From 4b0d2e512272069c397a7bea80bb6db419cfc932 Mon Sep 17 00:00:00 2001 From: tsv2013 Date: Tue, 16 Jan 2024 15:00:37 +0300 Subject: [PATCH] Fixed https://github.com/surveyjs/survey-library/issues/7670 - The headerView property should be saved in theme JSON --- .vscode/settings.json | 3 +-- packages/survey-creator-core/.vscode/settings.json | 3 +-- .../src/components/tabs/theme-builder.ts | 1 + .../survey-creator-core/tests/tabs/theme-builder.tests.ts | 7 +++++++ packages/survey-creator-knockout/.vscode/settings.json | 3 +-- packages/survey-creator-react/.vscode/settings.json | 3 +-- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e9dd910207..b4905e6568 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,8 +5,7 @@ }, "[typescript]": { "editor.codeActionsOnSave": { - "source.fixAll": true, - //"source.organizeImports": true, // be vare of https://github.com/microsoft/vscode-typescript-tslint-plugin/issues/51 + "source.fixAll": "explicit" }, "editor.defaultFormatter": "vscode.typescript-language-features" }, diff --git a/packages/survey-creator-core/.vscode/settings.json b/packages/survey-creator-core/.vscode/settings.json index bb9b80811d..43469713c3 100644 --- a/packages/survey-creator-core/.vscode/settings.json +++ b/packages/survey-creator-core/.vscode/settings.json @@ -5,8 +5,7 @@ }, "[typescript]": { "editor.codeActionsOnSave": { - "source.fixAll": true, - //"source.organizeImports": true, // be vare of https://github.com/microsoft/vscode-typescript-tslint-plugin/issues/51 + "source.fixAll": "explicit" } }, // "typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, diff --git a/packages/survey-creator-core/src/components/tabs/theme-builder.ts b/packages/survey-creator-core/src/components/tabs/theme-builder.ts index dd08e9ee4a..b7be7b7989 100644 --- a/packages/survey-creator-core/src/components/tabs/theme-builder.ts +++ b/packages/survey-creator-core/src/components/tabs/theme-builder.ts @@ -577,6 +577,7 @@ export class ThemeBuilder extends Base { fontsettingsToCssVariable(options.question.panels[0].getElementByName("headerTitle"), this.themeCssVariablesChanges); fontsettingsToCssVariable(options.question.panels[0].getElementByName("headerDescription"), this.themeCssVariablesChanges); } + this.currentTheme.headerView = headerSettings["headerView"]; this.themeModified(options); } private shadowInnerPropertiesChanged(options: ValueChangedEvent) { diff --git a/packages/survey-creator-core/tests/tabs/theme-builder.tests.ts b/packages/survey-creator-core/tests/tabs/theme-builder.tests.ts index ddab456d34..13173f42d0 100644 --- a/packages/survey-creator-core/tests/tabs/theme-builder.tests.ts +++ b/packages/survey-creator-core/tests/tabs/theme-builder.tests.ts @@ -1173,6 +1173,13 @@ test("Theme onModified and saveThemeFunc", (): any => { expect(saveThemeCount).toBe(4); expect(creator.hasPendingThemeChanges).toBeFalsy(); expect(themePlugin.isModified).toBeTruthy(); + + themeEditor.getQuestionByName("headerViewContainer").value = [{ headerView: "advanced" }]; + expect(modificationsLog).toBe("->THEME_MODIFIED->THEME_SELECTED->THEME_MODIFIED->THEME_MODIFIED->THEME_MODIFIED"); + expect(saveCount).toBe(1); + expect(saveThemeCount).toBe(5); + expect(creator.hasPendingThemeChanges).toBeFalsy(); + expect(themePlugin.isModified).toBeTruthy(); }); test("Theme undo redo changes", (): any => { diff --git a/packages/survey-creator-knockout/.vscode/settings.json b/packages/survey-creator-knockout/.vscode/settings.json index bb9b80811d..43469713c3 100644 --- a/packages/survey-creator-knockout/.vscode/settings.json +++ b/packages/survey-creator-knockout/.vscode/settings.json @@ -5,8 +5,7 @@ }, "[typescript]": { "editor.codeActionsOnSave": { - "source.fixAll": true, - //"source.organizeImports": true, // be vare of https://github.com/microsoft/vscode-typescript-tslint-plugin/issues/51 + "source.fixAll": "explicit" } }, // "typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, diff --git a/packages/survey-creator-react/.vscode/settings.json b/packages/survey-creator-react/.vscode/settings.json index bb9b80811d..43469713c3 100644 --- a/packages/survey-creator-react/.vscode/settings.json +++ b/packages/survey-creator-react/.vscode/settings.json @@ -5,8 +5,7 @@ }, "[typescript]": { "editor.codeActionsOnSave": { - "source.fixAll": true, - //"source.organizeImports": true, // be vare of https://github.com/microsoft/vscode-typescript-tslint-plugin/issues/51 + "source.fixAll": "explicit" } }, // "typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,