Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
5d82eb7
#7381 Presets: top bar navigation
novikov82 Jan 16, 2026
6f2903c
Presets: top bar navigation
novikov82 Jan 16, 2026
4cf33fa
#7381 - update tests
novikov82 Jan 18, 2026
0d4b8de
#7381 update tests
novikov82 Jan 19, 2026
7ceaf16
#7381 - fixed dialog
novikov82 Jan 19, 2026
eb6d658
#7381 - update screenshots
novikov82 Jan 19, 2026
385d375
Merge remote-tracking branch 'origin/master' into issue/7381-Presets-…
novikov82 Jan 19, 2026
2e4c121
Presets: custom presets edit
novikov82 Jan 19, 2026
27f2c11
Presets: custom presets edit
novikov82 Jan 19, 2026
bd0d4fe
#7385
novikov82 Jan 20, 2026
3134e90
Merge remote-tracking branch 'origin/master' into issue/7381-Presets-…
novikov82 Jan 20, 2026
5910767
#7381 - update screenshot
novikov82 Jan 20, 2026
a035525
#7385 - save as dialog
novikov82 Jan 20, 2026
e4f0306
#7381 - keep menu title
novikov82 Jan 20, 2026
d0c1314
Presets: custom presets edit
novikov82 Jan 20, 2026
ae297ed
#7381 - increase timeout
novikov82 Jan 20, 2026
da21c0b
Merge branch 'issue/7381-Presets-top-bar-navigation' into issue/7385-…
novikov82 Jan 20, 2026
e2c22c4
#7385
novikov82 Jan 20, 2026
7d7bf1c
#7385
novikov82 Jan 21, 2026
81f42a1
#7385
novikov82 Jan 21, 2026
8bd38c6
Merge remote-tracking branch 'origin/master' into issue/7385-Presets-…
novikov82 Jan 21, 2026
71bb5c6
#7385 - extract PresetsManager
novikov82 Jan 21, 2026
43f2524
fix reference
novikov82 Jan 22, 2026
e48390b
#7385 - fixed imports
novikov82 Jan 22, 2026
a800b5c
Presets: custom presets edit
novikov82 Jan 22, 2026
8fa6420
Presets: custom presets edit
novikov82 Jan 23, 2026
2ac5059
#7385 - fix enable/disable save item
novikov82 Jan 23, 2026
38175ef
#7385 - presets management inside creator
novikov82 Jan 23, 2026
bdedb35
Presets: custom presets edit
novikov82 Jan 26, 2026
a500964
popup width #7385
novikov82 Jan 26, 2026
3f75554
#7385 - popup css
novikov82 Jan 26, 2026
ac9c526
#7385 - save status
novikov82 Jan 26, 2026
1293673
#7385 - saving and confirmations
novikov82 Jan 27, 2026
9e06f6c
#7385 - scrolling
novikov82 Jan 29, 2026
f4a32cf
#7385 - add scroll
novikov82 Jan 29, 2026
c5e0d50
#7385 - hide dropdown popup on blur
novikov82 Jan 29, 2026
6fdcdf2
#7385 - change methods signature
novikov82 Jan 29, 2026
4887863
#7385 - fix initial property grid state
novikov82 Jan 29, 2026
14e224b
#7385 - fixed unit tests
novikov82 Jan 29, 2026
448bf07
#7385 - unit tests for presets manager
novikov82 Jan 30, 2026
a36d782
#7385 - screenshot tests
novikov82 Jan 30, 2026
23a9d72
#7385 - screenshot tests
novikov82 Feb 2, 2026
fee42dd
#7385 - add f-tests
novikov82 Feb 2, 2026
9974f55
#7385 - fix preset list dialog styles
novikov82 Feb 3, 2026
a48203c
#7385 - fixed tests
novikov82 Feb 3, 2026
6ba47c4
#7385 - remove labels from presets menu
novikov82 Feb 3, 2026
17b84e1
Merge branch 'master' into issue/7385-Presets--custom-presets-edit
novikov82 Feb 3, 2026
9873574
#7385 - fix icon color
novikov82 Feb 4, 2026
a517b3b
#7385 - update screenshots
novikov82 Feb 4, 2026
684cf92
#7385 - update legacy screenshots
novikov82 Feb 4, 2026
bc6e651
#7385 - update f-tests
novikov82 Feb 4, 2026
6bc7734
#7385 - fix property grid category reset
novikov82 Feb 4, 2026
25e7d4a
#7385 - update screenshot tests
novikov82 Feb 5, 2026
d7a6358
#7402 fix angular and vue examples
novikov82 Feb 5, 2026
71502a7
#7385 - fix tests texts
novikov82 Feb 5, 2026
4e0e631
#7385 - update legacy screenshot
novikov82 Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 54 additions & 5 deletions e2e/presets.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { urlPresets, test, expect, showPresets, doDragDrop } from "./helper";
import { urlPresets, test, expect, showPresets, doDragDrop, showCreatorSettings } from "./helper";

const title = "Presets";
async function getRowsInputValues(matrix: any) {
Expand All @@ -7,17 +7,27 @@ async function getRowsInputValues(matrix: any) {
);
return values;
}

async function getTextsBySelector(selector: string, page: any) {
return (await page.locator(selector).filter({ visible: true }).allTextContents()).map(t => t.trim());
}
async function getTabsTexts(page: any) {
return (await page.locator(".svc-tabbed-menu-item").filter({ visible: true }).allTextContents()).map(t => t.trim());
return await getTextsBySelector(".svc-tabbed-menu-item", page);
}

async function getToolboxTexts(page: any) {
return (await page.locator(".svc-toolbox__item-title").filter({ visible: true }).allTextContents()).map(t => t.trim());
return await getTextsBySelector(".svc-toolbox__item-title", page);
}

async function getPropertiesTexts(page: any) {
return (await page.locator(".spg-checkbox__caption .sv-string-viewer, .spg-question__title .sv-string-viewer").filter({ visible: true }).allTextContents()).map(t => t.trim());
return await getTextsBySelector(".spg-checkbox__caption .sv-string-viewer, .spg-question__title .sv-string-viewer", page);
}

async function getMenuTexts(page: any) {
return await getTextsBySelector(".sps-list__item:not(.sps-list__item--disabled)", page);
}

async function getDropdownTexts(page: any) {
return await getTextsBySelector(".svc-list__item", page);
}

test.describe(title, () => {
Expand Down Expand Up @@ -414,4 +424,43 @@ test.describe(title, () => {
expect(await getPropertiesTexts(page)).toEqual(["Pages"]);
});

test("Hide default preset", async ({ page }) => {
await page.locator(".sps-navigation-bar-item").filter({ hasText: "Expert" }).click();
expect(await getMenuTexts(page)).toEqual(["Basic", "Advanced", "Expert", "Edit Presets list..."]);
await page.locator(".sps-list__container").filter({ visible: true }).getByText("Edit presets list...").click();
await page.locator(".spg-action-button").nth(1).click();

await page.getByRole("button", { name: "Save" }).click();

await page.locator(".sps-navigation-bar-item").filter({ hasText: "Expert" }).click();
expect(await getMenuTexts(page)).toEqual(["Basic", "Expert", "Edit Presets list..."]);
await page.locator(".sps-navigation-bar-item").filter({ hasText: "Quit" }).click();

await showCreatorSettings(page);
await page.getByText("Expert").click();

expect(await getDropdownTexts(page)).toEqual(["Basic", "Expert"]);
});

test("Add custom preset", async ({ page }) => {
await page.locator(".sps-navigation-bar-item").filter({ hasText: "Expert" }).click();
expect(await getMenuTexts(page)).toEqual(["Basic", "Advanced", "Expert", "Edit Presets list..."]);
await page.locator(".sps-list__container").filter({ visible: true }).getByText("Edit presets list...").click();
await page.getByText("Add new preset...").click();
await page.getByRole("textbox", { name: "presetName" }).fill("MyPreset");
await page.getByRole("button", { name: "Add" }).nth(1).click();
const items = page.locator(".sv-popup__container table").nth(0);
expect(await getRowsInputValues(items)).toEqual(["Basic", "Advanced", "Expert", "MyPreset"]);
await page.getByRole("button", { name: "Save" }).click();

await page.locator(".sps-navigation-bar-item").filter({ hasText: "Expert" }).click();
expect(await getMenuTexts(page)).toEqual(["Basic", "Advanced", "Expert", "MyPreset", "Edit Presets list..."]);
await page.locator(".sps-navigation-bar-item").filter({ hasText: "Quit" }).click();

await showCreatorSettings(page);
await page.getByText("Expert").click();

expect(await getDropdownTexts(page)).toEqual(["Basic", "Advanced", "Expert", "MyPreset"]);
});

});
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component, NgZone, OnInit, ViewEncapsulation } from "@angular/core";
import { SurveyCreatorModel } from "survey-creator-core";
import * as SurveyCreatorCore from "survey-creator-core";
import * as SurveyCreatorUIPreset from "survey-creator-core/ui-presets";
import * as Survey from "survey-core";
import SurveyThemes from "survey-core/themes";
import SurveyCreatorTestTheme from "survey-creator-core/themes/test";
Expand Down Expand Up @@ -37,6 +38,7 @@ export class TestDefaultComponent implements OnInit {
(<any>window).creator = this.creator;
(<any>window).Survey = Survey;
(<any>window).SurveyCreatorCore = SurveyCreatorCore;
(<any>window).SurveyCreatorUIPreset = SurveyCreatorUIPreset;
}
protected getSlk(): boolean { return true; }
protected createCreator(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
</ng-template>
</div>
<div class="svc-tab-designer svc-tab-designer--presets">
<sv-action-bar [model]="navigationBar" [handleClick]="false"></sv-action-bar>
<ng-template [component]="{ name: 'survey', data: {model: survey} }">
</ng-template>
<sv-scroll>
<sv-action-bar [model]="navigationBar" [handleClick]="false"></sv-action-bar>
<ng-template [component]="{ name: 'survey', data: {model: survey} }">
</ng-template>
</sv-scroll>
</div>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class TabDesignerPlugin implements ICreatorPlugin {
const presetPropertyGridViewModel = this.createSettingsPropertyGridViewModel("preset", creatorPresetsModelPropertyGridDefinition, creator);
presetPropertyGridViewModel.onNewSurveyCreatedCallback = (survey) => {
const presetChooser = survey.getQuestionByName("presetName") as QuestionDropdownModel;
if (!!presetChooser) {
if (!!presetChooser && presetChooser.choices.length === 0) {
presetChooser.choices = PredefinedCreatorPresets.map(preset => ({ value: preset, text: getLocString("preset.names." + preset) }));
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,13 @@ export const enStrings = {
presetsTab: "Presets",
creatorPresets: "Creator Presets",
save: "Save",
add: "Add",
discard: "Discard",
saveAs: "Save as...",
saveAsTitle: "Save current preset as...",
quit: "Quit",
quitConfirmation: "Exit to Survey Creator? You will loose all unsaved changes",
quitConfirmationOk: "Exit",
file: "File",
import: "Import",
export: "Export",
Expand All @@ -210,11 +216,20 @@ export const enStrings = {
resetConfirmation: "Do you really want to reset the settings?",
resetConfirmationOk: "Yes, reset the settings",

saved: "Saved",
unsaved: "Unsaved changes",

resetToDefaults: "Reset {0}",
defaultSettings: "Default Settings",
basic: "Basic",
advanced: "Advanced",
expert: "Expert",
editPresetsList: "Edit Presets list...",
editPresetsListTitle: "Edit Presets list",
addNewPreset: "Add new preset...",
addNewPresetTitle: "Add new preset",
confirmDeleteCustomPreset: "Delete preset? You will not be able to restore it",
savedPresets: "Saved presets",
license: "<a href='https://surveyjs.io/' target='_blank'>UI Preset Editor</a> is available only with a PRO license. To use it in your application, please <a href='https://surveyjs.io/manage#renewals-and-upgrades' target='_blank'>upgrade your license</a>.",
license2: "Your maintenance subscription expired on {date}. You may continue using all <a href='https://surveyjs.io/stay-updated/release-notes' target='_blank'>versions released up to that date</a>. To remove this banner in the latest version, please <a href='https://surveyjs.io/manage#license-manager' target='_blank'>renew your subscription</a> and <a href='https://surveyjs.io/remove-alert-banner' target='_blank'>set up a new license key</a>. Please note <a href='https://surveyjs.io/' target='_blank'>UI Preset Editor</a> is available to all users with an active PRO license.",
licenseCreator: "To use the Survey Creator plugin in your application, a <a href='https://surveyjs.io/licensing' target='_blank'>developer license</a> is required. If you have an active license, please <a href='https://surveyjs.io/remove-alert-banner' target='_blank'>set up your license key</a> and ensure you're using the <a href='https://surveyjs.io/stay-updated/release-notes' target='_blank'>latest version</a>. Please note <a href='https://surveyjs.io/' target='_blank'>UI Preset Editor</a> is included only in the PRO license tier.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ export class CreatorPresetEditablePropertyGrid extends CreatorPresetEditableCare
model.setValue(this.nameCategories, categories);
const items = this.getCurrentlyHiddenItems(categories);
model.setValue(this.nameMatrix, items);
this.propertyGridSetObj(this.currentProperties.getObj());
if (this.pageName == model.currentPage.name)this.propertyGridSetObj(this.currentProperties.getObj());
}
}
private getCurrentlyHiddenItems(categories: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export class CreatorPresetEditableToolboxConfigurator extends CreatorPresetEdita
};
}
private isCategoriesSame(categories: any, toolboxCategories: any): boolean {
if (categories.length !== toolboxCategories.length) return false;
if (categories.length !== toolboxCategories?.length) return false;
for (let i = 0; i < categories.length; i++) {
if (categories[i].category !== toolboxCategories[i].category) return false;
//if (categories[i].title !== toolboxCategories[i].title) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export class CreatorPresetEditorModel extends Base implements ICreatorPresetEdit
model.completeText = getLocString("presets.editor.completeText");
model.pagePrevText = getLocString("presets.editor.pagePrevText");
model.enterKeyAction = "loseFocus";
model.fitToContainer = false;

editablePresets.forEach(item => item.notifyCallback = (message: string) => this.notify(message));
if (!this.defaultJsonValue) {
Expand Down
Loading