From 9c5ff69213beae406f58bbd2f0c7f18558593f2d Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Mon, 21 Aug 2023 12:45:26 +0100 Subject: [PATCH 01/78] Return the actual objects (#11570) --- packages/bbui/src/Table/Table.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte index 3a86295178..529d1144ee 100644 --- a/packages/bbui/src/Table/Table.svelte +++ b/packages/bbui/src/Table/Table.svelte @@ -215,7 +215,7 @@ const nameA = getDisplayName(a) const nameB = getDisplayName(b) if (orderA !== orderB) { - return orderA < orderB ? orderA : orderB + return orderA < orderB ? a : b } return nameA < nameB ? a : b }) From 27bd653b02753900c58bf59cb387078f9c9fde50 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 21 Aug 2023 11:45:46 +0000 Subject: [PATCH 02/78] Bump version to 2.9.30 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index c3c9741bd0..1af0927e16 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.29", + "version": "2.9.30", "npmClient": "yarn", "packages": [ "packages/*" From 826255dfe213fccf9dd1b3659091bd111e1328c0 Mon Sep 17 00:00:00 2001 From: Jonny McCullagh Date: Thu, 24 Aug 2023 13:52:17 +0100 Subject: [PATCH 03/78] trigger a feature branch on pull request (#11584) trigger a feature branch on pull request --- .github/workflows/deploy-featurebranch.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/deploy-featurebranch.yml diff --git a/.github/workflows/deploy-featurebranch.yml b/.github/workflows/deploy-featurebranch.yml new file mode 100644 index 0000000000..9057d32c4c --- /dev/null +++ b/.github/workflows/deploy-featurebranch.yml @@ -0,0 +1,19 @@ +name: deploy-featurebranch + +on: + pull_request: + branches: + - develop + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: passeidireto/trigger-external-workflow-action@main + env: + BRANCH: ${{ github.head_ref }} + with: + repository: budibase/budibase-deploys + event: featurebranch-qa-deploy + github_pat: ${{ secrets.GH_ACCESS_TOKEN }} From fec20e526e4a2b82652787df8b0a50a6046f4427 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 24 Aug 2023 12:52:39 +0000 Subject: [PATCH 04/78] Bump version to 2.9.31 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 1af0927e16..27d07555d4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.30", + "version": "2.9.31", "npmClient": "yarn", "packages": [ "packages/*" From ee058a4c26a1f2031190a78dfc80bd012141918a Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 24 Aug 2023 14:05:10 +0000 Subject: [PATCH 05/78] Bump version to 2.9.32 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 27d07555d4..3d6bf559b8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.31", + "version": "2.9.32", "npmClient": "yarn", "packages": [ "packages/*" From 2eb78fb23dd847fc66373b7489b28772f69b483d Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 24 Aug 2023 17:12:48 +0100 Subject: [PATCH 06/78] don't recreate secret after first deploy, bump vm2 deps --- charts/budibase/templates/secrets.yaml | 3 +++ packages/server/package.json | 2 +- packages/string-templates/package.json | 2 +- yarn.lock | 16 ++++------------ 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/charts/budibase/templates/secrets.yaml b/charts/budibase/templates/secrets.yaml index 1c0a914ed3..e42a276f1d 100644 --- a/charts/budibase/templates/secrets.yaml +++ b/charts/budibase/templates/secrets.yaml @@ -1,4 +1,6 @@ {{- if .Values.globals.createSecrets -}} +{{- $existingSecret := lookup "v1" "Secret" .Release.Namespace (include "budibase.fullname" .) -}} +{{- if not $existingSecret -}} apiVersion: v1 kind: Secret metadata: @@ -15,3 +17,4 @@ data: objectStoreAccess: {{ template "budibase.defaultsecret" .Values.services.objectStore.accessKey }} objectStoreSecret: {{ template "budibase.defaultsecret" .Values.services.objectStore.secretKey }} {{- end -}} +{{- end -}} \ No newline at end of file diff --git a/packages/server/package.json b/packages/server/package.json index 7d0d8f5feb..c2eea18068 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -122,7 +122,7 @@ "to-json-schema": "0.2.5", "uuid": "3.3.2", "validate.js": "0.13.1", - "vm2": "3.9.17", + "vm2": "^3.9.19", "worker-farm": "1.7.0", "xml2js": "0.5.0", "yargs": "13.2.4" diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 4dc4c17ad8..242edc83a9 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -30,7 +30,7 @@ "handlebars": "^4.7.6", "handlebars-utils": "^1.0.6", "lodash": "^4.17.20", - "vm2": "^3.9.15" + "vm2": "^3.9.19" }, "devDependencies": { "@rollup/plugin-commonjs": "^17.1.0", diff --git a/yarn.lock b/yarn.lock index 827c94a176..a4f0e91e31 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24984,18 +24984,10 @@ vlq@^0.2.2: resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26" integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow== -vm2@3.9.17: - version "3.9.17" - resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.17.tgz#251b165ff8a0e034942b5181057305e39570aeab" - integrity sha512-AqwtCnZ/ERcX+AVj9vUsphY56YANXxRuqMb7GsDtAr0m0PcQX3u0Aj3KWiXM0YAHy7i6JEeHrwOnwXbGYgRpAw== - dependencies: - acorn "^8.7.0" - acorn-walk "^8.2.0" - -vm2@^3.9.15: - version "3.9.16" - resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.16.tgz#0fbc2a265f7bf8b837cea6f4a908f88a3f93b8e6" - integrity sha512-3T9LscojNTxdOyG+e8gFeyBXkMlOBYDoF6dqZbj+MPVHi9x10UfiTAJIobuchRCp3QvC+inybTbMJIUrLsig0w== +vm2@^3.9.19: + version "3.9.19" + resolved "https://registry.yarnpkg.com/vm2/-/vm2-3.9.19.tgz#be1e1d7a106122c6c492b4d51c2e8b93d3ed6a4a" + integrity sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg== dependencies: acorn "^8.7.0" acorn-walk "^8.2.0" From 3265042025c5e2471b8e223491dc90a8b34814eb Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 29 Aug 2023 14:27:39 +0100 Subject: [PATCH 07/78] Revert "Merge branch 'develop' into master" This reverts commit 99adc2039b9ed97a605a6a3885f29e7a48cfd328, reversing changes made to fec20e526e4a2b82652787df8b0a50a6046f4427. --- .github/workflows/budibase_ci.yml | 114 +-- .../workflows/check_unreleased_changes.yml | 29 - .github/workflows/release-develop.yml | 2 +- .nvmrc | 2 +- .tool-versions | 4 +- .vscode/launch.json | 71 +- docs/CONTRIBUTING.md | 2 +- hosting/{tests => dependencies}/Dockerfile | 0 hosting/{tests => dependencies}/README.md | 0 hosting/{tests => dependencies}/runner.sh | 0 hosting/docker-compose.test.yaml | 47 ++ hosting/single/Dockerfile | 4 +- jestTestcontainersConfigGenerator.js | 17 +- package.json | 4 +- packages/backend-core/src/cache/user.ts | 14 - packages/backend-core/src/db/lucene.ts | 26 +- .../backend-core/src/db/tests/lucene.spec.ts | 72 +- .../src/{features => featureFlags}/index.ts | 1 - .../tests/featureFlags.spec.ts | 0 .../backend-core/src/features/installation.ts | 17 - packages/backend-core/src/index.ts | 3 +- .../src/middleware/builderOnly.ts | 11 +- .../src/middleware/builderOrAdmin.ts | 11 +- .../backend-core/src/security/permissions.ts | 4 + packages/backend-core/src/users/db.ts | 38 +- .../tests/core/utilities/mocks/licenses.ts | 8 - .../core/utilities/testContainerUtils.ts | 21 +- .../bbui/src/Actions/position_dropdown.js | 3 +- .../bbui/src/ColorPicker/ColorPicker.svelte | 75 +- packages/bbui/src/Popover/Popover.svelte | 8 - packages/builder/src/builderStore/index.js | 10 +- .../src/builderStore/store/frontend.js | 29 +- .../DataTable/modals/CreateEditColumn.svelte | 67 +- .../commandPalette/CommandPalette.svelte | 4 +- .../src/components/common/NavItem.svelte | 17 +- .../src/components/design/Panel.svelte | 9 +- .../actions/ChangeFormStep.svelte | 10 +- .../controls/ColumnEditor/CellDrawer.svelte | 2 + .../controls/FilterEditor/FilterDrawer.svelte | 41 +- packages/builder/src/helpers/urlStateSync.js | 5 - .../_components/Navigation/index.svelte | 225 ------ .../_components/Screen/ThemePanel.svelte | 78 --- .../_components/Screen/index.svelte | 51 -- .../[screenId]/[componentId]/_layout.svelte | 52 -- .../[screenId]/[componentId]/index.svelte | 1 - .../[screenId]/_components/AppPanel.svelte | 47 +- .../[screenId]/_components/AppPreview.svelte | 57 +- .../_components/ComponentList/index.svelte | 163 ----- .../[screenId]/_components/LeftPanel.svelte | 21 - .../_components/ScreenList/index.svelte | 304 -------- .../design/[screenId]/_fallback.svelte | 5 + .../design/[screenId]/_layout.svelte | 78 ++- .../navigation}/ComponentDropdownMenu.svelte | 0 .../navigation}/ComponentKeyHandler.svelte | 20 +- .../navigation/ComponentListPanel.svelte | 90 +++ .../navigation}/ComponentScrollWrapper.svelte | 6 +- .../navigation}/ComponentTree.svelte | 3 +- .../navigation}/DNDPositionIndicator.svelte | 0 .../navigation}/ScreenslotDropdownMenu.svelte | 0 .../_components/navigation}/dndStore.js | 0 .../settings}/ComponentInfoSection.svelte | 0 .../settings}/ComponentSettingsPanel.svelte | 0 .../settings}/ComponentSettingsSection.svelte | 0 .../settings}/ConditionalUIDrawer.svelte | 0 .../settings}/ConditionalUISection.svelte | 0 .../settings}/CustomStylesSection.svelte | 0 .../settings}/DesignSection.svelte | 0 .../_components/settings}/StyleSection.svelte | 0 .../_components/settings}/componentStyles.js | 0 .../components/[componentId]/_layout.svelte | 41 ++ .../components/[componentId]/index.svelte | 4 + .../new/_components/NewComponentPanel.svelte | 4 - .../new/_components/componentStructure.json | 0 .../[componentId]/new/index.svelte | 0 .../design/[screenId]/components/index.svelte | 18 + .../design/[screenId]/index.svelte | 3 +- .../_components/LayoutDropdownMenu.svelte | 41 ++ .../_components/LayoutListPanel.svelte | 29 + .../_components/LayoutSettingsPanel.svelte | 53 ++ .../layouts/[layoutId]/_layout.svelte | 20 + .../layouts/[layoutId]/index.svelte | 7 + .../design/[screenId]/layouts/_layout.svelte | 12 + .../design/[screenId]/layouts/index.svelte | 12 + .../_components/NavigationInfoPanel.svelte | 33 + .../_components/NavigationLinksDrawer.svelte} | 0 .../_components/NavigationLinksEditor.svelte} | 10 +- .../NavigationSettingsPanel.svelte | 110 +++ .../design/[screenId]/navigation/index.svelte | 7 + .../_components}/RoleIndicator.svelte | 8 +- .../_components/ScreenDropdownMenu.svelte} | 2 +- .../_components/ScreenListPanel.svelte | 75 ++ .../_components/ScreenSettingsPanel.svelte} | 68 +- .../design/[screenId]/screens/index.svelte | 12 + .../_components}/AppThemeSelect.svelte | 0 .../_components}/ButtonRoundnessSelect.svelte | 0 .../theme/_components/ThemeInfoPanel.svelte | 12 + .../_components/ThemeSettingsPanel.svelte | 55 ++ .../design/[screenId]/theme/index.svelte | 7 + .../{NewScreen => }/CreateScreenModal.svelte | 15 +- .../{NewScreen => }/DatasourceModal.svelte | 0 .../design/_components/NewScreen/index.svelte | 105 --- .../{NewScreen => }/ScreenRoleModal.svelte | 0 .../{_components/NewScreen => }/blank.png | Bin .../app/[application]/design/new.svelte | 113 ++- .../{_components/NewScreen => }/table.png | Bin .../_components/StatusRenderer.svelte | 10 +- .../settings/automation-history/index.svelte | 4 +- packages/cli/tsconfig.build.json | 16 +- packages/client/manifest.json | 9 - .../client/src/components/Component.svelte | 12 +- packages/client/src/components/Screen.svelte | 2 +- .../client/src/components/app/Layout.svelte | 37 +- .../src/components/app/forms/Form.svelte | 11 +- .../src/components/app/forms/InnerForm.svelte | 2 +- .../src/components/preview/SettingsBar.svelte | 6 +- packages/client/src/stores/builder.js | 3 + .../grid/layout/NewColumnButton.svelte | 2 +- packages/pro | 2 +- packages/server/Dockerfile | 4 +- packages/server/jest.config.ts | 1 - packages/server/package.json | 17 +- packages/server/scripts/test.sh | 5 +- packages/server/specs/openapi.json | 213 +----- packages/server/specs/openapi.yaml | 160 +---- packages/server/specs/resources/index.ts | 2 - packages/server/specs/resources/roles.ts | 65 -- packages/server/specs/resources/user.ts | 8 +- .../server/src/api/controllers/application.ts | 7 +- packages/server/src/api/controllers/auth.ts | 9 +- .../src/api/controllers/deploy/index.ts | 17 +- .../server/src/api/controllers/permission.ts | 27 +- .../api/controllers/public/applications.ts | 18 +- .../api/controllers/public/mapping/types.ts | 4 - .../src/api/controllers/public/queries.ts | 6 +- .../src/api/controllers/public/roles.ts | 33 - .../server/src/api/controllers/public/rows.ts | 13 +- .../src/api/controllers/public/tables.ts | 13 +- .../src/api/controllers/public/users.ts | 30 +- .../server/src/api/controllers/query/index.ts | 4 +- .../src/api/controllers/row/external.ts | 22 +- .../server/src/api/controllers/row/index.ts | 7 +- .../src/api/controllers/row/internal.ts | 23 +- .../server/src/api/controllers/row/utils.ts | 17 +- .../server/src/api/controllers/row/views.ts | 78 ++- .../src/api/controllers/table/external.ts | 20 +- .../server/src/api/controllers/table/index.ts | 4 +- .../src/api/controllers/table/internal.ts | 35 +- .../server/src/api/controllers/table/utils.ts | 2 +- .../server/src/api/routes/public/roles.ts | 56 -- .../src/api/routes/public/tests/users.spec.js | 38 + .../src/api/routes/public/tests/users.spec.ts | 126 ---- packages/server/src/api/routes/row.ts | 170 +++-- ...ermissions.spec.ts => permissions.spec.js} | 109 +-- .../server/src/api/routes/tests/role.spec.js | 5 +- .../server/src/api/routes/tests/row.spec.ts | 656 +++++++++--------- .../src/api/routes/tests/viewV2.spec.ts | 18 +- packages/server/src/api/routes/view.ts | 2 +- packages/server/src/app.ts | 129 +++- packages/server/src/automations/index.ts | 4 - .../server/src/automations/steps/queryRows.ts | 17 +- .../tests/{filter.spec.ts => filter.spec.js} | 23 +- packages/server/src/automations/utils.ts | 13 +- packages/server/src/db/utils.ts | 17 +- packages/server/src/definitions/openapi.ts | 113 +-- packages/server/src/environment.ts | 2 - packages/server/src/features.ts | 24 - .../src/integration-test/postgres.spec.ts | 22 +- .../src/integrations/microsoftSqlServer.ts | 12 +- packages/server/src/integrations/mysql.ts | 66 +- packages/server/src/koa.ts | 102 --- packages/server/src/middleware/noViewData.ts | 9 + .../src/middleware/tests/noViewData.spec.ts | 83 +++ .../middleware/tests/trimViewRowInfo.spec.ts | 27 +- .../server/src/middleware/trimViewRowInfo.ts | 33 +- .../server/src/sdk/app/permissions/index.ts | 37 - .../app/permissions/tests/permissions.spec.ts | 52 -- packages/server/src/sdk/app/rows/search.ts | 16 +- .../src/sdk/app/rows/search/external.ts | 3 +- .../src/sdk/app/rows/search/internal.ts | 4 +- .../app/rows/search/tests/external.spec.ts | 11 +- .../app/rows/search/tests/internal.spec.ts | 3 +- packages/server/src/sdk/app/views/index.ts | 49 +- .../src/sdk/app/views/tests/views.spec.ts | 383 ++-------- packages/server/src/sdk/index.ts | 2 - packages/server/src/startup.ts | 5 +- .../src/tests/utilities/TestConfiguration.ts | 16 +- .../server/src/tests/utilities/api/index.ts | 3 - .../src/tests/utilities/api/permission.ts | 52 -- .../server/src/tests/utilities/api/row.ts | 37 +- .../server/src/tests/utilities/api/viewV2.ts | 74 +- packages/server/src/threads/automation.ts | 6 +- packages/server/src/threads/definitions.ts | 6 - packages/server/src/threads/query.ts | 8 +- packages/server/src/utilities/global.ts | 86 ++- packages/server/src/utilities/security.ts | 8 +- packages/server/src/utilities/users.ts | 17 +- .../server/src/utilities/workerRequests.ts | 31 +- packages/shared-core/package.json | 11 - packages/shared-core/src/filters.ts | 97 ++- packages/shared-core/tsconfig.build.json | 2 +- packages/shared-core/tsconfig.json | 6 - packages/types/src/api/web/app/rows.ts | 13 +- packages/types/src/api/web/app/table.ts | 12 +- packages/types/src/api/web/index.ts | 1 - packages/types/src/api/web/searchFilter.ts | 54 -- .../types/src/documents/app/automation.ts | 5 +- packages/types/src/documents/app/view.ts | 7 +- packages/types/src/documents/document.ts | 6 - .../types/src/documents/global/userGroup.ts | 4 - packages/types/src/sdk/datasources.ts | 6 - packages/types/src/sdk/index.ts | 1 - packages/types/src/sdk/licensing/feature.ts | 2 - packages/types/src/sdk/permissions.ts | 1 + packages/types/src/sdk/row.ts | 16 - packages/types/src/sdk/search.ts | 6 - packages/types/tsconfig.build.json | 2 +- packages/worker/Dockerfile | 2 +- packages/worker/package.json | 15 - .../worker/src/api/controllers/global/self.ts | 4 +- .../src/api/controllers/global/users.ts | 8 +- .../routes/global/tests/appBuilder.spec.ts | 4 +- .../src/api/routes/global/tests/scim.spec.ts | 2 - packages/worker/src/environment.ts | 2 - packages/worker/src/features.ts | 13 - packages/worker/src/tests/jestEnv.ts | 2 +- .../validators/dynamodb.integration.spec.ts | 4 +- scripts/build.js | 6 +- yarn.lock | 30 +- 228 files changed, 2643 insertions(+), 4345 deletions(-) delete mode 100644 .github/workflows/check_unreleased_changes.yml rename hosting/{tests => dependencies}/Dockerfile (100%) rename hosting/{tests => dependencies}/README.md (100%) rename hosting/{tests => dependencies}/runner.sh (100%) create mode 100644 hosting/docker-compose.test.yaml rename packages/backend-core/src/{features => featureFlags}/index.ts (98%) rename packages/backend-core/src/{features => featureFlags}/tests/featureFlags.spec.ts (100%) delete mode 100644 packages/backend-core/src/features/installation.ts delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/LeftPanel.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/ComponentDropdownMenu.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/ComponentKeyHandler.svelte (90%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/ComponentScrollWrapper.svelte (93%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/ComponentTree.svelte (98%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/DNDPositionIndicator.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/ScreenslotDropdownMenu.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ComponentList => components/[componentId]/_components/navigation}/dndStore.js (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/ComponentInfoSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/ComponentSettingsPanel.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/ComponentSettingsSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/ConditionalUIDrawer.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/ConditionalUISection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/CustomStylesSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/DesignSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/StyleSection.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Component => components/[componentId]/_components/settings}/componentStyles.js (100%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{ => components}/[componentId]/new/_components/NewComponentPanel.svelte (98%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{ => components}/[componentId]/new/_components/componentStructure.json (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{ => components}/[componentId]/new/index.svelte (100%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Navigation/LinksDrawer.svelte => navigation/_components/NavigationLinksDrawer.svelte} (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Navigation/LinksEditor.svelte => navigation/_components/NavigationLinksEditor.svelte} (75%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ScreenList => screens/_components}/RoleIndicator.svelte (87%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{_components/ScreenList/DropdownMenu.svelte => screens/_components/ScreenDropdownMenu.svelte} (97%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Screen/GeneralPanel.svelte => screens/_components/ScreenSettingsPanel.svelte} (72%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Screen => theme/_components}/AppThemeSelect.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/[screenId]/{[componentId]/_components/Screen => theme/_components}/ButtonRoundnessSelect.svelte (100%) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ThemeInfoPanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ThemeSettingsPanel.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/_components/{NewScreen => }/CreateScreenModal.svelte (94%) rename packages/builder/src/pages/builder/app/[application]/design/_components/{NewScreen => }/DatasourceModal.svelte (100%) delete mode 100644 packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/index.svelte rename packages/builder/src/pages/builder/app/[application]/design/_components/{NewScreen => }/ScreenRoleModal.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/design/{_components/NewScreen => }/blank.png (100%) rename packages/builder/src/pages/builder/app/[application]/design/{_components/NewScreen => }/table.png (100%) delete mode 100644 packages/server/specs/resources/roles.ts delete mode 100644 packages/server/src/api/controllers/public/roles.ts delete mode 100644 packages/server/src/api/routes/public/roles.ts create mode 100644 packages/server/src/api/routes/public/tests/users.spec.js delete mode 100644 packages/server/src/api/routes/public/tests/users.spec.ts rename packages/server/src/api/routes/tests/{permissions.spec.ts => permissions.spec.js} (57%) rename packages/server/src/automations/tests/{filter.spec.ts => filter.spec.js} (76%) delete mode 100644 packages/server/src/features.ts delete mode 100644 packages/server/src/koa.ts create mode 100644 packages/server/src/middleware/noViewData.ts create mode 100644 packages/server/src/middleware/tests/noViewData.spec.ts delete mode 100644 packages/server/src/sdk/app/permissions/index.ts delete mode 100644 packages/server/src/sdk/app/permissions/tests/permissions.spec.ts delete mode 100644 packages/server/src/tests/utilities/api/permission.ts delete mode 100644 packages/types/src/api/web/searchFilter.ts delete mode 100644 packages/types/src/sdk/row.ts delete mode 100644 packages/worker/src/features.ts diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 3e4b2221d2..9da52f8bc0 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -18,8 +18,6 @@ env: BRANCH: ${{ github.event.pull_request.head.ref }} BASE_BRANCH: ${{ github.event.pull_request.base.ref}} PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - NX_BASE_BRANCH: origin/${{ github.base_ref }} - USE_NX_AFFECTED: ${{ github.event_name == 'pull_request' && github.base_ref != 'master'}} jobs: lint: @@ -27,20 +25,20 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Checkout repo only uses: actions/checkout@v3 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' + if: github.repository != 'Budibase/budibase' - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile + - run: yarn - run: yarn lint build: @@ -48,66 +46,45 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - fetch-depth: 0 - name: Checkout repo only uses: actions/checkout@v3 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' - with: - fetch-depth: 0 + if: github.repository != 'Budibase/budibase' - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile - + - run: yarn # Run build all the projects - - name: Build - run: | - yarn build + - run: yarn build # Check the types of the projects built via esbuild - - name: Check types - run: | - if ${{ env.USE_NX_AFFECTED }}; then - yarn check:types --since=${{ env.NX_BASE_BRANCH }} - else - yarn check:types - fi + - run: yarn check:types test-libraries: runs-on: ubuntu-latest steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - fetch-depth: 0 - name: Checkout repo only uses: actions/checkout@v3 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' - with: - fetch-depth: 0 + if: github.repository != 'Budibase/budibase' - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile - - name: Test - run: | - if ${{ env.USE_NX_AFFECTED }}; then - yarn test --ignore=@budibase/worker --ignore=@budibase/server --ignore=@budibase/pro --since=${{ env.NX_BASE_BRANCH }} - else - yarn test --ignore=@budibase/worker --ignore=@budibase/server --ignore=@budibase/pro - fi + - run: yarn + - run: yarn test --ignore=@budibase/worker --ignore=@budibase/server --ignore=@budibase/pro - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos @@ -119,31 +96,21 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - fetch-depth: 0 - name: Checkout repo only uses: actions/checkout@v3 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' - with: - fetch-depth: 0 + if: github.repository != 'Budibase/budibase' - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile - - name: Test worker and server - run: | - if ${{ env.USE_NX_AFFECTED }}; then - yarn test --scope=@budibase/worker --scope=@budibase/server --since=${{ env.NX_BASE_BRANCH }} - else - yarn test --scope=@budibase/worker --scope=@budibase/server - fi - + - run: yarn + - run: yarn test --scope=@budibase/worker --scope=@budibase/server - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN || github.token }} # not required for public repos @@ -152,50 +119,42 @@ jobs: test-pro: runs-on: ubuntu-latest - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' steps: - name: Checkout repo and submodules uses: actions/checkout@v3 with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - fetch-depth: 0 - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile - - name: Test - run: | - if ${{ env.USE_NX_AFFECTED }}; then - yarn test --scope=@budibase/pro --since=${{ env.NX_BASE_BRANCH }} - else - yarn test --scope=@budibase/pro - fi + - run: yarn + - run: yarn test --scope=@budibase/pro integration-test: runs-on: ubuntu-latest steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Checkout repo only uses: actions/checkout@v3 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' + if: github.repository != 'Budibase/budibase' - - name: Use Node.js 18.x + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 14.x cache: "yarn" - - run: yarn --frozen-lockfile - - name: Build packages - run: yarn build --scope @budibase/server --scope @budibase/worker --scope @budibase/client --scope @budibase/backend-core + - run: yarn + - run: yarn build --projects=@budibase/server,@budibase/worker,@budibase/client - name: Run tests run: | cd qa-core @@ -207,12 +166,13 @@ jobs: check-pro-submodule: runs-on: ubuntu-latest - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' + if: github.repository == 'Budibase/budibase' steps: - name: Checkout repo and submodules uses: actions/checkout@v3 with: submodules: true + fetch-depth: 0 token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Check pro commit diff --git a/.github/workflows/check_unreleased_changes.yml b/.github/workflows/check_unreleased_changes.yml deleted file mode 100644 index d558330545..0000000000 --- a/.github/workflows/check_unreleased_changes.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: check_unreleased_changes - -on: - pull_request: - branches: - - master - -jobs: - check_unreleased: - runs-on: ubuntu-latest - steps: - - name: Check for unreleased changes - env: - REPO: "Budibase/budibase" - TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - RELEASE_TIMESTAMP=$(curl -s -H "Authorization: token $TOKEN" \ - "https://api.github.com/repos/$REPO/releases/latest" | \ - jq -r .published_at) - COMMIT_TIMESTAMP=$(curl -s -H "Authorization: token $TOKEN" \ - "https://api.github.com/repos/$REPO/commits/master" | \ - jq -r .commit.committer.date) - RELEASE_SECONDS=$(date --date="$RELEASE_TIMESTAMP" "+%s") - COMMIT_SECONDS=$(date --date="$COMMIT_TIMESTAMP" "+%s") - if (( COMMIT_SECONDS > RELEASE_SECONDS )); then - echo "There are unreleased changes. Please release these changes before merging." - exit 1 - fi - echo "No unreleased changes detected." diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index bd727b7865..61cb283e28 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -44,7 +44,7 @@ jobs: - uses: actions/setup-node@v1 with: - node-version: 18.x + node-version: 14.x - run: yarn install --frozen-lockfile - name: Update versions diff --git a/.nvmrc b/.nvmrc index 7950a44576..835d07c442 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v18.17.0 +v14.20.1 diff --git a/.tool-versions b/.tool-versions index a909d60941..9f2ea77b14 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -nodejs 18.17.0 +nodejs 14.21.3 python 3.10.0 -yarn 1.22.19 +yarn 1.22.19 \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index cfd8d7b155..8cb49d5825 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,31 +1,42 @@ - { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Budibase Server", - "type": "node", - "request": "launch", - "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], - "args": ["${workspaceFolder}/packages/server/src/index.ts"], - "cwd": "${workspaceFolder}/packages/server" - }, - { - "name": "Budibase Worker", - "type": "node", - "request": "launch", - "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], - "args": ["${workspaceFolder}/packages/worker/src/index.ts"], - "cwd": "${workspaceFolder}/packages/worker" - } - ], - "compounds": [ - { - "name": "Start Budibase", - "configurations": ["Budibase Server", "Budibase Worker"] - } - ] -} + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Budibase Server", + "type": "node", + "request": "launch", + "runtimeArgs": [ + "--nolazy", + "-r", + "ts-node/register/transpile-only" + ], + "args": [ + "${workspaceFolder}/packages/server/src/index.ts" + ], + "cwd": "${workspaceFolder}/packages/server" + }, + { + "name": "Budibase Worker", + "type": "node", + "request": "launch", + "runtimeArgs": [ + "--nolazy", + "-r", + "ts-node/register/transpile-only" + ], + "args": [ + "${workspaceFolder}/packages/worker/src/index.ts" + ], + "cwd": "${workspaceFolder}/packages/worker" + }, + ], + "compounds": [ + { + "name": "Start Budibase", + "configurations": ["Budibase Server", "Budibase Worker"] + } + ] +} \ No newline at end of file diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 70f198a84c..2fb4c36fa8 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -90,7 +90,7 @@ Component libraries are collections of components as well as the definition of t #### 1. Prerequisites -- NodeJS version `18.x.x` +- NodeJS version `14.x.x` - Python version `3.x` ### Using asdf (recommended) diff --git a/hosting/tests/Dockerfile b/hosting/dependencies/Dockerfile similarity index 100% rename from hosting/tests/Dockerfile rename to hosting/dependencies/Dockerfile diff --git a/hosting/tests/README.md b/hosting/dependencies/README.md similarity index 100% rename from hosting/tests/README.md rename to hosting/dependencies/README.md diff --git a/hosting/tests/runner.sh b/hosting/dependencies/runner.sh similarity index 100% rename from hosting/tests/runner.sh rename to hosting/dependencies/runner.sh diff --git a/hosting/docker-compose.test.yaml b/hosting/docker-compose.test.yaml new file mode 100644 index 0000000000..f059173d2d --- /dev/null +++ b/hosting/docker-compose.test.yaml @@ -0,0 +1,47 @@ +version: "3" + +# optional ports are specified throughout for more advanced use cases. + +services: + minio-service: + restart: on-failure + # Last version that supports the "fs" backend + image: minio/minio:RELEASE.2022-10-24T18-35-07Z + ports: + - "9000" + - "9001" + environment: + MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY} + MINIO_SECRET_KEY: ${MINIO_SECRET_KEY} + command: server /data --console-address ":9001" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 + + couchdb-service: + # platform: linux/amd64 + restart: on-failure + image: budibase/couchdb + environment: + - COUCHDB_PASSWORD=${COUCH_DB_PASSWORD} + - COUCHDB_USER=${COUCH_DB_USER} + ports: + - "5984" + - "4369" + - "9100" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5984/_up"] + interval: 30s + timeout: 20s + retries: 3 + + redis-service: + restart: on-failure + image: redis + command: redis-server --requirepass ${REDIS_PASSWORD} + ports: + - "6379" + healthcheck: + test: ["CMD", "redis-cli", "ping"] \ No newline at end of file diff --git a/hosting/single/Dockerfile b/hosting/single/Dockerfile index 9fdf2449d1..e43e5ad10c 100644 --- a/hosting/single/Dockerfile +++ b/hosting/single/Dockerfile @@ -1,7 +1,7 @@ -FROM node:18-slim as build +FROM node:14-slim as build # install node-gyp dependencies -RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils cron g++ make python3 +RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends apt-utils cron g++ make python # add pin script WORKDIR / diff --git a/jestTestcontainersConfigGenerator.js b/jestTestcontainersConfigGenerator.js index 1e39ed771f..4b94cf5016 100644 --- a/jestTestcontainersConfigGenerator.js +++ b/jestTestcontainersConfigGenerator.js @@ -1,16 +1,9 @@ module.exports = () => { return { - couchdb: { - image: "budibase/couchdb", - ports: [5984], - env: { - COUCHDB_PASSWORD: "budibase", - COUCHDB_USER: "budibase", - }, - wait: { - type: "ports", - timeout: 20000, - } - } + dockerCompose: { + composeFilePath: "../../hosting", + composeFile: "docker-compose.test.yaml", + startupTimeout: 10000, + }, } } diff --git a/package.json b/package.json index 4e4befb5f2..d27af2e27d 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "preinstall": "node scripts/syncProPackage.js", "setup": "git config submodule.recurse true && git submodule update && node ./hosting/scripts/setup.js && yarn && yarn build && yarn dev", "bootstrap": "./scripts/link-dependencies.sh && echo '***BOOTSTRAP ONLY REQUIRED FOR USE WITH ACCOUNT PORTAL***'", - "build": "lerna run build --stream", + "build": "yarn nx run-many -t=build", "build:dev": "lerna run --stream prebuild && yarn nx run-many --target=build --output-style=dynamic --watch --preserveWatchOutput", "check:types": "lerna run check:types", "backend:bootstrap": "./scripts/scopeBackend.sh && yarn run bootstrap", @@ -109,7 +109,7 @@ "@budibase/types": "0.0.0" }, "engines": { - "node": ">=18.0.0 <19.0.0" + "node": ">=14.0.0 <15.0.0" }, "dependencies": {} } diff --git a/packages/backend-core/src/cache/user.ts b/packages/backend-core/src/cache/user.ts index e2af78adfd..8281bfca62 100644 --- a/packages/backend-core/src/cache/user.ts +++ b/packages/backend-core/src/cache/user.ts @@ -4,8 +4,6 @@ import * as context from "../context" import * as platform from "../platform" import env from "../environment" import * as accounts from "../accounts" -import { UserDB } from "../users" -import { sdk } from "@budibase/shared-core" const EXPIRY_SECONDS = 3600 @@ -62,18 +60,6 @@ export async function getUser( // make sure the tenant ID is always correct/set user.tenantId = tenantId } - // if has groups, could have builder permissions granted by a group - if (user.userGroups && !sdk.users.isGlobalBuilder(user)) { - await context.doInTenant(tenantId, async () => { - const appIds = await UserDB.getGroupBuilderAppIds(user) - if (appIds.length) { - const existing = user.builder?.apps || [] - user.builder = { - apps: [...new Set(existing.concat(appIds))], - } - } - }) - } return user } diff --git a/packages/backend-core/src/db/lucene.ts b/packages/backend-core/src/db/lucene.ts index 7451d581b5..a491451a62 100644 --- a/packages/backend-core/src/db/lucene.ts +++ b/packages/backend-core/src/db/lucene.ts @@ -1,6 +1,7 @@ import fetch from "node-fetch" import { getCouchInfo } from "./couch" -import { SearchFilters, Row, EmptyFilterOption } from "@budibase/types" +import { SearchFilters, Row } from "@budibase/types" +import { createUserIndex } from "./searchIndexes/searchIndexes" const QUERY_START_REGEX = /\d[0-9]*:/g @@ -64,7 +65,6 @@ export class QueryBuilder { this.#index = index this.#query = { allOr: false, - onEmptyFilter: EmptyFilterOption.RETURN_ALL, string: {}, fuzzy: {}, range: {}, @@ -218,10 +218,6 @@ export class QueryBuilder { this.#query.allOr = true } - setOnEmptyFilter(value: EmptyFilterOption) { - this.#query.onEmptyFilter = value - } - handleSpaces(input: string) { if (this.#noEscaping) { return input @@ -293,9 +289,8 @@ export class QueryBuilder { const builder = this let allOr = this.#query && this.#query.allOr let query = allOr ? "" : "*:*" - let allFiltersEmpty = true const allPreProcessingOpts = { escape: true, lowercase: true, wrap: true } - let tableId: string = "" + let tableId if (this.#query.equal!.tableId) { tableId = this.#query.equal!.tableId delete this.#query.equal!.tableId @@ -310,7 +305,7 @@ export class QueryBuilder { } const contains = (key: string, value: any, mode = "AND") => { - if (!value || (Array.isArray(value) && value.length === 0)) { + if (Array.isArray(value) && value.length === 0) { return null } if (!Array.isArray(value)) { @@ -389,12 +384,6 @@ export class QueryBuilder { built += ` ${mode} ` } built += expression - if ( - (typeof value !== "string" && value != null) || - (typeof value === "string" && value !== tableId && value !== "") - ) { - allFiltersEmpty = false - } } if (opts?.returnBuilt) { return built @@ -474,13 +463,6 @@ export class QueryBuilder { allOr = false build({ tableId }, equal) } - if (allFiltersEmpty) { - if (this.#query.onEmptyFilter === EmptyFilterOption.RETURN_NONE) { - return "" - } else if (this.#query?.allOr) { - return query.replace("()", "(*:*)") - } - } return query } diff --git a/packages/backend-core/src/db/tests/lucene.spec.ts b/packages/backend-core/src/db/tests/lucene.spec.ts index 7716661d88..a82828d8f2 100644 --- a/packages/backend-core/src/db/tests/lucene.spec.ts +++ b/packages/backend-core/src/db/tests/lucene.spec.ts @@ -1,6 +1,6 @@ import { newid } from "../../docIds/newid" import { getDB } from "../db" -import { Database, EmptyFilterOption } from "@budibase/types" +import { Database } from "@budibase/types" import { QueryBuilder, paginatedSearch, fullSearch } from "../lucene" const INDEX_NAME = "main" @@ -156,76 +156,6 @@ describe("lucene", () => { expect(resp.rows.length).toBe(2) }) - describe("empty filters behaviour", () => { - it("should return all rows by default", async () => { - const builder = new QueryBuilder(dbName, INDEX_NAME) - builder.addEqual("property", "") - builder.addEqual("number", null) - builder.addString("property", "") - builder.addFuzzy("property", "") - builder.addNotEqual("number", undefined) - builder.addOneOf("number", null) - builder.addContains("array", undefined) - builder.addNotContains("array", null) - builder.addContainsAny("array", null) - - const resp = await builder.run() - expect(resp.rows.length).toBe(3) - }) - - it("should return all rows when onEmptyFilter is ALL", async () => { - const builder = new QueryBuilder(dbName, INDEX_NAME) - builder.setOnEmptyFilter(EmptyFilterOption.RETURN_ALL) - builder.setAllOr() - builder.addEqual("property", "") - builder.addEqual("number", null) - builder.addString("property", "") - builder.addFuzzy("property", "") - builder.addNotEqual("number", undefined) - builder.addOneOf("number", null) - builder.addContains("array", undefined) - builder.addNotContains("array", null) - builder.addContainsAny("array", null) - - const resp = await builder.run() - expect(resp.rows.length).toBe(3) - }) - - it("should return no rows when onEmptyFilter is NONE", async () => { - const builder = new QueryBuilder(dbName, INDEX_NAME) - builder.setOnEmptyFilter(EmptyFilterOption.RETURN_NONE) - builder.addEqual("property", "") - builder.addEqual("number", null) - builder.addString("property", "") - builder.addFuzzy("property", "") - builder.addNotEqual("number", undefined) - builder.addOneOf("number", null) - builder.addContains("array", undefined) - builder.addNotContains("array", null) - builder.addContainsAny("array", null) - - const resp = await builder.run() - expect(resp.rows.length).toBe(0) - }) - - it("should return all matching rows when onEmptyFilter is NONE, but a filter value is provided", async () => { - const builder = new QueryBuilder(dbName, INDEX_NAME) - builder.setOnEmptyFilter(EmptyFilterOption.RETURN_NONE) - builder.addEqual("property", "") - builder.addEqual("number", 1) - builder.addString("property", "") - builder.addFuzzy("property", "") - builder.addNotEqual("number", undefined) - builder.addOneOf("number", null) - builder.addContains("array", undefined) - builder.addNotContains("array", null) - builder.addContainsAny("array", null) - - const resp = await builder.run() - expect(resp.rows.length).toBe(1) - }) - }) - describe("skip", () => { const skipDbName = `db-${newid()}` let docs: { diff --git a/packages/backend-core/src/features/index.ts b/packages/backend-core/src/featureFlags/index.ts similarity index 98% rename from packages/backend-core/src/features/index.ts rename to packages/backend-core/src/featureFlags/index.ts index 8f5c903e05..877cd60e1a 100644 --- a/packages/backend-core/src/features/index.ts +++ b/packages/backend-core/src/featureFlags/index.ts @@ -1,6 +1,5 @@ import env from "../environment" import * as context from "../context" -export * from "./installation" /** * Read the TENANT_FEATURE_FLAGS env var and return an array of features flags for each tenant. diff --git a/packages/backend-core/src/features/tests/featureFlags.spec.ts b/packages/backend-core/src/featureFlags/tests/featureFlags.spec.ts similarity index 100% rename from packages/backend-core/src/features/tests/featureFlags.spec.ts rename to packages/backend-core/src/featureFlags/tests/featureFlags.spec.ts diff --git a/packages/backend-core/src/features/installation.ts b/packages/backend-core/src/features/installation.ts deleted file mode 100644 index defc8bf987..0000000000 --- a/packages/backend-core/src/features/installation.ts +++ /dev/null @@ -1,17 +0,0 @@ -export function processFeatureEnvVar( - fullList: string[], - featureList?: string -) { - let list - if (!featureList) { - list = fullList - } else { - list = featureList.split(",") - } - for (let feature of list) { - if (!fullList.includes(feature)) { - throw new Error(`Feature: ${feature} is not an allowed option`) - } - } - return list as unknown as T[] -} diff --git a/packages/backend-core/src/index.ts b/packages/backend-core/src/index.ts index ffffd8240a..7b98674788 100644 --- a/packages/backend-core/src/index.ts +++ b/packages/backend-core/src/index.ts @@ -6,8 +6,7 @@ export * as roles from "./security/roles" export * as permissions from "./security/permissions" export * as accounts from "./accounts" export * as installation from "./installation" -export * as featureFlags from "./features" -export * as features from "./features/installation" +export * as featureFlags from "./featureFlags" export * as sessions from "./security/sessions" export * as platform from "./platform" export * as auth from "./auth" diff --git a/packages/backend-core/src/middleware/builderOnly.ts b/packages/backend-core/src/middleware/builderOnly.ts index fafcc524cc..8c1c54a44c 100644 --- a/packages/backend-core/src/middleware/builderOnly.ts +++ b/packages/backend-core/src/middleware/builderOnly.ts @@ -5,12 +5,11 @@ import env from "../environment" export default async (ctx: UserCtx, next: any) => { const appId = getAppId() - const builderFn = - env.isWorker() || !appId - ? hasBuilderPermissions - : env.isApps() - ? isBuilder - : undefined + const builderFn = env.isWorker() + ? hasBuilderPermissions + : env.isApps() + ? isBuilder + : undefined if (!builderFn) { throw new Error("Service name unknown - middleware inactive.") } diff --git a/packages/backend-core/src/middleware/builderOrAdmin.ts b/packages/backend-core/src/middleware/builderOrAdmin.ts index 4b8badec15..c03e856233 100644 --- a/packages/backend-core/src/middleware/builderOrAdmin.ts +++ b/packages/backend-core/src/middleware/builderOrAdmin.ts @@ -5,12 +5,11 @@ import env from "../environment" export default async (ctx: UserCtx, next: any) => { const appId = getAppId() - const builderFn = - env.isWorker() || !appId - ? hasBuilderPermissions - : env.isApps() - ? isBuilder - : undefined + const builderFn = env.isWorker() + ? hasBuilderPermissions + : env.isApps() + ? isBuilder + : undefined if (!builderFn) { throw new Error("Service name unknown - middleware inactive.") } diff --git a/packages/backend-core/src/security/permissions.ts b/packages/backend-core/src/security/permissions.ts index aa0b20a30c..70dae57ae6 100644 --- a/packages/backend-core/src/security/permissions.ts +++ b/packages/backend-core/src/security/permissions.ts @@ -78,6 +78,7 @@ export const BUILTIN_PERMISSIONS = { permissions: [ new Permission(PermissionType.QUERY, PermissionLevel.READ), new Permission(PermissionType.TABLE, PermissionLevel.READ), + new Permission(PermissionType.VIEW, PermissionLevel.READ), ], }, WRITE: { @@ -86,6 +87,7 @@ export const BUILTIN_PERMISSIONS = { permissions: [ new Permission(PermissionType.QUERY, PermissionLevel.WRITE), new Permission(PermissionType.TABLE, PermissionLevel.WRITE), + new Permission(PermissionType.VIEW, PermissionLevel.READ), new Permission(PermissionType.AUTOMATION, PermissionLevel.EXECUTE), ], }, @@ -96,6 +98,7 @@ export const BUILTIN_PERMISSIONS = { new Permission(PermissionType.TABLE, PermissionLevel.WRITE), new Permission(PermissionType.USER, PermissionLevel.READ), new Permission(PermissionType.AUTOMATION, PermissionLevel.EXECUTE), + new Permission(PermissionType.VIEW, PermissionLevel.READ), new Permission(PermissionType.WEBHOOK, PermissionLevel.READ), ], }, @@ -106,6 +109,7 @@ export const BUILTIN_PERMISSIONS = { new Permission(PermissionType.TABLE, PermissionLevel.ADMIN), new Permission(PermissionType.USER, PermissionLevel.ADMIN), new Permission(PermissionType.AUTOMATION, PermissionLevel.ADMIN), + new Permission(PermissionType.VIEW, PermissionLevel.ADMIN), new Permission(PermissionType.WEBHOOK, PermissionLevel.READ), new Permission(PermissionType.QUERY, PermissionLevel.ADMIN), ], diff --git a/packages/backend-core/src/users/db.ts b/packages/backend-core/src/users/db.ts index c288540f35..55cc97bb1c 100644 --- a/packages/backend-core/src/users/db.ts +++ b/packages/backend-core/src/users/db.ts @@ -1,32 +1,30 @@ import env from "../environment" import * as eventHelpers from "./events" import * as accounts from "../accounts" -import * as accountSdk from "../accounts" import * as cache from "../cache" -import { getGlobalDB, getIdentity, getTenantId } from "../context" +import { getIdentity, getTenantId, getGlobalDB } from "../context" import * as dbUtils from "../db" import { EmailUnavailableError, HTTPError } from "../errors" import * as platform from "../platform" import * as sessions from "../security/sessions" import * as usersCore from "./users" import { - Account, AllDocsResponse, BulkUserCreated, BulkUserDeleted, - isSSOAccount, - isSSOUser, RowResponse, SaveUserOpts, User, + Account, + isSSOUser, + isSSOAccount, UserStatus, - UserGroup, - ContextUser, } from "@budibase/types" +import * as accountSdk from "../accounts" import { + validateUniqueUser, getAccountHolderFromUserIds, isAdmin, - validateUniqueUser, } from "./utils" import { searchExistingEmails } from "./lookup" import { hash } from "../utils" @@ -34,14 +32,8 @@ import { hash } from "../utils" type QuotaUpdateFn = (change: number, cb?: () => Promise) => Promise type GroupUpdateFn = (groupId: string, userIds: string[]) => Promise type FeatureFn = () => Promise -type GroupGetFn = (ids: string[]) => Promise -type GroupBuildersFn = (user: User) => Promise type QuotaFns = { addUsers: QuotaUpdateFn; removeUsers: QuotaUpdateFn } -type GroupFns = { - addUsers: GroupUpdateFn - getBulk: GroupGetFn - getGroupBuilderAppIds: GroupBuildersFn -} +type GroupFns = { addUsers: GroupUpdateFn } type FeatureFns = { isSSOEnforced: FeatureFn; isAppBuildersEnabled: FeatureFn } const bulkDeleteProcessing = async (dbUser: User) => { @@ -187,14 +179,6 @@ export class UserDB { return user } - static async bulkGet(userIds: string[]) { - return await usersCore.bulkGetGlobalUsersById(userIds) - } - - static async bulkUpdate(users: User[]) { - return await usersCore.bulkUpdateGlobalUsers(users) - } - static async save(user: User, opts: SaveUserOpts = {}): Promise { // default booleans to true if (opts.hashPassword == null) { @@ -473,12 +457,4 @@ export class UserDB { await cache.user.invalidateUser(userId) await sessions.invalidateSessions(userId, { reason: "deletion" }) } - - static async getGroups(groupIds: string[]) { - return await this.groups.getBulk(groupIds) - } - - static async getGroupBuilderAppIds(user: User) { - return await this.groups.getGroupBuilderAppIds(user) - } } diff --git a/packages/backend-core/tests/core/utilities/mocks/licenses.ts b/packages/backend-core/tests/core/utilities/mocks/licenses.ts index 309f0fd159..6747282040 100644 --- a/packages/backend-core/tests/core/utilities/mocks/licenses.ts +++ b/packages/backend-core/tests/core/utilities/mocks/licenses.ts @@ -86,10 +86,6 @@ export const useAuditLogs = () => { return useFeature(Feature.AUDIT_LOGS) } -export const usePublicApiUserRoles = () => { - return useFeature(Feature.USER_ROLE_PUBLIC_API) -} - export const useScimIntegration = () => { return useFeature(Feature.SCIM) } @@ -102,10 +98,6 @@ export const useAppBuilders = () => { return useFeature(Feature.APP_BUILDERS) } -export const useViewPermissions = () => { - return useFeature(Feature.VIEW_PERMISSIONS) -} - // QUOTAS export const setAutomationLogsQuota = (value: number) => { diff --git a/packages/backend-core/tests/core/utilities/testContainerUtils.ts b/packages/backend-core/tests/core/utilities/testContainerUtils.ts index 7da6cbc777..f6c702f7ef 100644 --- a/packages/backend-core/tests/core/utilities/testContainerUtils.ts +++ b/packages/backend-core/tests/core/utilities/testContainerUtils.ts @@ -32,8 +32,8 @@ function getTestContainerSettings( ): string | null { const entry = Object.entries(global).find( ([k]) => - k.includes(`${serverName.toUpperCase()}`) && - k.includes(`${key.toUpperCase()}`) + k.includes(`_${serverName.toUpperCase()}`) && + k.includes(`_${key.toUpperCase()}__`) ) if (!entry) { return null @@ -67,14 +67,27 @@ function getContainerInfo(containerName: string, port: number) { } function getCouchConfig() { - return getContainerInfo("couchdb", 5984) + return getContainerInfo("couchdb-service", 5984) +} + +function getMinioConfig() { + return getContainerInfo("minio-service", 9000) +} + +function getRedisConfig() { + return getContainerInfo("redis-service", 6379) } export function setupEnv(...envs: any[]) { - const couch = getCouchConfig() + const couch = getCouchConfig(), + minio = getCouchConfig(), + redis = getRedisConfig() const configs = [ { key: "COUCH_DB_PORT", value: couch.port }, { key: "COUCH_DB_URL", value: couch.url }, + { key: "MINIO_PORT", value: minio.port }, + { key: "MINIO_URL", value: minio.url }, + { key: "REDIS_URL", value: redis.url }, ] for (const config of configs.filter(x => !!x.value)) { diff --git a/packages/bbui/src/Actions/position_dropdown.js b/packages/bbui/src/Actions/position_dropdown.js index 4a5ef890bf..8fa02bb8f3 100644 --- a/packages/bbui/src/Actions/position_dropdown.js +++ b/packages/bbui/src/Actions/position_dropdown.js @@ -32,10 +32,11 @@ export default function positionDropdown(element, opts) { left: null, top: null, } + // Determine vertical styles if (align === "right-outside") { styles.top = anchorBounds.top - } else if (window.innerHeight - anchorBounds.bottom < (maxHeight || 100)) { + } else if (window.innerHeight - anchorBounds.bottom < 100) { styles.top = anchorBounds.top - elementBounds.height - offset styles.maxHeight = maxHeight || 240 } else { diff --git a/packages/bbui/src/ColorPicker/ColorPicker.svelte b/packages/bbui/src/ColorPicker/ColorPicker.svelte index 2ba5309860..9a70134fb6 100644 --- a/packages/bbui/src/ColorPicker/ColorPicker.svelte +++ b/packages/bbui/src/ColorPicker/ColorPicker.svelte @@ -1,8 +1,8 @@ -
{ - dropdown.toggle() - }} -> -
-
- - - -
+
+
(open = true)}> +
+
+ {#if open} +
{#each categories as category}
{category.label}
@@ -184,8 +187,8 @@
- - + {/if} +
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte deleted file mode 100644 index 13a008fae0..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte +++ /dev/null @@ -1,78 +0,0 @@ - - -
- - These settings apply to all screens -
- - - - - - - update("buttonBorderRadius", e.detail)} - /> - - update("primaryColor", val)} - props={{ - spectrumTheme: $store.theme, - }} - /> - update("primaryColorHover", val)} - props={{ - spectrumTheme: $store.theme, - }} - /> - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte deleted file mode 100644 index 778fa303cc..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte +++ /dev/null @@ -1,51 +0,0 @@ - - - -
-
- {#each tabs as tab} - { - activeTab = tab - }} - > - {capitalise(tab)} - - {/each} -
-
- - {#if activeTab === "theme"} - - {:else} - - {/if} - -
- - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte deleted file mode 100644 index 19cb1d8dff..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte +++ /dev/null @@ -1,52 +0,0 @@ - - -{#if routeComponentId === `${$store.selectedScreenId}-screen`} - -{:else if routeComponentId === `${$store.selectedScreenId}-navigation`} - -{:else} - -{/if} - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte deleted file mode 100644 index 0ff63d1ead..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte +++ /dev/null @@ -1 +0,0 @@ - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte index 09f97302fd..785b221239 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte @@ -1,16 +1,32 @@
- + -
- Screens -
-
- -
-
- -
-
-
- {#if filteredScreens?.length} - {#each filteredScreens as screen (screen._id)} - store.actions.screens.select(screen._id)} - rightAlignIcon - showTooltip - selectedBy={$userSelectedResourceMap[screen._id]} - > - -
- -
-
- {/each} - {:else} - -
- There aren't any screens matching that route -
-
- {/if} -
- -
screensHeight.set("210px")} - /> -
- - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte new file mode 100644 index 0000000000..00165e4ee9 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte @@ -0,0 +1,5 @@ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte index 0e630b4f39..8bc0dcc3e5 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte @@ -1,10 +1,14 @@ -{#if $selectedScreen} -
-
- - - -
+
+
+ + $goto("./screens")} + /> + $goto("./components")} + /> + $goto("./theme")} + /> + $goto("./navigation")} + /> + {#if $store.layouts?.length} + $goto("./layouts")} + /> + {/if} +
-{/if} + +
+ {#if $selectedScreen} + + + {/if} +
+
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentDropdownMenu.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentDropdownMenu.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentDropdownMenu.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentDropdownMenu.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentKeyHandler.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentKeyHandler.svelte similarity index 90% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentKeyHandler.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentKeyHandler.svelte index b6957f64f3..4813757727 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentKeyHandler.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentKeyHandler.svelte @@ -5,6 +5,7 @@ import { goto, isActive } from "@roxi/routify" import { notifications } from "@budibase/bbui" import ConfirmDialog from "components/common/ConfirmDialog.svelte" + import { isBuilderInputFocused } from "helpers" let confirmDeleteDialog let confirmEjectDialog @@ -36,7 +37,7 @@ confirmEjectDialog.show() }, ["Ctrl+Enter"]: () => { - $goto(`./:componentId/new`) + $goto("./new") }, ["Delete"]: component => { // Don't show confirmation for the screen itself @@ -53,8 +54,8 @@ store.actions.components.selectNext() }, ["Escape"]: () => { - if ($isActive(`./:componentId/new`)) { - $goto(`./${$store.selectedComponentId}`) + if ($isActive("./new")) { + $goto("./") } }, } @@ -84,13 +85,10 @@ const handler = keyHandlers[key] if (!handler) { return false - } - - if (event && key !== "Escape") { + } else if (event) { event.preventDefault() event.stopPropagation() } - return await handler(component) } catch (error) { notifications.error(error || "Error handling key press") @@ -103,13 +101,7 @@ return } // Ignore events when typing - const activeTag = document.activeElement?.tagName.toLowerCase() - const inCodeEditor = - document.activeElement?.classList?.contains("cm-content") - if ( - (inCodeEditor || ["input", "textarea"].indexOf(activeTag) !== -1) && - e.key !== "Escape" - ) { + if (isBuilderInputFocused(e)) { return } // Key events are always for the selected component diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte new file mode 100644 index 0000000000..9513753d76 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte @@ -0,0 +1,90 @@ + + + +
+ +
+ +
    +
  • + { + $store.selectedComponentId = $selectedScreen?.props._id + }} + id={`component-${$selectedScreen?.props._id}`} + selectedBy={$userSelectedResourceMap[$selectedScreen?.props._id]} + > + + + + + + {#if $dndStore.dragging && $dndStore.valid} + + {#if $dndStore.dropPosition !== DropPosition.INSIDE} + + {/if} + {/if} +
  • +
+
+
+ + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentScrollWrapper.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentScrollWrapper.svelte similarity index 93% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentScrollWrapper.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentScrollWrapper.svelte index 484b56f21c..15ba7acecf 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentScrollWrapper.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentScrollWrapper.svelte @@ -9,14 +9,14 @@ if (!bounds) { return } - const sidebarWidth = 310 + const sidebarWidth = 259 const navItemHeight = 32 const { scrollLeft, scrollTop, offsetHeight } = scrollRef let scrollBounds = scrollRef.getBoundingClientRect() let newOffsets = {} // Calculate left offset - const offsetX = bounds.left + bounds.width + scrollLeft + 16 + const offsetX = bounds.left + bounds.width + scrollLeft - 36 if (offsetX > sidebarWidth) { newOffsets.left = offsetX - sidebarWidth } else { @@ -64,7 +64,6 @@
div { + padding: var(--spacing-xl) 0; flex: 1 1 auto; overflow: auto; height: 0; diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentTree.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentTree.svelte similarity index 98% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentTree.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentTree.svelte index 0e23f82946..18319e4b33 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentTree.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentTree.svelte @@ -107,7 +107,6 @@ id={`component-${component._id}`} > + import { syncURLToState } from "helpers/urlStateSync" + import { store, selectedScreen } from "builderStore" + import * as routify from "@roxi/routify" + import { onDestroy } from "svelte" + import { findComponent } from "builderStore/componentUtils" + import ComponentListPanel from "./_components/navigation/ComponentListPanel.svelte" + import ComponentSettingsPanel from "./_components/settings/ComponentSettingsPanel.svelte" + + $: componentId = $store.selectedComponentId + $: store.actions.websocket.selectResource(componentId) + + const cleanUrl = url => { + // Strip trailing slashes + if (url?.endsWith("/index")) { + url = url.replace("/index", "") + } + // Hide new component panel whenever component ID changes + if (url?.endsWith("/new")) { + url = url.replace("/new", "") + } + return { url } + } + + // Keep URL and state in sync for selected component ID + const stopSyncing = syncURLToState({ + urlParam: "componentId", + stateKey: "selectedComponentId", + validate: id => !!findComponent($selectedScreen.props, id), + fallbackUrl: "../", + store, + routify, + beforeNavigate: cleanUrl, + }) + + onDestroy(stopSyncing) + + + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte new file mode 100644 index 0000000000..9b5d05fe57 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte @@ -0,0 +1,4 @@ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte similarity index 98% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte index 248bbc8141..7dca5b792b 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte @@ -31,10 +31,6 @@ $: orderMap = createComponentOrderMap(componentList) const getAllowedComponents = (allComponents, screen, component) => { - // Default to using the root screen container if no component specified - if (!component) { - component = screen.props - } const path = findComponentPath(screen?.props, component?._id) if (!path?.length) { return [] diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/componentStructure.json b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/componentStructure.json rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/index.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/index.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/index.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte new file mode 100644 index 0000000000..f8c4cc0868 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte @@ -0,0 +1,18 @@ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte index c4ed7d949c..f5e3806bd6 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte @@ -1,6 +1,5 @@ diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte new file mode 100644 index 0000000000..cba68f899d --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte @@ -0,0 +1,41 @@ + + + +
+ +
+ Delete +
+ + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte new file mode 100644 index 0000000000..cc895317fd --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte @@ -0,0 +1,29 @@ + + + +
+ {#each $store.layouts as layout (layout._id)} + store.actions.layouts.select(layout._id)} + > + + + {/each} +
+
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte new file mode 100644 index 0000000000..bfc2f94f43 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte @@ -0,0 +1,53 @@ + + + + + + Custom layouts are being deprecated. They will be removed in a future + release. + + + You can save the content of this layout by pressing the button below. + + + This will copy all components inside your layout, which you can then paste + into a screen. + + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte new file mode 100644 index 0000000000..c82fefab3e --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte @@ -0,0 +1,20 @@ + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte new file mode 100644 index 0000000000..4d39403bc3 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte @@ -0,0 +1,7 @@ + + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte new file mode 100644 index 0000000000..1333c6afe3 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte @@ -0,0 +1,12 @@ + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte new file mode 100644 index 0000000000..09d45f8fde --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte @@ -0,0 +1,12 @@ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte new file mode 100644 index 0000000000..614e1eed80 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte @@ -0,0 +1,33 @@ + + + + + {#if $selectedScreen.layoutId} + + You can't preview your navigation settings using this screen as it uses + a custom layout, which is deprecated + + {/if} + + Your navigation is configured for all the screens within your app. + + + You can hide and show your navigation for each screen in the screen + settings. + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/LinksDrawer.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationLinksDrawer.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/LinksDrawer.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationLinksDrawer.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/LinksEditor.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationLinksEditor.svelte similarity index 75% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/LinksEditor.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationLinksEditor.svelte index b081ea6d72..895c82495d 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Navigation/LinksEditor.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationLinksEditor.svelte @@ -1,6 +1,6 @@ - - + + Configure the links in your navigation bar. diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte new file mode 100644 index 0000000000..c6d43984b2 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte @@ -0,0 +1,110 @@ + + + + + + + + + update("navigation", "Top")} + /> + update("navigation", "Left")} + /> + + + {#if $store.navigation.navigation === "Top"} + update("sticky", e.detail)} + /> + update("logoUrl", e.detail)} + placeholder="Add logo URL" + updateOnChange={false} + /> + {/if} + + + update("hideTitle", !e.detail)} + /> + {#if !$store.navigation.hideTitle} + update("title", e.detail)} + placeholder="Add title" + updateOnChange={false} + /> + {/if} + + + + update("navBackground", e.detail)} + /> + + + + update("navTextColor", e.detail)} + /> + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte new file mode 100644 index 0000000000..fc2e03d8e8 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte @@ -0,0 +1,7 @@ + + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/RoleIndicator.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/RoleIndicator.svelte similarity index 87% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/RoleIndicator.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/RoleIndicator.svelte index 694abe444a..2555b0b2a2 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/RoleIndicator.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/RoleIndicator.svelte @@ -26,7 +26,7 @@ {#if showTooltip}
- +
{/if}
@@ -38,11 +38,13 @@ .tooltip { z-index: 1; position: absolute; - bottom: -5px; - left: 13px; + top: 50%; + left: calc(50% - 8px); + transform: translateX(-100%) translateY(-50%); display: flex; flex-direction: row; justify-content: flex-end; + width: 200px; pointer-events: none; } .tooltip :global(.spectrum-Tooltip) { diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/DropdownMenu.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenDropdownMenu.svelte similarity index 97% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/DropdownMenu.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenDropdownMenu.svelte index c117c7e9dd..fd5ddd9459 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ScreenList/DropdownMenu.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenDropdownMenu.svelte @@ -56,7 +56,7 @@ const deleteScreen = async () => { try { await store.actions.screens.delete(screen) - notifications.success("Deleted screen successfully") + notifications.success("Deleted screen successfully.") } catch (err) { notifications.error("Error deleting screen") } diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte new file mode 100644 index 0000000000..6362af3073 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte @@ -0,0 +1,75 @@ + + + + + + (searchString = e.detail)} + /> + x.name} getOptionValue={x => x.key} diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index 2c07f8f431..ed0549eeca 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -287,3 +287,9 @@ export const DatasourceTypes = { GRAPH: "Graph", API: "API", } + +export const ROW_EXPORT_FORMATS = { + CSV: "csv", + JSON: "json", + JSON_WITH_SCHEMA: "jsonWithSchema", +} diff --git a/packages/client/src/components/app/forms/InnerForm.svelte b/packages/client/src/components/app/forms/InnerForm.svelte index c0b4b2b8a8..233ea79812 100644 --- a/packages/client/src/components/app/forms/InnerForm.svelte +++ b/packages/client/src/components/app/forms/InnerForm.svelte @@ -136,7 +136,7 @@ // Check arrays - remove any values not present in the field schema and // convert any values supplied to strings if (Array.isArray(value) && type === "array" && schema) { - const options = schema?.constraints.inclusion || [] + const options = schema?.constraints?.inclusion || [] return value.map(opt => String(opt)).filter(opt => options.includes(opt)) } return value diff --git a/packages/server/src/api/controllers/row/index.ts b/packages/server/src/api/controllers/row/index.ts index 7f6f494621..a3e8d55661 100644 --- a/packages/server/src/api/controllers/row/index.ts +++ b/packages/server/src/api/controllers/row/index.ts @@ -92,7 +92,7 @@ export async function fetchView(ctx: any) { () => sdk.rows.fetchView(tableId, viewName, { calculation, - group, + group: calculation ? group : null, field, }), { diff --git a/packages/server/src/api/controllers/view/exporters.ts b/packages/server/src/api/controllers/view/exporters.ts index ec0aca95a9..e707cad0cc 100644 --- a/packages/server/src/api/controllers/view/exporters.ts +++ b/packages/server/src/api/controllers/view/exporters.ts @@ -27,7 +27,7 @@ export function json(rows: Row[]) { export function jsonWithSchema(schema: TableSchema, rows: Row[]) { const newSchema: TableSchema = {} Object.values(schema).forEach(column => { - if (!column.autocolumn) { + if (!column.autocolumn && column.name) { newSchema[column.name] = column } }) From 471a5838a340f927bad256946f5340ca88be233b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 31 Aug 2023 08:50:06 +0100 Subject: [PATCH 13/78] Ensure null IDs are pruned from draggable list to avoid crashing --- .../settings/controls/DraggableList.svelte | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/DraggableList.svelte b/packages/builder/src/components/design/settings/controls/DraggableList.svelte index b1f0e83654..c8395b2a1f 100644 --- a/packages/builder/src/components/design/settings/controls/DraggableList.svelte +++ b/packages/builder/src/components/design/settings/controls/DraggableList.svelte @@ -33,17 +33,19 @@ let anchors = {} let draggableItems = [] - const buildDragable = items => { - return items.map(item => { - return { - id: listItemKey ? item[listItemKey] : generate(), - item, - } - }) + const buildDraggable = items => { + return items + .map(item => { + return { + id: listItemKey ? item[listItemKey] : generate(), + item, + } + }) + .filter(item => item.id) } $: if (items) { - draggableItems = buildDragable(items) + draggableItems = buildDraggable(items) } const updateRowOrder = e => { From 8c889b873ca33944b5cb3203888adba1afa6f136 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 31 Aug 2023 08:50:36 +0100 Subject: [PATCH 14/78] Filter out invalid fields from fieldconfiguration (we don't allow formula and nested JSON fields in forms) --- .../controls/FieldConfiguration/FieldConfiguration.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte b/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte index 255f46ec7b..f12e8d27ae 100644 --- a/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte +++ b/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte @@ -99,6 +99,9 @@ } const type = getComponentForField(instance.field, schema) + if (!type) { + return null + } instance._component = `@budibase/standard-components/${type}` const pseudoComponentInstance = store.actions.components.createInstance( @@ -116,7 +119,9 @@ } $: if (sanitisedFields) { - fieldList = [...sanitisedFields, ...unconfigured].map(buildSudoInstance) + fieldList = [...sanitisedFields, ...unconfigured] + .map(buildSudoInstance) + .filter(x => x != null) } const processItemUpdate = e => { From 2f36b2f805fdc3ccb3bd26b1b49ecdbfc0b40d03 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 31 Aug 2023 08:51:00 +0100 Subject: [PATCH 15/78] Ensure the default export value is only set once --- .../src/components/backend/DataTable/modals/ExportModal.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte index 0fc5fe96e0..09f76d3522 100644 --- a/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/ExportModal.svelte @@ -42,7 +42,7 @@ let exportFormat let filterLookup - $: if (options) { + $: if (options && !exportFormat) { exportFormat = Array.isArray(options) ? options[0]?.key : [] } From d36c7d744fd0294a9012c6c0569d5dde1777d615 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 31 Aug 2023 10:24:52 +0200 Subject: [PATCH 16/78] Rename --- .../backend/DataTable/buttons/ManageAccessButton.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte index f6a74784fa..5a7e274eb8 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte @@ -10,13 +10,13 @@ let modal let resourcePermissions - async function openDropdown() { + async function openModal() { resourcePermissions = await permissions.forResource(resourceId) modal.show() } - + Access From dcd8c3b2896ed5da567c64d305e2b62df8357f33 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 31 Aug 2023 10:36:17 +0200 Subject: [PATCH 17/78] Move permissions code to sdk --- .../server/src/api/controllers/permission.ts | 26 +------------ .../server/src/sdk/app/permissions/index.ts | 38 ++++++++++++++++++- 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/packages/server/src/api/controllers/permission.ts b/packages/server/src/api/controllers/permission.ts index 8314f29398..ef138ee5c2 100644 --- a/packages/server/src/api/controllers/permission.ts +++ b/packages/server/src/api/controllers/permission.ts @@ -147,31 +147,7 @@ export async function fetch(ctx: UserCtx) { export async function getResourcePerms(ctx: UserCtx) { const resourceId = ctx.params.resourceId - const db = context.getAppDB() - const body = await db.allDocs( - getRoleParams(null, { - include_docs: true, - }) - ) - const rolesList = body.rows.map(row => row.doc) - let permissions: Record = {} - for (let level of SUPPORTED_LEVELS) { - // update the various roleIds in the resource permissions - for (let role of rolesList) { - const rolePerms = roles.checkForRoleResourceArray( - role.permissions, - resourceId - ) - if ( - rolePerms && - rolePerms[resourceId] && - rolePerms[resourceId].indexOf(level) !== -1 - ) { - permissions[level] = roles.getExternalRoleID(role._id, role.version)! - } - } - } - ctx.body = Object.assign(getBasePermissions(resourceId), permissions) + ctx.body = await sdk.permissions.getResourcePerms(resourceId) } export async function addPermission(ctx: UserCtx) { diff --git a/packages/server/src/sdk/app/permissions/index.ts b/packages/server/src/sdk/app/permissions/index.ts index 2219120db6..144b4fab2b 100644 --- a/packages/server/src/sdk/app/permissions/index.ts +++ b/packages/server/src/sdk/app/permissions/index.ts @@ -1,10 +1,15 @@ +import { context, roles } from "@budibase/backend-core" +import { features } from "@budibase/pro" import { DocumentType, PermissionLevel, VirtualDocumentType, } from "@budibase/types" -import { isViewID } from "../../../db/utils" -import { features } from "@budibase/pro" +import { getRoleParams, isViewID } from "../../../db/utils" +import { + CURRENTLY_SUPPORTED_LEVELS, + getBasePermissions, +} from "../../../utilities/security" type ResourceActionAllowedResult = | { allowed: true } @@ -35,3 +40,32 @@ export async function resourceActionAllowed({ resourceType: VirtualDocumentType.VIEW, } } + +export async function getResourcePerms(resourceId: string) { + const db = context.getAppDB() + const body = await db.allDocs( + getRoleParams(null, { + include_docs: true, + }) + ) + const rolesList = body.rows.map(row => row.doc) + let permissions: Record = {} + for (let level of CURRENTLY_SUPPORTED_LEVELS) { + // update the various roleIds in the resource permissions + for (let role of rolesList) { + const rolePerms = roles.checkForRoleResourceArray( + role.permissions, + resourceId + ) + if ( + rolePerms && + rolePerms[resourceId] && + rolePerms[resourceId].indexOf(level) !== -1 + ) { + permissions[level] = roles.getExternalRoleID(role._id, role.version)! + } + } + } + + return Object.assign(getBasePermissions(resourceId), permissions) +} From 566f9ecd22fc6caaaf0b9cb0ac332148db53607e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 31 Aug 2023 10:53:25 +0200 Subject: [PATCH 18/78] Create remove permission js api --- packages/builder/src/stores/backend/permissions.js | 7 +++++++ packages/frontend-core/src/api/permissions.js | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/packages/builder/src/stores/backend/permissions.js b/packages/builder/src/stores/backend/permissions.js index aaab406bc9..ea7bb347e2 100644 --- a/packages/builder/src/stores/backend/permissions.js +++ b/packages/builder/src/stores/backend/permissions.js @@ -13,6 +13,13 @@ export function createPermissionStore() { level, }) }, + remove: async ({ level, role, resource }) => { + return await API.removePermissionFromResource({ + resourceId: resource, + roleId: role, + level, + }) + }, forResource: async resourceId => { return await API.getPermissionForResource(resourceId) }, diff --git a/packages/frontend-core/src/api/permissions.js b/packages/frontend-core/src/api/permissions.js index 5407cb3ce5..9ba0be23cd 100644 --- a/packages/frontend-core/src/api/permissions.js +++ b/packages/frontend-core/src/api/permissions.js @@ -21,4 +21,17 @@ export const buildPermissionsEndpoints = API => ({ url: `/api/permission/${roleId}/${resourceId}/${level}`, }) }, + + /** + * Remove the the permissions for a certain resource + * @param resourceId the ID of the resource to update + * @param roleId the ID of the role to update the permissions of + * @param level the level to remove the role for this resource + * @return {Promise<*>} + */ + removePermissionFromResource: async ({ resourceId, roleId, level }) => { + return await API.delete({ + url: `/api/permission/${roleId}/${resourceId}/${level}`, + }) + }, }) From bbc484e2c454eb6fa083c2e89730e9f7021dbaba Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 31 Aug 2023 13:00:51 +0200 Subject: [PATCH 19/78] Handle frontend levels --- packages/builder/src/stores/backend/permissions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/stores/backend/permissions.js b/packages/builder/src/stores/backend/permissions.js index ea7bb347e2..0807c1cf10 100644 --- a/packages/builder/src/stores/backend/permissions.js +++ b/packages/builder/src/stores/backend/permissions.js @@ -21,7 +21,7 @@ export function createPermissionStore() { }) }, forResource: async resourceId => { - return await API.getPermissionForResource(resourceId) + return (await API.getPermissionForResource(resourceId)).permissions }, } } From a56712f4d7c79f2baea12277ad04109eca958f12 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 31 Aug 2023 13:01:17 +0200 Subject: [PATCH 20/78] Change shape --- .../server/src/api/controllers/permission.ts | 4 +- .../server/src/sdk/app/permissions/index.ts | 54 +++++++++++++++---- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/packages/server/src/api/controllers/permission.ts b/packages/server/src/api/controllers/permission.ts index ef138ee5c2..ea9b9a4596 100644 --- a/packages/server/src/api/controllers/permission.ts +++ b/packages/server/src/api/controllers/permission.ts @@ -147,7 +147,9 @@ export async function fetch(ctx: UserCtx) { export async function getResourcePerms(ctx: UserCtx) { const resourceId = ctx.params.resourceId - ctx.body = await sdk.permissions.getResourcePerms(resourceId) + ctx.body = { + permissions: await sdk.permissions.getResourcePerms(resourceId), + } } export async function addPermission(ctx: UserCtx) { diff --git a/packages/server/src/sdk/app/permissions/index.ts b/packages/server/src/sdk/app/permissions/index.ts index 144b4fab2b..cb4ce93250 100644 --- a/packages/server/src/sdk/app/permissions/index.ts +++ b/packages/server/src/sdk/app/permissions/index.ts @@ -3,9 +3,14 @@ import { features } from "@budibase/pro" import { DocumentType, PermissionLevel, + Role, VirtualDocumentType, } from "@budibase/types" -import { getRoleParams, isViewID } from "../../../db/utils" +import { + extractViewInfoFromID, + getRoleParams, + isViewID, +} from "../../../db/utils" import { CURRENTLY_SUPPORTED_LEVELS, getBasePermissions, @@ -41,15 +46,31 @@ export async function resourceActionAllowed({ } } -export async function getResourcePerms(resourceId: string) { +type ResourcePermissions = Record< + string, + { + role: string + inherited?: boolean | undefined + } +> + +export async function getResourcePerms( + resourceId: string +): Promise { const db = context.getAppDB() const body = await db.allDocs( getRoleParams(null, { include_docs: true, }) ) - const rolesList = body.rows.map(row => row.doc) - let permissions: Record = {} + const rolesList = body.rows.map(row => row.doc) + let permissions: Record = {} + + let parentResourceToCheck + if (isViewID(resourceId) && (await features.isViewPermissionEnabled())) { + parentResourceToCheck = extractViewInfoFromID(resourceId).tableId + } + for (let level of CURRENTLY_SUPPORTED_LEVELS) { // update the various roleIds in the resource permissions for (let role of rolesList) { @@ -57,15 +78,28 @@ export async function getResourcePerms(resourceId: string) { role.permissions, resourceId ) - if ( - rolePerms && - rolePerms[resourceId] && - rolePerms[resourceId].indexOf(level) !== -1 + if (rolePerms[resourceId]?.indexOf(level) > -1) { + permissions[level] = { + role: roles.getExternalRoleID(role._id!, role.version), + } + } else if ( + parentResourceToCheck && + rolePerms[parentResourceToCheck]?.indexOf(level) > -1 ) { - permissions[level] = roles.getExternalRoleID(role._id, role.version)! + permissions[level] = { + role: roles.getExternalRoleID(role._id!, role.version), + inherited: true, + } } } } - return Object.assign(getBasePermissions(resourceId), permissions) + const basePermissions = Object.entries( + getBasePermissions(resourceId) + ).reduce((p, [level, role]) => { + p[level] = { role } + return p + }, {}) + const result = Object.assign(basePermissions, permissions) + return result } From fc5c63df55f4483054b7741f226267e3cb771950 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 31 Aug 2023 14:49:08 +0100 Subject: [PATCH 21/78] Revert "Fix: Remove unused usage of `@budibase/types` in frontend-core" --- packages/frontend-core/src/constants.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/frontend-core/src/constants.js b/packages/frontend-core/src/constants.js index 198c8985d4..198d88196b 100644 --- a/packages/frontend-core/src/constants.js +++ b/packages/frontend-core/src/constants.js @@ -2,6 +2,7 @@ * Operator options for lucene queries */ export { OperatorOptions, SqlNumberTypeRangeMap } from "@budibase/shared-core" +export { Feature as Features } from "@budibase/types" // Cookie names export const Cookies = { From cd30c45ca5c03dc52f6758840b0b24d2f9d6d936 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 31 Aug 2023 14:50:28 +0100 Subject: [PATCH 22/78] Fix for error seen when creating blank screen --- .../src/builderStore/store/screenTemplates/rowListScreen.js | 3 +++ .../design/_components/NewScreen/CreateScreenModal.svelte | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js b/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js index 968d6deb4a..54dd38ac63 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js +++ b/packages/builder/src/builderStore/store/screenTemplates/rowListScreen.js @@ -3,6 +3,9 @@ import { Screen } from "./utils/Screen" import { Component } from "./utils/Component" export default function (datasources) { + if (!Array.isArray(datasources)) { + return [] + } return datasources.map(datasource => { return { name: `${datasource.name} - List`, diff --git a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte index dd611041ed..9a96242b30 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte @@ -110,7 +110,7 @@ if (mode === "table") { datasourceModal.show() } else if (mode === "blank") { - let templates = getTemplates($store, $tables.list) + let templates = getTemplates($tables.list) const blankScreenTemplate = templates.find( t => t.id === "createFromScratch" ) From 5d483cb6474cf0b6d513cde32cd0d7eedd2ff838 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 31 Aug 2023 14:05:32 +0000 Subject: [PATCH 23/78] Bump version to 2.9.33-alpha.9 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 22aea7d0ae..c7a5f2a2a6 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.33-alpha.8", + "version": "2.9.33-alpha.9", "npmClient": "yarn", "packages": [ "packages/*" From 00a4cb68bd660312fd75eec193a2fc5dc7dd3f53 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 31 Aug 2023 14:44:25 +0000 Subject: [PATCH 24/78] Bump version to 2.9.33-alpha.10 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index c7a5f2a2a6..6a6ce0b266 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.33-alpha.9", + "version": "2.9.33-alpha.10", "npmClient": "yarn", "packages": [ "packages/*" From 774ff745b6a640f7b7e5ff0cf9904a04146ce02d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 1 Sep 2023 09:40:29 +0200 Subject: [PATCH 25/78] Return role origin --- .../server/src/api/controllers/permission.ts | 29 +++++++++++++++-- .../server/src/sdk/app/permissions/index.ts | 31 ++++++++++--------- packages/types/src/api/web/app/index.ts | 1 + packages/types/src/api/web/app/permission.ts | 4 +++ 4 files changed, 48 insertions(+), 17 deletions(-) create mode 100644 packages/types/src/api/web/app/permission.ts diff --git a/packages/server/src/api/controllers/permission.ts b/packages/server/src/api/controllers/permission.ts index ea9b9a4596..8cc5bcec74 100644 --- a/packages/server/src/api/controllers/permission.ts +++ b/packages/server/src/api/controllers/permission.ts @@ -1,5 +1,11 @@ import { permissions, roles, context, HTTPError } from "@budibase/backend-core" -import { UserCtx, Database, Role, PermissionLevel } from "@budibase/types" +import { + UserCtx, + Database, + Role, + PermissionLevel, + GetResourcePermsResponse, +} from "@budibase/types" import { getRoleParams } from "../../db/utils" import { CURRENTLY_SUPPORTED_LEVELS, @@ -145,10 +151,27 @@ export async function fetch(ctx: UserCtx) { ctx.body = finalPermissions } -export async function getResourcePerms(ctx: UserCtx) { +export async function getResourcePerms( + ctx: UserCtx +) { const resourceId = ctx.params.resourceId + const resourcePermissions = await sdk.permissions.getResourcePerms(resourceId) + ctx.body = { - permissions: await sdk.permissions.getResourcePerms(resourceId), + permissions: Object.entries(resourcePermissions).reduce( + (p, [level, role]) => { + p[level] = role.role + return p + }, + {} as Record + ), + permissionType: Object.entries(resourcePermissions).reduce( + (p, [level, role]) => { + p[level] = role.type + return p + }, + {} as Record + ), } } diff --git a/packages/server/src/sdk/app/permissions/index.ts b/packages/server/src/sdk/app/permissions/index.ts index cb4ce93250..b1ebbd2ac8 100644 --- a/packages/server/src/sdk/app/permissions/index.ts +++ b/packages/server/src/sdk/app/permissions/index.ts @@ -46,12 +46,15 @@ export async function resourceActionAllowed({ } } +enum PermissionType { + EXPLICIT = "explicit", + INHERITED = "inherited", + BASE = "base", +} + type ResourcePermissions = Record< string, - { - role: string - inherited?: boolean | undefined - } + { role: string; type: PermissionType } > export async function getResourcePerms( @@ -64,11 +67,13 @@ export async function getResourcePerms( }) ) const rolesList = body.rows.map(row => row.doc) - let permissions: Record = {} + let permissions: ResourcePermissions = {} - let parentResourceToCheck + let permsToInherit: ResourcePermissions | undefined if (isViewID(resourceId) && (await features.isViewPermissionEnabled())) { - parentResourceToCheck = extractViewInfoFromID(resourceId).tableId + permsToInherit = await getResourcePerms( + extractViewInfoFromID(resourceId).tableId + ) } for (let level of CURRENTLY_SUPPORTED_LEVELS) { @@ -81,14 +86,12 @@ export async function getResourcePerms( if (rolePerms[resourceId]?.indexOf(level) > -1) { permissions[level] = { role: roles.getExternalRoleID(role._id!, role.version), + type: PermissionType.EXPLICIT, } - } else if ( - parentResourceToCheck && - rolePerms[parentResourceToCheck]?.indexOf(level) > -1 - ) { + } else if (permsToInherit && permsToInherit[level]) { permissions[level] = { - role: roles.getExternalRoleID(role._id!, role.version), - inherited: true, + role: permsToInherit[level].role, + type: PermissionType.INHERITED, } } } @@ -97,7 +100,7 @@ export async function getResourcePerms( const basePermissions = Object.entries( getBasePermissions(resourceId) ).reduce((p, [level, role]) => { - p[level] = { role } + p[level] = { role, type: PermissionType.BASE } return p }, {}) const result = Object.assign(basePermissions, permissions) diff --git a/packages/types/src/api/web/app/index.ts b/packages/types/src/api/web/app/index.ts index e7b4b87aa9..276d7fa7c1 100644 --- a/packages/types/src/api/web/app/index.ts +++ b/packages/types/src/api/web/app/index.ts @@ -4,3 +4,4 @@ export * from "./row" export * from "./view" export * from "./rows" export * from "./table" +export * from "./permission" diff --git a/packages/types/src/api/web/app/permission.ts b/packages/types/src/api/web/app/permission.ts new file mode 100644 index 0000000000..52f6bdcabb --- /dev/null +++ b/packages/types/src/api/web/app/permission.ts @@ -0,0 +1,4 @@ +export interface GetResourcePermsResponse { + permissions: Record + permissionType: Record +} From 5d870fb41a2dd1920419d37ea6259451a2cdb655 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 1 Sep 2023 09:50:55 +0200 Subject: [PATCH 26/78] Rename --- .../server/src/api/controllers/permission.ts | 8 +++++ .../server/src/sdk/app/permissions/index.ts | 31 ++++++++++--------- packages/types/src/api/web/app/permission.ts | 1 + 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/packages/server/src/api/controllers/permission.ts b/packages/server/src/api/controllers/permission.ts index 8cc5bcec74..6702c24450 100644 --- a/packages/server/src/api/controllers/permission.ts +++ b/packages/server/src/api/controllers/permission.ts @@ -156,6 +156,8 @@ export async function getResourcePerms( ) { const resourceId = ctx.params.resourceId const resourcePermissions = await sdk.permissions.getResourcePerms(resourceId) + const inheritablePermissions = + await sdk.permissions.getInheritablePermissions(resourceId) ctx.body = { permissions: Object.entries(resourcePermissions).reduce( @@ -172,6 +174,12 @@ export async function getResourcePerms( }, {} as Record ), + inheritablePermissions: + inheritablePermissions && + Object.entries(inheritablePermissions).reduce((p, [level, role]) => { + p[level] = role.role + return p + }, {} as Record), } } diff --git a/packages/server/src/sdk/app/permissions/index.ts b/packages/server/src/sdk/app/permissions/index.ts index b1ebbd2ac8..ce6ac8c98a 100644 --- a/packages/server/src/sdk/app/permissions/index.ts +++ b/packages/server/src/sdk/app/permissions/index.ts @@ -46,17 +46,25 @@ export async function resourceActionAllowed({ } } -enum PermissionType { - EXPLICIT = "explicit", - INHERITED = "inherited", - BASE = "base", +enum PermissionSource { + EXPLICIT = "EXPLICIT", + INHERITED = "INHERITED", + BASE = "BASE", } type ResourcePermissions = Record< string, - { role: string; type: PermissionType } + { role: string; type: PermissionSource } > +export async function getInheritablePermissions( + resourceId: string +): Promise { + if (isViewID(resourceId) && (await features.isViewPermissionEnabled())) { + return await getResourcePerms(extractViewInfoFromID(resourceId).tableId) + } +} + export async function getResourcePerms( resourceId: string ): Promise { @@ -69,12 +77,7 @@ export async function getResourcePerms( const rolesList = body.rows.map(row => row.doc) let permissions: ResourcePermissions = {} - let permsToInherit: ResourcePermissions | undefined - if (isViewID(resourceId) && (await features.isViewPermissionEnabled())) { - permsToInherit = await getResourcePerms( - extractViewInfoFromID(resourceId).tableId - ) - } + const permsToInherit = await getInheritablePermissions(resourceId) for (let level of CURRENTLY_SUPPORTED_LEVELS) { // update the various roleIds in the resource permissions @@ -86,12 +89,12 @@ export async function getResourcePerms( if (rolePerms[resourceId]?.indexOf(level) > -1) { permissions[level] = { role: roles.getExternalRoleID(role._id!, role.version), - type: PermissionType.EXPLICIT, + type: PermissionSource.EXPLICIT, } } else if (permsToInherit && permsToInherit[level]) { permissions[level] = { role: permsToInherit[level].role, - type: PermissionType.INHERITED, + type: PermissionSource.INHERITED, } } } @@ -100,7 +103,7 @@ export async function getResourcePerms( const basePermissions = Object.entries( getBasePermissions(resourceId) ).reduce((p, [level, role]) => { - p[level] = { role, type: PermissionType.BASE } + p[level] = { role, type: PermissionSource.BASE } return p }, {}) const result = Object.assign(basePermissions, permissions) diff --git a/packages/types/src/api/web/app/permission.ts b/packages/types/src/api/web/app/permission.ts index 52f6bdcabb..73ad47d83f 100644 --- a/packages/types/src/api/web/app/permission.ts +++ b/packages/types/src/api/web/app/permission.ts @@ -1,4 +1,5 @@ export interface GetResourcePermsResponse { permissions: Record permissionType: Record + inheritablePermissions?: Record } From 3192bbe4ddc865959c05ae80325b0fe967123443 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 1 Sep 2023 09:56:12 +0200 Subject: [PATCH 27/78] Clean --- .../backend/DataTable/buttons/ManageAccessButton.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte index 5a7e274eb8..1de31bf83b 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte @@ -23,7 +23,6 @@ From bdaf179f20e2681db2033e5cc078242ed4c6b006 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 1 Sep 2023 10:16:49 +0200 Subject: [PATCH 28/78] Remove placeholder --- .../backend/DataTable/modals/ManageAccessModal.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte b/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte index 678fb3b1c5..ff2db2088e 100644 --- a/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte @@ -54,7 +54,7 @@ {#each Object.keys(permissions) as level} Date: Fri, 1 Sep 2023 11:33:59 +0200 Subject: [PATCH 31/78] Change api interfaces --- .../FlowChart/FlowItem.svelte | 2 +- .../buttons/ManageAccessButton.svelte | 7 +--- .../grid/GridManageAccessButton.svelte | 14 +------- .../DataTable/modals/ManageAccessModal.svelte | 35 +++++++++---------- .../integration/AccessLevelSelect.svelte | 2 +- .../server/src/api/controllers/permission.ts | 26 ++++++-------- .../server/src/sdk/app/permissions/index.ts | 33 +++++++++++++---- packages/types/src/api/web/app/permission.ts | 15 +++++--- 8 files changed, 69 insertions(+), 65 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 7a02433411..85c3776fdb 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -73,7 +73,7 @@ if (!perms["execute"]) { role = "BASIC" } else { - role = perms["execute"] + role = perms["execute"].role } } diff --git a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte index 8742eaef76..5c0b7df742 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/ManageAccessButton.svelte @@ -5,7 +5,6 @@ export let resourceId export let disabled = false - export let requiresLicence let modal let resourcePermissions @@ -20,9 +19,5 @@ Access - + diff --git a/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte index e4c48528f4..0cd008bab1 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte @@ -1,5 +1,4 @@ - + diff --git a/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte b/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte index 0e792410ca..5b0f114534 100644 --- a/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/ManageAccessModal.svelte @@ -15,7 +15,6 @@ export let resourceId export let permissions - export let requiresLicence async function changePermission(level, role) { try { @@ -41,24 +40,20 @@ } } - $: computedPermissions = Object.keys(permissions.permissions).reduce( - (p, c) => { - p[c] = { - selected: - permissions.permissionType[c] === "INHERITED" - ? "inherited" - : permissions.permissions[c], + $: computedPermissions = Object.entries(permissions.permissions).reduce( + (p, [level, roleInfo]) => { + p[level] = { + selectedValue: + roleInfo.permissionType === "INHERITED" ? "inherited" : roleInfo.role, options: [...get(roles)], } - if (permissions.inheritablePermissions) { - p[c].inheritOption = permissions.inheritablePermissions[c] - p[c].options.unshift({ + if (roleInfo.inheritablePermission) { + p[level].inheritOption = roleInfo.inheritablePermission + p[level].options.unshift({ _id: "inherited", name: `Inherit (${ - get(roles).find( - x => x._id === permissions.inheritablePermissions[c] - ).name + get(roles).find(x => x._id === roleInfo.inheritablePermission).name })`, }) } @@ -66,21 +61,23 @@ }, {} ) + + $: requiresPlanToModify = permissions.requiresPlanToModify Manage Access - {#if requiresLicence} + {#if requiresPlanToModify} - {requiresLicence.tier} + {requiresPlanToModify} {/if} - {#if requiresLicence} - {requiresLicence.message} + {#if requiresPlanToModify} + {requiresPlanToModify} {:else} Specify the minimum access level role for this data.
@@ -90,7 +87,7 @@ - + - + {#if mounted} + + {/if} update("navWidth", e.detail)} + /> + {/if} +
+ +
+ update("hideLogo", !e.detail)} + /> + {#if !$store.navigation.hideLogo} +
+ +
+ update("logoUrl", e.detail)} + updateOnChange={false} + /> + {/if} +
+ +
+ update("hideTitle", !e.detail)} + /> + {#if !$store.navigation.hideTitle} +
+ +
+ update("title", e.detail)} + updateOnChange={false} + /> + {/if} +
+ +
+ update("navBackground", e.detail)} + /> +
+ +
+ update("navTextColor", e.detail)} + /> +
+
+ {/if} + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/AppThemeSelect.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/AppThemeSelect.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/AppThemeSelect.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/AppThemeSelect.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ButtonRoundnessSelect.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ButtonRoundnessSelect.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/theme/_components/ButtonRoundnessSelect.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ButtonRoundnessSelect.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/GeneralPanel.svelte similarity index 72% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenSettingsPanel.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/GeneralPanel.svelte index 8982cd20de..a08ded8eee 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenSettingsPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/GeneralPanel.svelte @@ -1,12 +1,8 @@ - - - {#if $selectedScreen.layoutId} - - This screen uses a custom layout, which is deprecated - - {/if} - {#each screenSettings as setting (setting.key)} - setScreenSetting(setting, val)} - props={{ ...setting.props, error: errors[setting.key] }} - {bindings} - /> - {/each} - - - +{#if $selectedScreen.layoutId} + + This screen uses a custom layout, which is deprecated + +{/if} +{#each screenSettings as setting (setting.key)} + setScreenSetting(setting, val)} + props={{ ...setting.props, error: errors[setting.key] }} + {bindings} + /> +{/each} diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte new file mode 100644 index 0000000000..13a008fae0 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/ThemePanel.svelte @@ -0,0 +1,78 @@ + + +
+ + These settings apply to all screens +
+ + + + + + + update("buttonBorderRadius", e.detail)} + /> + + update("primaryColor", val)} + props={{ + spectrumTheme: $store.theme, + }} + /> + update("primaryColorHover", val)} + props={{ + spectrumTheme: $store.theme, + }} + /> + + + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte new file mode 100644 index 0000000000..778fa303cc --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Screen/index.svelte @@ -0,0 +1,51 @@ + + + +
+
+ {#each tabs as tab} + { + activeTab = tab + }} + > + {capitalise(tab)} + + {/each} +
+
+ + {#if activeTab === "theme"} + + {:else} + + {/if} + +
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte new file mode 100644 index 0000000000..19cb1d8dff --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/_layout.svelte @@ -0,0 +1,52 @@ + + +{#if routeComponentId === `${$store.selectedScreenId}-screen`} + +{:else if routeComponentId === `${$store.selectedScreenId}-navigation`} + +{:else} + +{/if} + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte new file mode 100644 index 0000000000..0ff63d1ead --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/index.svelte @@ -0,0 +1 @@ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte similarity index 98% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte index 7dca5b792b..248bbc8141 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/NewComponentPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/NewComponentPanel.svelte @@ -31,6 +31,10 @@ $: orderMap = createComponentOrderMap(componentList) const getAllowedComponents = (allComponents, screen, component) => { + // Default to using the root screen container if no component specified + if (!component) { + component = screen.props + } const path = findComponentPath(screen?.props, component?._id) if (!path?.length) { return [] diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/componentStructure.json similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/_components/componentStructure.json diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/index.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/index.svelte rename to packages/builder/src/pages/builder/app/[application]/design/[screenId]/[componentId]/new/index.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte index 785b221239..09f97302fd 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPanel.svelte @@ -1,32 +1,16 @@
- +
+ Screens +
+
+ +
+
+ +
+
+
+ {#if filteredScreens?.length} + {#each filteredScreens as screen (screen._id)} + store.actions.screens.select(screen._id)} + rightAlignIcon + showTooltip + selectedBy={$userSelectedResourceMap[screen._id]} + > + +
+ +
+
+ {/each} + {:else} + +
+ There aren't any screens matching that route +
+
+ {/if} +
+ +
screensHeight.set("210px")} + /> +
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte deleted file mode 100644 index 00165e4ee9..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_fallback.svelte +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte index 8bc0dcc3e5..0e630b4f39 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_layout.svelte @@ -1,14 +1,10 @@ -
-
- - $goto("./screens")} - /> - $goto("./components")} - /> - $goto("./theme")} - /> - $goto("./navigation")} - /> - {#if $store.layouts?.length} - $goto("./layouts")} - /> - {/if} - -
- -
- {#if $selectedScreen} - +{#if $selectedScreen} +
+
+ - {/if} + +
-
+{/if} diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte deleted file mode 100644 index 9513753d76..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte +++ /dev/null @@ -1,90 +0,0 @@ - - - -
- -
- -
    -
  • - { - $store.selectedComponentId = $selectedScreen?.props._id - }} - id={`component-${$selectedScreen?.props._id}`} - selectedBy={$userSelectedResourceMap[$selectedScreen?.props._id]} - > - - - - - - {#if $dndStore.dragging && $dndStore.valid} - - {#if $dndStore.dropPosition !== DropPosition.INSIDE} - - {/if} - {/if} -
  • -
-
-
- - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_layout.svelte deleted file mode 100644 index 860258c940..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_layout.svelte +++ /dev/null @@ -1,41 +0,0 @@ - - - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte deleted file mode 100644 index 9b5d05fe57..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/index.svelte +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte deleted file mode 100644 index f8c4cc0868..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/index.svelte +++ /dev/null @@ -1,18 +0,0 @@ - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte index f5e3806bd6..c4ed7d949c 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/index.svelte @@ -1,5 +1,6 @@ diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte deleted file mode 100644 index cba68f899d..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutDropdownMenu.svelte +++ /dev/null @@ -1,41 +0,0 @@ - - - -
- -
- Delete -
- - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte deleted file mode 100644 index cc895317fd..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutListPanel.svelte +++ /dev/null @@ -1,29 +0,0 @@ - - - -
- {#each $store.layouts as layout (layout._id)} - store.actions.layouts.select(layout._id)} - > - - - {/each} -
-
- - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte deleted file mode 100644 index bfc2f94f43..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_components/LayoutSettingsPanel.svelte +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - Custom layouts are being deprecated. They will be removed in a future - release. - - - You can save the content of this layout by pressing the button below. - - - This will copy all components inside your layout, which you can then paste - into a screen. - - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte deleted file mode 100644 index c82fefab3e..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/_layout.svelte +++ /dev/null @@ -1,20 +0,0 @@ - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte deleted file mode 100644 index 4d39403bc3..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/[layoutId]/index.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte deleted file mode 100644 index 1333c6afe3..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/_layout.svelte +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte deleted file mode 100644 index 09d45f8fde..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/layouts/index.svelte +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte deleted file mode 100644 index 614e1eed80..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationInfoPanel.svelte +++ /dev/null @@ -1,33 +0,0 @@ - - - - - {#if $selectedScreen.layoutId} - - You can't preview your navigation settings using this screen as it uses - a custom layout, which is deprecated - - {/if} - - Your navigation is configured for all the screens within your app. - - - You can hide and show your navigation for each screen in the screen - settings. - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte deleted file mode 100644 index c6d43984b2..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/_components/NavigationSettingsPanel.svelte +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - update("navigation", "Top")} - /> - update("navigation", "Left")} - /> - - - {#if $store.navigation.navigation === "Top"} - update("sticky", e.detail)} - /> - update("logoUrl", e.detail)} - placeholder="Add logo URL" - updateOnChange={false} - /> - {/if} - - - update("hideTitle", !e.detail)} - /> - {#if !$store.navigation.hideTitle} - update("title", e.detail)} - placeholder="Add title" - updateOnChange={false} - /> - {/if} - - - - update("navBackground", e.detail)} - /> - - - - update("navTextColor", e.detail)} - /> - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte deleted file mode 100644 index fc2e03d8e8..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/navigation/index.svelte +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte deleted file mode 100644 index 6362af3073..0000000000 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - (searchString = e.detail)} - /> -