mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
Merge branch 'main' into feat/make-DATE_AFTER-the-default-time-operator
This commit is contained in:
commit
d9d1dbbebd
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "unleash-frontend",
|
||||
"description": "unleash your features",
|
||||
"version": "4.9.0-beta.2",
|
||||
"version": "4.9.0-beta.3",
|
||||
"keywords": [
|
||||
"unleash",
|
||||
"feature toggle",
|
||||
|
@ -5,6 +5,10 @@ import { CANCEL } from '../ConstraintAccordionEdit';
|
||||
import { ConstraintFormHeader } from './ConstraintFormHeader/ConstraintFormHeader';
|
||||
import { useStyles } from './ConstraintAccordionEditBody.styles';
|
||||
import React from 'react';
|
||||
import { Alert } from '@material-ui/lab';
|
||||
import { newOperators } from 'constants/operators';
|
||||
import ConditionallyRender from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||
import { oneOf } from 'utils/one-of';
|
||||
|
||||
interface IConstraintAccordionBody {
|
||||
localConstraint: IConstraint;
|
||||
@ -31,6 +35,16 @@ export const ConstraintAccordionEditBody: React.FC<
|
||||
|
||||
return (
|
||||
<>
|
||||
<ConditionallyRender
|
||||
condition={oneOf(newOperators, localConstraint.operator)}
|
||||
show={
|
||||
<Alert severity="warning">
|
||||
In order to use this constraint operator, you need to
|
||||
update your SDK to the latest version.
|
||||
</Alert>
|
||||
}
|
||||
/>
|
||||
|
||||
<div className={styles.inputContainer}>
|
||||
<InvertedOperator
|
||||
inverted={Boolean(localConstraint.inverted)}
|
||||
|
@ -75,3 +75,9 @@ export const multipleValueOperators: Operator[] = [
|
||||
...stringOperators,
|
||||
...inOperators,
|
||||
];
|
||||
|
||||
export const newOperators: Operator[] = [
|
||||
...stringOperators,
|
||||
...dateOperators,
|
||||
...singleValueOperators,
|
||||
];
|
||||
|
@ -109,9 +109,10 @@ const filterFeatureByRegExp = (
|
||||
}
|
||||
|
||||
return feature.strategies.some(
|
||||
s =>
|
||||
regExp.test(s.name) ||
|
||||
// @ts-expect-error
|
||||
s.constraints.some(c => c.values.some(v => regExp.test(v)))
|
||||
strategy =>
|
||||
regExp.test(strategy.name) ||
|
||||
strategy.constraints.some(constraint =>
|
||||
constraint.values?.some(value => regExp.test(value))
|
||||
)
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user