Store compact view status (#3850)

* Store compact view status

* Rename to isCompact

* Fixes

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Thomas Trompette
2024-02-08 16:33:52 +01:00
committed by GitHub
parent 6ee179442a
commit 719da29795
16 changed files with 110 additions and 7 deletions

View File

@ -42,6 +42,7 @@ export const getViewScopedStateValuesFromSnapshot = ({
onViewFiltersChangeState,
onViewSortsChangeState,
onViewTypeChangeState,
onViewCompactModeChangeState,
savedViewFieldsByKeySelector,
savedViewFieldsState,
savedViewFiltersByKeySelector,
@ -87,6 +88,10 @@ export const getViewScopedStateValuesFromSnapshot = ({
onViewFiltersChange: getSnapshotValue(snapshot, onViewFiltersChangeState),
onViewSortsChange: getSnapshotValue(snapshot, onViewSortsChangeState),
onViewTypeChange: getSnapshotValue(snapshot, onViewTypeChangeState),
onViewCompactModeChange: getSnapshotValue(
snapshot,
onViewCompactModeChangeState,
),
savedViewFieldsByKey: getSnapshotValue(
snapshot,
savedViewFieldsByKeySelector,

View File

@ -3,6 +3,7 @@ import { getScopedSelectorDeprecated } from '@/ui/utilities/recoil-scope/utils/g
import { getScopedStateDeprecated } from '@/ui/utilities/recoil-scope/utils/getScopedStateDeprecated';
import { currentViewIdScopedState } from '@/views/states/currentViewIdScopedState';
import { isPersistingViewScopedState } from '@/views/states/isPersistingViewScopedState';
import { onViewCompactModeChangeScopeState } from '@/views/states/onViewCompactModeChangeScopeState';
import { onViewTypeChangeScopedState } from '@/views/states/onViewTypeChangeScopedState';
import { currentViewScopedSelector } from '@/views/states/selectors/currentViewScopedSelector';
@ -170,6 +171,11 @@ export const getViewScopedStates = ({
viewScopeId,
);
const onViewCompactModeChangeState = getScopedStateDeprecated(
onViewCompactModeChangeScopeState,
viewScopeId,
);
const currentViewIdState = getScopedStateDeprecated(
currentViewIdScopedState,
viewScopeId,
@ -214,5 +220,6 @@ export const getViewScopedStates = ({
onViewFiltersChangeState,
onViewFieldsChangeState,
onViewTypeChangeState,
onViewCompactModeChangeState,
};
};