mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
fix: add warning to constraint accordion (#792)
This commit is contained in:
parent
f52ca03b55
commit
268d586b52
@ -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,
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user