mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-01 13:47:27 +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 {
|
||||
onAddValues: (newValues: Set<string>) => void;
|
||||
onAddValues: (newValues: string[]) => void;
|
||||
helpText?: string;
|
||||
validator: (...values: string[]) => ConstraintValidatorOutput;
|
||||
}
|
||||
|
@ -84,6 +84,7 @@ export const EditableConstraintWrapper = ({
|
||||
) {
|
||||
return cleanConstraint({
|
||||
...state,
|
||||
contextName: action.payload,
|
||||
operator: DATE_AFTER,
|
||||
values: new Set(),
|
||||
value: new Date().toISOString(),
|
||||
@ -95,8 +96,8 @@ export const EditableConstraintWrapper = ({
|
||||
return cleanConstraint({
|
||||
...state,
|
||||
operator: IN,
|
||||
contextName: action.payload,
|
||||
values: new Set(),
|
||||
|
||||
value: '',
|
||||
});
|
||||
}
|
||||
@ -109,11 +110,20 @@ export const EditableConstraintWrapper = ({
|
||||
value: '',
|
||||
});
|
||||
case 'set operator':
|
||||
if (
|
||||
dateOperators.includes(state.operator) &&
|
||||
dateOperators.includes(action.payload)
|
||||
) {
|
||||
return cleanConstraint({
|
||||
...state,
|
||||
operator: action.payload,
|
||||
value: state.value,
|
||||
});
|
||||
}
|
||||
return cleanConstraint({
|
||||
...state,
|
||||
operator: action.payload,
|
||||
values: new Set(),
|
||||
|
||||
value: '',
|
||||
});
|
||||
case 'add value(s)': {
|
||||
|
Loading…
Reference in New Issue
Block a user