Make filters work on export csv action (#8389)

- Create a new component state `contextStoreFiltersComponentState` and
refactor `contextStoreTargetedRecordsRuleComponentState`
- Refactor `computeContextStoreFilters` to use filters when no records
are selected
This commit is contained in:
Raphaël Bosi
2024-11-08 15:38:45 +01:00
committed by GitHub
parent d44f7a46b6
commit 5a53ef1ade
9 changed files with 78 additions and 28 deletions

View File

@ -0,0 +1,11 @@
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
import { Filter } from '@/object-record/object-filter-dropdown/types/Filter';
import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2';
export const contextStoreFiltersComponentState = createComponentStateV2<
Filter[]
>({
key: 'contextStoreFiltersComponentState',
defaultValue: [],
componentInstanceContext: ContextStoreComponentInstanceContext,
});

View File

@ -1,5 +1,4 @@
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
import { Filter } from '@/object-record/object-filter-dropdown/types/Filter';
import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2';
type ContextStoreTargetedRecordsRuleSelectionMode = {
@ -10,7 +9,6 @@ type ContextStoreTargetedRecordsRuleSelectionMode = {
type ContextStoreTargetedRecordsRuleExclusionMode = {
mode: 'exclusion';
excludedRecordIds: string[];
filters: Filter[];
};
export type ContextStoreTargetedRecordsRule =