Make filters and sorts work on record page pagination (#12460)
Fixes #7929 This PR implements a system to capture and preserve the filters and sorts when navigating from an index view to a record show page. This information is stored in a context store component state. This allows users to navigate between records inside the record page while maintaining context from the index view.
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
import { ContextStoreComponentInstanceContext } from '@/context-store/states/contexts/ContextStoreComponentInstanceContext';
|
||||
import { RecordFilterGroup } from '@/object-record/record-filter-group/types/RecordFilterGroup';
|
||||
import { RecordFilter } from '@/object-record/record-filter/types/RecordFilter';
|
||||
import { RecordSort } from '@/object-record/record-sort/types/RecordSort';
|
||||
import { createComponentStateV2 } from '@/ui/utilities/state/component-state/utils/createComponentStateV2';
|
||||
|
||||
type RecordShowParentViewComponentState = {
|
||||
parentViewComponentId: string;
|
||||
parentViewObjectNameSingular: string;
|
||||
parentViewFilterGroups: RecordFilterGroup[];
|
||||
parentViewFilters: RecordFilter[];
|
||||
parentViewSorts: RecordSort[];
|
||||
};
|
||||
|
||||
export const contextStoreRecordShowParentViewComponentState =
|
||||
createComponentStateV2<RecordShowParentViewComponentState | undefined | null>(
|
||||
{
|
||||
key: 'contextStoreRecordShowParentViewComponentState',
|
||||
defaultValue: undefined,
|
||||
componentInstanceContext: ContextStoreComponentInstanceContext,
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user