Fixed record sort on kanban (#10515)
This PR fixes a leftover from the removal of combined filters and sorts. Board request hook was still relying on combinedViewSorts, here we just use currentRecordSorts instead and it works well.
This commit is contained in:
@ -11,10 +11,9 @@ import { computeViewRecordGqlOperationFilter } from '@/object-record/record-filt
|
|||||||
import { recordGroupDefinitionFamilyState } from '@/object-record/record-group/states/recordGroupDefinitionFamilyState';
|
import { recordGroupDefinitionFamilyState } from '@/object-record/record-group/states/recordGroupDefinitionFamilyState';
|
||||||
import { useRecordBoardRecordGqlFields } from '@/object-record/record-index/hooks/useRecordBoardRecordGqlFields';
|
import { useRecordBoardRecordGqlFields } from '@/object-record/record-index/hooks/useRecordBoardRecordGqlFields';
|
||||||
import { recordIndexViewFilterGroupsState } from '@/object-record/record-index/states/recordIndexViewFilterGroupsState';
|
import { recordIndexViewFilterGroupsState } from '@/object-record/record-index/states/recordIndexViewFilterGroupsState';
|
||||||
|
import { currentRecordSortsComponentState } from '@/object-record/record-sort/states/currentRecordSortsComponentState';
|
||||||
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
||||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||||
import { useGetCurrentView } from '@/views/hooks/useGetCurrentView';
|
|
||||||
import { mapViewSortsToSorts } from '@/views/utils/mapViewSortsToSorts';
|
|
||||||
import { isDefined } from 'twenty-shared';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
type UseLoadRecordIndexBoardProps = {
|
type UseLoadRecordIndexBoardProps = {
|
||||||
@ -43,15 +42,14 @@ export const useLoadRecordIndexBoardColumn = ({
|
|||||||
const recordIndexViewFilterGroups = useRecoilValue(
|
const recordIndexViewFilterGroups = useRecoilValue(
|
||||||
recordIndexViewFilterGroupsState,
|
recordIndexViewFilterGroupsState,
|
||||||
);
|
);
|
||||||
|
|
||||||
const currentRecordFilters = useRecoilComponentValueV2(
|
const currentRecordFilters = useRecoilComponentValueV2(
|
||||||
currentRecordFiltersComponentState,
|
currentRecordFiltersComponentState,
|
||||||
);
|
);
|
||||||
|
|
||||||
const { currentViewWithCombinedFiltersAndSorts } = useGetCurrentView();
|
const currentRecordSorts = useRecoilComponentValueV2(
|
||||||
|
currentRecordSortsComponentState,
|
||||||
const viewsorts = currentViewWithCombinedFiltersAndSorts?.viewSorts ?? [];
|
);
|
||||||
|
|
||||||
const sorts = mapViewSortsToSorts(viewsorts);
|
|
||||||
|
|
||||||
const { filterValueDependencies } = useFilterValueDependencies();
|
const { filterValueDependencies } = useFilterValueDependencies();
|
||||||
|
|
||||||
@ -62,7 +60,7 @@ export const useLoadRecordIndexBoardColumn = ({
|
|||||||
recordIndexViewFilterGroups,
|
recordIndexViewFilterGroups,
|
||||||
);
|
);
|
||||||
|
|
||||||
const orderBy = turnSortsIntoOrderBy(objectMetadataItem, sorts);
|
const orderBy = turnSortsIntoOrderBy(objectMetadataItem, currentRecordSorts);
|
||||||
|
|
||||||
const recordGqlFields = useRecordBoardRecordGqlFields({
|
const recordGqlFields = useRecordBoardRecordGqlFields({
|
||||||
objectMetadataItem,
|
objectMetadataItem,
|
||||||
|
|||||||
Reference in New Issue
Block a user