fix(toolbar): sync SQL file tree visibility setting
Co-authored-by: zero <zero@zeroMacmini.local>
This commit is contained in:
1 parent
3161efe95f
commit
f41c7dd6a0
11 files changed
+35
-9
No files matched your search
@@ -70,6 +70,19 @@ describe("normalizeEditorSettings", () => {
|
||||
expect(normalizeEditorSettings({ dataGridSearchMode: "highlight" }).dataGridSearchMode).toBe("highlight");
|
||||
expect(normalizeEditorSettings({ dataGridSearchMode: "invalid" as any }).dataGridSearchMode).toBe("filter");
|
||||
});
|
||||
|
||||
it("normalizes toolbar item settings from older saved settings", () => {
|
||||
const settings = normalizeEditorSettings({
|
||||
toolbarItems: {
|
||||
sqlFileTree: false,
|
||||
history: false,
|
||||
} as any,
|
||||
});
|
||||
|
||||
expect(settings.toolbarItems.sqlFileTree).toBe(false);
|
||||
expect(settings.toolbarItems.history).toBe(false);
|
||||
expect(settings.toolbarItems.sqlLibrary).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("normalizeDesktopSettings", () => {
|
||||
|
||||
@@ -430,6 +430,7 @@ export interface ToolbarItems {
|
||||
dataCompare: boolean;
|
||||
checkUpdates: boolean;
|
||||
sqlLibrary: boolean;
|
||||
sqlFileTree: boolean;
|
||||
history: boolean;
|
||||
ai: boolean;
|
||||
theme: boolean;
|
||||
@@ -444,6 +445,7 @@ export const DEFAULT_TOOLBAR_ITEMS: ToolbarItems = {
|
||||
dataCompare: true,
|
||||
checkUpdates: true,
|
||||
sqlLibrary: true,
|
||||
sqlFileTree: true,
|
||||
history: true,
|
||||
ai: true,
|
||||
theme: true,
|
||||
@@ -676,6 +678,7 @@ function normalizeToolbarItems(items: Partial<ToolbarItems> | undefined): Toolba
|
||||
dataCompare: items.dataCompare ?? defaults.dataCompare,
|
||||
checkUpdates: items.checkUpdates ?? defaults.checkUpdates,
|
||||
sqlLibrary: items.sqlLibrary ?? defaults.sqlLibrary,
|
||||
sqlFileTree: items.sqlFileTree ?? defaults.sqlFileTree,
|
||||
history: items.history ?? defaults.history,
|
||||
ai: items.ai ?? defaults.ai,
|
||||
theme: items.theme ?? defaults.theme,
|
||||
|
||||
Reference in new issue
Block a user