Clean record filter and record sort (#10466)
This PR removes what's left from record filter and record sort previous logic to handle CRUD and state management with view. So everything that is named combinedFilter and combinedSort is removed here. We implement currentRecordFilters and currentRecordSorts everywhere. We also remove the event in a state onSortSelectComponentState. (a pattern we want to avoid)
This commit is contained in:
@ -1,28 +0,0 @@
|
||||
import { createComponentFamilySelectorV2 } from '@/ui/utilities/state/component-state/utils/createComponentFamilySelectorV2';
|
||||
import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';
|
||||
import { unsavedToDeleteViewSortIdsComponentFamilyState } from '@/views/states/unsavedToDeleteViewSortIdsComponentFamilyState';
|
||||
import { unsavedToUpsertViewSortsComponentFamilyState } from '@/views/states/unsavedToUpsertViewSortsComponentFamilyState';
|
||||
|
||||
export const areViewSortsDifferentFromRecordSortsSelector =
|
||||
createComponentFamilySelectorV2<boolean, { viewId?: string }>({
|
||||
key: 'areViewSortsDifferentFromRecordSortsSelector',
|
||||
get:
|
||||
({ familyKey, instanceId }) =>
|
||||
({ get }) => {
|
||||
return (
|
||||
get(
|
||||
unsavedToUpsertViewSortsComponentFamilyState.atomFamily({
|
||||
familyKey,
|
||||
instanceId,
|
||||
}),
|
||||
).length > 0 ||
|
||||
get(
|
||||
unsavedToDeleteViewSortIdsComponentFamilyState.atomFamily({
|
||||
familyKey,
|
||||
instanceId,
|
||||
}),
|
||||
).length > 0
|
||||
);
|
||||
},
|
||||
componentInstanceContext: ViewComponentInstanceContext,
|
||||
});
|
||||
@ -1,9 +0,0 @@
|
||||
import { createComponentFamilyStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentFamilyStateV2';
|
||||
import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';
|
||||
|
||||
export const unsavedToDeleteViewFilterIdsComponentFamilyState =
|
||||
createComponentFamilyStateV2<string[], { viewId?: string }>({
|
||||
key: 'unsavedToDeleteViewFilterIdsComponentFamilyState',
|
||||
defaultValue: [],
|
||||
componentInstanceContext: ViewComponentInstanceContext,
|
||||
});
|
||||
@ -1,9 +0,0 @@
|
||||
import { createComponentFamilyStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentFamilyStateV2';
|
||||
import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';
|
||||
|
||||
export const unsavedToDeleteViewSortIdsComponentFamilyState =
|
||||
createComponentFamilyStateV2<string[], { viewId?: string }>({
|
||||
key: 'unsavedToDeleteViewSortIdsComponentFamilyState',
|
||||
defaultValue: [],
|
||||
componentInstanceContext: ViewComponentInstanceContext,
|
||||
});
|
||||
@ -1,10 +0,0 @@
|
||||
import { createComponentFamilyStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentFamilyStateV2';
|
||||
import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';
|
||||
import { ViewFilter } from '@/views/types/ViewFilter';
|
||||
|
||||
export const unsavedToUpsertViewFiltersComponentFamilyState =
|
||||
createComponentFamilyStateV2<ViewFilter[], { viewId?: string }>({
|
||||
key: 'unsavedToUpsertViewFiltersComponentFamilyState',
|
||||
defaultValue: [],
|
||||
componentInstanceContext: ViewComponentInstanceContext,
|
||||
});
|
||||
@ -1,10 +0,0 @@
|
||||
import { createComponentFamilyStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentFamilyStateV2';
|
||||
import { ViewComponentInstanceContext } from '@/views/states/contexts/ViewComponentInstanceContext';
|
||||
import { ViewSort } from '../types/ViewSort';
|
||||
|
||||
export const unsavedToUpsertViewSortsComponentFamilyState =
|
||||
createComponentFamilyStateV2<ViewSort[], { viewId?: string }>({
|
||||
key: 'unsavedToUpsertViewSortsComponentFamilyState',
|
||||
defaultValue: [],
|
||||
componentInstanceContext: ViewComponentInstanceContext,
|
||||
});
|
||||
Reference in New Issue
Block a user