From 7870f313161c17717a22593f3a12c209306c90cf Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 14 Jul 2023 12:10:12 +0100 Subject: [PATCH 01/79] Check presence of next fn before attempting to execute. --- packages/client/src/utils/buttonActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 68f312f0ad..0405dc7d55 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -478,7 +478,7 @@ export const enrichButtonActions = (actions, context) => { actions.slice(i + 1), newContext ) - resolve(await next()) + resolve(typeof next === "function" ? await next() : true) } else { resolve(false) } From 18a05faf6713acf16f84e4f2b9a736d73e8b5690 Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 14 Jul 2023 14:19:19 +0100 Subject: [PATCH 02/79] Ensure the code editors are in the correct modes --- .../SetupPanel/AutomationBlockSetup.svelte | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 823dcc432b..e26052d1fa 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -33,6 +33,7 @@ import { bindingsToCompletions, jsAutocomplete, + hbAutocomplete, EditorModes, } from "components/common/CodeEditor" import FilterDrawer from "components/design/settings/controls/FilterEditor/FilterDrawer.svelte" @@ -70,7 +71,10 @@ $: queryLimit = tableId?.includes("datasource") ? "∞" : "1000" $: isTrigger = block?.type === "TRIGGER" $: isUpdateRow = stepId === ActionStepID.UPDATE_ROW - + $: codeMode = + stepId === "EXECUTE_BASH" ? EditorModes.Handlebars : EditorModes.JS + $: buildCompletions = + stepId === "EXECUTE_BASH" ? hbAutocomplete : jsAutocomplete /** * TODO - Remove after November 2023 * ******************************* @@ -497,17 +501,21 @@ inputData[key] = e.detail }} completions={[ - jsAutocomplete([ - ...bindingsToCompletions(bindings, EditorModes.JS), + buildCompletions([ + ...bindingsToCompletions(bindings, codeMode), ]), ]} - mode={EditorModes.JS} + mode={codeMode} height={500} />
-
Add available bindings by typing $
+
+ Add available bindings by typing {codeMode == EditorModes.JS ? "$" : "{{"} +
From 8ea6feb7201615cb9c6bea9f1c259b59b3870ed1 Mon Sep 17 00:00:00 2001 From: Dean Date: Mon, 17 Jul 2023 10:21:35 +0100 Subject: [PATCH 03/79] Added autocomplete flag --- .../SetupPanel/AutomationBlockSetup.svelte | 16 +++++----- .../common/CodeEditor/CodeEditor.svelte | 29 ++++++++++++------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index e26052d1fa..0a5b61869c 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -32,7 +32,6 @@ import CodeEditor from "components/common/CodeEditor/CodeEditor.svelte" import { bindingsToCompletions, - jsAutocomplete, hbAutocomplete, EditorModes, } from "components/common/CodeEditor" @@ -73,8 +72,12 @@ $: isUpdateRow = stepId === ActionStepID.UPDATE_ROW $: codeMode = stepId === "EXECUTE_BASH" ? EditorModes.Handlebars : EditorModes.JS - $: buildCompletions = - stepId === "EXECUTE_BASH" ? hbAutocomplete : jsAutocomplete + + $: stepCompletions = + codeMode === EditorModes.Handlebars + ? [hbAutocomplete([...bindingsToCompletions(bindings, codeMode)])] + : [] + /** * TODO - Remove after November 2023 * ******************************* @@ -500,12 +503,9 @@ onChange({ detail: e.detail }, key) inputData[key] = e.detail }} - completions={[ - buildCompletions([ - ...bindingsToCompletions(bindings, codeMode), - ]), - ]} + completions={stepCompletions} mode={codeMode} + autocompleteEnabled={codeMode != EditorModes.JS} height={500} />
diff --git a/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte b/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte index dadca85fac..2ce93e42c8 100644 --- a/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte +++ b/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte @@ -48,6 +48,7 @@ export let mode = EditorModes.Handlebars export let value = "" export let placeholder = null + export let autocompleteEnabled = true // Export a function to expose caret position export const getCaretPosition = () => { @@ -131,12 +132,6 @@ syntaxHighlighting(oneDarkHighlightStyle, { fallback: true }), highlightActiveLineGutter(), highlightSpecialChars(), - autocompletion({ - override: [...completions], - closeOnBlur: true, - icons: false, - optionClass: () => "autocomplete-option", - }), EditorView.lineWrapping, EditorView.updateListener.of(v => { const docStr = v.state.doc?.toString() @@ -159,11 +154,16 @@ const buildExtensions = base => { const complete = [...base] - if (mode.name == "javascript") { - complete.push(javascript()) - complete.push(highlightWhitespace()) - complete.push(lineNumbers()) - complete.push(foldGutter()) + + if (autocompleteEnabled) { + complete.push( + autocompletion({ + override: [...completions], + closeOnBlur: true, + icons: false, + optionClass: () => "autocomplete-option", + }) + ) complete.push( EditorView.inputHandler.of((view, from, to, insert) => { if (insert === "$") { @@ -193,6 +193,13 @@ ) } + if (mode.name == "javascript") { + complete.push(javascript()) + complete.push(highlightWhitespace()) + complete.push(lineNumbers()) + complete.push(foldGutter()) + } + if (placeholder) { complete.push(placeholderFn(placeholder)) } From f17043390226b46cfcf47492506c782847dc6095 Mon Sep 17 00:00:00 2001 From: Dean Date: Mon, 17 Jul 2023 11:15:57 +0100 Subject: [PATCH 04/79] Added the binding drawer back in for the javascript step --- .../SetupPanel/AutomationBlockSetup.svelte | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index 0a5b61869c..cece075860 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -15,6 +15,7 @@ Icon, Checkbox, DatePicker, + Detail, } from "@budibase/bbui" import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte" import { automationStore, selectedAutomation } from "builderStore" @@ -55,6 +56,7 @@ let drawer let fillWidth = true let inputData + let codeBindingOpen = false $: filters = lookForFilters(schemaProperties) || [] $: tempFilters = filters @@ -496,6 +498,18 @@ /> {:else if value.customType === "code"} + {#if codeMode == EditorModes.JS} + (codeBindingOpen = !codeBindingOpen)} + quiet + icon={codeBindingOpen ? "ChevronDown" : "ChevronRight"} + > + Bindings + + {#if codeBindingOpen} +
{JSON.stringify(bindings, null, 2)}
+ {/if} + {/if} { @@ -509,14 +523,16 @@ height={500} />
- -
-
- Add available bindings by typing {codeMode == EditorModes.JS ? "$" : "{{"} + {#if codeMode == EditorModes.Handlebars} + +
+
+ Add available bindings by typing + }} + +
-
+ {/if}
{:else if value.customType === "loopOption"} From ce24339e22fba3c63419598584d0838b6be537c6 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 17 Jul 2023 16:48:57 +0100 Subject: [PATCH 05/79] Update how blocks key child components for reference when ejecting, and ensure search fields in table blocks are keyed properly --- packages/client/src/components/Block.svelte | 21 +++++++++++-------- .../src/components/BlockComponent.svelte | 10 +++++---- .../components/app/blocks/TableBlock.svelte | 2 +- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/packages/client/src/components/Block.svelte b/packages/client/src/components/Block.svelte index b72ff81b49..37af28b4dc 100644 --- a/packages/client/src/components/Block.svelte +++ b/packages/client/src/components/Block.svelte @@ -8,27 +8,28 @@ let structureLookupMap = {} - const registerBlockComponent = (id, order, parentId, instance) => { + const registerBlockComponent = (id, parentId, order, instance) => { // Ensure child map exists if (!structureLookupMap[parentId]) { structureLookupMap[parentId] = {} } // Add this instance in this order, overwriting any existing instance in // this order in case of repeaters - structureLookupMap[parentId][order] = instance + structureLookupMap[parentId][id] = { order, instance } } - const unregisterBlockComponent = (order, parentId) => { + const unregisterBlockComponent = (id, parentId) => { // Ensure child map exists if (!structureLookupMap[parentId]) { return } - delete structureLookupMap[parentId][order] + delete structureLookupMap[parentId][id] } const eject = () => { // Start the new structure with the root component - let definition = structureLookupMap[$component.id][0] + let definition = Object.values(structureLookupMap[$component.id])[0] + .instance // Copy styles from block to root component definition._styles = { @@ -49,10 +50,12 @@ const attachChildren = (rootComponent, map) => { // Transform map into children array let id = rootComponent._id - const children = Object.entries(map[id] || {}).map(([order, instance]) => ({ - order, - instance, - })) + const children = Object.values(map[id] || {}).map( + ({ order, instance }) => ({ + order, + instance, + }) + ) if (!children.length) { return } diff --git a/packages/client/src/components/BlockComponent.svelte b/packages/client/src/components/BlockComponent.svelte index 4f720e2931..24d9b4dee4 100644 --- a/packages/client/src/components/BlockComponent.svelte +++ b/packages/client/src/components/BlockComponent.svelte @@ -23,6 +23,8 @@ // Create a fake component instance so that we can use the core Component // to render this part of the block, taking advantage of binding enrichment $: id = `${block.id}-${context ?? rand}` + $: parentId = $component?.id + $: inBuilder = $builderStore.inBuilder $: instance = { _component: `@budibase/standard-components/${type}`, _id: id, @@ -38,14 +40,14 @@ // Register this block component if we're inside the builder so it can be // ejected later $: { - if ($builderStore.inBuilder) { - block.registerComponent(id, order ?? 0, $component?.id, instance) + if (inBuilder) { + block.registerComponent(id, parentId, order ?? 0, instance) } } onDestroy(() => { - if ($builderStore.inBuilder) { - block.unregisterComponent(order ?? 0, $component?.id) + if (inBuilder) { + block.unregisterComponent(id, parentId) } }) diff --git a/packages/client/src/components/app/blocks/TableBlock.svelte b/packages/client/src/components/app/blocks/TableBlock.svelte index e45b53880d..eb42d85f45 100644 --- a/packages/client/src/components/app/blocks/TableBlock.svelte +++ b/packages/client/src/components/app/blocks/TableBlock.svelte @@ -169,7 +169,7 @@ order={1} > {#if enrichedSearchColumns?.length} - {#each enrichedSearchColumns as column, idx} + {#each enrichedSearchColumns as column, idx (column.name)} Date: Mon, 17 Jul 2023 16:49:39 +0100 Subject: [PATCH 06/79] Ensure search fields in cards block are keyed properly --- packages/client/src/components/app/blocks/CardsBlock.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/app/blocks/CardsBlock.svelte b/packages/client/src/components/app/blocks/CardsBlock.svelte index bbe54867ee..3e48247f92 100644 --- a/packages/client/src/components/app/blocks/CardsBlock.svelte +++ b/packages/client/src/components/app/blocks/CardsBlock.svelte @@ -126,7 +126,7 @@ order={1} > {#if enrichedSearchColumns?.length} - {#each enrichedSearchColumns as column, idx} + {#each enrichedSearchColumns as column, idx (column.name)} Date: Mon, 17 Jul 2023 16:56:48 +0100 Subject: [PATCH 07/79] Increase safety when ejecting blocks --- packages/client/src/components/Block.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/Block.svelte b/packages/client/src/components/Block.svelte index 37af28b4dc..65c2b38197 100644 --- a/packages/client/src/components/Block.svelte +++ b/packages/client/src/components/Block.svelte @@ -28,8 +28,11 @@ const eject = () => { // Start the new structure with the root component - let definition = Object.values(structureLookupMap[$component.id])[0] - .instance + const rootMap = structureLookupMap[$component.id] || {} + let definition = { ...Object.values(rootMap)[0]?.instance } + if (!definition) { + return + } // Copy styles from block to root component definition._styles = { From 4425c5992933c01f75e6b9c4d5f83b8c4abf19c9 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 17 Jul 2023 16:57:56 +0100 Subject: [PATCH 08/79] Remove pointless shallow clone --- packages/client/src/components/Block.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/Block.svelte b/packages/client/src/components/Block.svelte index 65c2b38197..26be3fd4bf 100644 --- a/packages/client/src/components/Block.svelte +++ b/packages/client/src/components/Block.svelte @@ -29,7 +29,7 @@ const eject = () => { // Start the new structure with the root component const rootMap = structureLookupMap[$component.id] || {} - let definition = { ...Object.values(rootMap)[0]?.instance } + let definition = Object.values(rootMap)[0]?.instance if (!definition) { return } From 92e4422e893cea97f22819a7e1f97f0eae83cb76 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 17 Jul 2023 16:59:40 +0100 Subject: [PATCH 09/79] Remove pointless map --- packages/client/src/components/Block.svelte | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/client/src/components/Block.svelte b/packages/client/src/components/Block.svelte index 26be3fd4bf..a739065015 100644 --- a/packages/client/src/components/Block.svelte +++ b/packages/client/src/components/Block.svelte @@ -53,12 +53,7 @@ const attachChildren = (rootComponent, map) => { // Transform map into children array let id = rootComponent._id - const children = Object.values(map[id] || {}).map( - ({ order, instance }) => ({ - order, - instance, - }) - ) + const children = Object.values(map[id] || {}) if (!children.length) { return } From d7bcdfe3afce8e65e03fd792bf51551a95662a29 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 17 Jul 2023 21:48:02 +0100 Subject: [PATCH 10/79] pin non-v versions --- .github/workflows/release-master.yml | 2 +- .github/workflows/release-selfhost.yml | 6 +++--- .github/workflows/release-singleimage.yml | 4 ++-- charts/budibase/Chart.yaml | 2 +- charts/budibase/values.yaml | 20 ++++++++++---------- charts/pvc.yaml | 11 +++++++++++ charts/rollout_test.sh | 5 +++++ 7 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 charts/pvc.yaml create mode 100755 charts/rollout_test.sh diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 68625ad7af..c8810b7442 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -96,7 +96,7 @@ jobs: git fetch mkdir sync echo "Packaging chart to sync dir" - helm package charts/budibase --version 0.0.0-master --app-version v"$RELEASE_VERSION" --destination sync + helm package charts/budibase --version 0.0.0-master --app-version "$RELEASE_VERSION" --destination sync echo "Packaging successful" git checkout gh-pages echo "Indexing helm repo" diff --git a/.github/workflows/release-selfhost.yml b/.github/workflows/release-selfhost.yml index f4524e99dc..39ee812726 100644 --- a/.github/workflows/release-selfhost.yml +++ b/.github/workflows/release-selfhost.yml @@ -43,7 +43,7 @@ jobs: run: | docker login -u $DOCKER_USER -p $DOCKER_PASSWORD - release_tag=v${{ env.RELEASE_VERSION }} + release_tag=${{ env.RELEASE_VERSION }} # Pull apps and worker images docker pull budibase/apps:$release_tag @@ -108,8 +108,8 @@ jobs: - name: Perform Github Release uses: softprops/action-gh-release@v1 with: - name: v${{ env.RELEASE_VERSION }} - tag_name: v${{ env.RELEASE_VERSION }} + name: ${{ env.RELEASE_VERSION }} + tag_name: ${{ env.RELEASE_VERSION }} generate_release_notes: true files: | packages/cli/build/cli-win.exe diff --git a/.github/workflows/release-singleimage.yml b/.github/workflows/release-singleimage.yml index 5408b48ef8..92f21bd649 100644 --- a/.github/workflows/release-singleimage.yml +++ b/.github/workflows/release-singleimage.yml @@ -71,7 +71,7 @@ jobs: context: . push: true platforms: linux/amd64,linux/arm64 - tags: budibase/budibase,budibase/budibase:v${{ env.RELEASE_VERSION }} + tags: budibase/budibase,budibase/budibase:${{ env.RELEASE_VERSION }} file: ./hosting/single/Dockerfile - name: Tag and release Budibase Azure App Service docker image uses: docker/build-push-action@v2 @@ -80,5 +80,5 @@ jobs: push: true platforms: linux/amd64 build-args: TARGETBUILD=aas - tags: budibase/budibase-aas,budibase/budibase-aas:v${{ env.RELEASE_VERSION }} + tags: budibase/budibase-aas,budibase/budibase-aas:${{ env.RELEASE_VERSION }} file: ./hosting/single/Dockerfile diff --git a/charts/budibase/Chart.yaml b/charts/budibase/Chart.yaml index 05b3f24dbd..9cefbb13a0 100644 --- a/charts/budibase/Chart.yaml +++ b/charts/budibase/Chart.yaml @@ -14,7 +14,7 @@ type: application # populates on packaging version: 0.0.0 # populates on packaging -appVersion: 0.0.0 +appVersion: v2.8.10 dependencies: - name: couchdb version: 3.3.4 diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 2d89e81b7f..f4f578191b 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -76,8 +76,8 @@ affinity: {} globals: appVersion: "" # Use as an override to .Chart.AppVersion budibaseEnv: PRODUCTION - tenantFeatureFlags: "*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR" - enableAnalytics: "1" + tenantFeatureFlags: "*:LICENSING,*:USER_GROUPS" + enableAnalytics: "0" sentryDSN: "" posthogToken: "phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU" selfHosted: "1" # set to 0 for budibase cloud environment, set to 1 for self-hosted setup @@ -95,9 +95,9 @@ globals: createSecrets: true # creates an internal API key, JWT secrets and redis password for you # if createSecrets is set to false, you can hard-code your secrets here - apiEncryptionKey: "" - internalApiKey: "" - jwtSecret: "" + apiEncryptionKey: "test" + internalApiKey: "test" + jwtSecret: "test" cdnUrl: "" # fallback values used during live rotation internalApiKeyFallback: "" @@ -209,14 +209,14 @@ services: # Override values in couchDB subchart couchdb: ## clusterSize is the initial size of the CouchDB cluster. - clusterSize: 3 + clusterSize: 1 allowAdminParty: false # Secret Management createAdminSecret: true - # adminUsername: budibase - # adminPassword: budibase + adminUsername: budibase + adminPassword: budibase # adminHash: -pbkdf2-this_is_not_necessarily_secure_either # cookieAuthSecret: admin @@ -239,11 +239,11 @@ couchdb: ## provisioning of Persistent Volumes; leaving it unset will invoke the default ## provisioner. persistentVolume: - enabled: false + enabled: true accessModes: - ReadWriteOnce size: 10Gi - storageClass: "" + storageClass: "local-path" ## The CouchDB image image: diff --git a/charts/pvc.yaml b/charts/pvc.yaml new file mode 100644 index 0000000000..956032c825 --- /dev/null +++ b/charts/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: local-path-pvc +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: 2Gi diff --git a/charts/rollout_test.sh b/charts/rollout_test.sh new file mode 100755 index 0000000000..e222fc5ca5 --- /dev/null +++ b/charts/rollout_test.sh @@ -0,0 +1,5 @@ +for i in {1..100000}; do +curl -s -XGET -o /dev/null -w "%{http_code}" http://localhost:10000/builder +sleep 0.1 + +done From 0e92bcece421ec65588e97bcfbc2472983d9d45c Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 18 Jul 2023 07:44:26 +0000 Subject: [PATCH 11/79] Bump version to 2.8.12 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 4fa6ce58d8..23bad4c3bd 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.11", + "version": "2.8.12", "npmClient": "yarn", "packages": [ "packages/*" From 8897705e6565c60748ca914a92177fd2785f305b Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 18 Jul 2023 08:07:54 +0000 Subject: [PATCH 12/79] Bump version to 2.8.13 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 23bad4c3bd..ebdf4935f0 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.12", + "version": "2.8.13", "npmClient": "yarn", "packages": [ "packages/*" From eb7d883ce22abb10523740d003b84a89c3535348 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Tue, 18 Jul 2023 08:57:59 +0000 Subject: [PATCH 13/79] Bump version to 2.8.14 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index ebdf4935f0..bca2548eb1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.13", + "version": "2.8.14", "npmClient": "yarn", "packages": [ "packages/*" From 504ddac47081ca81ebf22c13105acc6bf90c4e42 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jul 2023 15:24:44 +0100 Subject: [PATCH 14/79] Fix background color of datasource status button --- .../_components/EditDatasourceConfigButton.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte index 8ce30fddfd..154957a561 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte @@ -74,7 +74,7 @@ border: 1px solid var(--spectrum-global-color-gray-300); border-radius: 5px; width: 100%; - background-color: #00000047; + background-color: var(--spectrum-global-color-gray-50); color: white; overflow: hidden; padding: 12px 16px; From a2238911fa5ad766d75fd08efdf62624790cd75f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jul 2023 16:14:49 +0100 Subject: [PATCH 15/79] Fix link to users portal --- .../backend/DataTable/modals/CreateEditUser.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte index 01964aed75..c18ba313e0 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte @@ -95,9 +95,9 @@ {#if !creating}
A user's email, role, first and last names cannot be changed from within - the app builder. Please go to the user portal to do this. + the app builder. Please go to the + user portal + to do this.
{/if} Date: Tue, 18 Jul 2023 16:14:59 +0100 Subject: [PATCH 16/79] Fix getting started checklist links --- packages/worker/src/api/controllers/global/configs.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/worker/src/api/controllers/global/configs.ts b/packages/worker/src/api/controllers/global/configs.ts index b061d110f5..462aa3060d 100644 --- a/packages/worker/src/api/controllers/global/configs.ts +++ b/packages/worker/src/api/controllers/global/configs.ts @@ -507,17 +507,17 @@ export async function configChecklist(ctx: Ctx) { smtp: { checked: !!smtpConfig, label: "Set up email", - link: "/builder/portal/manage/email", + link: "/builder/portal/settings/email", }, adminUser: { checked: userExists, label: "Create your first user", - link: "/builder/portal/manage/users", + link: "/builder/portal/users/users", }, sso: { checked: !!googleConfig || !!oidcConfig, label: "Set up single sign-on", - link: "/builder/portal/manage/auth", + link: "/builder/portal/settings/auth", }, } } From 6df0ff57a42ccecd9182bd249096045d1504e943 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jul 2023 16:18:02 +0100 Subject: [PATCH 17/79] Fix edit icons being shown in preview results table --- packages/builder/src/components/backend/DataTable/Table.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 3c5b93df89..4569586762 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -109,6 +109,7 @@ {disableSorting} {customPlaceholder} allowEditRows={allowEditing} + allowEditColumns={allowEditing} showAutoColumns={!hideAutocolumns} {allowClickRows} on:clickrelationship={e => selectRelationship(e.detail)} From f10da702339322807d7fe2d673726c3cbb997dd1 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 18 Jul 2023 16:19:50 +0100 Subject: [PATCH 18/79] Fix DND in component tree --- packages/builder/src/components/common/NavItem.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/builder/src/components/common/NavItem.svelte b/packages/builder/src/components/common/NavItem.svelte index 7d61751364..6590463408 100644 --- a/packages/builder/src/components/common/NavItem.svelte +++ b/packages/builder/src/components/common/NavItem.svelte @@ -132,7 +132,6 @@ flex-direction: row; justify-content: flex-start; align-items: stretch; - position: relative; } .nav-item.scrollable { flex-direction: column; From e77a105bb250f35c401b0447eae504fb6967dee4 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 18 Jul 2023 16:46:35 +0100 Subject: [PATCH 19/79] General fixes for bindings and the undo/redo behaviour --- packages/bbui/src/Drawer/Drawer.svelte | 1 + .../components/common/CodeEditor/CodeEditor.svelte | 3 ++- .../src/components/common/UndoRedoControl.svelte | 12 ++++++++++-- .../components/common/bindings/BindingPanel.svelte | 4 ++-- packages/builder/src/helpers/helpers.js | 12 ++++++++++++ packages/builder/src/helpers/index.js | 1 + .../navigation/ComponentKeyHandler.svelte | 9 ++------- packages/string-templates/src/index.cjs | 3 ++- packages/string-templates/src/index.js | 2 ++ packages/string-templates/src/index.mjs | 1 + 10 files changed, 35 insertions(+), 13 deletions(-) diff --git a/packages/bbui/src/Drawer/Drawer.svelte b/packages/bbui/src/Drawer/Drawer.svelte index 782c3c6ed2..4ff4df854b 100644 --- a/packages/bbui/src/Drawer/Drawer.svelte +++ b/packages/bbui/src/Drawer/Drawer.svelte @@ -30,6 +30,7 @@ setContext("drawer-actions", { hide, show, + headless, }) const easeInOutQuad = x => { diff --git a/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte b/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte index 2ce93e42c8..406885aeb4 100644 --- a/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte +++ b/packages/builder/src/components/common/CodeEditor/CodeEditor.svelte @@ -1,6 +1,7 @@
{#if options && Array.isArray(options)} {#each options as option} + {@const optionValue = getOptionValue(option)}
value.trim()) } From d521bffc61d71f51fab8d68398f2902722ae2837 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 19 Jul 2023 12:22:29 +0100 Subject: [PATCH 21/79] tidy up --- charts/pvc.yaml | 11 ----------- charts/rollout_test.sh | 5 ----- 2 files changed, 16 deletions(-) delete mode 100644 charts/pvc.yaml delete mode 100755 charts/rollout_test.sh diff --git a/charts/pvc.yaml b/charts/pvc.yaml deleted file mode 100644 index 956032c825..0000000000 --- a/charts/pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: local-path-pvc -spec: - accessModes: - - ReadWriteOnce - storageClassName: local-path - resources: - requests: - storage: 2Gi diff --git a/charts/rollout_test.sh b/charts/rollout_test.sh deleted file mode 100755 index e222fc5ca5..0000000000 --- a/charts/rollout_test.sh +++ /dev/null @@ -1,5 +0,0 @@ -for i in {1..100000}; do -curl -s -XGET -o /dev/null -w "%{http_code}" http://localhost:10000/builder -sleep 0.1 - -done From 9076f79ad401c0d7415b2bd720fb25d61d79d981 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 19 Jul 2023 12:33:23 +0100 Subject: [PATCH 22/79] reducing couchDB k8s to one node, reverting values to default --- charts/budibase/Chart.yaml | 2 +- charts/budibase/values.yaml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/charts/budibase/Chart.yaml b/charts/budibase/Chart.yaml index 9cefbb13a0..05b3f24dbd 100644 --- a/charts/budibase/Chart.yaml +++ b/charts/budibase/Chart.yaml @@ -14,7 +14,7 @@ type: application # populates on packaging version: 0.0.0 # populates on packaging -appVersion: v2.8.10 +appVersion: 0.0.0 dependencies: - name: couchdb version: 3.3.4 diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index f4f578191b..74e4c52654 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -76,8 +76,8 @@ affinity: {} globals: appVersion: "" # Use as an override to .Chart.AppVersion budibaseEnv: PRODUCTION - tenantFeatureFlags: "*:LICENSING,*:USER_GROUPS" - enableAnalytics: "0" + tenantFeatureFlags: "*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR" + enableAnalytics: "1" sentryDSN: "" posthogToken: "phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU" selfHosted: "1" # set to 0 for budibase cloud environment, set to 1 for self-hosted setup @@ -95,9 +95,9 @@ globals: createSecrets: true # creates an internal API key, JWT secrets and redis password for you # if createSecrets is set to false, you can hard-code your secrets here - apiEncryptionKey: "test" - internalApiKey: "test" - jwtSecret: "test" + apiEncryptionKey: "" + internalApiKey: "" + jwtSecret: "" cdnUrl: "" # fallback values used during live rotation internalApiKeyFallback: "" @@ -215,8 +215,8 @@ couchdb: # Secret Management createAdminSecret: true - adminUsername: budibase - adminPassword: budibase + # adminUsername: budibase + # adminPassword: budibase # adminHash: -pbkdf2-this_is_not_necessarily_secure_either # cookieAuthSecret: admin @@ -239,11 +239,11 @@ couchdb: ## provisioning of Persistent Volumes; leaving it unset will invoke the default ## provisioner. persistentVolume: - enabled: true + enabled: false accessModes: - ReadWriteOnce size: 10Gi - storageClass: "local-path" + storageClass: "" ## The CouchDB image image: From 7afd77065f19fde802ad83fb1b543d57891d138d Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 19 Jul 2023 14:57:48 +0100 Subject: [PATCH 23/79] updating versionCommit tag --- scripts/versionCommit.sh | 2 +- yarn.lock | 93 +++------------------------------------- 2 files changed, 7 insertions(+), 88 deletions(-) diff --git a/scripts/versionCommit.sh b/scripts/versionCommit.sh index 71c931d736..86db0136e7 100755 --- a/scripts/versionCommit.sh +++ b/scripts/versionCommit.sh @@ -13,6 +13,6 @@ node ./bumpVersion.js $1 NEW_VERSION=$(node -p "require('../lerna.json').version") git add ../lerna.json git commit -m "Bump version to $NEW_VERSION" -git tag v$NEW_VERSION +git tag $NEW_VERSION git push git push --tags \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index bb016d1936..3acf765870 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1866,10 +1866,10 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/handlebars-helpers@^0.11.8": - version "0.11.8" - resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.11.8.tgz#6953d29673a8c5c407e096c0a84890465c7ce841" - integrity sha512-ggWJUt0GqsHFAEup5tlWlcrmYML57nKhpNGGLzVsqXVYN8eVmf3xluYmmMe7fDYhQH0leSprrdEXmsdFQF3HAQ== +"@budibase/handlebars-helpers@^0.11.9": + version "0.11.9" + resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.11.9.tgz#46ec9c571cd667b73e94918f82d6414acc52a281" + integrity sha512-S1AGkrljacSddTDw+SuPTU+HH+GZr83aodj5fZ2Ia3ZBSmKK6/WKq3ZXlX7L14s6N7HYzEY2MXdC7ZDd3bpfjQ== dependencies: array-sort "^1.0.0" define-property "^2.0.2" @@ -1880,16 +1880,13 @@ handlebars "^4.7.7" handlebars-utils "^1.0.6" has-value "^2.0.2" - helper-md "^0.2.2" html-tag "^2.0.0" - is-even "^1.0.0" is-glob "^4.0.1" kind-of "^6.0.3" micromatch "^3.1.5" relative "^3.0.2" striptags "^3.1.1" to-gfm-code-block "^0.1.1" - year "^0.2.1" "@budibase/nano@10.1.2": version "10.1.2" @@ -7038,7 +7035,7 @@ arg@^5.0.2: resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c" integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg== -argparse@^1.0.10, argparse@^1.0.7: +argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== @@ -7278,13 +7275,6 @@ atomic-sleep@^1.0.0: resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== -autolinker@~0.28.0: - version "0.28.1" - resolved "https://registry.yarnpkg.com/autolinker/-/autolinker-0.28.1.tgz#0652b491881879f0775dace0cdca3233942a4e47" - integrity sha512-zQAFO1Dlsn69eXaO6+7YZc+v84aquQKbwpzCE3L0stj56ERn9hutFxPopViLjo9G+rWwjozRhgS5KJ25Xy19cQ== - dependencies: - gulp-header "^1.7.1" - available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" @@ -8862,7 +8852,7 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" -concat-with-sourcemaps@*, concat-with-sourcemaps@^1.1.0: +concat-with-sourcemaps@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e" integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg== @@ -10646,11 +10636,6 @@ enquirer@^2.3.5, enquirer@^2.3.6, enquirer@~2.3.6: dependencies: ansi-colors "^4.1.1" -ent@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA== - entities@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" @@ -13185,15 +13170,6 @@ gtoken@^5.0.4: google-p12-pem "^3.1.3" jws "^4.0.0" -gulp-header@^1.7.1: - version "1.8.12" - resolved "https://registry.yarnpkg.com/gulp-header/-/gulp-header-1.8.12.tgz#ad306be0066599127281c4f8786660e705080a84" - integrity sha512-lh9HLdb53sC7XIZOYzTXM4lFuXElv3EVkSDhsd7DoJBj7hm+Ni7D3qYbb+Rr8DuM8nRanBvkVO9d7askreXGnQ== - dependencies: - concat-with-sourcemaps "*" - lodash.template "^4.4.0" - through2 "^2.0.0" - handlebars-utils@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/handlebars-utils/-/handlebars-utils-1.0.6.tgz#cb9db43362479054782d86ffe10f47abc76357f9" @@ -13376,16 +13352,6 @@ help-me@^4.0.1: glob "^8.0.0" readable-stream "^3.6.0" -helper-md@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/helper-md/-/helper-md-0.2.2.tgz#c1f59d7e55bbae23362fd8a0e971607aec69d41f" - integrity sha512-49TaQzK+Ic7ZVTq4i1UZxRUJEmAilTk8hz7q4I0WNUaTclLR8ArJV5B3A1fe1xF2HtsDTr2gYKLaVTof/Lt84Q== - dependencies: - ent "^2.2.0" - extend-shallow "^2.0.1" - fs-exists-sync "^0.1.0" - remarkable "^1.6.2" - hexoid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/hexoid/-/hexoid-1.0.0.tgz#ad10c6573fb907de23d9ec63a711267d9dc9bc18" @@ -14157,13 +14123,6 @@ is-docker@^2.0.0, is-docker@^2.1.1: resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== -is-even@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-even/-/is-even-1.0.0.tgz#76b5055fbad8d294a86b6a949015e1c97b717c06" - integrity sha512-LEhnkAdJqic4Dbqn58A0y52IXoHWlsueqQkKfMfdEnIYG8A1sm/GHidKkS6yvXlMoRrkM34csHnXQtOqcb+Jzg== - dependencies: - is-odd "^0.1.2" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -14341,13 +14300,6 @@ is-object@~0.1.2: resolved "https://registry.yarnpkg.com/is-object/-/is-object-0.1.2.tgz#00efbc08816c33cfc4ac8251d132e10dc65098d7" integrity sha512-GkfZZlIZtpkFrqyAXPQSRBMsaHAw+CgoKe2HXAkjd/sfoI9+hS8PT4wg2rJxdQyUKr7N2vHJbg7/jQtE5l5vBQ== -is-odd@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-0.1.2.tgz#bc573b5ce371ef2aad6e6f49799b72bef13978a7" - integrity sha512-Ri7C2K7o5IrUU9UEI8losXJCCD/UtsaIrkR5sxIcFg4xQ9cRJXlWA5DQvTE0yDc0krvSNLsRGXN11UPS6KyfBw== - dependencies: - is-number "^3.0.0" - is-path-inside@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" @@ -17066,11 +17018,6 @@ lodash-es@^4.17.11: resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== -lodash._reinterpolate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - integrity sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA== - lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -17201,21 +17148,6 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== -lodash.template@^4.4.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" - integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.templatesettings "^4.0.0" - -lodash.templatesettings@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" - integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.truncate@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" @@ -21769,14 +21701,6 @@ relative@^3.0.2: dependencies: isobject "^2.0.0" -remarkable@^1.6.2: - version "1.7.4" - resolved "https://registry.yarnpkg.com/remarkable/-/remarkable-1.7.4.tgz#19073cb960398c87a7d6546eaa5e50d2022fcd00" - integrity sha512-e6NKUXgX95whv7IgddywbeN/ItCkWbISmc2DiqHJb0wTrqZIexqdco5b8Z3XZoo/48IdNVKM9ZCvTPJ4F5uvhg== - dependencies: - argparse "^1.0.10" - autolinker "~0.28.0" - remixicon@2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/remixicon/-/remixicon-2.5.0.tgz#b5e245894a1550aa23793f95daceadbf96ad1a41" @@ -26127,11 +26051,6 @@ yauzl@^2.10.0, yauzl@^2.4.2: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" -year@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/year/-/year-0.2.1.tgz#4083ae520a318b23ec86037f3000cb892bdf9bb0" - integrity sha512-9GnJUZ0QM4OgXuOzsKNzTJ5EOkums1Xc+3YQXp+Q+UxFjf7zLucp9dQ8QMIft0Szs1E1hUiXFim1OYfEKFq97w== - ylru@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.3.2.tgz#0de48017473275a4cbdfc83a1eaf67c01af8a785" From a99124608ff01759cccfec2e377a4a3d813de3d6 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 19 Jul 2023 15:22:43 +0000 Subject: [PATCH 24/79] Bump version to 2.8.15 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index bca2548eb1..551b1f60f2 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.14", + "version": "2.8.15", "npmClient": "yarn", "packages": [ "packages/*" From 0d7a933db699d5c2f0f1c08952e7e59badca3145 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 19 Jul 2023 15:48:12 +0000 Subject: [PATCH 25/79] Bump version to 2.8.16 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 551b1f60f2..83b8f35697 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.15", + "version": "2.8.16", "npmClient": "yarn", "packages": [ "packages/*" From 5447404431a17caa6ceb0fe746a4bf92da183c1b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 17 Jul 2023 17:52:39 +0100 Subject: [PATCH 26/79] Upgrading to latest version of MongoDB to attempt to solve the memory leak, as well as some minor changes to websocket integration to get the development environment to work without the account portal when running in multi-tenancy mode. --- .../backend-core/src/context/mainContext.ts | 9 +++++++++ packages/server/package.json | 2 +- packages/server/src/startup.ts | 2 +- packages/server/src/websockets/builder.ts | 8 ++++++-- yarn.lock | 18 +++++++++--------- 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/packages/backend-core/src/context/mainContext.ts b/packages/backend-core/src/context/mainContext.ts index 61d96bb4b0..ae198aafc7 100644 --- a/packages/backend-core/src/context/mainContext.ts +++ b/packages/backend-core/src/context/mainContext.ts @@ -203,6 +203,15 @@ export function getTenantId(): string { return tenantId } +export function hasTenantId(): boolean { + if (!isMultiTenant()) { + return true + } + const context = Context.get() + const tenantId = context?.tenantId + return tenantId != null +} + export function getAutomationId(): string | undefined { const context = Context.get() return context?.automationId diff --git a/packages/server/package.json b/packages/server/package.json index a35f78d36d..52f209a403 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -98,7 +98,7 @@ "koa2-ratelimit": "1.1.1", "lodash": "4.17.21", "memorystream": "0.3.1", - "mongodb": "5.6", + "mongodb": "5.7", "mssql": "9.1.1", "mysql2": "2.3.3", "node-fetch": "2.6.7", diff --git a/packages/server/src/startup.ts b/packages/server/src/startup.ts index 64a6c011c4..9da26ac2aa 100644 --- a/packages/server/src/startup.ts +++ b/packages/server/src/startup.ts @@ -5,7 +5,7 @@ import { generateApiKey, getChecklist, } from "./utilities/workerRequests" -import { installation, tenancy, logging, events } from "@budibase/backend-core" +import { events, installation, logging, tenancy } from "@budibase/backend-core" import fs from "fs" import { watch } from "./watch" import * as automations from "./automations" diff --git a/packages/server/src/websockets/builder.ts b/packages/server/src/websockets/builder.ts index 2524d9608b..91d14269ed 100644 --- a/packages/server/src/websockets/builder.ts +++ b/packages/server/src/websockets/builder.ts @@ -1,6 +1,6 @@ import authorized from "../middleware/authorized" import { BaseSocket } from "./websocket" -import { permissions, events } from "@budibase/backend-core" +import { permissions, events, context } from "@budibase/backend-core" import http from "http" import Koa from "koa" import { Datasource, Table, SocketSession, ContextUser } from "@budibase/types" @@ -8,6 +8,7 @@ import { gridSocket } from "./index" import { clearLock, updateLock } from "../utilities/redis" import { Socket } from "socket.io" import { BuilderSocketEvent } from "@budibase/shared-core" +import { hasTenantId } from "@budibase/backend-core/src/context" export default class BuilderSocket extends BaseSocket { constructor(app: Koa, server: http.Server) { @@ -27,7 +28,10 @@ export default class BuilderSocket extends BaseSocket { userIdMap[session._id] = true } }) - await events.user.dataCollaboration(Object.keys(userIdMap).length) + + if (context.hasTenantId()) { + await events.user.dataCollaboration(Object.keys(userIdMap).length) + } // Reply with all current sessions callback({ users: sessions }) diff --git a/yarn.lock b/yarn.lock index 3acf765870..47f8bafb80 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7956,10 +7956,10 @@ bson@*: resolved "https://registry.yarnpkg.com/bson/-/bson-5.0.1.tgz#4cd3eeeabf6652ef0d6ab600f9a18212d39baac3" integrity sha512-y09gBGusgHtinMon/GVbv1J6FrXhnr/+6hqLlSmEFzkz6PodqF6TxjyvfvY3AfO+oG1mgUtbC86xSbOlwvM62Q== -bson@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/bson/-/bson-5.3.0.tgz#37b006df4cd91ed125cb686467c1dd6d4606b514" - integrity sha512-ukmCZMneMlaC5ebPHXIkP8YJzNl5DC41N5MAIvKDqLggdao342t4McltoJBQfQya/nHBWAcSsYRqlXPoQkTJag== +bson@^5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/bson/-/bson-5.4.0.tgz#0eea77276d490953ad8616b483298dbff07384c6" + integrity sha512-WRZ5SQI5GfUuKnPTNmAYPiKIof3ORXAF4IRU5UcgmivNIon01rWQlw5RUH954dpu8yGL8T59YShVddIPaU/gFA== buffer-alloc-unsafe@^1.1.0: version "1.1.0" @@ -18085,12 +18085,12 @@ mongodb-connection-string-url@^2.6.0: "@types/whatwg-url" "^8.2.1" whatwg-url "^11.0.0" -mongodb@5.6: - version "5.6.0" - resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-5.6.0.tgz#caff5278341bfc0f1ef6f394bb403d207de03d1e" - integrity sha512-z8qVs9NfobHJm6uzK56XBZF8XwM9H294iRnB7wNjF0SnY93si5HPziIJn+qqvUR5QOff/4L0gCD6SShdR/GtVQ== +mongodb@5.7: + version "5.7.0" + resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-5.7.0.tgz#e16d2fcdfd9f8503ec2d88288392dc3235bb3ecc" + integrity sha512-zm82Bq33QbqtxDf58fLWBwTjARK3NSvKYjyz997KSy6hpat0prjeX/kxjbPVyZY60XYPDNETaHkHJI2UCzSLuw== dependencies: - bson "^5.3.0" + bson "^5.4.0" mongodb-connection-string-url "^2.6.0" socks "^2.7.1" optionalDependencies: From cddd0d80f2b79f8835f41cab074ec68dee388eff Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 17 Jul 2023 18:03:09 +0100 Subject: [PATCH 27/79] Making sure tenant ID is always available to the builder websocket. --- packages/backend-core/src/context/mainContext.ts | 9 --------- packages/server/src/websockets/builder.ts | 8 +++++--- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/packages/backend-core/src/context/mainContext.ts b/packages/backend-core/src/context/mainContext.ts index ae198aafc7..61d96bb4b0 100644 --- a/packages/backend-core/src/context/mainContext.ts +++ b/packages/backend-core/src/context/mainContext.ts @@ -203,15 +203,6 @@ export function getTenantId(): string { return tenantId } -export function hasTenantId(): boolean { - if (!isMultiTenant()) { - return true - } - const context = Context.get() - const tenantId = context?.tenantId - return tenantId != null -} - export function getAutomationId(): string | undefined { const context = Context.get() return context?.automationId diff --git a/packages/server/src/websockets/builder.ts b/packages/server/src/websockets/builder.ts index 91d14269ed..66ec7bdef9 100644 --- a/packages/server/src/websockets/builder.ts +++ b/packages/server/src/websockets/builder.ts @@ -8,7 +8,6 @@ import { gridSocket } from "./index" import { clearLock, updateLock } from "../utilities/redis" import { Socket } from "socket.io" import { BuilderSocketEvent } from "@budibase/shared-core" -import { hasTenantId } from "@budibase/backend-core/src/context" export default class BuilderSocket extends BaseSocket { constructor(app: Koa, server: http.Server) { @@ -29,8 +28,11 @@ export default class BuilderSocket extends BaseSocket { } }) - if (context.hasTenantId()) { - await events.user.dataCollaboration(Object.keys(userIdMap).length) + const tenantId = context.getTenantIDFromAppID(appId) + if (tenantId) { + await context.doInTenant(tenantId, async () => { + await events.user.dataCollaboration(Object.keys(userIdMap).length) + }) } // Reply with all current sessions From 6a125aadc044ad317f1e7c10618c1da6f9bf9a6f Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 20 Jul 2023 10:06:42 +0000 Subject: [PATCH 28/79] Bump version to 2.8.17 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 83b8f35697..4dd30fd5f7 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.16", + "version": "2.8.17", "npmClient": "yarn", "packages": [ "packages/*" From faa00fa64df836178bf2b8beb0bb6211480c2387 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 12:05:04 +0100 Subject: [PATCH 29/79] Fix release and prerelease tag triggers --- .github/workflows/release-develop.yml | 2 +- .github/workflows/release-master.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index a7bf041eb5..e8d88fa136 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -6,7 +6,7 @@ concurrency: on: push: tags: - - v*-alpha.* + - ".*-alpha.*" workflow_dispatch: env: diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index c8810b7442..3c33dfcd86 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -6,9 +6,9 @@ concurrency: on: push: tags: - - "v[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+" # Exclude all pre-releases - - "!v*[0-9]+.[0-9]+.[0-9]+-*" + - "!*[0-9]+.[0-9]+.[0-9]+-*" env: # Posthog token used by ui at build time From 829c3e38bd146f0c112f6db5ea20f77a29a921bf Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 12:18:00 +0100 Subject: [PATCH 30/79] Adjust tag regex for prerelease --- .github/workflows/release-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index e8d88fa136..61cb283e28 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -6,7 +6,7 @@ concurrency: on: push: tags: - - ".*-alpha.*" + - "*-alpha.*" workflow_dispatch: env: From ba5002f7421bc4ad1f83bbbd266f1a1c274ff3ff Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 12:18:00 +0100 Subject: [PATCH 31/79] Adjust tag regex for prerelease --- .github/workflows/release-develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index e8d88fa136..61cb283e28 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -6,7 +6,7 @@ concurrency: on: push: tags: - - ".*-alpha.*" + - "*-alpha.*" workflow_dispatch: env: From 5bf4ae3967c68e0ac336210a14d13a050a1d94aa Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 20 Jul 2023 11:20:22 +0000 Subject: [PATCH 32/79] Bump version to 2.8.16-alpha.4 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 070a50bdac..f9c639e296 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.16-alpha.3", + "version": "2.8.16-alpha.4", "npmClient": "yarn", "packages": [ "packages/*" From 5d0918a6cb1ceaf468b59da90e2b3ed884182f3a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 20 Jul 2023 12:21:09 +0100 Subject: [PATCH 33/79] Prevent invalid characters in column names when importing tables --- packages/bbui/src/Icon/Icon.svelte | 12 ++--- .../DataTable/modals/CreateEditColumn.svelte | 3 +- .../TableNavigator/TableDataImport.svelte | 46 ++++++++++--------- packages/server/src/utilities/schema.ts | 8 ++++ packages/shared-core/src/constants.ts | 1 + 5 files changed, 38 insertions(+), 32 deletions(-) diff --git a/packages/bbui/src/Icon/Icon.svelte b/packages/bbui/src/Icon/Icon.svelte index 452a8c74a1..a2cf8a1b3a 100644 --- a/packages/bbui/src/Icon/Icon.svelte +++ b/packages/bbui/src/Icon/Icon.svelte @@ -47,7 +47,7 @@ {#if tooltip && showTooltip}
- +
{/if}
@@ -80,15 +80,9 @@ position: absolute; pointer-events: none; left: 50%; - top: calc(100% + 4px); - width: 100vw; - max-width: 150px; + bottom: calc(100% + 4px); transform: translateX(-50%); text-align: center; - } - - .spectrum-Icon--sizeXS { - width: 10px; - height: 10px; + z-index: 1; } diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 6ffd7f8bb3..f319f09b16 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -33,6 +33,7 @@ import { getBindings } from "components/backend/DataTable/formula" import { getContext } from "svelte" import JSONSchemaModal from "./JSONSchemaModal.svelte" + import { ValidColumnNameRegex } from "@budibase/shared-core" const AUTO_TYPE = "auto" const FORMULA_TYPE = FIELDS.FORMULA.type @@ -379,7 +380,7 @@ const newError = {} if (!external && fieldInfo.name?.startsWith("_")) { newError.name = `Column name cannot start with an underscore.` - } else if (fieldInfo.name && !fieldInfo.name.match(/^[_a-zA-Z0-9\s]*$/g)) { + } else if (fieldInfo.name && !fieldInfo.name.match(ValidColumnNameRegex)) { newError.name = `Illegal character; must be alpha-numeric.` } else if (PROHIBITED_COLUMN_NAMES.some(name => fieldInfo.name === name)) { newError.name = `${PROHIBITED_COLUMN_NAMES.join( diff --git a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte index f34a3e9c98..1191f92b31 100644 --- a/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte +++ b/packages/builder/src/components/backend/TableNavigator/TableDataImport.svelte @@ -1,5 +1,5 @@
@@ -127,10 +129,8 @@ on:change={handleFile} />
{/each} From 2645e4cdad6a00069657e3a3b6535ade908ca0cc Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 14:56:01 +0100 Subject: [PATCH 39/79] Build fixes --- .../utilities/structures/documents/platform/installation.ts | 2 +- packages/pro | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/tests/core/utilities/structures/documents/platform/installation.ts b/packages/backend-core/tests/core/utilities/structures/documents/platform/installation.ts index 25c5e50e00..711c6cf14f 100644 --- a/packages/backend-core/tests/core/utilities/structures/documents/platform/installation.ts +++ b/packages/backend-core/tests/core/utilities/structures/documents/platform/installation.ts @@ -1,4 +1,4 @@ -import { generator } from "@budibase/backend-core/tests" +import { generator } from "../../generator" import { Installation } from "@budibase/types" import * as db from "../../db" diff --git a/packages/pro b/packages/pro index b5124e76b9..5775dda6b9 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit b5124e76b9fa8020641e8d019ac1713c6245d6e6 +Subproject commit 5775dda6b9fe8badd5253a20ef4c78b0bd687bfa From ca6582eb9617aadf628cff3671dbf079d780cbbb Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 15:06:43 +0100 Subject: [PATCH 40/79] Update openapi.json --- packages/server/specs/openapi.json | 9 ++++++--- packages/server/specs/openapi.yaml | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/server/specs/openapi.json b/packages/server/specs/openapi.json index bcff78e861..d97b09568c 100644 --- a/packages/server/specs/openapi.json +++ b/packages/server/specs/openapi.json @@ -841,7 +841,8 @@ "auto", "json", "internal", - "barcodeqr" + "barcodeqr", + "bigint" ], "description": "Defines the type of the column, most explain themselves, a link column is a relationship." }, @@ -1045,7 +1046,8 @@ "auto", "json", "internal", - "barcodeqr" + "barcodeqr", + "bigint" ], "description": "Defines the type of the column, most explain themselves, a link column is a relationship." }, @@ -1260,7 +1262,8 @@ "auto", "json", "internal", - "barcodeqr" + "barcodeqr", + "bigint" ], "description": "Defines the type of the column, most explain themselves, a link column is a relationship." }, diff --git a/packages/server/specs/openapi.yaml b/packages/server/specs/openapi.yaml index a9daed6c76..86807c9981 100644 --- a/packages/server/specs/openapi.yaml +++ b/packages/server/specs/openapi.yaml @@ -768,6 +768,7 @@ components: - json - internal - barcodeqr + - bigint description: Defines the type of the column, most explain themselves, a link column is a relationship. constraints: @@ -931,6 +932,7 @@ components: - json - internal - barcodeqr + - bigint description: Defines the type of the column, most explain themselves, a link column is a relationship. constraints: @@ -1101,6 +1103,7 @@ components: - json - internal - barcodeqr + - bigint description: Defines the type of the column, most explain themselves, a link column is a relationship. constraints: From 6e974861160f4bcf0bcf472e1ea40565541fc9f3 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 20 Jul 2023 14:12:28 +0000 Subject: [PATCH 41/79] Bump version to 2.8.18 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 4dd30fd5f7..d97372e035 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.17", + "version": "2.8.18", "npmClient": "yarn", "packages": [ "packages/*" From 8fb796bdb3f866deb764cb575df63899f4f42dfe Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 15:31:19 +0100 Subject: [PATCH 42/79] Remove 'nightly' from test discord notification --- qa-core/scripts/testResultsWebhook.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa-core/scripts/testResultsWebhook.js b/qa-core/scripts/testResultsWebhook.js index 40cc42082d..5fbdd3a32e 100644 --- a/qa-core/scripts/testResultsWebhook.js +++ b/qa-core/scripts/testResultsWebhook.js @@ -42,7 +42,7 @@ async function discordResultsNotification(report) { Accept: "application/json", }, body: JSON.stringify({ - content: `**Nightly Tests Status**: ${OUTCOME}`, + content: `**Tests Status**: ${OUTCOME}`, embeds: [ { title: `Budi QA Bot - ${env}`, From 054fb24ea935ce59c0872f7033f37fe2a4df75d5 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 20 Jul 2023 16:15:59 +0100 Subject: [PATCH 43/79] demote some app metadata related bb-alert messages --- packages/backend-core/src/cache/appMetadata.ts | 11 ++++------- packages/backend-core/src/db/utils.ts | 6 +++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/backend-core/src/cache/appMetadata.ts b/packages/backend-core/src/cache/appMetadata.ts index 5b66c356d3..f1f3133757 100644 --- a/packages/backend-core/src/cache/appMetadata.ts +++ b/packages/backend-core/src/cache/appMetadata.ts @@ -2,8 +2,8 @@ import { getAppClient } from "../redis/init" import { doWithDB, DocumentType } from "../db" import { Database, App } from "@budibase/types" -const AppState = { - INVALID: "invalid", +export enum AppState { + INVALID = "invalid" } const EXPIRY_SECONDS = 3600 @@ -61,11 +61,8 @@ export async function getAppMetadata(appId: string) { } await client.store(appId, metadata, expiry) } - // we've stored in the cache an object to tell us that it is currently invalid - if (isInvalid(metadata)) { - throw { status: 404, message: "No app metadata found" } - } - return metadata as App + + return metadata as App & { state: AppState } } /** diff --git a/packages/backend-core/src/db/utils.ts b/packages/backend-core/src/db/utils.ts index 6034296996..137e210898 100644 --- a/packages/backend-core/src/db/utils.ts +++ b/packages/backend-core/src/db/utils.ts @@ -2,7 +2,7 @@ import env from "../environment" import { DEFAULT_TENANT_ID, SEPARATOR, DocumentType } from "../constants" import { getTenantId, getGlobalDBName } from "../context" import { doWithDB, directCouchAllDbs } from "./db" -import { getAppMetadata } from "../cache/appMetadata" +import { AppState, getAppMetadata } from "../cache/appMetadata" import { isDevApp, isDevAppID, getProdAppID } from "../docIds/conversions" import { App, Database } from "@budibase/types" import { getStartEndKeyURL } from "../docIds" @@ -101,7 +101,7 @@ export async function getAllApps({ const response = await Promise.allSettled(appPromises) const apps = response .filter( - (result: any) => result.status === "fulfilled" && result.value != null + (result: any) => result.status === "fulfilled" && result.value?.state !== AppState.INVALID ) .map(({ value }: any) => value) if (!all) { @@ -126,7 +126,7 @@ export async function getAppsByIDs(appIds: string[]) { ) // have to list the apps which exist, some may have been deleted return settled - .filter(promise => promise.status === "fulfilled") + .filter(promise => promise.status === "fulfilled" && promise.value.state !== AppState.INVALID) .map(promise => (promise as PromiseFulfilledResult).value) } From 6b6fba9393bd83f849ad89a1cbc919915f26e626 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 20 Jul 2023 16:38:24 +0100 Subject: [PATCH 44/79] optional chain --- packages/backend-core/src/db/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend-core/src/db/utils.ts b/packages/backend-core/src/db/utils.ts index 137e210898..08764154eb 100644 --- a/packages/backend-core/src/db/utils.ts +++ b/packages/backend-core/src/db/utils.ts @@ -126,7 +126,7 @@ export async function getAppsByIDs(appIds: string[]) { ) // have to list the apps which exist, some may have been deleted return settled - .filter(promise => promise.status === "fulfilled" && promise.value.state !== AppState.INVALID) + .filter(promise => promise.status === "fulfilled" && promise.value?.state !== AppState.INVALID) .map(promise => (promise as PromiseFulfilledResult).value) } From 5cc97ebcd5db81d7377381914801acf03b6e4e5e Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 20 Jul 2023 16:50:57 +0100 Subject: [PATCH 45/79] Update pro ref --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index 5775dda6b9..1b8fd8ed44 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 5775dda6b9fe8badd5253a20ef4c78b0bd687bfa +Subproject commit 1b8fd8ed445c4c25210f8faf07ff404c41fbc805 From b5340c20d8a23f0f3f7a6ce738152747aaa2439d Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 20 Jul 2023 16:56:31 +0100 Subject: [PATCH 46/79] lint --- packages/backend-core/src/cache/appMetadata.ts | 2 +- packages/backend-core/src/db/utils.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/backend-core/src/cache/appMetadata.ts b/packages/backend-core/src/cache/appMetadata.ts index f1f3133757..5ecc6f10b1 100644 --- a/packages/backend-core/src/cache/appMetadata.ts +++ b/packages/backend-core/src/cache/appMetadata.ts @@ -3,7 +3,7 @@ import { doWithDB, DocumentType } from "../db" import { Database, App } from "@budibase/types" export enum AppState { - INVALID = "invalid" + INVALID = "invalid", } const EXPIRY_SECONDS = 3600 diff --git a/packages/backend-core/src/db/utils.ts b/packages/backend-core/src/db/utils.ts index 08764154eb..b6e793c065 100644 --- a/packages/backend-core/src/db/utils.ts +++ b/packages/backend-core/src/db/utils.ts @@ -101,7 +101,9 @@ export async function getAllApps({ const response = await Promise.allSettled(appPromises) const apps = response .filter( - (result: any) => result.status === "fulfilled" && result.value?.state !== AppState.INVALID + (result: any) => + result.status === "fulfilled" && + result.value?.state !== AppState.INVALID ) .map(({ value }: any) => value) if (!all) { @@ -126,7 +128,11 @@ export async function getAppsByIDs(appIds: string[]) { ) // have to list the apps which exist, some may have been deleted return settled - .filter(promise => promise.status === "fulfilled" && promise.value?.state !== AppState.INVALID) + .filter( + promise => + promise.status === "fulfilled" && + promise.value?.state !== AppState.INVALID + ) .map(promise => (promise as PromiseFulfilledResult).value) } From 73ae3d44d45b65375a266b452c04a87c87f95250 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 21 Jul 2023 07:50:42 +0000 Subject: [PATCH 47/79] Bump version to 2.8.19 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index d97372e035..a74cf9934d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.18", + "version": "2.8.19", "npmClient": "yarn", "packages": [ "packages/*" From b5a656e350be385623b41c3e8e883b37849f0117 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 21 Jul 2023 09:06:55 +0100 Subject: [PATCH 48/79] Update datasource config button hover styles to fix issues in light theme --- .../_components/EditDatasourceConfigButton.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte index 154957a561..9e50ab8da3 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/EditDatasourceConfigButton.svelte @@ -74,11 +74,12 @@ border: 1px solid var(--spectrum-global-color-gray-300); border-radius: 5px; width: 100%; - background-color: var(--spectrum-global-color-gray-50); + background: var(--spectrum-global-color-gray-50); color: white; overflow: hidden; padding: 12px 16px; box-sizing: border-box; + transition: background 130ms ease-out; } .left { flex: 1; @@ -94,7 +95,7 @@ } .button:hover { cursor: pointer; - filter: brightness(1.2); + background: var(--spectrum-global-color-gray-100); } .connected { display: flex; From 567c7fd485724823542b7c3f436c00ded5dcef42 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 21 Jul 2023 09:43:25 +0100 Subject: [PATCH 49/79] code review --- packages/backend-core/src/cache/appMetadata.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/backend-core/src/cache/appMetadata.ts b/packages/backend-core/src/cache/appMetadata.ts index 5ecc6f10b1..69f734162b 100644 --- a/packages/backend-core/src/cache/appMetadata.ts +++ b/packages/backend-core/src/cache/appMetadata.ts @@ -24,6 +24,10 @@ function isInvalid(metadata?: { state: string }) { return !metadata || metadata.state === AppState.INVALID } +interface DeletedAppMetadata { + state: AppState +} + /** * Get the requested app metadata by id. * Use redis cache to first read the app metadata. @@ -31,7 +35,9 @@ function isInvalid(metadata?: { state: string }) { * @param {string} appId the id of the app to get metadata from. * @returns {object} the app metadata. */ -export async function getAppMetadata(appId: string) { +export async function getAppMetadata( + appId: string +): Promise { const client = await getAppClient() // try cache let metadata = await client.get(appId) @@ -62,7 +68,7 @@ export async function getAppMetadata(appId: string) { await client.store(appId, metadata, expiry) } - return metadata as App & { state: AppState } + return metadata } /** From 108d18df75753d9569637fa4441a3ae6f009eec1 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 21 Jul 2023 09:57:37 +0100 Subject: [PATCH 50/79] fix type check for deleted app type --- packages/backend-core/src/cache/appMetadata.ts | 13 ++++++------- packages/backend-core/src/db/utils.ts | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/backend-core/src/cache/appMetadata.ts b/packages/backend-core/src/cache/appMetadata.ts index 69f734162b..0c320ec776 100644 --- a/packages/backend-core/src/cache/appMetadata.ts +++ b/packages/backend-core/src/cache/appMetadata.ts @@ -5,6 +5,11 @@ import { Database, App } from "@budibase/types" export enum AppState { INVALID = "invalid", } + +export interface DeletedApp { + state: AppState +} + const EXPIRY_SECONDS = 3600 /** @@ -24,10 +29,6 @@ function isInvalid(metadata?: { state: string }) { return !metadata || metadata.state === AppState.INVALID } -interface DeletedAppMetadata { - state: AppState -} - /** * Get the requested app metadata by id. * Use redis cache to first read the app metadata. @@ -35,9 +36,7 @@ interface DeletedAppMetadata { * @param {string} appId the id of the app to get metadata from. * @returns {object} the app metadata. */ -export async function getAppMetadata( - appId: string -): Promise { +export async function getAppMetadata(appId: string): Promise { const client = await getAppClient() // try cache let metadata = await client.get(appId) diff --git a/packages/backend-core/src/db/utils.ts b/packages/backend-core/src/db/utils.ts index b6e793c065..4ebf8392b5 100644 --- a/packages/backend-core/src/db/utils.ts +++ b/packages/backend-core/src/db/utils.ts @@ -2,7 +2,7 @@ import env from "../environment" import { DEFAULT_TENANT_ID, SEPARATOR, DocumentType } from "../constants" import { getTenantId, getGlobalDBName } from "../context" import { doWithDB, directCouchAllDbs } from "./db" -import { AppState, getAppMetadata } from "../cache/appMetadata" +import { AppState, DeletedApp, getAppMetadata } from "../cache/appMetadata" import { isDevApp, isDevAppID, getProdAppID } from "../docIds/conversions" import { App, Database } from "@budibase/types" import { getStartEndKeyURL } from "../docIds" @@ -131,7 +131,7 @@ export async function getAppsByIDs(appIds: string[]) { .filter( promise => promise.status === "fulfilled" && - promise.value?.state !== AppState.INVALID + (promise.value as DeletedApp).state !== AppState.INVALID ) .map(promise => (promise as PromiseFulfilledResult).value) } From af8be511dfac26a4e0935c57d85889729d0cfeac Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 21 Jul 2023 10:39:58 +0100 Subject: [PATCH 51/79] Add back in XS icons --- packages/bbui/src/Icon/Icon.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/bbui/src/Icon/Icon.svelte b/packages/bbui/src/Icon/Icon.svelte index a2cf8a1b3a..11dc9963d5 100644 --- a/packages/bbui/src/Icon/Icon.svelte +++ b/packages/bbui/src/Icon/Icon.svelte @@ -85,4 +85,9 @@ text-align: center; z-index: 1; } + + .spectrum-Icon--sizeXS { + width: var(--spectrum-global-dimension-size-150); + height: var(--spectrum-global-dimension-size-150); + } From c5a0711dd891726c9cc9ce999128315d1cc98fa5 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 21 Jul 2023 10:12:39 +0000 Subject: [PATCH 52/79] Bump version to 2.8.20 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index a74cf9934d..db1b6dc3f5 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.19", + "version": "2.8.20", "npmClient": "yarn", "packages": [ "packages/*" From a56f0c91dd60fde7f3b8ac8fa7e0ef6ff8f12b3e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 21 Jul 2023 12:15:33 +0100 Subject: [PATCH 53/79] Quick improvement to table types, before now the field schema was quite difficult to parse/work out what components of the schema were used for what, this at least separates them into particularly grouped bits of metadata, so it is obvious which parts are used for which. In future we should really flip this a bit, so that FieldSchema is the base implementation, and then each of the types has its own schema extending that base - but that would be a more serious refactor (need to cast to the correct type when using based on the 'type' property. --- packages/types/src/documents/app/table.ts | 97 ------------------ .../src/documents/app/table/constants.ts | 9 ++ .../types/src/documents/app/table/index.ts | 3 + .../types/src/documents/app/table/schema.ts | 98 +++++++++++++++++++ .../types/src/documents/app/table/table.ts | 30 ++++++ 5 files changed, 140 insertions(+), 97 deletions(-) delete mode 100644 packages/types/src/documents/app/table.ts create mode 100644 packages/types/src/documents/app/table/constants.ts create mode 100644 packages/types/src/documents/app/table/index.ts create mode 100644 packages/types/src/documents/app/table/schema.ts create mode 100644 packages/types/src/documents/app/table/table.ts diff --git a/packages/types/src/documents/app/table.ts b/packages/types/src/documents/app/table.ts deleted file mode 100644 index 18b415da5f..0000000000 --- a/packages/types/src/documents/app/table.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { Document } from "../document" -import { View } from "./view" -import { RenameColumn } from "../../sdk" -import { FieldType } from "./row" - -export enum RelationshipTypes { - ONE_TO_MANY = "one-to-many", - MANY_TO_ONE = "many-to-one", - MANY_TO_MANY = "many-to-many", -} - -export enum AutoReason { - FOREIGN_KEY = "foreign_key", -} - -export interface FieldSchema { - type: FieldType - externalType?: string - fieldName?: string - name: string - sortable?: boolean - tableId?: string - relationshipType?: RelationshipTypes - through?: string - foreignKey?: string - icon?: string - autocolumn?: boolean - autoReason?: AutoReason - subtype?: string - throughFrom?: string - throughTo?: string - formula?: string - formulaType?: string - main?: boolean - ignoreTimezones?: boolean - timeOnly?: boolean - lastID?: number - useRichText?: boolean | null - order?: number - width?: number - meta?: { - toTable: string - toKey: string - } - constraints?: { - type?: string - email?: boolean - inclusion?: string[] - length?: { - minimum?: string | number | null - maximum?: string | number | null - } - numericality?: { - greaterThanOrEqualTo: string | null - lessThanOrEqualTo: string | null - } - presence?: - | boolean - | { - allowEmpty?: boolean - } - datetime?: { - latest: string - earliest: string - } - } -} - -export interface TableSchema { - [key: string]: FieldSchema -} - -export interface Table extends Document { - type?: string - views?: { [key: string]: View } - name: string - primary?: string[] - schema: TableSchema - primaryDisplay?: string - sourceId?: string - relatedFormula?: string[] - constrained?: string[] - sql?: boolean - indexes?: { [key: string]: any } - rows?: { [key: string]: any } - created?: boolean - rowHeight?: number -} - -export interface ExternalTable extends Table { - sourceId: string -} - -export interface TableRequest extends Table { - _rename?: RenameColumn - created?: boolean -} diff --git a/packages/types/src/documents/app/table/constants.ts b/packages/types/src/documents/app/table/constants.ts new file mode 100644 index 0000000000..12a347c715 --- /dev/null +++ b/packages/types/src/documents/app/table/constants.ts @@ -0,0 +1,9 @@ +export enum RelationshipTypes { + ONE_TO_MANY = "one-to-many", + MANY_TO_ONE = "many-to-one", + MANY_TO_MANY = "many-to-many", +} + +export enum AutoReason { + FOREIGN_KEY = "foreign_key", +} diff --git a/packages/types/src/documents/app/table/index.ts b/packages/types/src/documents/app/table/index.ts new file mode 100644 index 0000000000..c22788d269 --- /dev/null +++ b/packages/types/src/documents/app/table/index.ts @@ -0,0 +1,3 @@ +export * from "./table" +export * from "./schema" +export * from "./constants" diff --git a/packages/types/src/documents/app/table/schema.ts b/packages/types/src/documents/app/table/schema.ts new file mode 100644 index 0000000000..188a2fddd3 --- /dev/null +++ b/packages/types/src/documents/app/table/schema.ts @@ -0,0 +1,98 @@ +// all added by grid/table when defining the +// column size, position and whether it can be viewed +import { FieldType } from "../row" +import { AutoReason, RelationshipTypes } from "./constants" + +export interface UIFieldMetadata { + order?: number + width?: number + visible?: boolean + icon?: string +} + +export interface RelationshipFieldMetadata { + main?: boolean + fieldName?: string + tableId?: string + // below is used for SQL relationships, needed to define the foreign keys + // or the tables used for many-to-many relationships (through) + relationshipType?: RelationshipTypes + through?: string + foreignKey?: string + throughFrom?: string + throughTo?: string +} + +export interface AutoColumnFieldMetadata { + autocolumn?: boolean + subtype?: string + lastID?: number + // if the column was turned to an auto-column for SQL, explains why (primary, foreign etc) + autoReason?: AutoReason +} + +export interface NumberFieldMetadata { + // used specifically when Budibase generates external tables, this denotes if a number field + // is a foreign key used for a many-to-many relationship + meta?: { + toTable: string + toKey: string + } +} + +export interface DateFieldMetadata { + ignoreTimezones?: boolean + timeOnly?: boolean +} + +export interface StringFieldMetadata { + useRichText?: boolean | null +} + +export interface FormulaFieldMetadata { + formula?: string + formulaType?: string +} + +export interface FieldConstraints { + type?: string + email?: boolean + inclusion?: string[] + length?: { + minimum?: string | number | null + maximum?: string | number | null + } + numericality?: { + greaterThanOrEqualTo: string | null + lessThanOrEqualTo: string | null + } + presence?: + | boolean + | { + allowEmpty?: boolean + } + datetime?: { + latest: string + earliest: string + } +} + +export interface FieldSchema + extends UIFieldMetadata, + DateFieldMetadata, + RelationshipFieldMetadata, + AutoColumnFieldMetadata, + StringFieldMetadata, + FormulaFieldMetadata, + NumberFieldMetadata { + type: FieldType + name: string + sortable?: boolean + // only used by external databases, to denote the real type + externalType?: string + constraints?: FieldConstraints +} + +export interface TableSchema { + [key: string]: FieldSchema +} diff --git a/packages/types/src/documents/app/table/table.ts b/packages/types/src/documents/app/table/table.ts new file mode 100644 index 0000000000..f4dc790267 --- /dev/null +++ b/packages/types/src/documents/app/table/table.ts @@ -0,0 +1,30 @@ +import { Document } from "../../document" +import { View } from "../view" +import { RenameColumn } from "../../../sdk" +import { TableSchema } from "./schema" + +export interface Table extends Document { + type?: string + views?: { [key: string]: View } + name: string + primary?: string[] + schema: TableSchema + primaryDisplay?: string + sourceId?: string + relatedFormula?: string[] + constrained?: string[] + sql?: boolean + indexes?: { [key: string]: any } + rows?: { [key: string]: any } + created?: boolean + rowHeight?: number +} + +export interface ExternalTable extends Table { + sourceId: string +} + +export interface TableRequest extends Table { + _rename?: RenameColumn + created?: boolean +} From fb725f91b37051367aa6740e6a04255608cfed8f Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 21 Jul 2023 12:27:05 +0100 Subject: [PATCH 54/79] Update pro ref --- packages/pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pro b/packages/pro index 4d9840700e..93291fc6b8 160000 --- a/packages/pro +++ b/packages/pro @@ -1 +1 @@ -Subproject commit 4d9840700e7684581c39965b7cb6a2b2428c477c +Subproject commit 93291fc6b8227be8b1decafe2765c1b742fc4f21 From d77a4062c7f4c7bc2674ab2a8821cd500e83a553 Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Fri, 21 Jul 2023 12:32:23 +0100 Subject: [PATCH 55/79] Update CONTRIBUTING.md --- docs/CONTRIBUTING.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index ac35929be1..2fb4c36fa8 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -231,18 +231,33 @@ An overview of the CI pipelines can be found [here](../.github/workflows/README. ### Pro -@budibase/pro is the closed source package that supports licensed features in budibase. By default the package will be pulled from NPM and will not normally need to be touched in local development. If you require to update code inside the pro package it can be cloned to the same root level as budibase, e.g. +@budibase/pro is the closed source package that supports licensed features in budibase. By default the package will be pulled from NPM and will not normally need to be touched in local development. If you need to make an update to pro and have access to the repo, then you can update your submodule within the mono-repo by running `git submodule update --init` - from here you can use normal submodule flow to develop a change within pro. + +Once you have updated to use the pro submodule, it will be linked into all of your local dependencies by NX as with all other monorepo packages. If you have been using the NPM version of `@budibase/pro` then you may need to run a `git reset --hard` to fix all of the pro versions back to `0.0.0` to be monorepo aware. + +From here - to develop a change in pro, you can follow the below flow: ``` -. -|_ budibase -|_ budibase-pro +# enter the pro submodule +cd packages/pro +# get the base branch you are working from (same as monorepo) +git fetch +git checkout +# create a branch, named the same as the branch in your monorepo +git checkout -b +... make changes +# commit the changes you've made, with a message for pro +git commit +# within the monorepo, add the pro reference to your branch, commit it with a message like "Update pro ref" +cd ../.. +git add packages/pro +git commit ``` +From here, you will have created a branch in the pro repository and commited the reference to your branch on the monorepo. When you eventually PR this work back into the mainline branch, you will need to first merge your pro PR to the pro mainline, then go into your PR in the monorepo and update the reference again to the new mainline. + Note that only budibase maintainers will be able to access the pro repo. -By default, NX will make sure that dependencies are replaced with local source aware version. This is achieved using the `yarn link` command. To see specifically how dependencies are linked see [scripts/link-dependencies.sh](../scripts/link-dependencies.sh). The same link script is used to link dependencies to account-portal in local dev. - ### Troubleshooting Sometimes, things go wrong. This can be due to incompatible updates on the budibase platform. To clear down your development environment and start again follow **Step 6. Cleanup**, then proceed from **Step 3. Install and Build** in the setup guide above to create a fresh Budibase installation. From 7673673db26d77640ef33e54f6df99d1143901e4 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 21 Jul 2023 12:57:47 +0100 Subject: [PATCH 56/79] Updating RelationshipTypes -> RelationshipType. --- .../DataTable/modals/CreateEditColumn.svelte | 12 +++---- .../Datasources/CreateEditRelationship.svelte | 30 ++++++++-------- .../backend/Datasources/relationshipErrors.js | 4 +-- .../builder/src/constants/backend/index.js | 2 +- packages/server/specs/resources/table.ts | 8 ++--- .../api/controllers/row/ExternalRequest.ts | 4 +-- .../src/api/controllers/table/external.ts | 20 +++++------ packages/server/src/constants/index.ts | 2 +- .../db/defaultData/datasource_bb_default.ts | 6 ++-- .../src/db/linkedRows/LinkController.ts | 20 +++++------ .../src/db/tests/linkController.spec.js | 30 ++++++++-------- .../src/integration-test/postgres.spec.ts | 36 +++++++++---------- .../server/src/integrations/base/sqlTable.ts | 6 ++-- .../server/src/sdk/app/tables/validation.ts | 6 ++-- .../src/documents/app/table/constants.ts | 2 +- .../types/src/documents/app/table/schema.ts | 4 +-- 16 files changed, 93 insertions(+), 99 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 208739a540..dfb028d38d 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -18,7 +18,7 @@ import { TableNames, UNEDITABLE_USER_FIELDS } from "constants" import { FIELDS, - RelationshipTypes, + RelationshipType, ALLOWABLE_STRING_OPTIONS, ALLOWABLE_NUMBER_OPTIONS, ALLOWABLE_STRING_TYPES, @@ -183,7 +183,7 @@ dispatch("updatecolumns") if ( saveColumn.type === LINK_TYPE && - saveColumn.relationshipType === RelationshipTypes.MANY_TO_MANY + saveColumn.relationshipType === RelationshipType.MANY_TO_MANY ) { // Fetching the new tables tables.fetch() @@ -237,7 +237,7 @@ // Default relationships many to many if (editableColumn.type === LINK_TYPE) { - editableColumn.relationshipType = RelationshipTypes.MANY_TO_MANY + editableColumn.relationshipType = RelationshipType.MANY_TO_MANY } if (editableColumn.type === FORMULA_TYPE) { editableColumn.formulaType = "dynamic" @@ -285,17 +285,17 @@ { name: `Many ${thisName} rows → many ${linkName} rows`, alt: `Many ${table.name} rows → many ${linkTable.name} rows`, - value: RelationshipTypes.MANY_TO_MANY, + value: RelationshipType.MANY_TO_MANY, }, { name: `One ${linkName} row → many ${thisName} rows`, alt: `One ${linkTable.name} rows → many ${table.name} rows`, - value: RelationshipTypes.ONE_TO_MANY, + value: RelationshipType.ONE_TO_MANY, }, { name: `One ${thisName} row → many ${linkName} rows`, alt: `One ${table.name} rows → many ${linkTable.name} rows`, - value: RelationshipTypes.MANY_TO_ONE, + value: RelationshipType.MANY_TO_ONE, }, ] } diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index 53fcf56e7f..36c6a32801 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -1,5 +1,5 @@