diff --git a/src/atoms/projectScope/user.ts b/src/atoms/projectScope/user.ts index e6337df7..5c03281e 100644 --- a/src/atoms/projectScope/user.ts +++ b/src/atoms/projectScope/user.ts @@ -33,7 +33,6 @@ export const themeOverriddenAtom = atomWithStorage( /** User's default table settings (affecting saving and popup behavior) */ export const defaultTableSettingsAtom = atom((get) => { const userSettings = get(userSettingsAtom); - console.log("defaultTableSettings", userSettings.defaultTableSettings); return userSettings.defaultTableSettings; }); diff --git a/src/components/Settings/UserSettings/TableSettings.tsx b/src/components/Settings/UserSettings/TableSettings.tsx index b2b441da..6c4bfcb9 100644 --- a/src/components/Settings/UserSettings/TableSettings.tsx +++ b/src/components/Settings/UserSettings/TableSettings.tsx @@ -20,12 +20,12 @@ export default function TableSettings({ control={ { updateSettings({ defaultTableSettings: merge(settings.defaultTableSettings, { - saveSortingPopupDisabled: e.target.checked, + saveSortsPopupDisabled: e.target.checked, }), }); }} @@ -34,17 +34,17 @@ export default function TableSettings({ label="Disable popup - to save sorting changes to the team" style={{ marginLeft: -11, marginBottom: 13 }} /> - + { updateSettings({ defaultTableSettings: merge(settings.defaultTableSettings, { - automaticallyApplySorting: e.target.checked, + automaticallyApplySorts: e.target.checked, }), }); }} @@ -61,12 +61,12 @@ export default function TableSettings({ control={ { updateSettings({ defaultTableSettings: merge(settings.defaultTableSettings, { - saveColumnWidthPopupDisabled: e.target.checked, + saveColumnSizingPopupDisabled: e.target.checked, }), }); }} @@ -76,18 +76,18 @@ export default function TableSettings({ style={{ marginLeft: -11, marginTop: 13 }} /> { updateSettings({ defaultTableSettings: merge(settings.defaultTableSettings, { - automaticallyApplyColumnWidth: e.target.checked, + automaticallyApplyColumnSizing: e.target.checked, }), }); }} diff --git a/src/components/Table/ColumnHeader/useSaveTableSorts.tsx b/src/components/Table/ColumnHeader/useSaveTableSorts.tsx index 0d6e8821..3c8c9980 100644 --- a/src/components/Table/ColumnHeader/useSaveTableSorts.tsx +++ b/src/components/Table/ColumnHeader/useSaveTableSorts.tsx @@ -42,9 +42,9 @@ function useSaveTableSorts(canEditColumns: boolean) { } if (!canEditColumns) return; // If the user has disabled the popup, return early - if (defaultTableSettings?.saveSortingPopupDisabled) { - // If the user has `automaticallyApplySorting` set to true, apply the sorting before returning - if (defaultTableSettings?.automaticallyApplySorting) { + if (defaultTableSettings?.saveSortsPopupDisabled) { + // If the user has `automaticallyApplySorts` set to true, apply the sorting before returning + if (defaultTableSettings?.automaticallyApplySorts) { const updateTable = async () => await updateTableSchema({ sorts }); updateTable(); } diff --git a/src/components/Table/useSaveColumnSizing.tsx b/src/components/Table/useSaveColumnSizing.tsx index bae45118..68ec4668 100644 --- a/src/components/Table/useSaveColumnSizing.tsx +++ b/src/components/Table/useSaveColumnSizing.tsx @@ -43,9 +43,9 @@ export function useSaveColumnSizing( useEffect(() => { if (!canEditColumns || isEmpty(debouncedColumnSizing)) return; // If the user has disabled the popup, return early - if (defaultTableSettings?.saveColumnWidthPopupDisabled) { - // If the user has `automaticallyApplyColumnWidth` set to true, apply the column width before returning - if (defaultTableSettings?.automaticallyApplyColumnWidth) { + if (defaultTableSettings?.saveColumnSizingPopupDisabled) { + // If the user has `automaticallyApplyColumnSizing` set to true, apply the column width before returning + if (defaultTableSettings?.automaticallyApplyColumnSizing) { const updateTable = async () => { for (const [key, value] of Object.entries(debouncedColumnSizing)) { await updateColumn({ key, config: { width: value } }); diff --git a/src/types/settings.d.ts b/src/types/settings.d.ts index 1f9bee10..0c5321d1 100644 --- a/src/types/settings.d.ts +++ b/src/types/settings.d.ts @@ -52,10 +52,10 @@ export type UserSettings = Partial<{ favoriteTables: string[]; /** Stores default user settings for all tables */ defaultTableSettings: Partial<{ - saveSortingPopupDisabled: boolean; - automaticallyApplySorting: boolean; - saveColumnWidthPopupDisabled: boolean; - automaticallyApplyColumnWidth: boolean; + saveSortsPopupDisabled: boolean; + automaticallyApplySorts: boolean; + saveColumnSizingPopupDisabled: boolean; + automaticallyApplyColumnSizing: boolean; }>; /** Stores table-specific user overrides */ tables: Record<