From e695396bb88ae45154949d3181ded650c3948c89 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 3 Dec 2021 11:38:49 +0000 Subject: [PATCH 01/11] Ensure links prop is always an array when configuring layout links --- .../PropertyControls/NavigationEditor/NavigationDrawer.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte index 4d1823108c..4301028ba0 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte @@ -17,6 +17,7 @@ const flipDurationMs = 150 let dragDisabled = true + $: links = links || [] $: links.forEach(link => { if (!link.id) { link.id = generate() From 39d5c81b72ab3f6fee18139cb399c4416f38eaf7 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 3 Dec 2021 11:45:04 +0000 Subject: [PATCH 02/11] Ensure links are an array in the wrapper component for a cleaner fix --- .../PropertyControls/NavigationEditor/NavigationDrawer.svelte | 1 - .../PropertyControls/NavigationEditor/NavigationEditor.svelte | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte index 4301028ba0..4d1823108c 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationDrawer.svelte @@ -17,7 +17,6 @@ const flipDurationMs = 150 let dragDisabled = true - $: links = links || [] $: links.forEach(link => { if (!link.id) { link.id = generate() diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte index ea02b4184d..40357f50be 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/NavigationEditor/NavigationEditor.svelte @@ -6,7 +6,7 @@ export let value = [] let drawer - let links = cloneDeep(value) + let links = cloneDeep(value || []) const dispatch = createEventDispatcher() const save = () => { From cb1f87083195399b7beb0469461c2341c4df8ca0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 8 Dec 2021 08:35:19 +0000 Subject: [PATCH 03/11] Key links by URL as the svelte-spa-router link svelte action does not update correctly --- .../client/src/components/app/Link.svelte | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/client/src/components/app/Link.svelte b/packages/client/src/components/app/Link.svelte index 851b2f0b66..91537b5b38 100644 --- a/packages/client/src/components/app/Link.svelte +++ b/packages/client/src/components/app/Link.svelte @@ -79,18 +79,20 @@ {componentText} {:else} - - {componentText} - + {#key url} + + {componentText} + + {/key} {/if} {/if} From 49551ceb54fcc020f1e0edc7a7a45b63237310a2 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 8 Dec 2021 08:36:01 +0000 Subject: [PATCH 04/11] Fix incorrect icon used for repeater layout in settings bar --- packages/client/manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/manifest.json b/packages/client/manifest.json index d16b117215..de2ebc51e0 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -393,13 +393,13 @@ { "label": "Column", "value": "column", - "barIcon": "ViewRow", + "barIcon": "ViewColumn", "barTitle": "Column layout" }, { "label": "Row", "value": "row", - "barIcon": "ViewColumn", + "barIcon": "ViewRow", "barTitle": "Row layout" } ], From 6b20d5cf4616b656eaf7739e17e33b7a743ea329 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 8 Dec 2021 09:03:56 +0000 Subject: [PATCH 05/11] Allow internal links to be opened in a new tab --- .../client/src/components/app/Link.svelte | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/client/src/components/app/Link.svelte b/packages/client/src/components/app/Link.svelte index 91537b5b38..f47a2a0522 100644 --- a/packages/client/src/components/app/Link.svelte +++ b/packages/client/src/components/app/Link.svelte @@ -21,11 +21,25 @@ $: target = openInNewTab ? "_blank" : "_self" $: placeholder = $builderStore.inBuilder && !text $: componentText = getComponentText(text, $builderStore, $component) + $: sanitizedUrl = getSanitizedUrl(url, externalLink, openInNewTab) // Add color styles to main styles object, otherwise the styleable helper // overrides the color when it's passed as inline style. $: styles = enrichStyles($component.styles, color) + const getSanitizedUrl = (url, externalLink, newTab) => { + if (!url) { + return externalLink || newTab ? "#/" : "/" + } + if (externalLink) { + return url + } + if (openInNewTab) { + return `#${url}` + } + return url + } + const getComponentText = (text, builderState, componentState) => { if (!builderState.inBuilder || componentState.editing) { return text || "" @@ -65,10 +79,10 @@ {componentText} {:else if $builderStore.inBuilder || componentText} - {#if externalLink} + {#if externalLink || openInNewTab} {:else} - {#key url} + {#key sanitizedUrl} Date: Wed, 8 Dec 2021 09:31:39 +0000 Subject: [PATCH 06/11] Fix query params directly mutating the stored app definition --- .../PropertyControls/DataSourceSelect.svelte | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte index dc1b24077a..4cb080d0c9 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte @@ -31,6 +31,7 @@ const arrayTypes = ["attachment", "array"] let anchorRight, dropdownRight let drawer + let tmpQueryParams $: text = value?.label ?? "Choose an option" $: tables = $tablesStore.list.map(m => ({ @@ -105,12 +106,12 @@ } }) - function handleSelected(selected) { + const handleSelected = selected => { dispatch("change", selected) dropdownRight.hide() } - function fetchQueryDefinition(query) { + const fetchQueryDefinition = query => { const source = $datasources.list.find( ds => ds._id === query.datasourceId ).source @@ -124,6 +125,19 @@ const getQueryDatasource = query => { return $datasources.list.find(ds => ds._id === query?.datasourceId) } + + const openQueryParamsDrawer = () => { + tmpQueryParams = value.queryParams + drawer.show() + } + + const saveQueryParams = () => { + handleSelected({ + ...value, + queryParams: tmpQueryParams, + }) + drawer.hide() + }
@@ -134,24 +148,14 @@ on:click={dropdownRight.show} /> {#if value?.type === "query"} - + - + {#if getQueryParams(value).length > 0} From 96e2ada5bd06dcf97c4afdc4b42f90f15e58d58b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 8 Dec 2021 09:42:19 +0000 Subject: [PATCH 07/11] Lint --- .../PropertiesPanel/PropertyControls/DataSourceSelect.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte index 4cb080d0c9..220bd41205 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/DataSourceSelect.svelte @@ -17,7 +17,6 @@ queries as queriesStore, } from "stores/backend" import { datasources, integrations } from "stores/backend" - import { notifications } from "@budibase/bbui" import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte" import IntegrationQueryEditor from "components/integration/index.svelte" import { makePropSafe as safe } from "@budibase/string-templates" From a90cfc3e73a16e26651aeb2838b2cb10332b1bc0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 8 Dec 2021 09:45:50 +0000 Subject: [PATCH 08/11] Coerce picker option labels to string to fix bug when using autocomplete with numeric labels --- packages/bbui/src/Form/Core/Picker.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte index 5f4da1cad9..1af819e44a 100644 --- a/packages/bbui/src/Form/Core/Picker.svelte +++ b/packages/bbui/src/Form/Core/Picker.svelte @@ -63,9 +63,9 @@ const getFilteredOptions = (options, term, getLabel) => { if (autocomplete && term) { const lowerCaseTerm = term.toLowerCase() - return options.filter(option => - getLabel(option)?.toLowerCase().includes(lowerCaseTerm) - ) + return options.filter(option => { + return `${getLabel(option)}`?.toLowerCase().includes(lowerCaseTerm) + }) } return options } From b8b66b0c0715c16d0d611baf24fceeb99a877f4f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 8 Dec 2021 09:47:43 +0000 Subject: [PATCH 09/11] Remove unnecessary optional chaining --- packages/bbui/src/Form/Core/Picker.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte index 1af819e44a..143536a60a 100644 --- a/packages/bbui/src/Form/Core/Picker.svelte +++ b/packages/bbui/src/Form/Core/Picker.svelte @@ -64,7 +64,7 @@ if (autocomplete && term) { const lowerCaseTerm = term.toLowerCase() return options.filter(option => { - return `${getLabel(option)}`?.toLowerCase().includes(lowerCaseTerm) + return `${getLabel(option)}`.toLowerCase().includes(lowerCaseTerm) }) } return options From 90011b53ccd1af548c1fedbddb0b9427a97d7653 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 8 Dec 2021 10:59:26 +0000 Subject: [PATCH 10/11] Use full runtime bindings in automation settings and enable JS bindings for backend log action --- .../SetupPanel/AutomationBlockSetup.svelte | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index e7208518d5..acda9b89e0 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -96,13 +96,16 @@ allSteps[idx].schema?.outputs?.properties ?? {} ) bindings = bindings.concat( - outputs.map(([name, value]) => ({ - label: name, - type: value.type, - description: value.description, - category: idx === 0 ? "Trigger outputs" : `Step ${idx} outputs`, - path: idx === 0 ? `trigger.${name}` : `steps.${idx}.${name}`, - })) + outputs.map(([name, value]) => { + const runtime = idx === 0 ? `trigger.${name}` : `steps.${idx}.${name}` + return { + label: runtime, + type: value.type, + description: value.description, + category: idx === 0 ? "Trigger outputs" : `Step ${idx} outputs`, + path: runtime, + } + }) ) } return bindings @@ -261,7 +264,6 @@ value={inputData[key]} on:change={e => onChange(e, key)} {bindings} - allowJS={false} />
{/if} From a382184cd0de4476eb74e8a3d6c84a1cfc27735c Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 8 Dec 2021 11:38:32 +0000 Subject: [PATCH 11/11] v1.0.8 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 49a49487d3..d19745b11c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.7", + "version": "1.0.8", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index a66b3c912b..aa41d93782 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "1.0.7", + "version": "1.0.8", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 82fb9bbda6..826c833602 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.7", + "version": "1.0.8", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index e91c57415f..72552d7642 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.7", + "version": "1.0.8", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.7", - "@budibase/client": "^1.0.7", + "@budibase/bbui": "^1.0.8", + "@budibase/client": "^1.0.8", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^1.0.7", + "@budibase/string-templates": "^1.0.8", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index e7ec3372a1..ad050235fe 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.7", + "version": "1.0.8", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 8656c443ce..3b831055d0 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.7", + "version": "1.0.8", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.7", + "@budibase/bbui": "^1.0.8", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^1.0.7", + "@budibase/string-templates": "^1.0.8", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 67f6de62c0..155b85d84d 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.7", + "version": "1.0.8", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -69,9 +69,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/auth": "^1.0.7", - "@budibase/client": "^1.0.7", - "@budibase/string-templates": "^1.0.7", + "@budibase/auth": "^1.0.8", + "@budibase/client": "^1.0.8", + "@budibase/string-templates": "^1.0.8", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 3036bf7e9f..53d94f91e7 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.7", + "version": "1.0.8", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index d556d5f581..34986cef6a 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.7", + "version": "1.0.8", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/auth": "^1.0.7", - "@budibase/string-templates": "^1.0.7", + "@budibase/auth": "^1.0.8", + "@budibase/string-templates": "^1.0.8", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0",