Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
251 commits
Select commit Hold shift + click to select a range
ce89890
#7004 - do not recreate creator
novikov82 Jul 3, 2025
47b5012
#7004 Presets: integrate presets into creator
novikov82 Jul 4, 2025
a8fd1e0
#7004 Presets: integrate presets into creator
novikov82 Jul 7, 2025
4627c18
work for #7004
novikov82 Jul 8, 2025
b8e6d0e
#7004 Presets: integrate presets into creator
novikov82 Jul 9, 2025
1a546e6
#7004 - fixing tabs
novikov82 Jul 9, 2025
64e5b2f
#7004 fix tabs presets
novikov82 Jul 10, 2025
68cbfa0
#7004 Presets: fixed active tab setting
novikov82 Jul 10, 2025
8ebc3fb
#7004 - fixed presets current page
novikov82 Jul 10, 2025
a35febe
#7004 - do not refresh plugin
novikov82 Jul 10, 2025
961351b
#7004 - fixed presets current page
novikov82 Jul 10, 2025
3a24121
preview property grid #7004
novikov82 Jul 11, 2025
6b4b45f
Merge branch 'master' into issue/7004-Presets-integrate-presets-into-…
novikov82 Jul 21, 2025
2412c90
#7004 - integration behaviour
novikov82 Jul 22, 2025
9d4c58b
7004 - preview languages
novikov82 Jul 23, 2025
2d94983
#7004 - plugin title
novikov82 Jul 23, 2025
18bccd6
#7004 hide expand button
novikov82 Jul 23, 2025
b57c389
#7004 - fixed toolbox category apply
novikov82 Jul 23, 2025
bd45a2f
#7004 - apply on the fly
novikov82 Jul 23, 2025
ab23eb7
#7004 fixed presets applying
novikov82 Jul 24, 2025
6a9cdc6
work for #7004
novikov82 Jul 24, 2025
6038315
test for toolbox reorder #7004
novikov82 Jul 24, 2025
0b4cdba
fixing tests #7004
novikov82 Jul 25, 2025
9a809bd
#7004 - tests
novikov82 Jul 25, 2025
2140fd4
#7004 - add tests for multiply appy
novikov82 Jul 27, 2025
1bceddb
fix locale test
novikov82 Jul 28, 2025
a6c3510
#7004 Presets: integrate presets into creator
novikov82 Jul 28, 2025
cffec85
#7004 - fixed multiple preset apply for tabs
novikov82 Jul 28, 2025
421ec05
fixed toolbox multiple apply #7004
novikov82 Jul 28, 2025
9110018
#7004 presets css
novikov82 Jul 28, 2025
df6ab76
#7004 - first preset styles
novikov82 Jul 29, 2025
884fb16
#7004 - fix preset reinit
novikov82 Jul 29, 2025
c6aa65e
#7004 add search to survey languages
novikov82 Jul 30, 2025
a811233
#7004 - search in checkboxes
novikov82 Jul 30, 2025
95da3c6
#7004 - navigation
novikov82 Jul 30, 2025
05364aa
#7004 - fix navigation
novikov82 Jul 30, 2025
f8ad732
#7004 - navigation panel styling
novikov82 Jul 31, 2025
ac04a84
#7004 import themes
novikov82 Aug 1, 2025
8e523c5
#7004 Presets: integrate presets into creator
novikov82 Aug 4, 2025
0cf1d9c
#7004 Presets: integrate presets into creator
novikov82 Aug 5, 2025
9fe2e3b
#7004 work for matrix theming
novikov82 Aug 8, 2025
7a9837a
#7004 Presets: integrate presets into creator
novikov82 Aug 11, 2025
34faebb
#7004 - styles
novikov82 Aug 11, 2025
1537411
#7004 fixed styles
novikov82 Aug 12, 2025
281b6dc
clean styles #7004
novikov82 Aug 12, 2025
453d41e
#7004 - remove unused classes
novikov82 Aug 12, 2025
82c7865
#7004 fixed appearance
novikov82 Aug 13, 2025
a145234
#7004 - fixed tests
novikov82 Aug 13, 2025
b52af23
Merge remote-tracking branch 'origin/HEAD' into issue/7004-Presets-in…
novikov82 Aug 13, 2025
ad39be1
#7004 - presets default page
novikov82 Aug 13, 2025
7ce9dd1
#7004 - fix scrolling
novikov82 Aug 13, 2025
60909ab
#7004 - boolean switch
novikov82 Aug 13, 2025
5e82f06
#7004 - fix paddings
novikov82 Aug 13, 2025
e5c3cf9
#7004 - toolbox no categories
novikov82 Aug 13, 2025
e0b1cad
#7004 fix no categories toolbox
novikov82 Aug 14, 2025
baef970
#7004 fix build
novikov82 Aug 14, 2025
2988628
#7004 container scrolling
novikov82 Aug 18, 2025
eee40e2
#7004 - work for Creator parts disabling
novikov82 Aug 18, 2025
9b68a54
#7004 - fix page titles and descriptions
novikov82 Aug 18, 2025
e6c0820
#7004 - fixed some styles
novikov82 Aug 18, 2025
f0aaafc
#7004 switches in navigation panel
novikov82 Aug 19, 2025
06de011
#7004 - fix button style
novikov82 Aug 19, 2025
42c9f62
#7004 - fix matrix expand-collapse
novikov82 Aug 19, 2025
06ebc3c
#7007 - launch presets from sidebar
novikov82 Aug 19, 2025
9a38e54
#7004 Add button in tables
novikov82 Aug 20, 2025
eb476a8
#7007 - fix table rows
novikov82 Aug 20, 2025
9fcfb71
#7004 fixed menu
novikov82 Aug 21, 2025
80e9d78
#7004 - popup styles
novikov82 Aug 21, 2025
0605bfd
#7004 fix styles in popup
novikov82 Aug 21, 2025
e600a2f
#7004 - popup actions
novikov82 Aug 22, 2025
0d86464
#7004 - refactoring
novikov82 Aug 22, 2025
dd1abdf
#7004 titles in dialogs
novikov82 Aug 22, 2025
fa59f2d
#7004 reset items and fix tests
novikov82 Aug 25, 2025
fc7e84e
#7004 - some code for reset enable/disable
novikov82 Aug 25, 2025
7701d69
#7004 - in popup reset
novikov82 Aug 25, 2025
12982f1
#7004 - fixed icons in property grid settings
novikov82 Aug 25, 2025
cdc618f
Merge remote-tracking branch 'origin/master' into issue/7004-Presets-…
novikov82 Aug 26, 2025
25088a1
#7004 disable creator parts
novikov82 Aug 26, 2025
cd816b6
Revert "#7004 - some code for reset enable/disable"
novikov82 Aug 26, 2025
f4497c7
#7004 - fix unit tests
novikov82 Aug 26, 2025
b6b56f8
#7004 do not switch tabs in edit mode
novikov82 Aug 26, 2025
e558fdf
#7004 - do not show preset tab in list
novikov82 Aug 26, 2025
f2daebe
#7004 - fixed dropdown styles
novikov82 Aug 26, 2025
60298a5
#7004 fix expanded category font
novikov82 Aug 27, 2025
4098f3f
#7004 - introduce subitems
novikov82 Aug 27, 2025
aa61124
#7004 - introduce reset enabling/disabling
novikov82 Aug 27, 2025
8220560
#7004 subitems apply
novikov82 Aug 28, 2025
a249372
#7004 revert isDefault column - need to rewrite
novikov82 Aug 28, 2025
3eae6a7
#7004 - fix inner matrix align
novikov82 Aug 28, 2025
49c8a14
#7004 - refactored
novikov82 Aug 28, 2025
88da03e
#7004 - repairing tests
novikov82 Aug 28, 2025
10d36d5
#7004 - work with defaults
novikov82 Aug 29, 2025
a022aa9
#7004 fix tabs settings when presets enabled
novikov82 Aug 29, 2025
975f780
#7004 - fix subitems styles
novikov82 Aug 29, 2025
f255e6d
#7004 tabs and toolbox defaults
novikov82 Sep 1, 2025
1d6bd53
#7004 - fixed disabled buttons styles
novikov82 Sep 1, 2025
c382209
#7004 - fix row icons
novikov82 Sep 1, 2025
65e912c
#7004 - fixed subitems defaults
novikov82 Sep 1, 2025
590e17e
fixed #7004 - fixed properties reset
novikov82 Sep 1, 2025
24d2d68
#7004 - in-dialog defaults
novikov82 Sep 1, 2025
e1779d7
#7004 fixed tests
novikov82 Sep 2, 2025
a4fe609
#7004 fix builds
novikov82 Sep 2, 2025
0e008fd
#7004 - icons selector
novikov82 Sep 2, 2025
2ab1350
#7004 - reset
novikov82 Sep 4, 2025
1175476
#7004 - fix background color token
novikov82 Sep 4, 2025
c1f13c7
#7004 hide popup on blur
novikov82 Sep 4, 2025
2f12d27
Merge branch 'issue/7004-Presets-integrate-presets-into-creator' of h…
novikov82 Sep 4, 2025
675a4c9
#7004 - fixed icon change
novikov82 Sep 4, 2025
84825ea
#7004 - do not act on disabled sidebar button
novikov82 Sep 4, 2025
1d87b01
#7004 - lose focus on enter
novikov82 Sep 4, 2025
9483693
#7004 - fixed modal dialog width
novikov82 Sep 4, 2025
32666e8
#7005 fix exception for new items
novikov82 Sep 4, 2025
24e0a33
#7004 - default icons
novikov82 Sep 9, 2025
1c14f92
#7004 - fixed default font family
novikov82 Sep 9, 2025
5923f0e
#7004 - fixed removing empty category
novikov82 Sep 9, 2025
683a61e
#7004 - restore deleted items to their default gategory
novikov82 Sep 9, 2025
147ba31
#7004 - fixed test
novikov82 Sep 9, 2025
f12c09b
#7004 remove theme reference
novikov82 Sep 15, 2025
a5a3e54
#7004 fix hidden items in pg editor
novikov82 Sep 15, 2025
ff7d15f
#7140 fixed drag in matrix
novikov82 Sep 17, 2025
601296f
#7004 - fixed table input hover style
novikov82 Sep 19, 2025
0d74e47
#7004 - add reset for pages
novikov82 Sep 19, 2025
ee7d428
#7004 reset notifications
novikov82 Sep 22, 2025
c9397d3
#7004 - items
novikov82 Sep 22, 2025
2a170f0
#7004 add watch
novikov82 Sep 23, 2025
355fa52
#7004 -styling issues
novikov82 Sep 23, 2025
b1eafc4
#7004 - default names
novikov82 Sep 23, 2025
28bb8f3
#7004 - fix question border
novikov82 Sep 23, 2025
e73c1ac
#7005 - fixed empty dropdown appearance
novikov82 Sep 23, 2025
7799bd3
#7004 - do not show langauge sidebar
novikov82 Sep 23, 2025
afd88ff
#7004 - do not show subitems icon
novikov82 Sep 23, 2025
f0c73a4
#7004 - fix show/hide popup
novikov82 Sep 23, 2025
27ccd13
#7004 fixed add category button
novikov82 Sep 24, 2025
308cdae
Merge branch 'issue/7004-Presets-integrate-presets-into-creator' of h…
novikov82 Sep 24, 2025
0e40b0c
#7004 - fixed default icon
novikov82 Sep 24, 2025
4f2a101
#7004 - fixed layout
novikov82 Sep 24, 2025
e5aa5a3
Merge remote-tracking branch 'origin/HEAD' into issue/7004-Presets-in…
novikov82 Sep 24, 2025
110e17d
#7004 - fixed lint
novikov82 Sep 24, 2025
81831c7
#7004 - items
novikov82 Sep 25, 2025
1069fa8
#7004 subitems
novikov82 Sep 26, 2025
237e49a
#7004 - fix icon color
novikov82 Sep 26, 2025
db5676f
#7004 - fix items
novikov82 Sep 26, 2025
d2ee710
#7004 - subiyems expand button visibility
novikov82 Sep 26, 2025
b7be16d
#7004 - left part context menu
novikov82 Sep 26, 2025
d4925fa
#7004 - fix wide popups
novikov82 Sep 26, 2025
7d82584
#7004 - fixed some tests
novikov82 Sep 26, 2025
bc85a2e
#7004 - fixed toolbox json init and add tests for context menu
novikov82 Sep 29, 2025
1c21dac
#7004 - add styles and labels to context menu
novikov82 Sep 29, 2025
b8ff19e
#7004 context menu popup styles and labels
novikov82 Sep 30, 2025
25be0e7
#7004 - toolbox flat items
novikov82 Sep 30, 2025
3f9eea8
#7004 - fixed flat toolbox
novikov82 Sep 30, 2025
ccf7c4d
#7004 - fixed test
novikov82 Sep 30, 2025
0b3c9e9
#7004 - fixed dragged row styles
novikov82 Sep 30, 2025
b0cc48d
#7004 - fixed context menu styles
novikov82 Sep 30, 2025
9204d89
#7004 fixed default toolbox categories
novikov82 Oct 1, 2025
b660687
#7004 - fix names generation
novikov82 Oct 1, 2025
a405f08
#7004 - hidden properties
novikov82 Oct 1, 2025
3e40780
#7004 - fix add categories to property grid
novikov82 Oct 1, 2025
67c2ae0
#7004 - fix convert to subcategory
novikov82 Oct 1, 2025
38f0997
Merge remote-tracking branch 'origin/master' into issue/7004-Presets-…
novikov82 Oct 2, 2025
75713c3
#7004 - localization strings
novikov82 Oct 2, 2025
7018094
#7004 - fix unit test
novikov82 Oct 2, 2025
6fc2000
#7004 - remove reference to tokens
novikov82 Oct 2, 2025
5da822e
#7004 - angular, vue
novikov82 Oct 2, 2025
1354e7e
#7004 - vue build
novikov82 Oct 3, 2025
0688d9d
#7004 - simplify vue structure
novikov82 Oct 3, 2025
a18e7f4
#fixed new subitems naming
novikov82 Oct 3, 2025
7566a3b
#7004 - show subitems in unsorted
novikov82 Oct 3, 2025
8638287
#7004 - expand subitems on convert
novikov82 Oct 6, 2025
c0c2e3f
#7004 - switch active tab on delete
novikov82 Oct 6, 2025
5b6f88a
#7004 vue build
novikov82 Oct 6, 2025
b483da1
#7004 - allow delete all categories
novikov82 Oct 6, 2025
5a4ccd8
#7004 - fixed vue
novikov82 Oct 6, 2025
968c2e0
#7004 - remove and fixed tests
novikov82 Oct 6, 2025
923e19c
#7004 - angular build scripts
novikov82 Oct 7, 2025
dd03147
#7004 angular builds
novikov82 Oct 7, 2025
9215156
#7004 - angular, vue
novikov82 Oct 7, 2025
51e2a48
Merge remote-tracking branch 'origin/master' into issue/7004-Presets-…
novikov82 Oct 7, 2025
dcbe53a
#7004 - fix angular build
novikov82 Oct 7, 2025
455c53b
#7004 - fix some css
novikov82 Oct 7, 2025
5d2bc4d
#7004 - fix lint
novikov82 Oct 7, 2025
6fdf3a4
#7004 -fixed self-category and self-subitem move
novikov82 Oct 8, 2025
befa079
#7004 css
novikov82 Oct 8, 2025
cb2d642
#7004 - show dialogs on item or category add
novikov82 Oct 8, 2025
52f6869
#7004 fix developer index
novikov82 Oct 8, 2025
c4f5705
#7004 title in dialogs
novikov82 Oct 9, 2025
0b848b3
Merge branches 'issue/7004-Presets-integrate-presets-into-creator' an…
novikov82 Oct 9, 2025
96016c2
#7004 - fix new item creating and editing
novikov82 Oct 9, 2025
46cb0cf
#7004 - protect from undefined values
novikov82 Oct 9, 2025
32fdda9
#7004 - do not clear child items on reset from dialog
novikov82 Oct 9, 2025
42f4fcd
#87004 - fix test
novikov82 Oct 9, 2025
a0147f1
#7004 fixed unexpected property hiding
novikov82 Oct 13, 2025
74df1a6
#7004 - fixed pg context menu
novikov82 Oct 13, 2025
3f313d5
#7004 - working on styles
novikov82 Oct 13, 2025
0f42024
#7004 - add icons
novikov82 Oct 13, 2025
1b78130
#7004 fixed icons
novikov82 Oct 14, 2025
b39362a
#7004 - fixed styles
novikov82 Oct 14, 2025
2644dec
#7004 - fix presets indexing
novikov82 Oct 14, 2025
5a73933
#7004 css - fill the area
novikov82 Oct 15, 2025
e107f6d
Merge remote-tracking branch 'origin/master' into issue/7004-Presets-…
novikov82 Oct 15, 2025
5fffc3f
#7004 - switch off title actions responsivity
novikov82 Oct 15, 2025
6c88540
#7004 - fixed language to default
novikov82 Oct 15, 2025
877a7be
#7004 -fixed some constants
novikov82 Oct 15, 2025
80e1830
#7004 - fix popup sizing
novikov82 Oct 15, 2025
f4c2819
#7004 - add localization
novikov82 Oct 15, 2025
8c138b4
#7004 fixed empty json apply
novikov82 Oct 16, 2025
8ac40e1
#7004 - fix and translate localization
novikov82 Oct 16, 2025
b71f017
#7004 - fixed localization
novikov82 Oct 16, 2025
ecd77eb
#7004 v-tests
novikov82 Oct 17, 2025
819304a
#7004 - more visial tests
novikov82 Oct 17, 2025
15e1c13
#7004 - fix some styles and texts
novikov82 Oct 17, 2025
2920024
#7004 - changes to examples in angular and vue
novikov82 Oct 17, 2025
696340c
#7004 Fixed unit test
novikov82 Oct 20, 2025
5c388b6
#7004 - fix adding categories after delete
novikov82 Oct 20, 2025
45d7e09
#7004 devops scripts
novikov82 Oct 20, 2025
d1255ca
#7004 survey-creator-js
novikov82 Oct 20, 2025
4cb5a55
#7004 - fix vue build
novikov82 Oct 20, 2025
5c97e86
#7004 - fix save and exit
novikov82 Oct 20, 2025
a57fef3
#7004 - add some code for creator options
novikov82 Oct 20, 2025
3d7ceb2
#7004 - fixed popup styles
novikov82 Oct 20, 2025
834f232
#7004 - fix and add screenshot tests
novikov82 Oct 21, 2025
833a175
#7004 - Remove test results
novikov82 Oct 21, 2025
af38e32
#7004 - fixed pg page switch
novikov82 Oct 22, 2025
649faf3
#7004 revert devops scripts
novikov82 Oct 23, 2025
79ca409
#7004 - add presets build to main command
novikov82 Oct 23, 2025
2ce133d
Merge remote-tracking branch 'origin/master' into issue/7004-Presets-…
novikov82 Oct 23, 2025
e97f381
#7004 - fixed unit tests
novikov82 Oct 23, 2025
474141c
#7004 - test page for preact
novikov82 Oct 23, 2025
d70c13c
#7004 - try to fix vue
novikov82 Oct 23, 2025
55ff963
#7004 - fix tooltip
novikov82 Oct 23, 2025
b0a9081
#7004 - v-, f-tests
novikov82 Oct 23, 2025
ed8182b
#7004 fixed preact
novikov82 Oct 24, 2025
12ac075
#7004 - fix vue build
novikov82 Oct 24, 2025
06242d8
#7004 - fix angular
novikov82 Oct 24, 2025
efd8523
#7004 - drag-drop tabs tests
novikov82 Oct 24, 2025
6c55daa
#7004 - update screenshots
novikov82 Oct 24, 2025
8625422
#7004 - refactored f2e tests
novikov82 Oct 24, 2025
8756f58
#7004 hide JSON tab in tests
novikov82 Oct 27, 2025
08c04f5
#7004 fixed dnd test
novikov82 Oct 27, 2025
572adae
#7004 - add edit in-dialog test
novikov82 Oct 27, 2025
fe69b11
#7004 - more tests
novikov82 Oct 27, 2025
c830e9b
#7004 fiixed edit in popup tests
novikov82 Oct 28, 2025
3ffa25d
#7004 - fixed screenshot tests
novikov82 Oct 28, 2025
903ba3b
#7004 - switch off survey animation
novikov82 Oct 28, 2025
d1b428c
#7004 - e2e tests
novikov82 Oct 28, 2025
d4628d9
#7004 fixed initial popup show
novikov82 Oct 29, 2025
12a1be5
#7004 fixed json component
novikov82 Oct 29, 2025
b0d81bc
#7004 - fixed styles for angular
novikov82 Oct 29, 2025
83a5acb
#7004 - fixed angular components
novikov82 Oct 29, 2025
295e506
#7004 - updated screenshot tests
novikov82 Oct 29, 2025
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ example/
examples/
.gitignore
webpack.config.js
webpack.presets.config.js
index.js
copy-vrt-tests.js
copy-src-tests.js
Expand Down
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ module.exports = {
}
},
{
"files": ["packages/survey-creator-core/src/localization/*.ts"],
"files": [
"packages/survey-creator-core/src/localization/*.ts",
"packages/survey-creator-core/src/presets/localization/*.ts"
],
"rules": {
"surveyjs/eslint-plugin-i18n/only-english-or-code": "off"
}
Expand Down
38 changes: 34 additions & 4 deletions e2e/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import type { Locator, Page } from "@playwright/test";
import { expect, test as baseTest } from "@playwright/test";

export const url = "http://127.0.0.1:8080/testCafe/testcafe";
export const urlByPage = "http://127.0.0.1:8080/testCafe/by-page";
export const urlPreviewThemeSwitcher = "http://127.0.0.1:8080/testCafe/preview-theme-switcher";
export const urlThemeForPreview = "http://127.0.0.1:8080/testCafe/theme-for-preview-option";
export const urlDropdownCollapseView = "http://127.0.0.1:8080/testCafe/dropdown-collapse-view";
export const urlLocalized_de = "http://127.0.0.1:8080/testCafe/testcafe_localized_ui";
export const urlPresets = "http://127.0.0.1:8080/testCafe/presets";

export async function compareScreenshot(page: Page, elementSelector: string | Locator | undefined, screenshotName: string, elementIndex = 0) {
let currentElement = elementSelector;
Expand Down Expand Up @@ -42,17 +48,41 @@ export const setJSON = async (page: Page, json: object) => {
}, json);
};

export async function doDrag({ page, element, target, options }: { page: Page, element: Locator, target: Locator, options: any }):Promise<void> {
await element.hover({ force: true });
interface IDragToElementOptions {
elementPosition?: {x: number, y: number};
targetPosition?: {x: number, y: number};
steps?: number;
}

export async function doDrag({ page, element, target, options }: { page: Page, element: Locator, target: Locator, options?: IDragToElementOptions }):Promise<void> {
if (options?.elementPosition) {
await element.hover({ force: true, position: { x: (options.targetPosition?.x || 0), y: (options.targetPosition?.y || 0) } });
} else {
await element.hover({ force: true });
}
await page.mouse.down();
await target.scrollIntoViewIfNeeded();
const { x, y, width, height } = await <any>target.boundingBox();

await page.mouse.move(x + width / 2 + (options.destinationOffsetX || 0), y + height / 2 + (options.destinationOffsetY || 0), { steps: 20 });
if (options?.targetPosition) {
await page.mouse.move(x + (options?.targetPosition?.x || 0), y + (options?.targetPosition?.y || 0), { steps: options?.steps || 20 });
} else {
await page.mouse.move(x + width / 2, y + height / 2, { steps: options?.steps || 20 });

}
}

export async function doDragDrop({ page, element, target, options }: { page: Page, element: Locator, target: Locator, options: any }):Promise<void> {
export async function doDragDrop({ page, element, target, options }: { page: Page, element: Locator, target: Locator, options?: IDragToElementOptions }):Promise<void> {
await doDrag({ page, element, target, options: options || {} });
await page.mouse.up();
}

export async function showCreatorSettings(page) {
await page.locator(".svc-sidebar-tabs__bottom-container .svc-menu-action__button").click();
}
export async function showPresets(page) {
await showCreatorSettings(page);
await page.locator(".sps-launch__card").click();
}

export { expect };
169 changes: 169 additions & 0 deletions e2e/presets.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
import { urlPresets, test, expect, showPresets, doDragDrop } from "./helper";

const title = "Presets";
async function getRowsInputValues(matrix: any) {
const values = await matrix.locator("tr input").evaluateAll((inputs: any) =>
inputs.map((input: any) => (input as HTMLInputElement).value)
);
return values;
}

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

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

test.describe(title, () => {
test.beforeEach(async ({ page }) => {
await page.waitForLoadState("networkidle");
await page.goto(`${urlPresets}`);
await page.setViewportSize({ width: 1440, height: 1400 });
await showPresets(page);
});

test("Check presets tabs", async ({ page }) => {
await page.locator(".sps-list__container").getByText("Tabs").click();

const items = page.locator(".sps-question--matrixdynamic table").nth(0);
const hidden = page.locator(".sps-question--matrixdynamic table").nth(1);
expect(await getRowsInputValues(items)).toEqual(["Designer", "Preview", "Logic", "Translations"]);
expect(await getRowsInputValues(hidden)).toEqual(["Themes", "JSON Editor"]);
expect(await getTabsTexts(page)).toEqual(["Designer", "Preview", "Logic", "Translations"]);

await items.locator("tr").nth(1).getByTitle("Delete").click();
expect(await getRowsInputValues(items)).toEqual(["Designer", "Logic", "Translations"]);
expect(await getRowsInputValues(hidden)).toEqual(["Themes", "JSON Editor", "Preview"]);
expect(await getTabsTexts(page)).toEqual(["Designer", "Logic", "Translations"]);

await hidden.locator("tr").nth(1).getByTitle("Add").click();
expect(await getRowsInputValues(items)).toEqual(["Designer", "Logic", "Translations", "JSON Editor"]);
expect(await getRowsInputValues(hidden)).toEqual(["Themes", "Preview"]);
expect(await getTabsTexts(page)).toEqual(["Designer", "Logic", "Translations", "JSON Editor"]);
});

test("Check presets tabs - drag-drop", async ({ page }) => {
await page.locator(".sps-list__container").getByText("Tabs").click();

const items = page.locator(".sps-question--matrixdynamic table").nth(0);
const hidden = page.locator(".sps-question--matrixdynamic table").nth(1);

expect(await getRowsInputValues(items)).toEqual(["Designer", "Preview", "Logic", "Translations"]);
expect(await getRowsInputValues(hidden)).toEqual(["Themes", "JSON Editor"]);
expect(await getTabsTexts(page)).toEqual(["Designer", "Preview", "Logic", "Translations"]);

await doDragDrop({ page, element: items.locator("tr").nth(1).locator(".sd-table__cell--drag"), target: hidden, options: { targetPosition: { x: 5, y: 5 } } });
expect(await getRowsInputValues(items)).toEqual(["Designer", "Logic", "Translations"]);
expect(await getRowsInputValues(hidden)).toEqual(["Preview", "Themes", "JSON Editor"]);
expect(await getTabsTexts(page)).toEqual(["Designer", "Logic", "Translations"]);

await doDragDrop({ page, element: hidden.locator("tr").nth(2).locator(".sd-table__cell--drag"), target: items, options: { targetPosition: { x: 5, y: 5 } } });
expect(await getRowsInputValues(items)).toEqual(["JSON Editor", "Designer", "Logic", "Translations"]);
expect(await getRowsInputValues(hidden)).toEqual(["Preview", "Themes"]);
expect(await getTabsTexts(page)).toEqual(["JSON Editor", "Designer", "Logic", "Translations"]);

await doDragDrop({ page, element: items.locator("tr").nth(1).locator(".sd-table__cell--drag"), target: items.locator("tr").nth(3).locator(".sd-table__cell--drag"), options: { targetPosition: { x: 5, y: 5 } } });
expect(await getRowsInputValues(items)).toEqual(["JSON Editor", "Logic", "Designer", "Translations"]);
expect(await getRowsInputValues(hidden)).toEqual(["Preview", "Themes"]);
expect(await getTabsTexts(page)).toEqual(["JSON Editor", "Logic", "Designer", "Translations"]);
});

test("Check presets tabs - edit", async ({ page }) => {
await page.locator(".sps-list__container").getByText("Tabs").click();
const items = page.locator(".sps-question--matrixdynamic table").nth(0);

expect(await getRowsInputValues(items)).toEqual(["Designer", "Preview", "Logic", "Translations"]);
expect(await items.locator("tr").nth(0).locator(".sps-action-button--icon use").nth(0).getAttribute("xlink:href")).toBe("#icon-wrench-24x24");

await page.getByRole("row", { name: "Designer" }).hover();
await page.getByRole("row", { name: "Designer" }).getByRole("button").nth(1).click();
await page.getByRole("textbox", { name: "Title", exact: true }).fill("Designer1");
await page.getByRole("combobox", { name: "Icon name" }).focus();
await page.waitForTimeout(500);
await page.getByRole("combobox", { name: "Icon name" }).click();
await page.getByText("icon-actual-size-24x24").click();
await page.getByRole("button", { name: "Apply" }).click();
expect(await items.locator("tr").nth(0).locator(".sps-action-button--icon use").nth(0).getAttribute("xlink:href")).toBe("#icon-actual-size-24x24");
expect(await getRowsInputValues(items)).toEqual(["Designer1", "Preview", "Logic", "Translations"]);

await page.getByRole("row", { name: "Designer1" }).hover();
expect(await page.getByRole("row", { name: "Designer1" }).getByRole("button").nth(1)).toBeVisible();
await page.getByRole("row", { name: "Designer1" }).getByRole("button").nth(1).click();
await page.getByRole("button", { name: "Reset to default" }).waitFor({ state: "visible" });
await page.getByRole("button", { name: "Reset to default" }).click();
await page.getByRole("button", { name: "Apply" }).click();
expect(await items.locator("tr").nth(0).locator(".sps-action-button--icon use").nth(0).getAttribute("xlink:href")).toBe("#icon-wrench-24x24");
expect(await getRowsInputValues(items)).toEqual(["Designer", "Preview", "Logic", "Translations"]);
});

test("Check presets toolbox", async ({ page }) => {
await page.locator(".sps-list__container").getByText("Toolbox").click();
expect((await getToolboxTexts(page)).slice(0, 3)).toEqual(["Radio Button Group", "Rating Scale", "Slider"]);

const items = page.locator(".sps-row--multiple > div").nth(0).locator(".sps-question--matrixdynamic table").nth(0);
const hidden = page.locator(".sps-row--multiple > div").nth(1).locator(".sps-question--matrixdynamic table").nth(0);
await items.getByRole("row", { name: "Choice Questions" }).locator("#show-detail").getByRole("button").click();
await items.getByRole("row", { name: "Slider" }).getByRole("button").nth(3).click();
await items.getByText("Remove from Toolbox").click();
expect((await getToolboxTexts(page)).slice(0, 3)).toEqual(["Radio Button Group", "Rating Scale", "Checkboxes"]);

await hidden.getByRole("button", { name: "More" }).nth(0).click();
await hidden.getByRole("menuitem", { name: "Text Input Questions" }).locator("span").click();
expect((await getToolboxTexts(page)).slice(9, 13)).toEqual(["Single-Line Input", "Long Text", "Multiple Textboxes", "Slider"]);

await items.getByRole("button", { name: "Collapse" }).click();
await items.getByRole("button", { name: "Delete" }).nth(2).click();
expect((await getToolboxTexts(page)).slice(12, 14)).toEqual(["Slider", "Single-Select Matrix"]);

await hidden.getByRole("button", { name: "More" }).first().click();

await hidden.getByText("Move to new category").click();
expect((await getToolboxTexts(page)).slice(20, 21)).toEqual(["Panel"]);
});

test("Check presets tabs - drag-drop categories", async ({ page }) => {
await page.locator(".sps-list__container").getByText("Toolbox").click();
expect((await getToolboxTexts(page)).slice(0, 3)).toEqual(["Radio Button Group", "Rating Scale", "Slider"]);

const items = page.locator(".sps-row--multiple > div").nth(0).locator(".sps-question--matrixdynamic table").nth(0);
const hidden = page.locator(".sps-row--multiple > div").nth(1).locator(".sps-question--matrixdynamic table").nth(0);

expect(await getRowsInputValues(items)).toEqual(["Choice Questions", "Text Input Questions", "Containers", "Matrix Questions", "Misc"]);
expect(await getRowsInputValues(hidden)).toEqual([]);
expect((await getToolboxTexts(page)).slice(0, 4)).toEqual(["Radio Button Group", "Rating Scale", "Slider", "Checkboxes"]);

await doDragDrop({ page, element: items.locator("tr").filter({ visible: true }).nth(2).locator(".sd-table__cell--drag"), target: items.locator("tr").filter({ visible: true }).nth(0).locator(".sd-table__cell--drag"), options: { targetPosition: { x: 5, y: 5 } } });
expect(await getRowsInputValues(items)).toEqual(["Containers", "Choice Questions", "Text Input Questions", "Matrix Questions", "Misc"]);
expect(await getRowsInputValues(hidden)).toEqual([]);
expect((await getToolboxTexts(page)).slice(0, 4)).toEqual(["Panel", "Dynamic Panel", "Radio Button Group", "Rating Scale"]);
});

test("Check presets toolbox - drag-drop items", async ({ page }) => {
await page.locator(".sps-list__container").getByText("Toolbox").click();
expect((await getToolboxTexts(page)).slice(0, 3)).toEqual(["Radio Button Group", "Rating Scale", "Slider"]);

const items = page.locator(".sps-row--multiple > div").nth(0).locator(".sps-question--matrixdynamic table").nth(0);
const hidden = page.locator(".sps-row--multiple > div").nth(1).locator(".sps-question--matrixdynamic table").nth(0);
await items.getByRole("row", { name: "Choice Questions" }).locator("#show-detail").getByRole("button").click();
await doDragDrop({ page, element: items.getByRole("row", { name: "Slider" }).locator(".sd-table__cell--drag"), target: hidden, options: { targetPosition: { x: 5, y: 5 } } });

expect((await getToolboxTexts(page)).slice(0, 3)).toEqual(["Radio Button Group", "Rating Scale", "Checkboxes"]);

await items.getByRole("row", { name: "Text Input Questions" }).locator("#show-detail").getByRole("button").click();
await doDragDrop({ page, element: hidden.getByRole("row", { name: "Slider" }).locator(".sd-table__cell--drag"), target: items.getByRole("row", { name: "Multiple Textboxes" }), options: { targetPosition: { x: 25, y: 25 } } });

expect((await getToolboxTexts(page)).slice(9, 13)).toEqual(["Single-Line Input", "Long Text", "Slider", "Multiple Textboxes"]);

await doDragDrop({ page, element: items.getByRole("row", { name: "Long Text" }).locator(".sd-table__cell--drag"), target: items.getByRole("row", { name: "Ranking" }), options: { targetPosition: { x: 5, y: 5 } } });
expect((await getToolboxTexts(page)).slice(7, 12)).toEqual(["Image Picker", "Long Text", "Ranking", "Single-Line Input", "Slider"]);

await items.getByRole("row", { name: "Rating" }).locator("#show-detail").getByRole("button").click();
await doDragDrop({ page, element: items.getByRole("row", { name: "Slider" }).locator(".sd-table__cell--drag"), target: items.getByRole("row", { name: "Stars" }) });
await page.locator(".svc-toolbox__item-submenu-button").nth(0).hover();
expect(await page.locator(".svc-toolbox-subtypes .sv-popup__container").filter({ visible: true })).toBeVisible();
expect((await page.locator(".svc-toolbox__item-subtype").filter({ visible: true }).allTextContents()).map(t => t.trim())).toEqual(["Labels", "Stars", "Slider", "Smileys"]);
});

});
3 changes: 2 additions & 1 deletion packages/survey-creator-angular/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
],
"styles": [
"./node_modules/survey-core/survey-core.css",
"./node_modules/survey-creator-core/survey-creator-core.css"
"./node_modules/survey-creator-core/survey-creator-core.css",
"./node_modules/survey-creator-core/presets/index.css"
],
"scripts": []
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { FormsModule } from "@angular/forms";
import { BrowserModule } from "@angular/platform-browser";
import { AppComponent } from "./app.component";
import { SurveyCreatorModule } from "survey-creator-angular";
import { PresetsModule } from "survey-creator-angular/presets";
import { SurveyModule } from "survey-angular-ui";
import { ExampleComponent } from "./example.component";
import { AppRoutingModule } from "./router.module";
Expand All @@ -17,13 +18,14 @@ import { TestDropdownCollapseComponent } from "./test/dropdown-collapse.componen
import { TestLocalizationComponent } from "./test/localization.component";
import { ThemeTabComponent } from "./test/test-theme-tab.component";
import { NoLicenseComponent } from "./test/test-no-license.component";
import { PresetsComponent } from "./test/presets.component";

@NgModule({
declarations: [
AppComponent, ExampleComponent, TestDefaultComponent, TestThemeSwitcherComponent, ThemePreviewComponent, TestByPageComponent, TestCustomWidgetComponent, TestDropdownCollapseComponent, TestLocalizationComponent, ThemeTabComponent, NoLicenseComponent
AppComponent, ExampleComponent, TestDefaultComponent, TestThemeSwitcherComponent, ThemePreviewComponent, TestByPageComponent, TestCustomWidgetComponent, TestDropdownCollapseComponent, TestLocalizationComponent, ThemeTabComponent, NoLicenseComponent, PresetsComponent
],
imports: [
BrowserModule, SurveyCreatorModule, FormsModule, SurveyModule, AppRoutingModule
BrowserModule, SurveyCreatorModule, FormsModule, SurveyModule, AppRoutingModule, PresetsModule
],
providers: [],
bootstrap: [AppComponent]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { SurveyCreatorModel } from "survey-creator-core";
import * as Survey from "survey-core";
import "survey-core/survey.i18n";
import "survey-creator-core/survey-creator-core.i18n";

import "survey-creator-core/presets/index.css";
import { TabPresetsPlugin } from "survey-creator-core/presets";
const json = {
"logoPosition": "right",
"completedHtml": "<h3>Thank you for your feedback.</h3><h5>Your thoughts and ideas will help us to create a great product!</h5>",
Expand Down Expand Up @@ -85,6 +86,7 @@ export class ExampleComponent {
this.creator.JSON = json;
(<any>window).creator = this.creator;
(<any>window).Survey = Survey;
new TabPresetsPlugin(this.creator)
}

public survey = new SurveyModel(json);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { TestThemeSwitcherComponent } from "./test/theme-switcher.component";
import { TestLocalizationComponent } from "./test/localization.component";
import { ThemeTabComponent } from "./test/test-theme-tab.component";
import { NoLicenseComponent } from "./test/test-no-license.component";
import { PresetsComponent } from "./test/presets.component";
import { ExampleComponent } from "./example.component";

const routes = [
Expand All @@ -21,6 +22,7 @@ const routes = [
{ path: "testCafe/dropdown-collapse-view", component: TestDropdownCollapseComponent },
{ path: "testCafe/testcafe-theme-tab", component: ThemeTabComponent },
{ path: "testCafe/testcafe-no-license", component: NoLicenseComponent },
{ path: "testCafe/presets", component: PresetsComponent },
{ path: "", component: ExampleComponent }
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Component, ViewEncapsulation } from "@angular/core";
import { SurveyCreatorModel } from "survey-creator-core";
import { settings } from "survey-core";
import { TestDefaultComponent } from "./default.component";
import { TabPresetsPlugin } from "survey-creator-core/presets";
@Component({
selector: "test-theme-preview",
templateUrl: "./test.component.html",
encapsulation: ViewEncapsulation.None
})
export class PresetsComponent extends TestDefaultComponent {
constructor() {
super();
}
protected override getSlk(): boolean { return false; }
protected override createCreator(): void {
this.creator = new SurveyCreatorModel({ expandCollapseButtonVisibility: "never", showLogicTab: true, showTranslationTab: true, showJSONEditorTab: false });
this.creator.tabResponsivenessMode = "menu";
this.creator["animationEnabled"] = false;
settings.animationEnabled = false;
this.creator.allowZoom = false;
this.creator.showOneCategoryInPropertyGrid = true;
new TabPresetsPlugin(this.creator);
}
}
1 change: 1 addition & 0 deletions packages/survey-creator-angular/ng-package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "node_modules/ng-packagr/ng-package.schema.json",
"dest": "./build",
"deleteDestPath": false,
"lib": {
"entryFile": "src/angular-ui.ts"
}
Expand Down
Loading