mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-05 17:53:12 +02:00
iron out some date bugs
This commit is contained in:
parent
275cac95c5
commit
c14bbe4955
@ -28,7 +28,7 @@ const AddValuesButton = styled('button')(({ theme }) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
interface AddValuesProps {
|
interface AddValuesProps {
|
||||||
onAddValues: (newValues: Set<string>) => void;
|
onAddValues: (newValues: string[]) => void;
|
||||||
helpText?: string;
|
helpText?: string;
|
||||||
validator: (...values: string[]) => ConstraintValidatorOutput;
|
validator: (...values: string[]) => ConstraintValidatorOutput;
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,7 @@ export const EditableConstraintWrapper = ({
|
|||||||
) {
|
) {
|
||||||
return cleanConstraint({
|
return cleanConstraint({
|
||||||
...state,
|
...state,
|
||||||
|
contextName: action.payload,
|
||||||
operator: DATE_AFTER,
|
operator: DATE_AFTER,
|
||||||
values: new Set(),
|
values: new Set(),
|
||||||
value: new Date().toISOString(),
|
value: new Date().toISOString(),
|
||||||
@ -95,8 +96,8 @@ export const EditableConstraintWrapper = ({
|
|||||||
return cleanConstraint({
|
return cleanConstraint({
|
||||||
...state,
|
...state,
|
||||||
operator: IN,
|
operator: IN,
|
||||||
|
contextName: action.payload,
|
||||||
values: new Set(),
|
values: new Set(),
|
||||||
|
|
||||||
value: '',
|
value: '',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -109,11 +110,20 @@ export const EditableConstraintWrapper = ({
|
|||||||
value: '',
|
value: '',
|
||||||
});
|
});
|
||||||
case 'set operator':
|
case 'set operator':
|
||||||
|
if (
|
||||||
|
dateOperators.includes(state.operator) &&
|
||||||
|
dateOperators.includes(action.payload)
|
||||||
|
) {
|
||||||
|
return cleanConstraint({
|
||||||
|
...state,
|
||||||
|
operator: action.payload,
|
||||||
|
value: state.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
return cleanConstraint({
|
return cleanConstraint({
|
||||||
...state,
|
...state,
|
||||||
operator: action.payload,
|
operator: action.payload,
|
||||||
values: new Set(),
|
values: new Set(),
|
||||||
|
|
||||||
value: '',
|
value: '',
|
||||||
});
|
});
|
||||||
case 'add value(s)': {
|
case 'add value(s)': {
|
||||||
|
Loading…
Reference in New Issue
Block a user