diff --git a/client/packages/lowcoder-design/src/components/Tab.tsx b/client/packages/lowcoder-design/src/components/Tab.tsx index 3828b7e27f..a4e447a9f2 100644 --- a/client/packages/lowcoder-design/src/components/Tab.tsx +++ b/client/packages/lowcoder-design/src/components/Tab.tsx @@ -96,6 +96,8 @@ const Tabs = React.memo((props: ITabs) => { return ( handleTabClick(tab.key)} $isActive={isActive} > @@ -107,7 +109,7 @@ const Tabs = React.memo((props: ITabs) => { return ( <> - + {tabsConfig.map(renderTab)} {activeTab.content} diff --git a/client/packages/lowcoder/src/layout/gridItem.tsx b/client/packages/lowcoder/src/layout/gridItem.tsx index 8d02232bf7..e48396abf6 100644 --- a/client/packages/lowcoder/src/layout/gridItem.tsx +++ b/client/packages/lowcoder/src/layout/gridItem.tsx @@ -278,6 +278,7 @@ export const GridItem = React.memo((props: GridItemProps) => { return (
{ @@ -216,7 +223,7 @@ export const AppEditorInternalView = React.memo((props: AppEditorInternalViewPro }; }, [isUserViewMode]); - useSaveComp(appInfo.id, readOnly, compInstance, blockEditing); + const saveBaselineTaken = useSaveComp(appInfo.id, readOnly, compInstance, blockEditing); const loading = !compInstance || !compInstance.comp || !compInstance.comp.preloaded || props.loading; @@ -246,6 +253,8 @@ export const AppEditorInternalView = React.memo((props: AppEditorInternalViewPro }} > + {/* Tells tests (and anything else watching the DOM) that edits made from now on are saved. */} + {saveBaselineTaken && diff --git a/client/packages/lowcoder/src/pages/editor/right/ModulePanel.tsx b/client/packages/lowcoder/src/pages/editor/right/ModulePanel.tsx index 5b216cd708..8eee8cb094 100644 --- a/client/packages/lowcoder/src/pages/editor/right/ModulePanel.tsx +++ b/client/packages/lowcoder/src/pages/editor/right/ModulePanel.tsx @@ -228,6 +228,7 @@ function ModuleItem(props: ModuleItemProps) { return ( { e.stopPropagation(); e.dataTransfer.setData("compType", compType); diff --git a/client/packages/lowcoder/src/pages/editor/right/PluginPanel/PluginCompItem.tsx b/client/packages/lowcoder/src/pages/editor/right/PluginPanel/PluginCompItem.tsx index bbf8123c83..ce5e1fd738 100644 --- a/client/packages/lowcoder/src/pages/editor/right/PluginPanel/PluginCompItem.tsx +++ b/client/packages/lowcoder/src/pages/editor/right/PluginPanel/PluginCompItem.tsx @@ -85,6 +85,7 @@ export function PluginCompItem(props: PluginCompItemProps) { return ( { e.dataTransfer.setData("compType", compType); e.dataTransfer.setDragImage(TransparentImg, 0, 0); diff --git a/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx b/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx index b12d59f31a..9cb3009a07 100644 --- a/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx +++ b/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx @@ -175,6 +175,7 @@ export const UICompPanel = () => { { e.dataTransfer.setData("compType", info[0]); e.dataTransfer.setDragImage(TransparentImg, 0, 0); diff --git a/e2e/.gitignore b/e2e/.gitignore new file mode 100644 index 0000000000..2bfc22ef0f --- /dev/null +++ b/e2e/.gitignore @@ -0,0 +1,9 @@ +node_modules/ +playwright-report/ +test-results/ +blob-report/ +playwright/.auth/ +.run.lock + +# Local probe evidence: specs, logs, screenshots; not part of the suite +evidence/ diff --git a/e2e/AGENTS.md b/e2e/AGENTS.md new file mode 100644 index 0000000000..bfc420aa68 --- /dev/null +++ b/e2e/AGENTS.md @@ -0,0 +1,283 @@ +# AGENTS.md: how to write and change tests in e2e/ + +Source of truth for AI coding agents. What the suite is, how to run it, the catalogue, the defect table and the +D-3 rules: [README.md](README.md). +Mark anything you did not check as NOT VERIFIED. Never guess a locator, a timing or a product behaviour: measure it. +Rules say when they apply. "Existing exception" means reviewed code that deviates; do not copy it into new tests. + +## 1. Adding a test: steps + +1. Pick the scenario (README, "Scenarios") and the folder (section 2). Read one existing spec of that folder. +2. Read the helpers: `src/dsl/builders.ts`, `src/api/client.ts`, `src/constants.ts`, the `src//` helpers (table in section 8). +3. Read the client source of the component for its events, exposed values and timings. Cite the path in a comment; a line number is optional. +4. Seed the app through the API from builders (section 3). +5. Write the assertions (section 4). Import `test` and `expect` from `src/fixtures`, never from `@playwright/test` (accepted exception: stack-free unit specs, section 8). +6. Tags (section 6) and defect annotation (section 7) where they apply. +7. From `e2e/`: `./node_modules/.bin/tsc --noEmit`. Success = exit status 0 and no TypeScript diagnostics. +8. From the repository root: `e2e/scripts/run-in-docker.sh `. +9. Gate for your change type (section 9). +10. Invert the key assertion once, show it FAILS, restore (section 9). +11. Re-measure `--list` counts after the last edit and update the README catalogue. + +## 2. Where things go + +| Kind of test | Folder | +|---|---| +| fastest checks of harness and main flow | `tests/smoke/` | +| sign-in, sign-up | `tests/auth/` | +| invitation, sharing | `tests/workspace/` | +| app list, card menu, trash, publish | `tests/apps/` | +| editor interaction (drag, resize, rename, property, JS query) | `tests/editor/` | +| PostgreSQL queries, tables | `tests/datasource/` | +| triggers, temporary state, local storage | `tests/logic/` | +| modules | `tests/modules/` | +| visual components, npm components, Extensions panel | `tests/components/` | +| access control: cross-workspace, roles, groups, forged credentials, mass assignment, public leakage, collaboration rooms, CORS | `tests/security/` | +| profile, password, API keys of a user (user lifecycle) | `tests/account/` | +| unit tests of builders, fixtures, page objects, helpers | `tests/foundation/` or next to the area | + +MUST: +- Put reusable or exported helpers in `src//` (`src/logic/`, `src/datasource/`, `src/components/`, + `src/simple-components/`, `src/modules/`, `src/pages/`, `src/security/`) and give each a unit test (pattern: + `tests/logic/helpers.spec.ts`, `tests/components/scenario-helpers.spec.ts`). +- Edit shared files additively: `src/dsl/builders.ts`, `src/constants.ts`, `src/pages/*.ts`, `src/fixtures.ts`, + `playwright.config.ts`, `src/api/client.ts`, `fixtures/sql/init.sql`. Re-read the file right before editing; others + edit them. Do not reorder, rename or reformat existing code there. +- Keep `PRODUCTS` in `src/constants.ts` and `fixtures/sql/init.sql` equal. + +Accepted exception: setup utilities used by one spec only may stay in that spec (existing: `insertAndSave` in +`components/insert-all.spec.ts`, `buildHostInEditor` in `modules/module-editor-host.spec.ts`, test factories in +`foundation/*.spec.ts`, `openApp` in `components/chat.spec.ts`). Move a function to `src//` as soon as a second spec needs it. + +## 3. Building a test case + +MUST: +- Seed through the API: `createApp` and `publishApp` (`src/api/client.ts`), DSL from `appDsl(items, parts)`. Helpers: + `openSeededView` (`src/components/scenario.ts`), `openSeededApp` (`src/simple-components/seed.ts`). +- Use `component(type, { id, testId, ... })`: it starts from the recorded default in `fixtures/dsl/.json`. Hook + types (`modal`, `drawer`, `toast`, `chatController`, `meeting`) use `hook` or `recordedHookOf`. +- Bind one text per observed value (`boundText`) and assert one target per text, so a failure names the property. +- Locate by `data-testid` (`view.byTestId`, `view.buttonByTestId`) or role first. `view.byCompName` only for types in + `TYPES_WITHOUT_TEST_ID` (`src/components/insert-catalog.ts`). +- Drive the editor through page objects in `src/pages/`; add a method there when one is missing. +- Use the fixtures of `src/fixtures.ts`: `apiUser` (own user and organisation), `newUserSession`, `uniqueEmail`. Parallel tests share nothing. +- Scope every PostgreSQL write by the test's own `owner` (`OWNER_STATE_NAME`, `OWNER_FILTER`, + `insertUpdateDeleteQueries` in `src/datasource/notes-queries.ts`). `products` and `items` are read-only and shared. +- Use data: URIs from `src/media.ts` for images, audio, video, PDF (the guard blocks external hosts). +- Use `page.clock` for time-driven behaviour where possible (`tests/logic/triggers.spec.ts`). + +Accepted exceptions: +- CSS-class, positional (`nth`, `first`, `last`) or `.ant-*` locators inside a component are allowed when the component + exposes no role or test id and a comment says why. Existing: `components/choices.spec.ts`, `media.spec.ts`, + `rich-inputs.spec.ts`, `sliders-color.spec.ts`, `src/pages/PropertyPanel.ts`, `src/pages/TableView.ts`. Prefer + adding the lookup to a page object. +- Editor-built apps are allowed when the editor flow is the subject (`tests/editor/`, `smoke/editor-drag.spec.ts`, M3). + +MUST NOT: +- Hard-code credentials, host names, ports or generated resource ids: use `uniqueEmail`, `TEST_PASSWORD`, `POSTGRES`, + `APP_PAGE`, ids returned by the API. Deterministic DSL item ids and test ids local to one spec are fine. +- Let tests depend on each other or on test order. + +## 4. Waiting and assertions + +MUST: +- Use web-first `expect(locator)` and `expect.poll`. Expect timeout is 15 s (`playwright.config.ts`). +- Prove a state transition: assert the "before" state, act, assert the "after" state (pattern: + `tests/components/displays.spec.ts`). An assertion already true before the action proves nothing. This applies to + assertions meant to prove an action's effect; initial-render, structural, error and pure unit assertions need no "before". +- Give `expect` a message when several assert in a row in an integration test (`expect(x, "numberInput value")`). + Optional on isolated, self-explanatory unit assertions (`tests/foundation/`, `tests/logic/helpers.spec.ts`). +- For "nothing must happen" in new tests, use `expectTextStays(page, locator, expected, description, { windowMs })` + (`src/logic/helpers.ts`) over `NEGATIVE_EVENT_WINDOW_MS`. +- Name every fixed wait as a constant with the measured reason in its doc comment. Existing: `GRID_SETTLE_MS`, + `DEBOUNCE_SETTLE_MS`, `NEGATIVE_EVENT_WINDOW_MS`, `RTE_REMOUNT_SETTLE_MS` (`tests/components/rich-inputs.spec.ts`), + `VIEW_OBSERVATION_MS` (`src/components/insert-all.ts`). +- Set a per-test timeout from a named constant when a test needs more than 60 s. + +MUST NOT: +- Use `waitForTimeout` as an assertion, or to "let things settle" without a named, measured constant. +- Use `networkidle` as proof that a feature works. + +Accepted exceptions: +- `toBeVisible` is valid when visibility is the behaviour (a dialog opens, a panel shows). Do not use it where a text or + attribute can be asserted. +- Negative checks that do NOT use `expectTextStays` (existing, NOT to copy): `components/chat.spec.ts` and + `foundation/logic-builders.spec.ts` (fixed `waitForTimeout`), `foundation/module-host.spec.ts` and + `components/timer.spec.ts` (own polling or gap). + +## 5. Constants + +MUST: +- Use `TAGS`, `RUN_FLAGS`, `API_PATHS`, `applicationPath(...)`, `APP_PAGE`, `UI_PATHS`, `TABLE_LABELS`, + `EXTENSIONS_LABELS`, `EVENT_HANDLER_LABELS` from `src/constants.ts` instead of repeating them. +- Name, with a doc comment, every credential, generated-id prefix, shared UI label, route and timing value whose reason + is not obvious. Shared ones go to `src/constants.ts`; area-only ones to `src//` or the top of the spec. + +MUST NOT: +- Write routes (`"/api/applications"`), tags (`"@slow"`), credentials or unexplained timings (`15000`) inline. + +Coordinates, DSL item ids, test ids and labels used by one spec only may be local literals. + +## 6. Tags + +- `@smoke`: only the few fastest checks of harness and main flow (`tests/smoke/`, `apps/publish-draft.spec.ts`). +- `@core`: a main user flow of the base suite (auth, apps, editor, datasource, logic, workspace). +- `@security`: an access-control test of `tests/security/` (`TAGS.SECURITY`); the P0 set also carries `@core` and is selected by its ids, see README "security". +- `@lifecycle`: a user-lifecycle test (sign-up to deletion), ids `LC-`, details from `lifecycleTestDetails` / `lifecycleCandidateDetails` in `src/security/quarantine.ts` (`TAGS.LIFECYCLE`); in the default run, quarantined through the same two maps as the security ids. +- `@superadmin`: the four instance-super-admin tests SEC-R16a to SEC-R16d (`TAGS.SUPERADMIN`, pass `[TAGS.SUPERADMIN]` as `extraTags` of `securityTestDetails`). Opt-in like `@quarantine`: out of the default run and of the `@security` and P0 runs, in only with `E2E_INCLUDE_SUPERADMIN=1` (README, D-47). A test that also carries `@quarantine` (R16c, R16d) needs both variables. +- `@enterprise`: a test of the second stack in ENTERPRISE workspace mode (SEC-E01 to SEC-E06b, `TAGS.ENTERPRISE`, pass it in `extraTags` of `securityTestDetails`). Never runs on the default stack; with `E2E_STACK_PROFILE=enterprise` it is the only selection (README, "ENTERPRISE stack"). All its tests share ONE workspace: name only your own users, never count the members, never remove, demote or re-password the super admin. SEC-E05 resets the super admin's password, so it also carries `@enterprise-takeover` (`TAGS.ENTERPRISE_TAKEOVER`), which every run leaves out unless `E2E_INCLUDE_ENTERPRISE_TAKEOVER=1` (enterprise profile, with `E2E_INCLUDE_QUARANTINE=1`); then it is the ONLY test of the run. Its file keeps trace, screenshot and video off and passes no response body to an assertion (the reset answer holds a password). +- `@slow`: the test needs noticeably longer (PostgreSQL, npm, many editor steps). +- `@npm`: the test needs the app container to reach the npm registry. +- `@quarantine` and `@insert-all`: see section 7 and the README. +- Untagged is normal: component scenarios (S2 to S20), unit, helper and foundation tests carry no tag. +- Always use `TAGS.*`. A test with a tag string in its title only as test data stays untagged (`foundation/run-selection.spec.ts`). + +## 7. Defects + +MUST: +- Quarantine rule: a test that asserts the DESIRED behaviour and fails today gets `tag: TAGS.QUARANTINE` (excluded from + the default run). Existing: `editor/drop-size.spec.ts` (D-5) and the icon switch in `components/displays.spec.ts` (CD-9 candidate, with a `defect` annotation). +- A characterisation or workaround test that passes while documenting a defect is NOT quarantined. Give it + `annotation: { type: "defect", description: "" }` (examples: `tests/logic/temporary-state.spec.ts` CD-7, `components/npm-components.spec.ts` CD-5; conditional form + `testInfo.annotations.push({ type: "defect", description })` in `components/choices.spec.ts`, CD-8 candidate). D-5's + `drop-size.spec.ts` and CD-3's `timer.spec.ts` carry no annotation today; adding one is allowed. +- Other annotation types: `D-3 retry`, `handler retry` (retries of S1, M3, `foundation/editor-modules.spec.ts`), `observation` + (`modules/module-versions.spec.ts`). +- Cite the defect id in a comment where a test works around it (D-3, D-5, CD-3, CD-5, CD-7). The README table defines them. + CD-5 is an observation, not a confirmed defect. +- Add a new finding to the README ("Security findings" for the security tests, "Known defects" otherwise); until it is there, name it " candidate" in the annotation. +- Use the D-3 retry only in the editor-save specs S1 (`tests/components/insert-all.spec.ts`) and M3 + (`tests/modules/module-editor-host.spec.ts`): one retry on a fresh app, annotation `D3_RETRY_ANNOTATION` + (`src/constants.ts`), `test.describe.configure({ retries: 0, timeout: 180_000 })`. Reporter: + `src/reporters/d3-threshold-reporter.ts` (`D3_GATED_SPEC_FILES`); add a spec there only after agreeing it with the user. + +MUST NOT: +- Weaken, loosen or delete an assertion to hide a product defect. +- Enable Playwright retries on S1 or M3. `playwright.config.ts` has one global retry under `CI` only; S1 and M3 switch it off. +- Apply the D-3 retry to a test whose save is not the subject (S16 and S19 change organisation settings, not the DSL). +- Pass `--reporter=...` in a real S1 or M3 gate run: it replaces the config's reporters and bypasses the D-3 gate. + `--reporter=list` is for `--list` commands only. Expect `D-3 gate within the limit: ...` on stderr. + +D-3 threshold: the reporter counts tests that ran per gated file and fails above `floor(ran / 2)`. The limits 56 of 112 +and 5 of 10 apply to the complete gates only. A targeted run of fewer S1 or M3 tests gets a smaller limit; a one-test +run allows zero D-3 retries and fails if that test uses its retry. + +## 8. Prohibited, and helpers to reuse + +MUST NOT: +- Run two `run-in-docker.sh` stacks against the same checkout at once (lock `e2e/.run.lock`; they share `node_modules`, + `test-results`, `playwright-report`), and do not run `playwright test` directly while a stack of this checkout runs. +- Edit anything in `e2e/evidence/` (git-ignored, local). Do not cite it as if it were in git. +- Reach a real external host, switch the guard off, or add a route that allows another origin. Only `@npm` tests need + the app container to reach the npm registry. The one place the backend may be pointed at is the run's own echo sidecar (`echo` fixture, `src/security/echo.ts`); never give a data source or a registry entry any other URL. +- Import `test` from `@playwright/test` in a spec that opens a page or uses the stack: the network guard exists only in the `test` of `src/fixtures.ts` (accepted exception for stack-free unit specs below). +- Commit secrets. The PostgreSQL password in `src/constants.ts` is the throw-away one of the sidecar. +- Let the super admin's password (`E2E_SUPERUSER_PASSWORD`, new every run, set by `run-in-docker.sh`) reach a command line, log, trace, report, test title, annotation or error message; keep `set -x` off in the script. Never give the password to a matcher as the expected or received value (`expect(text).not.toContain(password)` prints it when it fails): assert `text.includes(password)` is `false`. The sign-in lives in an automatic worker fixture (`superAdminState`) because a request context created inside a test lands in its trace; do not sign the super admin in from a test or a helper, and create no request context in a helper. Every test that uses the `superAdmin` fixture carries `TAGS.SUPERADMIN` (a guard in `foundation/run-selection.spec.ts` checks it by parsing the spec with the TypeScript compiler: write the tag as `TAGS.SUPERADMIN` in the test's or its describe's details, a mention in a comment or title does not count). The super admin is ONE account shared by all workers: never switch its workspace or change its password. It hangs once the stack holds more than about 420 workspaces (README, security section): the SEC-R16 tests therefore carry `@superadmin` and run only on request (`E2E_INCLUDE_SUPERADMIN=1`); keep such runs short. +- Duplicate a helper that exists: + +| Need | Helper | File | +|---|---|---| +| user, app, module, permissions, datasource | `registerUser`, `createApp`, `createModule`, `publishApp`, `updateApp`, `getAppDsl`, `setPublicToAll`, `grantAppPermission`, `createPostgresDatasource`, `createN8nDatasource`, `setNpmRegistry`, `createInvitation`, `acceptInvitation` | `src/api/client.ts` | +| component from its recording | `component`, `recordedItem`, `recordedHook`, `recordedHookOf`, `hook` | `src/dsl/builders.ts`, `src/dsl/recorded.ts` | +| layout and app | `stackItems`, `containerOf`, `appDsl`, `button`, `text`, `input`, `table`, `barChart` | `src/dsl/builders.ts` | +| events and actions | `eventHandler`, `executeQuery`, `setTempState`, `runScript`, `executeComp`, `triggerModuleEvent` | `src/dsl/builders.ts` | +| queries, state, logic | `postgresQuery`, `jsQuery`, `n8nWorkflowsQuery` (recordings in `fixtures/dsl/n8n/`, loaded by `recordedN8nQuery` and `recordedN8nDatasource`), `tempState`, `transformer`, `dataResponder` | `src/dsl/builders.ts` | +| modules | `moduleApp`, `moduleInstance`, `scenarioModuleDsl`, `waitForSavedInstance`, `HandlerRetryBudget` | `src/dsl/builders.ts`, `src/modules/moduleScenario.ts` | +| bound text, nested override, seeded view | `boundText`, `withValueAt`, `openSeededView` | `src/components/scenario.ts` | +| containers and slots | `containerWithChildren`, `slotChild`, `slotContainers`, `openSeededApp` | `src/simple-components/seed.ts` | +| catalogue, saved-DSL polling | `INSERT_TYPES`, `HOOK_TYPES`, `searchTextOf`, `waitForSavedType`, `prepareForPublish` | `src/components/insert-catalog.ts`, `src/components/insert-all.ts` | +| notes and products queries | `selectProductsQuery`, `selectNotesQuery`, `noteWriteQuery`, `insertUpdateDeleteQueries` | `src/datasource/notes-queries.ts` | +| negative and counter reads, local storage | `expectTextStays`, `countAfterEquals`, `parseCounter`, `rawLocalStorage` | `src/logic/helpers.ts` | +| media | `PNG_RED`, `PNG_BLUE`, `WAV`, `WEBM`, `MP4`, `PDF`, `PDF_RAW_B64` | `src/media.ts` | +| security actors, quarantine, answers, tokens | `Actor`, `adminOfApiUser`, `joinWorkspace`, `makeDeveloper`, `makeAdmin`, `grantApp`, `seedPrivateApp`, `sceneOf`, `memberOf`, `roleOf`, `permissionIdOf`, `securityTestDetails`, `securityCandidateDetails`, `expectAnswer`, `expectDeniedAs`, `forgeApiKeyToken`, `forgeUnsignedToken`, `withRandomSignature`, `tokenIsSignedWith`, `superAdminCredentials`, `SUPER_ADMIN_ENV`, `enterpriseAdmin` (ENTERPRISE stack: an actor the super admin makes admin of the one workspace), `echoTargetPath`, `echoReadPrefix`, `echoBaseUrl`, `recordsContain` (requests the SERVER makes, read back from the HTTP echo sidecar: the `echo` fixture gives a test its own target `url` and `received()`; a denial must follow a positive control that the echo does receive from that path; compare a secret with `recordsContain(...)` as a boolean, never as a matcher's value) (the `actor`, `superAdmin` and `echo` fixtures are in `src/fixtures.ts`; the raw-answer helper `apiRaw` and the other security API helpers are in `src/api/client.ts`) | `src/security/actors.ts`, `scene.ts`, `quarantine.ts`, `assertions.ts`, `tokens.ts`, `super-admin.ts`, `enterprise.ts`, `echo.ts` | +| pages | `EditorPage`, `AppViewPage`, `PropertyPanel`, `QueryPanel`, `TableView`, `ExtensionsPanel`, `AppListPage`, `AuthPage`, `LoginPage`, `UserMenu`, `SettingPage`, `DatasourcePage` | `src/pages/` | + +Accepted exception to the `test` import rule: stack-free unit specs that open no browser page (no `page`, no app) may +import `test` from `@playwright/test`, because the network guard only guards browser contexts. Existing: +`foundation/builders.spec.ts`, `recorded.spec.ts`, `run-selection.spec.ts`, `media.spec.ts`, and the security specs +`foundation/security-api-raw.spec.ts`, `security-echo.spec.ts` and `lifecycle-mail-sink.spec.ts` (start `scripts/echo-server.js` on loopback ports), `lifecycle-mail.spec.ts`, `security-quarantine.spec.ts`, `security-constants.spec.ts`, `security-tokens.spec.ts`, `security-assertions.spec.ts`, `security-super-admin.spec.ts`. Anything that opens +a page or talks to the stack imports from `src/fixtures`. + +Two helpers share a name with different meanings; do not add a third: `testIdOf(name)` in `src/components/scenario.ts` +(`e2e-`, S2 to S7) and `testIdOf(compType)` in `src/components/insert-all.ts` (`probe-`, S1). Two +`SavedDslTimeoutError` classes exist, in `src/components/insert-all.ts` and `src/modules/moduleScenario.ts`, one per scenario family. + +## 9. Evidence before declaring a test done + +Put the output in your final report (command, directory, last lines). Scope by change type: + +| Change | Required run | +|---|---| +| helper, builder, page object | its unit spec, plus every spec that uses a changed page object | +| scenario or spec file | `e2e/scripts/run-in-docker.sh --repeat-each=10 --workers=4 ` (repository root) | +| S1 (`insert-all`) | the S1 gate command in README, once | +| M3 (`module-editor-host`) | the M3 gate command in README | + +MUST, in this order: +1. From `e2e/`: `./node_modules/.bin/tsc --noEmit` exits 0 with no TypeScript diagnostics (other shell output does not count). +2. Run the scope above and quote the pass line. +3. Invert the key assertion (expect the wrong value), run, quote the FAIL, restore, run green. For a guard or negative + assertion, break its input the same way. The checkout is shared and dirty: run `git diff -- ` before and after, + and restore only your own change (edit it back; never `git checkout` or `git stash` a file others edit). +4. After your LAST edit, re-run `--list --reporter=list` and update every count you wrote; drop any `file:line` you + cannot re-verify. + +MUST NOT: +- Report "should pass" or "same as before". Report what ran. +- Cite a number measured before a later edit. + +## 10. Common mistakes found in this suite + +Source: comments in the named files. The loss rates, timings and browser behaviours were measured in an earlier session +and are NOT VERIFIED in tracked evidence. + +- **richTextEditor typed too early:** it remounts once about 500 ms after mounting; text typed before is lost. Wait + `RTE_REMOUNT_SETTLE_MS` (no page signal exists). `tests/components/rich-inputs.spec.ts`. +- **Step control, Step 1:** the selected step is not clickable. Test `change` by selecting Step 2 by its button name. + `tests/components/buttons.spec.ts`. +- **Strict-mode violation from a leaving dropdown:** a closing antd dropdown is not yet `-hidden`; take `.last()` of the + visible ones. `src/pages/PropertyPanel.ts` (`visibleDropdown`). +- **`networkidle` after an iframe was added:** a component that adds a frame later (`iframe`, `custom`) keeps network + idle from firing; await it first. `tests/components/insert-all.spec.ts`. +- **numberInput:** it writes `value` when editing finishes; press Enter or blur. `tests/components/inputs.spec.ts`. +- **Icon from a name to a `data:` URI keeps the old icon** (CD-9 candidate; `@quarantine`). + `tests/components/displays.spec.ts`. +- **floatingButton group intercepts clicks:** give it its own column (`FLOATING_BUTTON_COLUMN`) and click its option by + `FLOATING_OPTION_ONE_SELECTOR`. `tests/components/buttons.spec.ts`. +- **Handler retry (M3):** `setTempStateAction(state, value, { eventName, retryAllowed, onRetry })` retries once through the + existing handler; pass `retryAllowed: false` when the caller's `HandlerRetryBudget` is spent. + `TableView.headerCell(title)` matches the exact title; `ExtensionsPanel.tile(kind, pkg)` and `tileVersion(kind, pkg)` take the list kind first. +- **Drop right after the editor opens:** width 0 (D-5) or a lost save (D-3). Open with `EditorPage.open()`. +- **Parallel writes to `notes` without the `owner` scope:** tests see each other's rows (4 of 4 parallel copies + failed when measured; NOT VERIFIED here). + +## 11. Commands cheat-sheet + +Repository root (paths after the script are relative to `e2e/`): + +```bash +e2e/scripts/build-e2e-image.sh # once +e2e/scripts/run-in-docker.sh # default run +e2e/scripts/run-in-docker.sh tests/components/inputs.spec.ts # one file +e2e/scripts/run-in-docker.sh -g "typed value reaches" # one test by title +e2e/scripts/run-in-docker.sh --grep @smoke # by tag +e2e/scripts/run-in-docker.sh --repeat-each=10 --workers=4 # general repeat gate +E2E_INCLUDE_QUARANTINE=1 e2e/scripts/run-in-docker.sh --grep @quarantine +E2E_INCLUDE_INSERT_ALL=1 e2e/scripts/run-in-docker.sh --grep @insert-all --workers=4 # S1 gate, once +E2E_INCLUDE_SUPERADMIN=1 e2e/scripts/run-in-docker.sh --grep @superadmin # SEC-R16a, R16b (R16c, R16d also need E2E_INCLUDE_QUARANTINE=1) +e2e/scripts/run-in-docker.sh --repeat-each=10 --workers=4 tests/modules/module-editor-host.spec.ts # M3 gate +E2E_STACK_PROFILE=enterprise e2e/scripts/run-in-docker.sh --repeat-each=10 --workers=4 tests/security/enterprise.spec.ts # ENTERPRISE stack gate (its own stack; never at the same time as another run) +E2E_INCLUDE_QUARANTINE=1 E2E_INCLUDE_ENTERPRISE_TAKEOVER=1 E2E_STACK_PROFILE=enterprise e2e/scripts/run-in-docker.sh # SEC-E05 ALONE, on its own stack +E2E_HOST_PORT=8080 e2e/scripts/run-in-docker.sh # also reach the app on 127.0.0.1:8080 +``` + +Directory `e2e/` (no stack; `--reporter=list` is required so no report files are written): + +```bash +./node_modules/.bin/tsc --noEmit +LOWCODER_BASE_URL=http://localhost:1 ./node_modules/.bin/playwright test --list --reporter=list +E2E_INCLUDE_QUARANTINE=1 LOWCODER_BASE_URL=http://localhost:1 ./node_modules/.bin/playwright test --list --reporter=list +E2E_INCLUDE_SUPERADMIN=1 LOWCODER_BASE_URL=http://localhost:1 ./node_modules/.bin/playwright test --list --reporter=list +E2E_INCLUDE_INSERT_ALL=1 E2E_INCLUDE_QUARANTINE=1 E2E_INCLUDE_SUPERADMIN=1 LOWCODER_BASE_URL=http://localhost:1 ./node_modules/.bin/playwright test --list --reporter=list +E2E_STACK_PROFILE=enterprise LOWCODER_BASE_URL=http://localhost:1 ./node_modules/.bin/playwright test --list --reporter=list # the SEC-E tests only +``` diff --git a/e2e/CLAUDE.md b/e2e/CLAUDE.md new file mode 100644 index 0000000000..43bb250696 --- /dev/null +++ b/e2e/CLAUDE.md @@ -0,0 +1,6 @@ +@AGENTS.md + +## Claude Code notes + +- A hook may prefix shell commands with `rtk`. When the tool reports that a hook changed the call, re-issue the Bash + call unchanged, with exactly the input the message quotes. diff --git a/e2e/README.md b/e2e/README.md new file mode 100644 index 0000000000..18bbc52091 --- /dev/null +++ b/e2e/README.md @@ -0,0 +1,606 @@ +# Lowcoder end-to-end tests (Playwright) + +Playwright suite (Chromium only) for the Lowcoder all-in-one Docker image. It checks that the web client and the +bundled backend work together: sign-up and sign-in, app lists, the editor (insert, move, resize, rename, properties, +queries), the published view, PostgreSQL queries and tables, query triggers, temporary state, local storage, modules, +the Extensions panel and the visual components. Apps are seeded through the HTTP API from DSL built by helpers +(`src/dsl/builders.ts`) and opened in the published view; the editor is driven only where the editor is the subject. + +Rules for writing or changing tests: [AGENTS.md](AGENTS.md). + +Not covered: Firefox and WebKit; the multi-container compose setup; databases other than PostgreSQL; the server and +node-service as separate units; any request to a real external host (the network guard blocks them); the app-level +layouts `navLayout` and `mobileTabLayout` (open decision). The functional behaviour of the nine components that need a +cloud service, credentials, third-party scripts or a device (3 Agora meetings, `turnstileCaptcha`, `scanner`, +`chartsGeoMap`, `openLayersGeoMap`, `hillchart`, `jsonLottie`, the components of the "cloud service or device" class) is not covered; their structural +lifecycle (insert, save, publish, load) is covered by S1 when `@insert-all` runs. No CI workflow runs this suite +(`.github/workflows/` has no e2e job). + +`e2e/evidence/` is git-ignored, local only, and is never a source for claims in git. + +## Architecture + +- **Image under test:** `lowcoderorg/lowcoder-ce:3.0.0-e2e` = the published `3.0.0` all-in-one image with its web client + rebuilt from tag `3.0.0` plus [client-hooks.patch](client-hooks.patch). The patch adds test hooks (`data-editor-ready`, + `data-testid="insert-comp-"` on insert-panel tiles, `role="tab"`/`role="tablist"`, `data-comp-name`), but it also + touches the editor's save code (`appEditorInternal.tsx`). A defect found on this image is assumed to exist in 3.0.0 + only where the patch does not touch the involved code; that equivalence is NOT VERIFIED. The image is a locally built tag. +- **Isolated Docker network per run:** `scripts/run-in-docker.sh` creates `lowcoder-e2e--net`, starts the app + container and a PostgreSQL sidecar, waits for `GET /api/configs`, runs Playwright from + `mcr.microsoft.com/playwright:v1.64.0-noble` with `e2e/` bound at `/work`, and removes everything on exit. Every run + executes `npm ci` inside the runner, so the runner needs access to the npm registry (and Docker must be able to pull + the images) even when `@npm` tests are excluded. There is no offline mode. +- **PostgreSQL sidecar:** `postgres:17-alpine` (pinned by digest) with `fixtures/sql/init.sql`: `items` (2 rows), + `products` (25 shared read-only rows), `notes` (writes, owner-scoped). Host name in `E2E_POSTGRES_HOST`; connection + constants are `POSTGRES` in `src/constants.ts`. +- **HTTP echo sidecar** (`scripts/echo-server.js`, started by `run-in-docker.sh` on the already pinned runner image, so no extra image or + download; network alias `e2e-echo`, port 8080; the runner gets `E2E_ECHO_URL`): the target of the requests the SERVER makes inside the + app container (node-service's npm registry proxy, the n8n plugin). It records `{ method, path, headers, body }` of every request in + memory (bodies cut at 65536 bytes, 10000 records kept) and answers `{}`; `GET /__e2e/requests?prefix=

` returns the records whose + path starts with `

`. The `echo` fixture of `src/fixtures.ts` gives each test its own target `/t/---` + (`url`, `received()`), so parallel tests never read each other's records; its one request context is created on first use and + disposed after the test. The records die with the container (`cleanup` removes it however the run ends). Limits: the browser guard + does not apply to these requests (they are made by the backend), so the echo is the only host the tests point the backend at; the + sidecar starts in every run, also on the enterprise profile; an echo test that finds nothing proves nothing unless a positive control + shows that the echo does receive from that path (every denial row of `outbound*.spec.ts` has one). The app and runner containers resolve `e2e-echo` through `--add-host e2e-echo:` (read with `docker inspect` after the sidecar starts), not DNS: measured with the sidecar stopped, `getent hosts e2e-echo` in the app container printed the sidecar's network IP and `curl` failed with "No route to host" (the runner got ECONNREFUSED on the same IP); without the entry the name resolved to a LAN address on the measuring host. +- **Canned answers** (the same sidecar): `POST /__e2e/answers { prefix, status, contentType, body }` makes requests whose path starts with `prefix` (any method, query string ignored) get that answer instead of `{}`; they are still recorded. One entry per prefix (the latest wins), the longest matching prefix answers, 10000 entries at most (the oldest dropped); an invalid entry (prefix not starting with `/`, status outside 100-599, a non-string body or content type, a body over 65536 bytes) is 400 and changes nothing. `EchoTarget.answer(subPath, { status, body, contentType })` of the `echo` fixture sets one below the test's own target; it uses Node's `fetch` (a canned answer may hold a token). `src/lifecycle/mock-idp.ts` builds a mock Generic OAuth provider on it (token and user-info endpoints on the test's target); the server calls them itself, the browser never visits the provider, so a test signs in with the client's own call `POST /api/auth/tp/login` and a made-up code. +- **Mail sink** (the same sidecar, SMTP on port 2525; the app gets `LOWCODER_ADMIN_SMTP_HOST=e2e-echo`, port 2525, no login, no STARTTLS): accepts every + mail the SERVER sends (password reset, invitation) and delivers it nowhere. One record `{ from, to[], data }` per message (`data` is the message as + latin1 text, dot-stuffing undone; the 65536-byte cut counts the bytes as sent, before dot-stuffing is undone; 10000 records kept); `GET /__e2e/mails?to=

` answers those sent to an address + (case-insensitive). Parsing is stream-safe (a command or the end of data may arrive in any number of TCP chunks); only EHLO, HELO, MAIL, RCPT, + DATA, RSET, NOOP and QUIT are understood, anything else is 502. The `mailbox` fixture (`mailsTo`, `waitForMail`) reads it with Node's `fetch`, never a + Playwright request context: a context created during a test lands in the trace, and the mails hold reset tokens (measured: a trace of a + `newContext` read held the mail body, a trace of the `fetch` read held none). `src/lifecycle/mail.ts` parses a mail (nested multipart, 7bit, 8bit, + binary, quoted-printable, base64, charsets, encoded-word subjects) and takes the token out of a reset link (`resetTokenOf`) or the code out of an + invitation (`inviteCodeOf`). Limits: no STARTTLS, no AUTH, and mails live for the whole run, so a test uses an address of its own. The links of the + mails carry the configured public URL as is; the run script's URL ends in a slash, so the links read `http://lowcoder-e2e-app:3000//user/auth/lost-password?token=...` + (a property of this run's setting, not a defect). +- **Fixed app host name `lowcoder-e2e-app`** (`scripts/app-host.sh`): network alias of the app container; + `LOWCODER_BASE_URL` is `http://lowcoder-e2e-app:3000`. Reason: the client's hocuspocus URL + (`REACT_APP_HOCUSPOCUS_URL=ws://lowcoder-e2e-app:3000/hocuspocus`) is baked in at client build time and the guard + compares every WebSocket host with the host of `LOWCODER_BASE_URL`. The name exists only inside a run's network; with + `E2E_HOST_PORT` the chat components do not connect in a host browser. +- **Network guard** (`src/fixtures.ts`): HTTP(S) requests of a context to another origin are aborted with + `blockedbyclient`; WebSockets to another host are closed with `socket.close()`. Service workers are blocked. The guard + is installed only by the custom `test` exported from `src/fixtures.ts` (automatic fixture `networkGuard`, and + `newUserSession` for further contexts). A spec that imports `test` from `@playwright/test` bypasses it; always import + `test` and `expect` from `src/fixtures` (stack-free unit specs that open no page are the accepted exception, `AGENTS.md` section 8). `blocked-requests.txt` is attached only for the primary `networkGuard`; + URLs blocked in a `newUserSession` context are not attached. The guard covers browser contexts, not requests made by + the backend inside the app container (which needs internet only for `@npm`: node-service fetches npm packages). +- **Users and isolation:** most tests use the `apiUser` fixture (own user and organisation, registered through the + API). Exceptions: stack-free unit tests register no user (the `actor` fixture of the security helpers registers its own users), `smoke/signup.spec.ts` registers through the UI, and + `auth/login.spec.ts` calls `registerUser` directly. Writes to `notes` are scoped by an `owner` value; `products` is + shared and read-only. +- **Config** (`playwright.config.ts`): `testDir ./tests`, 4 workers, test timeout 60 s, expect timeout 15 s, viewport + 1600x1000, `fullyParallel`. One global retry exists and only under `CI` (`retries: IS_CI ? 1 : 0`); S1 and M3 switch it + off with `test.describe.configure({ retries: 0, ... })`. Reporters: list, html, junit and the D-3 threshold reporter. + `LOWCODER_BASE_URL` is required. + +## Quick start + +All commands run from the repository root unless a directory is stated. Paths after `run-in-docker.sh` are relative to +`e2e/` (it is bound at `/work`), so write `tests/smoke/signup.spec.ts`, not `e2e/tests/...`. + +Prerequisites for running: Docker (network, pulls of the app, PostgreSQL and Playwright images), `flock` (macOS: +`brew install flock`), network access to the npm registry from the runner. + +Prerequisites for building the image (`e2e/scripts/build-e2e-image.sh`, several minutes): git with the ref `3.0.0` +present locally (`CLIENT_REF`), `tar`, `patch`, Docker, network access for image pulls, `apt-get` and `yarn --immutable` +inside the build container. + +```bash +# repository root, once: build the image under test +e2e/scripts/build-e2e-image.sh + +# repository root: default selection on a fresh stack (removed afterwards) +e2e/scripts/run-in-docker.sh + +ls e2e/playwright-report e2e/test-results +``` + +Checks without a stack, from `e2e/`: + +```bash +cd e2e +npm ci +./node_modules/.bin/tsc --noEmit # success = exit status 0 and no TypeScript diagnostics +LOWCODER_BASE_URL=http://localhost:1 ./node_modules/.bin/playwright test --list --reporter=list +``` + +Always add `--reporter=list` to `--list`: the configured html and junit reporters write into `playwright-report` and +`test-results` and fail in a read-only workspace. + +## Run recipes + +Repository root. Arguments after the script go to `playwright test`. + +```bash +e2e/scripts/run-in-docker.sh # default run +e2e/scripts/run-in-docker.sh tests/smoke/signup.spec.ts # one file +e2e/scripts/run-in-docker.sh tests/smoke/signup.spec.ts:6 # one test (file:line) +e2e/scripts/run-in-docker.sh -g "sign-up through the UI" # one test by title +e2e/scripts/run-in-docker.sh --grep @smoke # by tag: @smoke @core @slow @npm +E2E_INCLUDE_QUARANTINE=1 e2e/scripts/run-in-docker.sh --grep @quarantine +E2E_INCLUDE_SUPERADMIN=1 e2e/scripts/run-in-docker.sh --grep @superadmin # SEC-R16a, SEC-R16b (R16c, R16d also need E2E_INCLUDE_QUARANTINE=1) +E2E_INCLUDE_INSERT_ALL=1 E2E_INCLUDE_QUARANTINE=1 E2E_INCLUDE_SUPERADMIN=1 e2e/scripts/run-in-docker.sh # everything on the default stack (not the @enterprise tests) +E2E_STACK_PROFILE=enterprise e2e/scripts/run-in-docker.sh tests/security/enterprise.spec.ts # the ENTERPRISE stack, SEC-E01 to E04, E06a, E06b +E2E_STACK_PROFILE=signup-disabled e2e/scripts/run-in-docker.sh tests/auth/signup-disabled.spec.ts # the stack with e-mail sign-up switched off, LC-AU20 to AU24 +E2E_INCLUDE_QUARANTINE=1 E2E_INCLUDE_ENTERPRISE_TAKEOVER=1 E2E_STACK_PROFILE=enterprise e2e/scripts/run-in-docker.sh # SEC-E05 ALONE (no other test), on its own stack +``` + +Gates (a gate run must not pass `--reporter=...`, see below): + +```bash +# General repeat gate for a new or changed test or file (repository root) +e2e/scripts/run-in-docker.sh --repeat-each=10 --workers=4 tests/components/inputs.spec.ts + +# S1, the insert-every-component test (112 tests): ONCE, not --repeat-each; nightly command (repository root) +E2E_INCLUDE_INSERT_ALL=1 e2e/scripts/run-in-docker.sh --grep @insert-all --workers=4 + +# M3, the module host built in the editor (repository root) +e2e/scripts/run-in-docker.sh --repeat-each=10 --workers=4 tests/modules/module-editor-host.spec.ts + +# The ENTERPRISE stack (SEC-E01 to E04, E06a, E06b): not part of the P0 set, not pull-request blocking (repository root) +E2E_STACK_PROFILE=enterprise e2e/scripts/run-in-docker.sh --repeat-each=10 --workers=4 tests/security/enterprise.spec.ts +``` + +`--workers` only works as a CLI argument: `run-in-docker.sh` does not forward `E2E_WORKERS` into the runner. +A CLI `--reporter=...` REPLACES the reporters of `playwright.config.ts`, including the D-3 threshold reporter, so a +real S1 or M3 gate must not use it; a passing run prints `D-3 gate within the limit: ...` on stderr, and a missing line +means the gate did not run. `--reporter=list` is for `--list` only. + +Tags (`TAGS` in `src/constants.ts`): + +| Tag | Meaning | In default run | +|---|---|---| +| `@smoke` | fastest checks of the harness and the main flow | yes | +| `@core` | main user flows of the base suite | yes | +| `@slow` | noticeably longer (PostgreSQL, npm, many steps) | yes | +| `@npm` | needs the app container to reach the npm registry | yes | +| `@quarantine` | asserts the desired behaviour of a known product defect and fails today | no, `E2E_INCLUDE_QUARANTINE=1` | +| `@insert-all` | S1: insert, save, publish and load each of the 112 types | no, `E2E_INCLUDE_INSERT_ALL=1` | +| `@security` | access-control tests of `tests/security/` | yes (except the rows that also carry an opt-in tag) | +| `@lifecycle` | user-lifecycle tests, ids `LC-` (areas `AU PR AK WM GR SH PW DL IP OT`; `src/security/quarantine.ts`) | yes (quarantined ones excluded like `@security`) | +| `@enterprise` | the second stack in ENTERPRISE workspace mode (SEC-E01 to SEC-E06b, `tests/security/enterprise*.spec.ts`); SEC-E05 also carries `@quarantine`, `@enterprise-takeover` and `@superadmin` | no, never on the default stack; the only ones with `E2E_STACK_PROFILE=enterprise` (SEC-E05 aside) | +| `@enterprise-takeover` | SEC-E05 only: it resets the super admin's password, so it never shares a stack with another test | no, never on the default stack; on the enterprise profile only with `E2E_INCLUDE_ENTERPRISE_TAKEOVER=1` (plus `E2E_INCLUDE_QUARANTINE=1`), and then it is the ONLY test of the run | +| `@signup-disabled` | the third stack with `LOWCODER_EMAIL_SIGNUP_ENABLED=false` (LC-AU20 to LC-AU24, `tests/auth/signup-disabled.spec.ts`): every fixture that makes a user signs up, so nothing else runs there | no, never on another stack; the only tests of a run with `E2E_STACK_PROFILE=signup-disabled` | +| `@superadmin` | every test that uses the `superAdmin` fixture: SEC-R16a to SEC-R16d and the fixture test of `foundation/security-helpers.spec.ts` (D-47: they break a stack of more than about 420 workspaces); a guard test in `foundation/run-selection.spec.ts` fails when a spec has a test with that fixture and without the tag | no, `E2E_INCLUDE_SUPERADMIN=1` | + +Untagged is normal (most component, unit and helper tests). The three opt-in variables are independent; a test with several +opt-in tags runs only when all their variables are set (SEC-R16c and SEC-R16d carry `@quarantine` and `@superadmin`) (`src/run-selection.ts`). Tag strings inside `foundation/run-selection.spec.ts` are test +data; its tests are untagged. + +| Variable | Read by | Effect | +|---|---|---| +| `LOWCODER_E2E_IMAGE` | run-in-docker.sh | app image (default `...:3.0.0-e2e`; a missing default image stops the run) | +| `PLAYWRIGHT_IMAGE` | run-in-docker.sh | runner image; version must equal `@playwright/test` in `package-lock.json` (1.64.0) | +| `POSTGRES_IMAGE` | run-in-docker.sh | PostgreSQL sidecar image | +| `E2E_INCLUDE_QUARANTINE`, `E2E_INCLUDE_INSERT_ALL`, `E2E_INCLUDE_SUPERADMIN` | script and config | non-empty: include that opt-in group | +| `E2E_STACK_PROFILE` | run-in-docker.sh, config | `default` (the default), `signup-disabled` (the app container gets `LOWCODER_EMAIL_SIGNUP_ENABLED=false` and the run keeps only the `@signup-disabled` tests; `E2E_INCLUDE_QUARANTINE` is the only flag that applies) or `enterprise`: the app container gets `LOWCODER_WORKSPACE_MODE=ENTERPRISE` and the run keeps only the `@enterprise` tests (`grep`); another value stops the run. On the enterprise profile `E2E_INCLUDE_QUARANTINE` still opens the quarantined test (SEC-E05), `E2E_INCLUDE_INSERT_ALL` and `E2E_INCLUDE_SUPERADMIN` change nothing (the stack has one workspace, so the D-47 limit does not arise). A `--grep` of the command line narrows the profile's selection further; it does not replace it (measured with Playwright 1.64: enterprise profile with `--grep SEC-R01b` lists 0 tests, with `--grep SEC-E02` lists 1, with the default profile `--grep SEC-E02` lists 0) | +| `E2E_INCLUDE_ENTERPRISE_TAKEOVER` | run-in-docker.sh, config | non-empty, enterprise profile only (any other profile stops the script): run SEC-E05 alone; it is also quarantined, so `E2E_INCLUDE_QUARANTINE=1` is needed too | +| `E2E_HOST_PORT` | run-in-docker.sh | publish the app on `127.0.0.1:` while the run lasts | +| `E2E_WORKERS` | playwright.config.ts | worker count, effective only when `playwright test` is run directly; NOT forwarded by the script | +| `CI` | script, config | `forbidOnly` and one retry | +| `LOWCODER_BASE_URL` | config | origin under test; set by the script; any URL works for `--list` | +| `E2E_POSTGRES_HOST` | `src/postgres.ts` | set by the script | +| `E2E_ECHO_URL` | run-in-docker.sh, `src/security/echo.ts` (`ECHO_ENV`) | set by the script: `http://e2e-echo:8080`, the HTTP echo sidecar; the `echo` fixture throws, naming the variable, when it is missing | +| `E2E_SUPERUSER_USERNAME`, `E2E_SUPERUSER_PASSWORD` | run-in-docker.sh, `src/security/super-admin.ts` | set by the script for each run (a caller's value is overwritten; the password is random per run and never printed); the app gets the same pair as `LOWCODER_SUPERUSER_*` | +| `BASE_IMAGE`, `TARGET_IMAGE`, `CLIENT_REF` | build-e2e-image.sh | build inputs (defaults `...:3.0.0`, `...:3.0.0-e2e`, tag `3.0.0`) | + +Exit code: the one of `playwright test` once it started; before that the script's own failure decides it (lock held, +missing image, version mismatch, Docker, PostgreSQL or app start-up, `npm ci`). One run per checkout at a time (lock +`e2e/.run.lock`). Both scripts say "from any directory": that holds only when the path you type resolves; use the +repository root paths above. + +## Folder layout + +``` +e2e/ + package.json, package-lock.json @playwright/test 1.64.0, typescript + playwright.config.ts config; grep and grepInvert from src/run-selection.ts; D-3 reporter + tsconfig.json strict, noUncheckedIndexedAccess + client-hooks.patch test hooks applied to the 3.0.0 client + scripts/ run-in-docker.sh, build-e2e-image.sh, app-host.sh, echo-server.js (the HTTP echo sidecar and the mail sink) + fixtures/mail/ the two mails the 3.0.0 image sent (reset, invitation), with placeholders for address, token and code + fixtures/sql/init.sql PostgreSQL data: items, products, notes + fixtures/dsl/.json 112 DSL defaults recorded from the editor + fixtures/dsl/n8n/ n8nQuery.json (the query the editor saved for "Retrieve all workflows", reduced to type and action) and n8nDatasource.json (the data source form's create body, without workspace, target or key); no id or timestamp of the recording session survives (a unit test checks); a subfolder so the component catalog test does not count them + src/ + constants.ts TAGS, RUN_FLAGS, D3_RETRY_ANNOTATION, API paths, timeouts with reasons, PRODUCTS, labels + fixtures.ts `test` with networkGuard, apiUser, newUserSession, actor, superAdmin; uniqueEmail + run-selection.ts grepInvert from the three opt-in variables, grep from the stack profile + postgres.ts postgresConnection() + media.ts data: URI fixtures (PNG_RED, PNG_BLUE, WAV, WEBM, MP4, PDF, PDF_RAW_B64) + api/client.ts HTTP API helpers + dsl/builders.ts DSL builders; dsl/recorded.ts loads fixtures/dsl (RecordedFixtureError) + pages/ page objects: AppList, AppView, Auth, Datasource, Editor, Extensions panel, Login, Property panel, Query panel, Setting, TableView, UserMenu + logic/helpers.ts rawLocalStorage, countAfterEquals, parseCounter, expectTextStays, DEBOUNCE_SETTLE_MS + datasource/notes-queries.ts query builders: shared read-only products, owner-scoped notes + components/ insert-all.ts (S1 helpers), insert-catalog.ts (112 types), scenario.ts (boundText, withValueAt, openSeededView) + simple-components/seed.ts container and slot seeds, openSeededApp + modules/moduleScenario.ts module scenario DSL, saved-instance polling, HandlerRetryBudget + security/echo.ts `echoTargetPath`, `echoReadPrefix`, `echoBaseUrl`, `recordsContain` (boolean: never prints the needle), `EchoRecord`, `EchoTarget` (the `echo` fixture) + security/actors.ts, scene.ts, quarantine.ts, assertions.ts, tokens.ts, super-admin.ts security helpers (joinWorkspace, makeDeveloper, grantApp, seedPrivateApp, adminOfApiUser, sceneOf, memberOf, roleOf), the quarantine list and `securityCandidateDetails`, `expectAnswer` (status and code), forged, unsigned and wrongly signed API-key tokens, `superAdminCredentials` (reads `SUPER_ADMIN_ENV`); security/enterprise.ts: `enterpriseAdmin` (the admin of the one workspace of the ENTERPRISE stack) + reporters/d3-threshold-reporter.ts fails the run when more than half of S1 or M3 tests carry `D-3 retry` + tests/ specs by area (catalogue below) + evidence/ git-ignored, local only + playwright-report/, test-results/ git-ignored output of the last run +``` + +## Scenarios + +Test titles carry these ids. + +- LC- user-lifecycle tests (`@lifecycle`, quarantined through the same two maps as the SEC ids). Built: OT01 to OT05 (the new-user tour, the profile counts, navigation by role, the member detail and the admin sign-in page, `apps/onboarding.spec.ts` and `account/other.spec.ts`), AU20 to AU24 (the sign-up-disabled stack, `auth/signup-disabled.spec.ts`), AU01 to AU16 (sign-up and sign-in edge cases, `auth/signup-edge.spec.ts` and `auth/signin-session.spec.ts`), PR01 to PR15 (profile and password, `account/profile.spec.ts` and `account/password.spec.ts`), PW01 to PW15 (password recovery and invitation mails, `auth/password-recovery.spec.ts`), DL01 to DL11 (leaving, removal and workspace deletion, `workspace/leave-removal.spec.ts`), IP01 to IP05, IP07, IP08 (sign-in provider configuration, `auth/providers-config.spec.ts`), IP10 to IP15 (sign-in through a mock provider, `auth/providers-login.spec.ts`), AK01 to AK08 (API keys, `account/api-keys.spec.ts`), WM01, WM03, WM04, WM06, WM08 to WM12 (members and workspaces in the UI, `workspace/members-gui.spec.ts` and `workspace/workspaces-gui.spec.ts`), GR01 to GR10 (groups, `workspace/groups-gui.spec.ts`), SH01 to SH06 (sharing, `workspace/share-gui.spec.ts`). + +- S1 insert, save, publish, load every one of the 112 types (`@insert-all`; catalog unit tests in `insert-catalog.spec.ts`). +- S2 text inputs; S3 choice components; S4 date and time; S5 sliders and colour picker; S6 buttons and menus; S7 display components. +- S8 containers and slots; S9 overlays (modal, drawer, toast, tour); S10 forms; S11 file, signature, rich text, custom. +- S12 media (data: URIs); S13 listView and grid; S14 timer; S15 npm-loaded components (render only). +- S16 npm plugins in the Extensions panel; S17 AI Chat; S18 chat controller and iframe; S19 npm templates; S20 chat box. +- L1 temporary states; L2 local storage; L3 query triggers. +- D1 a PostgreSQL query feeds a text and a table, write queries re-read; D2 table with query data (sort, page, filter, edit). +- M1 two module instances, every direction across the boundary; M2 which module version a host shows; M3 host built in the editor. + +## Test catalogue + +Counts: `LOWCODER_BASE_URL=http://localhost:1 ./node_modules/.bin/playwright test --list --reporter=list` from `e2e/`: +default **612 tests in 102 files**; with `E2E_INCLUDE_QUARANTINE=1` **684 in 104**; with `E2E_INCLUDE_SUPERADMIN=1` **615 in 102**; with both of those **689 in 104**; +with `E2E_INCLUDE_INSERT_ALL=1` **724 in 103**; with all three opt-in variables **801 in 105** (the takeover variable changes nothing on the default stack). With `E2E_STACK_PROFILE=enterprise`: +**6 in 1** (SEC-E01 to E04, E06a, E06b; also with `E2E_INCLUDE_QUARANTINE=1` alone), **1 in 1** with `E2E_INCLUDE_QUARANTINE=1 E2E_INCLUDE_ENTERPRISE_TAKEOVER=1` (SEC-E05 alone), **0** with the takeover variable alone (SEC-E05 is quarantined too); `E2E_INCLUDE_INSERT_ALL` and `E2E_INCLUDE_SUPERADMIN` add nothing there. `@enterprise` is 7 tests, none in a default-stack listing. With `E2E_STACK_PROFILE=signup-disabled`: **5 in 1** (LC-AU20 to AU24). +Default-run tag counts: `@smoke` 5, `@core` 57, `@slow` 39, `@npm` 32, `@security` 99. On request: `@quarantine` 74 (72 with `E2E_INCLUDE_QUARANTINE=1` alone; the two that +also carry `@superadmin` need both variables), `@superadmin` 5 (the four SEC-R16 tests and the `superAdmin` fixture helper test), `@insert-all` 112. `@lifecycle` 88 (user-lifecycle tests, ids `LC-`, default run; 21 more are quarantined: LC-AK04, LC-AK08, LC-AU07, LC-AU15, LC-GR03, LC-GR09, LC-PR06, LC-PR13, LC-PR14, LC-PW08, LC-PW09, LC-PW10, LC-PW11, LC-PW12, LC-PW14, LC-PW15, LC-DL03, LC-DL04, LC-IP07, LC-IP14, LC-OT02). + +### smoke (4) + +| File | Proves | Tags | Tests | +|---|---|---|---| +| smoke/signup.spec.ts | sign-up through the UI lands on the empty app list | @smoke | 1 | +| smoke/published-view.spec.ts | an API-seeded app renders in the published view | @smoke | 1 | +| smoke/editor-drag.spec.ts | a component dragged from the insert panel is on the canvas and saved (D-3 prone) | @smoke | 1 | +| smoke/network-guard.spec.ts | requests to lowcoder.cloud are blocked, the app is let through | @smoke | 1 | + +### auth, workspace, apps (52), account (23) + +| File | Proves | Tags | Tests | +|---|---|---|---| +| auth/login.spec.ts | sign-in and sign-out; wrong password stays on sign-in | @core | 2 | +| auth/signup-edge.spec.ts | LC-AU01 to AU08, AU15, AU16: a registered address in any casing, a malformed address, the password rules of the form, the invitation link, a workspace sign-up page, a mismatched confirmation (LC-AU07 and LC-AU15 are quarantined: D-48 password rule, D-30) | @lifecycle, @core for AU08, @quarantine for 2 | 10 (8 default) | +| auth/signin-session.spec.ts | LC-AU09 to AU14: unknown address, choosing among two workspaces, UI sign-out ends the server session, cookie lifetime, redirects of signed-in and anonymous visitors | @lifecycle, @core for AU11 | 6 | +| auth/password-recovery.spec.ts | LC-PW01 to PW15: the forgot page mails one reset link, the reset page sets the password from the link, a token works once, a new request kills the earlier token, a wrong or another user's token is refused, the answer hides whether an address has an account, the invitation mail from the dialog lets the addressee in (LC-PW08 D-34, PW09 D-56, PW10 D-57, PW11 D-58, PW12 D-54, PW14 D-18, PW15 D-55 quarantined). Trace off: the pages and requests carry tokens | @lifecycle, @core for PW02, @quarantine for 7 | 15 (8 default) | +| auth/signup-disabled.spec.ts | LC-AU20 to AU24 on the sign-up-disabled stack: a sign-up through the API is refused (400 / 5003), the register page redirects to the sign-in page, the sign-in page and an invitation page offer no sign-up, an admin's create-user call is refused | @lifecycle, @signup-disabled | 5 (0 on the default stack) | +| auth/providers-config.spec.ts | LC-IP01 to IP05, IP07, IP08: an admin adds a GitHub provider in the UI, the workspace's sign-in page offers it, a disabled one leaves the page, a deleted one is gone, the last sign-in method cannot be switched off in the UI (notice and disabled button), a second configuration of one type is refused (LC-IP07 quarantined: D-61), the Generic form requires its issuer endpoint. LC-IP06 is not built (O-17) | @lifecycle, @quarantine for 1 | 7 (6 default) | +| auth/providers-login.spec.ts | LC-IP10 to IP15: sign-in through a mock Generic OAuth provider on the test's echo target (`POST /api/auth/tp/login` with a made-up code): a first sign-in creates the user (one token call with client id, secret and code, one user-info call with the bearer), the same provider user is the same account, registration off refuses an unknown user (400 / 5618), an error answer of the token endpoint fails the sign-in (500 / 5601), the profile binds an e-mail with which the user then signs in (LC-IP14 quarantined: D-62, an address that belongs to a form user signs in as that user) | @lifecycle, @quarantine for 1 | 6 (5 default) | +| account/profile.spec.ts | LC-PR01 to PR08, PR15: display name on the profile page and in the My Profile modal, an empty name refused, avatar upload, SVG refused, an oversized avatar (LC-PR06 quarantined: D-50), delete, UI language, status flags | @lifecycle, @quarantine for 1 | 9 (8 default) | +| account/password.spec.ts | LC-PR09 to PR14: password change in the modal, a wrong old password, the rule, a blank old password, replacing a password without the old one (LC-PR13 quarantined: D-49), a weak new password (LC-PR14 quarantined: D-48) | @lifecycle, @core for PR09, @quarantine for 2 | 6 (4 default) | +| account/other.spec.ts | LC-OT02 to OT05: the profile's "Info" count of created apps (LC-OT02 quarantined: D-63), a plain member's "Homepage (Org)" tab and missing settings against a developer's, an admin's member "Detail" popup, the admin sign-in page signs in any user | @lifecycle, @quarantine for 1 | 4 (3 default) | +| account/api-keys.spec.ts | LC-AK01 to AK08: a key created in the UI authenticates, the token is shown once and listed masked, a key deleted in the UI stops working, no key card for a plain member, a name is required, a key follows the user's current workspace, two keys of one second never share a token (LC-AK04 quarantined: D-45; LC-AK08: D-51, both fixed on the branch) | @lifecycle, @quarantine for 2 | 8 (6 default) | +| workspace/members-gui.spec.ts | LC-WM01, WM03, WM04, WM06, WM12: the All Users group page (group roles, Remove from Group leaves the membership: O-16), the invite dialog's link lets a user in, a plain member has no settings and the API leave works, an unknown invitation code | @lifecycle, @core for WM04 | 5 | +| workspace/workspaces-gui.spec.ts | LC-WM08 to WM11: Create Workspace in the avatar menu, switching, renaming, deleting with the exact name | @lifecycle | 4 | +| workspace/leave-removal.spec.ts | LC-DL01 to DL11: a removed member leaves the groups and loses its app grants (and does not get them back on rejoin), a leave cleans the same, an app of a removed developer stays with the workspace, a removed user keeps its account and own workspace, a user in no workspace is told 'User not found', deleting a workspace removes it for its members and its groups can no longer be read, its apps can no longer be opened, its invitation admits nobody (LC-DL03 D-59 and LC-DL04 D-60 quarantined) | @lifecycle, @quarantine for 2 | 11 (9 default) | +| workspace/groups-gui.spec.ts | LC-GR01 to GR10: create, rename (an empty name refused), delete (a deleted group's grant stays: D-53, LC-GR03), add members, group roles, remove, exit (the only group admin cannot), the built-in groups (LC-GR09: D-52), the developers group makes a developer | @lifecycle, @quarantine for 2 | 10 (8 default) | +| workspace/share-gui.spec.ts | LC-SH01 to SH06: the share dialog of the editor (add a viewer, change to editor, remove, the public switch, no Publish button for a non-owner editor) and the data source's Access Control (Can Use) | @lifecycle, @core for SH01 | 6 | +| workspace/member-access.spec.ts | invited member sees only shared apps; invitation link flow | @core | 2 | +| apps/public-app.spec.ts | public app renders for an anonymous visitor, a private one does not | @core | 1 | +| apps/publish-draft.spec.ts | published view shows the last published version, not the draft | @smoke @core | 1 | +| apps/onboarding.spec.ts | LC-OT01: a new user who signs up through the UI sees the tour, closing it stores `newUserGuidance` and it does not return after a reload | @lifecycle | 1 | +| apps/trash-restore.spec.ts | trash and restore | @core | 1 | +| apps/card-menu.spec.ts | export/import, duplicate, rename, trash from the card menu | @core | 4 | + +### editor (6) + +| File | Proves | Tags | Tests | +|---|---|---|---| +| editor/edit-property.spec.ts | a property edit is shown, saved, survives a reload | @core | 1 | +| editor/rename-component.spec.ts | rename on canvas, in the saved app, after reload | @core | 1 | +| editor/move-resize.spec.ts | drag and resize handle are saved | @core | 2 | +| editor/js-query.spec.ts | a JS query written in the editor runs | @core | 1 | +| editor/drop-size.spec.ts | a component dropped right after ready has width above 0 (D-5) | @quarantine | 1 | + +### datasource (10) + +| File | Proves | Tags | Tests | +|---|---|---|---| +| datasource/postgres.spec.ts | PostgreSQL query written in the editor; published app shows its data | @core @slow | 2 | +| datasource/table.spec.ts | D2: editor-built table bound to a query; published table; sort, page, select, filter, notes edit/save | @core @slow | 3 | +| datasource/query-feeds-components.spec.ts | D1: query feeds text and table, owner-scoped writes re-read, chart renders | @core @slow @npm | 1 | +| datasource/notes-queries.spec.ts | unit tests of the query builders | none | 4 | + +### logic (21) + +| File | Proves | Tags | Tests | +|---|---|---|---| +| logic/state-and-queries.spec.ts | load query, button sets temp state, local storage survives reload | @core | 3 | +| logic/temporary-state.spec.ts | L1: state set by event, JS query, query event; transformer, data responder; `setIn` error path (CD-7) | @core | 2 | +| logic/local-storage.spec.ts | L2: local storage component | @core | 1 | +| logic/triggers.spec.ts | L3: page load, manual, input change, timeout, periodic, condition, before unload | @core, one also @slow | 6 | +| logic/helpers.spec.ts | unit tests of `src/logic/helpers.ts` (with `expectCountStays`) | none | 10 | + +### modules (10) + +| File | Proves | Tags | Tests | +|---|---|---|---| +| modules/module-io-events.spec.ts | M1: two instances of one module: inputs, output, method, event | none | 1 | +| modules/module-versions.spec.ts | M2: which module version a host shows | none | 2 | +| modules/module-editor-host.spec.ts | M3: host built in the editor, D-3 retry and handler retry | @slow | 1 | +| modules/module-helpers.spec.ts | unit tests of `src/modules/moduleScenario.ts` | none | 6 | + +### components (101 default, 214 with S1 and the quarantined one) + +| File | Proves | Tags | Tests | +|---|---|---|---| +| components/inputs.spec.ts | S2 typed value reaches the bound text of every input component | none | 1 | +| components/choices.spec.ts | S3 one action per choice component changes only its bound text | none | 1 | +| components/date-time.spec.ts | S4 typed dates and times; invalid date refused | none | 1 | +| components/sliders-color.spec.ts | S5 slider, rangeSlider, colorPicker | none | 1 | +| components/buttons.spec.ts | S6 each button, link, dropdown, navigation, step, floatingButton handler | none | 1 | +| components/displays.spec.ts | S7 bound properties change on state change; icon cases | none, @quarantine for the icon switch | 3 | +| components/containers.spec.ts | S8 container bodies and slots | none | 8 | +| components/overlays.spec.ts | S9 modal, drawer, toast, tour | none | 4 | +| components/forms.spec.ts | S10 form, jsonSchemaForm | none | 3 | +| components/rich-inputs.spec.ts | S11 file, signature, richTextEditor, custom | none | 4 | +| components/media.spec.ts | S12 image, carousel, avatarGroup, comment, card, audio, video, fileViewer | none | 8 | +| components/lists.spec.ts | S13 listView and grid rows | none | 5 | +| components/timer.spec.ts | S14 display runs, stops after Pause, `pause` event (CD-3 limits it) | none | 1 | +| components/chat.spec.ts | S17 AI Chat, S18 chat controller, S20 chat box | none | 7 | +| components/iframe.spec.ts | S18 `url` decides `src` | none | 1 | +| components/npm-components.spec.ts | S15 npm components render; calendar with a pinned clock; barChart bound to a query (annotation CD-5) | @npm @slow | 26 | +| components/npm-plugins.spec.ts | S16/S19 npm plugin and template listed, kept after reload | @npm | 3 | +| components/insert-catalog.spec.ts | S1 catalog and saved-DSL helpers (unit tests) | none | 10 | +| components/insert-all.spec.ts | S1 every one of the 112 types inserts, saves, publishes, loads | @insert-all @slow | 112 | +| components/scenario-helpers.spec.ts | unit tests of `src/components/scenario.ts` | none | 5 | +| components/simple-helpers.spec.ts | unit tests of `src/simple-components/seed.ts` | none | 9 | + +### security (98 default; 47 more with `E2E_INCLUDE_QUARANTINE=1`; 4 more with `E2E_INCLUDE_SUPERADMIN=1`, SEC-R16c and R16d only with both variables; needs the stack) + +Access-control tests, API level plus UI checks in SEC-R01a, R02a, R04a+, R05b, R06b, R06d+, R07a, R07c, R08d, R10b, R11a, R13, A06a, A11 and the UI rows of the cross-workspace tests (page objects `SettingPage`, `DatasourcePage`, `AppListPage`, `AppViewPage`, `EditorPage`; where a measurement contradicts the expected UI behaviour, the test encodes what was measured and says so). +Titles are `SEC- `, tags `@security` (the P0 set also `@core`); each denial asserts HTTP status and `code` (`API_ERRORS`; exceptions: SEC-A10b, whose desired answer is only "no workspace id in the body", SEC-R15c, which accepts the two refusals of the folder grant but asserts one exact answer for the decisive step, and the rows that are not a denial, SEC-A11 to A13); the +scenarios that try to change something also read the resource back with the owner's session (read-only scenarios assert a before control +and the denial). A scenario that asserts the desired behaviour and fails on the 3.0.0 image is `@quarantine` with the `defect` annotation +of `src/security/quarantine.ts` (`FIXED_ON_BRANCH`, `OPEN_DEFECTS`); a failure nobody expected is first a "candidate" (`securityCandidateDetails`, annotation ` candidate: ...`) until it gets a D id in the table "Security findings" below; none is open now. +The P0 set is 22 of them, selected by id (repository root; the trailing space in the pattern keeps `SEC-C03` from matching `SEC-C03x`): +`e2e/scripts/run-in-docker.sh --grep "SEC-(C01a|C02a|C03|C06|C12a|C12b|C14a|C16d|R01b|R02a|R02b|R02c|R03d|R03e|R06a|R07a|R10b|R10c|A01a|A03a|A06a|A07b) "`. +The set tests the 3.0.0 server and the 3.0.0 client of the image, not a pull request's client. + +Outbound requests of the server (SEC-X01a to X01d, X02a, X02b; the HTTP echo sidecar of "Architecture"): the app is pointed at the test's own echo target and the +echo's records are read back. SEC-X01 (`security/outbound.spec.ts`): an org admin points the workspace's npm registry at the echo (`setNpmRegistry`, a +dummy bearer token `e2e-dummy-`); X01a+ is the positive control (the admin's `GET /api/npm/registry/{app}/e2e-pkg` reaches the echo with +the token), X01b and X01c (D-35, open) assert that an anonymous caller and a signed-in outsider are refused (4xx) and that nothing of their +call reaches the echo (both are asserted softly, so a failure reports both dimensions; each is shown after the admin's control call, so the echo can receive from that path), X01d+ shows that an anonymous +call on a PUBLIC app still reaches the echo (intended use: public apps load their npm components). SEC-X02 (`security/outbound-n8n.spec.ts`): an n8n data +source (`createN8nDatasource`, spec v1.1.1; X02b sets `forwardAllCookies: true`, the form's "Forward All Cookies") whose `serverURL` is the echo target and a saved query "Retrieve all workflows" (`n8nWorkflowsQuery`, recorded in +`fixtures/dsl/n8n/`); X02a+ is the positive control (the literal marker parameter and the data source's key arrive), X02b (D-27, fixed on this branch's server) +asserts, after a positive control that a benign cookie set in A's browser context does reach the echo, that the caller's session cookie value is in no record: the parameter is `{{LOWCODER_CE_SELFHOST_TOKEN}}` as the WHOLE value, because the 3.0.0 server puts every +request cookie into the plugin's evaluation context and a whole-value segment becomes the cookie entry, which the plugin sends as JSON in the URL (measured: the +cookie value appeared in the path; inside a longer string the entry prints as `[object Object]`). The cookie value is compared as a boolean and never put in a message; the +file turns the trace off because the echo's answer to a read would carry it. + +Super admin (SEC-R16a to R16d, `superAdmin` fixture of `src/fixtures.ts`): `run-in-docker.sh` creates the instance super admin +`e2e-superadmin@example.test` with a new random password per run and passes both values to the runner as `E2E_SUPERUSER_USERNAME` / +`E2E_SUPERUSER_PASSWORD` (name-only `docker run -e NAME`, so the password is on no command line; `SUPER_ADMIN_ENV` in `src/constants.ts` +holds the names). The 3.0.0 image honours `LOWCODER_SUPERUSER_USERNAME/PASSWORD` (measured: the sign-in works and the user is a +`super_admin` member of every new workspace). The account is shared by all workers: tests never switch its workspace or change its +password; SEC-R16c and R16d act only on the test's own workspace. Rules: the sign-in is an automatic worker fixture that runs before the +first test of a worker, because Playwright traces every request context created while a test runs (measured: a sign-in made inside a +test put the login body, with the password, into the trace and the HTML report). Leak check, measured with a deliberately failing +SEC-R16a: `find e2e/test-results e2e/playwright-report -name '*.zip' -exec unzip -p {} \; | grep -a -c '"loginId":"e2e-superadmin@example.test"'` +printed 1 when the test signed the super admin in through `page.request` (positive control) and 0 with the fixture alone. SEC-R16b also proves identity (the request context is signed in as the fixture user, which is a `super_admin` member of the workspace while a plain member is not), because on the 3.0.0 image any signed-in user can write a config key. A run +started without the two variables fails the super-admin tests at once with an error naming both variables; other tests are unaffected. +LIMIT (D-47, measured on the 3.0.0 image, cause not found, HEAD not measured): once the stack holds more than about 420 workspaces every +request of the super admin hangs until the gateway answers 504 (400 workspaces: about 100 ms; 450: 120 to 240 s; an early session does not +help). Each security test creates one to three workspaces, so `--repeat-each=10 tests/security` (about 1000 workspaces) failed SEC-R16a and +R16b from the third repeat. Therefore the four SEC-R16 tests carry the tag `@superadmin`: they are out of the default run and of every +`@security` or P0 run, and run only with `E2E_INCLUDE_SUPERADMIN=1 e2e/scripts/run-in-docker.sh --grep @superadmin` (R16c and R16d also carry +`@quarantine` and then need `E2E_INCLUDE_QUARANTINE=1` too). Keep such runs short. + +ENTERPRISE stack (SEC-E01 to SEC-E06b, `E2E_STACK_PROFILE=enterprise`): the same image started with `LOWCODER_WORKSPACE_MODE=ENTERPRISE` +(`run-in-docker.sh` adds the variable; there is no compose file). Measured on the 3.0.0 image: the container hands both +`LOWCODER_WORKSPACE_MODE` and the super-admin variables to the server. The super admin's own workspace is the ONE enterprise workspace +OE (SEC-E01: its name is "'s workspace", a new user's only workspace is OE, role `member`, the super admin is +`super_admin` there and has no other workspace). Creating a workspace is refused with 400 / 5003 (SEC-E06a), and the +lookup of workspaces by e-mail answers OE for a known and for an unknown address alike (SEC-E06b). OE has no admin but the super admin, so a test +signs up an actor and the super admin promotes it (`enterpriseAdmin`). True deactivation (SEC-E02 to E04): a removal by an admin marks the +user deleted (`markUserDeletedAndInvalidConnectionsAtEnterpriseMode`, state DELETED, connection sources renamed); measured: the removed user's +session and API key answer 401 without a body at once, and signing in again with its password answers 403 / 5608 (`INVALID_PASSWORD`, the answer of +a wrong password; no session results, the context stays anonymous). SEC-E05 (D-40) resets the super admin's password on a server with the +defect, so it lives alone in `security/enterprise-takeover.spec.ts`, tagged `@enterprise-takeover`, and runs on a stack of its own: the tag is +left out of every run unless `E2E_INCLUDE_ENTERPRISE_TAKEOVER=1` is set (with the enterprise profile and `E2E_INCLUDE_QUARANTINE=1`), and a run with +the flag selects that one test only (`grep` is then `/@enterprise-takeover/`), so it cannot break other tests; measured: the reset answers 200. +That file turns trace, screenshot and video off and passes no response body to any assertion, because the reset answer carries a new password +Leak check, measured on the 3.0.0 image: the run `E2E_INCLUDE_QUARANTINE=1 E2E_INCLUDE_ENTERPRISE_TAKEOVER=1 E2E_STACK_PROFILE=enterprise e2e/scripts/run-in-docker.sh` +failed as expected (200 instead of 400 / 5003). A script searched `test-results/`, `playwright-report/` (zip archives unpacked) and the run log for the two new +passwords the test saw (the control's and the attack's), printing only counts: 0 matches in 5 files and the log, with no trace archive written. The same search +with the trace switched on found both values (2 matches in 2 trace archives), so the search can see them. The control's reset does not leak either. +Rules for the one shared workspace: a test names only its own users, never counts the members of OE, and never removes, demotes or +re-passwords the super admin. The gate `--repeat-each=10 --workers=4 tests/security/enterprise.spec.ts` (60 tests) passed; the developer quota +of `checkDeveloperCount` was not reached with 40 admins in OE. The enterprise profile selects by tag, so the unit specs of `foundation/` do not run on it. +Listing, from `e2e/` (no stack): `E2E_STACK_PROFILE=enterprise LOWCODER_BASE_URL=http://localhost:1 ./node_modules/.bin/playwright test --list --reporter=list`. + +Sign-up-disabled stack (LC-AU20 to LC-AU24, `E2E_STACK_PROFILE=signup-disabled`): the same image with `LOWCODER_EMAIL_SIGNUP_ENABLED=false` (`run-in-docker.sh` +adds the variable). Whether anyone may sign up is a deployment setting, so it needs a stack of its own: every fixture that makes a user signs up, which is why that +profile runs only the `@signup-disabled` tests (`grep`) and no other test can use it. Measured on the 3.0.0 image: the FIRST sign-up of the stack passes (the code keeps +sign-up open while no workspace has an admin), every later one is refused 400 / 5003; the register page redirects to the sign-in page and the sign-in page has no "Sign Up"; +an invitation link opens the workspace's sign-in page with the inviter's heading and no "Sign Up"; an admin's `POST /api/users/new/{orgId}` is refused 400 / 5003 too. Each test +first makes sure some admin exists (accepting both answers), so none depends on the order. Listing, from `e2e/` (no stack): +`E2E_STACK_PROFILE=signup-disabled LOWCODER_BASE_URL=http://localhost:1 ./node_modules/.bin/playwright test --list --reporter=list`. + +| File | Proves | Tags | Tests | +|---|---|---|---| +| security/enterprise.spec.ts | SEC-E01 (new users join the super admin's workspace as members), E02 and E03 (a removed user's session and API key stop at once), E04 (a removed user cannot sign in again), E06a (no second workspace), E06b (no account oracle in the e-mail lookup) | @security, @enterprise, @superadmin for E01 to E04 and E06a | 6, only with `E2E_STACK_PROFILE=enterprise` | +| security/enterprise-takeover.spec.ts | SEC-E05 (D-40): an admin resets the super admin's password; alone on its own stack | @security, @enterprise, @enterprise-takeover, @superadmin, @quarantine | 1, only with `E2E_STACK_PROFILE=enterprise`, `E2E_INCLUDE_QUARANTINE=1` and `E2E_INCLUDE_ENTERPRISE_TAKEOVER=1` | +| security/cross-org.spec.ts | cross-workspace rows (C01 to C22): another workspace's app, datasource, query, settings, roles, members, folders, groups, permission rows; 18 tests are `@quarantine` (C09, C10, C11, C13, C15, C16b, C16c, C16f, C17a, C17b, C17c, C18b, C19a, C19b, C20, C21, C22e) | @security, @core for 8 (the P0 rows), @quarantine for 18 | 24 default + 18 quarantined (C17c has an API and a UI test) | +| security/bundles.spec.ts | C23 (another workspace's bundle cannot be viewed, recycled, shared, reordered, published, renamed or created in; C23a and C23c `@quarantine`) and R17 (a developer's bundle: R17a+ positive, R17d viewer cannot recycle or delete, R17e editor cannot grant owner, R17f the creator's recycle; R17b, R17c and R17f `@quarantine`) | @security, @quarantine for 5 | 7 default + 5 quarantined | +| security/roles.spec.ts | R01 to R10: member without grant, viewer, editor, developer, plain member, anonymous visitor are held to their rights, the data source rows (R09), the workspace admin rows (R07, R08); R16: the instance super admin opens a private app's editing view and writes a config key (R16a, R16b), a workspace admin cannot demote or remove it (R16c D-23, R16d D-24); quarantined: R01d, R03b, R06c, R07d, R08c, R08d, R09c, R09d, R16c, R16d | @security, @core for the 10 P0 rows, @quarantine for 10, @superadmin for 4 (R16a to R16d) | 30 default + 8 quarantined + 2 `@superadmin` + 2 `@quarantine @superadmin` (R16c, R16d) | +| security/group-grants.spec.ts | R05 (group grants, a member removed from the group loses the right, UI after reload) and R14 (group administration) | @security | 6 | +| security/membership-changes.spec.ts | R11 to R13 (a removed member, a demoted admin, a removed permission row with a session open) and R15 (folder rights); quarantined: R11b, R15c | @security, @quarantine for 2 | 7 default + 2 quarantined | +| security/credentials.spec.ts | A01 to A05: forged, unsigned and wrongly signed tokens, API keys (a removed member's key, a member's key), logged-out and made-up cookies, forwarding headers; quarantined: A02a (D-45: the 3.0.0 server keeps the user's last API key after a delete), A04 | @security, @core for A01a and A03a, @quarantine for 2 | 7 default + 2 quarantined | +| security/mass-assignment.spec.ts | A06 to A08: a member cannot promote itself, an update cannot move an app or change its creator or public flag, a viewer's eight write routes (A08a to A08h); quarantined: A06b, A07a | @security, @core for A06a and A07b, @quarantine for 2 | 11 default + 2 quarantined | +| security/public-leakage.spec.ts | A09 and A10: what a public app and the session-free routes show an anonymous visitor (A09b and A09d are pins); quarantined: A09a, A09c, A10a, A10b, A10c | @security, @quarantine for 5 | 2 default + 5 quarantined | +| security/outbound.spec.ts | SEC-X01a to X01d: the npm registry proxy against the echo sidecar (X01a+ and X01d+ pass; X01b and X01c, D-35, `@quarantine`) | @security, @quarantine for 2 | 2 default + 2 quarantined | +| security/outbound-n8n.spec.ts | SEC-X02a and X02b: the n8n plugin's request against the echo sidecar (X02a+ passes; X02b, D-27, `@quarantine`); trace off for the file | @security, @quarantine for 1 | 1 default + 1 quarantined | +| security/collab-room.spec.ts | A11: a chat controller of another workspace joins the room of a private app (two browser sessions, the image's hocuspocus); `@quarantine` | @security, @quarantine | 1 quarantined | +| security/transport.spec.ts | A12 (CORS: a foreign origin is allowed with credentials, `@quarantine`) and A13 (session cookie flags) | @security, @quarantine for 1 | 1 default + 1 quarantined | + +Quarantined tests that behave unexpectedly on the 3.0.0 image: SEC-R09d is order-dependent (the batched data-source check; measured 8 failures and 2 passes in 10 repeats), so a quarantine run can show it passing. Accounting of `E2E_INCLUDE_QUARANTINE=1 e2e/scripts/run-in-docker.sh --workers=4 --reporter=list --grep "@quarantine" tests/security` (measured before the @superadmin tag existed, so it included SEC-R16c and R16d; they now need `E2E_INCLUDE_SUPERADMIN=1` as well): 44 listed, 43 failed, 1 passed (SEC-R09d), 0 skipped, 0 did not run; the two quarantined tests of `foundation/security-helpers.spec.ts` are outside that folder. + +### foundation (258, unit and builder tests; several touch the stack) + +| File | Proves | Tags | Tests | +|---|---|---|---| +| foundation/builders.spec.ts | every DSL builder's output shape, and the n8n recordings with `n8nWorkflowsQuery` | none | 40 | +| foundation/recorded.spec.ts | recorded-fixture parsing and errors | none | 5 | +| foundation/run-selection.spec.ts | `grepInvertFor`, `grepFor`, `excludedTags`, `runFlagsFromEnv`, `stackProfileFromEnv` for the four opt-in flags and the stack profile (every flag combination on the default and enterprise stacks and the signup-disabled profile: SEC-E05 runs only with its own flag and then alone), and the guard that every `superAdmin` fixture test carries `@superadmin` (parses each spec with the TypeScript compiler: `test` and every local name bound to it, by an aliased import of the fixtures or of `@playwright/test` or by a `test.extend(...)` variable; `test.only/skip/fixme/fail`, hooks, tags on an enclosing `test.describe`; comments, titles and annotations never count; the guard itself is tested on synthetic sources) | none | 27 | +| foundation/media.spec.ts | media fixtures have the right signatures | none | 8 | +| foundation/create-module.spec.ts | `createModule` request shape | none | 4 | +| foundation/module-host.spec.ts | module created through the API works in a host; republish rules | none | 2 | +| foundation/editor-modules.spec.ts | module page objects in the editor | @slow | 3 | +| foundation/extensions-panel.spec.ts | `ExtensionsPanel` page object | @npm @slow | 2 | +| foundation/logic-builders.spec.ts | logic builders seed an app the view runs | none | 1 | +| foundation/products-table.spec.ts | products fixture and `TableView` | none | 2 | +| foundation/table-view-header.spec.ts | header lookup is exact | none | 1 | +| foundation/d3-threshold-reporter.spec.ts | D-3 gate verdicts of the reporter | none | 9 | +| foundation/security-helpers.spec.ts | the security helpers of `src/api/client.ts`, `src/security/actors.ts` and `src/security/scene.ts` against the stack (`apiRaw`, `actor`, `joinWorkspace`, `makeDeveloper`, grants, folders, datasources, API keys, bundles, `signIn`, `getApp`, `listGroupMembers`, `sceneOf`, `memberOf`, `roleOf`, `permissionIdOf`, `adminOfApiUser`, the `superAdmin` fixture, ...); 2 tests are `@quarantine` (D-45 API-key delete, D-46 bundle recycle) | none, @superadmin for 1, @quarantine for 2 | 36 default + 1 `@superadmin` + 2 quarantined | +| foundation/security-pages.spec.ts | the page objects `SettingPage` (settings sidebar, members rows and role selects, provider page) and `DatasourcePage` (the form's save answer) as admin, developer and plain member, and `AppViewPage.openAndAwaitQuery` (the status of the query a seeded app runs on load) | none | 4 | +| foundation/security-echo.spec.ts | the echo sidecar (`scripts/echo-server.js` started on a loopback port: record and read back, per-target prefixes, control paths, body cut, canned answers) and `src/security/echo.ts`, `n8nDatasourceBody`, `npmRegistryPath` (no stack) | none | 17 | +| foundation/security-api-raw.spec.ts | `apiRaw` against a local server: status, code, body, params, request and response headers (no stack) | none | 7 | +| foundation/security-quarantine.spec.ts | `securityTestDetails`, `securityCandidateDetails`, `lifecycleTestDetails`, `lifecycleCandidateDetails` and the two quarantine maps (no stack) | none | 16 | +| foundation/lifecycle-pages.spec.ts | `ProfilePage`, `ProfileModal`, `UserMenu` (profile, create and switch workspace), `ApiKeysCard`, `WorkspacesPage`, `GroupsPage`, `ShareDialog`, `SettingPage` (invite link, operations), `PasswordRecoveryPage`, `LoginPage.forgotPasswordLink`, the invite dialog of `SettingPage` (send, notice), `ProvidersPage`, `ProfilePage.infoCount`, `SettingPage.openDetailOf`, the navigation and tour locators of `AppListPage` (`tourClose` on a UI sign-up) | none | 14 | +| foundation/lifecycle-mail.spec.ts | `src/lifecycle/mail.ts` against the two recorded mails (`fixtures/mail/`) and built messages: encodings, charsets, nested multipart, encoded-word subjects, `resetTokenOf`, `inviteCodeOf`, the error types (no stack), `resetLinkOf` (cut at the token characters), `withSingleSlashes` | none | 13 | +| foundation/lifecycle-mail-sink.spec.ts | the mail sink of `scripts/echo-server.js` on loopback ports with a raw SMTP client: a recorded conversation, case-insensitive match, dot-stuffing, 502, byte-by-byte commands, pipelining, a split terminator, RSET, 503, the over-long line, the body cut (also across writes, with the terminator split at the cut), `mailboxAt` (no stack) | none | 11 | +| foundation/lifecycle-mail-stack.spec.ts | the sink on the stack: a reset request makes the server mail one reset link whose token the parser extracts | `@lifecycle` | 1 | +| foundation/lifecycle-helpers.spec.ts | `registerRaw`, `signInRaw`, `updateProfile`, `deleteProfilePhoto`, `createOrganization`, `deleteOrganizationRaw`, `listAuthConfigs`, `addGithubConfigRaw`, `leaveOrganization`, the multipart option of `apiRaw`, `randomPng` | none | 7 | +| foundation/lifecycle-helpers-local.spec.ts | `removeAuthConfigRaw` against a local server (the request it sends and the refusal it returns; never against the stack: O-17) | none | 1 | +| foundation/lifecycle-mock-idp.spec.ts | `src/lifecycle/mock-idp.ts`: the Generic configuration body, the canned-answer helpers and `providerLogin` against a local server (no stack) | none | 3 | +| foundation/lifecycle-recovery-helpers.spec.ts | `requestPasswordReset`, `resetLostPasswordRaw`, `sendInvitationEmails` against the stack and the mail sink (its own file, trace off: a live token passes through a request context) | none | 1 | +| foundation/security-constants.spec.ts | `API_ERRORS`, roles, security path builders (no stack) | none | 6 | +| foundation/security-tokens.spec.ts | `src/security/tokens.ts`: the HS256 signer against RFC 7515 A.1, forged, unsigned and wrongly signed tokens, `bearerHeader`, `issuedAtSecond` (no stack) | none | 9 | +| foundation/security-assertions.spec.ts | `expectAnswer` and `expectDeniedAs` pass on a match and fail on a wrong status or code (no stack) | none | 6 | +| foundation/security-super-admin.spec.ts | `superAdminCredentials` (both variables, missing or empty ones name both variables and the script, never a value) and `withCapacityHint` (no stack) | none | 8 | + +## Known defects, observations and candidates + +| Id | What | Suite handling | +|---|---|---| +| D-3 | an edit made right after the editor opens can be lost; `EditorPage.open()` waits for `data-editor-ready` and `GRID_SETTLE_MS`, which narrows but does not close the race | tests that save through the editor poll the saved DSL; S1 and M3 retry once (below) | +| D-5 | a component dropped right after ready is saved with width 0 | `GRID_SETTLE_MS` in `src/constants.ts`; `editor/drop-size.spec.ts` asserts the desired width and is `@quarantine` (no annotation) | +| CD-3 | the timer's `start`/`resume` events and state do not reach bindings | `components/timer.spec.ts` asserts display text and the `pause` event only (no annotation) | +| CD-5 | an OBSERVATION, not a confirmed defect: `barChart1.data` reads empty while the chart draws the bound data | `components/npm-components.spec.ts` (bound barChart test) asserts today's `chart=0` and carries `{type:"defect", description:"CD-5"}`; `datasource/query-feeds-components.spec.ts` asserts the binding through a text | +| CD-7 | `setIn` with a bad path or on a scalar fails silently (query ends as success) | `logic/temporary-state.spec.ts` asserts today's behaviour, annotation `{type:"defect", description:"CD-7"}`, default run | +| CD-8 candidate | `transfer` list titles are in the wrong order | conditional `defect` annotation in `components/choices.spec.ts`; not confirmed as a defect yet | +| CD-9 candidate | an icon switched from a name to an image URL keeps the old icon | `components/displays.spec.ts`, `@quarantine`, `defect` annotation; not confirmed as a defect yet | +| CD-4 | npm components fail silently without internet; version is `latest` | `@npm`, render-only assertions | +| O-11 | observation: back-to-back key presses on a slider are lost | `components/sliders-color.spec.ts` asserts the bound text after every press | +| O-12 | observation: publishing an existing version tag of a module answers HTTP 500 / code 5000, not a tag-specific error | `modules/module-versions.spec.ts` asserts only that the call fails with the API error type and records the message in an `observation` annotation | +| O-13 | observation: a mounted host never reloads a module that was republished under it while the module id is unchanged | `modules/module-versions.spec.ts` asserts the old version stays over `MOUNTED_HOST_OBSERVATION_MS` | +| O-14 | observation: the chat controller's `messageSent` fires only when the answer succeeds, `messageReceived` fires either way | `components/chat.spec.ts` | +| O-15 | observation: the bound `connectionStatus` of the chat controller reads `Online` at its first read | `components/chat.spec.ts` uses a received frame as the signal of the connection | +| O-16 | observation: the 3.0.0 client has no working page for a workspace's own members (`orgUsersPermission.tsx` is not routed): `/setting/permission/users` is the All Users group page with group roles, and its Remove from Group takes the user off that page but leaves the workspace membership; changing a workspace role or removing a member is API-only | `workspace/members-gui.spec.ts` LC-WM01, LC-WM03 (annotation `observation`) | +| O-17 | observation: switching a workspace's e-mail sign-in off (`DELETE /api/auth/config/EMAIL` with a second provider present) answers 200 and ends the caller's session AND the instance super admin's (both answer 401 afterwards; the super admin is a member of every workspace and every worker shares its session), while an e-mail sign-in with and without the workspace id still answered 200 (measured on the image; whether the configuration was stored as disabled was not read back). A test of it would break the run, so LC-IP06 is not built; no test of the suite calls this route against the stack (LC-IP05 only reads the notice in the UI; the helper `removeAuthConfigRaw` is tested against a local server) | measured, not built | +| D-45 | on the 3.0.0 image `DELETE /api/auth/api-key/{id}` of the user's last key answers 200 but the key stays listed and keeps authenticating (fixed on the branch by `86fe43f9d`, NOT VERIFIED at runtime) | `security/credentials.spec.ts` SEC-A02a and the helper test in `foundation/security-helpers.spec.ts`, `@quarantine`, annotation `D-45`; LC-AK04 (the UI delete of the last key) | +| D-46 | on the 3.0.0 image recycling a bundle sets the status and answers 500 / 5005 (suspected open at HEAD, NOT VERIFIED) | `security/bundles.spec.ts` SEC-R17f and the helper test, `@quarantine`, annotation `D-46`; `recycleBundle` tolerates exactly this answer | + +## Security findings + +Ids `D-6` to `D-47` are the defects the security tests use (annotation `{ type: "defect", description: "D-n" }`, and the maps `FIXED_ON_BRANCH` and +`OPEN_DEFECTS` of `src/security/quarantine.ts`). Status: `open` = present in the 3.0.0 image and in the code of this branch; +`fixed on branch` = present in the 3.0.0 image, fixed in this branch's server by the named commit (the image under test still has it, so the +test is `@quarantine`; it leaves the quarantine by deleting its id from `FIXED_ON_BRANCH` once a run against an updated server passes it); +`suspected` = read in the code, the runtime behaviour is not established. D-45, D-46 and D-47 were found by running tests; the other +findings were read in the code and each scenario asserts the desired behaviour. "pin" means the test asserts the current good behaviour +and passes. + +| Id | Finding | Status | Scenarios | +|---|---|---|---| +| D-6 | an admin of any workspace renames any user or replaces or deletes their photo (the route checks the admin role of the path's workspace, not that the user belongs to it) | open | SEC-C19a, C19b | +| D-7 | any workspace admin renames another workspace's folder and grants permissions on it; a plain member can escalate inside a workspace through folder grants copied onto later apps | open | SEC-C09, C11, C22e, R15c | +| D-8 | any signed-in user reads the permission list of any folder | open | SEC-C10 | +| D-9 | an app editor sets the app's status (recycled, deleted) through the update route, which needs only edit rights | suspected | SEC-R03b | +| D-10 | viewers, and anonymous visitors of public apps, run unpublished (draft) queries | suspected | SEC-A09c | +| D-11 | a plain member creates apps in a workspace when it is a developer in its current workspace | suspected | SEC-R06c | +| D-12 | anonymous callers resolve names of apps, users, workspaces and more by id (`POST /api/meta/`) | open | SEC-A10a | +| D-13 | anonymous callers list the workspaces of any e-mail address (`GET /api/organizations/byuser/{email}`) | open | SEC-A10b | +| D-14 | the workspace answer carries the auth configs' client secret | open | SEC-R07d | +| D-15 | API keys are signed with a published default secret; a forged token is refused only because it must equal a stored key | open, defended (pin) | SEC-A01a | +| D-16 | any signed-in user writes deployment-wide server config | fixed on branch (`24295707f`) | SEC-R08c (positive half SEC-R16b) | +| D-17 | library queries of other workspaces can be read and run | fixed on branch (`e84499a0b`) | SEC-C15 | +| D-18 | any signed-in user invites itself into any workspace | fixed on branch (`2ae399ef2`) | SEC-C17a, C17b, LC-PW14 (the invitation mail of another workspace) | +| D-19 | folder create with a client-chosen id replaces another workspace's folder | fixed on branch (`f3e4b2908`) | SEC-A07a | +| D-20 | a query naming its datasource by gid skips the use permission | fixed on branch (`a8e6531ec`) | SEC-R09c | +| D-21 | any signed-in user lists any app's versions | fixed on branch (`f698f98ef`) | SEC-C20 | +| D-22 | any signed-in user lists any workspace's users through a group id | fixed on branch (`3eb3c4a05`) | SEC-C18b | +| D-23 | a workspace admin grants `super_admin` or changes a super admin's role | fixed on branch (`bf53d64b9`) | SEC-A06b, R16c | +| D-24 | an admin removes a super admin or the last admin | fixed on branch (`928d02040`) | SEC-R08d, R16d | +| D-25 | app views, the anonymous view of a public app included, carry the workspace's password-reset mail template | fixed on branch (`7f2b48e4a`) | SEC-A09a | +| D-26 | an app's creator who left the workspace, and any user on a template app, open the editing view | fixed on branch (`c377186ad`) | SEC-R11b | +| D-27 | the session cookie is forwarded to JS datasource queries | fixed on branch (`f4fc9f3ec`) | SEC-X02b | +| D-28 | any signed-in user sets any workspace's slug and reads any workspace | fixed on branch (`22e4419b1`, `893e7ebd0`) | SEC-C16b, C16c | +| D-29 | any signed-in user reads any datasource's structure and makes it connect | fixed on branch (`fe745f3bd`) | SEC-C13 | +| D-30 | signing in with `?orgId=` joins that workspace without an invitation (may be intended for the per-workspace sign-in page; needs an owner decision) | suspected | SEC-C17c | +| D-31 | an editor of any app reads any history snapshot by id | open | SEC-C21 | +| D-32 | any workspace member reads the full live DSL of any of its apps | open | SEC-R01d | +| D-33 | credentialed CORS from any origin with CSRF protection off (default allowed origins `*`) | open | SEC-A12 (`@quarantine`), SEC-A13 (pin) | +| D-34 | sessions survive a password change | open | SEC-A04, LC-PW08 (a password reset), `@quarantine` | +| D-35 | anonymous callers use any app's workspace npm registry settings | open | SEC-X01b, X01c | +| D-36 | the collaboration server checks neither the user nor the room | open | SEC-A11 | +| D-37 | the app slug route has no permission check (latent while no slug is stored) | open | SEC-C16f | +| D-38 | a batched permission lookup takes the workspace and the admin role from the first id | suspected | SEC-R09d | +| D-39 | actuator metrics (`/api/status/**`) are anonymous | open | SEC-A10c | +| D-40 | in ENTERPRISE mode a workspace admin resets the instance super admin's password and receives it | open (measured on the 3.0.0 image: the reset answers 200 and the password) | SEC-E05 (`security/enterprise-takeover.spec.ts`, alone on its own enterprise stack) | +| D-41 | a plain member creates bundles in a workspace when it is a developer in its current workspace | suspected | SEC-R17b | +| D-42 | a bundle's element list carries the editing DSL of every app in it, with no check on the apps | open | SEC-R17c | +| D-43 | any signed-in user lists any bundle's elements, each app's editing DSL included | fixed on branch (`bd6308331`) | SEC-C23a | +| D-44 | an app's owner adds or moves it into any bundle of any workspace | fixed on branch (`a63df54ac`) | SEC-C23c | +| D-45 | deleting a user's last API key answers 200 but the key stays listed and keeps authenticating (measured on the image) | fixed on branch (`86fe43f9d`, not verified at runtime on the branch) | SEC-A02a, LC-AK04 and the helper test in `foundation/security-helpers.spec.ts` | +| D-46 | recycling a bundle sets the status and then answers 500 / 5005 (measured on the image) | suspected open on the branch (not verified at runtime) | SEC-R17f and the helper test; `recycleBundle` tolerates exactly this answer | +| D-47 | the instance super admin's requests hang (HTTP 504) once the stack holds more than about 420 workspaces (measured on the 3.0.0 image: 400 ok in about 100 ms, 450 and more 504 after about 120 s; cause not found) | open, cause not found, measured on 3.0.0, HEAD not measured | SEC-R16a to R16d, tagged `@superadmin` | +| D-48 | the server enforces no password rule on sign-up (the rule, at least 8 characters with a letter and a digit, is checked in the client only): a sign-up with the password `a` answers 200 and opens a session, and so does `PUT /api/users/password` with the new password `a` (measured on the image; the same code at HEAD, not run) | open (candidate L-3 of the lifecycle research) | LC-AU07, LC-PR14, `@quarantine` | +| D-49 | `POST /api/users/password?password=` sets a password with no old password for a user who already has one (the route of the "Set Password" card); any session, a stolen one included, replaces the password and takes the account (measured on the image; HEAD the same by code, not run) | open (candidate L-2) | LC-PR13, `@quarantine` | +| D-50 | the avatar size limit (`avatarMaxSizeInKb`, 300) is not enforced: a 6.7 MB PNG is accepted (measured on the image; HEAD not run) | open, not verified at HEAD | LC-PR06, `@quarantine` | +| D-51 | an API-key token is the user id and the second it was created in (no unique id): two keys of one user created in the same second are the same token, so deleting one of them does not revoke it (measured on the image: back-to-back keys collide) | fixed on branch (`0da2e7f76`, a random `jti` in every new key token; not verified at runtime) | LC-AK08, `@quarantine`; LC-AK03 creates its second key in a later second to avoid it | +| D-52 | `PUT /api/groups/{id}/update` renames the all-users group (measured on the image) and, by the same code, the developers group (not measured): the rename has no system-group check, the UI only hides the control (HEAD unchanged by the commit log) | open | LC-GR09, `@quarantine` | +| D-53 | deleting a group leaves its members the access the group granted: a member of a deleted group still views the app the group was granted on, 30 s after the delete (measured on the image; HEAD unchanged by the commit log) | open | LC-GR03, `@quarantine` | +| D-54 | the reset link of the mail has a double slash (`//user/auth/lost-password?token=...`, because the public URL, in the shipped default too, ends in a slash) and the client opens a blank page for it; the same link with one slash opens the reset form (measured on the image; the link is built in `EmailCommunicationServiceImpl`, HEAD unchanged by the commit log) | open | LC-PW12, `@quarantine` | +| D-55 | the invite dialog confirms with a raw translation key (`oups! membersSettings.inviteByEmailSuccess`): the client asks for keys that do not exist (`inviteDialog.tsx`, HEAD unchanged by the commit log) | open | LC-PW15, `@quarantine` | +| D-56 | the password-reset mail ignores the workspace's own template (the template is read with the wrong key; measured on the image: the marker of a stored template is absent) | fixed on branch (`adfe89327`; not run at HEAD) | LC-PW09, `@quarantine` | +| D-57 | an account in no workspace gets no reset mail while the forgot page still confirms (measured on the image: a member removed from its only workspace gets none) | fixed on branch (`49e759ed9`; not run at HEAD) | LC-PW10, `@quarantine` | +| D-58 | a reset request for a display name that is not an address mails that user's token to the typed text: whoever can rename a user sets the victim's name to an address of its own and receives the victim's token (measured on the image: the alias received a mail; the reset itself was not run; HEAD code read, `UserServiceImpl.java:437`) | open | LC-PW11, `@quarantine` | +| D-59 | a removed developer's data source grant is not deleted: 20 s after the removal the "Can Use" row of the data source was still there, while the group and app rows were gone within 40 ms (measured on the image; HEAD not run) | open, not verified at HEAD | LC-DL03, `@quarantine` | +| D-60 | a removed member's folder grant is not deleted and is live again after a rejoin: the removal listener has no folder step, and the row was still there after the removal and after the rejoin (measured on the image; HEAD listener read: no folder or bundle step) | open | LC-DL04, `@quarantine` | +| D-61 | a second sign-in configuration of a provider type that already has one is accepted: a second GitHub configuration with another client id answers 200 and the workspace lists two (the server code names the refusal 400 / 5621 `DUPLICATE_AUTH_CONFIG_ADDITION`; measured on the image, HEAD not run) | open, not verified at HEAD | LC-IP07, `@quarantine` | +| D-62 | a provider sign-in whose e-mail claim equals an existing account's address signs in AS that account: the server resolves the provider identity by address (`UserServiceImpl.findByAuthUserRawId` is `findByEmailDeep`, the claim is not verified), so whoever configures a provider for a workspace can make its user-info answer name any address and receive that user's session, including users of other workspaces; measured on the image with a mock provider: the session listed the form user's own workspace (HEAD code read: unchanged) | open | LC-IP14, `@quarantine` | +| D-63 | the "Info" card "Your Created Apps" of the profile page counts 0 although the user created two apps (`createBy` of the list equals the user's name and the app list shows them; the page filters the redux app list, `UserProfileLayout.tsx`; root cause NOT VERIFIED); measured on the image, HEAD not run | open, not verified at HEAD | LC-OT02, `@quarantine` | + +Quarantine decision rule: a test that asserts the DESIRED behaviour and fails today is `@quarantine`. A +characterisation or workaround test that passes while documenting a defect (CD-5, CD-7, CD-3 limits, D-3 handling) is not. + +Annotation types used: `defect` (description = defect id) for a test that asserts or works around a defect; +`D-3 retry` and `handler retry` for the retries of S1/M3 and the editor-module tests; `observation` for a recorded +observation (`modules/module-versions.spec.ts`, O-12). Observations O-11 to O-15 are listed in the table above. + +D-3 retry and threshold rules (code: `src/components/insert-all.ts`, `src/modules/moduleScenario.ts`, +`src/reporters/d3-threshold-reporter.ts`): + +- S1 and M3 wait up to `SAVE_POLL_TIMEOUT_MS` (20 s) for the saved DSL to hold the edit. On a timeout the test adds the + annotation `D-3 retry` and redoes its editor steps on a fresh app once; a second lost save fails the test. +- M3 has a second retry, `handler retry`, for its event-handler step. At most one of each per test. +- Both files set `test.describe.configure({ retries: 0, timeout: 180_000 })`, switching off the one CI retry. +- The reporter counts, per gated file, the tests that RAN and fails the run when more than `floor(ran / 2)` carry + `D-3 retry`. The limits 56 of 112 (S1) and 5 of 10 (M3) apply to the complete gates above. A targeted run of fewer + tests gets a proportionally smaller limit; a one-test run allows zero D-3 retries. A file that did not run is not judged. +- Limit: a regression that loses fewer than half of the first saves passes. + +## Troubleshooting + +- `another run uses .../e2e (lock .../e2e/.run.lock)`: a second `run-in-docker.sh` in the same checkout. Wait or use + another checkout. +- `test-results` is empty or gone after a run: a concurrent run in the same checkout cleaned it (Playwright recreates + `outputDir` at the start of a run). Never run two stacks, or a direct `playwright test`, in one checkout at once. +- Chat tests cannot connect (`ws://localhost:3006` in blocked requests): the image predates the baked + `REACT_APP_HOCUSPOCUS_URL`; rebuild with `e2e/scripts/build-e2e-image.sh`. +- `image ... does not exist; build it with e2e/scripts/build-e2e-image.sh`: the default image is only a local tag. +- `@npm` tests time out or components render an empty area: the app container cannot reach the npm registry (CD-4 shows + no error). `--grep-invert @npm` skips those tests, but the run still needs the npm registry for `npm ci`. +- `@playwright/test ... does not match the runner image`: align `package-lock.json` and `PLAYWRIGHT_IMAGE`; the script + header has the lockfile command. +- A component dropped right after the editor opens is thin or zero-width: D-5; use `EditorPage.open()`. +- The app does not answer within 300 s: the script prints the last 60 log lines of the container. diff --git a/e2e/client-hooks.patch b/e2e/client-hooks.patch new file mode 100644 index 0000000000..13447f1562 --- /dev/null +++ b/e2e/client-hooks.patch @@ -0,0 +1,121 @@ +diff --git a/client/packages/lowcoder-design/src/components/Tab.tsx b/client/packages/lowcoder-design/src/components/Tab.tsx +index 3828b7e27..a4e447a9f 100644 +--- a/client/packages/lowcoder-design/src/components/Tab.tsx ++++ b/client/packages/lowcoder-design/src/components/Tab.tsx +@@ -96,6 +96,8 @@ const Tabs = React.memo((props: ITabs) => { + return ( + handleTabClick(tab.key)} + $isActive={isActive} + > +@@ -107,7 +109,7 @@ const Tabs = React.memo((props: ITabs) => { + + return ( + <> +- ++ + {tabsConfig.map(renderTab)} + + {activeTab.content} +diff --git a/client/packages/lowcoder/src/layout/gridItem.tsx b/client/packages/lowcoder/src/layout/gridItem.tsx +index 8d02232bf..e48396abf 100644 +--- a/client/packages/lowcoder/src/layout/gridItem.tsx ++++ b/client/packages/lowcoder/src/layout/gridItem.tsx +@@ -278,6 +278,7 @@ export const GridItem = React.memo((props: GridItemProps) => { + return ( +
{ +@@ -216,7 +223,7 @@ export const AppEditorInternalView = React.memo((props: AppEditorInternalViewPro + }; + }, [isUserViewMode]); + +- useSaveComp(appInfo.id, readOnly, compInstance, blockEditing); ++ const saveBaselineTaken = useSaveComp(appInfo.id, readOnly, compInstance, blockEditing); + + const loading = + !compInstance || !compInstance.comp || !compInstance.comp.preloaded || props.loading; +@@ -246,6 +253,8 @@ export const AppEditorInternalView = React.memo((props: AppEditorInternalViewPro + }} + > + ++ {/* Tells tests (and anything else watching the DOM) that edits made from now on are saved. */} ++ {saveBaselineTaken && + +diff --git a/client/packages/lowcoder/src/pages/editor/right/ModulePanel.tsx b/client/packages/lowcoder/src/pages/editor/right/ModulePanel.tsx +index 5b216cd70..8eee8cb09 100644 +--- a/client/packages/lowcoder/src/pages/editor/right/ModulePanel.tsx ++++ b/client/packages/lowcoder/src/pages/editor/right/ModulePanel.tsx +@@ -228,6 +228,7 @@ function ModuleItem(props: ModuleItemProps) { + return ( + { + e.stopPropagation(); + e.dataTransfer.setData("compType", compType); +diff --git a/client/packages/lowcoder/src/pages/editor/right/PluginPanel/PluginCompItem.tsx b/client/packages/lowcoder/src/pages/editor/right/PluginPanel/PluginCompItem.tsx +index bbf8123c8..ce5e1fd73 100644 +--- a/client/packages/lowcoder/src/pages/editor/right/PluginPanel/PluginCompItem.tsx ++++ b/client/packages/lowcoder/src/pages/editor/right/PluginPanel/PluginCompItem.tsx +@@ -85,6 +85,7 @@ export function PluginCompItem(props: PluginCompItemProps) { + return ( + { + e.dataTransfer.setData("compType", compType); + e.dataTransfer.setDragImage(TransparentImg, 0, 0); +diff --git a/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx b/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx +index b12d59f31..9cb3009a0 100644 +--- a/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx ++++ b/client/packages/lowcoder/src/pages/editor/right/uiCompPanel.tsx +@@ -175,6 +175,7 @@ export const UICompPanel = () => { + + { + e.dataTransfer.setData("compType", info[0]); + e.dataTransfer.setDragImage(TransparentImg, 0, 0); diff --git a/e2e/fixtures/dsl/audio.json b/e2e/fixtures/dsl/audio.json new file mode 100644 index 0000000000..5bf84f7b18 --- /dev/null +++ b/e2e/fixtures/dsl/audio.json @@ -0,0 +1,115 @@ +{ + "ui": { + "layout": { + "1730c6f4": { + "i": "1730c6f4", + "h": 5, + "w": 6, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "1730c6f4": { + "compType": "audio", + "comp": { + "src": "https://cdn.pixabay.com/audio/2023/07/06/audio_e12e5bea9d.mp3", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "audio1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/autocomplete.json b/e2e/fixtures/dsl/autocomplete.json new file mode 100644 index 0000000000..610e691b5f --- /dev/null +++ b/e2e/fixtures/dsl/autocomplete.json @@ -0,0 +1,136 @@ +{ + "ui": { + "layout": { + "7fa98600": { + "i": "7fa98600", + "h": 5, + "w": 6, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "7fa98600": { + "compType": "autocomplete", + "comp": { + "defaultValue": "", + "value": "", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "validationType": "Text", + "allowClear": true, + "items": "[\n {\n \"value\": \"1-BeiJing\",\n \"label\": \"北京\"\n },\n {\n \"value\": \"2-ShangHai\",\n \"label\": \"上海\"\n },\n {\n \"value\": \"3-GuangDong\",\n \"label\": \"广东\"\n },\n {\n \"value\": \"4-ShenZhen\",\n \"label\": \"深圳\"\n }\n]", + "filterOptionsByInput": true, + "ignoreCase": true, + "searchFirstPY": true, + "searchLabelOnly": true, + "valueOrLabel": "label", + "autoCompleteType": "normal", + "autocompleteIconColor": "blue", + "componentSize": "small", + "valueInItems": "", + "selectedOption": "{}", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "autocomplete1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/avatar.json b/e2e/fixtures/dsl/avatar.json new file mode 100644 index 0000000000..468dda2bd7 --- /dev/null +++ b/e2e/fixtures/dsl/avatar.json @@ -0,0 +1,144 @@ +{ + "ui": { + "layout": { + "3f2afc28": { + "i": "3f2afc28", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "3f2afc28": { + "compType": "avatar", + "comp": { + "icon": "/icon:solid/user", + "iconSize": "40", + "shape": "circle", + "title": "", + "src": "", + "avatarLabel": "{{currentUser.name}}", + "avatarCatption": "{{currentUser.email}}", + "labelPosition": "left", + "alignmentPosition": "left", + "options": { + "optionType": "manual", + "manual": { + "manual": [ + { + "label": "Option 1" + }, + { + "label": "Option 2" + } + ] + }, + "mapData": { + "data": "[]" + } + }, + "badgeType": "number", + "badgeCount": "0", + "badgeSize": "default", + "overflowCount": "99", + "badgeTitle": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "avatar1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/avatarGroup.json b/e2e/fixtures/dsl/avatarGroup.json new file mode 100644 index 0000000000..d97d9dfd60 --- /dev/null +++ b/e2e/fixtures/dsl/avatarGroup.json @@ -0,0 +1,141 @@ +{ + "ui": { + "layout": { + "3d9f1ac": { + "i": "3d9f1ac", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "3d9f1ac": { + "compType": "avatarGroup", + "comp": { + "maxCount": "3", + "avatarSize": "40", + "alignment": "center", + "autoColor": true, + "avatars": { + "optionType": "manual", + "manual": { + "manual": [ + { + "src": "https://api.dicebear.com/7.x/miniavs/svg?seed=1", + "label": "J" + }, + { + "AvatarIcon": "/icon:antd/startwotone" + }, + { + "label": "D" + }, + { + "label": "W" + } + ] + }, + "mapData": { + "data": "[]" + } + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "avatarGroup1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/barChart.json b/e2e/fixtures/dsl/barChart.json new file mode 100644 index 0000000000..49478aa254 --- /dev/null +++ b/e2e/fixtures/dsl/barChart.json @@ -0,0 +1,189 @@ +{ + "ui": { + "layout": { + "c2db190e": { + "i": "c2db190e", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "c2db190e": { + "compType": "barChart", + "comp": { + "mode": "ui", + "title": "Bar Chart", + "data": "[\n {\n \"month\": \"Jan\",\n \"sales\": 1200,\n \"target\": 1000\n },\n {\n \"month\": \"Feb\",\n \"sales\": 1500,\n \"target\": 1200\n },\n {\n \"month\": \"Mar\",\n \"sales\": 1300,\n \"target\": 1400\n },\n {\n \"month\": \"Apr\",\n \"sales\": 1800,\n \"target\": 1500\n },\n {\n \"month\": \"May\",\n \"sales\": 1600,\n \"target\": 1700\n },\n {\n \"month\": \"Jun\",\n \"sales\": 2100,\n \"target\": 1900\n }\n]", + "xAxisKey": "month", + "xAxisDirection": "horizontal", + "xAxisData": "[]", + "series": [ + { + "columnName": "sales", + "seriesName": "Sales", + "dataIndex": "38645d9e" + }, + { + "columnName": "target", + "seriesName": "Target", + "dataIndex": "6882de22" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "showLabel": true, + "type": "basicBar", + "barWidth": "40", + "showBackground": false, + "backgroundColor": "#aaaaaa", + "polarRadiusStart": "30", + "polarRadiusEnd": "80%", + "polarStartAngle": "90", + "polarEndAngle": "-180", + "polarIsTangent": false, + "stack": false, + "race": false, + "labelData": "[]" + } + }, + "echartsOption": "{\n \"data\": [\n {\n \"value\": 100,\n \"name\": \"Show\",\n \"color\": \"#fc8452\"\n },\n {\n \"value\": 80,\n \"name\": \"Click\",\n \"color\": \"#9a60b4\"\n },\n {\n \"value\": 60,\n \"name\": \"Visit\",\n \"color\": \"#fac858\"\n },\n {\n \"value\": 40,\n \"name\": \"Query\",\n \"color\": \"#ee6666\"\n },\n {\n \"value\": 20,\n \"name\": \"Buy\",\n \"color\": \"#3ba272\"\n }\n ]\n}", + "echartsTitle": "Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsConfig": { + "compType": "funnel", + "comp": {} + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "left": "10", + "right": "10", + "top": "20", + "bottom": "20", + "tooltip": true, + "legendVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "barChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/basicChart.json b/e2e/fixtures/dsl/basicChart.json new file mode 100644 index 0000000000..7b4b677a54 --- /dev/null +++ b/e2e/fixtures/dsl/basicChart.json @@ -0,0 +1,188 @@ +{ + "ui": { + "layout": { + "536eda7": { + "i": "536eda7", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "536eda7": { + "compType": "basicChart", + "comp": { + "mode": "ui", + "title": "Chart", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "dc3fbe10" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "3cdcdd14" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "showLabel": true, + "type": "basicBar", + "barWidth": "40", + "showBackground": false, + "backgroundColor": "#aaaaaa", + "polarRadiusStart": "30", + "polarRadiusEnd": "80%", + "polarStartAngle": "90", + "polarEndAngle": "-180", + "polarIsTangent": false, + "stack": false, + "race": false, + "labelData": "[]" + } + }, + "echartsOption": "{\n \"data\": [\n {\n \"value\": 100,\n \"name\": \"Show\",\n \"color\": \"#fc8452\"\n },\n {\n \"value\": 80,\n \"name\": \"Click\",\n \"color\": \"#9a60b4\"\n },\n {\n \"value\": 60,\n \"name\": \"Visit\",\n \"color\": \"#fac858\"\n },\n {\n \"value\": 40,\n \"name\": \"Query\",\n \"color\": \"#ee6666\"\n },\n {\n \"value\": 20,\n \"name\": \"Buy\",\n \"color\": \"#3ba272\"\n }\n ]\n}", + "echartsTitle": "Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsConfig": { + "compType": "funnel", + "comp": {} + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "left": "10", + "right": "10", + "top": "20", + "bottom": "20", + "tooltip": true, + "legendVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "basicChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/bpmnEditor.json b/e2e/fixtures/dsl/bpmnEditor.json new file mode 100644 index 0000000000..06098507a7 --- /dev/null +++ b/e2e/fixtures/dsl/bpmnEditor.json @@ -0,0 +1,120 @@ +{ + "ui": { + "layout": { + "6cf77745": { + "i": "6cf77745", + "h": 60, + "w": 13, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "6cf77745": { + "compType": "bpmnEditor", + "comp": { + "autoHeight": "fixed", + "xml": "", + "values": "", + "svgDownload": false, + "designer": false, + "showLogo": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "bpmnEditor1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/button.json b/e2e/fixtures/dsl/button.json new file mode 100644 index 0000000000..f37ffee944 --- /dev/null +++ b/e2e/fixtures/dsl/button.json @@ -0,0 +1,117 @@ +{ + "ui": { + "layout": { + "68dc853b": { + "i": "68dc853b", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "68dc853b": { + "compType": "button", + "comp": { + "text": "Form Button", + "type": "", + "form": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "button1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/calendar.json b/e2e/fixtures/dsl/calendar.json new file mode 100644 index 0000000000..0824008c39 --- /dev/null +++ b/e2e/fixtures/dsl/calendar.json @@ -0,0 +1,191 @@ +{ + "ui": { + "layout": { + "2fbcc939": { + "i": "2fbcc939", + "h": 60, + "w": 13, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "2fbcc939": { + "compType": "calendar", + "comp": { + "events": { + "optionType": "manual", + "manual": { + "manual": [ + { + "id": "1", + "label": "Coding", + "detail": "Discuss project milestones and deliverables.", + "start": "2026-11-20 10:00:00", + "end": "2026-11-20 12:30:00", + "color": "#079968", + "backgroundColor": "#ffffff", + "titleColor": "#000000", + "detailColor": "#000000", + "titleFontWeight": "normal", + "titleFontStyle": "italic", + "detailFontWeight": "normal", + "detailFontStyle": "italic", + "animation": "none", + "animationDelay": "0s", + "animationDuration": "0s", + "animationIterationCount": "0" + }, + { + "id": "2", + "label": "Rest", + "start": "2026-11-21", + "end": "2026-11-22", + "allDay": true, + "color": "#079968" + }, + { + "id": "3", + "label": "event 1", + "resourceId": "d1", + "start": "2026-11-20 10:00:00", + "end": "2026-11-20 17:30:00", + "color": "#079968" + }, + { + "id": "4", + "label": "event 5", + "resourceId": "b", + "start": "2026-11-20 08:00:00", + "end": "2026-11-20 16:30:00", + "color": "#079968" + }, + { + "id": "5", + "label": "event 3", + "resourceId": "a", + "start": "2026-11-20 12:00:00", + "end": "2026-11-20 21:30:00", + "color": "#079968" + } + ] + }, + "mapData": { + "data": "[]" + } + }, + "resources": "[\n {\n \"id\": \"a\",\n \"title\": \"Auditorium A\"\n },\n {\n \"id\": \"b\",\n \"title\": \"Auditorium B\",\n \"eventColor\": \"green\"\n },\n {\n \"id\": \"d\",\n \"title\": \"Auditorium D\",\n \"children\": [\n {\n \"id\": \"d1\",\n \"title\": \"Room D1\"\n },\n {\n \"id\": \"d2\",\n \"title\": \"Room D2\"\n }\n ]\n }\n]", + "resourceName": "Rooms", + "editable": true, + "showEventTime": true, + "showWeekends": true, + "showAllDay": true, + "defaultDate": "{{ new Date() }}", + "firstDay": "1", + "dayMaxEvents": "2", + "eventMaxStack": "0", + "licenseKey": "", + "currentFreeView": "timeGridWeek", + "currentPremiumView": "resourceTimelineDay", + "showVerticalScrollbar": false, + "showResourceEventsInFreeView": false, + "inputFormat": "YYYY-MM-DD HH:mm:ss", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "calendar1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/candleStickChart.json b/e2e/fixtures/dsl/candleStickChart.json new file mode 100644 index 0000000000..737f874eae --- /dev/null +++ b/e2e/fixtures/dsl/candleStickChart.json @@ -0,0 +1,177 @@ +{ + "ui": { + "layout": { + "42157a7a": { + "i": "42157a7a", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "42157a7a": { + "compType": "candleStickChart", + "comp": { + "mode": "json", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "22aeb42a" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "42740bf3" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsData": "[\n [\n 185.43,\n 188.52,\n 184.74,\n 189.12\n ],\n [\n 188.32,\n 186.85,\n 186.21,\n 189.95\n ],\n [\n 186.9,\n 187.65,\n 185.83,\n 188.12\n ],\n [\n 187.75,\n 185.2,\n 184.9,\n 187.85\n ],\n [\n 185.35,\n 189.2,\n 185.15,\n 189.45\n ],\n [\n 189.1,\n 187.5,\n 186.8,\n 189.3\n ],\n [\n 187.6,\n 190.25,\n 187.4,\n 190.5\n ],\n [\n 190.15,\n 189.75,\n 188.9,\n 191.2\n ],\n [\n 189.8,\n 192.35,\n 189.6,\n 192.5\n ],\n [\n 192.4,\n 191.85,\n 191.2,\n 193.15\n ]\n]", + "echartsOption": "{\n \"xAxis\": {\n \"data\": [\n \"2024-03-01\",\n \"2024-03-04\",\n \"2024-03-05\",\n \"2024-03-06\",\n \"2024-03-07\",\n \"2024-03-08\",\n \"2024-03-11\",\n \"2024-03-12\",\n \"2024-03-13\",\n \"2024-03-14\"\n ]\n },\n \"axisColor\": [\n \"#E9EBF1\",\n \"#ffffff\"\n ],\n \"data\": [\n [\n 185.43,\n 188.52,\n 184.74,\n 189.12\n ],\n [\n 188.32,\n 186.85,\n 186.21,\n 189.95\n ],\n [\n 186.9,\n 187.65,\n 185.83,\n 188.12\n ],\n [\n 187.75,\n 185.2,\n 184.9,\n 187.85\n ],\n [\n 185.35,\n 189.2,\n 185.15,\n 189.45\n ],\n [\n 189.1,\n 187.5,\n 186.8,\n 189.3\n ],\n [\n 187.6,\n 190.25,\n 187.4,\n 190.5\n ],\n [\n 190.15,\n 189.75,\n 188.9,\n 191.2\n ],\n [\n 189.8,\n 192.35,\n 189.6,\n 192.5\n ],\n [\n 192.4,\n 191.85,\n 191.2,\n 193.15\n ]\n ],\n \"itemStyle\": {\n \"color\": \"#26A69A\",\n \"color0\": \"#EF5350\",\n \"borderColor\": \"#26A69A\",\n \"borderColor0\": \"#EF5350\"\n }\n}", + "echartsTitle": "CandleStick Chart", + "echartsTitleData": "[\n \"2024-03-01\",\n \"2024-03-04\",\n \"2024-03-05\",\n \"2024-03-06\",\n \"2024-03-07\",\n \"2024-03-08\",\n \"2024-03-11\",\n \"2024-03-12\",\n \"2024-03-13\",\n \"2024-03-14\"\n]", + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsTitleConfig": { + "position": "center" + }, + "echartsConfig": { + "compType": "candleStick", + "comp": {} + }, + "left": "10", + "right": "10", + "top": "20", + "bottom": "20", + "dataZoomBottom": "20", + "dataZoomHeight": "15", + "tooltip": true, + "dataZoomVisibility": true, + "axisFlagVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "candleStickChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/card.json b/e2e/fixtures/dsl/card.json new file mode 100644 index 0000000000..0be8a661bc --- /dev/null +++ b/e2e/fixtures/dsl/card.json @@ -0,0 +1,177 @@ +{ + "ui": { + "layout": { + "bb9ebe04": { + "i": "bb9ebe04", + "h": 44, + "w": 6, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "bb9ebe04": { + "compType": "card", + "comp": { + "showTitle": true, + "title": "Title", + "size": "small", + "extraTitle": "More", + "cardType": "common", + "CoverImg": true, + "imgSrc": "https://lowcoder.cloud/images/e0a89736c6be4393893d2981ac1fd753.png", + "imgHeight": "auto", + "showMeta": true, + "metaTitle": "Content Title", + "metaDesc": "Content Description", + "hoverable": true, + "showActionIcon": true, + "actionOptions": { + "optionType": "manual", + "manual": { + "manual": [ + { + "label": "Option 1", + "icon": "/icon:antd/settingoutlined" + }, + { + "label": "Option 2", + "icon": "/icon:antd/editoutlined" + }, + { + "label": "Option 3", + "icon": "/icon:antd/ellipsisoutlined" + } + ] + }, + "mapData": { + "data": "[]", + "mapData": { + "icon": "" + } + } + }, + "container": { + "header": { + "layout": {} + }, + "body": { + "0": { + "view": { + "layout": {} + } + } + }, + "footer": { + "layout": {} + }, + "showHeader": true, + "showBody": true, + "autoHeight": "auto", + "showVerticalScrollbar": false, + "horizontalGridCells": 24, + "scrollbars": false, + "style": { + "borderWidth": "1px" + }, + "appliedThemeId": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "card1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/carousel.json b/e2e/fixtures/dsl/carousel.json new file mode 100644 index 0000000000..e96c8c9b7e --- /dev/null +++ b/e2e/fixtures/dsl/carousel.json @@ -0,0 +1,118 @@ +{ + "ui": { + "layout": { + "29f2252b": { + "i": "29f2252b", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "29f2252b": { + "compType": "carousel", + "comp": { + "autoPlay": true, + "data": "[\"https://temp.im/403x192\",\"https://temp.im/403x192\"]", + "showDots": true, + "dotPosition": "bottom", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "carousel1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/cascader.json b/e2e/fixtures/dsl/cascader.json new file mode 100644 index 0000000000..a2ae553baa --- /dev/null +++ b/e2e/fixtures/dsl/cascader.json @@ -0,0 +1,136 @@ +{ + "ui": { + "layout": { + "ae9d65a0": { + "i": "ae9d65a0", + "h": 5, + "w": 8, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "ae9d65a0": { + "compType": "cascader", + "comp": { + "value": "[\"California\",\"San Francisco\",\"The Golden Gate Bridge\"]", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "options": "[\n {\n \"value\": \"California\",\n \"label\": \"California\",\n \"children\": [\n {\n \"value\": \"San Francisco\",\n \"label\": \"San Francisco\",\n \"children\": [\n {\n \"value\": \"The Golden Gate Bridge\",\n \"label\": \"The Golden Gate Bridge\"\n }\n ]\n }\n ]\n },\n {\n \"value\": \"New South Wales\",\n \"label\": \"New South Wales\",\n \"children\": [\n {\n \"value\": \"Sydney\",\n \"label\": \"Sydney\",\n \"children\": [\n {\n \"value\": \"Sydney Opera House\",\n \"label\": \"Sydney Opera House\"\n }\n ]\n }\n ]\n }\n]", + "showSearch": true, + "margin": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "padding": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "cascader1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/chart.json b/e2e/fixtures/dsl/chart.json new file mode 100644 index 0000000000..d1c9def367 --- /dev/null +++ b/e2e/fixtures/dsl/chart.json @@ -0,0 +1,174 @@ +{ + "ui": { + "layout": { + "9f54e461": { + "i": "9f54e461", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "9f54e461": { + "compType": "chart", + "comp": { + "mode": "ui", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "9108b4ef" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "bea3c947" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsTitle": "Chart", + "echartsOption": "{\n \"data\": [\n {\n \"value\": 100,\n \"name\": \"Show\",\n \"color\": \"#fc8452\"\n },\n {\n \"value\": 80,\n \"name\": \"Click\",\n \"color\": \"#9a60b4\"\n },\n {\n \"value\": 60,\n \"name\": \"Visit\",\n \"color\": \"#fac858\"\n },\n {\n \"value\": 40,\n \"name\": \"Query\",\n \"color\": \"#ee6666\"\n },\n {\n \"value\": 20,\n \"name\": \"Buy\",\n \"color\": \"#3ba272\"\n }\n ]\n}", + "left": "10", + "right": "10", + "top": "20", + "bottom": "20", + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLegendOrientConfig": { + "orient": "horizontal" + }, + "echartsLegendAlignConfig": { + "left": "center" + }, + "legendVisibility": true, + "tooltip": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "chart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/chartsGeoMap.json b/e2e/fixtures/dsl/chartsGeoMap.json new file mode 100644 index 0000000000..525c811f8c --- /dev/null +++ b/e2e/fixtures/dsl/chartsGeoMap.json @@ -0,0 +1,188 @@ +{ + "ui": { + "layout": { + "55c73689": { + "i": "55c73689", + "h": 60, + "w": 13, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "55c73689": { + "compType": "chartsGeoMap", + "comp": { + "mode": "map", + "title": "Chart", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "spending", + "dataIndex": "14236731" + }, + { + "columnName": "budget", + "seriesName": "budget", + "dataIndex": "a9e9034c" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "showLabel": true, + "type": "basicBar", + "barWidth": "40", + "showBackground": false, + "backgroundColor": "#aaaaaa", + "polarRadiusStart": "30", + "polarRadiusEnd": "80%", + "polarStartAngle": "90", + "polarEndAngle": "-180", + "polarIsTangent": false, + "stack": false, + "race": false, + "labelData": "[]" + } + }, + "echartsOption": "{\n \"data\": [\n {\n \"value\": 100,\n \"name\": \"Show\",\n \"color\": \"#fc8452\"\n },\n {\n \"value\": 80,\n \"name\": \"Click\",\n \"color\": \"#9a60b4\"\n },\n {\n \"value\": 60,\n \"name\": \"Visit\",\n \"color\": \"#fac858\"\n },\n {\n \"value\": 40,\n \"name\": \"Query\",\n \"color\": \"#ee6666\"\n },\n {\n \"value\": 20,\n \"name\": \"Buy\",\n \"color\": \"#3ba272\"\n }\n ]\n}", + "echartsTitle": "Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsConfig": { + "compType": "funnel", + "comp": {} + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "left": "10", + "right": "10", + "top": "20", + "bottom": "20", + "tooltip": true, + "legendVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "chartsGeoMap1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/chat.json b/e2e/fixtures/dsl/chat.json new file mode 100644 index 0000000000..79d34ff30e --- /dev/null +++ b/e2e/fixtures/dsl/chat.json @@ -0,0 +1,125 @@ +{ + "ui": { + "layout": { + "d1320f0d": { + "i": "d1320f0d", + "h": 20, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "d1320f0d": { + "compType": "chat", + "comp": { + "_internalDbName": "chat5837", + "chatQuery": { + "value": "" + }, + "systemPrompt": "You are a helpful assistant.", + "placeholder": "Type your message here...", + "autoHeight": "auto", + "leftPanelWidth": "250px", + "databaseName": "ChatDB_chat5837", + "currentMessage": "", + "conversationHistory": "[]", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "chat1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/chatBox.json b/e2e/fixtures/dsl/chatBox.json new file mode 100644 index 0000000000..d1258d707e --- /dev/null +++ b/e2e/fixtures/dsl/chatBox.json @@ -0,0 +1,143 @@ +{ + "ui": { + "layout": { + "42b8e1df": { + "i": "42b8e1df", + "h": 24, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "42b8e1df": { + "compType": "chatBox", + "comp": { + "chatTitle": "Chat", + "showHeader": true, + "messages": "[]", + "currentUserId": "user_1", + "currentUserName": "User", + "typingUsers": "[]", + "isAiThinking": false, + "lastSentMessageText": "", + "lastSentMessageTagsLlm": "", + "messageText": "", + "allowMessageFileUpload": true, + "maxMessageFiles": "10", + "rooms": "[]", + "currentRoomId": "", + "pendingInvites": "[]", + "onlineUsers": "[]", + "mentionCandidates": "[]", + "showRoomsPanel": true, + "roomsPanelWidth": "240px", + "allowRoomCreation": true, + "allowRoomSearch": true, + "pendingRoomId": "", + "newRoomName": "", + "newRoomType": "public", + "newRoomDescription": "", + "newRoomLlmQuery": "", + "inviteTargetUserId": "", + "pendingInviteId": "", + "autoHeight": "auto", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "chatBox1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/chatController.json b/e2e/fixtures/dsl/chatController.json new file mode 100644 index 0000000000..15742c6eb4 --- /dev/null +++ b/e2e/fixtures/dsl/chatController.json @@ -0,0 +1,102 @@ +{ + "ui": { + "layout": {} + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + }, + { + "compType": "chatController", + "comp": { + "applicationId": "lowcoder_app", + "userId": "user_1", + "userName": "User" + }, + "name": "chatController1" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/checkbox.json b/e2e/fixtures/dsl/checkbox.json new file mode 100644 index 0000000000..6664e0c250 --- /dev/null +++ b/e2e/fixtures/dsl/checkbox.json @@ -0,0 +1,142 @@ +{ + "ui": { + "layout": { + "fc83aa3c": { + "i": "fc83aa3c", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "fc83aa3c": { + "compType": "checkbox", + "comp": { + "defaultValue": "", + "value": "", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "options": { + "optionType": "manual", + "manual": { + "manual": [ + { + "value": "1", + "label": "Option 1" + }, + { + "value": "2", + "label": "Option 2" + } + ] + }, + "mapData": { + "data": "[]" + } + }, + "layout": "horizontal", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "checkbox1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/collapsibleContainer.json b/e2e/fixtures/dsl/collapsibleContainer.json new file mode 100644 index 0000000000..8d99ce0180 --- /dev/null +++ b/e2e/fixtures/dsl/collapsibleContainer.json @@ -0,0 +1,204 @@ +{ + "ui": { + "layout": { + "c483bfb2": { + "i": "c483bfb2", + "h": 25, + "w": 9, + "delayCollision": true, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "c483bfb2": { + "compType": "collapsibleContainer", + "comp": { + "container": { + "header": { + "layout": { + "9f350aff": { + "i": "9f350aff", + "h": 8, + "w": 13, + "x": 0, + "y": 0 + }, + "e3ea1748": { + "i": "e3ea1748", + "h": 5, + "w": 10, + "x": 14, + "y": 0 + } + }, + "items": { + "9f350aff": { + "compType": "text", + "comp": { + "text": "### Displayed Container Title", + "autoHeight": "auto", + "type": "markdown", + "horizontalAlignment": "left", + "contentScrollBar": true, + "verticalAlignment": "center", + "margin": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "padding": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "collapsibleTitle1" + }, + "e3ea1748": { + "compType": "toggleButton", + "comp": { + "value": "true", + "showText": false, + "trueText": "Hide", + "falseText": "Show", + "trueIcon": "/icon:solid/AngleUp", + "falseIcon": "/icon:solid/AngleDown", + "iconPosition": "right", + "alignment": "right", + "showBorder": false, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "collapsibleToggle1" + } + } + }, + "body": { + "0": { + "view": { + "layout": {} + } + } + }, + "footer": { + "layout": {} + }, + "showHeader": true, + "showBody": "{{collapsibleToggle1.value}}", + "autoHeight": "auto", + "showVerticalScrollbar": false, + "horizontalGridCells": 24, + "scrollbars": false, + "style": { + "borderWidth": "1px" + }, + "appliedThemeId": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "collapsibleContainer1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/colorPicker.json b/e2e/fixtures/dsl/colorPicker.json new file mode 100644 index 0000000000..f822330281 --- /dev/null +++ b/e2e/fixtures/dsl/colorPicker.json @@ -0,0 +1,127 @@ +{ + "ui": { + "layout": { + "31fd7bd9": { + "i": "31fd7bd9", + "h": 5, + "w": 5, + "x": 1, + "y": 3, + "pos": 0 + } + }, + "items": { + "31fd7bd9": { + "compType": "colorPicker", + "comp": { + "defaultValue": "", + "value": "#3377ff", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "validationType": "Text", + "color": "{}", + "trigger": "click", + "presets": "{\n \"label\": \"Recommended\",\n \"colors\": [\n \"#000000\",\n \"#000000E0\",\n \"#000000A6\",\n \"#00000073\",\n \"#00000040\",\n \"#00000026\",\n \"#0000001A\",\n \"#00000012\",\n \"#0000000A\",\n \"#00000005\",\n \"#F5222D\",\n \"#FA8C16\",\n \"#FADB14\",\n \"#8BBB11\",\n \"#52C41A\",\n \"#13A8A8\",\n \"#1677FF\",\n \"#2F54EB\",\n \"#722ED1\",\n \"#EB2F96\",\n \"#F5222D4D\",\n \"#FA8C164D\",\n \"#FADB144D\",\n \"#8BBB114D\",\n \"#52C41A4D\",\n \"#13A8A84D\",\n \"#1677FF4D\",\n \"#2F54EB4D\",\n \"#722ED14D\",\n \"#EB2F964D\"\n ]\n}", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "colorPicker1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/columnLayout.json b/e2e/fixtures/dsl/columnLayout.json new file mode 100644 index 0000000000..ebef13d994 --- /dev/null +++ b/e2e/fixtures/dsl/columnLayout.json @@ -0,0 +1,161 @@ +{ + "ui": { + "layout": { + "cf3d6687": { + "i": "cf3d6687", + "h": 25, + "w": 15, + "delayCollision": true, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "cf3d6687": { + "compType": "columnLayout", + "comp": { + "columns": { + "manual": [ + { + "id": 0, + "label": "Column1", + "key": "Column1", + "minWidth": "", + "background": "", + "backgroundImage": "", + "border": "", + "radius": "", + "margin": "", + "padding": "", + "hidden": "false" + }, + { + "id": 1, + "label": "Column2", + "key": "Column2", + "minWidth": "", + "background": "", + "backgroundImage": "", + "border": "", + "radius": "", + "margin": "", + "padding": "", + "hidden": "false" + } + ] + }, + "containers": { + "0": { + "layout": {} + }, + "1": { + "layout": {} + } + }, + "horizontalGridCells": 24, + "autoHeight": "auto", + "matchColumnsHeight": true, + "templateRows": "1fr", + "rowGap": "20px", + "templateColumns": "1fr 1fr", + "mainScrollbar": false, + "columnGap": "20px", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "columnLayout1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/comment.json b/e2e/fixtures/dsl/comment.json new file mode 100644 index 0000000000..6ce5e93ce3 --- /dev/null +++ b/e2e/fixtures/dsl/comment.json @@ -0,0 +1,125 @@ +{ + "ui": { + "layout": { + "d8e3ca9": { + "i": "d8e3ca9", + "h": 55, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "d8e3ca9": { + "compType": "comment", + "comp": { + "value": "[\n {\n \"user\": {\n \"name\": \"John Doe\",\n \"avatar\": \"https://ui-avatars.com/api/?name=John+Doe\"\n },\n \"value\": \"Has anyone tried using Lowcode for our new internal tool yet?\",\n \"createdAt\": \"2024-09-20T10:15:41.658Z\"\n },\n {\n \"user\": {\n \"name\": \"Jane Smith\",\n \"avatar\": \"https://ui-avatars.com/api/?name=Jane+Smith\"\n },\n \"value\": \"Yes, I’ve been experimenting with it for automating our workflows. It's super quick to set up.\",\n \"createdAt\": \"2024-09-20T10:17:12.658Z\"\n },\n {\n \"user\": {\n \"name\": \"Michael Brown\",\n \"displayName\": \"Michael\",\n \"avatar\": \"https://ui-avatars.com/api/?name=Michael+Brown\"\n },\n \"value\": \"That sounds interesting! What kind of automation are you building?\",\n \"createdAt\": \"2024-09-20T10:18:45.658Z\"\n },\n {\n \"user\": {\n \"name\": \"Jane Smith\",\n \"avatar\": \"https://ui-avatars.com/api/?name=Jane+Smith\"\n },\n \"value\": \"Mostly automating form submissions and integrating them with our CRM. It's easy to drag-and-drop components.\",\n \"createdAt\": \"2024-09-20T10:20:30.658Z\"\n },\n {\n \"user\": {\n \"name\": \"John Doe\",\n \"avatar\": \"https://ui-avatars.com/api/?name=John+Doe\"\n },\n \"value\": \"We should look into using it for API integrations as well. Lowcode could save a lot of development time.\",\n \"createdAt\": \"2024-09-20T10:22:05.658Z\"\n },\n {\n \"user\": {\n \"name\": \"Michael Brown\",\n \"displayName\": \"Michael\",\n \"avatar\": \"https://ui-avatars.com/api/?name=Michael+Brown\"\n },\n \"value\": \"I agree. Let’s plan a session next week to dive deeper into the possibilities.\",\n \"createdAt\": \"2024-09-20T10:23:55.658Z\"\n }\n]", + "title": "%d Comment in Total", + "placeholder": "Shift + Enter to Comment; Enter @ or # for Quick Input", + "buttonText": "Comment", + "sendCommentAble": true, + "userInfo": "{\n \"name\": \"{{currentUser.name}}\",\n \"email\": \"{{currentUser.email}}\"\n}", + "mentionList": "{\n \"@\": [\n \"John Doe\",\n \"Jane Doe\",\n \"Michael Smith\",\n \"Emily Davis\",\n \"Robert Johnson\",\n \"Patricia Brown\",\n \"William Jones\",\n \"Jennifer Miller\",\n \"David Wilson\",\n \"Linda Moore\"\n ],\n \"#\": [\n \"#lowcode\",\n \"#automation\",\n \"#appbuilder\",\n \"#nocode\",\n \"#workflow\",\n \"#draganddrop\",\n \"#rapiddevelopment\",\n \"#digitaltransformation\",\n \"#integration\",\n \"#api\"\n ]\n}", + "commentList": "[]", + "deletedItem": "[]", + "submitedItem": "[]", + "mentionName": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "comment1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/container.json b/e2e/fixtures/dsl/container.json new file mode 100644 index 0000000000..039b6e5832 --- /dev/null +++ b/e2e/fixtures/dsl/container.json @@ -0,0 +1,178 @@ +{ + "ui": { + "layout": { + "d9f7e49b": { + "i": "d9f7e49b", + "h": 25, + "w": 9, + "delayCollision": true, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "d9f7e49b": { + "compType": "container", + "comp": { + "container": { + "header": { + "layout": { + "931eda75": { + "i": "931eda75", + "h": 5, + "w": 24, + "x": 0, + "y": 0 + } + }, + "items": { + "931eda75": { + "compType": "text", + "comp": { + "text": "### Displayed Container Title", + "autoHeight": "auto", + "type": "markdown", + "horizontalAlignment": "left", + "contentScrollBar": true, + "verticalAlignment": "center", + "margin": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "padding": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "containerTitle1" + } + } + }, + "body": { + "0": { + "view": { + "layout": {} + } + } + }, + "footer": { + "layout": {} + }, + "showHeader": true, + "showBody": true, + "autoHeight": "auto", + "showVerticalScrollbar": false, + "horizontalGridCells": 24, + "scrollbars": false, + "style": { + "borderWidth": "1px" + }, + "appliedThemeId": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "container1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/controlButton.json b/e2e/fixtures/dsl/controlButton.json new file mode 100644 index 0000000000..7ed72a8025 --- /dev/null +++ b/e2e/fixtures/dsl/controlButton.json @@ -0,0 +1,126 @@ +{ + "ui": { + "layout": { + "1a103897": { + "i": "1a103897", + "h": 6, + "w": 3, + "x": 2, + "y": 2, + "pos": 0 + } + }, + "items": { + "1a103897": { + "compType": "controlButton", + "comp": { + "iconSize": "20px", + "type": "", + "autoHeight": "fixed", + "aspectRatio": "1 / 1", + "form": "", + "sourceMode": "standard", + "iconScoutAsset": { + "uuid": "", + "value": "", + "preview": "" + }, + "restrictPaddingOnRotation": "controlButton", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "controlButton1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/custom.json b/e2e/fixtures/dsl/custom.json new file mode 100644 index 0000000000..65aac44fcd --- /dev/null +++ b/e2e/fixtures/dsl/custom.json @@ -0,0 +1,116 @@ +{ + "ui": { + "layout": { + "5cc74b5f": { + "i": "5cc74b5f", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "5cc74b5f": { + "compType": "custom", + "comp": { + "model": "{\n \"name\": \"{{currentUser.name}}\",\n \"text\": \"It's a Good Day.\",\n \"query\": \"query1\"\n}", + "code": "\n \n \n \n \n \n
\n \n \n ", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "custom1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/date.json b/e2e/fixtures/dsl/date.json new file mode 100644 index 0000000000..84a0b77cd5 --- /dev/null +++ b/e2e/fixtures/dsl/date.json @@ -0,0 +1,129 @@ +{ + "ui": { + "layout": { + "49be82fe": { + "i": "49be82fe", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "49be82fe": { + "compType": "date", + "comp": { + "defaultValue": "", + "value": "", + "userTimeZone": "UTC", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "placeholder": "Select Date", + "inputFormat": "YYYY-MM-DD", + "suffixIcon": "/icon:regular/calendar", + "timeZone": "UTC", + "pickerMode": "date", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "date1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/dateRange.json b/e2e/fixtures/dsl/dateRange.json new file mode 100644 index 0000000000..a3173bbe40 --- /dev/null +++ b/e2e/fixtures/dsl/dateRange.json @@ -0,0 +1,131 @@ +{ + "ui": { + "layout": { + "95e06c3f": { + "i": "95e06c3f", + "h": 6, + "w": 9, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "95e06c3f": { + "compType": "dateRange", + "comp": { + "defaultStart": "", + "start": "", + "defaultEnd": "", + "end": "", + "userRangeTimeZone": "UTC", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "placeholder": "Select Date", + "inputFormat": "YYYY-MM-DD", + "suffixIcon": "/icon:regular/calendar", + "timeZone": "UTC", + "pickerMode": "date", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "dateRange1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/divider.json b/e2e/fixtures/dsl/divider.json new file mode 100644 index 0000000000..41f65c2503 --- /dev/null +++ b/e2e/fixtures/dsl/divider.json @@ -0,0 +1,116 @@ +{ + "ui": { + "layout": { + "2ba110bc": { + "i": "2ba110bc", + "h": 1, + "w": 9, + "x": 0, + "y": 5, + "pos": 0 + } + }, + "items": { + "2ba110bc": { + "compType": "divider", + "comp": { + "align": "left", + "autoHeight": "auto", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "divider1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/drawer.json b/e2e/fixtures/dsl/drawer.json new file mode 100644 index 0000000000..ef5e3a9461 --- /dev/null +++ b/e2e/fixtures/dsl/drawer.json @@ -0,0 +1,119 @@ +{ + "ui": { + "layout": {} + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + }, + { + "compType": "drawer", + "comp": { + "visible": "", + "titleAlign": "left", + "horizontalGridCells": 24, + "autoHeight": "auto", + "drawerScrollbar": true, + "placement": "right", + "closePosition": "left", + "maskClosable": true, + "showMask": true, + "toggleClose": true, + "escapeClosable": true, + "closeIcon": "", + "zIndex": "950", + "container": { + "layout": {} + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "drawer1" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/dropdown.json b/e2e/fixtures/dsl/dropdown.json new file mode 100644 index 0000000000..398435231b --- /dev/null +++ b/e2e/fixtures/dsl/dropdown.json @@ -0,0 +1,133 @@ +{ + "ui": { + "layout": { + "37726bcb": { + "i": "37726bcb", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "37726bcb": { + "compType": "dropdown", + "comp": { + "text": "Menu", + "triggerIconSize": "15", + "triggerMode": "hover", + "options": { + "optionType": "manual", + "manual": { + "manual": [ + { + "label": "Option 1" + }, + { + "label": "Option 2" + } + ] + }, + "mapData": { + "data": "[]" + } + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "dropdown1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/file.json b/e2e/fixtures/dsl/file.json new file mode 100644 index 0000000000..899c3b9d01 --- /dev/null +++ b/e2e/fixtures/dsl/file.json @@ -0,0 +1,122 @@ +{ + "ui": { + "layout": { + "acde3487": { + "i": "acde3487", + "h": 5, + "w": 6, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "acde3487": { + "compType": "file", + "comp": { + "text": "Browse", + "dragHintText": "Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files.", + "uploadType": "single", + "uploadMode": "button", + "autoHeight": "auto", + "showUploadList": true, + "prefixIcon": "/icon:solid/arrow-up-from-bracket", + "captureResolution": "auto", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "file1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/fileViewer.json b/e2e/fixtures/dsl/fileViewer.json new file mode 100644 index 0000000000..58b223344e --- /dev/null +++ b/e2e/fixtures/dsl/fileViewer.json @@ -0,0 +1,116 @@ +{ + "ui": { + "layout": { + "76e7e770": { + "i": "76e7e770", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "76e7e770": { + "compType": "fileViewer", + "comp": { + "autoHeight": "auto", + "showVerticalScrollbar": false, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "fileViewer1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/floatTextContainer.json b/e2e/fixtures/dsl/floatTextContainer.json new file mode 100644 index 0000000000..bf841a5d42 --- /dev/null +++ b/e2e/fixtures/dsl/floatTextContainer.json @@ -0,0 +1,183 @@ +{ + "ui": { + "layout": { + "14f7da67": { + "i": "14f7da67", + "h": 25, + "w": 9, + "delayCollision": true, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "14f7da67": { + "compType": "floatTextContainer", + "comp": { + "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi feugiat faucibus eleifend. Pellentesque eleifend, risus vel sagittis mattis, mauris ipsum tempor sapien, eu lobortis lacus libero a dui. Cras erat felis, rhoncus vestibulum consectetur et, ultrices ut purus. Sed a tortor orci. Vestibulum nec eleifend ante.", + "type": "markdown", + "float": "left", + "horizontalAlignment": "left", + "width": "40", + "container": { + "header": { + "layout": { + "860f9943": { + "i": "860f9943", + "h": 5, + "w": 24, + "x": 0, + "y": 0 + } + }, + "items": { + "860f9943": { + "compType": "text", + "comp": { + "text": "### Displayed Container Title", + "autoHeight": "auto", + "type": "markdown", + "horizontalAlignment": "left", + "contentScrollBar": true, + "verticalAlignment": "center", + "margin": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "padding": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "containerTitle1" + } + } + }, + "body": { + "0": { + "view": { + "layout": {} + } + } + }, + "footer": { + "layout": {} + }, + "showHeader": true, + "showBody": true, + "autoHeight": "auto", + "showVerticalScrollbar": false, + "horizontalGridCells": 24, + "scrollbars": false, + "style": { + "borderWidth": "1px" + }, + "appliedThemeId": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "floatTextContainer1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/floatingButton.json b/e2e/fixtures/dsl/floatingButton.json new file mode 100644 index 0000000000..b7ad5278dc --- /dev/null +++ b/e2e/fixtures/dsl/floatingButton.json @@ -0,0 +1,137 @@ +{ + "ui": { + "layout": { + "c1165922": { + "i": "c1165922", + "h": 1, + "w": 1, + "x": 3, + "y": 5, + "pos": 0 + } + }, + "items": { + "c1165922": { + "compType": "floatingButton", + "comp": { + "value": "", + "includeMargin": true, + "icon": "/icon:antd/questioncircleoutlined", + "buttons": { + "manual": [ + { + "id": 0, + "label": "Option 1", + "badge": "1", + "description": "", + "icon": "/icon:antd/filetextoutlined" + }, + { + "id": 1, + "label": "Option 2", + "badge": "0", + "description": "", + "icon": "/icon:antd/filetextoutlined" + } + ] + }, + "shape": "circle", + "buttonTheme": "primary", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "floatingButton1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/form.json b/e2e/fixtures/dsl/form.json new file mode 100644 index 0000000000..ac627aa5f3 --- /dev/null +++ b/e2e/fixtures/dsl/form.json @@ -0,0 +1,202 @@ +{ + "ui": { + "layout": { + "e73a7389": { + "i": "e73a7389", + "h": 50, + "w": 9, + "delayCollision": true, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "e73a7389": { + "compType": "form", + "comp": { + "container": { + "header": { + "layout": { + "c1f38942": { + "i": "c1f38942", + "h": 5, + "w": 24, + "x": 0, + "y": 0 + } + }, + "items": { + "c1f38942": { + "compType": "text", + "comp": { + "text": "### Form Title", + "autoHeight": "auto", + "type": "markdown", + "horizontalAlignment": "left", + "contentScrollBar": true, + "verticalAlignment": "center", + "margin": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "padding": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "formTitle1" + } + } + }, + "body": { + "0": { + "view": { + "layout": {} + } + } + }, + "footer": { + "layout": { + "49a78e62": { + "i": "49a78e62", + "h": 5, + "w": 10, + "x": 14, + "y": 0 + } + }, + "items": { + "49a78e62": { + "compType": "button", + "comp": { + "text": "Submit", + "type": "submit", + "form": "form1", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "formButton1" + } + } + }, + "showHeader": true, + "showBody": true, + "showFooter": true, + "autoHeight": "auto", + "showVerticalScrollbar": false, + "horizontalGridCells": 24, + "scrollbars": false, + "style": { + "borderWidth": "1px" + }, + "appliedThemeId": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "form1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/funnelChart.json b/e2e/fixtures/dsl/funnelChart.json new file mode 100644 index 0000000000..6c92cca7db --- /dev/null +++ b/e2e/fixtures/dsl/funnelChart.json @@ -0,0 +1,193 @@ +{ + "ui": { + "layout": { + "c7efc480": { + "i": "c7efc480", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "c7efc480": { + "compType": "funnelChart", + "comp": { + "mode": "json", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "761f3b5a" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "b16559c3" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsData": "[\n {\n \"value\": 100,\n \"name\": \"Show\",\n \"color\": \"#fc8452\"\n },\n {\n \"value\": 80,\n \"name\": \"Click\",\n \"color\": \"#9a60b4\"\n },\n {\n \"value\": 60,\n \"name\": \"Visit\",\n \"color\": \"#fac858\"\n },\n {\n \"value\": 40,\n \"name\": \"Query\",\n \"color\": \"#ee6666\"\n },\n {\n \"value\": 20,\n \"name\": \"Buy\",\n \"color\": \"#3ba272\"\n }\n]", + "echartsOption": "{\n \"data\": [\n {\n \"value\": 100,\n \"name\": \"Show\",\n \"color\": \"#fc8452\"\n },\n {\n \"value\": 80,\n \"name\": \"Click\",\n \"color\": \"#9a60b4\"\n },\n {\n \"value\": 60,\n \"name\": \"Visit\",\n \"color\": \"#fac858\"\n },\n {\n \"value\": 40,\n \"name\": \"Query\",\n \"color\": \"#ee6666\"\n },\n {\n \"value\": 20,\n \"name\": \"Buy\",\n \"color\": \"#3ba272\"\n }\n ]\n}", + "echartsTitle": "Funnel Chart", + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsSortingConfig": { + "sort": "descending" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsFunnelAlignConfig": { + "funnelAlign": "center" + }, + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLegendOrientConfig": { + "orient": "horizontal" + }, + "echartsLegendAlignConfig": { + "left": "center" + }, + "echartsConfig": { + "compType": "funnel", + "comp": {} + }, + "echartsTitleConfig": { + "position": "center" + }, + "tooltip": true, + "label": true, + "legendVisibility": true, + "left": "35", + "top": "60", + "bottom": "60", + "width": "80", + "min": "0", + "max": "100", + "gap": "2", + "opacity": "1", + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "funnelChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/ganttChart.json b/e2e/fixtures/dsl/ganttChart.json new file mode 100644 index 0000000000..1246bba612 --- /dev/null +++ b/e2e/fixtures/dsl/ganttChart.json @@ -0,0 +1,218 @@ +{ + "ui": { + "layout": { + "36981f27": { + "i": "36981f27", + "h": 60, + "w": 13, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "36981f27": { + "compType": "ganttChart", + "comp": { + "autoHeight": "auto", + "showHeaders": true, + "showLegendTable": true, + "data": { + "optionType": "manual", + "manual": { + "manual": [ + { + "label": "Some Project", + "start": "Sun Nov 01 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "end": "Sun Nov 15 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "id": "ProjectSample", + "progress": "25", + "type": "project", + "hideChildren": "false", + "displayOrder": "1" + }, + { + "label": "Idea", + "start": "Sun Nov 01 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "end": "Mon Nov 02 2026 12:28:00 GMT+0000 (Coordinated Universal Time)", + "id": "Task 0", + "project": "ProjectSample", + "progress": "45", + "type": "task", + "displayOrder": "2" + }, + { + "label": "Research", + "start": "Mon Nov 02 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "end": "Wed Nov 04 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "id": "Task 1", + "project": "ProjectSample", + "progress": "25", + "type": "task", + "displayOrder": "3", + "dependencies": "Task 0" + }, + { + "label": "Discussion with team", + "start": "Wed Nov 04 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "end": "Sun Nov 08 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "id": "Task 2", + "project": "ProjectSample", + "progress": "10", + "type": "task", + "displayOrder": "4", + "dependencies": "Task 1" + }, + { + "label": "Developing", + "start": "Sun Nov 08 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "end": "Mon Nov 09 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "id": "Task 3", + "project": "ProjectSample", + "progress": "2", + "type": "task", + "displayOrder": "5", + "dependencies": "Task 2" + }, + { + "label": "Review", + "start": "Sun Nov 08 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "end": "Tue Nov 10 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "id": "Task 4", + "project": "ProjectSample", + "progress": "70", + "type": "task", + "displayOrder": "6", + "dependencies": "Task 2" + }, + { + "label": "Release", + "start": "Sun Nov 15 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "end": "Sun Nov 15 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "id": "Task 6", + "project": "ProjectSample", + "progress": "10", + "type": "milestone", + "displayOrder": "7", + "dependencies": "Task 4" + }, + { + "label": "Party Time", + "start": "Wed Nov 18 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "end": "Thu Nov 19 2026 00:00:00 GMT+0000 (Coordinated Universal Time)", + "id": "Task 9", + "progress": "0", + "type": "task" + } + ] + }, + "mapData": { + "data": "[]" + } + }, + "activeViewMode": "Day", + "legendWidth": "300px", + "headerHeight": "30", + "columnWidth": "65", + "listCellWidth": "80px", + "rowHeight": "40", + "handleWidth": "10", + "arrowIndent": "20", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "ganttChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/gaugeChart.json b/e2e/fixtures/dsl/gaugeChart.json new file mode 100644 index 0000000000..9f61086bab --- /dev/null +++ b/e2e/fixtures/dsl/gaugeChart.json @@ -0,0 +1,218 @@ +{ + "ui": { + "layout": { + "ff406557": { + "i": "ff406557", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "ff406557": { + "compType": "gaugeChart", + "comp": { + "mode": "json", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "90f36975" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "18df3a44" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsOption": "{\n \"data\": [\n {\n \"value\": 60,\n \"name\": \"Completed\",\n \"color\": \"#fc8452\",\n \"formatter\": \"{value} %\"\n }\n ]\n}", + "stageGaugeOption": "{\n \"data\": [\n {\n \"value\": 80,\n \"formatter\": \"{value} Km/h\",\n \"color\": [\n [\n 0.3,\n \"#67e0e3\"\n ],\n [\n 0.7,\n \"#37a2da\"\n ],\n [\n 1,\n \"#fd666d\"\n ]\n ]\n }\n ]\n}", + "gradeGaugeOption": "{\n \"data\": [\n {\n \"value\": 80,\n \"name\": \"Grade Rating\",\n \"formatter\": \"{value} %\",\n \"color\": [\n [\n 0.25,\n \"#FF6E76\"\n ],\n [\n 0.5,\n \"#FDDD60\"\n ],\n [\n 0.75,\n \"#58D9F9\"\n ],\n [\n 1,\n \"#7CFFB2\"\n ]\n ]\n }\n ]\n}", + "temperatureGaugeOption": "{\n \"data\": [\n {\n \"value\": 20,\n \"color\": \"#fc8452\",\n \"borderColor\": \"#cd7c1d\",\n \"formatter\": \"{value} °C\"\n }\n ]\n}", + "multiTitleGaugeOption": "{\n \"data\": [\n {\n \"formatter\": \"{value}%\",\n \"value\": [\n {\n \"color\": \"#19b1e6\",\n \"title\": \"Perfect\",\n \"value\": 20,\n \"titlePosition\": [\n \"-60%\",\n \"60%\"\n ],\n \"valuePosition\": [\n \"-60%\",\n \"80%\"\n ]\n },\n {\n \"color\": \"#fac858\",\n \"title\": \"Good\",\n \"value\": 40,\n \"titlePosition\": [\n \"0%\",\n \"60%\"\n ],\n \"valuePosition\": [\n \"0%\",\n \"80%\"\n ]\n },\n {\n \"color\": \"#09f64d\",\n \"title\": \"Commonly\",\n \"value\": 60,\n \"titlePosition\": [\n \"60%\",\n \"60%\"\n ],\n \"valuePosition\": [\n \"60%\",\n \"80%\"\n ]\n }\n ]\n }\n ]\n}", + "ringGaugeOption": "{\n \"data\": [\n {\n \"formatter\": \"{value}%\",\n \"value\": [\n {\n \"color\": \"#19b1e6\",\n \"title\": \"Perfect\",\n \"value\": 20,\n \"titlePosition\": [\n \"0%\",\n \"-40%\"\n ],\n \"valuePosition\": [\n \"0%\",\n \"-20%\"\n ]\n },\n {\n \"color\": \"#fac858\",\n \"title\": \"Good\",\n \"value\": 40,\n \"titlePosition\": [\n \"0%\",\n \"0%\"\n ],\n \"valuePosition\": [\n \"0%\",\n \"20%\"\n ]\n },\n {\n \"color\": \"#09f64d\",\n \"title\": \"Commonly\",\n \"value\": 60,\n \"titlePosition\": [\n \"0%\",\n \"40%\"\n ],\n \"valuePosition\": [\n \"0%\",\n \"60%\"\n ]\n }\n ]\n }\n ]\n}", + "clockGaugeOption": "{\n \"data\": [\n {\n \"outlineColor\": \"#aa2a2a\",\n \"anchor\": {\n \"color\": \"#cfae09\",\n \"size\": 10\n },\n \"hour\": {\n \"color\": \"#cfae09\",\n \"width\": 4,\n \"length\": 50,\n \"value\": 4\n },\n \"minute\": {\n \"color\": \"#cfae09\",\n \"width\": 2.5,\n \"length\": 65,\n \"value\": 30\n },\n \"second\": {\n \"color\": \"#cfae09\",\n \"width\": 1,\n \"length\": 90,\n \"value\": 45\n }\n }\n ]\n}", + "barometerGaugeOption": "{\n \"data\": [\n {\n \"formatter\": \"{value}%\",\n \"value\": 58.46,\n \"name\": \"PLP\",\n \"outline\": {\n \"color\": \"#c80707\",\n \"period\": [\n 0,\n 100\n ],\n \"splitNumber\": 10,\n \"progressBarWidth\": 2,\n \"axisTickLength\": 6,\n \"axisTickWidth\": 2,\n \"radius\": \"70%\"\n },\n \"inline\": {\n \"color\": \"#000000\",\n \"period\": [\n 0,\n 60\n ],\n \"progressBarWidth\": 2,\n \"splitNumber\": 6,\n \"axisTickLength\": 6,\n \"axisTickWidth\": 2,\n \"radius\": \"60%\"\n }\n }\n ]\n}", + "chartType": "Default", + "echartsTitle": "Gauge Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsConfig": { + "compType": "gauge", + "comp": {} + }, + "echartsTitleConfig": { + "position": "center" + }, + "tooltip": true, + "legendVisibility": true, + "label": true, + "progressBar": true, + "roundCap": true, + "left": "35", + "top": "60", + "bottom": "60", + "width": "80", + "radius": "80", + "temperatureRadius": "60", + "min": "0", + "max": "100", + "gap": "2", + "position_x": "50", + "position_y": "60", + "startAngle": "210", + "endAngle": "-30", + "splitNumber": "10", + "pointerLength": "50", + "barometerPointerLength": "125", + "pointerWidth": "5", + "barometerPointerWidth": "3", + "pointer_Y": "0", + "barometerPointer_Y": "-10", + "pointerIcon": "", + "gradePointerIcon": "path://M12.8,0.7l12,40.1H0.7L12.8,0.7z", + "clockPointerIcon": "path://M2.9,0.7L2.9,0.7c1.4,0,2.6,1.2,2.6,2.6v115c0,1.4-1.2,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.2-2.6-2.6V3.3C0.3,1.9,1.4,0.7,2.9,0.7z", + "barometerPointerIcon": "path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z", + "multiTitlePointerIcon": "path://M2.9,0.7L2.9,0.7c1.4,0,2.6,1.2,2.6,2.6v115c0,1.4-1.2,2.6-2.6,2.6l0,0c-1.4,0-2.6-1.2-2.6-2.6V3.3C0.3,1.9,1.4,0.7,2.9,0.7z", + "progressBarWidth": "10", + "axisTickWidth": "2", + "axisTickLength": "7", + "axisLabelDistance": "10", + "axisTickColor": "#444444", + "gradeGaugePointerLength": "25", + "gradeGaugePointerWidth": "10", + "gradeGaugePointer_Y": "45", + "stageProgressBarWidth": "15", + "temperatureProgressBarWidth": "35", + "ringProgressBarWidth": "20", + "temperatureAxisLabelDistance": "30", + "stageAxisTickColor": "#ffffff", + "gradeAxisTickColor": "", + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "gaugeChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/graphChart.json b/e2e/fixtures/dsl/graphChart.json new file mode 100644 index 0000000000..fe742981f0 --- /dev/null +++ b/e2e/fixtures/dsl/graphChart.json @@ -0,0 +1,182 @@ +{ + "ui": { + "layout": { + "ca09eee1": { + "i": "ca09eee1", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "ca09eee1": { + "compType": "graphChart", + "comp": { + "mode": "json", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "4ea57a55" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "9b8299ef" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsCategories": "[\n {\n \"name\": \"Person\",\n \"itemStyle\": {\n \"color\": \"#4285F4\"\n }\n },\n {\n \"name\": \"Company\",\n \"itemStyle\": {\n \"color\": \"#34A853\"\n }\n },\n {\n \"name\": \"Project\",\n \"itemStyle\": {\n \"color\": \"#EA4335\"\n }\n }\n]", + "echartsLinks": "[\n {\n \"source\": \"1\",\n \"target\": \"3\",\n \"value\": 8,\n \"lineStyle\": {\n \"width\": 2\n }\n },\n {\n \"source\": \"1\",\n \"target\": \"4\",\n \"value\": 6,\n \"lineStyle\": {\n \"width\": 2\n }\n },\n {\n \"source\": \"2\",\n \"target\": \"3\",\n \"value\": 5,\n \"lineStyle\": {\n \"width\": 1\n }\n },\n {\n \"source\": \"3\",\n \"target\": \"4\",\n \"value\": 9,\n \"lineStyle\": {\n \"width\": 3\n }\n }\n]", + "echartsNodes": "[\n {\n \"id\": \"1\",\n \"name\": \"John Smith\",\n \"value\": 25,\n \"category\": 0,\n \"symbolSize\": 25\n },\n {\n \"id\": \"2\",\n \"name\": \"Jane Doe\",\n \"value\": 20,\n \"category\": 0,\n \"symbolSize\": 20\n },\n {\n \"id\": \"3\",\n \"name\": \"Acme Inc\",\n \"value\": 30,\n \"category\": 1,\n \"symbolSize\": 30\n },\n {\n \"id\": \"4\",\n \"name\": \"Project X\",\n \"value\": 25,\n \"category\": 2,\n \"symbolSize\": 25\n }\n]", + "echartsOption": "{\n \"color\": {\n \"pointColor\": \"#4285F4\",\n \"lineColor\": \"#00000045\"\n },\n \"categories\": [\n {\n \"name\": \"Person\",\n \"itemStyle\": {\n \"color\": \"#4285F4\"\n }\n },\n {\n \"name\": \"Company\",\n \"itemStyle\": {\n \"color\": \"#34A853\"\n }\n },\n {\n \"name\": \"Project\",\n \"itemStyle\": {\n \"color\": \"#EA4335\"\n }\n }\n ],\n \"nodes\": [\n {\n \"id\": \"1\",\n \"name\": \"John Smith\",\n \"value\": 25,\n \"category\": 0,\n \"symbolSize\": 25\n },\n {\n \"id\": \"2\",\n \"name\": \"Jane Doe\",\n \"value\": 20,\n \"category\": 0,\n \"symbolSize\": 20\n },\n {\n \"id\": \"3\",\n \"name\": \"Acme Inc\",\n \"value\": 30,\n \"category\": 1,\n \"symbolSize\": 30\n },\n {\n \"id\": \"4\",\n \"name\": \"Project X\",\n \"value\": 25,\n \"category\": 2,\n \"symbolSize\": 25\n }\n ],\n \"links\": [\n {\n \"source\": \"1\",\n \"target\": \"3\",\n \"value\": 8,\n \"lineStyle\": {\n \"width\": 2\n }\n },\n {\n \"source\": \"1\",\n \"target\": \"4\",\n \"value\": 6,\n \"lineStyle\": {\n \"width\": 2\n }\n },\n {\n \"source\": \"2\",\n \"target\": \"3\",\n \"value\": 5,\n \"lineStyle\": {\n \"width\": 1\n }\n },\n {\n \"source\": \"3\",\n \"target\": \"4\",\n \"value\": 9,\n \"lineStyle\": {\n \"width\": 3\n }\n }\n ]\n}", + "echartsTitle": "Graph Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "echartsConfig": { + "compType": "graph", + "comp": {} + }, + "arrowSize": "10", + "pointSize": "15", + "repulsion": "100", + "gravity": "0.1", + "lineLength": "100", + "lineWidth": "2", + "curveness": "0", + "tooltip": true, + "arrowFlag": true, + "legendVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "graphChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/grid.json b/e2e/fixtures/dsl/grid.json new file mode 100644 index 0000000000..f6e697990b --- /dev/null +++ b/e2e/fixtures/dsl/grid.json @@ -0,0 +1,241 @@ +{ + "ui": { + "layout": { + "6f056190": { + "i": "6f056190", + "h": 40, + "w": 9, + "delayCollision": true, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "6f056190": { + "compType": "grid", + "comp": { + "noOfRows": "[\n {\n \"rate\": \"9.2\",\n \"title\": \"The Shawshank Redemption\",\n \"url\": \"https://www.imdb.com/title/tt0111161/\",\n \"cover\": \"https://m.media-amazon.com/images/M/MV5BMDFkYTc0MGEtZmNhMC00ZDIzLWFmNTEtODM1ZmRlYWMwMWFmXkEyXkFqcGdeQXVyMTMxODk2OTU@._V1_UY67_CR0,0,45,67_AL_.jpg\"\n },\n {\n \"rate\": \"9.2\",\n \"title\": \"The Godfather\",\n \"url\": \"https://www.imdb.com/title/tt0068646/\",\n \"cover\": \"https://m.media-amazon.com/images/M/MV5BM2MyNjYxNmUtYTAwNi00MTYxLWJmNWYtYzZlODY3ZTk3OTFlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_UY67_CR1,0,45,67_AL_.jpg\"\n },\n {\n \"rate\": \"9.0\",\n \"title\": \"The Dark Knight\",\n \"url\": \"https://www.imdb.com/title/tt0468569/\",\n \"cover\": \"https://m.media-amazon.com/images/M/MV5BMTMxNTMwODM0NF5BMl5BanBnXkFtZTcwODAyMTk2Mw@@._V1_UY67_CR0,0,45,67_AL_.jpg\"\n },\n {\n \"rate\": \"9.0\",\n \"title\": \"The Godfather Part II\",\n \"url\": \"https://www.imdb.com/title/tt0071562/\",\n \"cover\": \"https://m.media-amazon.com/images/M/MV5BMWMwMGQzZTItY2JlNC00OWZiLWIyMDctNDk2ZDQ2YjRjMWQ0XkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_UY67_CR1,0,45,67_AL_.jpg\"\n },\n {\n \"rate\": \"9.0\",\n \"title\": \"12 Angry Men\",\n \"url\": \"https://www.imdb.com/title/tt0050083/\",\n \"cover\": \"https://m.media-amazon.com/images/M/MV5BMWU4N2FjNzYtNTVkNC00NzQ0LTg0MjAtYTJlMjFhNGUxZDFmXkEyXkFqcGdeQXVyNjc1NTYyMjg@._V1_UX45_CR0,0,45,67_AL_.jpg\"\n },\n {\n \"rate\": \"8.9\",\n \"title\": \"Schindler's List\",\n \"url\": \"https://www.imdb.com/title/tt0108052/\",\n \"cover\": \"https://m.media-amazon.com/images/M/MV5BNDE4OTMxMTctNmRhYy00NWE2LTg3YzItYTk3M2UwOTU5Njg4XkEyXkFqcGdeQXVyNjU0OTQ0OTY@._V1_UX45_CR0,0,45,67_AL_.jpg\"\n }\n]", + "noOfColumns": "3", + "itemIndexName": "i", + "itemDataName": "currentItem", + "dynamicHeight": "auto", + "heightUnitOfRow": "1", + "container": { + "layout": { + "23cec23a": { + "i": "23cec23a", + "w": 7, + "h": 14, + "x": 0, + "y": 0 + }, + "c200c6a7": { + "i": "c200c6a7", + "h": 5, + "w": 17, + "x": 7, + "y": 0 + }, + "7cab5f53": { + "i": "7cab5f53", + "h": 5, + "w": 17, + "x": 7, + "y": 9 + } + }, + "items": { + "23cec23a": { + "compType": "image", + "comp": { + "sourceMode": "standard", + "src": "{{currentItem.cover}}", + "iconScoutAsset": { + "uuid": "", + "value": "", + "preview": "" + }, + "clipPath": "none", + "autoHeight": "fixed", + "restrictPaddingOnRotation": "image", + "enableOverflow": false, + "aspectRatio": "16 / 9", + "placement": "top", + "overflow": "hidden", + "positionX": "center", + "positionY": "center", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "image1" + }, + "c200c6a7": { + "compType": "link", + "comp": { + "text": "{{i+1}}. {{currentItem.title}}", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "goToURL", + "comp": { + "url": "{{currentItem.url}}", + "query": [ + {} + ], + "hash": [ + {} + ], + "inNewTab": true + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ], + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "link1" + }, + "7cab5f53": { + "compType": "rating", + "comp": { + "defaultValue": "", + "value": "{{currentItem.rate / 2}}", + "max": "5", + "label": { + "text": "", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "right" + }, + "allowHalf": true, + "disabled": "true", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "rating1" + } + } + }, + "autoHeight": "auto", + "showVerticalScrollbar": false, + "showHorizontalScrollbar": false, + "horizontalGridCells": 24, + "scrollbars": false, + "pagination": { + "changeablePageSize": null, + "pageSize": "6", + "pageSizeOptions": "[5, 10, 20, 50]" + }, + "horizontal": false, + "minHorizontalWidth": "100px", + "enableSorting": false, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "grid1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/heatmapChart.json b/e2e/fixtures/dsl/heatmapChart.json new file mode 100644 index 0000000000..4f3159f87c --- /dev/null +++ b/e2e/fixtures/dsl/heatmapChart.json @@ -0,0 +1,189 @@ +{ + "ui": { + "layout": { + "61a3e5e8": { + "i": "61a3e5e8", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "61a3e5e8": { + "compType": "heatmapChart", + "comp": { + "mode": "json", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "a3be57e8" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "b04a845e" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsData": "[\n [\n 0,\n 0,\n 10\n ],\n [\n 0,\n 1,\n 20\n ],\n [\n 0,\n 2,\n 30\n ],\n [\n 1,\n 0,\n 40\n ],\n [\n 1,\n 1,\n 50\n ],\n [\n 1,\n 2,\n 60\n ],\n [\n 2,\n 0,\n 70\n ],\n [\n 2,\n 1,\n 80\n ],\n [\n 2,\n 2,\n 90\n ],\n [\n 3,\n 0,\n 100\n ],\n [\n 3,\n 1,\n 90\n ],\n [\n 3,\n 2,\n 80\n ],\n [\n 4,\n 0,\n 70\n ],\n [\n 4,\n 1,\n 60\n ],\n [\n 4,\n 2,\n 50\n ],\n [\n 5,\n 0,\n 40\n ],\n [\n 5,\n 1,\n 30\n ],\n [\n 5,\n 2,\n 20\n ],\n [\n 6,\n 0,\n 10\n ],\n [\n 6,\n 1,\n 0\n ],\n [\n 6,\n 2,\n 10\n ]\n]", + "echartsDataX": "[\n \"Mo\",\n \"Tu\",\n \"We\",\n \"Th\",\n \"Fr\",\n \"Sa\",\n \"Su\"\n]", + "echartsDataY": "[\n \"Morning\",\n \"Afternoon\",\n \"Evening\"\n]", + "echartsColor": "[\n \"#313695\",\n \"#4575b4\",\n \"#74add1\",\n \"#abd9e9\",\n \"#e0f3f8\"\n]", + "echartsOption": "{\n \"xAxis\": [\n \"Mo\",\n \"Tu\",\n \"We\",\n \"Th\",\n \"Fr\",\n \"Sa\",\n \"Su\"\n ],\n \"yAxis\": [\n \"Morning\",\n \"Afternoon\",\n \"Evening\"\n ],\n \"color\": [\n \"#313695\",\n \"#4575b4\",\n \"#74add1\",\n \"#abd9e9\",\n \"#e0f3f8\"\n ],\n \"data\": [\n [\n 0,\n 0,\n 10\n ],\n [\n 0,\n 1,\n 20\n ],\n [\n 0,\n 2,\n 30\n ],\n [\n 1,\n 0,\n 40\n ],\n [\n 1,\n 1,\n 50\n ],\n [\n 1,\n 2,\n 60\n ],\n [\n 2,\n 0,\n 70\n ],\n [\n 2,\n 1,\n 80\n ],\n [\n 2,\n 2,\n 90\n ],\n [\n 3,\n 0,\n 100\n ],\n [\n 3,\n 1,\n 90\n ],\n [\n 3,\n 2,\n 80\n ],\n [\n 4,\n 0,\n 70\n ],\n [\n 4,\n 1,\n 60\n ],\n [\n 4,\n 2,\n 50\n ],\n [\n 5,\n 0,\n 40\n ],\n [\n 5,\n 1,\n 30\n ],\n [\n 5,\n 2,\n 20\n ],\n [\n 6,\n 0,\n 10\n ],\n [\n 6,\n 1,\n 0\n ],\n [\n 6,\n 2,\n 10\n ]\n ]\n}", + "echartsTitle": "Heatmap Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "echartsLegendOrientConfig": { + "orient": "horizontal" + }, + "echartsLegendAlignConfig": { + "left": "center" + }, + "echartsConfig": { + "compType": "heatmap", + "comp": {} + }, + "left": "15", + "right": "10", + "top": "15", + "bottom": "30", + "min": "0", + "max": "100", + "tooltip": true, + "xAxisVisibility": true, + "yAxisVisibility": true, + "labelVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "heatmapChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/hillchart.json b/e2e/fixtures/dsl/hillchart.json new file mode 100644 index 0000000000..0280379f30 --- /dev/null +++ b/e2e/fixtures/dsl/hillchart.json @@ -0,0 +1,116 @@ +{ + "ui": { + "layout": { + "2abdc4e4": { + "i": "2abdc4e4", + "h": 50, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "2abdc4e4": { + "compType": "hillchart", + "comp": { + "autoHeight": "auto", + "data": "[\n {\n \"id\": 1,\n \"color\": \"gray\",\n \"description\": \"Validation: Salesforce Integration\",\n \"x\": 25,\n \"size\": 15\n },\n {\n \"id\": 2,\n \"color\": \"maroon\",\n \"description\": \"Renewals\",\n \"x\": 80,\n \"size\": 10\n },\n {\n \"id\": 3,\n \"color\": \"maroon\",\n \"description\": \"Refactor: Fancy Pants\",\n \"x\": 35,\n \"size\": 10\n },\n {\n \"id\": 4,\n \"color\": \"cyan\",\n \"description\": \"Refactor: Lighthouse Orbs\",\n \"x\": 45,\n \"size\": 10\n },\n {\n \"id\": 5,\n \"color\": \"yellow\",\n \"description\": \"Migration & Legacy Data Updates\",\n \"x\": 50,\n \"size\": 20\n }\n]", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "hillchart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/icon.json b/e2e/fixtures/dsl/icon.json new file mode 100644 index 0000000000..0a5a5b8050 --- /dev/null +++ b/e2e/fixtures/dsl/icon.json @@ -0,0 +1,123 @@ +{ + "ui": { + "layout": { + "e0d39dec": { + "i": "e0d39dec", + "h": 10, + "w": 2, + "x": 2, + "y": 0, + "pos": 0 + } + }, + "items": { + "e0d39dec": { + "compType": "icon", + "comp": { + "sourceMode": "standard", + "icon": "/icon:antd/homefilled", + "iconScoutAsset": { + "uuid": "", + "value": "", + "preview": "" + }, + "autoHeight": "auto", + "iconSize": "20", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "icon1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/iframe.json b/e2e/fixtures/dsl/iframe.json new file mode 100644 index 0000000000..62601f469f --- /dev/null +++ b/e2e/fixtures/dsl/iframe.json @@ -0,0 +1,114 @@ +{ + "ui": { + "layout": { + "14560281": { + "i": "14560281", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "14560281": { + "compType": "iframe", + "comp": { + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "iframe1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/image.json b/e2e/fixtures/dsl/image.json new file mode 100644 index 0000000000..88ca06fab4 --- /dev/null +++ b/e2e/fixtures/dsl/image.json @@ -0,0 +1,130 @@ +{ + "ui": { + "layout": { + "5b24a1dd": { + "i": "5b24a1dd", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "5b24a1dd": { + "compType": "image", + "comp": { + "sourceMode": "standard", + "src": "https://temp.im/350x400", + "iconScoutAsset": { + "uuid": "", + "value": "", + "preview": "" + }, + "clipPath": "none", + "autoHeight": "fixed", + "restrictPaddingOnRotation": "image", + "enableOverflow": false, + "aspectRatio": "16 / 9", + "placement": "top", + "overflow": "hidden", + "positionX": "center", + "positionY": "center", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "image1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/imageEditor.json b/e2e/fixtures/dsl/imageEditor.json new file mode 100644 index 0000000000..bcf013550d --- /dev/null +++ b/e2e/fixtures/dsl/imageEditor.json @@ -0,0 +1,128 @@ +{ + "ui": { + "layout": { + "9f5c1b0d": { + "i": "9f5c1b0d", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "9f5c1b0d": { + "compType": "imageEditor", + "comp": { + "src": "", + "name": "Example", + "crop": true, + "flip": true, + "rotate": true, + "draw": true, + "shape": true, + "icon": true, + "text": true, + "mask": true, + "filter": true, + "dataURI": "", + "data": "", + "buttonText": "Save", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "imageEditor1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/input.json b/e2e/fixtures/dsl/input.json new file mode 100644 index 0000000000..25456530a1 --- /dev/null +++ b/e2e/fixtures/dsl/input.json @@ -0,0 +1,124 @@ +{ + "ui": { + "layout": { + "30b0f8ae": { + "i": "30b0f8ae", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "30b0f8ae": { + "compType": "input", + "comp": { + "defaultValue": "", + "value": "", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "validationType": "Text", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "input1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/jsonEditor.json b/e2e/fixtures/dsl/jsonEditor.json new file mode 100644 index 0000000000..23b459977d --- /dev/null +++ b/e2e/fixtures/dsl/jsonEditor.json @@ -0,0 +1,123 @@ +{ + "ui": { + "layout": { + "c689675b": { + "i": "c689675b", + "h": 50, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "c689675b": { + "compType": "jsonEditor", + "comp": { + "value": "{\n \"a\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"b\": false,\n \"c\": {\n \"message\": \"hello world\"\n }\n}", + "autoHeight": "auto", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "column", + "align": "left" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "jsonEditor1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/jsonExplorer.json b/e2e/fixtures/dsl/jsonExplorer.json new file mode 100644 index 0000000000..b2a5bfaec9 --- /dev/null +++ b/e2e/fixtures/dsl/jsonExplorer.json @@ -0,0 +1,119 @@ +{ + "ui": { + "layout": { + "e3928e56": { + "i": "e3928e56", + "h": 50, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "e3928e56": { + "compType": "jsonExplorer", + "comp": { + "value": "{\n \"a\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ],\n \"b\": false,\n \"c\": {\n \"message\": \"hello world\"\n }\n}", + "autoHeight": "auto", + "indent": "4", + "expandToggle": true, + "theme": "shapeshifter:inverted", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "jsonExplorer1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/jsonLottie.json b/e2e/fixtures/dsl/jsonLottie.json new file mode 100644 index 0000000000..24f25ba67a --- /dev/null +++ b/e2e/fixtures/dsl/jsonLottie.json @@ -0,0 +1,131 @@ +{ + "ui": { + "layout": { + "c5816826": { + "i": "c5816826", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "c5816826": { + "compType": "jsonLottie", + "comp": { + "sourceMode": "standard", + "value": "{\n \"v\": \"5.8.1\",\n \"fr\": 30,\n \"ip\": 0,\n \"op\": 43,\n \"w\": 1000,\n \"h\": 800,\n \"nm\": \"Social_Media_82 1\",\n \"ddd\": 0,\n \"assets\": [],\n \"layers\": [\n {\n \"ddd\": 0,\n \"ind\": 1,\n \"ty\": 4,\n \"nm\": \"Shape 02\",\n \"td\": 1,\n \"sr\": 1,\n \"ks\": {\n \"o\": {\n \"a\": 0,\n \"k\": 100,\n \"ix\": 11\n },\n \"r\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 10\n },\n \"p\": {\n \"a\": 0,\n \"k\": [\n 500,\n 396.73,\n 0\n ],\n \"ix\": 2,\n \"l\": 2\n },\n \"a\": {\n \"a\": 0,\n \"k\": [\n 0,\n 0,\n 0\n ],\n \"ix\": 1,\n \"l\": 2\n },\n \"s\": {\n \"a\": 1,\n \"k\": [\n {\n \"i\": {\n \"x\": [\n 0.833,\n 0.833,\n 0.833\n ],\n \"y\": [\n 0.833,\n 0.833,\n 0.833\n ]\n },\n \"o\": {\n \"x\": [\n 0.167,\n 0.167,\n 0.167\n ],\n \"y\": [\n 0.167,\n 0.167,\n 0.167\n ]\n },\n \"t\": 0,\n \"s\": [\n 0,\n 0,\n 100\n ]\n },\n {\n \"t\": 3,\n \"s\": [\n 111.765,\n 111.765,\n 100\n ]\n }\n ],\n \"ix\": 6,\n \"l\": 2\n }\n },\n \"ao\": 0,\n \"shapes\": [\n {\n \"ty\": \"sr\",\n \"sy\": 1,\n \"d\": 1,\n \"pt\": {\n \"a\": 0,\n \"k\": 5,\n \"ix\": 3\n },\n \"p\": {\n \"a\": 0,\n \"k\": [\n 0,\n 0\n ],\n \"ix\": 4\n },\n \"r\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 5\n },\n \"ir\": {\n \"a\": 1,\n \"k\": [\n {\n \"i\": {\n \"x\": [\n 0.833\n ],\n \"y\": [\n 0.833\n ]\n },\n \"o\": {\n \"x\": [\n 0.167\n ],\n \"y\": [\n 0.167\n ]\n },\n \"t\": 3,\n \"s\": [\n 37\n ]\n },\n {\n \"t\": 6,\n \"s\": [\n 100\n ]\n }\n ],\n \"ix\": 6\n },\n \"is\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 8\n },\n \"or\": {\n \"a\": 0,\n \"k\": 212,\n \"ix\": 7\n },\n \"os\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 9\n },\n \"ix\": 1,\n \"nm\": \"Polystar Path 1\",\n \"mn\": \"ADBE Vector Shape - Star\",\n \"hd\": false\n },\n {\n \"ty\": \"fl\",\n \"c\": {\n \"a\": 0,\n \"k\": [\n 1,\n 0.082352941176,\n 0.622145469516,\n 1\n ],\n \"ix\": 4\n },\n \"o\": {\n \"a\": 0,\n \"k\": 100,\n \"ix\": 5\n },\n \"r\": 1,\n \"bm\": 0,\n \"nm\": \"Fill 1\",\n \"mn\": \"ADBE Vector Graphic - Fill\",\n \"hd\": false\n }\n ],\n \"ip\": 0,\n \"op\": 43,\n \"st\": 0,\n \"bm\": 0\n },\n {\n \"ddd\": 0,\n \"ind\": 2,\n \"ty\": 4,\n \"nm\": \"Reflection\",\n \"tt\": 1,\n \"sr\": 1,\n \"ks\": {\n \"o\": {\n \"a\": 0,\n \"k\": 70,\n \"ix\": 11\n },\n \"r\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 10\n },\n \"p\": {\n \"a\": 1,\n \"k\": [\n {\n \"i\": {\n \"x\": 0.68,\n \"y\": 1\n },\n \"o\": {\n \"x\": 0.24,\n \"y\": 0\n },\n \"t\": -3,\n \"s\": [\n 500,\n 400,\n 0\n ],\n \"to\": [\n 271.667,\n 0,\n 0\n ],\n \"ti\": [\n -271.667,\n 0,\n 0\n ]\n },\n {\n \"t\": 38,\n \"s\": [\n 2130,\n 400,\n 0\n ]\n }\n ],\n \"ix\": 2,\n \"l\": 2\n },\n \"a\": {\n \"a\": 0,\n \"k\": [\n 0,\n 0,\n 0\n ],\n \"ix\": 1,\n \"l\": 2\n },\n \"s\": {\n \"a\": 0,\n \"k\": [\n 100,\n 100,\n 100\n ],\n \"ix\": 6,\n \"l\": 2\n }\n },\n \"ao\": 0,\n \"shapes\": [\n {\n \"ty\": \"gr\",\n \"it\": [\n {\n \"ind\": 0,\n \"ty\": \"sh\",\n \"ix\": 1,\n \"ks\": {\n \"a\": 0,\n \"k\": {\n \"i\": [\n [\n 0,\n 0\n ],\n [\n 0,\n 0\n ]\n ],\n \"o\": [\n [\n 0,\n 0\n ],\n [\n 0,\n 0\n ]\n ],\n \"v\": [\n [\n -318,\n -506\n ],\n [\n -1366,\n 542\n ]\n ],\n \"c\": false\n },\n \"ix\": 2\n },\n \"nm\": \"Path 1\",\n \"mn\": \"ADBE Vector Shape - Group\",\n \"hd\": false\n },\n {\n \"ty\": \"st\",\n \"c\": {\n \"a\": 0,\n \"k\": [\n 0.960784313725,\n 0.864126227884,\n 0.632987347771,\n 1\n ],\n \"ix\": 3\n },\n \"o\": {\n \"a\": 0,\n \"k\": 100,\n \"ix\": 4\n },\n \"w\": {\n \"a\": 0,\n \"k\": 161,\n \"ix\": 5\n },\n \"lc\": 1,\n \"lj\": 1,\n \"ml\": 4,\n \"bm\": 0,\n \"nm\": \"Stroke 1\",\n \"mn\": \"ADBE Vector Graphic - Stroke\",\n \"hd\": false\n },\n {\n \"ty\": \"fl\",\n \"c\": {\n \"a\": 0,\n \"k\": [\n 1,\n 0.082352941176,\n 0.946020687328,\n 1\n ],\n \"ix\": 4\n },\n \"o\": {\n \"a\": 0,\n \"k\": 100,\n \"ix\": 5\n },\n \"r\": 1,\n \"bm\": 0,\n \"nm\": \"Fill 1\",\n \"mn\": \"ADBE Vector Graphic - Fill\",\n \"hd\": false\n },\n {\n \"ty\": \"tr\",\n \"p\": {\n \"a\": 0,\n \"k\": [\n 0,\n 0\n ],\n \"ix\": 2\n },\n \"a\": {\n \"a\": 0,\n \"k\": [\n 0,\n 0\n ],\n \"ix\": 1\n },\n \"s\": {\n \"a\": 0,\n \"k\": [\n 100,\n 100\n ],\n \"ix\": 3\n },\n \"r\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 6\n },\n \"o\": {\n \"a\": 0,\n \"k\": 100,\n \"ix\": 7\n },\n \"sk\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 4\n },\n \"sa\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 5\n },\n \"nm\": \"Transform\"\n }\n ],\n \"nm\": \"Shape 1\",\n \"np\": 3,\n \"cix\": 2,\n \"bm\": 0,\n \"ix\": 1,\n \"mn\": \"ADBE Vector Group\",\n \"hd\": false\n }\n ],\n \"ip\": 0,\n \"op\": 43,\n \"st\": -4,\n \"bm\": 0\n },\n {\n \"ddd\": 0,\n \"ind\": 3,\n \"ty\": 4,\n \"nm\": \"Shape 01\",\n \"sr\": 1,\n \"ks\": {\n \"o\": {\n \"a\": 0,\n \"k\": 100,\n \"ix\": 11\n },\n \"r\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 10\n },\n \"p\": {\n \"a\": 0,\n \"k\": [\n 500,\n 396.73,\n 0\n ],\n \"ix\": 2,\n \"l\": 2\n },\n \"a\": {\n \"a\": 0,\n \"k\": [\n 0,\n 0,\n 0\n ],\n \"ix\": 1,\n \"l\": 2\n },\n \"s\": {\n \"a\": 1,\n \"k\": [\n {\n \"i\": {\n \"x\": [\n 0.667,\n 0.667,\n 0.667\n ],\n \"y\": [\n 1,\n 1,\n 1\n ]\n },\n \"o\": {\n \"x\": [\n 0.333,\n 0.333,\n 0.333\n ],\n \"y\": [\n 0,\n 0,\n 0\n ]\n },\n \"t\": 0,\n \"s\": [\n 0,\n 0,\n 100\n ]\n },\n {\n \"i\": {\n \"x\": [\n 0.667,\n 0.667,\n 0.667\n ],\n \"y\": [\n 1,\n 1,\n 1\n ]\n },\n \"o\": {\n \"x\": [\n 0.333,\n 0.333,\n 0.333\n ],\n \"y\": [\n 0,\n 0,\n 0\n ]\n },\n \"t\": 3,\n \"s\": [\n 111.765,\n 111.765,\n 100\n ]\n },\n {\n \"i\": {\n \"x\": [\n 0.667,\n 0.667,\n 0.667\n ],\n \"y\": [\n 1,\n 1,\n 1\n ]\n },\n \"o\": {\n \"x\": [\n 0.333,\n 0.333,\n 0.333\n ],\n \"y\": [\n 0,\n 0,\n 0\n ]\n },\n \"t\": 6,\n \"s\": [\n 111.765,\n 111.765,\n 100\n ]\n },\n {\n \"i\": {\n \"x\": [\n 0.667,\n 0.667,\n 0.667\n ],\n \"y\": [\n 1,\n 1,\n 1\n ]\n },\n \"o\": {\n \"x\": [\n 0.333,\n 0.333,\n 0.333\n ],\n \"y\": [\n 0,\n 0,\n 0\n ]\n },\n \"t\": 9,\n \"s\": [\n 116,\n 116,\n 100\n ]\n },\n {\n \"t\": 12,\n \"s\": [\n 111.765,\n 111.765,\n 100\n ]\n }\n ],\n \"ix\": 6,\n \"l\": 2\n }\n },\n \"ao\": 0,\n \"shapes\": [\n {\n \"ty\": \"sr\",\n \"sy\": 1,\n \"d\": 1,\n \"pt\": {\n \"a\": 0,\n \"k\": 5,\n \"ix\": 3\n },\n \"p\": {\n \"a\": 0,\n \"k\": [\n 0,\n 0\n ],\n \"ix\": 4\n },\n \"r\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 5\n },\n \"ir\": {\n \"a\": 1,\n \"k\": [\n {\n \"i\": {\n \"x\": [\n 0.833\n ],\n \"y\": [\n 0.833\n ]\n },\n \"o\": {\n \"x\": [\n 0.167\n ],\n \"y\": [\n 0.167\n ]\n },\n \"t\": 3,\n \"s\": [\n 37\n ]\n },\n {\n \"t\": 6,\n \"s\": [\n 100\n ]\n }\n ],\n \"ix\": 6\n },\n \"is\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 8\n },\n \"or\": {\n \"a\": 0,\n \"k\": 212,\n \"ix\": 7\n },\n \"os\": {\n \"a\": 0,\n \"k\": 0,\n \"ix\": 9\n },\n \"ix\": 1,\n \"nm\": \"Polystar Path 1\",\n \"mn\": \"ADBE Vector Shape - Star\",\n \"hd\": false\n },\n {\n \"ty\": \"fl\",\n \"c\": {\n \"a\": 0,\n \"k\": [\n 1,\n 0.729411764706,\n 0.082352941176,\n 1\n ],\n \"ix\": 4\n },\n \"o\": {\n \"a\": 0,\n \"k\": 100,\n \"ix\": 5\n },\n \"r\": 1,\n \"bm\": 0,\n \"nm\": \"Fill 1\",\n \"mn\": \"ADBE Vector Graphic - Fill\",\n \"hd\": false\n }\n ],\n \"ip\": 0,\n \"op\": 43,\n \"st\": 0,\n \"bm\": 0\n }\n ],\n \"markers\": []\n}", + "iconScoutAsset": { + "uuid": "", + "value": "", + "preview": "" + }, + "speed": "1", + "width": "100", + "height": "100", + "animationStart": "auto", + "loop": "single", + "keepLastFrame": true, + "autoHeight": "auto", + "aspectRatio": "1/1", + "fit": "contain", + "align": "0.5,0.5", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "jsonLottie1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/jsonSchemaForm.json b/e2e/fixtures/dsl/jsonSchemaForm.json new file mode 100644 index 0000000000..40d7eaab4c --- /dev/null +++ b/e2e/fixtures/dsl/jsonSchemaForm.json @@ -0,0 +1,122 @@ +{ + "ui": { + "layout": { + "fed9b1fe": { + "i": "fed9b1fe", + "h": 50, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "fed9b1fe": { + "compType": "jsonSchemaForm", + "comp": { + "formType": "rjsf", + "schema": "{\n \"title\": \"User Information\",\n \"description\": \"Form Example\",\n \"type\": \"object\",\n \"required\": [\n \"name\",\n \"phone\"\n ],\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"title\": \"Name\"\n },\n \"phone\": {\n \"type\": \"string\",\n \"title\": \"Phone\",\n \"minLength\": 11\n },\n \"birthday\": {\n \"type\": \"string\",\n \"title\": \"Birthday\"\n }\n }\n}", + "showVerticalScrollbar": false, + "uiSchema": "{\n \"name\": {\n \"ui:autofocus\": true,\n \"ui:emptyValue\": \"\"\n },\n \"phone\": {\n \"ui:help\": \"at least 11 characters\"\n },\n \"birthday\": {\n \"ui:widget\": \"date\"\n }\n}", + "autoHeight": "auto", + "data": "{\n \"name\": \"David\",\n \"phone\": \"13488886666\",\n \"birthday\": \"1980-03-16\"\n}", + "errorSchema": "{\n \"__errors\": [\n \"Custom error message for the entire form\"\n ],\n \"fieldName\": {\n \"__errors\": [\n \"Custom error for specific field\"\n ]\n }\n}", + "validationState": "{}", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "jsonSchemaForm1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/kanban.json b/e2e/fixtures/dsl/kanban.json new file mode 100644 index 0000000000..4fda4d0e99 --- /dev/null +++ b/e2e/fixtures/dsl/kanban.json @@ -0,0 +1,167 @@ +{ + "ui": { + "layout": { + "e725964": { + "i": "e725964", + "h": 60, + "w": 13, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "e725964": { + "compType": "kanban", + "comp": { + "autoHeight": "auto", + "tagStyles": { + "textSize": "12px" + }, + "data": { + "optionType": "manual", + "manual": { + "manual": [ + { + "label": "Task - 29001", + "status": "Open", + "summary": "Analyze customer requirements.", + "priority": "High", + "tags": "Bug, Release Bug", + "assignee": "Nancy Davloio", + "rankId": "1", + "id": "0" + }, + { + "label": "Task - 29002", + "status": "InProgress", + "summary": "Add responsive support to applicaton", + "priority": "Low", + "tags": "Story, Kanban", + "assignee": "Nancy Davloio", + "rankId": "1", + "id": "1" + } + ] + }, + "mapData": { + "data": "[]", + "mapData": { + "status": "Open" + } + } + }, + "scrollbars": false, + "minCardWidth": "", + "cardContentStyles": { + "padding": "10px" + }, + "statusOptions": "[\n {\n \"label\": \"To Do\",\n \"value\": \"Open\"\n },\n {\n \"label\": \"In Progress\",\n \"value\": \"InProgress\"\n },\n {\n \"label\": \"In Review\",\n \"value\": \"Review\"\n },\n {\n \"label\": \"Done\",\n \"value\": \"Close\"\n }\n]", + "assigneeOptions": "[\n {\n \"id\": \"1\",\n \"name\": \"Nancy Davloio\"\n },\n {\n \"id\": \"2\",\n \"name\": \"Andrew Fuller\"\n }\n]", + "cardViewOption": "default", + "cardView": { + "cardView": { + "container": { + "layout": {} + } + } + }, + "separateAssigneeSections": false, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "kanban1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/lineChart.json b/e2e/fixtures/dsl/lineChart.json new file mode 100644 index 0000000000..0cd2b7d63b --- /dev/null +++ b/e2e/fixtures/dsl/lineChart.json @@ -0,0 +1,182 @@ +{ + "ui": { + "layout": { + "de193661": { + "i": "de193661", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "de193661": { + "compType": "lineChart", + "comp": { + "mode": "ui", + "title": "Line Chart", + "data": "[\n {\n \"date\": \"Jan\",\n \"sales\": 320,\n \"growth\": 250\n },\n {\n \"date\": \"Feb\",\n \"sales\": 450,\n \"growth\": 300\n },\n {\n \"date\": \"Mar\",\n \"sales\": 380,\n \"growth\": 340\n },\n {\n \"date\": \"Apr\",\n \"sales\": 520,\n \"growth\": 400\n },\n {\n \"date\": \"May\",\n \"sales\": 480,\n \"growth\": 450\n },\n {\n \"date\": \"Jun\",\n \"sales\": 600,\n \"growth\": 500\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "xAxisData": "[]", + "series": [ + { + "columnName": "sales", + "seriesName": "Sales", + "dataIndex": "5da52851", + "step": "" + }, + { + "columnName": "growth", + "seriesName": "Growth", + "dataIndex": "5500e757", + "step": "" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "line", + "comp": { + "symbol": "emptyCircle", + "symbolSize": "4", + "polarRadiusStart": "30", + "polarRadiusEnd": "80%", + "polarStartAngle": "90", + "polarEndAngle": "-180", + "polarIsTangent": false, + "labelData": "[]", + "borderType": "solid" + } + }, + "animationDuration": "1000", + "echartsOption": "{\n \"data\": [\n {\n \"value\": 100,\n \"name\": \"Show\",\n \"color\": \"#fc8452\"\n },\n {\n \"value\": 80,\n \"name\": \"Click\",\n \"color\": \"#9a60b4\"\n },\n {\n \"value\": 60,\n \"name\": \"Visit\",\n \"color\": \"#fac858\"\n },\n {\n \"value\": 40,\n \"name\": \"Query\",\n \"color\": \"#ee6666\"\n },\n {\n \"value\": 20,\n \"name\": \"Buy\",\n \"color\": \"#3ba272\"\n }\n ]\n}", + "echartsTitle": "Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsConfig": { + "compType": "funnel", + "comp": {} + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "left": "10", + "right": "10", + "top": "20", + "bottom": "20", + "tooltip": true, + "legendVisibility": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "lineChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/link.json b/e2e/fixtures/dsl/link.json new file mode 100644 index 0000000000..12cb52f1b3 --- /dev/null +++ b/e2e/fixtures/dsl/link.json @@ -0,0 +1,115 @@ +{ + "ui": { + "layout": { + "3a072475": { + "i": "3a072475", + "h": 5, + "w": 6, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "3a072475": { + "compType": "link", + "comp": { + "text": "Link", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "link1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/listView.json b/e2e/fixtures/dsl/listView.json new file mode 100644 index 0000000000..8e62f89d78 --- /dev/null +++ b/e2e/fixtures/dsl/listView.json @@ -0,0 +1,241 @@ +{ + "ui": { + "layout": { + "e67ab5c4": { + "i": "e67ab5c4", + "h": 40, + "w": 9, + "delayCollision": true, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "e67ab5c4": { + "compType": "listView", + "comp": { + "noOfRows": "[\n {\n \"rate\": \"9.2\",\n \"title\": \"The Shawshank Redemption\",\n \"url\": \"https://www.imdb.com/title/tt0111161/\",\n \"cover\": \"https://m.media-amazon.com/images/M/MV5BMDFkYTc0MGEtZmNhMC00ZDIzLWFmNTEtODM1ZmRlYWMwMWFmXkEyXkFqcGdeQXVyMTMxODk2OTU@._V1_UY67_CR0,0,45,67_AL_.jpg\"\n },\n {\n \"rate\": \"9.2\",\n \"title\": \"The Godfather\",\n \"url\": \"https://www.imdb.com/title/tt0068646/\",\n \"cover\": \"https://m.media-amazon.com/images/M/MV5BM2MyNjYxNmUtYTAwNi00MTYxLWJmNWYtYzZlODY3ZTk3OTFlXkEyXkFqcGdeQXVyNzkwMjQ5NzM@._V1_UY67_CR1,0,45,67_AL_.jpg\"\n },\n {\n \"rate\": \"9.0\",\n \"title\": \"The Dark Knight\",\n \"url\": \"https://www.imdb.com/title/tt0468569/\",\n \"cover\": \"https://m.media-amazon.com/images/M/MV5BMTMxNTMwODM0NF5BMl5BanBnXkFtZTcwODAyMTk2Mw@@._V1_UY67_CR0,0,45,67_AL_.jpg\"\n }\n]", + "noOfColumns": "1", + "itemIndexName": "i", + "itemDataName": "currentItem", + "dynamicHeight": "auto", + "heightUnitOfRow": "1", + "container": { + "layout": { + "8479dfe0": { + "i": "8479dfe0", + "w": 6, + "h": 14, + "x": 0, + "y": 0 + }, + "c491e014": { + "i": "c491e014", + "h": 5, + "w": 17, + "x": 7, + "y": 0 + }, + "51b07abf": { + "i": "51b07abf", + "h": 5, + "w": 17, + "x": 7, + "y": 9 + } + }, + "items": { + "8479dfe0": { + "compType": "image", + "comp": { + "sourceMode": "standard", + "src": "{{currentItem.cover}}", + "iconScoutAsset": { + "uuid": "", + "value": "", + "preview": "" + }, + "clipPath": "none", + "autoHeight": "fixed", + "restrictPaddingOnRotation": "image", + "enableOverflow": false, + "aspectRatio": "16 / 9", + "placement": "top", + "overflow": "hidden", + "positionX": "center", + "positionY": "center", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "image1" + }, + "c491e014": { + "compType": "link", + "comp": { + "text": "{{i+1}}. {{currentItem.title}}", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "goToURL", + "comp": { + "url": "{{currentItem.url}}", + "query": [ + {} + ], + "hash": [ + {} + ], + "inNewTab": true + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ], + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "link1" + }, + "51b07abf": { + "compType": "rating", + "comp": { + "defaultValue": "{{currentItem.rate / 2}}", + "value": "", + "max": "5", + "label": { + "text": "", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "right" + }, + "allowHalf": true, + "disabled": "true", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "rating1" + } + } + }, + "autoHeight": "auto", + "showVerticalScrollbar": false, + "showHorizontalScrollbar": false, + "horizontalGridCells": 24, + "scrollbars": false, + "pagination": { + "changeablePageSize": null, + "pageSize": "6", + "pageSizeOptions": "[5, 10, 20, 50]" + }, + "horizontal": false, + "minHorizontalWidth": "100px", + "enableSorting": false, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "listView1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/meeting.json b/e2e/fixtures/dsl/meeting.json new file mode 100644 index 0000000000..a1e102b917 --- /dev/null +++ b/e2e/fixtures/dsl/meeting.json @@ -0,0 +1,123 @@ +{ + "ui": { + "layout": {} + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + }, + { + "compType": "meeting", + "comp": { + "visible": "false", + "autoHeight": "auto", + "placement": "right", + "maskClosable": true, + "showMask": true, + "meetingActive": "false", + "audioControl": "false", + "videoControl": "true", + "endCall": "false", + "sharing": "false", + "appId": "Agora Application ID", + "localUser": "", + "localUserID": "d7fac767-6309-4875-9fac-1868d33f3c2c", + "localUserName": "", + "meetingName": "53cc9ecf-dff1-44cd-b3bb-1c9ff89b2407", + "rtmToken": "Agora RTM Token", + "rtcToken": "Agora RTC Token", + "container": { + "layout": {} + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "meeting1" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/mention.json b/e2e/fixtures/dsl/mention.json new file mode 100644 index 0000000000..8c1c42880d --- /dev/null +++ b/e2e/fixtures/dsl/mention.json @@ -0,0 +1,127 @@ +{ + "ui": { + "layout": { + "104f6603": { + "i": "104f6603", + "h": 5, + "w": 5, + "x": 1, + "y": 3, + "pos": 0 + } + }, + "items": { + "104f6603": { + "compType": "mention", + "comp": { + "defaultValue": "", + "value": "", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "validationType": "Text", + "autoHeight": "auto", + "mentionList": "{\n \"@\": [\n \"John Doe\",\n \"Jane Doe\",\n \"Michael Smith\",\n \"Emily Davis\",\n \"Robert Johnson\",\n \"Patricia Brown\",\n \"William Jones\",\n \"Jennifer Miller\",\n \"David Wilson\",\n \"Linda Moore\"\n ],\n \"#\": [\n \"#lowcode\",\n \"#automation\",\n \"#appbuilder\",\n \"#nocode\",\n \"#workflow\",\n \"#draganddrop\",\n \"#rapiddevelopment\",\n \"#digitaltransformation\",\n \"#integration\",\n \"#api\"\n ]\n}", + "invalid": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "mention1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/mermaid.json b/e2e/fixtures/dsl/mermaid.json new file mode 100644 index 0000000000..cb60612d7e --- /dev/null +++ b/e2e/fixtures/dsl/mermaid.json @@ -0,0 +1,115 @@ +{ + "ui": { + "layout": { + "9ca9601e": { + "i": "9ca9601e", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "9ca9601e": { + "compType": "mermaid", + "comp": { + "code": "flowchart TD\n A[Start] --> B{Is it working?}\n B -->|Yes| C[Great!]\n B -->|No| D[Debug]\n D --> E[Check Documentation]\n E --> B\n C --> F[Deploy]", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "mermaid1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/modal.json b/e2e/fixtures/dsl/modal.json new file mode 100644 index 0000000000..3baa8b1d1b --- /dev/null +++ b/e2e/fixtures/dsl/modal.json @@ -0,0 +1,115 @@ +{ + "ui": { + "layout": {} + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + }, + { + "compType": "modal", + "comp": { + "visible": "", + "horizontalGridCells": 24, + "autoHeight": "auto", + "titleAlign": "left", + "modalScrollbar": false, + "maskClosable": true, + "showMask": true, + "toggleClose": true, + "zIndex": "950", + "container": { + "layout": {} + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "modal1" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/multiSelect.json b/e2e/fixtures/dsl/multiSelect.json new file mode 100644 index 0000000000..b1a2628c93 --- /dev/null +++ b/e2e/fixtures/dsl/multiSelect.json @@ -0,0 +1,154 @@ +{ + "ui": { + "layout": { + "bb7beda3": { + "i": "bb7beda3", + "h": 5, + "w": 6, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "bb7beda3": { + "compType": "multiSelect", + "comp": { + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "options": { + "optionType": "manual", + "manual": { + "manual": [ + { + "value": "1", + "label": "Option 1" + }, + { + "value": "2", + "label": "Option 2" + } + ] + }, + "mapData": { + "data": "[]" + } + }, + "showSearch": true, + "margin": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "padding": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "defaultValue": "[\"1\",\"2\"]", + "value": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "multiSelect1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/multiTags.json b/e2e/fixtures/dsl/multiTags.json new file mode 100644 index 0000000000..3418ab7583 --- /dev/null +++ b/e2e/fixtures/dsl/multiTags.json @@ -0,0 +1,165 @@ +{ + "ui": { + "layout": { + "e18a3dbf": { + "i": "e18a3dbf", + "h": 5, + "w": 8, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "e18a3dbf": { + "compType": "multiTags", + "comp": { + "options": { + "optionType": "manual", + "manual": { + "manual": [ + { + "label": "Option 1", + "colorType": "default", + "presetColor": "default", + "color": "#1890ff", + "textColor": "#ffffff", + "border": "", + "borderWidth": "", + "borderStyle": "solid", + "radius": "", + "margin": "", + "padding": "", + "width": "" + }, + { + "label": "Option 2", + "colorType": "default", + "presetColor": "default", + "color": "#1890ff", + "textColor": "#ffffff", + "border": "", + "borderWidth": "", + "borderStyle": "solid", + "radius": "", + "margin": "", + "padding": "", + "width": "" + } + ] + }, + "mapData": { + "data": "[]", + "mapData": { + "colorType": "default", + "presetColor": "default", + "color": "#1890ff", + "textColor": "#ffffff", + "border": "", + "borderWidth": "", + "borderStyle": "solid", + "radius": "", + "margin": "", + "padding": "", + "width": "" + } + } + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "multiTags1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/n8n/n8nDatasource.json b/e2e/fixtures/dsl/n8n/n8nDatasource.json new file mode 100644 index 0000000000..60ea0fdd71 --- /dev/null +++ b/e2e/fixtures/dsl/n8n/n8nDatasource.json @@ -0,0 +1,11 @@ +{ + "name": "n8n", + "type": "n8n", + "datasourceConfig": { + "serverURL": "http://placeholder.invalid", + "apiKey": "placeholder", + "specVersion": "v1.1.1", + "authConfigType": "NO_AUTH", + "sslCertVerificationType": "VERIFY_CA_CERT" + } +} diff --git a/e2e/fixtures/dsl/n8n/n8nQuery.json b/e2e/fixtures/dsl/n8n/n8nQuery.json new file mode 100644 index 0000000000..5361854275 --- /dev/null +++ b/e2e/fixtures/dsl/n8n/n8nQuery.json @@ -0,0 +1,21 @@ +{ + "compType": "n8n", + "comp": { + "actionName": "get_workflows", + "action": { + "query_@_active": "true", + "query_@_tags": "test,production", + "query_@_name": "", + "query_@_projectId": "", + "query_@_excludePinnedData": "true", + "query_@_limit": "100", + "query_@_cursor": "" + }, + "headers": [ + { + "key": "", + "value": "" + } + ] + } +} diff --git a/e2e/fixtures/dsl/navigation.json b/e2e/fixtures/dsl/navigation.json new file mode 100644 index 0000000000..a1d7dcba5e --- /dev/null +++ b/e2e/fixtures/dsl/navigation.json @@ -0,0 +1,279 @@ +{ + "ui": { + "layout": { + "da80f702": { + "i": "da80f702", + "h": 5, + "w": 15, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "da80f702": { + "compType": "navigation", + "comp": { + "logoEvent": [ + { + "name": "click", + "handler": { + "compType": "empty", + "comp": {}, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ], + "orientation": "horizontal", + "displayMode": "bar", + "hamburgerPosition": "right", + "hamburgerSize": "56px", + "placement": "right", + "hamburgerIcon": "", + "drawerCloseIcon": "", + "shadowOverlay": "true", + "horizontalAlignment": "left", + "items": { + "optionType": "manual", + "manual": [ + { + "label": "Menu Item 1", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "openAppPage", + "comp": { + "query": [ + {} + ], + "hash": [ + {} + ] + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ], + "items": [ + { + "label": "Sub Menu 1", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "openAppPage", + "comp": { + "query": [ + {} + ], + "hash": [ + {} + ] + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ], + "items": [ + { + "label": "Sub Menu 1-1", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "openAppPage", + "comp": { + "query": [ + {} + ], + "hash": [ + {} + ] + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ] + }, + { + "label": "Sub Menu 1-2", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "openAppPage", + "comp": { + "query": [ + {} + ], + "hash": [ + {} + ] + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ] + } + ] + }, + { + "label": "Sub Menu 2", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "openAppPage", + "comp": { + "query": [ + {} + ], + "hash": [ + {} + ] + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ] + }, + { + "label": "Sub Menu 3", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "openAppPage", + "comp": { + "query": [ + {} + ], + "hash": [ + {} + ] + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ] + } + ] + } + ], + "mapData": { + "data": "[]" + } + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "navigation1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/numberInput.json b/e2e/fixtures/dsl/numberInput.json new file mode 100644 index 0000000000..d109569011 --- /dev/null +++ b/e2e/fixtures/dsl/numberInput.json @@ -0,0 +1,127 @@ +{ + "ui": { + "layout": { + "157a170b": { + "i": "157a170b", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "157a170b": { + "compType": "numberInput", + "comp": { + "defaultValue": "", + "value": "", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "formatter": "standard", + "step": "1", + "controls": true, + "thousandsSeparator": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "numberInput1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/openLayersGeoMap.json b/e2e/fixtures/dsl/openLayersGeoMap.json new file mode 100644 index 0000000000..ca19d81e88 --- /dev/null +++ b/e2e/fixtures/dsl/openLayersGeoMap.json @@ -0,0 +1,430 @@ +{ + "ui": { + "layout": { + "97b2da16": { + "i": "97b2da16", + "h": 50, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "97b2da16": { + "compType": "openLayersGeoMap", + "comp": { + "autoHeight": "fixed", + "layers": { + "data": { + "manual": [ + { + "label": "ArcGIS Feature Servies", + "title": "ArcGIS Feature Servies", + "type": "arcgis-feature-service", + "source": { + "url": "https://services-eu1.arcgis.com/NPIbx47lsIiu2pqz/ArcGIS/rest/services/Neptune_Coastline_Campaign_Open_Data_Land_Use_2014/FeatureServer/0", + "attributions": "", + "serverType": "geoserver", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "tile" + }, + "visible": true, + "selectable": true, + "userVisible": true, + "minZoom": "8", + "maxZoom": "22", + "opacity": "1" + }, + { + "label": "ArcGIS - Vector Tile PBF", + "title": "ArcGIS - Vector Tile PBF", + "type": "arcgis-vector-tiles", + "source": { + "url": "https://rijnland.enl-mcs.nl/arcgis/rest/services/Polder/MapServer/0", + "attributions": "", + "serverType": "geoserver", + "projection": "EPSG:28992", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "tile" + }, + "visible": true, + "selectable": true, + "userVisible": true, + "minZoom": "8", + "maxZoom": "22", + "opacity": "1" + }, + { + "label": "PMTiles - Raster", + "title": "PMTiles - Raster", + "type": "pmtiles", + "source": { + "url": "https://r2-public.protomaps.com/protomaps-sample-datasets/terrarium_z9.pmtiles", + "attributions": "", + "serverType": "geoserver", + "tileSize": "[512,512]", + "nodata": "0", + "ratio": "1", + "pmtilesType": "raster", + "mapServerType": "tile" + }, + "visible": false, + "selectable": false, + "userVisible": true, + "minZoom": "0", + "maxZoom": "30", + "opacity": "1" + }, + { + "label": "PMTiles - Vector", + "title": "PMTiles - Vector", + "type": "pmtiles", + "source": { + "url": "https://link.storjshare.io/raw/jxqj5ixgrdniigc7f23mogdzeirq/truemaps-public%2Fpublic-datasets%2Foverturemaps%2F2024-01-17-alpha.0%2Ftheme%3Dbuildings%2Fegypt_buildings_vt.pmtiles", + "attributions": "", + "serverType": "geoserver", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "tile" + }, + "visible": false, + "selectable": false, + "userVisible": true, + "minZoom": "0", + "maxZoom": "30", + "opacity": "1" + }, + { + "label": "GeoJson", + "title": "GeoJson with Style and Image src", + "type": "geojson", + "source": { + "attributions": "", + "serverType": "geoserver", + "data": "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"img_src\":\"https://picsum.photos/id/0/400/300\",\"title_en\":\"This is Point 3 Title\"},\"geometry\":{\"coordinates\":[31.648544983141022,30.168372482757235],\"type\":\"Point\"},\"id\":0},{\"type\":\"Feature\",\"properties\":{\"marker-color\":\"#25d439\",\"marker-size\":\"medium\",\"marker-symbol\":\"circle\",\"img_src\":\"https://picsum.photos/id/1/400/300\",\"title_en\":\"This is Point 4 Title\"},\"geometry\":{\"coordinates\":[31.609205437222727,30.15667607035462],\"type\":\"Point\"},\"id\":1},{\"type\":\"Feature\",\"properties\":{\"img_src\":\"https://picsum.photos/id/2/400/300\",\"title_en\":\"This is Point 1 Title\"},\"geometry\":{\"coordinates\":[31.616315587975095,30.12764586201415],\"type\":\"Point\"},\"id\":2},{\"type\":\"Feature\",\"properties\":{\"marker-color\":\"#22f40f\",\"marker-size\":\"medium\",\"marker-symbol\":\"circle\",\"img_src\":\"https://picsum.photos/id/3/400/300\",\"title_en\":\"This is Point 2 Title\"},\"geometry\":{\"coordinates\":[31.647216271721106,30.128195901651907],\"type\":\"Point\"},\"id\":3},{\"type\":\"Feature\",\"properties\":{\"stroke\":\"#8ec0bf\",\"stroke-width\":2,\"stroke-opacity\":1,\"fill\":\"#54e7ab\",\"fill-opacity\":0.5,\"img_src\":\"https://picsum.photos/id/4/400/300\",\"title_en\":\"This is Polygon 1 Title\"},\"geometry\":{\"coordinates\":[[[31.663062927451392,30.106857074945523],[31.65276727632417,30.106857074945523],[31.65276727632417,30.09777181176149],[31.663062927451392,30.09777181176149],[31.663062927451392,30.106857074945523]]],\"type\":\"Polygon\"},\"id\":4},{\"type\":\"Feature\",\"properties\":{\"stroke\":\"#555555\",\"stroke-width\":2,\"stroke-opacity\":1,\"fill\":\"#ff91f6\",\"fill-opacity\":1,\"img_src\":\"https://picsum.photos/id/5/400/300\",\"title_en\":\"This is Polygon 2 Title\"},\"geometry\":{\"coordinates\":[[[31.636689184721234,30.09388132659143],[31.62511722772365,30.09388132659143],[31.62511722772365,30.08220833646739],[31.636689184721234,30.08220833646739],[31.636689184721234,30.09388132659143]]],\"type\":\"Polygon\"},\"id\":5},{\"type\":\"Feature\",\"properties\":{\"img_src\":\"https://picsum.photos/id/6/400/300\",\"stroke\":\"#5b69ff\",\"stroke-width\":3.3,\"stroke-opacity\":1,\"title_en\":\"This is Line Title\"},\"geometry\":{\"coordinates\":[[31.636477907863707,30.101294459203615],[31.65277860477454,30.1083398631053],[31.655995224561934,30.116316091824615],[31.648069978547227,30.117802108513885]],\"type\":\"LineString\"},\"id\":6}]}", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "tile" + }, + "visible": true, + "selectable": true, + "userVisible": true, + "minZoom": "0", + "maxZoom": "22", + "opacity": "1" + }, + { + "label": "Egypt DSM - COG", + "type": "cog", + "source": { + "url": "https://link.storjshare.io/raw/juj37qat4melrpmooioq65fzgo7q/truemaps-public/aw3d30/output_cog.tif", + "attributions": "", + "serverType": "geoserver", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "tile" + }, + "visible": true, + "selectable": true, + "userVisible": true, + "minZoom": "0", + "maxZoom": "22", + "opacity": "0.3" + }, + { + "label": "Contours - WFS", + "type": "wfs", + "source": { + "url": "https://services.seismofaults.eu/geoserver/EDSF/wfs?service=WFS&version=1.1.0&request=GetFeature&typeName=EDSF%3Asubduction_contours&outputFormat=JSON&srsName=urn%3Ax-ogc%3Adef%3Acrs%3AEPSG%3A4326&maxFeatures=1000", + "attributions": "", + "serverType": "geoserver", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "tile" + }, + "visible": true, + "selectable": true, + "userVisible": true, + "minZoom": "0", + "maxZoom": "22", + "opacity": "1" + }, + { + "label": "World Basemap - MVT/pbf", + "type": "mvt", + "source": { + "url": "https://wms.wheregroup.com/tileserver/tile/world-0-14/{z}/{x}/{y}.pbf", + "attributions": "", + "serverType": "geoserver", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "tile" + }, + "visible": false, + "selectable": true, + "userVisible": true, + "minZoom": "0", + "maxZoom": "22", + "opacity": "1", + "splitscreen": "left" + }, + { + "label": "USA MapServer ImageLayer - ArcGIS MapServer", + "type": "arcgis-mapserver", + "source": { + "url": "https://sampleserver6.arcgisonline.com/ArcGIS/rest/services/USA/MapServer", + "attributions": "", + "serverType": "geoserver", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "image" + }, + "visible": false, + "selectable": false, + "userVisible": true, + "minZoom": "0", + "maxZoom": "22", + "opacity": "1" + }, + { + "label": "USA MapServer TileLayer - ArcGIS MapServer", + "type": "arcgis-mapserver", + "source": { + "url": "https://sampleserver6.arcgisonline.com/ArcGIS/rest/services/USA/MapServer", + "attributions": "", + "serverType": "geoserver", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "tile" + }, + "visible": false, + "selectable": true, + "userVisible": true, + "minZoom": "0", + "maxZoom": "22", + "opacity": "1" + }, + { + "label": "NASA | BlueMarble NextGeneration - WMS", + "type": "wms", + "source": { + "url": "https://ideas-digitaltwin.jpl.nasa.gov/wms/epsg4326/best/wms.cgi", + "attributions": "", + "params": "{\"LAYERS\":\"BlueMarble_NextGeneration\",\"TILED\":true,\"VERSION\":\"1.3.0\"}", + "serverType": "geoserver", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "tile" + }, + "visible": true, + "selectable": true, + "userVisible": true, + "minZoom": "0", + "maxZoom": "8", + "opacity": "1" + }, + { + "label": "Mapbox Style GL - JSON", + "type": "stylegl", + "source": { + "url": "https://wms.wheregroup.com/tileserver/style/osm-bright.json", + "attributions": "", + "serverType": "geoserver", + "projection": "EPSG:3857", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "tile" + }, + "visible": false, + "selectable": false, + "userVisible": true, + "minZoom": "0", + "maxZoom": "22", + "opacity": "1", + "splitscreen": "right" + }, + { + "label": "Open Street Map - XYZ", + "type": "xyz", + "source": { + "url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png", + "attributions": "", + "serverType": "geoserver", + "tileSize": "256,256", + "nodata": "0", + "ratio": "1", + "pmtilesType": "vector", + "mapServerType": "tile" + }, + "visible": true, + "selectable": true, + "userVisible": true, + "minZoom": "0", + "maxZoom": "19", + "opacity": "1" + } + ] + } + }, + "zoom": "10", + "maxZoom": "30", + "rotation": "0", + "projection": "EPSG:3857", + "bbox": "[0,0,0,0]", + "events": "", + "event": "", + "feature": "", + "features": { + "menu": false, + "zoom": true, + "fullscreen": true, + "layers": true, + "center": true, + "modify": false, + "save": false, + "splitscreen": false, + "tracker": false, + "timeline": false, + "gpsCentered": true, + "north": false, + "scale": true, + "largeButtons": true, + "scaleToBottom": false, + "modify:move": true, + "modify:point": true, + "modify:line": true, + "modify:oval": true, + "modify:polygon": true, + "modify:delete": true, + "modify:redo": true, + "modify:undo": true, + "modify:clear": true, + "modify:snap": true, + "splitscreen:horizontal": true, + "splitscreen:vertical": false, + "debug": false + }, + "external": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "openLayersGeoMap1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/pageLayout.json b/e2e/fixtures/dsl/pageLayout.json new file mode 100644 index 0000000000..160a277c0c --- /dev/null +++ b/e2e/fixtures/dsl/pageLayout.json @@ -0,0 +1,319 @@ +{ + "ui": { + "layout": { + "728288d6": { + "i": "728288d6", + "h": 50, + "w": 9, + "delayCollision": true, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "728288d6": { + "compType": "pageLayout", + "comp": { + "container": { + "header": { + "layout": { + "187aed49": { + "i": "187aed49", + "h": 6, + "w": 24, + "x": 0, + "y": 0 + } + }, + "items": { + "187aed49": { + "compType": "navigation", + "comp": { + "logoEvent": [ + { + "name": "click", + "handler": { + "compType": "empty", + "comp": {}, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ], + "orientation": "horizontal", + "displayMode": "bar", + "hamburgerPosition": "right", + "hamburgerSize": "56px", + "placement": "right", + "hamburgerIcon": "", + "drawerCloseIcon": "", + "shadowOverlay": "true", + "horizontalAlignment": "left", + "items": { + "optionType": "manual", + "manual": [ + { + "label": "Home", + "hidden": "false", + "active": "false", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "openAppPage", + "comp": { + "query": [ + {} + ], + "hash": [ + {} + ] + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ] + }, + { + "label": "Services", + "hidden": "false", + "active": "false", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "openAppPage", + "comp": { + "query": [ + {} + ], + "hash": [ + {} + ] + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ], + "items": [ + { + "label": "Lowcode Platform", + "hidden": "false", + "active": "false", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "openAppPage", + "comp": { + "query": [ + {} + ], + "hash": [ + {} + ] + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ] + }, + { + "label": "App Development", + "hidden": "false", + "active": "false", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "openAppPage", + "comp": { + "query": [ + {} + ], + "hash": [ + {} + ] + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ] + } + ] + }, + { + "label": "About", + "hidden": "false", + "active": "false", + "onEvent": [ + { + "name": "click", + "handler": { + "compType": "openAppPage", + "comp": { + "query": [ + {} + ], + "hash": [ + {} + ] + }, + "condition": "", + "slowdown": "debounce", + "delay": "" + } + } + ] + } + ], + "mapData": { + "data": "[]" + } + }, + "hidden": "false", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "pageNavigation1" + } + } + }, + "sider": { + "layout": {} + }, + "body": { + "0": { + "view": { + "layout": {} + } + } + }, + "footer": { + "layout": {} + }, + "showHeader": true, + "showSider": true, + "innerSider": true, + "siderCollapsible": false, + "siderCollapsed": false, + "siderRight": false, + "siderWidth": "20%", + "siderCollapsedWidth": "0", + "horizontalGridCells": 24, + "autoHeight": "auto", + "siderScrollbars": false, + "contentScrollbars": false, + "mainScrollbars": false, + "appliedThemeId": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "pageLayout1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/password.json b/e2e/fixtures/dsl/password.json new file mode 100644 index 0000000000..df325b1f30 --- /dev/null +++ b/e2e/fixtures/dsl/password.json @@ -0,0 +1,125 @@ +{ + "ui": { + "layout": { + "ce32d6ac": { + "i": "ce32d6ac", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "ce32d6ac": { + "compType": "password", + "comp": { + "defaultValue": "", + "value": "", + "label": { + "text": "Password", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "validationType": "Regex", + "visibilityToggle": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "password1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/pieChart.json b/e2e/fixtures/dsl/pieChart.json new file mode 100644 index 0000000000..497c1e93ad --- /dev/null +++ b/e2e/fixtures/dsl/pieChart.json @@ -0,0 +1,184 @@ +{ + "ui": { + "layout": { + "33c62524": { + "i": "33c62524", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "33c62524": { + "compType": "pieChart", + "comp": { + "mode": "ui", + "title": "Chart", + "data": "[\n {\n \"category\": \"Market Share\",\n \"name\": \"Samsung\",\n \"value\": 21.8\n },\n {\n \"category\": \"Market Share\",\n \"name\": \"Apple\",\n \"value\": 20.5\n },\n {\n \"category\": \"Market Share\",\n \"name\": \"Xiaomi\",\n \"value\": 13.4\n },\n {\n \"category\": \"Market Share\",\n \"name\": \"Oppo\",\n \"value\": 8.8\n },\n {\n \"category\": \"Market Share\",\n \"name\": \"Vivo\",\n \"value\": 8.1\n },\n {\n \"category\": \"Market Share\",\n \"name\": \"Others\",\n \"value\": 27.4\n }\n]", + "xAxisKey": "name", + "xAxisDirection": "horizontal", + "xAxisData": "[]", + "series": [ + { + "columnName": "value", + "seriesName": "value", + "showLabel": true, + "radius": "30", + "left": "", + "top": "", + "startAngle": "0", + "endAngle": "360", + "roseType": "none", + "labelAlignTo": "none", + "labelPosition": "outer", + "labelBleedMargin": "5", + "labelEdgeDistance": "25%", + "labelLineLength": "10", + "labelLineLength2": "10", + "padAngle": "0", + "borderRadius": "0", + "dataIndex": "d8ab1a82" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "pie", + "comp": { + "type": "basicPie", + "cellSize": "40", + "range": "2021-09", + "mapUrl": "https://echarts.apache.org/examples/data/asset/geo/USA.json" + } + }, + "echartsOption": "{\n \"data\": [\n {\n \"value\": 100,\n \"name\": \"Show\",\n \"color\": \"#fc8452\"\n },\n {\n \"value\": 80,\n \"name\": \"Click\",\n \"color\": \"#9a60b4\"\n },\n {\n \"value\": 60,\n \"name\": \"Visit\",\n \"color\": \"#fac858\"\n },\n {\n \"value\": 40,\n \"name\": \"Query\",\n \"color\": \"#ee6666\"\n },\n {\n \"value\": 20,\n \"name\": \"Buy\",\n \"color\": \"#3ba272\"\n }\n ]\n}", + "echartsTitle": "Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsConfig": { + "compType": "funnel", + "comp": {} + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "left": "10", + "right": "10", + "top": "20", + "bottom": "20", + "tooltip": true, + "legendVisibility": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "pieChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/pivotTable.json b/e2e/fixtures/dsl/pivotTable.json new file mode 100644 index 0000000000..231aacc5b1 --- /dev/null +++ b/e2e/fixtures/dsl/pivotTable.json @@ -0,0 +1,125 @@ +{ + "ui": { + "layout": { + "b836954c": { + "i": "b836954c", + "h": 50, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "b836954c": { + "compType": "pivotTable", + "comp": { + "autoHeight": "auto", + "data": "[\n [\n \"Total Bill\",\n \"Tip\",\n \"Payer Gender\",\n \"Payer Smoker\",\n \"Day of Week\",\n \"Meal\",\n \"Party Size\"\n ],\n [\n 16.99,\n 1.01,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 10.34,\n 1.66,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 21.01,\n 3.5,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 23.68,\n 3.31,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 24.59,\n 3.61,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 25.29,\n 4.71,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 8.77,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 26.88,\n 3.12,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 15.04,\n 1.96,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 14.78,\n 3.23,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 10.27,\n 1.71,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 35.26,\n 5,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 15.42,\n 1.57,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 18.43,\n 3,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 14.83,\n 3.02,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 21.58,\n 3.92,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 10.33,\n 1.67,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 16.29,\n 3.71,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 16.97,\n 3.5,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 20.65,\n 3.35,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 17.92,\n 4.08,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 20.29,\n 2.75,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 15.77,\n 2.23,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 39.42,\n 7.58,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 19.82,\n 3.18,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 17.81,\n 2.34,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 13.37,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 12.69,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 21.7,\n 4.3,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 19.65,\n 3,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 9.55,\n 1.45,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 18.35,\n 2.5,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 15.06,\n 3,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 20.69,\n 2.45,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 17.78,\n 3.27,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 24.06,\n 3.6,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 16.31,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 16.93,\n 3.07,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 18.69,\n 2.31,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 31.27,\n 5,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 16.04,\n 2.24,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 17.46,\n 2.54,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 13.94,\n 3.06,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 9.68,\n 1.32,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 30.4,\n 5.6,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 18.29,\n 3,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 22.23,\n 5,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 32.4,\n 6,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 28.55,\n 2.05,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 18.04,\n 3,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 12.54,\n 2.5,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 10.29,\n 2.6,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 34.81,\n 5.2,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 9.94,\n 1.56,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 25.56,\n 4.34,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 19.49,\n 3.51,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 38.01,\n 3,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 26.41,\n 1.5,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 11.24,\n 1.76,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 48.27,\n 6.73,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 20.29,\n 3.21,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 13.81,\n 2,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 11.02,\n 1.98,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 18.29,\n 3.76,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 17.59,\n 2.64,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 20.08,\n 3.15,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 16.45,\n 2.47,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 3.07,\n 1,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 1\n ],\n [\n 20.23,\n 2.01,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 15.01,\n 2.09,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 12.02,\n 1.97,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 17.07,\n 3,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 26.86,\n 3.14,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 25.28,\n 5,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 14.73,\n 2.2,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 10.51,\n 1.25,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 17.92,\n 3.08,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 27.2,\n 4,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 4\n ],\n [\n 22.76,\n 3,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 17.29,\n 2.71,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 19.44,\n 3,\n \"Male\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 16.66,\n 3.4,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 10.07,\n 1.83,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 1\n ],\n [\n 32.68,\n 5,\n \"Male\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 15.98,\n 2.03,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 34.83,\n 5.17,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 4\n ],\n [\n 13.03,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 18.28,\n 4,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 24.71,\n 5.85,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 21.16,\n 3,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 28.97,\n 3,\n \"Male\",\n \"Smoker\",\n \"Friday\",\n \"Dinner\",\n 2\n ],\n [\n 22.49,\n 3.5,\n \"Male\",\n \"Non-Smoker\",\n \"Friday\",\n \"Dinner\",\n 2\n ],\n [\n 5.75,\n 1,\n \"Female\",\n \"Smoker\",\n \"Friday\",\n \"Dinner\",\n 2\n ],\n [\n 16.32,\n 4.3,\n \"Female\",\n \"Smoker\",\n \"Friday\",\n \"Dinner\",\n 2\n ],\n [\n 22.75,\n 3.25,\n \"Female\",\n \"Non-Smoker\",\n \"Friday\",\n \"Dinner\",\n 2\n ],\n [\n 40.17,\n 4.73,\n \"Male\",\n \"Smoker\",\n \"Friday\",\n \"Dinner\",\n 4\n ],\n [\n 27.28,\n 4,\n \"Male\",\n \"Smoker\",\n \"Friday\",\n \"Dinner\",\n 2\n ],\n [\n 12.03,\n 1.5,\n \"Male\",\n \"Smoker\",\n \"Friday\",\n \"Dinner\",\n 2\n ],\n [\n 21.01,\n 3,\n \"Male\",\n \"Smoker\",\n \"Friday\",\n \"Dinner\",\n 2\n ],\n [\n 12.46,\n 1.5,\n \"Male\",\n \"Non-Smoker\",\n \"Friday\",\n \"Dinner\",\n 2\n ],\n [\n 11.35,\n 2.5,\n \"Female\",\n \"Smoker\",\n \"Friday\",\n \"Dinner\",\n 2\n ],\n [\n 15.38,\n 3,\n \"Female\",\n \"Smoker\",\n \"Friday\",\n \"Dinner\",\n 2\n ],\n [\n 44.3,\n 2.5,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 22.42,\n 3.48,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 20.92,\n 4.08,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 15.36,\n 1.64,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 20.49,\n 4.06,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 25.21,\n 4.29,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 18.24,\n 3.76,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 14.31,\n 4,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 14,\n 3,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 7.25,\n 1,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 1\n ],\n [\n 38.07,\n 4,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 23.95,\n 2.55,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 25.71,\n 4,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 17.31,\n 3.5,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 29.93,\n 5.07,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 10.65,\n 1.5,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 12.43,\n 1.8,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 24.08,\n 2.92,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 4\n ],\n [\n 11.69,\n 2.31,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 13.42,\n 1.68,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 14.26,\n 2.5,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 15.95,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 12.48,\n 2.52,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 29.8,\n 4.2,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 6\n ],\n [\n 8.52,\n 1.48,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 14.52,\n 2,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 11.38,\n 2,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 22.82,\n 2.18,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 3\n ],\n [\n 19.08,\n 1.5,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 20.27,\n 2.83,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 11.17,\n 1.5,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 12.26,\n 2,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 18.26,\n 3.25,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 8.51,\n 1.25,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 10.33,\n 2,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 14.15,\n 2,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 16,\n 2,\n \"Male\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 13.16,\n 2.75,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 17.47,\n 3.5,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 34.3,\n 6.7,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 6\n ],\n [\n 41.19,\n 5,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 5\n ],\n [\n 27.05,\n 5,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 6\n ],\n [\n 16.43,\n 2.3,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 8.35,\n 1.5,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 18.64,\n 1.36,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 3\n ],\n [\n 11.87,\n 1.63,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 9.78,\n 1.73,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 7.51,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 14.07,\n 2.5,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 13.13,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 17.26,\n 2.74,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 24.55,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 19.77,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 29.85,\n 5.14,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 5\n ],\n [\n 48.17,\n 5,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 6\n ],\n [\n 25,\n 3.75,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 13.39,\n 2.61,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 16.49,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 21.5,\n 3.5,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 12.66,\n 2.5,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 16.21,\n 2,\n \"Female\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 13.81,\n 2,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 17.51,\n 3,\n \"Female\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 24.52,\n 3.48,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 20.76,\n 2.24,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 31.71,\n 4.5,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 10.59,\n 1.61,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 10.63,\n 2,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 50.81,\n 10,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 15.81,\n 3.16,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 7.25,\n 5.15,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 31.85,\n 3.18,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 16.82,\n 4,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 32.9,\n 3.11,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 17.89,\n 2,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 14.48,\n 2,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 9.6,\n 4,\n \"Female\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 34.63,\n 3.55,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 34.65,\n 3.68,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 23.33,\n 5.65,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 45.35,\n 3.5,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 23.17,\n 6.5,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 4\n ],\n [\n 40.55,\n 3,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 20.69,\n 5,\n \"Male\",\n \"Non-Smoker\",\n \"Sunday\",\n \"Dinner\",\n 5\n ],\n [\n 20.9,\n 3.5,\n \"Female\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 30.46,\n 2,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 5\n ],\n [\n 18.15,\n 3.5,\n \"Female\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 23.1,\n 4,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 3\n ],\n [\n 15.69,\n 1.5,\n \"Male\",\n \"Smoker\",\n \"Sunday\",\n \"Dinner\",\n 2\n ],\n [\n 19.81,\n 4.19,\n \"Female\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 28.44,\n 2.56,\n \"Male\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 15.48,\n 2.02,\n \"Male\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 16.58,\n 4,\n \"Male\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 7.56,\n 1.44,\n \"Male\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 10.34,\n 2,\n \"Male\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 43.11,\n 5,\n \"Female\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 4\n ],\n [\n 13,\n 2,\n \"Female\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 13.51,\n 2,\n \"Male\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 18.71,\n 4,\n \"Male\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 3\n ],\n [\n 12.74,\n 2.01,\n \"Female\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 13,\n 2,\n \"Female\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 16.4,\n 2.5,\n \"Female\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 2\n ],\n [\n 20.53,\n 4,\n \"Male\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 4\n ],\n [\n 16.47,\n 3.23,\n \"Female\",\n \"Smoker\",\n \"Thursday\",\n \"Lunch\",\n 3\n ],\n [\n 26.59,\n 3.41,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 38.73,\n 3,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 24.27,\n 2.03,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 12.76,\n 2.23,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 30.06,\n 2,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 25.89,\n 5.16,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 48.33,\n 9,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 13.27,\n 2.5,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 28.17,\n 6.5,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 12.9,\n 1.1,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 28.15,\n 3,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 5\n ],\n [\n 11.59,\n 1.5,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 7.74,\n 1.44,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 30.14,\n 3.09,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 12.16,\n 2.2,\n \"Male\",\n \"Smoker\",\n \"Friday\",\n \"Lunch\",\n 2\n ],\n [\n 13.42,\n 3.48,\n \"Female\",\n \"Smoker\",\n \"Friday\",\n \"Lunch\",\n 2\n ],\n [\n 8.58,\n 1.92,\n \"Male\",\n \"Smoker\",\n \"Friday\",\n \"Lunch\",\n 1\n ],\n [\n 15.98,\n 3,\n \"Female\",\n \"Non-Smoker\",\n \"Friday\",\n \"Lunch\",\n 3\n ],\n [\n 13.42,\n 1.58,\n \"Male\",\n \"Smoker\",\n \"Friday\",\n \"Lunch\",\n 2\n ],\n [\n 16.27,\n 2.5,\n \"Female\",\n \"Smoker\",\n \"Friday\",\n \"Lunch\",\n 2\n ],\n [\n 10.09,\n 2,\n \"Female\",\n \"Smoker\",\n \"Friday\",\n \"Lunch\",\n 2\n ],\n [\n 20.45,\n 3,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 13.28,\n 2.72,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 22.12,\n 2.88,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 24.01,\n 2,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 4\n ],\n [\n 15.69,\n 3,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 11.61,\n 3.39,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 10.77,\n 1.47,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 15.53,\n 3,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 10.07,\n 1.25,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 12.6,\n 1,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 32.83,\n 1.17,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 35.83,\n 4.67,\n \"Female\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 29.03,\n 5.92,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 3\n ],\n [\n 27.18,\n 2,\n \"Female\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 22.67,\n 2,\n \"Male\",\n \"Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 17.82,\n 1.75,\n \"Male\",\n \"Non-Smoker\",\n \"Saturday\",\n \"Dinner\",\n 2\n ],\n [\n 18.78,\n 3,\n \"Female\",\n \"Non-Smoker\",\n \"Thursday\",\n \"Dinner\",\n 2\n ]\n]", + "rendererName": "Table", + "aggregatorName": "Count", + "cols": "[]", + "rows": "[]", + "vals": "[]", + "hiddenAttributes": "[]", + "hiddenFromAggregators": "[]", + "hiddenFromDragDrop": "[]", + "readOnly": false, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "pivotTable1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/progress.json b/e2e/fixtures/dsl/progress.json new file mode 100644 index 0000000000..9ea0b9115f --- /dev/null +++ b/e2e/fixtures/dsl/progress.json @@ -0,0 +1,115 @@ +{ + "ui": { + "layout": { + "cd2829a4": { + "i": "cd2829a4", + "h": 5, + "w": 6, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "cd2829a4": { + "compType": "progress", + "comp": { + "value": "60", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "progress1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/progressCircle.json b/e2e/fixtures/dsl/progressCircle.json new file mode 100644 index 0000000000..cbcd6a4015 --- /dev/null +++ b/e2e/fixtures/dsl/progressCircle.json @@ -0,0 +1,120 @@ +{ + "ui": { + "layout": { + "da482097": { + "i": "da482097", + "h": 20, + "w": 6, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "da482097": { + "compType": "progressCircle", + "comp": { + "value": "60", + "progressType": "circle", + "showInfo": true, + "strokeLinecap": "round", + "gapPosition": "bottom", + "customFormat": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "progressCircle1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/qrCode.json b/e2e/fixtures/dsl/qrCode.json new file mode 100644 index 0000000000..771fda8774 --- /dev/null +++ b/e2e/fixtures/dsl/qrCode.json @@ -0,0 +1,118 @@ +{ + "ui": { + "layout": { + "80664388": { + "i": "80664388", + "h": 32, + "w": 6, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "80664388": { + "compType": "qrCode", + "comp": { + "value": "", + "level": "L", + "includeMargin": true, + "restrictPaddingOnRotation": "qrCode", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "qrCode1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/radarChart.json b/e2e/fixtures/dsl/radarChart.json new file mode 100644 index 0000000000..69ca796a82 --- /dev/null +++ b/e2e/fixtures/dsl/radarChart.json @@ -0,0 +1,186 @@ +{ + "ui": { + "layout": { + "7fb735ad": { + "i": "7fb735ad", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "7fb735ad": { + "compType": "radarChart", + "comp": { + "mode": "json", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "d684fe11" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "ca95ae86" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsData": "[\n {\n \"name\": \"Current System\",\n \"value\": [\n 85,\n 72,\n 78,\n 65,\n 82,\n 68\n ]\n },\n {\n \"name\": \"Competitor System\",\n \"value\": [\n 67,\n 82,\n 58,\n 73,\n 45,\n 79\n ],\n \"areaColor\": \"#ff00ff77\",\n \"lineColor\": \"#ff00ff77\",\n \"lineWidth\": 2,\n \"pointSize\": 8,\n \"pointColor\": \"#ff00ff77\"\n }\n]", + "echartsIndicators": "[\n {\n \"name\": \"Performance\",\n \"max\": 100\n },\n {\n \"name\": \"Reliability\",\n \"max\": 100\n },\n {\n \"name\": \"Efficiency\",\n \"max\": 100\n },\n {\n \"name\": \"User Satisfaction\",\n \"max\": 100\n },\n {\n \"name\": \"Cost Effectiveness\",\n \"max\": 100\n },\n {\n \"name\": \"Scalability\",\n \"max\": 100\n }\n]", + "echartsOption": "{\n \"color\": [\n \"#6ee1d5\",\n \"#a7dd85\"\n ],\n \"indicator\": [\n {\n \"name\": \"Performance\",\n \"max\": 100\n },\n {\n \"name\": \"Reliability\",\n \"max\": 100\n },\n {\n \"name\": \"Efficiency\",\n \"max\": 100\n },\n {\n \"name\": \"User Satisfaction\",\n \"max\": 100\n },\n {\n \"name\": \"Cost Effectiveness\",\n \"max\": 100\n },\n {\n \"name\": \"Scalability\",\n \"max\": 100\n }\n ],\n \"series\": [\n {\n \"name\": \"Current System\",\n \"value\": [\n 85,\n 72,\n 78,\n 65,\n 82,\n 68\n ]\n },\n {\n \"name\": \"Competitor System\",\n \"value\": [\n 67,\n 82,\n 58,\n 73,\n 45,\n 79\n ],\n \"areaColor\": \"#ff00ff77\",\n \"lineColor\": \"#ff00ff77\",\n \"lineWidth\": 2,\n \"pointSize\": 8,\n \"pointColor\": \"#ff00ff77\"\n }\n ]\n}", + "echartsTitle": "Radar Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "echartsConfig": { + "compType": "radar", + "comp": {} + }, + "echartsLegendOrientConfig": { + "orient": "horizontal" + }, + "echartsLegendAlignConfig": { + "left": "center" + }, + "position_x": "50", + "position_y": "50", + "radius": "60", + "splitNumber": "5", + "startAngle": "90", + "areaFlag": true, + "tooltip": true, + "legendVisibility": true, + "indicatorVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "radarChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/radio.json b/e2e/fixtures/dsl/radio.json new file mode 100644 index 0000000000..37e9038caa --- /dev/null +++ b/e2e/fixtures/dsl/radio.json @@ -0,0 +1,142 @@ +{ + "ui": { + "layout": { + "ae81324a": { + "i": "ae81324a", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "ae81324a": { + "compType": "radio", + "comp": { + "defaultValue": "", + "value": "", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "options": { + "optionType": "manual", + "manual": { + "manual": [ + { + "value": "1", + "label": "Option 1" + }, + { + "value": "2", + "label": "Option 2" + } + ] + }, + "mapData": { + "data": "[]" + } + }, + "layout": "horizontal", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "radio1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/rangeSlider.json b/e2e/fixtures/dsl/rangeSlider.json new file mode 100644 index 0000000000..477d47aea0 --- /dev/null +++ b/e2e/fixtures/dsl/rangeSlider.json @@ -0,0 +1,126 @@ +{ + "ui": { + "layout": { + "3e8aca91": { + "i": "3e8aca91", + "h": 5, + "w": 6, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "3e8aca91": { + "compType": "rangeSlider", + "comp": { + "max": "100", + "min": "0", + "step": "1", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "start": "10", + "end": "60", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "rangeSlider1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/rating.json b/e2e/fixtures/dsl/rating.json new file mode 100644 index 0000000000..b90a451d79 --- /dev/null +++ b/e2e/fixtures/dsl/rating.json @@ -0,0 +1,124 @@ +{ + "ui": { + "layout": { + "733afb83": { + "i": "733afb83", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "733afb83": { + "compType": "rating", + "comp": { + "defaultValue": "", + "value": "", + "max": "5", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "rating1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/responsiveLayout.json b/e2e/fixtures/dsl/responsiveLayout.json new file mode 100644 index 0000000000..df8ff99393 --- /dev/null +++ b/e2e/fixtures/dsl/responsiveLayout.json @@ -0,0 +1,165 @@ +{ + "ui": { + "layout": { + "a26f6298": { + "i": "a26f6298", + "h": 25, + "w": 15, + "delayCollision": true, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "a26f6298": { + "compType": "responsiveLayout", + "comp": { + "columns": { + "manual": [ + { + "id": 0, + "label": "Column1", + "key": "Column1", + "minWidth": "", + "background": "", + "backgroundImage": "", + "border": "", + "radius": "", + "margin": "", + "padding": "", + "hidden": "false" + }, + { + "id": 1, + "label": "Column2", + "key": "Column2", + "minWidth": "", + "background": "", + "backgroundImage": "", + "border": "", + "radius": "", + "margin": "", + "padding": "", + "hidden": "false" + } + ] + }, + "containers": { + "0": { + "layout": {} + }, + "1": { + "layout": {} + } + }, + "horizontalGridCells": 24, + "verticalGridCells": 24, + "autoHeight": "auto", + "rowBreak": true, + "useComponentWidth": true, + "matchColumnsHeight": true, + "mainScrollbar": false, + "columnPerRowLG": "4", + "columnPerRowMD": "2", + "columnPerRowSM": "1", + "verticalSpacing": "8", + "horizontalSpacing": "8", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "responsiveLayout1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/richTextEditor.json b/e2e/fixtures/dsl/richTextEditor.json new file mode 100644 index 0000000000..f5a2e48304 --- /dev/null +++ b/e2e/fixtures/dsl/richTextEditor.json @@ -0,0 +1,120 @@ +{ + "ui": { + "layout": { + "a3a46f44": { + "i": "a3a46f44", + "h": 50, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "a3a46f44": { + "compType": "richTextEditor", + "comp": { + "value": "", + "delta": "", + "autoHeight": "fixed", + "contentScrollBar": false, + "placeholder": "Please Input...", + "toolbar": "[[{\"header\":[1,2,3,false]}],[\"bold\",\"italic\",\"underline\",\"strike\",\"blockquote\"],[{\"list\":\"ordered\"},{\"list\":\"bullet\"}],[{\"indent\":\"-1\"},{\"indent\":\"+1\"}],[{\"color\":[]},{\"background\":[]},{\"align\":[]}],[\"link\",\"image\"],[\"clean\"]]", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "richTextEditor1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/sankeyChart.json b/e2e/fixtures/dsl/sankeyChart.json new file mode 100644 index 0000000000..f92ab780e7 --- /dev/null +++ b/e2e/fixtures/dsl/sankeyChart.json @@ -0,0 +1,184 @@ +{ + "ui": { + "layout": { + "839bddea": { + "i": "839bddea", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "839bddea": { + "compType": "sankeyChart", + "comp": { + "mode": "json", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "5be2f6f0" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "d068dedc" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsData": "[\n {\n \"name\": \"Website Visits\",\n \"color\": \"#3498db\"\n },\n {\n \"name\": \"Product Page\",\n \"color\": \"#2ecc71\"\n },\n {\n \"name\": \"Cart\",\n \"color\": \"#f39c12\"\n },\n {\n \"name\": \"Checkout\",\n \"color\": \"#e74c3c\"\n },\n {\n \"name\": \"Purchase\",\n \"color\": \"#9b59b6\"\n },\n {\n \"name\": \"Abandoned\",\n \"color\": \"#95a5a6\"\n }\n]", + "echartsLinks": "[\n {\n \"source\": \"Website Visits\",\n \"target\": \"Product Page\",\n \"value\": 1000\n },\n {\n \"source\": \"Website Visits\",\n \"target\": \"Abandoned\",\n \"value\": 300\n },\n {\n \"source\": \"Product Page\",\n \"target\": \"Cart\",\n \"value\": 700\n },\n {\n \"source\": \"Product Page\",\n \"target\": \"Abandoned\",\n \"value\": 300\n },\n {\n \"source\": \"Cart\",\n \"target\": \"Checkout\",\n \"value\": 400\n },\n {\n \"source\": \"Cart\",\n \"target\": \"Abandoned\",\n \"value\": 300\n },\n {\n \"source\": \"Checkout\",\n \"target\": \"Purchase\",\n \"value\": 350\n },\n {\n \"source\": \"Checkout\",\n \"target\": \"Abandoned\",\n \"value\": 50\n }\n]", + "echartsOption": "{\n \"data\": [\n {\n \"name\": \"Website Visits\",\n \"color\": \"#3498db\"\n },\n {\n \"name\": \"Product Page\",\n \"color\": \"#2ecc71\"\n },\n {\n \"name\": \"Cart\",\n \"color\": \"#f39c12\"\n },\n {\n \"name\": \"Checkout\",\n \"color\": \"#e74c3c\"\n },\n {\n \"name\": \"Purchase\",\n \"color\": \"#9b59b6\"\n },\n {\n \"name\": \"Abandoned\",\n \"color\": \"#95a5a6\"\n }\n ],\n \"links\": [\n {\n \"source\": \"Website Visits\",\n \"target\": \"Product Page\",\n \"value\": 1000\n },\n {\n \"source\": \"Website Visits\",\n \"target\": \"Abandoned\",\n \"value\": 300\n },\n {\n \"source\": \"Product Page\",\n \"target\": \"Cart\",\n \"value\": 700\n },\n {\n \"source\": \"Product Page\",\n \"target\": \"Abandoned\",\n \"value\": 300\n },\n {\n \"source\": \"Cart\",\n \"target\": \"Checkout\",\n \"value\": 400\n },\n {\n \"source\": \"Cart\",\n \"target\": \"Abandoned\",\n \"value\": 300\n },\n {\n \"source\": \"Checkout\",\n \"target\": \"Purchase\",\n \"value\": 350\n },\n {\n \"source\": \"Checkout\",\n \"target\": \"Abandoned\",\n \"value\": 50\n }\n ]\n}", + "echartsTitle": "Sankey Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "echartsConfig": { + "compType": "sankey", + "comp": {} + }, + "left": "15", + "right": "10", + "top": "15", + "bottom": "10", + "curveness": "0.5", + "opacity": "0.5", + "nodeWidth": "20", + "nodeGap": "10", + "draggable": true, + "focus": true, + "tooltip": true, + "legendVisibility": true, + "labelVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "sankeyChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/scanner.json b/e2e/fixtures/dsl/scanner.json new file mode 100644 index 0000000000..0584068351 --- /dev/null +++ b/e2e/fixtures/dsl/scanner.json @@ -0,0 +1,119 @@ +{ + "ui": { + "layout": { + "486a189a": { + "i": "486a189a", + "h": 5, + "w": 6, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "486a189a": { + "compType": "scanner", + "comp": { + "data": "", + "value": "", + "text": "Click Scan", + "uniqueData": true, + "maskClosable": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "scanner1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/scatterChart.json b/e2e/fixtures/dsl/scatterChart.json new file mode 100644 index 0000000000..081ffb873b --- /dev/null +++ b/e2e/fixtures/dsl/scatterChart.json @@ -0,0 +1,182 @@ +{ + "ui": { + "layout": { + "4327f2f": { + "i": "4327f2f", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "4327f2f": { + "compType": "scatterChart", + "comp": { + "mode": "ui", + "title": "Chart", + "data": "[\n {\n \"hours\": 1.5,\n \"score\": 62,\n \"student\": \"Alex M.\"\n },\n {\n \"hours\": 2,\n \"score\": 65,\n \"student\": \"Sarah P.\"\n },\n {\n \"hours\": 2.5,\n \"score\": 71,\n \"student\": \"James W.\"\n },\n {\n \"hours\": 2.8,\n \"score\": 69,\n \"student\": \"Emma L.\"\n },\n {\n \"hours\": 3,\n \"score\": 75,\n \"student\": \"Michael R.\"\n },\n {\n \"hours\": 3.2,\n \"score\": 73,\n \"student\": \"Lisa K.\"\n },\n {\n \"hours\": 3.5,\n \"score\": 78,\n \"student\": \"David H.\"\n },\n {\n \"hours\": 3.8,\n \"score\": 77,\n \"student\": \"Sophie T.\"\n },\n {\n \"hours\": 4,\n \"score\": 82,\n \"student\": \"Ryan B.\"\n },\n {\n \"hours\": 4.2,\n \"score\": 84,\n \"student\": \"Nina C.\"\n },\n {\n \"hours\": 4.5,\n \"score\": 86,\n \"student\": \"Thomas G.\"\n },\n {\n \"hours\": 4.8,\n \"score\": 88,\n \"student\": \"Maria S.\"\n },\n {\n \"hours\": 5,\n \"score\": 89,\n \"student\": \"Daniel F.\"\n },\n {\n \"hours\": 5.2,\n \"score\": 91,\n \"student\": \"Anna D.\"\n },\n {\n \"hours\": 5.5,\n \"score\": 90,\n \"student\": \"Kevin P.\"\n },\n {\n \"hours\": 5.8,\n \"score\": 93,\n \"student\": \"Rachel M.\"\n },\n {\n \"hours\": 6,\n \"score\": 95,\n \"student\": \"John L.\"\n },\n {\n \"hours\": 6.2,\n \"score\": 94,\n \"student\": \"Emily W.\"\n },\n {\n \"hours\": 3,\n \"score\": 68,\n \"student\": \"Chris B.\"\n },\n {\n \"hours\": 5,\n \"score\": 96,\n \"student\": \"Jessica H.\"\n }\n]", + "xAxisKey": "hours", + "xAxisDirection": "horizontal", + "xAxisData": "[]", + "series": [ + { + "columnName": "hours", + "seriesName": "hours", + "dynamicIndex": "1", + "divider": "1000", + "markLineFrom": "[0,0]", + "markLineTo": "[1000,1000]", + "dataIndex": "2f7b8e83" + }, + { + "columnName": "score", + "seriesName": "score", + "dynamicIndex": "1", + "divider": "1000", + "markLineFrom": "[0,0]", + "markLineTo": "[1000,1000]", + "dataIndex": "1671f865" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "scatter", + "comp": { + "labelIndex": "2", + "shape": "circle", + "boundaryGap": true, + "heatmapMonth": "2021-09" + } + }, + "echartsOption": "{\n \"data\": [\n {\n \"value\": 100,\n \"name\": \"Show\",\n \"color\": \"#fc8452\"\n },\n {\n \"value\": 80,\n \"name\": \"Click\",\n \"color\": \"#9a60b4\"\n },\n {\n \"value\": 60,\n \"name\": \"Visit\",\n \"color\": \"#fac858\"\n },\n {\n \"value\": 40,\n \"name\": \"Query\",\n \"color\": \"#ee6666\"\n },\n {\n \"value\": 20,\n \"name\": \"Buy\",\n \"color\": \"#3ba272\"\n }\n ]\n}", + "echartsTitle": "Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsConfig": { + "compType": "funnel", + "comp": {} + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "left": "10", + "right": "10", + "top": "20", + "bottom": "20", + "tooltip": true, + "legendVisibility": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "scatterChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/segmentedControl.json b/e2e/fixtures/dsl/segmentedControl.json new file mode 100644 index 0000000000..22edcfda09 --- /dev/null +++ b/e2e/fixtures/dsl/segmentedControl.json @@ -0,0 +1,141 @@ +{ + "ui": { + "layout": { + "c8ba3846": { + "i": "c8ba3846", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "c8ba3846": { + "compType": "segmentedControl", + "comp": { + "defaultValue": "", + "value": "", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "options": { + "optionType": "manual", + "manual": { + "manual": [ + { + "value": "1", + "label": "Option 1" + }, + { + "value": "2", + "label": "Option 2" + } + ] + }, + "mapData": { + "data": "[]" + } + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "segmentedControl1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/select.json b/e2e/fixtures/dsl/select.json new file mode 100644 index 0000000000..a77319e2e3 --- /dev/null +++ b/e2e/fixtures/dsl/select.json @@ -0,0 +1,154 @@ +{ + "ui": { + "layout": { + "d9b75615": { + "i": "d9b75615", + "h": 5, + "w": 6, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "d9b75615": { + "compType": "select", + "comp": { + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "options": { + "optionType": "manual", + "manual": { + "manual": [ + { + "value": "1", + "label": "Option 1" + }, + { + "value": "2", + "label": "Option 2" + } + ] + }, + "mapData": { + "data": "[]" + } + }, + "showSearch": true, + "margin": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "padding": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "defaultValue": "", + "value": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "select1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/shape.json b/e2e/fixtures/dsl/shape.json new file mode 100644 index 0000000000..95cfde6cf3 --- /dev/null +++ b/e2e/fixtures/dsl/shape.json @@ -0,0 +1,140 @@ +{ + "ui": { + "layout": { + "a74cb97e": { + "i": "a74cb97e", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "a74cb97e": { + "compType": "shape", + "comp": { + "icon": "", + "container": { + "header": { + "layout": {} + }, + "body": { + "0": { + "view": { + "layout": {} + } + } + }, + "footer": { + "layout": {} + }, + "showHeader": true, + "showBody": true, + "autoHeight": "auto", + "showVerticalScrollbar": false, + "horizontalGridCells": 24, + "scrollbars": false, + "style": { + "borderWidth": "1px" + }, + "appliedThemeId": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "shape1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/sharingcomponent.json b/e2e/fixtures/dsl/sharingcomponent.json new file mode 100644 index 0000000000..dc2bd50ef0 --- /dev/null +++ b/e2e/fixtures/dsl/sharingcomponent.json @@ -0,0 +1,120 @@ +{ + "ui": { + "layout": { + "7941f35b": { + "i": "7941f35b", + "h": 50, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "7941f35b": { + "compType": "sharingcomponent", + "comp": { + "autoHeight": "fixed", + "profilePadding": "0px", + "profileBorderRadius": "0px", + "videoAspectRatio": "", + "userId": "{{meeting1.localUser}}", + "noVideoText": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "sharingcomponent1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/signature.json b/e2e/fixtures/dsl/signature.json new file mode 100644 index 0000000000..77a81f54a0 --- /dev/null +++ b/e2e/fixtures/dsl/signature.json @@ -0,0 +1,124 @@ +{ + "ui": { + "layout": { + "19d6f459": { + "i": "19d6f459", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "19d6f459": { + "compType": "signature", + "comp": { + "tips": "Sign Here", + "label": { + "text": "", + "width": "33", + "widthUnit": "%", + "position": "column", + "align": "left" + }, + "showUndo": true, + "showClear": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "signature1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/slider.json b/e2e/fixtures/dsl/slider.json new file mode 100644 index 0000000000..b6880fe6d4 --- /dev/null +++ b/e2e/fixtures/dsl/slider.json @@ -0,0 +1,125 @@ +{ + "ui": { + "layout": { + "b9a714b5": { + "i": "b9a714b5", + "h": 5, + "w": 6, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "b9a714b5": { + "compType": "slider", + "comp": { + "max": "100", + "min": "0", + "step": "1", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "value": "60", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "slider1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/splitLayout.json b/e2e/fixtures/dsl/splitLayout.json new file mode 100644 index 0000000000..c510d8036b --- /dev/null +++ b/e2e/fixtures/dsl/splitLayout.json @@ -0,0 +1,157 @@ +{ + "ui": { + "layout": { + "e8043595": { + "i": "e8043595", + "h": 25, + "w": 15, + "delayCollision": true, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "e8043595": { + "compType": "splitLayout", + "comp": { + "columns": { + "manual": [ + { + "id": 0, + "label": "Area 1", + "key": "Area1", + "minWidth": "10%", + "maxWidth": "90%", + "width": "50%", + "collapsible": false, + "background": "", + "backgroundImage": "", + "padding": "" + }, + { + "id": 1, + "label": "Area 2", + "key": "Area2", + "minWidth": "10%", + "maxWidth": "90%", + "width": "50%", + "collapsible": true, + "background": "", + "backgroundImage": "", + "padding": "" + } + ] + }, + "containers": { + "0": { + "layout": {} + }, + "1": { + "layout": {} + } + }, + "autoHeight": "auto", + "horizontalGridCells": 24, + "verticalGridCells": 24, + "orientation": "horizontal", + "matchColumnsHeight": true, + "mainScrollbar": false, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "splitLayout1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/step.json b/e2e/fixtures/dsl/step.json new file mode 100644 index 0000000000..b6887e8073 --- /dev/null +++ b/e2e/fixtures/dsl/step.json @@ -0,0 +1,171 @@ +{ + "ui": { + "layout": { + "d513e9a5": { + "i": "d513e9a5", + "h": 6, + "w": 13, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "d513e9a5": { + "compType": "step", + "comp": { + "autoHeight": "auto", + "initialValue": "", + "value": "", + "stepStatus": "", + "stepPercent": "", + "size": "default", + "displayType": "default", + "direction": "horizontal", + "responsive": true, + "labelPlacement": "horizontal", + "options": { + "optionType": "manual", + "manual": { + "manual": [ + { + "value": "1", + "label": "Step 1", + "subTitle": "Initialization", + "description": "Initial setup of parameters.", + "icon": "/icon:solid/play", + "status": "finish", + "disabled": "false" + }, + { + "value": "2", + "label": "Step 2", + "subTitle": "Execution", + "description": "Execution of the main process.", + "icon": "/icon:solid/person-running", + "status": "process", + "disabled": "false" + }, + { + "value": "3", + "label": "Step 3", + "subTitle": "Finalization", + "description": "Final steps to complete the process.", + "icon": "/icon:solid/circle-check", + "status": "wait", + "disabled": "true" + }, + { + "value": "4", + "label": "Step 4", + "subTitle": "Completion", + "description": "Process completed successfully.", + "status": "wait", + "disabled": "true" + } + ] + }, + "mapData": { + "data": "[]" + } + }, + "showScrollBars": false, + "minHorizontalWidth": "180px", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "step1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/sunburstChart.json b/e2e/fixtures/dsl/sunburstChart.json new file mode 100644 index 0000000000..2b7d8c7a72 --- /dev/null +++ b/e2e/fixtures/dsl/sunburstChart.json @@ -0,0 +1,177 @@ +{ + "ui": { + "layout": { + "b2f92a39": { + "i": "b2f92a39", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "b2f92a39": { + "compType": "sunburstChart", + "comp": { + "mode": "json", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "84aa4261" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "e81df9e8" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsData": "[\n {\n \"name\": \"Traffic\",\n \"children\": [\n {\n \"name\": \"Direct\",\n \"value\": 350,\n \"children\": [\n {\n \"name\": \"New\",\n \"value\": 200\n },\n {\n \"name\": \"Return\",\n \"value\": 150\n }\n ]\n },\n {\n \"name\": \"Social\",\n \"value\": 300,\n \"children\": [\n {\n \"name\": \"FB\",\n \"value\": 120\n },\n {\n \"name\": \"IG\",\n \"value\": 100\n },\n {\n \"name\": \"TW\",\n \"value\": 80\n }\n ]\n },\n {\n \"name\": \"Search\",\n \"value\": 400,\n \"children\": [\n {\n \"name\": \"Google\",\n \"value\": 300\n },\n {\n \"name\": \"Bing\",\n \"value\": 100\n }\n ]\n }\n ]\n }\n]", + "echartsLevels": "[\n {\n \"itemStyle\": {\n \"color\": \"#3498db\",\n \"borderWidth\": 2,\n \"borderColor\": \"white\"\n }\n },\n {\n \"itemStyle\": {\n \"color\": \"#2ecc71\",\n \"borderWidth\": 1,\n \"borderColor\": \"white\"\n }\n },\n {\n \"itemStyle\": {\n \"color\": \"#e74c3c\",\n \"borderWidth\": 1,\n \"borderColor\": \"white\"\n }\n }\n]", + "echartsOption": "{\n \"data\": [\n {\n \"name\": \"Traffic\",\n \"children\": [\n {\n \"name\": \"Direct\",\n \"value\": 350,\n \"children\": [\n {\n \"name\": \"New\",\n \"value\": 200\n },\n {\n \"name\": \"Return\",\n \"value\": 150\n }\n ]\n },\n {\n \"name\": \"Social\",\n \"value\": 300,\n \"children\": [\n {\n \"name\": \"FB\",\n \"value\": 120\n },\n {\n \"name\": \"IG\",\n \"value\": 100\n },\n {\n \"name\": \"TW\",\n \"value\": 80\n }\n ]\n },\n {\n \"name\": \"Search\",\n \"value\": 400,\n \"children\": [\n {\n \"name\": \"Google\",\n \"value\": 300\n },\n {\n \"name\": \"Bing\",\n \"value\": 100\n }\n ]\n }\n ]\n }\n ],\n \"levels\": [\n {\n \"itemStyle\": {\n \"color\": \"#3498db\",\n \"borderWidth\": 2,\n \"borderColor\": \"white\"\n }\n },\n {\n \"itemStyle\": {\n \"color\": \"#2ecc71\",\n \"borderWidth\": 1,\n \"borderColor\": \"white\"\n }\n },\n {\n \"itemStyle\": {\n \"color\": \"#e74c3c\",\n \"borderWidth\": 1,\n \"borderColor\": \"white\"\n }\n }\n ],\n \"label\": {\n \"show\": true,\n \"formatter\": \"{b}\",\n \"fontSize\": 12,\n \"color\": \"white\"\n },\n \"radius\": [\n \"20%\",\n \"90%\"\n ]\n}", + "echartsTitle": "Sunburst Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsConfig": { + "compType": "sunburst", + "comp": {} + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "radiusInline": "20", + "radiusOutline": "80", + "position_x": "50", + "position_y": "50", + "tooltip": true, + "labelVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "sunburstChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/switch.json b/e2e/fixtures/dsl/switch.json new file mode 100644 index 0000000000..d642c976a6 --- /dev/null +++ b/e2e/fixtures/dsl/switch.json @@ -0,0 +1,123 @@ +{ + "ui": { + "layout": { + "973387e9": { + "i": "973387e9", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "973387e9": { + "compType": "switch", + "comp": { + "defaultValue": "", + "value": "", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "switch1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/tabbedContainer.json b/e2e/fixtures/dsl/tabbedContainer.json new file mode 100644 index 0000000000..f27ffecbf0 --- /dev/null +++ b/e2e/fixtures/dsl/tabbedContainer.json @@ -0,0 +1,149 @@ +{ + "ui": { + "layout": { + "17ca5c5b": { + "i": "17ca5c5b", + "h": 25, + "w": 9, + "delayCollision": true, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "17ca5c5b": { + "compType": "tabbedContainer", + "comp": { + "tabs": { + "manual": [ + { + "id": 0, + "label": "Tab1", + "key": "Tab1", + "iconPosition": "left" + }, + { + "id": 1, + "label": "Tab2", + "key": "Tab2", + "iconPosition": "left" + } + ] + }, + "selectedTabKey": "Tab1", + "containers": { + "0": { + "layout": {} + }, + "1": { + "layout": {} + } + }, + "autoHeight": "auto", + "showVerticalScrollbar": false, + "horizontalGridCells": 24, + "scrollbars": false, + "placement": "top", + "showHeader": true, + "tabBehavior": "lazy", + "tabsGutter": "32", + "tabsCentered": false, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "tabbedContainer1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/table.json b/e2e/fixtures/dsl/table.json new file mode 100644 index 0000000000..2af2c93c1b --- /dev/null +++ b/e2e/fixtures/dsl/table.json @@ -0,0 +1,589 @@ +{ + "ui": { + "layout": { + "bbaaf741": { + "i": "bbaaf741", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "bbaaf741": { + "compType": "table", + "comp": { + "showRowGridBorder": true, + "showHRowGridBorder": true, + "autoHeight": "auto", + "data": "[\n {\n \"id\": 1,\n \"name\": \"Reagen Gilberthorpe\",\n \"date\": \"7/5/2022\",\n \"department\": \"Marketing\"\n },\n {\n \"id\": 2,\n \"name\": \"Haroun Lortzing\",\n \"date\": \"11/6/2022\",\n \"department\": \"Human Resources\"\n },\n {\n \"id\": 3,\n \"name\": \"Garret Kilmaster\",\n \"date\": \"11/14/2021\",\n \"department\": \"Research and Development\"\n },\n {\n \"id\": 4,\n \"name\": \"Israel Harrowsmith\",\n \"date\": \"4/3/2022\",\n \"department\": \"Training\"\n },\n {\n \"id\": 5,\n \"name\": \"Loren O'Lagen\",\n \"date\": \"9/10/2022\",\n \"department\": \"Services\"\n },\n {\n \"id\": 6,\n \"name\": \"Wallis Hothersall\",\n \"date\": \"4/18/2022\",\n \"department\": \"Accounting\"\n },\n {\n \"id\": 7,\n \"name\": \"Kaia Biskup\",\n \"date\": \"3/4/2022\",\n \"department\": \"Sales\"\n },\n {\n \"id\": 8,\n \"name\": \"Travers Saterweyte\",\n \"date\": \"1/9/2022\",\n \"department\": \"Human Resources\"\n },\n {\n \"id\": 9,\n \"name\": \"Mikey Niemetz\",\n \"date\": \"1/4/2022\",\n \"department\": \"Marketing\"\n },\n {\n \"id\": 10,\n \"name\": \"Mano Meckiff\",\n \"date\": \"2/19/2022\",\n \"department\": \"Research and Development\"\n }\n]", + "columns": [ + { + "title": "ID", + "showTitle": true, + "isCustom": false, + "dataIndex": "id", + "filterable": false, + "width": "55", + "autoWidth": "fixed", + "render": { + "compType": "text", + "comp": { + "text": "{{currentCell}}" + } + }, + "align": "left", + "fixed": "close", + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + }, + { + "title": "Name", + "showTitle": true, + "isCustom": false, + "dataIndex": "name", + "filterable": false, + "width": "200", + "autoWidth": "fixed", + "render": { + "compType": "text", + "comp": { + "text": "{{currentCell}}" + } + }, + "align": "left", + "fixed": "close", + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + }, + { + "title": "Date", + "showTitle": true, + "isCustom": false, + "dataIndex": "date", + "filterable": false, + "width": "110", + "autoWidth": "fixed", + "render": { + "compType": "text", + "comp": { + "text": "{{currentCell}}" + } + }, + "align": "left", + "fixed": "close", + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + }, + { + "title": "Department", + "showTitle": true, + "isCustom": false, + "dataIndex": "department", + "filterable": false, + "width": "250", + "autoWidth": "fixed", + "render": { + "compType": "tag", + "comp": { + "text": "{{currentCell}}", + "tagColors": { + "optionType": "manual", + "manual": { + "manual": [ + { + "label": "Tag1", + "icon": "/icon:solid/tag", + "colorType": "preset", + "presetColor": "blue", + "color": "#1890ff", + "textColor": "#ffffff", + "border": "", + "radius": "", + "margin": "", + "padding": "" + }, + { + "label": "Tag2", + "icon": "/icon:solid/tag", + "colorType": "preset", + "presetColor": "green", + "color": "#1890ff", + "textColor": "#ffffff", + "border": "", + "radius": "", + "margin": "", + "padding": "" + } + ] + }, + "mapData": { + "data": "[]", + "mapData": { + "colorType": "preset", + "presetColor": "blue", + "color": "#1890ff", + "textColor": "#ffffff", + "border": "", + "radius": "", + "margin": "", + "padding": "" + } + } + } + } + }, + "align": "left", + "fixed": "close", + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + } + ], + "size": "middle", + "selection": { + "mode": "single" + }, + "pagination": { + "changeablePageSize": null, + "pageSizeOptions": "[5, 10, 20, 50]" + }, + "sort": [], + "toolbar": { + "showRefresh": true, + "showDownload": true, + "showFilter": true, + "position": "below", + "columnSeparator": ",", + "showUpdateButtons": true + }, + "summaryRows": "1", + "hideToolbar": false, + "rowAutoHeight": "auto", + "tableAutoHeight": "auto", + "expansion": { + "slot": { + "container": { + "layout": {} + } + } + }, + "editModeClicks": "single", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "table1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/tableLite.json b/e2e/fixtures/dsl/tableLite.json new file mode 100644 index 0000000000..4399741f7e --- /dev/null +++ b/e2e/fixtures/dsl/tableLite.json @@ -0,0 +1,579 @@ +{ + "ui": { + "layout": { + "b61ceeb8": { + "i": "b61ceeb8", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "b61ceeb8": { + "compType": "tableLite", + "comp": { + "showRowGridBorder": true, + "showHRowGridBorder": true, + "autoHeight": "auto", + "data": "[\n {\n \"id\": 1,\n \"name\": \"Reagen Gilberthorpe\",\n \"date\": \"7/5/2022\",\n \"department\": \"Marketing\"\n },\n {\n \"id\": 2,\n \"name\": \"Haroun Lortzing\",\n \"date\": \"11/6/2022\",\n \"department\": \"Human Resources\"\n },\n {\n \"id\": 3,\n \"name\": \"Garret Kilmaster\",\n \"date\": \"11/14/2021\",\n \"department\": \"Research and Development\"\n },\n {\n \"id\": 4,\n \"name\": \"Israel Harrowsmith\",\n \"date\": \"4/3/2022\",\n \"department\": \"Training\"\n },\n {\n \"id\": 5,\n \"name\": \"Loren O'Lagen\",\n \"date\": \"9/10/2022\",\n \"department\": \"Services\"\n },\n {\n \"id\": 6,\n \"name\": \"Wallis Hothersall\",\n \"date\": \"4/18/2022\",\n \"department\": \"Accounting\"\n },\n {\n \"id\": 7,\n \"name\": \"Kaia Biskup\",\n \"date\": \"3/4/2022\",\n \"department\": \"Sales\"\n },\n {\n \"id\": 8,\n \"name\": \"Travers Saterweyte\",\n \"date\": \"1/9/2022\",\n \"department\": \"Human Resources\"\n },\n {\n \"id\": 9,\n \"name\": \"Mikey Niemetz\",\n \"date\": \"1/4/2022\",\n \"department\": \"Marketing\"\n },\n {\n \"id\": 10,\n \"name\": \"Mano Meckiff\",\n \"date\": \"2/19/2022\",\n \"department\": \"Research and Development\"\n }\n]", + "columns": [ + { + "title": "ID", + "showTitle": true, + "isCustom": false, + "dataIndex": "id", + "filterable": false, + "width": "55", + "autoWidth": "fixed", + "render": { + "compType": "text", + "comp": { + "text": "{{currentCell}}" + } + }, + "align": "left", + "fixed": "close", + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + }, + { + "title": "Name", + "showTitle": true, + "isCustom": false, + "dataIndex": "name", + "filterable": false, + "width": "200", + "autoWidth": "fixed", + "render": { + "compType": "text", + "comp": { + "text": "{{currentCell}}" + } + }, + "align": "left", + "fixed": "close", + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + }, + { + "title": "Date", + "showTitle": true, + "isCustom": false, + "dataIndex": "date", + "filterable": false, + "width": "110", + "autoWidth": "fixed", + "render": { + "compType": "text", + "comp": { + "text": "{{currentCell}}" + } + }, + "align": "left", + "fixed": "close", + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + }, + { + "title": "Department", + "showTitle": true, + "isCustom": false, + "dataIndex": "department", + "filterable": false, + "width": "250", + "autoWidth": "fixed", + "render": { + "compType": "tag", + "comp": { + "text": "{{currentCell}}", + "tagColors": { + "optionType": "manual", + "manual": { + "manual": [ + { + "label": "Tag1", + "icon": "/icon:solid/tag", + "colorType": "preset", + "presetColor": "blue", + "color": "#1890ff", + "textColor": "#ffffff", + "border": "", + "radius": "", + "margin": "", + "padding": "" + }, + { + "label": "Tag2", + "icon": "/icon:solid/tag", + "colorType": "preset", + "presetColor": "green", + "color": "#1890ff", + "textColor": "#ffffff", + "border": "", + "radius": "", + "margin": "", + "padding": "" + } + ] + }, + "mapData": { + "data": "[]", + "mapData": { + "colorType": "preset", + "presetColor": "blue", + "color": "#1890ff", + "textColor": "#ffffff", + "border": "", + "radius": "", + "margin": "", + "padding": "" + } + } + } + } + }, + "align": "left", + "fixed": "close", + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "wrap", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + } + ], + "size": "middle", + "selection": { + "mode": "single" + }, + "pagination": { + "changeablePageSize": null, + "pageSizeOptions": "[5, 10, 20, 50]" + }, + "sort": [], + "toolbar": { + "showRefresh": true, + "showDownload": true, + "position": "below", + "columnSeparator": "," + }, + "summaryRows": "1", + "hideToolbar": false, + "rowAutoHeight": "auto", + "tableAutoHeight": "auto", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "tableLite1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/text.json b/e2e/fixtures/dsl/text.json new file mode 100644 index 0000000000..b456540902 --- /dev/null +++ b/e2e/fixtures/dsl/text.json @@ -0,0 +1,132 @@ +{ + "ui": { + "layout": { + "b71b0017": { + "i": "b71b0017", + "h": 24, + "w": 6, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "b71b0017": { + "compType": "text", + "comp": { + "text": "### 👋 Hello, {{currentUser.name}}", + "autoHeight": "auto", + "type": "markdown", + "horizontalAlignment": "left", + "contentScrollBar": true, + "verticalAlignment": "center", + "margin": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "padding": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "text1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/textArea.json b/e2e/fixtures/dsl/textArea.json new file mode 100644 index 0000000000..316ec14cd4 --- /dev/null +++ b/e2e/fixtures/dsl/textArea.json @@ -0,0 +1,126 @@ +{ + "ui": { + "layout": { + "4ca780fd": { + "i": "4ca780fd", + "h": 12, + "w": 6, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "4ca780fd": { + "compType": "textArea", + "comp": { + "defaultValue": "", + "value": "", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "validationType": "Text", + "autoHeight": "fixed", + "textAreaScrollBar": false, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "textArea1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/themeriverChart.json b/e2e/fixtures/dsl/themeriverChart.json new file mode 100644 index 0000000000..9f89efe49a --- /dev/null +++ b/e2e/fixtures/dsl/themeriverChart.json @@ -0,0 +1,184 @@ +{ + "ui": { + "layout": { + "5a703e25": { + "i": "5a703e25", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "5a703e25": { + "compType": "themeriverChart", + "comp": { + "mode": "json", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "f96247ab" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "770f97c0" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsData": "[\n [\n \"2024-01\",\n 125,\n \"Smartphones\"\n ],\n [\n \"2024-02\",\n 138,\n \"Smartphones\"\n ],\n [\n \"2024-03\",\n 152,\n \"Smartphones\"\n ],\n [\n \"2024-04\",\n 167,\n \"Smartphones\"\n ],\n [\n \"2024-01\",\n 95,\n \"Laptops\"\n ],\n [\n \"2024-02\",\n 110,\n \"Laptops\"\n ],\n [\n \"2024-03\",\n 125,\n \"Laptops\"\n ],\n [\n \"2024-04\",\n 120,\n \"Laptops\"\n ],\n [\n \"2024-01\",\n 55,\n \"Tablets\"\n ],\n [\n \"2024-02\",\n 60,\n \"Tablets\"\n ],\n [\n \"2024-03\",\n 65,\n \"Tablets\"\n ],\n [\n \"2024-04\",\n 72,\n \"Tablets\"\n ],\n [\n \"2024-01\",\n 30,\n \"Wearables\"\n ],\n [\n \"2024-02\",\n 42,\n \"Wearables\"\n ],\n [\n \"2024-03\",\n 55,\n \"Wearables\"\n ],\n [\n \"2024-04\",\n 68,\n \"Wearables\"\n ]\n]", + "echartsColors": "[\n \"#5470c6\",\n \"#91cc75\",\n \"#fac858\",\n \"#ee6666\",\n \"#73c0de\",\n \"#3ba272\",\n \"#fc8452\",\n \"#9a60b4\"\n]", + "echartsOption": "{\n \"data\": [\n [\n \"2024-01\",\n 125,\n \"Smartphones\"\n ],\n [\n \"2024-02\",\n 138,\n \"Smartphones\"\n ],\n [\n \"2024-03\",\n 152,\n \"Smartphones\"\n ],\n [\n \"2024-04\",\n 167,\n \"Smartphones\"\n ],\n [\n \"2024-01\",\n 95,\n \"Laptops\"\n ],\n [\n \"2024-02\",\n 110,\n \"Laptops\"\n ],\n [\n \"2024-03\",\n 125,\n \"Laptops\"\n ],\n [\n \"2024-04\",\n 120,\n \"Laptops\"\n ],\n [\n \"2024-01\",\n 55,\n \"Tablets\"\n ],\n [\n \"2024-02\",\n 60,\n \"Tablets\"\n ],\n [\n \"2024-03\",\n 65,\n \"Tablets\"\n ],\n [\n \"2024-04\",\n 72,\n \"Tablets\"\n ],\n [\n \"2024-01\",\n 30,\n \"Wearables\"\n ],\n [\n \"2024-02\",\n 42,\n \"Wearables\"\n ],\n [\n \"2024-03\",\n 55,\n \"Wearables\"\n ],\n [\n \"2024-04\",\n 68,\n \"Wearables\"\n ]\n ],\n \"color\": [\n \"#5470c6\",\n \"#91cc75\",\n \"#fac858\",\n \"#ee6666\",\n \"#73c0de\",\n \"#3ba272\",\n \"#fc8452\",\n \"#9a60b4\"\n ]\n}", + "echartsTitle": "Themeriver Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsConfig": { + "compType": "themeriver", + "comp": {} + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "echartsLegendOrientConfig": { + "orient": "horizontal" + }, + "echartsLegendAlignConfig": { + "left": "center" + }, + "splitNumber": "4", + "left": "15", + "right": "10", + "top": "15", + "bottom": "20", + "tooltip": true, + "legendVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "themeriverChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/time.json b/e2e/fixtures/dsl/time.json new file mode 100644 index 0000000000..0b1cbb6a83 --- /dev/null +++ b/e2e/fixtures/dsl/time.json @@ -0,0 +1,128 @@ +{ + "ui": { + "layout": { + "6fd0594a": { + "i": "6fd0594a", + "h": 6, + "w": 6, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "6fd0594a": { + "compType": "time", + "comp": { + "defaultValue": "", + "value": "", + "userTimeZone": "UTC", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "placeholder": "Select Time", + "inputFormat": "HH:mm:ss", + "suffixIcon": "/icon:regular/clock", + "timeZone": "UTC", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "time1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/timeRange.json b/e2e/fixtures/dsl/timeRange.json new file mode 100644 index 0000000000..5570ddf22a --- /dev/null +++ b/e2e/fixtures/dsl/timeRange.json @@ -0,0 +1,130 @@ +{ + "ui": { + "layout": { + "3f4cd8f2": { + "i": "3f4cd8f2", + "h": 6, + "w": 9, + "x": 0, + "y": 2, + "pos": 0 + } + }, + "items": { + "3f4cd8f2": { + "compType": "timeRange", + "comp": { + "defaultStart": "", + "start": "", + "defaultEnd": "", + "end": "", + "userRangeTimeZone": "UTC", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "placeholder": "Select Time", + "inputFormat": "HH:mm:ss", + "suffixIcon": "/icon:regular/clock", + "timeZone": "UTC", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "timeRange1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/timeline.json b/e2e/fixtures/dsl/timeline.json new file mode 100644 index 0000000000..219022e2d9 --- /dev/null +++ b/e2e/fixtures/dsl/timeline.json @@ -0,0 +1,123 @@ +{ + "ui": { + "layout": { + "1ff12a75": { + "i": "1ff12a75", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "1ff12a75": { + "compType": "timeline", + "comp": { + "value": "[\n {\n \"title\": \"Majiang Releases\",\n \"subTitle\": \"Majiang Published in China\",\n \"label\": \"2022-6-10\"\n },\n {\n \"title\": \"Openblocks public release\",\n \"subTitle\": \"Openblocks open source in GitHub\",\n \"label\": \"2022-11-28\"\n },\n {\n \"title\": \"Last code submission\",\n \"subTitle\": \"Openblocks project abandoned\",\n \"dot\": \"ExclamationCircleOutlined\",\n \"label\": \"2023-3-28\",\n \"color\": \"red\",\n \"titleColor\": \"red\",\n \"subTitleColor\": \"red\",\n \"labelColor\": \"red\"\n },\n {\n \"title\": \"Lowcoder 2.0\",\n \"subTitle\": \"Lowcoder, keep moving forward\",\n \"dot\": \"LogoutOutlined\",\n \"color\": \"green\",\n \"label\": \"2023-6-20\"\n }\n]", + "mode": "alternate", + "autoHeight": "auto", + "verticalScrollbar": false, + "pending": "Continuous Improvement", + "clickedObject": { + "title": "" + }, + "clickedIndex": 0, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "timeline1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/timer.json b/e2e/fixtures/dsl/timer.json new file mode 100644 index 0000000000..7e1b0d88d7 --- /dev/null +++ b/e2e/fixtures/dsl/timer.json @@ -0,0 +1,116 @@ +{ + "ui": { + "layout": { + "c2704631": { + "i": "c2704631", + "h": 14, + "w": 6, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "c2704631": { + "compType": "timer", + "comp": { + "defaultValue": "00:00:00:000", + "timerType": "timer", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "timer1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/toast.json b/e2e/fixtures/dsl/toast.json new file mode 100644 index 0000000000..82dc730024 --- /dev/null +++ b/e2e/fixtures/dsl/toast.json @@ -0,0 +1,109 @@ +{ + "ui": { + "layout": {} + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast1" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/toggleButton.json b/e2e/fixtures/dsl/toggleButton.json new file mode 100644 index 0000000000..a544b2760a --- /dev/null +++ b/e2e/fixtures/dsl/toggleButton.json @@ -0,0 +1,123 @@ +{ + "ui": { + "layout": { + "89681405": { + "i": "89681405", + "h": 6, + "w": 3, + "x": 2, + "y": 2, + "pos": 0 + } + }, + "items": { + "89681405": { + "compType": "toggleButton", + "comp": { + "value": "", + "showText": true, + "trueText": "Hide", + "falseText": "Show", + "trueIcon": "/icon:solid/AngleUp", + "falseIcon": "/icon:solid/AngleDown", + "iconPosition": "right", + "alignment": "stretch", + "showBorder": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "toggleButton1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/tour.json b/e2e/fixtures/dsl/tour.json new file mode 100644 index 0000000000..1c5bb543c4 --- /dev/null +++ b/e2e/fixtures/dsl/tour.json @@ -0,0 +1,139 @@ +{ + "ui": { + "layout": { + "f2f2d2ff": { + "i": "f2f2d2ff", + "h": 1, + "w": 1, + "x": 3, + "y": 5, + "pos": 0 + } + }, + "items": { + "f2f2d2ff": { + "compType": "tour", + "comp": { + "open": "", + "options": { + "manual": { + "manual": [ + { + "target": "", + "title": "Welcome", + "description": "Welcome to lowcoder", + "placement": "", + "type": "" + }, + { + "target": "", + "title": "Step 2", + "description": "This is a tutorial step", + "placement": "", + "type": "" + } + ] + } + }, + "placement": "bottom", + "type": "default", + "defaultValue": "", + "value": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "tour1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/transfer.json b/e2e/fixtures/dsl/transfer.json new file mode 100644 index 0000000000..d0d4c897d4 --- /dev/null +++ b/e2e/fixtures/dsl/transfer.json @@ -0,0 +1,126 @@ +{ + "ui": { + "layout": { + "8b98c149": { + "i": "8b98c149", + "h": 50, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "8b98c149": { + "compType": "transfer", + "comp": { + "sourceTitle": "Source Data", + "targetTitle": "Target Data", + "showSearch": true, + "pageSize": "10", + "items": "[\n {\n \"key\": \"1\",\n \"title\": \"Content 1\"\n },\n {\n \"key\": \"2\",\n \"title\": \"Content 2\"\n },\n {\n \"key\": \"3\",\n \"title\": \"Content 3\"\n },\n {\n \"key\": \"4\",\n \"title\": \"Content 4\"\n },\n {\n \"key\": \"5\",\n \"title\": \"Content 5\"\n },\n {\n \"key\": \"6\",\n \"title\": \"Content 6\"\n },\n {\n \"key\": \"7\",\n \"title\": \"Content 7\"\n }\n]", + "targetKeys": "[]", + "selectedKeys": "[]", + "targetObject": "[]", + "searchInfo": [ + "", + "" + ], + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "transfer1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/tree.json b/e2e/fixtures/dsl/tree.json new file mode 100644 index 0000000000..766f9d75f1 --- /dev/null +++ b/e2e/fixtures/dsl/tree.json @@ -0,0 +1,128 @@ +{ + "ui": { + "layout": { + "12da6bd3": { + "i": "12da6bd3", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "12da6bd3": { + "compType": "tree", + "comp": { + "treeData": "[\n {\n \"label\": \"Asia\",\n \"value\": \"asia\",\n \"children\": [\n {\n \"label\": \"China\",\n \"value\": \"china\",\n \"children\": [\n {\n \"label\": \"Beijing\",\n \"value\": \"beijing\"\n },\n {\n \"label\": \"Shanghai\",\n \"value\": \"shanghai\"\n }\n ]\n },\n {\n \"label\": \"Japan\",\n \"value\": \"japan\"\n }\n ]\n },\n {\n \"label\": \"Europe\",\n \"value\": \"europe\",\n \"disabled\": true,\n \"children\": [\n {\n \"label\": \"England\",\n \"value\": \"england\"\n },\n {\n \"label\": \"France\",\n \"value\": \"france\",\n \"checkable\": false\n },\n {\n \"label\": \"Germany\",\n \"value\": \"germany\",\n \"disableCheckbox\": true\n }\n ]\n },\n {\n \"label\": \"North America\",\n \"value\": \"northAmerica\"\n }\n]", + "defaultValue": "[]", + "value": "[]", + "expanded": "[]", + "selectType": "single", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "column", + "align": "left" + }, + "autoHeight": "auto", + "verticalScrollbar": false, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "tree1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/treeChart.json b/e2e/fixtures/dsl/treeChart.json new file mode 100644 index 0000000000..11f2794c45 --- /dev/null +++ b/e2e/fixtures/dsl/treeChart.json @@ -0,0 +1,180 @@ +{ + "ui": { + "layout": { + "b47a0993": { + "i": "b47a0993", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "b47a0993": { + "compType": "treeChart", + "comp": { + "mode": "json", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "96b64459" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "2e0f424" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsData": "[\n {\n \"name\": \"Company Structure\",\n \"children\": [\n {\n \"name\": \"Executive\",\n \"children\": [\n {\n \"name\": \"CEO\",\n \"value\": 1\n },\n {\n \"name\": \"CFO\",\n \"value\": 1\n },\n {\n \"name\": \"COO\",\n \"value\": 1\n }\n ]\n },\n {\n \"name\": \"Product\",\n \"children\": [\n {\n \"name\": \"Engineering\",\n \"value\": 25\n },\n {\n \"name\": \"Design\",\n \"value\": 10\n },\n {\n \"name\": \"Product Management\",\n \"value\": 8\n }\n ]\n },\n {\n \"name\": \"Marketing\",\n \"children\": [\n {\n \"name\": \"Social Media\",\n \"value\": 5\n },\n {\n \"name\": \"Content\",\n \"value\": 7\n },\n {\n \"name\": \"Analytics\",\n \"value\": 3\n }\n ]\n }\n ]\n }\n]", + "echartsOption": "{\n \"data\": [\n {\n \"name\": \"Company Structure\",\n \"children\": [\n {\n \"name\": \"Executive\",\n \"children\": [\n {\n \"name\": \"CEO\",\n \"value\": 1\n },\n {\n \"name\": \"CFO\",\n \"value\": 1\n },\n {\n \"name\": \"COO\",\n \"value\": 1\n }\n ]\n },\n {\n \"name\": \"Product\",\n \"children\": [\n {\n \"name\": \"Engineering\",\n \"value\": 25\n },\n {\n \"name\": \"Design\",\n \"value\": 10\n },\n {\n \"name\": \"Product Management\",\n \"value\": 8\n }\n ]\n },\n {\n \"name\": \"Marketing\",\n \"children\": [\n {\n \"name\": \"Social Media\",\n \"value\": 5\n },\n {\n \"name\": \"Content\",\n \"value\": 7\n },\n {\n \"name\": \"Analytics\",\n \"value\": 3\n }\n ]\n }\n ]\n }\n ],\n \"pointColor\": \"#3498db\",\n \"lineColor\": \"#95a5a6\",\n \"label\": {\n \"show\": true,\n \"position\": \"right\",\n \"distance\": 5,\n \"fontSize\": 12,\n \"color\": \"#333\"\n },\n \"emphasis\": {\n \"focus\": \"descendant\"\n },\n \"expandAndCollapse\": true,\n \"initialTreeDepth\": 2,\n \"layout\": \"orthogonal\",\n \"orient\": \"horizontal\",\n \"symbolSize\": 10\n}", + "echartsTitle": "Tree Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsConfig": { + "compType": "tree", + "comp": {} + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "left": "20", + "right": "20", + "top": "20", + "bottom": "20", + "pointSize": "10", + "lineWidth": "2", + "edgeShape": true, + "tooltip": true, + "legendVisibility": true, + "labelVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "treeChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/treeSelect.json b/e2e/fixtures/dsl/treeSelect.json new file mode 100644 index 0000000000..8e59d6a198 --- /dev/null +++ b/e2e/fixtures/dsl/treeSelect.json @@ -0,0 +1,129 @@ +{ + "ui": { + "layout": { + "d00e6ed3": { + "i": "d00e6ed3", + "h": 5, + "w": 9, + "x": 0, + "y": 3, + "pos": 0 + } + }, + "items": { + "d00e6ed3": { + "compType": "treeSelect", + "comp": { + "treeData": "[\n {\n \"label\": \"Asia\",\n \"value\": \"asia\",\n \"children\": [\n {\n \"label\": \"China\",\n \"value\": \"china\",\n \"children\": [\n {\n \"label\": \"Beijing\",\n \"value\": \"beijing\"\n },\n {\n \"label\": \"Shanghai\",\n \"value\": \"shanghai\"\n }\n ]\n },\n {\n \"label\": \"Japan\",\n \"value\": \"japan\"\n }\n ]\n },\n {\n \"label\": \"Europe\",\n \"value\": \"europe\",\n \"disabled\": true,\n \"children\": [\n {\n \"label\": \"England\",\n \"value\": \"england\"\n },\n {\n \"label\": \"France\",\n \"value\": \"france\",\n \"checkable\": false\n },\n {\n \"label\": \"Germany\",\n \"value\": \"germany\",\n \"disableCheckbox\": true\n }\n ]\n },\n {\n \"label\": \"North America\",\n \"value\": \"northAmerica\"\n }\n]", + "defaultValue": "[]", + "value": "[]", + "expanded": "[]", + "selectType": "single", + "checkedStrategy": "parent", + "label": { + "text": "Label", + "width": "33", + "widthUnit": "%", + "position": "row", + "align": "left" + }, + "placeholder": "Please Select", + "showSearch": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "treeSelect1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/treemapChart.json b/e2e/fixtures/dsl/treemapChart.json new file mode 100644 index 0000000000..f35336cc3b --- /dev/null +++ b/e2e/fixtures/dsl/treemapChart.json @@ -0,0 +1,176 @@ +{ + "ui": { + "layout": { + "eecc9cd2": { + "i": "eecc9cd2", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "eecc9cd2": { + "compType": "treemapChart", + "comp": { + "mode": "json", + "data": "[\n {\n \"date\": \"2021-09-01\",\n \"department\": \"Administration\",\n \"spending\": 9003,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-02\",\n \"department\": \"Finance\",\n \"spending\": 3033,\n \"budget\": 4000\n },\n {\n \"date\": \"2021-09-03\",\n \"department\": \"Sales\",\n \"spending\": 9230,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-04\",\n \"department\": \"Administration\",\n \"spending\": 13032,\n \"budget\": 15000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Finance\",\n \"spending\": 2300,\n \"budget\": 5000\n },\n {\n \"date\": \"2021-09-05\",\n \"department\": \"Sales\",\n \"spending\": 7323.5,\n \"budget\": 8000\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Administration\",\n \"spending\": 13000,\n \"budget\": 16023\n },\n {\n \"date\": \"2021-09-06\",\n \"department\": \"Finance\",\n \"spending\": 3569.5,\n \"budget\": 3000\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Sales\",\n \"spending\": 10000,\n \"budget\": 9932\n },\n {\n \"date\": \"2021-09-07\",\n \"department\": \"Administration\",\n \"spending\": 18033,\n \"budget\": 20000\n },\n {\n \"date\": \"2021-09-08\",\n \"department\": \"Finance\",\n \"spending\": 4890,\n \"budget\": 4500\n },\n {\n \"date\": \"2021-09-09\",\n \"department\": \"Sales\",\n \"spending\": 9322,\n \"budget\": 8000\n }\n]", + "xAxisKey": "date", + "xAxisDirection": "horizontal", + "series": [ + { + "columnName": "spending", + "seriesName": "Spending", + "dataIndex": "8f45ef1d" + }, + { + "columnName": "budget", + "seriesName": "Budget", + "dataIndex": "368756c0" + } + ], + "xConfig": { + "type": "default" + }, + "yConfig": { + "yAxisType": "value" + }, + "legendConfig": { + "position": "bottom" + }, + "chartConfig": { + "compType": "bar", + "comp": { + "type": "basicBar" + } + }, + "echartsData": "[\n {\n \"name\": \"Company Budget\",\n \"value\": 1000,\n \"children\": [\n {\n \"name\": \"Product Development\",\n \"value\": 400,\n \"itemStyle\": {\n \"color\": \"#3498db\"\n },\n \"children\": [\n {\n \"name\": \"Engineering\",\n \"value\": 250,\n \"itemStyle\": {\n \"color\": \"#3498db\"\n }\n },\n {\n \"name\": \"Design\",\n \"value\": 80,\n \"itemStyle\": {\n \"color\": \"#5dade2\"\n }\n },\n {\n \"name\": \"Research\",\n \"value\": 70,\n \"itemStyle\": {\n \"color\": \"#85c1e9\"\n }\n }\n ]\n },\n {\n \"name\": \"Marketing\",\n \"value\": 300,\n \"itemStyle\": {\n \"color\": \"#2ecc71\"\n },\n \"children\": [\n {\n \"name\": \"Digital Advertising\",\n \"value\": 150,\n \"itemStyle\": {\n \"color\": \"#2ecc71\"\n }\n },\n {\n \"name\": \"Content Creation\",\n \"value\": 80,\n \"itemStyle\": {\n \"color\": \"#58d68d\"\n }\n },\n {\n \"name\": \"Events\",\n \"value\": 70,\n \"itemStyle\": {\n \"color\": \"#80e5a8\"\n }\n }\n ]\n },\n {\n \"name\": \"Operations\",\n \"value\": 200,\n \"itemStyle\": {\n \"color\": \"#e74c3c\"\n },\n \"children\": [\n {\n \"name\": \"Office Space\",\n \"value\": 100,\n \"itemStyle\": {\n \"color\": \"#e74c3c\"\n }\n },\n {\n \"name\": \"Equipment\",\n \"value\": 50,\n \"itemStyle\": {\n \"color\": \"#ec7063\"\n }\n },\n {\n \"name\": \"Utilities\",\n \"value\": 50,\n \"itemStyle\": {\n \"color\": \"#f1948a\"\n }\n }\n ]\n },\n {\n \"name\": \"HR\",\n \"value\": 100,\n \"itemStyle\": {\n \"color\": \"#9b59b6\"\n },\n \"children\": [\n {\n \"name\": \"Recruiting\",\n \"value\": 30,\n \"itemStyle\": {\n \"color\": \"#9b59b6\"\n }\n },\n {\n \"name\": \"Training\",\n \"value\": 40,\n \"itemStyle\": {\n \"color\": \"#af7ac5\"\n }\n },\n {\n \"name\": \"Benefits\",\n \"value\": 30,\n \"itemStyle\": {\n \"color\": \"#c39bd3\"\n }\n }\n ]\n }\n ]\n }\n]", + "echartsOption": "{\n \"data\": [\n {\n \"name\": \"Company Budget\",\n \"value\": 1000,\n \"children\": [\n {\n \"name\": \"Product Development\",\n \"value\": 400,\n \"itemStyle\": {\n \"color\": \"#3498db\"\n },\n \"children\": [\n {\n \"name\": \"Engineering\",\n \"value\": 250,\n \"itemStyle\": {\n \"color\": \"#3498db\"\n }\n },\n {\n \"name\": \"Design\",\n \"value\": 80,\n \"itemStyle\": {\n \"color\": \"#5dade2\"\n }\n },\n {\n \"name\": \"Research\",\n \"value\": 70,\n \"itemStyle\": {\n \"color\": \"#85c1e9\"\n }\n }\n ]\n },\n {\n \"name\": \"Marketing\",\n \"value\": 300,\n \"itemStyle\": {\n \"color\": \"#2ecc71\"\n },\n \"children\": [\n {\n \"name\": \"Digital Advertising\",\n \"value\": 150,\n \"itemStyle\": {\n \"color\": \"#2ecc71\"\n }\n },\n {\n \"name\": \"Content Creation\",\n \"value\": 80,\n \"itemStyle\": {\n \"color\": \"#58d68d\"\n }\n },\n {\n \"name\": \"Events\",\n \"value\": 70,\n \"itemStyle\": {\n \"color\": \"#80e5a8\"\n }\n }\n ]\n },\n {\n \"name\": \"Operations\",\n \"value\": 200,\n \"itemStyle\": {\n \"color\": \"#e74c3c\"\n },\n \"children\": [\n {\n \"name\": \"Office Space\",\n \"value\": 100,\n \"itemStyle\": {\n \"color\": \"#e74c3c\"\n }\n },\n {\n \"name\": \"Equipment\",\n \"value\": 50,\n \"itemStyle\": {\n \"color\": \"#ec7063\"\n }\n },\n {\n \"name\": \"Utilities\",\n \"value\": 50,\n \"itemStyle\": {\n \"color\": \"#f1948a\"\n }\n }\n ]\n },\n {\n \"name\": \"HR\",\n \"value\": 100,\n \"itemStyle\": {\n \"color\": \"#9b59b6\"\n },\n \"children\": [\n {\n \"name\": \"Recruiting\",\n \"value\": 30,\n \"itemStyle\": {\n \"color\": \"#9b59b6\"\n }\n },\n {\n \"name\": \"Training\",\n \"value\": 40,\n \"itemStyle\": {\n \"color\": \"#af7ac5\"\n }\n },\n {\n \"name\": \"Benefits\",\n \"value\": 30,\n \"itemStyle\": {\n \"color\": \"#c39bd3\"\n }\n }\n ]\n }\n ]\n }\n ],\n \"label\": {\n \"show\": true,\n \"formatter\": \"{b}\",\n \"fontSize\": 12,\n \"color\": \"#333\",\n \"position\": \"inside\"\n },\n \"itemStyle\": {\n \"borderColor\": \"#fff\",\n \"borderWidth\": 1,\n \"gapWidth\": 1\n },\n \"breadcrumb\": {\n \"show\": true\n },\n \"roam\": false\n}", + "echartsTitle": "Treemap Chart", + "echartsLegendConfig": { + "position": "bottom" + }, + "echartsLabelConfig": { + "position": "inside" + }, + "echartsConfig": { + "compType": "treemap", + "comp": {} + }, + "echartsTitleVerticalConfig": { + "position": "top" + }, + "echartsTitleConfig": { + "position": "center" + }, + "left": "10", + "right": "10", + "top": "20", + "bottom": "20", + "tooltip": true, + "labelVisibility": true, + "mapApiKey": "", + "mapZoomLevel": "3", + "mapCenterLng": "15.932644", + "mapCenterLat": "50.942063", + "mapOptions": "{\n \"tooltip\": {\n \"trigger\": \"item\"\n },\n \"animation\": true,\n \"series\": [\n {\n \"name\": \"Population\",\n \"type\": \"scatter\",\n \"coordinateSystem\": \"gmap\",\n \"itemStyle\": {\n \"color\": \"#00c1de\"\n },\n \"data\": [\n {\n \"name\": \"Azerbaijan\",\n \"value\": [\n 47.395,\n 40.43,\n 8352021\n ]\n },\n {\n \"name\": \"Albania\",\n \"value\": [\n 20.068,\n 41.143,\n 3153731\n ]\n },\n {\n \"name\": \"Armenia\",\n \"value\": [\n 44.563,\n 40.534,\n 3017661\n ]\n },\n {\n \"name\": \"Bosnia and Herzegovina\",\n \"value\": [\n 17.786,\n 44.169,\n 3915238\n ]\n },\n {\n \"name\": \"Bulgaria\",\n \"value\": [\n 25.231,\n 42.761,\n 7744591\n ]\n },\n {\n \"name\": \"Cyprus\",\n \"value\": [\n 33.219,\n 35.043,\n 836321\n ]\n },\n {\n \"name\": \"Denmark\",\n \"value\": [\n 9.264,\n 56.058,\n 5416945\n ]\n },\n {\n \"name\": \"Ireland\",\n \"value\": [\n -8.152,\n 53.177,\n 4143294\n ]\n },\n {\n \"name\": \"Estonia\",\n \"value\": [\n 25.793,\n 58.674,\n 1344312\n ]\n },\n {\n \"name\": \"Austria\",\n \"value\": [\n 14.912,\n 47.683,\n 8291979\n ]\n },\n {\n \"name\": \"Czech Republic\",\n \"value\": [\n 15.338,\n 49.743,\n 10191762\n ]\n },\n {\n \"name\": \"Finland\",\n \"value\": [\n 26.272,\n 64.504,\n 5246004\n ]\n },\n {\n \"name\": \"France\",\n \"value\": [\n 2.55,\n 46.565,\n 60990544\n ]\n },\n {\n \"name\": \"Georgia\",\n \"value\": [\n 43.518,\n 42.176,\n 4473409\n ]\n },\n {\n \"name\": \"Germany\",\n \"value\": [\n 9.851,\n 51.11,\n 82652369\n ]\n },\n {\n \"name\": \"Greece\",\n \"value\": [\n 21.766,\n 39.666,\n 11099737\n ]\n },\n {\n \"name\": \"Croatia\",\n \"value\": [\n 16.693,\n 45.723,\n 455149\n ]\n },\n {\n \"name\": \"Hungary\",\n \"value\": [\n 19.134,\n 47.07,\n 10086387\n ]\n },\n {\n \"name\": \"Iceland\",\n \"value\": [\n -18.48,\n 64.764,\n 295732\n ]\n },\n {\n \"name\": \"Israel\",\n \"value\": [\n 34.851,\n 31.026,\n 6692037\n ]\n },\n {\n \"name\": \"Italy\",\n \"value\": [\n 12.8,\n 42.7,\n 5864636\n ]\n },\n {\n \"name\": \"Latvia\",\n \"value\": [\n 25.641,\n 56.858,\n 2301793\n ]\n },\n {\n \"name\": \"Belarus\",\n \"value\": [\n 28.047,\n 53.54,\n 9795287\n ]\n },\n {\n \"name\": \"Lithuania\",\n \"value\": [\n 23.897,\n 55.336,\n 3425077\n ]\n },\n {\n \"name\": \"Slovakia\",\n \"value\": [\n 19.491,\n 48.707,\n 5386995\n ]\n },\n {\n \"name\": \"Liechtenstein\",\n \"value\": [\n 9.555,\n 47.153,\n 34598\n ]\n },\n {\n \"name\": \"The former Yugoslav Republic of Macedonia\",\n \"value\": [\n 21.698,\n 41.6,\n 2033655\n ]\n },\n {\n \"name\": \"Malta\",\n \"value\": [\n 14.442,\n 35.89,\n 402617\n ]\n },\n {\n \"name\": \"Belgium\",\n \"value\": [\n 4.664,\n 50.643,\n 10398049\n ]\n },\n {\n \"name\": \"Faroe Islands\",\n \"value\": [\n -6.864,\n 62.05,\n 48205\n ]\n },\n {\n \"name\": \"Andorra\",\n \"value\": [\n 1.576,\n 42.549,\n 73483\n ]\n },\n {\n \"name\": \"Luxembourg\",\n \"value\": [\n 6.088,\n 49.771,\n 456613\n ]\n },\n {\n \"name\": \"Monaco\",\n \"value\": [\n 7.412,\n 43.75,\n 325\n ]\n },\n {\n \"name\": \"Montenegro\",\n \"value\": [\n 19.254,\n 42.792,\n 607969\n ]\n },\n {\n \"name\": \"Netherlands\",\n \"value\": [\n 5.389,\n 52.077,\n 1632769\n ]\n },\n {\n \"name\": \"Norway\",\n \"value\": [\n 8.74,\n 61.152,\n 4638836\n ]\n },\n {\n \"name\": \"Poland\",\n \"value\": [\n 19.401,\n 52.125,\n 38195558\n ]\n },\n {\n \"name\": \"Portugal\",\n \"value\": [\n -8.058,\n 40.309,\n 10528226\n ]\n },\n {\n \"name\": \"Romania\",\n \"value\": [\n 24.969,\n 45.844,\n 21627557\n ]\n },\n {\n \"name\": \"Republic of Moldova\",\n \"value\": [\n 28.599,\n 47.193,\n 3876661\n ]\n },\n {\n \"name\": \"Slovenia\",\n \"value\": [\n 14.827,\n 46.124,\n 1999425\n ]\n },\n {\n \"name\": \"Spain\",\n \"value\": [\n -3.649,\n 40.227,\n 43397491\n ]\n },\n {\n \"name\": \"Sweden\",\n \"value\": [\n 15.27,\n 62.011,\n 9038049\n ]\n },\n {\n \"name\": \"Switzerland\",\n \"value\": [\n 7.908,\n 46.861,\n 7424389\n ]\n },\n {\n \"name\": \"Turkey\",\n \"value\": [\n 35.179,\n 39.061,\n 72969723\n ]\n },\n {\n \"name\": \"United Kingdom\",\n \"value\": [\n -1.6,\n 53,\n 60244834\n ]\n },\n {\n \"name\": \"Ukraine\",\n \"value\": [\n 31.388,\n 49.016,\n 46917544\n ]\n },\n {\n \"name\": \"San Marino\",\n \"value\": [\n 12.46,\n 43.942,\n 30214\n ]\n },\n {\n \"name\": \"Serbia\",\n \"value\": [\n 20.806,\n 44.032,\n 9863026\n ]\n },\n {\n \"name\": \"Holy See (Vatican City)\",\n \"value\": [\n 12.451,\n 41.904,\n 783\n ]\n },\n {\n \"name\": \"Russia\",\n \"value\": [\n 96.689,\n 61.988,\n 143953092\n ]\n }\n ],\n \"encode\": {\n \"value\": 2,\n \"lng\": 0,\n \"lat\": 1\n }\n }\n ]\n}", + "showCharts": true, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "treemapChart1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/turnstileCaptcha.json b/e2e/fixtures/dsl/turnstileCaptcha.json new file mode 100644 index 0000000000..15ddeaaab5 --- /dev/null +++ b/e2e/fixtures/dsl/turnstileCaptcha.json @@ -0,0 +1,116 @@ +{ + "ui": { + "layout": { + "45e29154": { + "i": "45e29154", + "h": 20, + "w": 7, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "45e29154": { + "compType": "turnstileCaptcha", + "comp": { + "CFToken": "", + "clientKey": "3x00000000000000000000FF", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "turnstileCaptcha1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/video.json b/e2e/fixtures/dsl/video.json new file mode 100644 index 0000000000..420d97f124 --- /dev/null +++ b/e2e/fixtures/dsl/video.json @@ -0,0 +1,118 @@ +{ + "ui": { + "layout": { + "9e7a9e5e": { + "i": "9e7a9e5e", + "h": 40, + "w": 9, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "9e7a9e5e": { + "compType": "video", + "comp": { + "src": "https://www.youtube.com/watch?v=pRpeEdMmmQ0", + "poster": "", + "currentTimeStamp": "0", + "duration": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "video1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/dsl/videocomponent.json b/e2e/fixtures/dsl/videocomponent.json new file mode 100644 index 0000000000..8b768ddc34 --- /dev/null +++ b/e2e/fixtures/dsl/videocomponent.json @@ -0,0 +1,121 @@ +{ + "ui": { + "layout": { + "54528def": { + "i": "54528def", + "h": 32, + "w": 6, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "54528def": { + "compType": "videocomponent", + "comp": { + "autoHeight": "auto", + "profilePadding": "0px", + "profileBorderRadius": "0px", + "videoAspectRatio": "1 / 1", + "userId": "{{meeting1.localUser}}", + "profileImageUrl": "https://api.dicebear.com/7.x/fun-emoji/svg?seed=Peanut&radius=50&backgroundColor=transparent&randomizeIds=true&eyes=wink,sleepClose", + "noVideoText": "", + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "videocomponent1" + } + } + }, + "refTree": { + "value": "" + }, + "hooks": [ + { + "compType": "urlParams", + "comp": {}, + "name": "url" + }, + { + "compType": "dayJsLib", + "comp": {}, + "name": "dayjs" + }, + { + "compType": "lodashJsLib", + "comp": {}, + "name": "_" + }, + { + "compType": "utils", + "comp": {}, + "name": "utils" + }, + { + "compType": "message", + "comp": {}, + "name": "message" + }, + { + "compType": "toast", + "comp": { + "title": "", + "description": "", + "type": "info", + "duration": "4.5", + "placement": "bottomRight", + "dismissible": true, + "showProgress": false, + "pauseOnHover": true, + "width": "", + "progressHeight": "" + }, + "name": "toast" + }, + { + "compType": "localStorage", + "comp": {}, + "name": "localStorage" + }, + { + "compType": "currentUser", + "comp": {}, + "name": "currentUser" + }, + { + "compType": "screenInfo", + "comp": {}, + "name": "screenInfo" + }, + { + "compType": "theme", + "comp": {}, + "name": "theme" + } + ], + "settings": { + "title": "", + "description": "", + "category": "Business", + "showHeaderInPublic": true, + "themeId": "default", + "preventAppStylesOverwriting": true, + "disableCollision": false, + "lowcoderCompVersion": "latest", + "maxWidth": { + "dropdown": "1920", + "input": 0 + }, + "gridRowCount": "Infinity", + "gridPaddingX": "0", + "gridPaddingY": "0" + }, + "preload": { + "script": "", + "css": "", + "globalCSS": "" + } +} \ No newline at end of file diff --git a/e2e/fixtures/mail/invitation.eml b/e2e/fixtures/mail/invitation.eml new file mode 100644 index 0000000000..4d73b6728f --- /dev/null +++ b/e2e/fixtures/mail/invitation.eml @@ -0,0 +1,21 @@ +Date: Sun, 22 Nov 2026 10:55:50 +0000 (UTC) +From: info@localhost +To: user@example.test +Message-ID: <1051115562.5.1795344950476@33907fb065a4> +Subject: You've been invited! +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_3_1845517189.1795344950473" + +------=_Part_3_1845517189.1795344950473 +Content-Type: multipart/related; + boundary="----=_Part_4_1783775357.1795344950474" + +------=_Part_4_1783775357.1795344950474 +Content-Type: text/html;charset=UTF-8 +Content-Transfer-Encoding: 7bit + +You have been invited to join our platform. Click here to accept the invitation: http://lowcoder-e2e-app:3000//invite/INVITECODEPLACEHOLDER000 +------=_Part_4_1783775357.1795344950474-- + +------=_Part_3_1845517189.1795344950473-- \ No newline at end of file diff --git a/e2e/fixtures/mail/password-reset.eml b/e2e/fixtures/mail/password-reset.eml new file mode 100644 index 0000000000..e54c66c094 --- /dev/null +++ b/e2e/fixtures/mail/password-reset.eml @@ -0,0 +1,21 @@ +Date: Sun, 22 Nov 2026 10:55:50 +0000 (UTC) +From: info@localhost +To: user@example.test +Message-ID: <1610215697.2.1795344950407@33907fb065a4> +Subject: Reset Your Lost Password +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_0_593773844.1795344950383" + +------=_Part_0_593773844.1795344950383 +Content-Type: multipart/related; + boundary="----=_Part_1_302257333.1795344950387" + +------=_Part_1_302257333.1795344950387 +Content-Type: text/html;charset=UTF-8 +Content-Transfer-Encoding: 7bit + +

Hi, user@example.test
Here is the link to reset your password: http://lowcoder-e2e-app:3000//user/auth/lost-password?token=TOKEN%3CPLACEHOLDER%24
Please note that the link will expire after 12 hours.

+------=_Part_1_302257333.1795344950387-- + +------=_Part_0_593773844.1795344950383-- \ No newline at end of file diff --git a/e2e/fixtures/sql/init.sql b/e2e/fixtures/sql/init.sql new file mode 100644 index 0000000000..1b51fc740c --- /dev/null +++ b/e2e/fixtures/sql/init.sql @@ -0,0 +1,16 @@ +-- Data of the PostgreSQL sidecar the data source tests read. +CREATE TABLE items (id integer PRIMARY KEY, name text NOT NULL); +INSERT INTO items (id, name) VALUES (1, 'alpha'), (2, 'beta'); + +-- Read-only rows for the table, chart and list scenarios (paging, sorting, filtering). No test writes them. +-- 25 rows: `name` product-01 ... product-25; `category` cycles tools/books/games (tools 8, books 9, games 8); +-- `stock` is id * 3 % 17, so the first five rows hold 3, 6, 9, 12, 15. Must equal PRODUCTS in e2e/src/constants.ts. +CREATE TABLE products (id integer PRIMARY KEY, name text NOT NULL, category text NOT NULL, price numeric(10, 2) NOT NULL, stock integer NOT NULL); +INSERT INTO products (id, name, category, price, stock) +SELECT g, 'product-' || lpad(g::text, 2, '0'), (ARRAY['tools','books','games'])[1 + g % 3], (g * 7 % 50) + 0.99, g * 3 % 17 +FROM generate_series(1, 25) AS g; + +-- Rows the write tests insert, update and delete. Every test writes only rows with its own `owner` value, so tests +-- running in parallel never see each other's rows. +CREATE TABLE notes (id serial PRIMARY KEY, owner text NOT NULL, body text NOT NULL); +CREATE INDEX notes_owner_idx ON notes (owner); diff --git a/e2e/package-lock.json b/e2e/package-lock.json new file mode 100644 index 0000000000..36398ce216 --- /dev/null +++ b/e2e/package-lock.json @@ -0,0 +1,91 @@ +{ + "name": "lowcoder-e2e", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "lowcoder-e2e", + "devDependencies": { + "@playwright/test": "1.64.0", + "@types/node": "^22.10.0", + "typescript": "^5.6.0" + } + }, + "node_modules/@playwright/test": { + "version": "1.64.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.64.0.tgz", + "integrity": "sha512-oTN9FNYuN6bqQMwiho6jJKLCG2/QOYCixGXuCjRmzOq23eODeukuY2XiAVoVpAECbuezMt1MHQjAiQxK8F+Y+g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.64.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@types/node": { + "version": "22.20.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz", + "integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/playwright": { + "version": "1.64.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.64.0.tgz", + "integrity": "sha512-kVzTnYFYEyQ9RGzBjNCd2+yEqWmVbxl3AHPynv3qQ6JTjv4a+kwRcnqQwIpuP3NnrnIrE/Q6wWAIAvMfIE2/Yg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.64.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/playwright-core": { + "version": "1.64.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.0.tgz", + "integrity": "sha512-T9r+MZkTECl2+oUcZ26YgZzTrYidTsIhYYkJix+6iDOymOb1FB2RLLSOxRGnZGv5DStt+aduIVbt+E8WygXYpg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/e2e/package.json b/e2e/package.json new file mode 100644 index 0000000000..487b27fe57 --- /dev/null +++ b/e2e/package.json @@ -0,0 +1,17 @@ +{ + "name": "lowcoder-e2e", + "private": true, + "description": "End-to-end tests of the Lowcoder all-in-one image, run with Playwright from scripts/run-in-docker.sh", + "scripts": { + "test": "playwright test", + "test:smoke": "playwright test --grep @smoke", + "test:core": "playwright test --grep @core", + "report": "playwright show-report", + "typecheck": "tsc --noEmit" + }, + "devDependencies": { + "@playwright/test": "1.64.0", + "@types/node": "^22.10.0", + "typescript": "^5.6.0" + } +} diff --git a/e2e/playwright.config.ts b/e2e/playwright.config.ts new file mode 100644 index 0000000000..ffc2417d61 --- /dev/null +++ b/e2e/playwright.config.ts @@ -0,0 +1,60 @@ +import { defineConfig, devices } from "@playwright/test"; +import { grepFor, grepInvertFor, runFlagsFromEnv } from "./src/run-selection"; + +/** Origin of the Lowcoder instance under test. The run script sets it to the app container on the Docker network. */ +const BASE_URL = process.env.LOWCODER_BASE_URL; +if (!BASE_URL) { + throw new Error("LOWCODER_BASE_URL is not set. Run the suite through e2e/scripts/run-in-docker.sh."); +} + +const IS_CI = !!process.env.CI; +const TEST_TIMEOUT_MS = 60_000; +const EXPECT_TIMEOUT_MS = 15_000; +/** The insert panel and the canvas fit without scrolling at this size. */ +const VIEWPORT = { width: 1600, height: 1000 }; +const CI_RETRIES = 1; +/** + * Parallel workers. Four is what the editor's save race was measured with; with many more the machine is loaded so + * much that tests become slow and time out. + */ +const DEFAULT_WORKERS = 4; + +/** + * Tests tagged @quarantine (known defects), @insert-all (the 112-test insert smoke test) and @superadmin (the instance + * super admin tests) run only on request, each with its own variable, E2E_INCLUDE_QUARANTINE, E2E_INCLUDE_INSERT_ALL and + * E2E_INCLUDE_SUPERADMIN; see src/run-selection.ts. + */ +const RUN_FLAGS_OF_ENV = runFlagsFromEnv(process.env); +const GREP_INVERT = grepInvertFor(RUN_FLAGS_OF_ENV); +/** On the enterprise stack (E2E_STACK_PROFILE=enterprise) only the @enterprise tests run; on the default stack none of them does. */ +const GREP = grepFor(RUN_FLAGS_OF_ENV); + +export default defineConfig({ + testDir: "./tests", + outputDir: "./test-results", + fullyParallel: true, + grep: GREP, + grepInvert: GREP_INVERT, + workers: Number(process.env.E2E_WORKERS || DEFAULT_WORKERS), + forbidOnly: IS_CI, + retries: IS_CI ? CI_RETRIES : 0, + timeout: TEST_TIMEOUT_MS, + expect: { timeout: EXPECT_TIMEOUT_MS }, + reporter: [ + ["list"], + ["html", { outputFolder: "./playwright-report", open: "never" }], + ["junit", { outputFile: "./test-results/junit.xml" }], + // Fails the run when more than half of the tests of S1 or M3 needed a D-3 retry. + ["./src/reporters/d3-threshold-reporter.ts"], + ], + use: { + baseURL: BASE_URL, + // With service workers blocked, every request of the page goes through the context route of the network guard. + serviceWorkers: "block", + trace: "retain-on-failure", + video: "retain-on-failure", + screenshot: "only-on-failure", + viewport: VIEWPORT, + }, + projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"], viewport: VIEWPORT } }], +}); diff --git a/e2e/scripts/app-host.sh b/e2e/scripts/app-host.sh new file mode 100644 index 0000000000..64e5a861a0 --- /dev/null +++ b/e2e/scripts/app-host.sh @@ -0,0 +1,9 @@ +# Sourced by run-in-docker.sh and build-e2e-image.sh. +# +# The host name under which the tests reach the application, and which the test image's client uses for its hocuspocus +# WebSocket (REACT_APP_HOCUSPOCUS_URL, baked in when the client is built). The app container gets it as a network +# alias in the run's own Docker network, so two runs at once do not share it. The network guard compares the host of +# every WebSocket with the host of LOWCODER_BASE_URL (e2e/src/fixtures.ts), so both must use this name. +readonly E2E_APP_HOST="lowcoder-e2e-app" +readonly E2E_APP_PORT=3000 +readonly E2E_HOCUSPOCUS_PATH="/hocuspocus" diff --git a/e2e/scripts/build-e2e-image.sh b/e2e/scripts/build-e2e-image.sh new file mode 100755 index 0000000000..ad0203578a --- /dev/null +++ b/e2e/scripts/build-e2e-image.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +## +## Builds the image the end-to-end tests run against: the published 3.0.0 all-in-one image with its web client +## replaced by the client of the 3.0.0 release plus the testability hooks in e2e/client-hooks.patch. The tests need +## those hooks (the editor-ready attribute, the test ids of the insert panel, the tab roles, the component name on +## canvas items), which the released client does not have. Nothing else of the client differs from 3.0.0, so defects +## found with this image are those of 3.0.0. +## +## Usage (from any directory): +## e2e/scripts/build-e2e-image.sh +## +## Environment: +## BASE_IMAGE image to start from (default lowcoderorg/lowcoder-ce:3.0.0) +## TARGET_IMAGE image to create (default lowcoderorg/lowcoder-ce:3.0.0-e2e, the default of run-in-docker.sh) +## CLIENT_REF git ref whose client/ is built (default 3.0.0, the release tag; it must exist locally) +## +## Steps: export client/ of CLIENT_REF with `git archive` to a temporary directory, apply e2e/client-hooks.patch, run +## `yarn --immutable && yarn build` there in a node container (the Dockerfile's client build stage, same node image +## and build arguments), then `docker build` a layer that replaces /lowcoder/client of the base image with the built +## client. Takes several minutes. +## +## The client is built with REACT_APP_HOCUSPOCUS_URL=ws://$E2E_APP_HOST:$E2E_APP_PORT/hocuspocus (app-host.sh), so the chat +## components reach the hocuspocus server of the image through the app's own nginx. That host name exists only inside the +## network of a run-in-docker.sh run; in a browser opened through E2E_HOST_PORT the chat components cannot connect. +## +## Not covered: the server (api-service, node-service) stays the one of the base image, and so do the components +## (client-comps), the SDK and the embed bundle; only the main client (packages/lowcoder) is replaced. The patch has +## to apply to CLIENT_REF; for another ref it may need regenerating. +## + +set -euo pipefail + +# shellcheck source=app-host.sh +source "$(dirname "${BASH_SOURCE[0]}")/app-host.sh" +readonly DEFAULT_BASE_IMAGE="lowcoderorg/lowcoder-ce:3.0.0" +readonly DEFAULT_TARGET_IMAGE="lowcoderorg/lowcoder-ce:3.0.0-e2e" +readonly BASE_IMAGE="${BASE_IMAGE:-$DEFAULT_BASE_IMAGE}" +readonly TARGET_IMAGE="${TARGET_IMAGE:-$DEFAULT_TARGET_IMAGE}" +# Same as the build-client stage of deploy/docker/Dockerfile +readonly CLIENT_REF="${CLIENT_REF:-3.0.0}" +readonly NODE_IMAGE="node:22.23-slim" +readonly NODE_MAX_OLD_SPACE_MB=12288 +# Owner of /lowcoder/client in the image (user lowcoder, group lowcoder) +readonly CLIENT_OWNER="9001:9001" +readonly CLIENT_BUILD_SUBDIR="packages/lowcoder/build" + +readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +readonly REPO_DIR="$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel)" +readonly HOOKS_PATCH="$SCRIPT_DIR/../client-hooks.patch" +readonly WORK_DIR="$(mktemp -d)" +readonly BUILD_CONTAINER="lowcoder-e2e-image-$$" + +log() { + echo "[$(date +%H:%M:%S)] $*" +} + +cleanup() { + docker rm -f "$BUILD_CONTAINER" > /dev/null 2>&1 || true + # The build container runs as root; hand the files back so they can be removed + docker run --rm -v "$WORK_DIR":/work "$NODE_IMAGE" chown -R "$(id -u):$(id -g)" /work > /dev/null 2>&1 || true + rm -rf "$WORK_DIR" +} +trap cleanup EXIT + +log "Exporting client/ of $CLIENT_REF and applying $HOOKS_PATCH" +git -C "$REPO_DIR" archive "$CLIENT_REF" client | tar -C "$WORK_DIR" -xf - +patch -p1 -d "$WORK_DIR" < "$HOOKS_PATCH" + +log "Building the client with $NODE_IMAGE (several minutes)" +docker run --rm --name "$BUILD_CONTAINER" -v "$WORK_DIR/client":/lowcoder-client -w /lowcoder-client \ + -e REACT_APP_COMMIT_ID=test -e REACT_APP_ENV=production -e REACT_APP_EDITION=community \ + -e HOST_OWNER="$(id -u):$(id -g)" -e REACT_APP_DISABLE_JS_SANDBOX=true -e REACT_APP_HOCUSPOCUS_URL="ws://${E2E_APP_HOST}:${E2E_APP_PORT}${E2E_HOCUSPOCUS_PATH}" -e NODE_OPTIONS="--max-old-space-size=${NODE_MAX_OLD_SPACE_MB}" \ + "$NODE_IMAGE" sh -c 'apt-get update > /dev/null && apt-get install -y --no-install-recommends curl ca-certificates > /dev/null && yarn --immutable && yarn build; status=$?; chown -R "$HOST_OWNER" /lowcoder-client; exit $status' + +[ -f "$WORK_DIR/client/$CLIENT_BUILD_SUBDIR/index.html" ] || { echo "ERROR: the build produced no index.html" >&2; exit 1; } + +log "Building $TARGET_IMAGE from $BASE_IMAGE" +mkdir -p "$WORK_DIR/context" +mv "$WORK_DIR/client/$CLIENT_BUILD_SUBDIR" "$WORK_DIR/context/client" +docker build -t "$TARGET_IMAGE" -f - "$WORK_DIR/context" </t/` and then + * reads back what arrived. + * + * - Every request except `/__e2e/*` is recorded as { method, path, headers, body } and answered 200 with `{}` (JSON). + * `path` includes the query string. The body is UTF-8 text cut at MAX_BODY_BYTES; at most MAX_RECORDS records are kept + * (the oldest are dropped). + * - GET /__e2e/health answers `ok`. + * - GET /__e2e/requests?prefix=

answers the records whose path starts with

, as a JSON array. + * - POST /__e2e/answers { prefix, status, contentType, body } stores a canned answer: a request (any method) whose path starts with + * `prefix` is still recorded and then gets that status, content type and body instead of `{}`. One entry per prefix (the latest wins), + * the longest matching prefix answers, at most MAX_RECORDS entries are kept (the oldest are dropped). The control answer is 204; an + * invalid entry (prefix not starting with "/", status outside 100-599, a non-string body or content type, body over MAX_BODY_BYTES) is 400. + * Every other path keeps the `{}` answer, so the outbound tests are unaffected. + * + * It is also the run's mail sink: a minimal SMTP listener on MAIL_PORT (default 2525) accepts every message the SERVER + * sends (password reset, invitation) and delivers it nowhere. + * - One record per message: { from, to: string[], data } with `data` the message bytes as latin1 text (so a consumer decodes + * the transfer encoding and charset itself), dot-stuffing undone; the cap of MAX_BODY_BYTES counts the bytes as SENT (before + * dot-stuffing is undone), so a cut message with many dot-prefixed lines holds somewhat fewer decoded bytes; at most MAX_RECORDS are kept. + * - GET /__e2e/mails?to=

answers the messages with that recipient (case-insensitive), as a JSON array. + * - Supported commands: EHLO, HELO, MAIL FROM, RCPT TO, DATA, RSET, NOOP, QUIT; no STARTTLS, no AUTH, no PIPELINING advertised + * (a pipelining client is still answered in order). Parsing is stream-safe: command lines and the end of data may be split + * over any number of TCP chunks; a message past MAX_BODY_BYTES is drained, not stored, and still answered 250. + * + * Limits: the records live in memory and die with the container (nothing is written to disk); the server makes no request of + * its own and has no dependency; it answers every other request, whatever the method, with the same `{}`, so it cannot + * tell a test's request from a stray one except by the path prefix. + */ + +const http = require("node:http"); +const net = require("node:net"); + +const PORT = Number(process.env.ECHO_PORT || 8080); +const MAX_BODY_BYTES = 65536; +const MAX_RECORDS = 10000; +const CONTROL_PREFIX = "/__e2e/"; +const HEALTH_PATH = "/__e2e/health"; +const REQUESTS_PATH = "/__e2e/requests"; +const MAILS_PATH = "/__e2e/mails"; +const ANSWERS_PATH = "/__e2e/answers"; +const STATUS_NO_CONTENT = 204; +const STATUS_BAD_REQUEST = 400; +const MIN_HTTP_STATUS = 100; +const MAX_HTTP_STATUS = 599; +const STATUS_OK = 200; +const STATUS_NOT_FOUND = 404; +const MAIL_PORT = Number(process.env.MAIL_PORT || 2525); +/** RFC 5321 4.5.3.1.4: a command line is at most 512 bytes including CRLF. */ +const MAX_COMMAND_LINE_BYTES = 512; +const CRLF = Buffer.from("\r\n", "latin1"); +const DATA_TERMINATOR = Buffer.from("\r\n.\r\n", "latin1"); +/** Bytes held back while draining a message, so a terminator split across chunks is still found. */ +const TERMINATOR_HOLD_BACK_BYTES = DATA_TERMINATOR.length - 1; + +/** @type {{ method: string, path: string, headers: Record, body: string }[]} */ +const records = []; +/** @type {{ from: string, to: string[], data: string }[]} */ +const mails = []; +/** @type {Map} canned answers by path prefix, oldest first */ +const answers = new Map(); + +function send(response, status, contentType, text) { + response.writeHead(status, { "content-type": contentType }); + response.end(text); +} + +/** Validates and stores one canned answer; returns whether it was valid. */ +function storeAnswer(text) { + let entry; + try { + entry = JSON.parse(text); + } catch { + return false; + } + const valid = + entry !== null && + typeof entry === "object" && + typeof entry.prefix === "string" && + entry.prefix.startsWith("/") && + Number.isInteger(entry.status) && + entry.status >= MIN_HTTP_STATUS && + entry.status <= MAX_HTTP_STATUS && + typeof entry.contentType === "string" && + typeof entry.body === "string" && + Buffer.byteLength(entry.body) <= MAX_BODY_BYTES; + if (!valid) { + return false; + } + answers.delete(entry.prefix); + answers.set(entry.prefix, { status: entry.status, contentType: entry.contentType, body: entry.body }); + if (answers.size > MAX_RECORDS) { + answers.delete(answers.keys().next().value); + } + return true; +} + +/** The canned answer of the longest stored prefix of a path (the query string is ignored), or undefined. */ +function cannedAnswerFor(path) { + const pathname = path.split("?")[0]; + let best; + for (const [prefix, answer] of answers) { + if (pathname.startsWith(prefix) && (best === undefined || prefix.length > best.prefix.length)) { + best = { prefix, answer }; + } + } + return best?.answer; +} + +function handleControl(request, response) { + const url = new URL(request.url, "http://echo.invalid"); + if (request.method === "POST" && url.pathname === ANSWERS_PATH) { + const chunks = []; + request.on("data", (chunk) => chunks.push(chunk)); + request.on("end", () => { + if (storeAnswer(Buffer.concat(chunks).toString("utf8"))) { + response.writeHead(STATUS_NO_CONTENT).end(); + } else { + send(response, STATUS_BAD_REQUEST, "text/plain", "invalid canned answer"); + } + }); + return; + } + if (request.method === "GET" && url.pathname === HEALTH_PATH) { + return send(response, STATUS_OK, "text/plain", "ok"); + } + if (request.method === "GET" && url.pathname === REQUESTS_PATH) { + const prefix = url.searchParams.get("prefix") ?? ""; + return send( + response, + STATUS_OK, + "application/json", + JSON.stringify(records.filter((record) => record.path.startsWith(prefix))), + ); + } + if (request.method === "GET" && url.pathname === MAILS_PATH) { + const to = (url.searchParams.get("to") ?? "").toLowerCase(); + return send( + response, + STATUS_OK, + "application/json", + JSON.stringify(mails.filter((mail) => mail.to.some((recipient) => recipient.toLowerCase() === to))), + ); + } + return send(response, STATUS_NOT_FOUND, "text/plain", "unknown control path"); +} + +function handleRecorded(request, response) { + const chunks = []; + let size = 0; + request.on("data", (chunk) => { + if (size < MAX_BODY_BYTES) { + chunks.push(chunk); + size += chunk.length; + } + }); + request.on("end", () => { + const body = Buffer.concat(chunks).subarray(0, MAX_BODY_BYTES).toString("utf8"); + records.push({ method: request.method, path: request.url, headers: request.headers, body }); + if (records.length > MAX_RECORDS) { + records.splice(0, records.length - MAX_RECORDS); + } + const canned = cannedAnswerFor(request.url); + if (canned) { + return send(response, canned.status, canned.contentType, canned.body); + } + send(response, STATUS_OK, "application/json", "{}"); + }); +} + +http + .createServer((request, response) => { + if (request.url.startsWith(CONTROL_PREFIX)) { + return handleControl(request, response); + } + return handleRecorded(request, response); + }) + .listen(PORT, "0.0.0.0", () => console.log(`echo server listening on ${PORT}`)); + +/** The address of `MAIL FROM:` / `RCPT TO:` (the text between the angle brackets, or the rest of the line). */ +function addressOf(argument) { + const match = /<([^>]*)>/.exec(argument); + return (match ? match[1] : argument.replace(/^[^:]*:/, "")).trim(); +} + +/** One SMTP connection: a state machine over a per-connection buffer, so TCP chunk boundaries never decide anything. */ +function handleSmtpConnection(socket) { + let buffer = Buffer.alloc(0); + let inData = false; + let from = ""; + let recipients = []; + let stored = []; + let storedBytes = 0; + /** The virtual leading CRLF is stored too, so the limit leaves room for it (it is stripped before the data is cut to MAX_BODY_BYTES). */ + const STORED_BYTES_LIMIT = MAX_BODY_BYTES + CRLF.length; + + const reply = (text) => socket.write(`${text}\r\n`); + const resetEnvelope = () => { + from = ""; + recipients = []; + }; + + /** Keeps the first MAX_BODY_BYTES of the message and drops the rest (the message is still drained). */ + const store = (bytes) => { + if (storedBytes >= STORED_BYTES_LIMIT) { + return; + } + const room = STORED_BYTES_LIMIT - storedBytes; + const part = bytes.subarray(0, room); + stored.push(part); + storedBytes += part.length; + }; + + const finishMessage = () => { + // The data started after a virtual CRLF (so a message that opens with the terminator is found): drop it, undo dot-stuffing. + const data = Buffer.concat(stored).toString("latin1").replace(/\r\n\.\./g, "\r\n.").replace(/^\r\n/, "").slice(0, MAX_BODY_BYTES); + mails.push({ from, to: recipients, data }); + if (mails.length > MAX_RECORDS) { + mails.splice(0, mails.length - MAX_RECORDS); + } + stored = []; + storedBytes = 0; + inData = false; + resetEnvelope(); + reply("250 message accepted"); + }; + + const handleCommand = (line) => { + const [verb, ...rest] = line.trim().split(" "); + const argument = rest.join(" "); + switch (verb.toUpperCase()) { + case "EHLO": + case "HELO": + return reply("250 e2e-mail"); + case "MAIL": + resetEnvelope(); + from = addressOf(argument); + return reply("250 ok"); + case "RCPT": + recipients.push(addressOf(argument)); + return reply("250 ok"); + case "DATA": + if (recipients.length === 0) { + return reply("503 need RCPT first"); + } + inData = true; + stored = []; + storedBytes = 0; + buffer = Buffer.concat([CRLF, buffer]); // the virtual CRLF before the first data line + return reply("354 end data with ."); + case "RSET": + resetEnvelope(); + return reply("250 ok"); + case "NOOP": + return reply("250 ok"); + case "QUIT": + reply("221 bye"); + return socket.end(); + default: + return reply("502 command not implemented"); + } + }; + + /** Consumes the buffer as far as it holds complete input. */ + const drain = () => { + for (;;) { + if (socket.destroyed || socket.writableEnded) { + return; + } + if (inData) { + const end = buffer.indexOf(DATA_TERMINATOR); + if (end >= 0) { + store(buffer.subarray(0, end)); + buffer = buffer.subarray(end + DATA_TERMINATOR.length); + finishMessage(); + continue; + } + const keep = Math.min(TERMINATOR_HOLD_BACK_BYTES, buffer.length); + store(buffer.subarray(0, buffer.length - keep)); + buffer = buffer.subarray(buffer.length - keep); + return; + } + const lineEnd = buffer.indexOf(CRLF); + if (lineEnd < 0) { + if (buffer.length > MAX_COMMAND_LINE_BYTES) { + reply("500 line too long"); + socket.end(); + } + return; + } + if (lineEnd + CRLF.length > MAX_COMMAND_LINE_BYTES) { + reply("500 line too long"); + socket.end(); + return; + } + const line = buffer.subarray(0, lineEnd).toString("latin1"); + buffer = buffer.subarray(lineEnd + CRLF.length); + handleCommand(line); + } + }; + + socket.on("data", (chunk) => { + buffer = Buffer.concat([buffer, chunk]); + drain(); + }); + socket.on("error", () => socket.destroy()); + reply("220 e2e-mail ready"); +} + +net.createServer(handleSmtpConnection).listen(MAIL_PORT, "0.0.0.0", () => console.log(`mail sink listening on ${MAIL_PORT}`)); diff --git a/e2e/scripts/run-in-docker.sh b/e2e/scripts/run-in-docker.sh new file mode 100755 index 0000000000..80f494078d --- /dev/null +++ b/e2e/scripts/run-in-docker.sh @@ -0,0 +1,315 @@ +#!/bin/bash + +## +## Runs the Lowcoder end-to-end tests (Playwright) against a fresh all-in-one container. +## +## Starts the all-in-one image on its own Docker network, waits until the API answers, runs the tests from the +## official Playwright image on the same network (the app is reachable by its container name), and removes +## the container and the network when it ends, however it ends. +## +## Usage (from any directory): +## e2e/scripts/run-in-docker.sh [playwright test arguments] +## e2e/scripts/run-in-docker.sh --grep @smoke +## e2e/scripts/run-in-docker.sh --repeat-each=10 --workers=4 +## +## Environment: +## LOWCODER_E2E_IMAGE image under test (default lowcoderorg/lowcoder-ce:3.0.0-e2e, made by +## e2e/scripts/build-e2e-image.sh: the 3.0.0 image with the client of this checkout; the +## tests need the hooks of that client, so a release image without them fails) +## PLAYWRIGHT_IMAGE runner image; its version must equal @playwright/test in e2e/package-lock.json +## (default mcr.microsoft.com/playwright:v1.64.0-noble) +## E2E_INCLUDE_QUARANTINE set to 1 to also run the @quarantine tests (they expose known defects) +## E2E_INCLUDE_INSERT_ALL set to 1 to also run the @insert-all tests (S1, the insert-every-component smoke test, 112 +## tests); independent of E2E_INCLUDE_QUARANTINE. Nightly: E2E_INCLUDE_INSERT_ALL=1 $0 --grep @insert-all +## E2E_INCLUDE_SUPERADMIN set to 1 to also run the @superadmin tests (SEC-R16a to SEC-R16d, the instance super admin; +## independent of the other flags; SEC-R16c and SEC-R16d also carry @quarantine and then need +## E2E_INCLUDE_QUARANTINE=1 too). Run: E2E_INCLUDE_SUPERADMIN=1 $0 --grep @superadmin +## E2E_STACK_PROFILE which stack to start: `default` (the all-in-one image in its SAAS workspace mode; the default) or +## `enterprise` (the same image with LOWCODER_WORKSPACE_MODE=ENTERPRISE: one workspace shared by every +## user; it runs only the @enterprise tests, SEC-E01 to SEC-E04, E06a, E06b) or `signup-disabled` (the same +## image with LOWCODER_EMAIL_SIGNUP_ENABLED=false: nobody may sign up with e-mail; it runs only the +## @signup-disabled tests, LC-AU20 to AU24, because every fixture that makes a user signs up). Any other value +## is an error. +## A --grep of the command line narrows the profile's own selection further (measured, Playwright 1.64: +## it does not replace it). Gate: E2E_STACK_PROFILE=enterprise $0 --repeat-each=10 --workers=4 tests/security/enterprise.spec.ts +## E2E_INCLUDE_ENTERPRISE_TAKEOVER set to 1, with E2E_STACK_PROFILE=enterprise (any other profile is an error), to run SEC-E05 +## ALONE (no other test of the run): it resets the super admin's password, so it needs a stack of its own. +## It is quarantined, so it needs E2E_INCLUDE_QUARANTINE=1 as well: +## E2E_INCLUDE_QUARANTINE=1 E2E_INCLUDE_ENTERPRISE_TAKEOVER=1 E2E_STACK_PROFILE=enterprise $0 +## POSTGRES_IMAGE PostgreSQL sidecar for the data source tests (pinned by digest) +## E2E_HOST_PORT also publish the app on 127.0.0.1: to look at it in a browser while the run lasts +## +## Set by the script for each run (a value of the caller is overwritten; the password is new every run, never printed, +## never on a command line: both containers get it through Docker's name-only `-e NAME` form): +## E2E_SUPERUSER_USERNAME, E2E_SUPERUSER_PASSWORD the instance super admin of the stack (the app gets them as +## LOWCODER_SUPERUSER_USERNAME / LOWCODER_SUPERUSER_PASSWORD); read by the `superAdmin` fixture +## of e2e/src/fixtures.ts. Keep `set -x` off in this script. +## +## One run per checkout at a time (a lock on e2e/.run.lock; needs flock, on macOS `brew install flock`). +## +## Results: e2e/playwright-report (HTML), e2e/test-results (JUnit, traces, videos, screenshots of failures). +## Exit code: the one of `playwright test`; non-zero when the app does not start or the versions differ. +## +## One-off, after changing e2e/package.json: regenerate the lockfile inside the runner image +## docker run --rm --user "$(id -u):$(id -g)" -e HOME=/tmp -v "$PWD/e2e":/work -w /work \ +## mcr.microsoft.com/playwright:v1.64.0-noble npm install --no-audit --no-fund +## +## Also starts a PostgreSQL sidecar with the data of fixtures/sql/init.sql; the tests reach it by container name +## (the name is passed as E2E_POSTGRES_HOST). +## +## Also starts an HTTP echo sidecar (scripts/echo-server.js, on the already pinned runner image, no extra download) under the +## alias e2e-echo: the target of the requests the SERVER makes inside the app container (npm registry proxy, n8n plugin). +## It records every request in memory and serves them back per path prefix; it dies with the run. The runner gets its +## address as E2E_ECHO_URL. Nothing is sent to the internet by it. The app and runner containers resolve the alias through +## `--add-host e2e-echo:`, not through DNS: should the sidecar die, the name still points at that +## private address and the request fails locally (refused or unreachable) instead of the name resolving on an external resolver. +## +## Not covered: Firefox and WebKit (only Chromium runs), the multi-container compose setup, databases other than +## PostgreSQL. +## + +set -euo pipefail + +readonly DEFAULT_APP_IMAGE="lowcoderorg/lowcoder-ce:3.0.0-e2e" +readonly DEFAULT_PLAYWRIGHT_IMAGE="mcr.microsoft.com/playwright:v1.64.0-noble" +readonly APP_IMAGE="${LOWCODER_E2E_IMAGE:-$DEFAULT_APP_IMAGE}" +readonly PLAYWRIGHT_IMAGE="${PLAYWRIGHT_IMAGE:-$DEFAULT_PLAYWRIGHT_IMAGE}" + +readonly DEFAULT_POSTGRES_IMAGE="postgres:17-alpine@sha256:778d0b486d6daa02b77434d0358ec57a1b21fd8b6d22ac2eef56a33e816928f6" +readonly POSTGRES_IMAGE="${POSTGRES_IMAGE:-$DEFAULT_POSTGRES_IMAGE}" +# Must equal POSTGRES in e2e/src/constants.ts +readonly POSTGRES_DATABASE="shop" +readonly POSTGRES_USER="postgres" +readonly POSTGRES_PASSWORD="e2e-postgres-password" +# The instance super admin of the throw-away stack; the domain equals TEST_EMAIL_DOMAIN in e2e/src/constants.ts; the suite +# reads the name from E2E_SUPERUSER_USERNAME (SUPER_ADMIN_ENV). The password is generated per run (generate_superuser_password). +readonly SUPERUSER_USERNAME="e2e-superadmin@example.test" +readonly SUPERUSER_PASSWORD_BYTES=18 + +# Stack profiles (the values equal STACK_PROFILES in e2e/src/constants.ts). There is no compose file: the profile is this +# variable, and the enterprise one only adds the workspace mode to the app container. +readonly DEFAULT_PROFILE="default" +readonly ENTERPRISE_PROFILE="enterprise" +readonly ENTERPRISE_WORKSPACE_MODE="ENTERPRISE" +readonly SIGNUP_DISABLED_PROFILE="signup-disabled" +readonly STACK_PROFILE="${E2E_STACK_PROFILE:-$DEFAULT_PROFILE}" + +# shellcheck source=app-host.sh +source "$(dirname "${BASH_SOURCE[0]}")/app-host.sh" +readonly APP_PORT="$E2E_APP_PORT" +readonly READY_PATH="/api/configs" +# Seconds to wait for the app to answer, and between two checks +readonly STARTUP_TIMEOUT=300 +readonly POLL_INTERVAL=2 +readonly LOG_TAIL_LINES=60 + +readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +readonly E2E_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +readonly LOCKFILE="$E2E_DIR/package-lock.json" + +readonly NAME_PREFIX="lowcoder-e2e-$$" +readonly NETWORK="${NAME_PREFIX}-net" +readonly APP_CONTAINER="${NAME_PREFIX}-app" +readonly POSTGRES_CONTAINER="${NAME_PREFIX}-pg" +readonly RUNNER_CONTAINER="${NAME_PREFIX}-runner" +readonly ECHO_CONTAINER="${NAME_PREFIX}-echo" +# The alias and port the app container and the runner use; E2E_ECHO_URL below is built from them (the suite reads it by ECHO_ENV in e2e/src/constants.ts) +readonly ECHO_ALIAS="e2e-echo" +readonly ECHO_PORT=8080 +# The echo sidecar is also the mail sink: the app sends its mails (password reset, invitation) to ECHO_ALIAS:MAIL_PORT, no TLS, no login +readonly MAIL_PORT=2525 +readonly ECHO_HEALTH_PATH="/__e2e/health" +readonly ECHO_SCRIPT="$SCRIPT_DIR/echo-server.js" +# Set by start_echo: the sidecar's IP on the run network (used for --add-host of the app and the runner) +ECHO_IP="" + +log() { + echo "[$(date +%H:%M:%S)] $*" +} + +fail() { + echo "ERROR: $*" >&2 + exit 1 +} + +cleanup() { + docker rm -f "$RUNNER_CONTAINER" "$APP_CONTAINER" "$POSTGRES_CONTAINER" "$ECHO_CONTAINER" > /dev/null 2>&1 || true + docker network rm "$NETWORK" > /dev/null 2>&1 || true +} +trap cleanup EXIT + +check_stack_profile() { + case "$STACK_PROFILE" in + "$DEFAULT_PROFILE" | "$ENTERPRISE_PROFILE" | "$SIGNUP_DISABLED_PROFILE") ;; + *) fail "E2E_STACK_PROFILE=\"$STACK_PROFILE\" names no stack; use $DEFAULT_PROFILE, $ENTERPRISE_PROFILE or $SIGNUP_DISABLED_PROFILE" ;; + esac + if [ -n "${E2E_INCLUDE_ENTERPRISE_TAKEOVER:-}" ] && [ "$STACK_PROFILE" != "$ENTERPRISE_PROFILE" ]; then + fail "E2E_INCLUDE_ENTERPRISE_TAKEOVER needs E2E_STACK_PROFILE=$ENTERPRISE_PROFILE" + fi +} + +# Version of @playwright/test locked in package-lock.json +locked_playwright_version() { + awk '/"node_modules\/@playwright\/test"/ { found = 1 } + found && /"version"/ { gsub(/[",]/, "", $2); print $2; exit }' "$LOCKFILE" +} + +# Version in the tag of the runner image, v1.64.0-noble -> 1.64.0 +image_playwright_version() { + local tag="${PLAYWRIGHT_IMAGE##*:}" + tag="${tag#v}" + echo "${tag%%-*}" +} + +check_playwright_versions() { + [ -f "$LOCKFILE" ] || fail "$LOCKFILE is missing; see the usage comment of this script to generate it" + local locked image + locked="$(locked_playwright_version)" + image="$(image_playwright_version)" + [ -n "$locked" ] || fail "no @playwright/test version found in $LOCKFILE" + if [ "$locked" != "$image" ]; then + fail "@playwright/test $locked (package-lock.json) does not match the runner image $PLAYWRIGHT_IMAGE ($image)" + fi +} + +check_app_image() { + if ! docker image inspect "$APP_IMAGE" > /dev/null 2>&1 && [ "$APP_IMAGE" = "$DEFAULT_APP_IMAGE" ]; then + fail "image $APP_IMAGE does not exist; build it with e2e/scripts/build-e2e-image.sh" + fi +} + +# One random password per run. It is exported, never echoed and never an argument of a command: `docker run -e NAME` +# (name only) takes the value from this script's environment. +generate_superuser_password() { + local password + password="$(head -c "$SUPERUSER_PASSWORD_BYTES" /dev/urandom | od -An -tx1 | tr -d ' \n')" + export E2E_SUPERUSER_USERNAME="$SUPERUSER_USERNAME" E2E_SUPERUSER_PASSWORD="$password" + export LOWCODER_SUPERUSER_USERNAME="$SUPERUSER_USERNAME" LOWCODER_SUPERUSER_PASSWORD="$password" +} + +start_app() { + local publish=() profile_env=() + if [ -n "${E2E_HOST_PORT:-}" ]; then + publish=(-p "127.0.0.1:${E2E_HOST_PORT}:${APP_PORT}") + fi + if [ "$STACK_PROFILE" = "$ENTERPRISE_PROFILE" ]; then + profile_env=(-e "LOWCODER_WORKSPACE_MODE=$ENTERPRISE_WORKSPACE_MODE") + elif [ "$STACK_PROFILE" = "$SIGNUP_DISABLED_PROFILE" ]; then + profile_env=(-e "LOWCODER_EMAIL_SIGNUP_ENABLED=false") + fi + log "Starting $APP_IMAGE as $APP_CONTAINER (stack profile $STACK_PROFILE)" + docker run -d --name "$APP_CONTAINER" --network "$NETWORK" --network-alias "$E2E_APP_HOST" --add-host "${ECHO_ALIAS}:${ECHO_IP}" "${publish[@]}" "${profile_env[@]}" \ + -e LOWCODER_PUBLIC_URL="http://${E2E_APP_HOST}:${APP_PORT}/" \ + -e LOWCODER_SUPERUSER_USERNAME -e LOWCODER_SUPERUSER_PASSWORD \ + -e LOWCODER_ADMIN_SMTP_HOST="$ECHO_ALIAS" -e LOWCODER_ADMIN_SMTP_PORT="$MAIL_PORT" \ + -e LOWCODER_ADMIN_SMTP_AUTH=false -e LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED=false -e LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED=false \ + "$APP_IMAGE" > /dev/null +} + +start_postgres() { + log "Starting $POSTGRES_IMAGE as $POSTGRES_CONTAINER" + docker run -d --name "$POSTGRES_CONTAINER" --network "$NETWORK" \ + -e POSTGRES_DB="$POSTGRES_DATABASE" -e POSTGRES_USER="$POSTGRES_USER" -e POSTGRES_PASSWORD="$POSTGRES_PASSWORD" \ + -v "$E2E_DIR/fixtures/sql":/docker-entrypoint-initdb.d:ro \ + "$POSTGRES_IMAGE" > /dev/null +} + +# The image starts a temporary server for the init scripts, so "accepting connections" alone is too early: +# wait until the seeded table can be read. +wait_for_postgres() { + local waited=0 + until docker exec "$POSTGRES_CONTAINER" psql -U "$POSTGRES_USER" -d "$POSTGRES_DATABASE" -tAc "SELECT count(*) FROM items" > /dev/null 2>&1; do + if [ "$waited" -ge "$STARTUP_TIMEOUT" ]; then + docker logs --tail "$LOG_TAIL_LINES" "$POSTGRES_CONTAINER" >&2 || true + fail "PostgreSQL did not become ready within ${STARTUP_TIMEOUT}s" + fi + sleep "$POLL_INTERVAL" + waited=$((waited + POLL_INTERVAL)) + done + log "PostgreSQL ready after ${waited}s" +} + +# The runner image already holds Node, so the echo server needs no image of its own. +start_echo() { + log "Starting the echo sidecar as $ECHO_CONTAINER (alias $ECHO_ALIAS, port $ECHO_PORT)" + docker run -d --name "$ECHO_CONTAINER" --network "$NETWORK" --network-alias "$ECHO_ALIAS" --init \ + --user "$(id -u):$(id -g)" \ + -v "$ECHO_SCRIPT":/echo/echo-server.js:ro -e ECHO_PORT="$ECHO_PORT" -e MAIL_PORT="$MAIL_PORT" \ + "$PLAYWRIGHT_IMAGE" node /echo/echo-server.js > /dev/null + ECHO_IP="$(docker inspect -f "{{(index .NetworkSettings.Networks \"$NETWORK\").IPAddress}}" "$ECHO_CONTAINER")" + [ -n "$ECHO_IP" ] || fail "no IP address for $ECHO_CONTAINER on $NETWORK" + log "Echo sidecar is $ECHO_ALIAS = $ECHO_IP" +} + +wait_for_echo() { + local waited=0 + until docker exec "$ECHO_CONTAINER" node -e "fetch('http://localhost:${ECHO_PORT}${ECHO_HEALTH_PATH}').then((r) => process.exit(r.ok ? 0 : 1), () => process.exit(1))" > /dev/null 2>&1; do + if [ "$waited" -ge "$STARTUP_TIMEOUT" ]; then + docker logs --tail "$LOG_TAIL_LINES" "$ECHO_CONTAINER" >&2 || true + fail "the echo sidecar did not become ready within ${STARTUP_TIMEOUT}s" + fi + sleep "$POLL_INTERVAL" + waited=$((waited + POLL_INTERVAL)) + done + log "Echo sidecar ready after ${waited}s" +} + +wait_for_app() { + local waited=0 + log "Waiting for $READY_PATH (at most ${STARTUP_TIMEOUT}s)" + until docker exec "$APP_CONTAINER" curl -sf "http://localhost:${APP_PORT}${READY_PATH}" > /dev/null 2>&1; do + if [ "$waited" -ge "$STARTUP_TIMEOUT" ]; then + docker logs --tail "$LOG_TAIL_LINES" "$APP_CONTAINER" >&2 || true + fail "the application did not answer on $READY_PATH within ${STARTUP_TIMEOUT}s" + fi + if [ "$(docker inspect -f '{{.State.Running}}' "$APP_CONTAINER" 2>/dev/null)" != "true" ]; then + docker logs --tail "$LOG_TAIL_LINES" "$APP_CONTAINER" >&2 || true + fail "the application container stopped" + fi + sleep "$POLL_INTERVAL" + waited=$((waited + POLL_INTERVAL)) + done + log "Application ready after ${waited}s" +} + +run_tests() { + log "Running Playwright from $PLAYWRIGHT_IMAGE" + local status=0 + # --init and --ipc=host: recommended by Playwright for Chromium in Docker (https://playwright.dev/docs/docker) + docker run --rm --name "$RUNNER_CONTAINER" --network "$NETWORK" --add-host "${ECHO_ALIAS}:${ECHO_IP}" --init --ipc=host \ + --user "$(id -u):$(id -g)" -e HOME=/tmp \ + -e CI="${CI:-}" \ + -e LOWCODER_BASE_URL="http://${E2E_APP_HOST}:${APP_PORT}" \ + -e E2E_POSTGRES_HOST="$POSTGRES_CONTAINER" \ + -e E2E_ECHO_URL="http://${ECHO_ALIAS}:${ECHO_PORT}" \ + -e E2E_INCLUDE_QUARANTINE="${E2E_INCLUDE_QUARANTINE:-}" \ + -e E2E_INCLUDE_INSERT_ALL="${E2E_INCLUDE_INSERT_ALL:-}" \ + -e E2E_INCLUDE_SUPERADMIN="${E2E_INCLUDE_SUPERADMIN:-}" \ + -e E2E_INCLUDE_ENTERPRISE_TAKEOVER="${E2E_INCLUDE_ENTERPRISE_TAKEOVER:-}" \ + -e E2E_STACK_PROFILE="$STACK_PROFILE" \ + -e E2E_SUPERUSER_USERNAME -e E2E_SUPERUSER_PASSWORD \ + -v "$E2E_DIR":/work -w /work \ + "$PLAYWRIGHT_IMAGE" \ + sh -c 'npm ci --no-audit --no-fund && npx playwright test "$@"' sh "$@" || status=$? + return "$status" +} + +# Two runs on one checkout would share node_modules, test-results and playwright-report in e2e/: refuse the second. +acquire_run_lock() { + exec 9> "$E2E_DIR/.run.lock" + flock -n 9 || fail "another run uses $E2E_DIR (lock $E2E_DIR/.run.lock); wait for it or use another checkout" +} + +check_stack_profile +acquire_run_lock +check_playwright_versions +check_app_image +generate_superuser_password +docker network create "$NETWORK" > /dev/null +start_postgres +start_echo +start_app +wait_for_postgres +wait_for_echo +wait_for_app +run_tests "$@" diff --git a/e2e/src/api/client.ts b/e2e/src/api/client.ts new file mode 100644 index 0000000000..d59e6f3852 --- /dev/null +++ b/e2e/src/api/client.ts @@ -0,0 +1,1014 @@ +import type { APIRequestContext, APIResponse } from "@playwright/test"; +import { recordedN8nDatasource } from "../dsl/recorded"; +import { + API_ERRORS, + API_OK, + API_PATHS, + APP_TYPE_APPLICATION, + APP_TYPE_MODULE, + appPermissionPath, + appPermissionsPath, + applicationPath, + appViewPath, + AUTH_ID_EMAIL, + AUTH_SOURCE_EMAIL, + appRecordsByAppPath, + bundleAddAppPath, + bundleElementsPath, + bundlePath, + bundlePermissionsPath, + bundleRecyclePath, + bundleViewPath, + datasourcePermissionPath, + datasourcePermissionsPath, + EMPTY_MODULE_DSL, + folderMovePath, + folderPermissionPath, + folderPermissionsPath, + groupAddMemberPath, + groupMembersPath, + groupRemoveMemberPath, + groupRolePath, + invitationAcceptPath, + NEW_USER_GUIDANCE_STATUS, + NPM_REGISTRIES_SETTING_KEY, + orgCommonSettingsPath, + orgMembersPath, + orgRemoveMemberPath, + orgRolePath, + publicToAllPath, + publishPath, + recyclePath, + restorePath, + snapshotsPath, + orgLeavePath, + orgPath, + switchOrgPath, + TEST_PASSWORD, + apiKeyPath, + OAUTH_AUTH_TYPE, + OAUTH_DUMMY_CLIENT_ID, + type AppRole, + type OrgRole, +} from "../constants"; + +/** A Lowcoder API call that did not answer with `code === API_OK`. The message carries the response body. */ +export class LowcoderApiError extends Error { + constructor(action: string, status: number, body: string) { + super(`${action} failed: HTTP ${status}, body: ${body}`); + this.name = "LowcoderApiError"; + } +} + +interface ApiEnvelope { + code: number; + message?: string; + data: T; +} + +async function unwrap(action: string, response: APIResponse): Promise { + const text = await response.text(); + let envelope: ApiEnvelope; + try { + envelope = JSON.parse(text) as ApiEnvelope; + } catch { + throw new LowcoderApiError(action, response.status(), text); + } + if (!response.ok() || envelope.code !== API_OK) { + throw new LowcoderApiError(action, response.status(), text); + } + return envelope.data; +} + +export interface RegisteredUser { + email: string; + orgId: string; +} + +interface CurrentUserData { + /** The user's id (`GET /api/users/me`). */ + id?: string; + /** Display name of the user (`GET /api/users/me`). */ + name?: string; + /** The name the app shows for the user (measured: the e-mail address until the user sets a nickname). */ + username?: string; + /** The sign-in connections of the user (`UserProfileView.connections`): the e-mail connection and one per provider, with the address each knows. */ + connections?: { source: string; email?: string }[]; + /** UI language code (`en`, `de`...). */ + uiLanguage?: string; + /** The avatar's URL; `null` or absent without an avatar. */ + avatarUrl?: string | null; + /** Flags set through `PUT /api/users/mark-status`. */ + userStatus?: Record; + orgAndRoles: { org: { id: string; name?: string }; role?: string }[]; + /** The workspace the user's routes act in (a flag on the membership row, not on the session). */ + currentOrgId?: string; +} + +/** + * Registers a user with e-mail and password. The request context keeps the session cookie, so when it is the + * `page.request` of a browser context the page is logged in as well. + */ +export async function registerUser(request: APIRequestContext, email: string): Promise { + await unwrap( + `register ${email}`, + await request.post(API_PATHS.LOGIN, { + data: { + loginId: email, + password: TEST_PASSWORD, + register: true, + source: AUTH_SOURCE_EMAIL, + authId: AUTH_ID_EMAIL, + }, + }), + ); + await dismissNewUserGuidance(request); + const me = await currentUser(request); + const org = me.orgAndRoles[0]; + if (!org) { + throw new LowcoderApiError(`register ${email}`, 200, "the new user has no workspace"); + } + return { email, orgId: org.org.id }; +} + +/** + * The form sign-up of `registerUser` as a raw answer (no unwrap), for the call under test: the answer of a refused + * sign-up is the subject. The request context keeps the session cookie when the sign-up works. `invitation` adds the two + * query parameters `invitationId` and `orgId` the register page sends when the visitor came through an invitation link + * (`UserApi.formLogin` in `client/packages/lowcoder/src/api/userApi.ts`; the server reads them with `@RequestParam`). + */ +export async function registerRaw( + request: APIRequestContext, + email: string, + password: string, + invitation?: { invitationId: string; orgId: string }, +): Promise { + return apiRaw(request, "POST", API_PATHS.LOGIN, { + data: { loginId: email, password, register: true, source: AUTH_SOURCE_EMAIL, authId: AUTH_ID_EMAIL }, + params: invitation, + }); +} + +/** + * Marks the new-user tour as done. Otherwise the tour (react-joyride) opens on the first visit of the app list + * and its overlay intercepts clicks. The tests that are about the tour itself do not exist yet. + */ +export async function dismissNewUserGuidance(request: APIRequestContext): Promise { + await unwrap( + "dismiss new user guidance", + await request.put(API_PATHS.MARK_USER_STATUS, { data: { type: NEW_USER_GUIDANCE_STATUS, value: true } }), + ); +} + +export async function currentUser(request: APIRequestContext): Promise { + return unwrap("current user", await request.get(API_PATHS.CURRENT_USER)); +} + +export interface CreatedApp { + appId: string; + /** The app's gid (`applicationGid` of the answer): the second id an app is addressable by (SEC-C01b). */ + appGid?: string; +} + +interface CreateAppData { + applicationInfoView: { applicationId: string; applicationGid?: string }; +} + +/** POST /api/applications: the body differs between an app and a module only in `applicationType` and the default DSL. */ +async function createApplication( + action: string, + request: APIRequestContext, + params: { orgId: string; name: string; applicationType: number; dsl: object }, +): Promise { + const data = await unwrap( + action, + await request.post(API_PATHS.APPLICATIONS, { + data: { + orgId: params.orgId, + name: params.name, + applicationType: params.applicationType, + editingApplicationDSL: params.dsl, + }, + }), + ); + return { appId: data.applicationInfoView.applicationId, appGid: data.applicationInfoView.applicationGid }; +} + +export async function createApp( + request: APIRequestContext, + params: { orgId: string; name: string; dsl?: object }, +): Promise { + return createApplication(`create app ${params.name}`, request, { + ...params, + applicationType: APP_TYPE_APPLICATION, + dsl: params.dsl ?? {}, + }); +} + +/** + * Creates a module (an app of type APP_TYPE_MODULE that other apps embed as a `module` component). `appId` of the + * result is the module id a host's `moduleInstance` names. Without `dsl` the module is the empty one the editor's + * "Create Module" posts (EMPTY_MODULE_DSL); build a filled one with `moduleApp`. A module is published like an app + * (`publishApp`); a host uses its latest published version and, while it has none, its draft. + */ +export async function createModule( + request: APIRequestContext, + params: { orgId: string; name: string; dsl?: object }, +): Promise { + return createApplication(`create module ${params.name}`, request, { + ...params, + applicationType: APP_TYPE_MODULE, + dsl: params.dsl ?? EMPTY_MODULE_DSL, + }); +} + +export const FIRST_VERSION_TAG = "1.0.0"; + +/** + * Publishes the draft as version `tag`, like the editor's publish dialog (which sends a commit message and a + * version tag). A publish with an empty body works once; a second one with an empty body answered HTTP 500 + * "Service is busy" on the 3.0.0 image, so every publish names its version. + */ +export async function publishApp( + request: APIRequestContext, + appId: string, + tag: string = FIRST_VERSION_TAG, +): Promise { + await unwrap( + `publish app ${appId} as ${tag}`, + await request.post(publishPath(appId), { data: { commitMessage: `e2e ${tag}`, tag } }), + ); +} + +interface AppData { + /** The draft (editing) DSL: what GET /api/applications/{id} returns for the editor. */ + applicationDSL: unknown; +} + +/** The stored draft DSL of an app, as the editor saved it. */ +export async function getAppDsl(request: APIRequestContext, appId: string): Promise { + return unwrap(`read app ${appId}`, await request.get(applicationPath(appId))); +} + +export async function updateApp( + request: APIRequestContext, + appId: string, + changes: { name?: string; dsl?: object }, +): Promise { + await unwrap( + `update app ${appId}`, + await request.put(applicationPath(appId), { + data: { + ...(changes.name === undefined ? {} : { name: changes.name }), + ...(changes.dsl === undefined ? {} : { editingApplicationDSL: changes.dsl }), + }, + }), + ); +} + +export async function setPublicToAll(request: APIRequestContext, appId: string, publicToAll: boolean): Promise { + await unwrap( + `set public-to-all of ${appId}`, + await request.put(publicToAllPath(appId), { data: { publicToAll } }), + ); +} + +export interface AppSummary { + applicationId: string; + name: string; + applicationStatus: string; +} + +/** Names of the apps in the current workspace's list (not the trash). */ +export async function listAppNames(request: APIRequestContext): Promise { + const apps = await unwrap<{ name: string }[]>( + "list apps", + await request.get(API_PATHS.APPLICATION_LIST, { params: { applicationType: APP_TYPE_APPLICATION } }), + ); + return apps.map((app) => app.name); +} + +export async function listRecycledApps(request: APIRequestContext): Promise { + return unwrap("list recycled apps", await request.get(API_PATHS.APPLICATION_RECYCLE_LIST)); +} + +export async function recycleApp(request: APIRequestContext, appId: string): Promise { + await unwrap(`recycle app ${appId}`, await request.put(recyclePath(appId))); +} + +export async function restoreApp(request: APIRequestContext, appId: string): Promise { + await unwrap(`restore app ${appId}`, await request.put(restorePath(appId))); +} + +interface InviteData { + inviteCode: string; +} + +/** Creates an invitation link of a workspace; returns its code. */ +export async function createInvitation(request: APIRequestContext, orgId: string): Promise { + const data = await unwrap( + `invite to ${orgId}`, + await request.post(API_PATHS.INVITATION, { params: { orgId } }), + ); + return data.inviteCode; +} + +export async function acceptInvitation(request: APIRequestContext, inviteCode: string): Promise { + await unwrap(`accept invitation ${inviteCode}`, await request.get(invitationAcceptPath(inviteCode))); +} + +export async function currentUserId(request: APIRequestContext): Promise { + const me = await unwrap<{ id: string }>("current user id", await request.get(API_PATHS.CURRENT_USER)); + return me.id; +} + +export async function grantAppPermission( + request: APIRequestContext, + appId: string, + params: { role: AppRole; userIds: string[]; groupIds?: string[] }, +): Promise { + await unwrap( + `grant ${params.role} on ${appId}`, + await request.put(appPermissionsPath(appId), { + data: { role: params.role, userIds: params.userIds, groupIds: params.groupIds ?? [] }, + }), + ); +} + +/** + * The raw answer of GET /api/applications/{id}/view (the published app). Not unwrapped: tests also need the + * failure answers (permission denied) and compare their `code`. + */ +export async function viewAppRaw(request: APIRequestContext, appId: string): Promise<{ status: number; code: number }> { + const response = await request.get(appViewPath(appId)); + const body = (await response.json()) as { code: number }; + return { status: response.status(), code: body.code }; +} + +/** The raw answer of GET /api/applications/{id} (the editable app), see viewAppRaw. */ +export async function editAppRaw(request: APIRequestContext, appId: string): Promise<{ status: number; code: number }> { + const response = await request.get(applicationPath(appId)); + const body = (await response.json()) as { code: number }; + return { status: response.status(), code: body.code }; +} + +export interface PostgresConnection { + host: string; + port: number; + database: string; + username: string; + password: string; +} + +/** Creates a PostgreSQL data source in the workspace; returns its id. */ +export async function createPostgresDatasource( + request: APIRequestContext, + params: { orgId: string; name: string; connection: PostgresConnection }, +): Promise { + const data = await unwrap<{ id: string }>( + `create datasource ${params.name}`, + await request.post(API_PATHS.DATASOURCES, { + data: { + name: params.name, + type: "postgres", + organizationId: params.orgId, + // extParams is a map; a list is rejected as an illegal configuration + datasourceConfig: { ...params.connection, usingSsl: false, extParams: {} }, + }, + }), + ); + return data.id; +} + +// --------------------------------------------------------------------------------------------------------------- +// Security helpers. The call under test of a security test goes through `apiRaw`; the setup calls +// below unwrap and throw. None of them creates a request context: the caller passes its own (fixture-owned) one. +// --------------------------------------------------------------------------------------------------------------- + +export type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH"; + +/** The answer of `apiRaw`: nothing is unwrapped and nothing throws on a failure status. */ +export interface RawAnswer { + status: number; + /** `code` of the `ResponseView` body; `undefined` when the body is not JSON or has no numeric `code`. */ + code: number | undefined; + /** The body text exactly as received (empty for an answer without a body). */ + body: string; + /** The body parsed as JSON, `undefined` when it is not JSON. */ + json: unknown; + /** Response headers, names in lower case; a header sent several times (`set-cookie`) is joined with a newline. */ + headers: Record; +} + +export interface RawRequestOptions { + /** JSON body (an object or array), or a string sent as it is. */ + data?: unknown; + params?: Record; + headers?: Record; + /** A multipart form body (a file upload); sent instead of `data`. */ + multipart?: Record; +} + +/** + * Sends one request and returns status, `code` and body without unwrapping. Use it for the call under test of every + * security test: `unwrap` throws on any failure, which would turn a correct denial into a test error. Generalises + * `viewAppRaw` / `editAppRaw`, which stay. + */ +export async function apiRaw( + request: APIRequestContext, + method: HttpMethod, + path: string, + options: RawRequestOptions = {}, +): Promise { + const response = await request.fetch(path, { + method, + data: options.data, + multipart: options.multipart, + params: options.params, + headers: options.headers, + }); + const body = await response.text(); + let json: unknown; + try { + json = JSON.parse(body); + } catch { + json = undefined; + } + const code = typeof json === "object" && json !== null ? (json as { code?: unknown }).code : undefined; + return { status: response.status(), code: typeof code === "number" ? code : undefined, body, json, headers: response.headers() }; +} + +/** Makes the organisation the user's current one (the flag is on the membership row, not on the session). */ +export async function switchOrganization(request: APIRequestContext, orgId: string): Promise { + await unwrap(`switch to organisation ${orgId}`, await request.put(switchOrgPath(orgId))); +} + +export async function updateMemberRole( + request: APIRequestContext, + orgId: string, + userId: string, + role: OrgRole, +): Promise { + await unwrap( + `set role ${role} of ${userId} in ${orgId}`, + await request.put(orgRolePath(orgId), { data: { userId, role } }), + ); +} + +/** One row of the member list of a workspace (`GET /api/organizations/{orgId}/members`, measured). */ +export interface OrgMember { + userId: string; + name: string; + /** `admin`, `member` or `super_admin`. */ + role: string; +} + +/** The members of a workspace, the instance super admin included (`role` `super_admin`). Needs membership. */ +export async function listOrgMembers(request: APIRequestContext, orgId: string): Promise { + const data = await unwrap<{ members: OrgMember[] }>(`list members of ${orgId}`, await request.get(orgMembersPath(orgId))); + return data.members; +} + +export async function removeOrgMember(request: APIRequestContext, orgId: string, userId: string): Promise { + await unwrap( + `remove ${userId} from ${orgId}`, + await request.delete(orgRemoveMemberPath(orgId), { params: { userId } }), + ); +} + +/** + * One group of the current organisation as `GET /api/groups/list` reports it (measured on the 3.0.0 image: Jackson names + * the Lombok booleans `devGroup` and `allUsersGroup`; the group has no `type` field, so the developer group is found by + * the flag, not by the type `dev` of domain/group/util/SystemGroups.java:13). + */ +export interface GroupSummary { + groupId: string; + groupName: string; + /** True for the system group of the workspace's developers (`isDevGroup` of `GroupView`). */ + devGroup: boolean; + /** True for the system group every member belongs to. */ + allUsersGroup: boolean; +} + +/** The groups of the user's current organisation. */ +export async function listGroups(request: APIRequestContext): Promise { + return unwrap("list groups", await request.get(API_PATHS.GROUP_LIST)); +} + +/** Creates a group in the user's current organisation; returns its id. */ +export async function createGroup(request: APIRequestContext, name: string): Promise { + const data = await unwrap<{ groupId: string }>( + `create group ${name}`, + await request.post(API_PATHS.GROUPS, { data: { name } }), + ); + return data.groupId; +} + +export async function addGroupMember( + request: APIRequestContext, + groupId: string, + userId: string, + role: OrgRole, +): Promise { + await unwrap( + `add ${userId} to group ${groupId} as ${role}`, + await request.post(groupAddMemberPath(groupId), { data: { userId, role } }), + ); +} + +export async function removeGroupMember(request: APIRequestContext, groupId: string, userId: string): Promise { + await unwrap( + `remove ${userId} from group ${groupId}`, + await request.delete(groupRemoveMemberPath(groupId), { params: { userId } }), + ); +} + +export async function updateGroupMemberRole( + request: APIRequestContext, + groupId: string, + userId: string, + role: OrgRole, +): Promise { + await unwrap( + `set role ${role} of ${userId} in group ${groupId}`, + await request.put(groupRolePath(groupId), { data: { userId, role } }), + ); +} + +/** One row of a permission list (`PermissionItemView`): `permissionId` is what update and remove take. */ +export interface PermissionItem { + permissionId: string; + /** `USER` or `GROUP`. */ + type: string; + /** Id of the user or group the row is for. */ + id: string; + name: string; + role: string; +} + +/** The permission list of an app, folder or datasource (`CommonPermissionView`, plus the app's public flags). */ +export interface PermissionView { + creatorId: string; + groupPermissions: PermissionItem[]; + userPermissions: PermissionItem[]; + publicToAll?: boolean; +} + +export async function listAppPermissions(request: APIRequestContext, appId: string): Promise { + return unwrap(`list permissions of ${appId}`, await request.get(appPermissionsPath(appId))); +} + +export async function updateAppPermission( + request: APIRequestContext, + appId: string, + permissionId: string, + role: AppRole, +): Promise { + await unwrap( + `set role ${role} of permission ${permissionId} on ${appId}`, + await request.put(appPermissionPath(appId, permissionId), { data: { role } }), + ); +} + +export async function removeAppPermission(request: APIRequestContext, appId: string, permissionId: string): Promise { + await unwrap( + `remove permission ${permissionId} of ${appId}`, + await request.delete(appPermissionPath(appId, permissionId)), + ); +} + +/** Creates a folder at the root of the user's current organisation; returns its id. */ +export async function createFolder(request: APIRequestContext, name: string): Promise { + const data = await unwrap<{ folderId: string }>( + `create folder ${name}`, + await request.post(API_PATHS.FOLDERS, { data: { name } }), + ); + return data.folderId; +} + +/** Moves an app into the folder. */ +export async function moveToFolder(request: APIRequestContext, appId: string, folderId: string): Promise { + await unwrap( + `move ${appId} to folder ${folderId}`, + await request.put(folderMovePath(appId), { params: { targetFolderId: folderId } }), + ); +} + +export interface PermissionGrant { + role: AppRole; + userIds?: string[]; + groupIds?: string[]; +} + +export async function grantFolderPermission(request: APIRequestContext, folderId: string, grant: PermissionGrant): Promise { + await unwrap( + `grant ${grant.role} on folder ${folderId}`, + await request.post(folderPermissionsPath(folderId), { + data: { role: grant.role, userIds: grant.userIds ?? [], groupIds: grant.groupIds ?? [] }, + }), + ); +} + +export async function listFolderPermissions(request: APIRequestContext, folderId: string): Promise { + return unwrap(`list permissions of folder ${folderId}`, await request.get(folderPermissionsPath(folderId))); +} + +export async function updateFolderPermission( + request: APIRequestContext, + folderId: string, + permissionId: string, + role: AppRole, +): Promise { + await unwrap( + `set role ${role} of permission ${permissionId} on folder ${folderId}`, + await request.put(folderPermissionPath(folderId, permissionId), { data: { role } }), + ); +} + +export async function removeFolderPermission( + request: APIRequestContext, + folderId: string, + permissionId: string, +): Promise { + await unwrap( + `remove permission ${permissionId} of folder ${folderId}`, + await request.delete(folderPermissionPath(folderId, permissionId)), + ); +} + +export async function grantDatasourcePermission( + request: APIRequestContext, + datasourceId: string, + grant: PermissionGrant, +): Promise { + await unwrap( + `grant ${grant.role} on datasource ${datasourceId}`, + await request.put(datasourcePermissionsPath(datasourceId), { + data: { role: grant.role, userIds: grant.userIds ?? [], groupIds: grant.groupIds ?? [] }, + }), + ); +} + +export async function listDatasourcePermissions(request: APIRequestContext, datasourceId: string): Promise { + return unwrap( + `list permissions of datasource ${datasourceId}`, + await request.get(datasourcePermissionsPath(datasourceId)), + ); +} + +export async function updateDatasourcePermission( + request: APIRequestContext, + permissionId: string, + role: AppRole, +): Promise { + await unwrap( + `set role ${role} of datasource permission ${permissionId}`, + await request.put(datasourcePermissionPath(permissionId), { data: { role } }), + ); +} + +export async function removeDatasourcePermission(request: APIRequestContext, permissionId: string): Promise { + await unwrap( + `remove datasource permission ${permissionId}`, + await request.delete(datasourcePermissionPath(permissionId)), + ); +} + +/** Creates an API key of the signed-in user; the answer carries the token, which is shown only here. */ +export async function createApiKey(request: APIRequestContext, name: string): Promise<{ id: string; token: string }> { + return unwrap<{ id: string; token: string }>( + `create API key ${name}`, + await request.post(API_PATHS.API_KEYS, { data: { name } }), + ); +} + +export async function deleteApiKey(request: APIRequestContext, apiKeyId: string): Promise { + await unwrap(`delete API key ${apiKeyId}`, await request.delete(apiKeyPath(apiKeyId))); +} + +/** Ends the session of the request context on the server (the cookie stays in the context, but is dead). */ +export async function logout(request: APIRequestContext): Promise { + await unwrap("log out", await request.post(API_PATHS.AUTH_LOGOUT)); +} + +/** Runs an app query as `POST /api/query/execute` does; `viewMode: true` runs the published version. Raw answer. */ +export async function executeAppQueryRaw( + request: APIRequestContext, + params: { applicationId: string; queryId: string; viewMode: boolean }, +): Promise { + return apiRaw(request, "POST", API_PATHS.QUERY_EXECUTE, { data: { ...params, params: [] } }); +} + +/** Creates a library query in the organisation; `query` is its `libraryQueryDSL`. Returns its id. */ +export async function createLibraryQuery( + request: APIRequestContext, + params: { orgId: string; name: string; query: object }, +): Promise { + const data = await unwrap<{ id: string }>( + `create library query ${params.name}`, + await request.post(API_PATHS.LIBRARY_QUERIES, { + data: { organizationId: params.orgId, name: params.name, libraryQueryDSL: params.query }, + }), + ); + return data.id; +} + +/** Saves a history snapshot of the app (the route answers a Boolean, no id: read it back with `listSnapshots`). */ +export async function createSnapshot(request: APIRequestContext, appId: string, dsl: object): Promise { + await unwrap( + `create snapshot of ${appId}`, + await request.post(API_PATHS.APPLICATION_HISTORY_SNAPSHOTS, { data: { applicationId: appId, dsl, context: {} } }), + ); +} + +/** Ids of the app's history snapshots, newest first as the server lists them. */ +export async function listSnapshots(request: APIRequestContext, appId: string): Promise<{ snapshotId: string }[]> { + const data = await unwrap<{ list: { snapshotId: string }[] }>( + `list snapshots of ${appId}`, + await request.get(snapshotsPath(appId)), + ); + return data.list; +} + +/** Creates a bundle in the organisation; returns its id. */ +export async function createBundle(request: APIRequestContext, params: { orgId: string; name: string }): Promise { + const data = await unwrap<{ bundleId: string }>( + `create bundle ${params.name}`, + await request.post(API_PATHS.BUNDLES, { data: { orgId: params.orgId, name: params.name } }), + ); + return data.bundleId; +} + +export async function addAppToBundle(request: APIRequestContext, appId: string, bundleId: string): Promise { + await unwrap( + `add ${appId} to bundle ${bundleId}`, + await request.put(bundleAddAppPath(appId), { params: { toBundleId: bundleId } }), + ); +} + +/** The raw answer of `GET /api/bundles/{id}/elements` (the call under test of SEC-C23 and SEC-R17). */ +export async function bundleElementsRaw(request: APIRequestContext, bundleId: string): Promise { + return apiRaw(request, "GET", bundleElementsPath(bundleId)); +} + +export async function grantBundlePermission(request: APIRequestContext, bundleId: string, grant: PermissionGrant): Promise { + await unwrap( + `grant ${grant.role} on bundle ${bundleId}`, + await request.post(bundlePermissionsPath(bundleId), { + data: { role: grant.role, userIds: grant.userIds ?? [], groupIds: grant.groupIds ?? [] }, + }), + ); +} + +/** + * Recycles a bundle. The 3.0.0 server sets the status and THEN answers HTTP 500 / 5005 "Cannot find this application" + * (measured: the bundle is recycled, `GET /api/bundles/{id}/view` answers 400 / 5003 afterwards, and the recycled bundle + * can be deleted; D-46). A setup helper must work on that image, so an answer + * of exactly that shape counts as success when the view confirms the bundle is no longer the normal one; any other + * failure throws. The call under test of a security test goes through `apiRaw`, not through this. + */ +export async function recycleBundle(request: APIRequestContext, bundleId: string): Promise { + const answer = await apiRaw(request, "PUT", bundleRecyclePath(bundleId)); + if (answer.status === 200 && answer.code === API_OK) { + return; + } + const view = await apiRaw(request, "GET", bundleViewPath(bundleId)); + const failedAfterRecycling = + answer.status === API_ERRORS.NO_RESOURCE_FOUND.status && + answer.code === API_ERRORS.NO_RESOURCE_FOUND.code && + view.code === API_ERRORS.UNSUPPORTED_OPERATION.code; + if (!failedAfterRecycling) { + throw new LowcoderApiError(`recycle bundle ${bundleId}`, answer.status, answer.body); + } +} + +/** Deletes a bundle; the server wants it recycled first. */ +export async function deleteBundle(request: APIRequestContext, bundleId: string): Promise { + await unwrap(`delete bundle ${bundleId}`, await request.delete(bundlePath(bundleId))); +} + +/** + * Stores a GitHub sign-in configuration with the given client secret in the workspace of the (admin) caller. GitHub + * configs are only stored; nothing contacts GitHub. Used to prove whether the secret leaks to other callers (SEC-R07d). + */ +export async function seedOAuthConfig(request: APIRequestContext, params: { clientSecret: string; clientId?: string }): Promise { + await unwrap( + "seed OAuth config", + await request.post(API_PATHS.AUTH_CONFIG, { + data: { + authType: OAUTH_AUTH_TYPE, + clientId: params.clientId ?? OAUTH_DUMMY_CLIENT_ID, + clientSecret: params.clientSecret, + enable: true, + }, + }), + ); +} + +/** + * One sign-in configuration as `GET /api/auth/configs` lists it (admin only). The answer also carries the client secret in + * clear (D-14); the type leaves it out so no test reads it. + */ +export interface AuthConfigEntry { + id: string; + authType: string; + enable: boolean; +} + +/** `GET /api/auth/configs`: the sign-in configurations of the caller's workspace, e-mail included (id `EMAIL`). */ +export async function listAuthConfigs(request: APIRequestContext): Promise { + const rows = await unwrap("list auth configs", await request.get(API_PATHS.AUTH_CONFIGS)); + return rows.map((row) => ({ id: row.id, authType: row.authType, enable: row.enable })); +} + +/** `POST /api/auth/config` with a GitHub configuration, as the raw answer (the call under test of the duplicate check). */ +export async function addGithubConfigRaw(request: APIRequestContext, params: { clientId: string; clientSecret: string }): Promise { + return apiRaw(request, "POST", API_PATHS.AUTH_CONFIG, { + data: { authType: OAUTH_AUTH_TYPE, clientId: params.clientId, clientSecret: params.clientSecret, enable: true }, + }); +} + +/** `DELETE /api/auth/config/{id}` (`delete=false` disables, `true` deletes), as the raw answer. */ +export async function removeAuthConfigRaw(request: APIRequestContext, id: string, options: { remove: boolean }): Promise { + return apiRaw(request, "DELETE", `${API_PATHS.AUTH_CONFIG}/${id}`, { params: { delete: String(options.remove) } }); +} + +/** + * Signs in an existing user with e-mail and password (the form login of `registerUser` without `register`). The request + * context keeps the session cookie: a second `signIn` of the same user in another context is a second, independent + * session. The action label names the e-mail only; the password never reaches an error message. + */ +export async function signIn(request: APIRequestContext, email: string, password: string = TEST_PASSWORD): Promise { + await unwrap( + `sign in ${email}`, + await request.post(API_PATHS.LOGIN, { + data: { loginId: email, password, register: false, source: AUTH_SOURCE_EMAIL, authId: AUTH_ID_EMAIL }, + }), + ); +} + +/** + * The form sign-in of `signIn` as a raw answer (no unwrap, no throw on a refusal), for a test that measures the answer + * or reads its headers. Like `signIn`, the password never reaches a label or message. + */ +export async function signInRaw(request: APIRequestContext, email: string, password: string = TEST_PASSWORD): Promise { + return apiRaw(request, "POST", API_PATHS.LOGIN, { + data: { loginId: email, password, register: false, source: AUTH_SOURCE_EMAIL, authId: AUTH_ID_EMAIL }, + }); +} + +/** `POST /api/users/lost-password`: asks for a reset mail for an address (anonymous route; the answer is empty whatever the address). */ +export async function requestPasswordReset(request: APIRequestContext, address: string): Promise { + return apiRaw(request, "POST", API_PATHS.USER_LOST_PASSWORD, { data: { userEmail: address } }); +} + +/** `POST /api/users/reset-lost-password`: sets a new password from a mailed token (anonymous route). The call under test, so raw. */ +export async function resetLostPasswordRaw( + request: APIRequestContext, + credentials: { address: string; token: string; password: string }, +): Promise { + return apiRaw(request, "POST", API_PATHS.USER_RESET_LOST_PASSWORD, { + data: { userEmail: credentials.address, token: credentials.token, newPassword: credentials.password }, + }); +} + +/** `POST /api/invitation/email/invite`: creates an invitation of a workspace and mails its link to the addresses. */ +export async function sendInvitationEmails(request: APIRequestContext, orgId: string, addresses: string[]): Promise { + return apiRaw(request, "POST", API_PATHS.INVITATION_EMAIL, { data: { emails: addresses, orgId } }); +} + +/** `DELETE /api/organizations/{id}/leave`: the caller leaves the workspace (a plain member has no UI control for it). */ +export async function leaveOrganization(request: APIRequestContext, orgId: string): Promise { + await unwrap(`leave organisation ${orgId}`, await request.delete(orgLeavePath(orgId))); +} + +/** `DELETE /api/organizations/{id}`: deletes a workspace (state DELETED; its memberships and groups go asynchronously). The call under test, so raw. */ +export async function deleteOrganizationRaw(request: APIRequestContext, orgId: string): Promise { + return apiRaw(request, "DELETE", orgPath(orgId)); +} + +/** `POST /api/organizations`: creates a workspace the caller administers (SAAS mode only); returns its id. */ +export async function createOrganization(request: APIRequestContext, name: string): Promise { + const org = await unwrap<{ orgId: string }>(`create organisation ${name}`, await request.post(API_PATHS.ORGANIZATIONS, { data: { name } })); + return org.orgId; +} + +/** `PUT /api/users`: sets the caller's display name (`username` in the profile answer) and UI language; a blank value is skipped. */ +export async function updateProfile(request: APIRequestContext, fields: { name?: string; uiLanguage?: string }): Promise { + await unwrap("update profile", await request.put(API_PATHS.USERS, { data: fields })); +} + +/** `DELETE /api/users/photo`: removes the caller's avatar (answers 200 with an empty body, measured; 500 / 5000 without an avatar). */ +export async function deleteProfilePhoto(request: APIRequestContext): Promise { + const response = await request.delete(API_PATHS.USER_PHOTO); + if (!response.ok()) { + throw new LowcoderApiError("delete profile photo", response.status(), await response.text()); + } +} + +/** What `GET /api/applications/{id}` (the editing view) reports about an app: the fields security tests compare. */ +export interface AppDetails { + name: string; + /** Workspace the app belongs to. */ + orgId: string; + /** Creator, as the API reports it (an id). */ + createBy: string; + /** `NORMAL` or `RECYCLED` (`APP_STATUS`). */ + applicationStatus: string; + publicToAll: boolean; + /** The draft DSL. */ + dsl: unknown; +} + +/** Reads an app through its editing view; needs the EDIT right (a denial throws, use `apiRaw` for the call under test). */ +export async function getApp(request: APIRequestContext, appId: string): Promise { + const data = await unwrap<{ + applicationInfoView: { name: string; orgId: string; createBy: string; applicationStatus: string; publicToAll: boolean }; + applicationDSL: unknown; + }>(`read app ${appId}`, await request.get(applicationPath(appId))); + const { name, orgId, createBy, applicationStatus, publicToAll } = data.applicationInfoView; + return { name, orgId, createBy, applicationStatus, publicToAll, dsl: data.applicationDSL }; +} + +/** One published version of an app as `GET /api/application-records/listByApplicationId` lists it (`ApplicationRecordMetaView`). */ +export interface AppVersion { + tag: string; +} + +/** The published versions of an app, as the owner reads them; `unwrap` throws for a caller without the right. */ +export async function listAppVersions(request: APIRequestContext, appId: string): Promise { + return unwrap( + `list versions of ${appId}`, + await request.get(appRecordsByAppPath(), { params: { applicationId: appId } }), + ); +} + +/** Uploads the signed-in user's profile photo (`POST /api/users/photo`, multipart field `file`). */ +export async function uploadProfilePhoto(request: APIRequestContext, photo: { name: string; mimeType: string; buffer: Buffer }): Promise { + await unwrap("upload profile photo", await request.post(API_PATHS.USER_PHOTO, { multipart: { file: photo } })); +} + +/** The signed-in user's profile photo as the server returns it (`GET /api/users/photo`): status and the exact bytes. */ +export async function readProfilePhoto(request: APIRequestContext): Promise<{ status: number; bytes: Buffer }> { + const response = await request.get(API_PATHS.USER_PHOTO); + return { status: response.status(), bytes: await response.body() }; +} + +/** One member row of `GET /api/groups/{id}/members` (measured: `data.members[]` with `userId` and `role`). */ +export interface GroupMemberRow { + userId: string; + role: string; +} + +/** The members of a group. Needs the right to list them (org admin or group member); a denial throws. */ +export async function listGroupMembers(request: APIRequestContext, groupId: string): Promise { + const data = await unwrap<{ members: GroupMemberRow[] }>(`list members of group ${groupId}`, await request.get(groupMembersPath(groupId))); + return data.members; +} + +/** + * Points the workspace's npm registry (a global entry, bearer token) at `url`: `PUT /api/organizations/{orgId}/common-settings` + * with the key `npmRegistries` and one entry (shape of node-service's `NpmRegistryConfigEntry`). The caller must be an admin of + * the workspace. It REPLACES the list, so the workspace has exactly this one registry afterwards. + */ +export async function setNpmRegistry( + request: APIRequestContext, + orgId: string, + registry: { url: string; token: string }, +): Promise { + const entry = { scope: { type: "global" }, registry: { url: registry.url, auth: { type: "bearer", credentials: registry.token } } }; + await unwrap( + `set the npm registry of ${orgId}`, + await request.put(orgCommonSettingsPath(orgId), { data: { key: NPM_REGISTRIES_SETTING_KEY, value: [entry] } }), + ); +} + +/** The `POST /api/datasources` body of an n8n data source: the recorded form body with the workspace, the target and the key set. */ +export function n8nDatasourceBody( + params: { orgId: string; name?: string; serverURL: string; apiKey: string; forwardAllCookies?: boolean }, +): object { + const recorded = recordedN8nDatasource(); + return { + ...recorded, + name: params.name ?? recorded.name, + organizationId: params.orgId, + datasourceConfig: { + ...recorded.datasourceConfig, + serverURL: params.serverURL, + apiKey: params.apiKey, + ...(params.forwardAllCookies === undefined ? {} : { forwardAllCookies: params.forwardAllCookies }), + }, + }; +} + +/** Creates an n8n data source (spec v1.1.1) whose `serverURL` is `params.serverURL` (a test's echo target); returns its id. */ +export async function createN8nDatasource( + request: APIRequestContext, + params: { orgId: string; name?: string; serverURL: string; apiKey: string; forwardAllCookies?: boolean }, +): Promise { + const data = await unwrap<{ id: string }>( + "create n8n datasource", + await request.post(API_PATHS.DATASOURCES, { data: n8nDatasourceBody(params) }), + ); + return data.id; +} diff --git a/e2e/src/components/insert-all.ts b/e2e/src/components/insert-all.ts new file mode 100644 index 0000000000..dc586a24b6 --- /dev/null +++ b/e2e/src/components/insert-all.ts @@ -0,0 +1,120 @@ +import type { APIRequestContext } from "@playwright/test"; +import { getAppDsl } from "../api/client"; +import { SAVE_POLL_TIMEOUT_MS } from "../constants"; +import { containerOf, text } from "../dsl/builders"; +import { recordedHook } from "../dsl/recorded"; +import { HOOK_TYPES } from "./insert-catalog"; + +/** Helpers of S1, the insert-every-tile smoke test (`tests/components/insert-all.spec.ts`). */ + +/** How often the saved DSL is read while waiting for the editor's autosave. */ +export const SAVE_POLL_INTERVAL_MS = 500; + +/** The published view must reach network idle within this time (the probe ignored a timeout; S1 fails on it). */ +export const VIEW_NETWORK_IDLE_TIMEOUT_MS = 20_000; + +/** After the view is ready: how long asynchronous `pageerror` events are observed (the probe's wait). */ +export const VIEW_OBSERVATION_MS = 2_500; + +/** The readiness text the five hook types get: they have no element of their own, so nothing else shows the view loaded. */ +export const READY_TEST_ID = "s1-ready"; +export const READY_TEXT = "ready"; +const READY_ITEM = { id: "s1Ready", name: "s1Ready" } as const; + +/** The test id every grid type is given, so its element can be found (`probe-`, as in the probe). */ +export function testIdOf(compType: string): string { + return `probe-${compType}`; +} + +/** The editor did not save the dropped component within `SAVE_POLL_TIMEOUT_MS`: defect D-3, the caller may retry once. */ +export class SavedDslTimeoutError extends Error { + constructor(appId: string, compType: string, timeoutMs: number) { + super( + `app ${appId}: the saved DSL did not hold a ${compType} within ${timeoutMs} ms of the drop (the editor's autosave was lost, defect D-3)`, + ); + this.name = "SavedDslTimeoutError"; + } +} + +/** The saved DSL as far as S1 reads it. */ +export interface SavedDsl { + ui: { layout?: Record; items?: Record }> }; + hooks?: { compType: string; name: string }[]; + [key: string]: unknown; +} + +function asSavedDsl(dsl: unknown): SavedDsl { + if (typeof dsl !== "object" || dsl === null || typeof (dsl as SavedDsl).ui !== "object" || (dsl as SavedDsl).ui === null) { + throw new TypeError(`the saved DSL has no "ui": ${JSON.stringify(dsl)?.slice(0, 200)}`); + } + return dsl as SavedDsl; +} + +/** + * Whether the saved DSL holds the component the drop created. A grid type is an item of `ui.items` with that `compType`; + * a hook type is the hook the editor adds with the recorded name (`modal1`, `toast1`, ...): `toast` is no evidence by type + * alone, every saved app has the hook `toast` of the base hooks. An app the editor has not saved yet (`{}`) holds nothing. + */ +export function holdsInsertedType(dsl: unknown, compType: string): boolean { + if (typeof dsl !== "object" || dsl === null) { + throw new TypeError(`the stored DSL is not an object: ${JSON.stringify(dsl)}`); + } + // A freshly created app stores `{}` until the editor's first save: nothing is held yet. + const saved = dsl as Partial; + if (HOOK_TYPES.has(compType)) { + const hookName = recordedHook(compType).name; + return (saved.hooks ?? []).some((hook) => hook.compType === compType && hook.name === hookName); + } + return Object.values(saved.ui?.items ?? {}).some((item) => item.compType === compType); +} + +/** Waits until the stored draft of `appId` holds the dropped component; throws `SavedDslTimeoutError` otherwise. */ +export async function waitForSavedType( + request: APIRequestContext, + appId: string, + compType: string, + timeoutMs: number = SAVE_POLL_TIMEOUT_MS, +): Promise { + const deadline = Date.now() + timeoutMs; + for (;;) { + const { applicationDSL } = await getAppDsl(request, appId); + if (holdsInsertedType(applicationDSL, compType)) { + return asSavedDsl(applicationDSL); + } + if (Date.now() >= deadline) { + throw new SavedDslTimeoutError(appId, compType, timeoutMs); + } + await new Promise((resolve) => setTimeout(resolve, SAVE_POLL_INTERVAL_MS)); + } +} + +/** What `prepareForPublish` returns: the DSL to write and how the view finds the component afterwards. */ +export interface PreparedDsl { + dsl: SavedDsl; + /** For a grid type: the name of the component (`barChart1`), its element carries `data-comp-name`. */ + compName?: string; +} + +/** + * The saved DSL as S1 writes it back before publishing: a grid type's component gets `dataTestId` (a copy; the input is + * not changed), a hook type gets the readiness text (`READY_TEXT`, test id `READY_TEST_ID`) on its otherwise empty grid. + */ +export function prepareForPublish(saved: SavedDsl, compType: string): PreparedDsl { + const dsl = structuredClone(saved); + if (HOOK_TYPES.has(compType)) { + const ready = text({ ...READY_ITEM, text: READY_TEXT, testId: READY_TEST_ID }); + const added = containerOf([ready]); + dsl.ui = { + ...dsl.ui, + layout: { ...(dsl.ui.layout ?? {}), ...added.layout }, + items: { ...(dsl.ui.items ?? {}), ...(added.items as NonNullable) }, + }; + return { dsl }; + } + const item = Object.values(dsl.ui.items ?? {}).find((candidate) => candidate.compType === compType); + if (!item) { + throw new Error(`the saved DSL has no ${compType} to give a test id: ${JSON.stringify(dsl.ui).slice(0, 300)}`); + } + item.comp = { ...(item.comp ?? {}), dataTestId: testIdOf(compType) }; + return { dsl, compName: item.name }; +} diff --git a/e2e/src/components/insert-catalog.ts b/e2e/src/components/insert-catalog.ts new file mode 100644 index 0000000000..59ae0dd8b1 --- /dev/null +++ b/e2e/src/components/insert-catalog.ts @@ -0,0 +1,150 @@ +/** + * The 112 component types of the editor's Components pane, as S1 (the insert-every-tile smoke test) needs them: the + * tile label the panel search finds each by, the five types that live in the DSL `hooks` instead of on the grid, and + * the grid types that render no `data-testid`. Inventory taken from the pane of 3.0.0-e2e; + * `tests/components/insert-catalog.spec.ts` keeps it in step with the recordings in `fixtures/dsl`. + */ + +/** Component type -> the label of its tile (the panel search text is derived from it, see `searchTextOf`). */ +export const INSERT_TILE_LABELS: Readonly> = { + barChart: "Bar Chart", + lineChart: "Line Chart", + pieChart: "Pie Chart", + scatterChart: "Scatter Chart", + candleStickChart: "Candlestick Chart", + funnelChart: "Funnel Chart", + gaugeChart: "Gauge Chart", + graphChart: "Graph Chart", + heatmapChart: "Heatmap Chart", + radarChart: "Radar Chart", + sankeyChart: "Sankey Chart", + sunburstChart: "Sunburst Chart", + themeriverChart: "Theme River Chart", + treeChart: "Tree Chart", + treemapChart: "Treemap Chart", + openLayersGeoMap: "Openlayers Geomap", + chartsGeoMap: "Geo Map Charts", + table: "Table", + tableLite: "Table (Lite)", + pivotTable: "Pivot Table", + mermaid: "Mermaid Chart", + timeline: "Timeline", + progress: "Progress", + progressCircle: "Progress Circle", + shape: "Shapes", + text: "Text Display", + responsiveLayout: "Responsive Layout", + pageLayout: "Page Layout", + columnLayout: "Column Layout", + splitLayout: "Split Layout", + floatTextContainer: "Float Text Container", + card: "Content Card", + tabbedContainer: "Tabbed Container", + collapsibleContainer: "Collapsible Container", + container: "Container", + listView: "List View", + grid: "Grid", + multiTags: "Tags", + modal: "Modal", + drawer: "Drawer", + toast: "Toast", + divider: "Divider", + navigation: "Navigation", + step: "Step Control", + cascader: "Cascader", + link: "Link", + floatingButton: "Float Button", + tree: "Tree", + treeSelect: "Tree Select", + form: "Form", + jsonSchemaForm: "JSON Schema Form", + jsonEditor: "JSON Editor", + jsonExplorer: "JSON Explorer", + richTextEditor: "Rich Text Editor", + input: "Input", + password: "Password", + numberInput: "Number Input", + textArea: "Text Area", + autocomplete: "Auto Complete", + switch: "Switch", + checkbox: "Checkbox", + radio: "Radio", + date: "Date", + dateRange: "Date Range", + time: "Time", + timeRange: "Time Range", + slider: "Slider", + rangeSlider: "Range Slider", + button: "Form Button", + controlButton: "Icon Button", + dropdown: "Dropdown", + toggleButton: "Toggle Button", + segmentedControl: "Segmented Control", + rating: "Rating", + select: "Select", + multiSelect: "Multiselect", + sharingcomponent: "Screen Share Stream", + videocomponent: "Camera Stream", + meeting: "Agora Meeting Controller", + avatar: "Avatar", + avatarGroup: "Avatar Group", + comment: "Comment", + mention: "Mention", + chatController: "Chat Controller", + chatBox: "Chat Box", + chat: "AI Chat", + calendar: "Calendar", + timer: "Timer", + ganttChart: "Gantt Chart", + kanban: "Kanban Board (preview!)", + hillchart: "Hillchart", + bpmnEditor: "BPMN Editor", + file: "File Upload", + fileViewer: "File Viewer", + qrCode: "QR Code", + transfer: "Transfer", + scanner: "Scanner", + signature: "Signature", + tour: "Tour", + turnstileCaptcha: "Turnstile Captcha", + image: "Image", + carousel: "Image Carousel", + audio: "Audio", + video: "Video", + jsonLottie: "Lottie Animation", + icon: "Icons", + imageEditor: "Image Editor", + colorPicker: "Color Picker", + iframe: "IFrame", + custom: "Custom Component", + chart: "Chart (deprecated)", + basicChart: "Multitype Chart", +}; + +/** Every type of the pane, in the pane's order. */ +export const INSERT_TYPES: readonly string[] = Object.keys(INSERT_TILE_LABELS); + +/** + * The types that are not on the grid until something opens them: the DSL keeps them in `hooks` and the published view + * shows no element of their own (no test id, no `data-comp-name`). + */ +export const HOOK_TYPES: ReadonlySet = new Set(["modal", "drawer", "toast", "chatController", "meeting"]); + +/** + * Grid types whose rendered component carries no `data-testid` even when `dataTestId` is set: the + * view is located by the component's name, `[data-comp-name=]`. + */ +export const TYPES_WITHOUT_TEST_ID: ReadonlySet = new Set([ + "barChart", "basicChart", "candleStickChart", "chart", "chartsGeoMap", "funnelChart", "gaugeChart", "graphChart", + "grid", "heatmapChart", "kanban", "lineChart", "listView", "pieChart", "radarChart", "sankeyChart", "scatterChart", + "sunburstChart", "themeriverChart", "treeChart", "treemapChart", +]); + +/** The panel search text for a type: its label without spaces, lower case (the search the probe used for all 112). */ +export function searchTextOf(compType: string): string { + const label = INSERT_TILE_LABELS[compType]; + if (label === undefined) { + throw new Error(`no tile label is known for the component type "${compType}"`); + } + return label.replace(/\s+/g, "").toLowerCase(); +} diff --git a/e2e/src/components/scenario.ts b/e2e/src/components/scenario.ts new file mode 100644 index 0000000000..dc743eed57 --- /dev/null +++ b/e2e/src/components/scenario.ts @@ -0,0 +1,92 @@ +/** + * Helpers shared by the component scenarios S2-S7: a + * seeded published view in which each behaviour is made visible through a text bound to the component's exposed + * state, one text per observed value. + */ +import type { Page } from "@playwright/test"; +import { appDsl, text, type AppParts, type DslItem } from "../dsl/builders"; +import type { AppViewPage } from "../pages/AppViewPage"; +import { openSeededApp } from "../simple-components/seed"; + +/** Raised when a path of a recorded component does not exist, so a nested override cannot be placed silently. */ +export class ComponentPathError extends Error { + constructor(path: readonly (string | number)[], reason: string) { + super(`cannot set ${path.join(".")}: ${reason}`); + this.name = "ComponentPathError"; + } +} + +/** Prefix of the test id the S2-S7 scenarios give a component: the component `` has the test id `e2e-`. */ +export const COMPONENT_TEST_ID_PREFIX = "e2e-"; + +export function testIdOf(name: string): string { + return `${COMPONENT_TEST_ID_PREFIX}${name}`; +} + +/** Prefix of the test id of a bound text: the text that shows component `` has the test id `t-`. */ +export const BOUND_TEXT_TEST_ID_PREFIX = "t-"; + +/** Grid height (rows) of a bound text. */ +export const BOUND_TEXT_ROWS = 4; + +export function boundTextTestId(name: string): string { + return `${BOUND_TEXT_TEST_ID_PREFIX}${name}`; +} + +/** A text that shows `expression` (e.g. `{{input1.value}}`), addressable as `boundTextTestId(name)`. */ +export function boundText(params: { id: string; name: string; expression: string }): DslItem { + const item = text({ + id: `tx-${params.id}`, + name: `t_${params.name}`, + text: params.expression, + testId: boundTextTestId(params.name), + }); + return { ...item, layout: { ...item.layout, h: BOUND_TEXT_ROWS } }; +} + +/** + * Returns a deep copy of `comp` with `value` set at `path` (object keys and array indexes). Every step of the path + * but the last must exist, so a typo in a nested handler path fails here and not as a silently ignored property. + */ +export function withValueAt( + comp: Record, + path: readonly (string | number)[], + value: unknown, +): Record { + if (path.length === 0) { + throw new ComponentPathError(path, "the path is empty"); + } + const copy = structuredClone(comp); + let cursor: unknown = copy; + path.forEach((step, index) => { + const isLast = index === path.length - 1; + if (cursor === null || typeof cursor !== "object") { + throw new ComponentPathError(path, `${path.slice(0, index).join(".")} is not an object or array`); + } + const container = cursor as Record; + if (isLast) { + container[step] = value; + return; + } + if (!(step in container)) { + throw new ComponentPathError(path, `${path.slice(0, index + 1).join(".")} does not exist`); + } + cursor = container[step]; + }); + return copy; +} + +/** + * Creates and publishes an app holding `items` and opens its published view. The app belongs to the test's own user + * (`apiUser.orgId`), so no test shares state with another. Only builds the DSL; the workflow is `openSeededApp`. + */ +export async function openSeededView( + page: Page, + orgId: string, + appName: string, + items: DslItem[], + parts: AppParts = {}, +): Promise { + const { view } = await openSeededApp(page, page.request, { orgId, name: appName, dsl: appDsl(items, parts) }); + return view; +} diff --git a/e2e/src/constants.ts b/e2e/src/constants.ts new file mode 100644 index 0000000000..e1c9da91f3 --- /dev/null +++ b/e2e/src/constants.ts @@ -0,0 +1,739 @@ +/** `code` of every successful Lowcoder API response (ResponseView). */ +export const API_OK = 1; + +/** AppTypeEnum.Application in client/packages/lowcoder/src/constants/applicationConstants.ts. */ +export const APP_TYPE_APPLICATION = 1; + +/** AppTypeEnum.Module in the same file: a module is an app of this type that other apps embed. */ +export const APP_TYPE_MODULE = 2; + +/** The DSL a module has when it is created without one (recorded from the editor's "Create Module"). */ +export const EMPTY_MODULE_DSL = { ui: { compType: "module", comp: {} } } as const; + +/** The version tag of the second publication of an app (the first is FIRST_VERSION_TAG in api/client.ts). */ +export const SECOND_VERSION_TAG = "2.0.0"; + +/** Authentication source and id of the e-mail/password login, from GET /api/configs. */ +export const AUTH_SOURCE_EMAIL = "EMAIL"; +export const AUTH_ID_EMAIL = "EMAIL"; + +export const API_PATHS = { + LOGIN: "/api/auth/form/login", + CURRENT_USER: "/api/users/me", + APPLICATIONS: "/api/applications", + APPLICATION_LIST: "/api/applications/list", + APPLICATION_RECYCLE_LIST: "/api/applications/recycle/list", + INVITATION: "/api/invitation", + MARK_USER_STATUS: "/api/users/mark-status", + DATASOURCES: "/api/datasources", + // Routes of the security helpers and scenarios (tests/security/): + APPLICATION_RECORDS: "/api/application-records", + APPLICATION_HISTORY_SNAPSHOTS: "/api/application/history-snapshots", + BUNDLES: "/api/bundles", + BUNDLE_LIST: "/api/bundles/list", + FOLDERS: "/api/folders", + FOLDER_ELEMENTS: "/api/folders/elements", + ORGANIZATIONS: "/api/organizations", + GROUPS: "/api/groups", + GROUP_LIST: "/api/groups/list", + USERS: "/api/users", + USER_MY_ORG: "/api/users/myorg", + USER_PHOTO: "/api/users/photo", + USER_PASSWORD: "/api/users/password", + USER_RESET_PASSWORD: "/api/users/reset-password", + USER_LOST_PASSWORD: "/api/users/lost-password", + AUTH_TP_LOGIN: "/api/auth/tp/login", + AUTH_EMAIL_BIND: "/api/auth/email/bind", + USER_RESET_LOST_PASSWORD: "/api/users/reset-lost-password", + INVITATION_EMAIL: "/api/invitation/email/invite", + AUTH_LOGOUT: "/api/auth/logout", + AUTH_CONFIG: "/api/auth/config", + AUTH_CONFIGS: "/api/auth/configs", + API_KEYS: "/api/auth/api-key", + QUERY_EXECUTE: "/api/query/execute", + QUERY_EXECUTE_FROM_NODE: "/api/query/execute-from-node", + LIBRARY_QUERIES: "/api/library-queries", + CONFIGS: "/api/configs", + META: "/api/meta/", + STATUS_PROMETHEUS: "/api/status/prometheus", + /** The registry proxy of the app: `//` (api/npm/PrivateNpmRegistryEndpoint.java). */ + NPM_REGISTRY: "/api/npm/registry", +} as const; + +/** `GET` path of the registry proxy for a package of the app; the proxy is open to anonymous callers (D-35). */ +export function npmRegistryPath(appId: string, packageName: string): string { + return `${API_PATHS.NPM_REGISTRY}/${appId}/${packageName}`; +} + +/** Key of the organisation common setting that holds the npm registry entries (`PUT /api/organizations/{orgId}/common-settings`). */ +export const NPM_REGISTRIES_SETTING_KEY = "npmRegistries"; + +/** + * The HTTP echo sidecar that scripts/run-in-docker.sh starts on the run's network (scripts/echo-server.js): the target of + * requests the SERVER makes inside the app container. `ECHO_ENV` names the variable the run script sets to its base URL. + */ +export const ECHO_ENV = "E2E_ECHO_URL"; + +/** The control routes of the echo sidecar; every other path is recorded and answered `{}`. */ +export const ECHO_PATHS = { HEALTH: "/__e2e/health", REQUESTS: "/__e2e/requests", MAILS: "/__e2e/mails", ANSWERS: "/__e2e/answers" } as const; + +/** Path prefix of the echo targets: a test's own target is `-`, so parallel tests never read each other's records. */ +export const ECHO_TARGET_PREFIX = "/t/"; + +/** Subjects of the mails the server sends (EmailCommunicationServiceImpl): a mail is told apart by its subject. */ +export const MAIL_SUBJECTS = { PASSWORD_RESET: "Reset Your Lost Password", INVITATION: "You've been invited!" } as const; + +/** The page a reset link opens (client routesURL.ts), and the query parameter that carries the token. */ +export const RESET_PASSWORD_PAGE = "/user/auth/lost-password"; +export const RESET_TOKEN_PARAM = "token"; +/** The path of an invitation link in a mail, followed by the invitation code. */ +export const INVITE_LINK_PATH = "/invite/"; + +export function applicationPath(appId: string): string { + return `${API_PATHS.APPLICATIONS}/${appId}`; +} + +export function appViewPath(appId: string): string { + return `${applicationPath(appId)}/view`; +} + +export function appPermissionsPath(appId: string): string { + return `${applicationPath(appId)}/permissions`; +} + +export function publicToAllPath(appId: string): string { + return `${applicationPath(appId)}/public-to-all`; +} + +export function recyclePath(appId: string): string { + return `${API_PATHS.APPLICATIONS}/recycle/${appId}`; +} + +export function restorePath(appId: string): string { + return `${API_PATHS.APPLICATIONS}/restore/${appId}`; +} + +export function invitationAcceptPath(inviteCode: string): string { + return `${API_PATHS.INVITATION}/${inviteCode}/invite`; +} + +/** `code` of the API answer when the user may not view or edit the app (observed on the 3.0.0 image). */ +export const API_CODE_APP_PERMISSION_DENIED = 5308; + +export function publishPath(appId: string): string { + return `${applicationPath(appId)}/publish`; +} + +export const APP_PAGE = { + EDIT: (appId: string) => `/apps/${appId}/edit`, + VIEW: (appId: string) => `/apps/${appId}/view`, +} as const; + +export const UI_PATHS = { + REGISTER: "/user/auth/register", + APP_LIST_PATH: "/apps", + APP_LIST: /\/apps/, + LOGIN: /\/user\/auth\/login/, + /** Where a visitor who may not see an app lands: the sign-in page of the app's workspace. */ + LOGIN_IN_ORG: /\/org\/[^/]+\/auth\/login/, + /** The classic one-step e-mail and password form, "for super admin" by its comment, open to anyone (`loginAdmin.tsx`). */ + ADMIN_LOGIN: "/admin/login", +} as const; + +/** Meets the password rules of the sign-up form. */ +export const TEST_PASSWORD = "Passw0rd-e2e"; + +/** User status flag of the pop-up for older non-developer users (`UserStatusType.java`). */ +export const USER_STATUS_OLDER_NON_DEV_POPUP = "olderUserNonDevPopup"; + +/** User status flag that the new-user tour sets when it is finished (HomeTutorialsV2.tsx). */ +export const NEW_USER_GUIDANCE_STATUS = "newUserGuidance"; + +/** The `example.test` domain cannot receive mail (RFC 2606). */ +export const TEST_EMAIL_DOMAIN = "example.test"; + +/** + * Annotation type of a test that lost an editor save (defect D-3) and redid its steps on a fresh app. The + * D-3 threshold reporter counts the tests that carry it (src/reporters/d3-threshold-reporter.ts). + */ +export const D3_RETRY_ANNOTATION = "D-3 retry"; + +export const TAGS = { + SMOKE: "@smoke", + CORE: "@core", + SLOW: "@slow", + QUARANTINE: "@quarantine", + /** Components the browser loads from npm through the app's node-service; the app container needs internet access. */ + NPM: "@npm", + /** + * The insert-every-component smoke test (S1, 112 tests): out of the default run, in only with + * E2E_INCLUDE_INSERT_ALL (see src/run-selection.ts). + */ + INSERT_ALL: "@insert-all", + /** Access-control tests of tests/security/ (permission matrix, cross-workspace, abuse); see src/security/quarantine.ts. */ + SECURITY: "@security", + /** A user-lifecycle test (sign-up to deletion), ids `LC-`; in the default run (see src/security/quarantine.ts). */ + LIFECYCLE: "@lifecycle", + /** + * The tests of the instance super admin (SEC-R16a to SEC-R16d): out of the default run and of the @security and @core + * gate runs, in only with E2E_INCLUDE_SUPERADMIN (see src/run-selection.ts). On the 3.0.0 image the super admin is a + * member of every workspace and its requests time out once the stack holds more than about 420 workspaces (defect + * D-47), a size that repeated security runs reach. SEC-R16c and SEC-R16d also carry @quarantine and need both flags. + */ + SUPERADMIN: "@superadmin", + /** + * The tests of the second stack in ENTERPRISE workspace mode (SEC-E01 to SEC-E06b, tests/security/enterprise*.spec.ts): + * out of every run on the default stack, the only ones of a run with E2E_STACK_PROFILE=enterprise (see + * src/run-selection.ts). SEC-E05 also carries @quarantine (open defect D-40) and @superadmin. + */ + ENTERPRISE: "@enterprise", + /** + * SEC-E05 alone: it resets the instance super admin's password, which breaks every later super-admin sign-in of its stack, + * so it must never share a stack with another test. Out of every run unless E2E_INCLUDE_ENTERPRISE_TAKEOVER is set, and + * then the ONLY test of the run (enterprise profile only; see src/run-selection.ts). It also carries @enterprise and @quarantine. + */ + ENTERPRISE_TAKEOVER: "@enterprise-takeover", + /** + * The tests of the third stack, with the deployment setting LOWCODER_EMAIL_SIGNUP_ENABLED=false (tests/auth/signup-disabled.spec.ts): + * out of every run on the other stacks, the only ones of a run with E2E_STACK_PROFILE=signup-disabled (see src/run-selection.ts). + * Every fixture that makes a user signs up, so no other test can run on that stack. + */ + SIGNUP_DISABLED: "@signup-disabled", +} as const; + +/** Environment variables that widen the run beyond the default selection (read by playwright.config.ts). */ +export const RUN_FLAGS = { + INCLUDE_QUARANTINE: "E2E_INCLUDE_QUARANTINE", + INCLUDE_INSERT_ALL: "E2E_INCLUDE_INSERT_ALL", + INCLUDE_SUPERADMIN: "E2E_INCLUDE_SUPERADMIN", + /** Enterprise profile only: run SEC-E05 (`@enterprise-takeover`) and nothing else. */ + INCLUDE_ENTERPRISE_TAKEOVER: "E2E_INCLUDE_ENTERPRISE_TAKEOVER", +} as const; + +/** Environment variable that picks the stack a run is made for; `run-in-docker.sh` sets it for the runner (read by playwright.config.ts). */ +export const STACK_PROFILE_ENV = "E2E_STACK_PROFILE"; + +/** + * The stacks `run-in-docker.sh` starts: `default` is the all-in-one image in its SAAS workspace mode, `enterprise` the same + * image with LOWCODER_WORKSPACE_MODE=ENTERPRISE (one workspace shared by all users). A missing variable means `default`. + */ +export const STACK_PROFILES = { DEFAULT: "default", ENTERPRISE: "enterprise", SIGNUP_DISABLED: "signup-disabled" } as const; +export type StackProfile = (typeof STACK_PROFILES)[keyof typeof STACK_PROFILES]; + +/** + * Names (only the names: the values are never in the code) of the environment variables that carry the instance super + * admin of the stack. `e2e/scripts/run-in-docker.sh` sets both for each run, with a new random password, and passes them + * to the runner by name (`docker run -e NAME`). Read by `superAdminCredentials` (src/security/super-admin.ts). + */ +export const SUPER_ADMIN_ENV = { + USERNAME: "E2E_SUPERUSER_USERNAME", + PASSWORD: "E2E_SUPERUSER_PASSWORD", +} as const; + +/** + * WORKAROUND for defect D-5: a component dropped within about 0.5 s after + * the editor reports ready gets the layout width 0 and is unusable. Measured on 3.0.0-e2e, 4 drops per delay: + * 0 ms -> 4 of 4 had width 0, 500 ms -> 1 of 4, 1000 ms and more -> 0 of 4. Remove when the editor exposes a + * signal for the layout being measured. + */ +export const GRID_SETTLE_MS = 1500; + +export const SAVE_POLL_TIMEOUT_MS = 20_000; +export const INSERT_PANEL_TIMEOUT_MS = 30_000; +export const INSERT_PANEL_ATTEMPT_TIMEOUT_MS = 3_000; + +/** Request failure reported by Chromium for a request that a Playwright route aborted with "blockedbyclient". */ +export const BLOCKED_BY_CLIENT_ERROR = "net::ERR_BLOCKED_BY_CLIENT"; + +/** Origin the client reports to for subscriptions; the network guard has to block it. */ +export const LOWCODER_CLOUD_FLOW_URL = "https://api-service.lowcoder.cloud/api/flow"; + +/** + * The PostgreSQL sidecar that scripts/run-in-docker.sh starts on the run's network (see fixtures/sql/init.sql). + * The run script passes its host name; the rest is fixed there. + */ +export const POSTGRES = { + HOST_ENV: "E2E_POSTGRES_HOST", + PORT: 5432, + DATABASE: "shop", + USERNAME: "postgres", + PASSWORD: "e2e-postgres-password", +} as const; + +export const SEEDED_ITEM_NAMES = ["alpha", "beta"] as const; + +/** Component type, panel search text, drop position and generated name of the button the editor tests drop. */ +export const BUTTON_COMP_TYPE = "button"; +export const BUTTON_SEARCH_TEXT = "Button"; +export const FIRST_BUTTON_NAME = "button1"; +export const DROP_TARGET = { x: 120, y: 40 } as const; + +/** A WebSocket endpoint on lowcoder.cloud, for the network guard test. */ +export const LOWCODER_CLOUD_WS_URL = "wss://api-service.lowcoder.cloud/e2e-guard-check"; + +export const IMPORT_ATTEMPT_TIMEOUT_MS = 3_000; +export const IMPORT_TIMEOUT_MS = 20_000; + +/** The browser local-storage key under which an app's `localStorage` component keeps its values. */ +export const LOCAL_STORAGE_NAMESPACE = "lowcoder_app_local_storage"; + +/** + * How long a test reads a text that must NOT change after a click that should deliver nothing (a module event + * without a handler). The probes waited this long; the window bounds a late event, it does not exclude one. + */ +export const NEGATIVE_EVENT_WINDOW_MS = 1_000; + +/** Labels the table component shows (toolbar and header filter), as the 3.0.0 client renders them. */ +export const TABLE_LABELS = { + /** Toolbar button that appears only while an edited cell has not been saved. */ + SAVE_CHANGES: "Save Changes", + /** Confirmation button of a column filter menu. */ + FILTER_CONFIRM: "OK", +} as const; + +/** The table component's default page size (recorded `pagination`, fixtures/dsl/table.json). */ +export const TABLE_DEFAULT_PAGE_SIZE = 5; + +/** + * The read-only `products` table of fixtures/sql/init.sql, which the SQL generates. Keep both in step. + * `FIRST_FIVE_STOCK` is `stock` of ids 1 to 5, the oracle D1 reads through `slice(0, 5)`. + */ +export const PRODUCTS = { + ROW_COUNT: 25, + FIRST_NAME: "product-01", + LAST_NAME: "product-25", + CATEGORY_COUNTS: { tools: 8, books: 9, games: 8 }, + FIRST_FIVE_STOCK: [3, 6, 9, 12, 15], + COLUMNS: ["id", "name", "category", "price", "stock"], +} as const; + +/** Labels of the editor's Extensions panel (Insert tab) and its two "add npm package" dialogs. */ +export const EXTENSIONS_LABELS = { + PANEL: "Extensions", + INSERT_TAB: "Insert", + ADD_PLUGIN: "Add npm Plugin", + ADD_TEMPLATE: "Add npm Template", + /** Titles of the two lists; each list's tiles sit in the element that follows its title. */ + PLUGIN_LIST_TITLE: "Plugins", + TEMPLATE_LIST_TITLE: "Templates", + EMPTY_PLUGINS: "No plugins added yet.", + EMPTY_TEMPLATES: "No templates added yet.", +} as const; + +/** Test id prefix of a tile of the insert panel; an npm package's tile id is `insert-comp-remote#npm#@#`. */ +export const INSERT_TILE_TEST_ID_PREFIX = "insert-comp-"; +export const NPM_TILE_TEST_ID_PREFIX = `${INSERT_TILE_TEST_ID_PREFIX}remote#npm#`; +/** Test id of every module tile of the Extensions panel (the tile shows the module's name). */ +export const MODULE_TILE_TEST_ID = `${INSERT_TILE_TEST_ID_PREFIX}module`; + +/** How long an npm package takes to become a tile (the app's node-service fetches it from the registry; 1.2 s measured). */ +export const NPM_PACKAGE_TILE_TIMEOUT_MS = 90_000; +/** How long the editor takes to show a dropped module instance in the component list. */ +export const MODULE_INSTANCE_TIMEOUT_MS = 15_000; + +/** Labels of the property panel's event handler list and of the action popover (3.0.0 client, English). */ +export const EVENT_HANDLER_LABELS = { + ADD: "Add", + /** The action a new handler starts with. */ + DEFAULT_ACTION: "Run a Data Query", + SET_TEMP_STATE_ACTION: "Set a Temporary State value", + /** Row label of the state select in the "Set a Temporary State value" popover. */ + STATE_FIELD: "State", + /** Row label of the value field of that popover. */ + VALUE_FIELD: "value", +} as const; + +/** Positions of the `.ant-select`s in the action popover (recorded: the action type, the State, the Debounce select). */ +export const ACTION_POPOVER_SELECT_INDEX = { ACTION_TYPE: 0, STATE: 1 } as const; + +/** How long one step of the action popover waits for its element before the handler setup is retried. */ +export const ACTION_STEP_TIMEOUT_MS = 10_000; + +/** How long a re-entered handler popover is given to show its State row, which tells that the action is already set. */ +export const ACTION_REENTRY_PROBE_MS = 2_000; + +// --------------------------------------------------------------------------------------------------------------- +// Security tests (tests/security/, helpers in src/security/ and the security helpers of src/api/client.ts) +// --------------------------------------------------------------------------------------------------------------- + +/** `MemberRole` of an organisation member or group member (domain/organization/model/MemberRole.java:9-11). */ +export const ORG_ROLES = { ADMIN: "admin", MEMBER: "member", SUPER_ADMIN: "super_admin" } as const; +export type OrgRole = (typeof ORG_ROLES)[keyof typeof ORG_ROLES]; + +/** `ResourceRole` of an app, datasource, folder or bundle grant (domain/permission/model/ResourceRole.java:20-22). */ +export const APP_ROLES = { VIEWER: "viewer", EDITOR: "editor", OWNER: "owner" } as const; +export type AppRole = (typeof APP_ROLES)[keyof typeof APP_ROLES]; + +/** What a denied or failed call answers: the HTTP status and the `code` of the `ResponseView` body. */ +export interface ApiError { + status: number; + /** `undefined` when the answer has no JSON body (the entry point of an unauthenticated call sets only the status). */ + code: number | undefined; +} + +/** + * `{ status, code }` of the `BizError` constants the security tests expect, copied from + * server/api-service/lowcoder-sdk/src/main/java/org/lowcoder/sdk/exception/BizError.java (unchanged since 3.0.0). + * A test asserts both fields. The line numbers of the file are in the comments. + */ +export const API_ERRORS = { + /** An authenticated route called without a session: the entry point answers the status only, no body + * (api/framework/security/AuthenticationEntryPoint.java:17-21). */ + UNAUTHENTICATED: { status: 401, code: undefined }, + INTERNAL_SERVER_ERROR: { status: 500, code: 5000 }, // :13 + NOT_AUTHORIZED: { status: 401, code: 5001 }, // :14 + INVALID_PARAMETER: { status: 500, code: 5002 }, // :15 + UNSUPPORTED_OPERATION: { status: 400, code: 5003 }, // :16 + NO_RESOURCE_FOUND: { status: 500, code: 5005 }, // :18 + INVALID_ORG_ID: { status: 500, code: 5100 }, // :28 + LAST_ADMIN_CANNOT_LEAVE_ORG: { status: 500, code: 5102 }, // :30 + UNABLE_TO_FIND_VALID_ORG: { status: 500, code: 5105 }, // :33 + INVALID_GROUP_ID: { status: 500, code: 5150 }, // :38 + /** The last admin of a group leaving it (`BizError.java`). */ + CANNOT_LEAVE_GROUP: { status: 500, code: 5152 }, // :40 + /** Deleting the all-users or the developers group. */ + CANNOT_DELETE_SYSTEM_GROUP: { status: 500, code: 5154 }, // :42 + NEED_DEV_TO_CREATE_RESOURCE: { status: 500, code: 5155 }, // :44 + INVALID_INVITATION_CODE: { status: 400, code: 5200 }, // :47 + QUERY_NOT_FOUND: { status: 500, code: 5300 }, // :55 + ILLEGAL_APPLICATION_PERMISSION_ID: { status: 500, code: 5302 }, // :57 + NO_PERMISSION_TO_VIEW: { status: 403, code: 5304 }, // :59 + INVALID_HISTORY_SNAPSHOT: { status: 500, code: 5307 }, // :63 + /** Equal to API_CODE_APP_PERMISSION_DENIED, which stays for the existing tests. */ + NO_PERMISSION_TO_REQUEST_APP: { status: 403, code: 5308 }, // :65 + APPLICATION_AND_ORG_NOT_MATCH: { status: 400, code: 5309 }, // :66 + DATASOURCE_NOT_FOUND: { status: 500, code: 5500 }, // :69 + DATASOURCE_AND_APP_ORG_NOT_MATCH: { status: 500, code: 5510 }, // :80 + USER_NOT_SIGNED_IN: { status: 401, code: 5600 }, // :85 + /** An upload above the configured limit (`avatarMaxSizeInKb`, 300; read in the code, not measured: 3.0.0 accepts it). */ + PAYLOAD_TOO_LARGE: { status: 413, code: 5700 }, + /** `PUT /api/users/mark-status` with a type that is not a user status (`UserController.java`; `BizError` INVALID_USER_STATUS). */ + INVALID_USER_STATUS: { status: 500, code: 6200 }, // :135 + /** The form sign-up of an address that is registered, in any casing (`FormAuthRequest.java`). */ + USER_LOGIN_ID_EXIST: { status: 403, code: 5607 }, // :107 + /** The form login of a wrong password, an unknown address and (ENTERPRISE mode, measured) a user deleted by a removal. */ + INVALID_PASSWORD: { status: 403, code: 5608 }, // :92 + /** A second sign-in configuration of a provider type that already has one (`AuthenticationApiServiceImpl.java` [3.0.0] `:308-323`; NOT enforced on the image, D-61). */ + DUPLICATE_AUTH_CONFIG_ADDITION: { status: 400, code: 5621 }, + /** A provider sign-in whose user the workspace's configuration may not create ("Allow Registration" off). */ + USER_NOT_EXIST: { status: 400, code: 5618 }, + /** A provider sign-in whose token or user-info call failed (`Failed to get OIDC information`; measured for an `invalid_grant` token answer). */ + OIDC_INFORMATION_FAILED: { status: 500, code: 5601 }, + /** Disabling or deleting the last enabled sign-in configuration of a workspace (measured). */ + DISABLE_AUTH_CONFIG_FORBIDDEN: { status: 403, code: 5617 }, + /** The form sign-up of an address that does not look like an e-mail address (`FormAuthRequest.java`). */ + INVALID_EMAIL_FORMAT: { status: 400, code: 5623 }, // :91 + LIBRARY_QUERY_AND_ORG_NOT_MATCH: { status: 400, code: 6103 }, // :131 + LIBRARY_QUERY_NOT_FOUND: { status: 400, code: 6104 }, // :132 + USER_BANNED: { status: 500, code: 6201 }, // :136 + FOLDER_OPERATE_NO_PERMISSION: { status: 500, code: 6301 }, // :143 + ILLEGAL_FOLDER_PERMISSION_ID: { status: 500, code: 6304 }, // :146 + BUNDLE_OPERATE_NO_PERMISSION: { status: 500, code: 6401 }, // :152 + ILLEGAL_BUNDLE_PERMISSION_ID: { status: 500, code: 6404 }, // :155 + ORGANIZATION_NOT_FOUND: { status: 400, code: 6701 }, // :165 +} as const satisfies Record; + +/** + * The published default of LOWCODER_API_KEY_SECRET (deploy/docker/default.env:100). Only SEC-A01 uses it, to forge + * an API-key token and prove the server refuses one signed with a public value. It is documented public text, not a + * credential of this throw-away stack; whether the image runs with it does not change A01's expected result. + */ +export const PUBLIC_DEFAULT_API_KEY_SECRET = "5a41b090758b39b226603177ef48d73ae9839dd458ccb7e66f7e7cc028d5a50b"; + +/** + * Name of the session cookie (LOWCODER_COOKIE_NAME, deploy/docker/default.env:59). The helper unit test reads it from + * the `Set-Cookie` of a registration, which tells whether the image overrides it. + */ +export const SESSION_COOKIE_NAME = "LOWCODER_CE_SELFHOST_TOKEN"; + +export function appSlugPath(appId: string): string { + return `${applicationPath(appId)}/slug`; +} + +export function appPermissionPath(appId: string, permissionId: string): string { + return `${appPermissionsPath(appId)}/${permissionId}`; +} + +export function appRecordsByAppPath(): string { + return `${API_PATHS.APPLICATION_RECORDS}/listByApplicationId`; +} + +export function snapshotsPath(appId: string): string { + return `${API_PATHS.APPLICATION_HISTORY_SNAPSHOTS}/${appId}`; +} + +export function snapshotPath(appId: string, snapshotId: string): string { + return `${snapshotsPath(appId)}/${snapshotId}`; +} + +export function bundlePath(bundleId: string): string { + return `${API_PATHS.BUNDLES}/${bundleId}`; +} + +export function bundleRecyclePath(bundleId: string): string { + return `${API_PATHS.BUNDLES}/recycle/${bundleId}`; +} + +export function bundleViewPath(bundleId: string): string { + return `${bundlePath(bundleId)}/view`; +} + +export function bundleElementsPath(bundleId: string): string { + return `${bundlePath(bundleId)}/elements`; +} + +/** `PUT /api/bundles/addApp/{appId}?toBundleId=`: the bundle goes in the query. */ +export function bundleAddAppPath(appId: string): string { + return `${API_PATHS.BUNDLES}/addApp/${appId}`; +} + +export function bundleReorderPath(bundleId: string): string { + return `${bundlePath(bundleId)}/reorder`; +} + +export function bundlePermissionsPath(bundleId: string): string { + return `${bundlePath(bundleId)}/permissions`; +} + +export function bundlePublishPath(bundleId: string): string { + return `${bundlePath(bundleId)}/publish`; +} + +export function datasourcePath(datasourceId: string): string { + return `${API_PATHS.DATASOURCES}/${datasourceId}`; +} + +export function datasourceStructurePath(datasourceId: string): string { + return `${datasourcePath(datasourceId)}/structure`; +} + +export function datasourcePermissionsPath(datasourceId: string): string { + return `${datasourcePath(datasourceId)}/permissions`; +} + +/** The route of one datasource permission row; it has no datasource id (the server finds it from the row). */ +export function datasourcePermissionPath(permissionId: string): string { + return `${API_PATHS.DATASOURCES}/permissions/${permissionId}`; +} + +export function folderPermissionsPath(folderId: string): string { + return `${API_PATHS.FOLDERS}/${folderId}/permissions`; +} + +export function folderPermissionPath(folderId: string, permissionId: string): string { + return `${folderPermissionsPath(folderId)}/${permissionId}`; +} + +/** `PUT /api/folders/move/{appId}?targetFolderId=`: the target folder goes in the query. */ +export function folderMovePath(appId: string): string { + return `${API_PATHS.FOLDERS}/move/${appId}`; +} + +export function orgPath(orgId: string): string { + return `${API_PATHS.ORGANIZATIONS}/${orgId}`; +} + +export function orgMembersPath(orgId: string): string { + return `${orgPath(orgId)}/members`; +} + +export function orgCommonSettingsPath(orgId: string): string { + return `${orgPath(orgId)}/common-settings`; +} + +export function orgSlugPath(orgId: string): string { + return `${orgPath(orgId)}/slug`; +} + +export function orgUpdatePath(orgId: string): string { + return `${orgPath(orgId)}/update`; +} + +export function orgRolePath(orgId: string): string { + return `${orgPath(orgId)}/role`; +} + +/** `DELETE /api/organizations/{orgId}/remove?userId=`: the user goes in the query. */ +export function orgRemoveMemberPath(orgId: string): string { + return `${orgPath(orgId)}/remove`; +} + +export function orgLeavePath(orgId: string): string { + return `${orgPath(orgId)}/leave`; +} + +export function switchOrgPath(orgId: string): string { + return `${API_PATHS.ORGANIZATIONS}/switchOrganization/${orgId}`; +} + +export function orgsByUserPath(email: string): string { + return `${API_PATHS.ORGANIZATIONS}/byuser/${encodeURIComponent(email)}`; +} + +export function groupMembersPath(groupId: string): string { + return `${API_PATHS.GROUPS}/${groupId}/members`; +} + +export function groupPotentialMembersPath(groupId: string): string { + return `${API_PATHS.GROUPS}/${groupId}/potential-members`; +} + +/** `DELETE /api/groups/{id}`: deletes a group (a system group answers `API_ERRORS.CANNOT_DELETE_SYSTEM_GROUP`). */ +export function groupPath(groupId: string): string { + return `${API_PATHS.GROUPS}/${groupId}`; +} + +/** `PUT /api/groups/{id}/update`: renames a group. */ +export function groupUpdatePath(groupId: string): string { + return `${groupPath(groupId)}/update`; +} + +/** `DELETE /api/groups/{id}/leave`: the caller leaves the group (the last group admin cannot). */ +export function groupLeavePath(groupId: string): string { + return `${groupPath(groupId)}/leave`; +} + +export function groupAddMemberPath(groupId: string): string { + return `${API_PATHS.GROUPS}/${groupId}/addMember`; +} + +/** `DELETE /api/groups/{groupId}/remove?userId=`: the user goes in the query. */ +export function groupRemoveMemberPath(groupId: string): string { + return `${API_PATHS.GROUPS}/${groupId}/remove`; +} + +export function groupRolePath(groupId: string): string { + return `${API_PATHS.GROUPS}/${groupId}/role`; +} + +/** `PUT /api/users/{orgId}/{userId}`: rename a user (server: admin of the path organisation). */ +export function userProfilePath(orgId: string, userId: string): string { + return `${API_PATHS.USERS}/${orgId}/${userId}`; +} + +export function userPhotoPath(orgId: string, userId: string): string { + return `${API_PATHS.USERS}/photo/${orgId}/${userId}`; +} + +export function apiKeyPath(apiKeyId: string): string { + return `${API_PATHS.API_KEYS}/${apiKeyId}`; +} + +export function libraryQueryPath(libraryQueryId: string): string { + return `${API_PATHS.LIBRARY_QUERIES}/${libraryQueryId}`; +} + +export function configPath(key: string): string { + return `${API_PATHS.CONFIGS}/${key}`; +} + +/** `authType` of the OAuth configuration `seedOAuthConfig` stores: GitHub, which is only stored and never contacted. */ +export const OAUTH_AUTH_TYPE = "GITHUB"; + +/** `clientId` of that configuration: a placeholder, nothing is ever sent to GitHub with it. */ +export const OAUTH_DUMMY_CLIENT_ID = "e2e-dummy-client-id"; + +/** + * Heading of the error page a signed-in user of ANOTHER workspace gets for an app's editor or published view (measured + * on the 3.0.0 client: the denial 403 / 5308 of that user shows this, not the "no permission to view/edit" text a + * member of the workspace gets). The page has no test id. + */ +export const NOT_IN_WORKSPACE_MESSAGE = "Insufficient permissions: you are not in the workspace, please contact admin of this workspace."; + +/** `ApplicationStatus` of an app as the API reports it (domain/application/model/ApplicationStatus.java). */ +export const APP_STATUS = { NORMAL: "NORMAL", RECYCLED: "RECYCLED" } as const; + +/** Header and scheme of an API-key token (api/authentication/util/JWTUtils.java: `Authorization: Bearer `). */ +export const AUTHORIZATION_HEADER = "Authorization"; +export const BEARER_PREFIX = "Bearer "; + +/** Request header that carries a session cookie when a test replays a cookie value in a context that has none. */ +export const COOKIE_HEADER = "Cookie"; + +// --------------------------------------------------------------------------------------------------------------- +// Constants of the role and abuse scenarios +// --------------------------------------------------------------------------------------------------------------- + +/** `PUT /api/applications/{id}/public-to-marketplace` (body `{ publicToMarketplace }`). */ +export function publicToMarketplacePath(appId: string): string { + return `${applicationPath(appId)}/public-to-marketplace`; +} + +/** `GET /api/datasources/listByOrg?orgId=`: the datasources of a workspace that the caller may USE. */ +export function datasourcesByOrgPath(): string { + return `${API_PATHS.DATASOURCES}/listByOrg`; +} + +/** `GET /api/bundles/recycle/list`: the trash of bundles. */ +export const BUNDLE_RECYCLE_LIST_PATH = "/api/bundles/recycle/list"; + +/** + * The common-settings key that holds the password-reset e-mail template of a workspace + * (domain/organization/model/Organization.java sanitiser, SF-20 / D-25): it must never reach an anonymous visitor. + */ +export const PASSWORD_RESET_EMAIL_TEMPLATE_KEY = "PASSWORD_RESET_EMAIL_TEMPLATE"; + +/** An origin that is not the app's, sent as `Origin` to read the server's CORS answer (SEC-A12). Never contacted. */ +export const FOREIGN_ORIGIN = "https://evil.example.test"; + +/** Header names read by the CORS and forwarding scenarios. */ +export const ORIGIN_HEADER = "Origin"; +export const FORWARDED_FOR_HEADER = "X-Forwarded-For"; +export const REAL_IP_HEADER = "X-Real-IP"; +export const CORS_ALLOW_ORIGIN_HEADER = "access-control-allow-origin"; +export const CORS_ALLOW_CREDENTIALS_HEADER = "access-control-allow-credentials"; +export const SET_COOKIE_HEADER = "set-cookie"; +/** The loopback address the node-service gate of `POST /api/query/execute-from-node` trusts (SEC-A05). */ +export const LOOPBACK_ADDRESS = "127.0.0.1"; + +/** `GET /api/auth/api-keys`: the API keys of the signed-in user. */ +export const API_KEYS_LIST_PATH = "/api/auth/api-keys"; + +/** Query parameter of `POST /api/users/password`, the route that sets a password with no old one ("Set Password"). */ +export const USER_SET_PASSWORD_PARAM = "password"; + +/** + * The messages of the two token refusals of `reset-lost-password` (both answer 500 / 5002, `INVALID_PARAMETER`): a token that is + * stored but does not match, and an account with no live token (never requested, already used, or expired). Read from the + * answer body of the 3.0.0 image (`UserServiceImpl.java` [3.0.0] `:448-455`). + */ +export const RESET_TOKEN_MESSAGES = { + INVALID: "Invalid token received for password reset request", + EXPIRED: "Token to reset the password has expired", +} as const; + +/** + * How long a test polls for the clean-up a removal, a leave or a workspace deletion starts (a listener on its own scheduler, + * `OrganizationEventListener` [3.0.0]). Measured on the image: the rows of the user's groups and apps, and the memberships of a + * deleted workspace, were gone within 40 ms; the bound leaves room for a loaded runner. + */ +export const MEMBERSHIP_CLEANUP_TIMEOUT_MS = 10_000; + +/** The path of a workspace's own sign-in page, which lists its enabled providers. */ +export function orgLoginPath(orgId: string): string { + return `/org/${orgId}/auth/login`; +} + +/** The notice the provider page shows for the last enabled configuration (`detail/index.tsx`; measured text). */ +export const LAST_PROVIDER_NOTICE = "You can't disable/delete config as this is the only enabled configuration."; + +/** The password a scenario changes to (meets the password rules like TEST_PASSWORD, differs from it). */ +export const CHANGED_PASSWORD = "Passw0rd-e2e-changed"; + +/** Attributes the session cookie must carry (`CookieHelper.java:49-57`) and the one it must not (plain http stack). */ +export const COOKIE_HTTP_ONLY = "HttpOnly"; +export const COOKIE_SAME_SITE_LAX = "SameSite=Lax"; +export const COOKIE_SECURE = "Secure"; + +/** Client routes of the settings and the data source pages (3.0.0 client; they are mounted for every user, the client redirects). */ +export const SETTING_PATHS = { + HOME: "/setting", + /** The members of the "All Users" group: user name, joining time, role select. */ + MEMBERS: "/setting/permission/users", + OAUTH_PROVIDER: "/setting/oauth-provider", + /** The user groups: the group list with "Create Group" and "Invite Members". */ + GROUPS: "/setting/permission", + /** The workspaces of the user: create, switch, edit, delete. */ + WORKSPACES: "/setting/organization", +} as const; +export const DATASOURCE_PAGE_PATH = "/datasource"; diff --git a/e2e/src/datasource/notes-queries.ts b/e2e/src/datasource/notes-queries.ts new file mode 100644 index 0000000000..5457abc7be --- /dev/null +++ b/e2e/src/datasource/notes-queries.ts @@ -0,0 +1,50 @@ +import { eventHandler, executeQuery, postgresQuery } from "../dsl/builders"; + +/** `{{owner.value}}` is the temporary state that holds the test's token: every query reads and writes only its rows. */ +export const OWNER_STATE_NAME = "owner"; +export const OWNER_FILTER = `owner = {{${OWNER_STATE_NAME}.value}}`; +/** The note a write targets: the owner's newest row (ids are shared by all owners, so they are never asserted). */ +const NEWEST_OWN_NOTE = `id = (SELECT max(id) FROM notes WHERE ${OWNER_FILTER})`; + +export const SELECT_PRODUCTS = "selectProducts"; +export const SELECT_NOTES = "selectNotes"; +export const SELECT_PRODUCTS_SQL = "SELECT id, name, category, price, stock FROM products ORDER BY id"; +const QUIET = { showSuccess: false } as const; +/** What a write query does when it succeeds: it re-reads the owner's notes. */ +export const REREAD_NOTES = [eventHandler("success", executeQuery(SELECT_NOTES))]; + +/** The read-only `products` query shared by D1 and D2 (automatic, no success toast). */ +export function selectProductsQuery(datasourceId: string, id: string): object { + return postgresQuery({ id, name: SELECT_PRODUCTS, datasourceId, sql: SELECT_PRODUCTS_SQL, notification: QUIET }); +} + +/** `selectNotes`: the owner's rows (automatic). */ +export function selectNotesQuery(datasourceId: string, id: string): object { + return postgresQuery({ + id, + name: SELECT_NOTES, + datasourceId, + sql: `SELECT id, body FROM notes WHERE ${OWNER_FILTER} ORDER BY id`, + notification: QUIET, + }); +} + +/** A manual write query that re-reads the owner's notes when it succeeds. */ +export function noteWriteQuery(params: { id: string; name: string; datasourceId: string; sql: string }): object { + return postgresQuery({ ...params, trigger: "manual", onEvent: REREAD_NOTES, notification: QUIET }); +} + +/** The three owner-scoped writes of D1; `input1` holds the typed body. */ +export function insertUpdateDeleteQueries(datasourceId: string, ids: [string, string, string]): object[] { + const owner = `{{${OWNER_STATE_NAME}.value}}`; + return [ + noteWriteQuery({ id: ids[0], name: "insertNote", datasourceId, sql: `INSERT INTO notes (owner, body) VALUES (${owner}, {{input1.value}})` }), + noteWriteQuery({ + id: ids[1], + name: "updateNote", + datasourceId, + sql: `UPDATE notes SET body = {{input1.value}} WHERE ${OWNER_FILTER} AND ${NEWEST_OWN_NOTE}`, + }), + noteWriteQuery({ id: ids[2], name: "deleteNote", datasourceId, sql: `DELETE FROM notes WHERE ${OWNER_FILTER} AND ${NEWEST_OWN_NOTE}` }), + ]; +} diff --git a/e2e/src/dsl/builders.ts b/e2e/src/dsl/builders.ts new file mode 100644 index 0000000000..1a3fdb2e75 --- /dev/null +++ b/e2e/src/dsl/builders.ts @@ -0,0 +1,625 @@ +/** + * Builders for the application DSL. The shape is the one the editor saves (recorded from a real editor session): + * `ui.layout` places items on the grid, `ui.items` holds each component by its layout id. Only `ui` is needed for + * the app to load; the editor adds `refTree`, `hooks`, `settings` and `preload` itself. + * + * Conventions every item builder follows: `id` is the layout id (unique in the app), `name` the component name the + * app's expressions use (`{{.value}}`), `testId` becomes the component's `data-testid` (its "Individual ID" + * property). Free text properties are expression strings, so `{{ ... }}` binds them to queries and components. + * + * Typical use: `appDsl(stackItems([text(...), button(...)]), { queries: [...], tempStates: [...] })`. + */ +import { recordedBaseHooks, recordedHook, recordedItem, recordedN8nQuery, type RecordedHook } from "./recorded"; + +export interface GridPosition { + x: number; + y: number; + w: number; + h: number; +} + +export interface DslItem { + id: string; + layout: GridPosition; + item: { compType: string; name: string; comp: Record }; +} + +/** Where an item sits when the caller gives no position. */ +interface Placement { + x?: number; + y?: number; +} + +const DEFAULT_BUTTON_SIZE = { w: 6, h: 6 } as const; +const DEFAULT_TEXT_SIZE = { w: 12, h: 5 } as const; +const DEFAULT_INPUT_SIZE = { w: 8, h: 6 } as const; +const DEFAULT_TABLE_SIZE = { w: 24, h: 20 } as const; +const DEFAULT_BAR_CHART_SIZE = { w: 12, h: 40 } as const; +const DEFAULT_MODULE_INSTANCE_SIZE = { w: 24, h: 12 } as const; +/** Grid rows left empty between two items by `stackItems`. */ +const DEFAULT_STACK_GAP = 1; +/** The size the module editor gives a new module (`containerSize`). */ +const DEFAULT_MODULE_CONTAINER_SIZE = { height: 12, width: 24 } as const; + +/** Event handler fields the editor saves around every action. */ +const DEFAULT_SLOWDOWN = "debounce"; +const ACTION_TYPES = { + EXECUTE_QUERY: "executeQuery", + SET_TEMP_STATE: "setTempState", + RUN_SCRIPT: "runScript", + EXECUTE_COMP: "executeComp", + TRIGGER_MODULE_EVENT: "triggerModuleEvent", +} as const; +const CLICK_EVENT = "click"; +const SET_VALUE_METHOD = "setValue"; +const JSON_VALUE_PARAM = "JSONValue"; +const STRING_PARAM = "string"; +const VALUE_PARAM_NAME = "value"; +const JS_DATASOURCE_ID = "#JS_CODE"; +const DEFAULT_QUERY_NOTIFICATION = { showSuccess: true, showFail: true, fail: [{}] } as const; + +// --------------------------------------------------------------------------------------------------------------- +// Event handlers +// --------------------------------------------------------------------------------------------------------------- + +/** What a handler does, before it is wrapped for an event by `eventHandler`. Build one with the action builders. */ +export interface EventAction { + compType: string; + comp: Record; +} + +export type HandlerSlowdown = "debounce" | "throttle"; + +/** The entry of an `onEvent` list: the event's name and its handler. */ +export interface EventBinding { + name: string; + handler: EventAction & { condition: string; slowdown: HandlerSlowdown; delay: string }; +} + +export interface HandlerOptions { + /** Expression that must be truthy for the handler to run ("Only run when"); empty runs always. */ + condition?: string; + slowdown?: HandlerSlowdown; + /** Delay in ms as a string; empty for none. */ + delay?: string; +} + +function withHandlerFields(action: EventAction, options: HandlerOptions): EventBinding["handler"] { + return { + ...action, + condition: options.condition ?? "", + slowdown: options.slowdown ?? DEFAULT_SLOWDOWN, + delay: options.delay ?? "", + }; +} + +/** Binds an action to the component or query event `eventName` (`click`, `change`, `success`, `fail`, ...). */ +export function eventHandler(eventName: string, action: EventAction, options: HandlerOptions = {}): EventBinding { + return { name: eventName, handler: withHandlerFields(action, options) }; +} + +/** "Run a Data Query". */ +export function executeQuery(queryName: string): EventAction { + return { compType: ACTION_TYPES.EXECUTE_QUERY, comp: { queryName, queryVariables: [] } }; +} + +/** "Set a Temporary State value": `value` is a code string (`"clicked-{{1+1}}"`), not a JSON document. */ +export function setTempState(stateName: string, value: string): EventAction { + return { + compType: ACTION_TYPES.SET_TEMP_STATE, + comp: { + name: stateName, + methodName: SET_VALUE_METHOD, + params: [{ compType: JSON_VALUE_PARAM, comp: value, name: VALUE_PARAM_NAME }], + }, + }; +} + +/** "Run JavaScript". The script is not async: no top-level `await`. */ +export function runScript(script: string): EventAction { + return { compType: ACTION_TYPES.RUN_SCRIPT, comp: { script } }; +} + +/** A string argument of a component method called by `executeComp`. */ +export interface MethodParam { + name: string; + value: string; +} + +/** "Control a Component": calls `methodName` (`setValue`, `openModal`, `method1` of a module, ...) of a component. */ +export function executeComp(compName: string, methodName: string, params: MethodParam[] = []): EventAction { + return { + compType: ACTION_TYPES.EXECUTE_COMP, + comp: { + name: compName, + methodName, + params: params.map((param) => ({ compType: STRING_PARAM, comp: param.value, name: param.name })), + }, + }; +} + +/** Inside a module: raises the module's event `eventName` to its host. */ +export function triggerModuleEvent(eventName: string): EventAction { + return { compType: ACTION_TYPES.TRIGGER_MODULE_EVENT, comp: { name: eventName } }; +} + +// --------------------------------------------------------------------------------------------------------------- +// Layout +// --------------------------------------------------------------------------------------------------------------- + +/** The `layout` and `items` objects a container body holds (the app's `ui`, a modal's or a module's `container`). */ +export function containerOf(items: DslItem[]): { layout: Record; items: Record } { + const layout: Record = {}; + const components: Record = {}; + items.forEach((entry, index) => { + layout[entry.id] = { i: entry.id, ...entry.layout, pos: index }; + components[entry.id] = entry.item; + }); + return { layout, items: components }; +} + +/** + * Puts every item into its own rows below the previous one (same x, y accumulated from the heights plus `gap`), so + * that no seeded item covers another. Components that overlap intercept each other's clicks. Returns new + * items; the order of the list is the order on the page. + */ +export function stackItems(items: DslItem[], gap: number = DEFAULT_STACK_GAP): DslItem[] { + let nextRow = 0; + return items.map((entry) => { + const placed = { ...entry, layout: { ...entry.layout, y: nextRow } }; + nextRow += entry.layout.h + gap; + return placed; + }); +} + +// --------------------------------------------------------------------------------------------------------------- +// Components +// --------------------------------------------------------------------------------------------------------------- + +/** A button. `testId` becomes the data-testid of the rendered component (its "Individual ID" property). */ +export function button( + params: { + id: string; + name: string; + text: string; + testId: string; + /** Name of a query to run when the button is clicked (the "Run a Data Query" event handler). */ + onClickQuery?: string; + /** Any event handlers, e.g. `[eventHandler("click", setTempState("state1", "x"))]`; added after `onClickQuery`'s. */ + onEvent?: EventBinding[]; + } & Placement, +): DslItem { + const comp: Record = { text: params.text, dataTestId: params.testId }; + const handlers: EventBinding[] = [ + ...(params.onClickQuery === undefined ? [] : [eventHandler(CLICK_EVENT, executeQuery(params.onClickQuery))]), + ...(params.onEvent ?? []), + ]; + if (handlers.length > 0) { + comp.onEvent = handlers; + } + return { + id: params.id, + layout: { x: params.x ?? 0, y: params.y ?? 0, ...DEFAULT_BUTTON_SIZE }, + item: { compType: "button", name: params.name, comp }, + }; +} + +/** A text component. Its `text` is an expression string, so `{{ ... }}` binds it to queries and components. */ +export function text(params: { id: string; name: string; text: string; testId: string } & Placement): DslItem { + return { + id: params.id, + layout: { x: params.x ?? 0, y: params.y ?? 0, ...DEFAULT_TEXT_SIZE }, + item: { compType: "text", name: params.name, comp: { text: params.text, dataTestId: params.testId } }, + }; +} + +/** An input, `value` its initial text; its typed text is `{{.value}}`. */ +export function input(params: { id: string; name: string; testId: string; value?: string } & Placement): DslItem { + return { + id: params.id, + layout: { x: params.x ?? 0, y: params.y ?? 0, ...DEFAULT_INPUT_SIZE }, + item: { compType: "input", name: params.name, comp: { value: params.value ?? "", dataTestId: params.testId } }, + }; +} + +/** + * Any component of the Components pane, from its recorded default (`fixtures/dsl/.json`) with the overrides + * merged on top: `comp` overrides properties (shallow: a nested object such as `options` is replaced whole), `testId` + * sets `dataTestId`, `onEvent` the event handlers. `name` defaults to the recorded one (`select1`, `table1`, ...) and + * `w`/`h` to the recorded size. Throws RecordedFixtureError for the hook types (`modal`, `drawer`, ...): use `hook`. + */ +export function component( + compType: string, + params: { + id: string; + testId: string; + name?: string; + comp?: Record; + onEvent?: EventBinding[]; + w?: number; + h?: number; + } & Placement, +): DslItem { + const recorded = recordedItem(compType); + const comp: Record = { + ...recorded.comp, + dataTestId: params.testId, + ...(params.onEvent === undefined ? {} : { onEvent: params.onEvent }), + ...params.comp, + }; + return { + id: params.id, + layout: { x: params.x ?? 0, y: params.y ?? 0, w: params.w ?? recorded.layout.w, h: params.h ?? recorded.layout.h }, + item: { compType, name: params.name ?? recorded.name, comp }, + }; +} + +/** A column of a `table`. */ +export interface TableColumn { + /** The key of the row objects the column shows. */ + dataIndex: string; + /** Header text; defaults to `dataIndex`. */ + title?: string; + sortable?: boolean; + filterable?: boolean; + /** Cells can be edited in place; edits collect in `.changeSet` until "Save Changes". */ + editable?: boolean; +} + +function recordedColumnOf(column: TableColumn): Record { + const recordedColumn = (recordedItem("table").comp.columns as Record[])[0]!; + return { + ...recordedColumn, + title: column.title ?? column.dataIndex, + dataIndex: column.dataIndex, + ...(column.sortable === undefined ? {} : { sortable: column.sortable }), + ...(column.filterable === undefined ? {} : { filterable: column.filterable }), + ...(column.editable === undefined ? {} : { editable: column.editable }), + }; +} + +/** + * A table on the recorded table (`fixtures/dsl/table.json`); `data` is an expression such as `{{query1.data}}`. + * `columns` are either plain keys of the rows to show, each as a minimal text column, or `TableColumn` objects, each + * built on the recorded column with its sort / filter / edit flags (sorting, filtering and editing were verified only + * on recorded columns). The editor derives columns itself when data is bound; a table saved without columns shows + * "No Columns Are Currently Visible", so the columns are part of the DSL. `onEvent` takes the table's events + * (`saveChanges`, `rowClick`, ...). + */ +export function table( + params: { + id: string; + name: string; + data: string; + columns: (string | TableColumn)[]; + testId: string; + onEvent?: EventBinding[]; + } & Placement, +): DslItem { + const columns = params.columns.map((column) => + typeof column === "string" + ? { + title: column, + showTitle: true, + isCustom: false, + dataIndex: column, + render: { compType: "text", comp: { text: "{{currentCell}}" } }, + } + : recordedColumnOf(column), + ); + const comp: Record = { + ...recordedItem("table").comp, + data: params.data, + columns, + dataTestId: params.testId, + ...(params.onEvent === undefined ? {} : { onEvent: params.onEvent }), + }; + return { + id: params.id, + layout: { x: params.x ?? 0, y: params.y ?? 0, ...DEFAULT_TABLE_SIZE }, + item: { compType: "table", name: params.name, comp }, + }; +} + +/** One series of a bar chart: the row key it plots. */ +export interface ChartSeries { + columnName: string; + seriesName: string; +} + +/** + * A bar chart on the recorded one (`fixtures/dsl/barChart.json`), loaded from npm at run time (the app container needs + * internet). `data` is an expression for the rows, `xAxisKey` the row key on the x axis. Defect CD-5: `{{barChart1.data}}` + * reads empty while bars show, so the component's own `data` is no oracle. That a chart bound to a temporary state + * receives its rows is measured by the canvas's pixels (tests/components/npm-components.spec.ts, the bound variant); + * for any other binding assert the same expression in a text and that the canvas rendered. + */ +export function barChart( + params: { + id: string; + name: string; + testId: string; + data: string; + xAxisKey: string; + series: ChartSeries[]; + } & Placement, +): DslItem { + const recorded = recordedItem("barChart"); + const comp: Record = { + ...recorded.comp, + dataTestId: params.testId, + data: params.data, + xAxisKey: params.xAxisKey, + series: params.series.map((entry, index) => ({ ...entry, dataIndex: `s${index + 1}` })), + }; + return { + id: params.id, + layout: { x: params.x ?? 0, y: params.y ?? 0, ...DEFAULT_BAR_CHART_SIZE }, + item: { compType: "barChart", name: params.name, comp }, + }; +} + +// --------------------------------------------------------------------------------------------------------------- +// Queries +// --------------------------------------------------------------------------------------------------------------- + +/** How a JavaScript query starts. `automatic` is labelled "Run on page load" in the editor. */ +export type JsQueryTrigger = "automatic" | "manual" | "onQueryExecution" | "onTimeout" | "onBeforeUnload"; + +/** + * How a PostgreSQL query starts. `onInputChange` re-runs it when an expression it reads changes; it does nothing on a + * JavaScript query (a dependency change runs only non-JS queries, queryComp.tsx:305), and `onBeforeUnload` exists only + * for JavaScript queries (JSTriggerTypeOptions, queryComp.tsx:116-121), hence two types, not one. + */ +export type PostgresQueryTrigger = "automatic" | "manual" | "onQueryExecution" | "onTimeout" | "onInputChange"; + +/** Options both query builders take; every field defaults to what the editor saves for a new query. */ +export interface QueryOptions { + /** `success` and `fail` handlers, e.g. `[eventHandler("success", executeQuery("selectNotes"))]`. */ + onEvent?: EventBinding[]; + /** Which result notifications show; both default to true (the editor's default). */ + notification?: { showSuccess?: boolean; showFail?: boolean }; + /** Delay in ms as a string, for trigger `onTimeout`. */ + delayTime?: string; + periodic?: boolean; + /** Period in ms as a string, with `periodic`. */ + periodicTime?: string; + /** e.g. `{ showConfirmationModal: true, confirmationMessage: "Really run?" }`. */ + confirmationModal?: Record; + /** Name of the query this one is chained after (`onQueryExecution`). */ + depQueryName?: string; +} + +/** The settings every query carries, as the editor saves them (recorded after creating queries in the editor). */ +function queryDefaults( + params: { id: string; name: string; trigger: JsQueryTrigger | PostgresQueryTrigger } & QueryOptions, +): Record { + return { + id: params.id, + name: params.name, + order: 1, + triggerType: params.trigger, + onEvent: params.onEvent ?? [], + notification: { ...DEFAULT_QUERY_NOTIFICATION, ...params.notification }, + timeout: "", + confirmationModal: params.confirmationModal ?? {}, + variables: [], + periodic: params.periodic ?? false, + periodicTime: params.periodicTime ?? "", + cancelPrevious: false, + depQueryName: params.depQueryName ?? "", + delayTime: params.delayTime ?? "", + }; +} + +/** A query on a PostgreSQL data source. */ +export function postgresQuery( + params: { id: string; name: string; datasourceId: string; sql: string; trigger?: PostgresQueryTrigger } & QueryOptions, +): object { + return { + compType: "postgres", + comp: { + commandType: "INSERT", + command: { table: "", changeSet: { compType: "KEY_VALUE_PAIRS", comp: [{ column: "", value: "" }] } }, + mode: "SQL", + sql: params.sql, + disablePreparedStatement: false, + }, + datasourceId: params.datasourceId, + ...queryDefaults({ ...params, trigger: params.trigger ?? "automatic" }), + }; +} + +/** A JavaScript query ("Run JavaScript Code"); its result is `.data`. */ +export function jsQuery( + params: { id: string; name: string; script: string; trigger?: JsQueryTrigger } & QueryOptions, +): object { + return { + compType: "js", + comp: { script: params.script }, + datasourceId: JS_DATASOURCE_ID, + ...queryDefaults({ ...params, trigger: params.trigger ?? "manual" }), + }; +} + +/** Key of the `name` parameter of the n8n action "Retrieve all workflows" in the saved query (`_@_`, recorded). */ +export const N8N_NAME_PARAM_KEY = "query_@_name"; + +/** + * A query on an n8n data source with the action "Retrieve all workflows" (`GET /workflows` of the spec v1.1.1), from the + * query the editor saved (`fixtures/dsl/n8n/n8nQuery.json`: the generated `actionName` and the action's other defaults). + * `nameParam` is the string value of the `name` parameter; node-service evaluates a `{{key}}` in it against the request + * context and sends the result in the URL. Starts `manual` (the n8n recording says `automatic`): a test runs it with + * `POST /api/query/execute`. + */ +export function n8nWorkflowsQuery( + params: { id: string; name: string; datasourceId: string; nameParam: string; trigger?: PostgresQueryTrigger } & QueryOptions, +): object { + const recorded = recordedN8nQuery(); + return { + compType: recorded.compType, + comp: { ...recorded.comp, action: { ...recorded.comp.action, [N8N_NAME_PARAM_KEY]: params.nameParam } }, + datasourceId: params.datasourceId, + ...queryDefaults({ ...params, trigger: params.trigger ?? "manual" }), + }; +} + +// --------------------------------------------------------------------------------------------------------------- +// State and logic items +// --------------------------------------------------------------------------------------------------------------- + +/** + * A temporary state; `value` is the initial value as a code string, e.g. `"0"`, `"null"`, `"{}"` or + * `JSON.stringify(token)` for a string. The editor drops the `id` when it saves; the seeded state stays usable. + */ +export function tempState(params: { id: string; name: string; value: string }): object { + return { id: params.id, name: params.name, value: params.value }; +} + +/** A transformer ("Transformer" in the data panel): `script` is a function body, its result is `.value`. */ +export function transformer(params: { name: string; script: string }): object { + return { name: params.name, script: params.script }; +} + +/** A data responder: runs its handlers on `dataChange` whenever the expression `data` changes. */ +export function dataResponder(params: { name: string; data: string; onEvent: EventBinding[]; order?: number }): object { + return { name: params.name, order: params.order ?? 0, data: params.data, onEvent: params.onEvent }; +} + +/** + * An entry of the DSL `hooks`: components that are not on the grid (`modal`, `drawer`, `toast`, ...). `comp` is the + * complete property object; to start from the recorded defaults use `recordedHookOf`. + */ +export function hook(compType: string, name: string, comp: Record): RecordedHook { + return { compType, comp, name }; +} + +/** A hook on the recorded default of its type (`fixtures/dsl/.json`), `comp` merged over it, e.g. a modal with a body. */ +export function recordedHookOf(compType: string, comp: Record = {}, name?: string): RecordedHook { + const recorded = recordedHook(compType); + return hook(compType, name ?? recorded.name, { ...recorded.comp, ...comp }); +} + +// --------------------------------------------------------------------------------------------------------------- +// Modules +// --------------------------------------------------------------------------------------------------------------- + +export interface ModuleInput { + name: string; + /** Initial value of the input: a code string. */ + defaultValue?: string; +} + +export interface ModuleOutput { + name: string; + /** Expression, e.g. `{{input1.value}}`; the host reads it as `{{.}}`. */ + value: string; +} + +export interface ModuleMethod { + name: string; + /** What the method does inside the module; the host calls it with `executeComp(, )`. */ + action: EventAction; +} + +/** + * The DSL of a module (pass it to `createModule`): the inputs the host sets (`{{.value}}` inside), the + * outputs it reads, its methods and events (names; raise one with `triggerModuleEvent`), and the components of the + * module's own page as `items`. + */ +export function moduleApp(params: { + inputs?: ModuleInput[]; + outputs?: ModuleOutput[]; + methods?: ModuleMethod[]; + events?: string[]; + items?: DslItem[]; + containerSize?: { height: number; width: number }; +}): object { + return { + ui: { + compType: "module", + comp: { + io: { + inputs: (params.inputs ?? []).map((entry) => ({ + name: entry.name, + description: "", + type: "data", + defaultValue: { compType: "data", comp: entry.defaultValue ?? "" }, + test: { compType: "data", comp: "" }, + })), + outputs: params.outputs ?? [], + }, + methods: (params.methods ?? []).map((method) => ({ + name: method.name, + action: withHandlerFields(method.action, {}), + })), + events: { list: (params.events ?? []).map((name) => ({ name })), enableEventTestMessage: true }, + container: containerOf(params.items ?? []), + containerSize: params.containerSize ?? DEFAULT_MODULE_CONTAINER_SIZE, + }, + }, + }; +} + +/** + * An instance of a module in a host app. `inputs` maps input names to values (code strings), `events` are handlers + * for the module's events: `[eventHandler("event1", setTempState("state1", "fired"))]`. Several instances of one + * module repeat its test ids; scope locators with `AppViewPage.inModule(name)`. + */ +export function moduleInstance( + params: { + id: string; + name: string; + moduleId: string; + inputs?: Record; + events?: EventBinding[]; + } & Placement, +): DslItem { + return { + id: params.id, + layout: { x: params.x ?? 0, y: params.y ?? 0, ...DEFAULT_MODULE_INSTANCE_SIZE }, + item: { + compType: "module", + name: params.name, + comp: { + appId: params.moduleId, + error: "", + inputs: params.inputs ?? {}, + events: params.events ?? [], + autoHeight: "auto", + scrollbars: false, + loadModuleInDomWhenHide: true, + }, + }, + }; +} + +// --------------------------------------------------------------------------------------------------------------- +// The app +// --------------------------------------------------------------------------------------------------------------- + +export interface AppParts { + queries?: object[]; + tempStates?: object[]; + /** Written as the top-level key `transformers`. */ + transformers?: object[]; + /** Written as the top-level key `dataResponders`. */ + dataResponders?: object[]; + /** Written as the top-level key `hooks`, after the hooks every app has (`recordedBaseHooks`). */ + hooks?: object[]; +} + +/** + * The DSL of an app that shows the given items, runs the given queries and holds the given temporary states, + * transformers, data responders and hooks. Parts left out are not written. + */ +export function appDsl(items: DslItem[], parts: AppParts = {}): object { + return { + ui: containerOf(items), + ...(parts.queries?.length ? { queries: parts.queries } : {}), + ...(parts.tempStates?.length ? { tempStates: parts.tempStates } : {}), + ...(parts.transformers?.length ? { transformers: parts.transformers } : {}), + ...(parts.dataResponders?.length ? { dataResponders: parts.dataResponders } : {}), + ...(parts.hooks?.length ? { hooks: [...recordedBaseHooks(), ...parts.hooks] } : {}), + }; +} diff --git a/e2e/src/dsl/recorded.ts b/e2e/src/dsl/recorded.ts new file mode 100644 index 0000000000..50cb3d73da --- /dev/null +++ b/e2e/src/dsl/recorded.ts @@ -0,0 +1,208 @@ +import { readFileSync } from "node:fs"; +import { join } from "node:path"; + +/** + * Access to the recorded default DSL of every component of the editor's Components pane: `fixtures/dsl/.json` + * holds what the editor saved after the component was dropped on an empty app (recorded on 3.0.0-e2e; re-record + * when the image changes). The builders merge their overrides onto these recordings so a seeded component has every + * property the editor itself writes. + */ +export const RECORDED_DSL_DIR = join(__dirname, "..", "..", "fixtures", "dsl"); + +/** A recording that is missing, unreadable, or lacks the part a builder asks for. The message names the file. */ +export class RecordedFixtureError extends Error { + constructor(compType: string, reason: string) { + super(`recorded DSL of "${compType}" (${join(RECORDED_DSL_DIR, `${compType}.json`)}): ${reason}`); + this.name = "RecordedFixtureError"; + } +} + +export interface RecordedGridPosition { + i: string; + x: number; + y: number; + w: number; + h: number; + pos: number; +} + +export interface RecordedItem { + compType: string; + name: string; + comp: Record; + /** The grid position the editor gave the dropped component. */ + layout: RecordedGridPosition; +} + +export interface RecordedHook { + compType: string; + name: string; + comp: Record; +} + +export interface RecordedFile { + ui: { + layout: Record | unknown[]; + items?: Record }>; + }; + hooks: RecordedHook[]; +} + +const cache = new Map(); + +function isObject(value: unknown): value is Record { + return typeof value === "object" && value !== null && !Array.isArray(value); +} + +/** + * Parses the text of a recording and checks the parts the readers rely on: `ui` is an object with a `layout` (an object, + * or the array of an app without components) and, when present, an `items` object whose entries have a string + * `compType` and `name` and an object `comp`; `hooks` is an array of entries with a string `compType` and `name`. + * Anything else is a RecordedFixtureError that names the file, not a TypeError somewhere in a builder. + */ +export function parseRecordedFile(compType: string, text: string): RecordedFile { + let parsed: unknown; + try { + parsed = JSON.parse(text); + } catch (error) { + throw new RecordedFixtureError(compType, error instanceof Error ? error.message : String(error)); + } + if (!isObject(parsed) || !isObject(parsed.ui)) { + throw new RecordedFixtureError(compType, "is not an object with a `ui` object"); + } + const { layout, items } = parsed.ui; + if (!isObject(layout) && !Array.isArray(layout)) { + throw new RecordedFixtureError(compType, "has no `ui.layout` object or array"); + } + if (items !== undefined) { + if (!isObject(items)) { + throw new RecordedFixtureError(compType, "has a `ui.items` that is not an object"); + } + for (const [id, item] of Object.entries(items)) { + if (!isObject(item) || typeof item.compType !== "string" || typeof item.name !== "string" || !isObject(item.comp)) { + throw new RecordedFixtureError(compType, `has a \`ui.items\` entry ${id} without a string compType, a string name and a comp object`); + } + } + } + if (!Array.isArray(parsed.hooks)) { + throw new RecordedFixtureError(compType, "has no `hooks` array"); + } + for (const [index, hook] of parsed.hooks.entries()) { + if (!isObject(hook) || typeof hook.compType !== "string" || typeof hook.name !== "string") { + throw new RecordedFixtureError(compType, `has a hook ${index} without a string compType and a string name`); + } + } + return parsed as unknown as RecordedFile; +} + +function load(compType: string): RecordedFile { + const cached = cache.get(compType); + if (cached) { + return cached; + } + let text: string; + try { + text = readFileSync(join(RECORDED_DSL_DIR, `${compType}.json`), "utf8"); + } catch (error) { + throw new RecordedFixtureError(compType, error instanceof Error ? error.message : String(error)); + } + const parsed = parseRecordedFile(compType, text); + cache.set(compType, parsed); + return parsed; +} + +/** + * The first grid item of a parsed recording as a fresh deep copy with its layout entry; throws RecordedFixtureError when + * there is none, when its layout is missing, or when its `compType` is not `compType` (a misrecorded file would seed + * the defaults of another component). + */ +export function firstRecordedItem(compType: string, file: RecordedFile): RecordedItem { + const entry = Object.entries(file.ui.items ?? {})[0]; + if (!entry) { + throw new RecordedFixtureError(compType, "has no component on the grid (a hook type? use recordedHook)"); + } + const [id, item] = entry; + if (item.compType !== compType) { + throw new RecordedFixtureError(compType, `holds a ${item.compType} as its first component, not a ${compType}`); + } + const layout = (file.ui.layout as Record)[id]; + if (!layout) { + throw new RecordedFixtureError(compType, `has no layout entry for item ${id}`); + } + return structuredClone({ ...item, layout }); +} + +/** + * The component the editor placed on the grid when `compType` was dropped, as a fresh deep copy (callers merge into it). + * Types that live in the DSL `hooks` instead of on the grid (`modal`, `drawer`, `toast`, `chatController`, `meeting`) + * have no such item: use `recordedHook`. + */ +export function recordedItem(compType: string): RecordedItem { + return firstRecordedItem(compType, load(compType)); +} + +/** The hook of type `compType` the editor added when the component was dropped (the last of its type), as a fresh copy. */ +export function recordedHook(compType: string): RecordedHook { + const hook = [...load(compType).hooks].reverse().find((candidate) => candidate.compType === compType); + if (!hook) { + throw new RecordedFixtureError(compType, `has no hook of type ${compType}`); + } + return structuredClone(hook); +} + +/** Type whose recording holds only the hooks every app has (urlParams, dayjs, lodash, utils, message, toast, ...). */ +const BASE_HOOKS_SOURCE_TYPE = "button"; + +/** The hooks every app of the editor carries; written ahead of the hooks a test adds (see `appDsl`). */ +export function recordedBaseHooks(): RecordedHook[] { + return structuredClone(load(BASE_HOOKS_SOURCE_TYPE).hooks); +} + +/** + * Folder of the recordings that are no component of the Components pane (`fixtures/dsl/n8n/`): the n8n data source's create + * request and the query the editor saved for its "Retrieve all workflows" action. It is a subfolder on purpose: the catalog + * test (`tests/components/insert-catalog.spec.ts`) and `recorded.spec.ts` read every `*.json` directly in `RECORDED_DSL_DIR` + * as a component type. + */ +export const RECORDED_N8N_DIR = join(RECORDED_DSL_DIR, "n8n"); + +/** Recorded n8n query entry (what the editor saved in the app DSL's `queries`), reduced to what a builder keeps: type and `comp` with `actionName` and `action`. Ids, order and data source are set by the builder. */ +export interface RecordedN8nQuery { + compType: string; + comp: { actionName: string; action: Record; headers: unknown[] }; + [key: string]: unknown; +} + +/** Recorded body of the `POST /api/datasources` the data source form sends for an n8n data source, reduced to type, name and settings; the workspace, the target and the key are set by `n8nDatasourceBody`. */ +export interface RecordedN8nDatasource { + name: string; + type: string; + datasourceConfig: Record; +} + +function loadN8n(file: string): unknown { + const label = `n8n/${file}`; + try { + return JSON.parse(readFileSync(join(RECORDED_N8N_DIR, `${file}.json`), "utf8")); + } catch (error) { + throw new RecordedFixtureError(label, error instanceof Error ? error.message : String(error)); + } +} + +/** The n8n query the editor saved, as a fresh deep copy; throws RecordedFixtureError when its type or `actionName` is missing. */ +export function recordedN8nQuery(): RecordedN8nQuery { + const parsed = loadN8n("n8nQuery"); + if (!isObject(parsed) || parsed.compType !== "n8n" || !isObject(parsed.comp) || typeof parsed.comp.actionName !== "string" || !isObject(parsed.comp.action)) { + throw new RecordedFixtureError("n8n/n8nQuery", "is not an n8n query with a string `comp.actionName` and a `comp.action` object"); + } + return structuredClone(parsed) as unknown as RecordedN8nQuery; +} + +/** The n8n data source create body the form sent, as a fresh deep copy; throws RecordedFixtureError when it is not of type n8n or lacks `datasourceConfig`. */ +export function recordedN8nDatasource(): RecordedN8nDatasource { + const parsed = loadN8n("n8nDatasource"); + if (!isObject(parsed) || parsed.type !== "n8n" || typeof parsed.name !== "string" || !isObject(parsed.datasourceConfig)) { + throw new RecordedFixtureError("n8n/n8nDatasource", "is not an n8n data source body with a string `name` and a `datasourceConfig` object"); + } + return structuredClone(parsed) as unknown as RecordedN8nDatasource; +} diff --git a/e2e/src/fixtures.ts b/e2e/src/fixtures.ts new file mode 100644 index 0000000000..0831ca4cbc --- /dev/null +++ b/e2e/src/fixtures.ts @@ -0,0 +1,248 @@ +import { test as base, expect, type APIRequest, type APIRequestContext, type BrowserContext, type Page } from "@playwright/test"; +import { ECHO_PATHS, TEST_EMAIL_DOMAIN } from "./constants"; +import { currentUserId, registerUser, signIn, type RegisteredUser } from "./api/client"; +import type { Actor } from "./security/actors"; +import { echoBaseUrl, echoReadPrefix, echoTargetPath, type EchoRecord, type EchoTarget } from "./security/echo"; +import { mailboxAt, type Mailbox } from "./lifecycle/mail"; +import { superAdminCredentials, withCapacityHint, type SuperAdmin } from "./security/super-admin"; + +export interface NetworkGuard { + /** URLs of the requests the guard blocked in this context. */ + blockedUrls: string[]; +} + +/** + * Blocks every request of the browser context to an origin other than the app under test. The Lowcoder + * client calls api-service.lowcoder.cloud (subscriptions, with the user's e-mail, workspace and host) and loads + * HubSpot; no test may reach them. Every context a test uses has to get this guard: the `context` of the test + * gets it from the automatic `networkGuard` fixture, further contexts come from `newUserSession`. + * + * It covers HTTP(S) requests and WebSocket connections of the pages of the context. Service workers are blocked + * (config and `newUserSession`), so none can bypass the routes. The suite never switches the guard off. + * + * Limits: it does not cover requests made by the backend inside the application container, nor requests that do + * not go through a page of the context. + */ +export async function installNetworkGuard(context: BrowserContext, baseURL: string): Promise { + const allowed = new URL(baseURL); + const allowedOrigin = allowed.origin; + const guard: NetworkGuard = { blockedUrls: [] }; + await context.route( + (url) => url.origin !== allowedOrigin, + (route) => { + guard.blockedUrls.push(route.request().url()); + return route.abort("blockedbyclient"); + }, + ); + // The app's own WebSocket is on its own host (nginx proxies it); any other host is blocked. + await context.routeWebSocket( + (url) => url.host !== allowed.host, + (socket) => { + guard.blockedUrls.push(socket.url()); + return socket.close(); + }, + ); + return guard; +} + +/** A second, independent browser session (own cookies), guarded like the test's own. */ +export interface UserSession { + context: BrowserContext; + page: Page; +} + +/** The signed-in browser state (cookies) of the instance super admin, as `APIRequestContext.storageState()` returns it. */ +export type SuperAdminStorageState = Awaited>; + +/** + * Outcome of the worker's one super-admin sign-in: the signed-in state, or the reason there is none (credentials not set, + * sign-in refused, stack unreachable). Kept instead of thrown, so a spec that never asks for the super admin runs without it. + */ +export type SuperAdminOutcome = { state: SuperAdminStorageState } | { error: Error }; + +interface WorkerFixtures { + /** + * The super admin's sign-in, made once per worker when the worker starts. It is an AUTOMATIC worker fixture on purpose: + * Playwright traces every request context created while a test runs, so a sign-in made lazily by the first test that needs + * the super admin would put the login body, with the password, into that test's trace (measured: 1 leak in the trace and + * the HTML report of a failing test). Made before the first test starts, the request context is in no trace. It opens and + * disposes its own request context (in a `finally`). The `superAdmin` fixture rethrows a failure, with a message that names + * the two variables and the run script (`SuperAdminEnvError`) and never a value. + */ + superAdminState: SuperAdminOutcome; +} + +interface Fixtures { + networkGuard: NetworkGuard; + /** A user registered through the API and logged in in the test's browser context. */ + apiUser: RegisteredUser; + /** Opens another browser session, for a second user or an anonymous visitor. Closed after the test. */ + newUserSession: () => Promise; + /** + * A user for a security test: `newUserSession` plus a registration (own SAAS workspace, admin of it) and its user id. + * `tag` names the role in the e-mail (`e2e--w-...`). Its context is closed after the test by + * `newUserSession`; helpers never create contexts. + */ + actor: (tag: string) => Promise; + /** + * The instance super admin (a SUPER_ADMIN member of every workspace, no workspace of its own): a guarded browser context + * opened from `superAdminState` and closed after the test. ONE account shared by all workers: never switch its + * workspace, never change its password, change it only inside the test's own workspace. + */ + superAdmin: SuperAdmin; + /** + * The test's own target on the HTTP echo sidecar (`url`, `received()`): where the SERVER's outbound requests are pointed. The + * request context that reads the records is created on first use, reused, and disposed after the test, pass or fail. It is + * the runner's own connection to the sidecar on the run's network, an internal host. Limit: a context created while a test + * runs lands in its trace, so the trace holds the records read (a leaked secret would be in it). + */ + echo: EchoTarget; + /** + * The mails the server sent to the run's mail sink (the echo sidecar), found by recipient. Read with Node's `fetch`, not a + * request context, so no mail (they hold reset tokens) reaches a trace. Mails live for the whole run: use an address of the test's own. + */ + mailbox: Mailbox; +} + +/** + * Signs the super admin in once, in a request context of its own that is disposed before this returns. Never throws: the + * failure is the outcome. The password is read from the environment, used for that request and kept nowhere else. + */ +async function signInSuperAdmin(factory: APIRequest, baseURL: string | undefined): Promise { + try { + const credentials = superAdminCredentials(process.env); + if (!baseURL) { + throw new Error("baseURL is not set; the super admin's sign-in needs it"); + } + const request = await factory.newContext({ baseURL }); + try { + await signIn(request, credentials.username, credentials.password); + return { state: await request.storageState() }; + } finally { + await request.dispose(); + } + } catch (error) { + return { error: withCapacityHint(error instanceof Error ? error : new Error(String(error))) }; + } +} + +let emailCounter = 0; +/** `e2e--w-