Solves issue #5917. This PR is now ready for the first review! Filters do not fully work yet, there's a problem applying multiple filters like the following: ``` { and: [ { [correspondingField.name]: { gte: start.toISOString(), } as DateFilter, }, { [correspondingField.name]: { lte: end.toISOString(), } as DateFilter, }, ], } ``` I'll do my best to dig into it tonight! --------- Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@ -9,6 +9,7 @@ import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
||||
import { HotkeyScope } from '@/ui/utilities/hotkey/types/HotkeyScope';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
import { EditableFilterChip } from '@/views/components/EditableFilterChip';
|
||||
import { ViewFilterOperand } from '@/views/types/ViewFilterOperand';
|
||||
|
||||
import { useDeleteCombinedViewFilters } from '@/views/hooks/useDeleteCombinedViewFilters';
|
||||
import { availableFilterDefinitionsComponentState } from '@/views/states/availableFilterDefinitionsComponentState';
|
||||
@ -74,7 +75,13 @@ export const EditableFilterDropdownButton = ({
|
||||
const { id: fieldId, value, operand } = viewFilter;
|
||||
if (
|
||||
!value &&
|
||||
![FilterOperand.IsEmpty, FilterOperand.IsNotEmpty].includes(operand)
|
||||
![
|
||||
FilterOperand.IsEmpty,
|
||||
FilterOperand.IsNotEmpty,
|
||||
ViewFilterOperand.IsInPast,
|
||||
ViewFilterOperand.IsInFuture,
|
||||
ViewFilterOperand.IsToday,
|
||||
].includes(operand)
|
||||
) {
|
||||
deleteCombinedViewFilter(fieldId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user