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:
Raphaël Bosi
2025-06-11 18:01:03 +02:00
committed by GitHub
parent 23cbeec227
commit 27d0a3766f
18 changed files with 296 additions and 195 deletions

View File

@ -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,
},
);