From 19b4ed070cb93359113b390edc8b384c0a8c76bb Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 8 Nov 2023 10:25:28 +0000 Subject: [PATCH 1/5] Reduce the likelihood of collisions in table names by using a UUID instead of a random word. --- packages/server/src/api/routes/tests/row.spec.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/server/src/api/routes/tests/row.spec.ts b/packages/server/src/api/routes/tests/row.spec.ts index 48f7ab4f09..c426d59f4e 100644 --- a/packages/server/src/api/routes/tests/row.spec.ts +++ b/packages/server/src/api/routes/tests/row.spec.ts @@ -32,6 +32,7 @@ import { structures, } from "@budibase/backend-core/tests" import _ from "lodash" +import * as uuid from "uuid" const timestamp = new Date("2023-01-26T11:48:57.597Z").toISOString() tk.freeze(timestamp) @@ -68,7 +69,7 @@ describe.each([ const generateTableConfig: () => SaveTableRequest = () => { return { - name: generator.word(), + name: uuid.v4(), type: "table", primary: ["id"], primaryDisplay: "name", @@ -481,7 +482,7 @@ describe.each([ }) const createViewResponse = await config.createView({ - name: generator.word(), + name: uuid.v4(), schema: { Country: { visible: true, @@ -816,7 +817,8 @@ describe.each([ RelationshipType.ONE_TO_MANY, ["link"], { - name: generator.word(), + // Making sure that the combined table name + column name is within postgres limits + name: uuid.v4().replace(/-/g, "").substring(0, 16), type: "table", primary: ["id"], primaryDisplay: "id", @@ -949,7 +951,7 @@ describe.each([ describe("view 2.0", () => { async function userTable(): Promise { return { - name: `users_${generator.word()}`, + name: `users_${uuid.v4()}`, sourceId: INTERNAL_TABLE_SOURCE_ID, sourceType: TableSourceType.INTERNAL, type: "table", @@ -1133,7 +1135,7 @@ describe.each([ const viewSchema = { age: { visible: true }, name: { visible: true } } async function userTable(): Promise
{ return { - name: `users_${generator.word()}`, + name: `users_${uuid.v4()}`, sourceId: INTERNAL_TABLE_SOURCE_ID, sourceType: TableSourceType.INTERNAL, type: "table", @@ -1630,7 +1632,7 @@ describe.each([ }), (tableId: string) => config.api.row.save(tableId, { - name: generator.word(), + name: uuid.v4(), description: generator.paragraph(), tableId, }), From d86e94376586870a8b18dc0d08dca60ee86ee0fa Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 8 Nov 2023 10:27:15 +0000 Subject: [PATCH 2/5] Automation history issue fix --- .../FlowChart/FlowItemHeader.svelte | 68 +++++++++++-------- .../AutomationBuilder/TestDisplay.svelte | 1 + .../_components/HistoryDetailsPanel.svelte | 2 +- 3 files changed, 43 insertions(+), 28 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte index 0c7ac3d27d..3c9e1a13b1 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItemHeader.svelte @@ -13,13 +13,13 @@ export let idx export let addLooping export let deleteStep - + export let enableNaming = true let validRegex = /^[A-Za-z0-9_\s]+$/ let typing = false const dispatch = createEventDispatcher() - $: stepNames = $selectedAutomation.definition.stepNames + $: stepNames = $selectedAutomation?.definition.stepNames $: automationName = stepNames?.[block.id] || block?.name || "" $: automationNameError = getAutomationNameError(automationName) $: status = updateStatus(testResult, isTrigger) @@ -32,7 +32,7 @@ )?.[0] } } - $: loopBlock = $selectedAutomation.definition.steps.find( + $: loopBlock = $selectedAutomation?.definition.steps.find( x => x.blockToLoop === block?.id ) @@ -126,24 +126,33 @@ Step {idx} {/if} - { - automationName = e.target.value.trim() - }} - on:click={startTyping} - on:blur={async () => { - typing = false - if (automationNameError) { - automationName = stepNames[block.id] || block?.name - } else { - await saveName() - } - }} - /> + + {#if enableNaming} + { + automationName = e.target.value.trim() + }} + on:click={startTyping} + on:blur={async () => { + typing = false + if (automationNameError) { + automationName = stepNames[block.id] || block?.name + } else { + await saveName() + } + }} + /> + {:else} +
+ {automationName} +
+ {/if}
@@ -178,9 +187,11 @@ {/if} - - - + {#if !isHeaderTrigger} + + + + {/if} {/if} {#if !showTestStatus} {#if block.stepId !== ActionStepID.LOOP} (openBlocks[block.id] = !openBlocks[block.id])} isTrigger={idx === 0} diff --git a/packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/HistoryDetailsPanel.svelte b/packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/HistoryDetailsPanel.svelte index 5b9c925130..cde76fa1c0 100644 --- a/packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/HistoryDetailsPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/settings/automation-history/_components/HistoryDetailsPanel.svelte @@ -56,7 +56,7 @@ {/if} {#key history}
- +
{/key} From 555f8fc22ccdd77da0c44fbab58ad8725153d770 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 8 Nov 2023 11:29:28 +0000 Subject: [PATCH 3/5] Bump version to 2.13.4 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 25ec556c56..765395227c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.13.3", + "version": "2.13.4", "npmClient": "yarn", "packages": [ "packages/*" From cf4e29ef311ed4974cbee7cf3e97f9f8c7e1d37e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 8 Nov 2023 13:35:43 +0000 Subject: [PATCH 4/5] allow for custom DATA_DIR on azure --- hosting/couchdb/build-target-paths.sh | 4 ++-- hosting/scripts/build-target-paths.sh | 4 ++-- hosting/single/runner.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hosting/couchdb/build-target-paths.sh b/hosting/couchdb/build-target-paths.sh index 67e1765ca8..34227011f4 100644 --- a/hosting/couchdb/build-target-paths.sh +++ b/hosting/couchdb/build-target-paths.sh @@ -2,8 +2,8 @@ echo ${TARGETBUILD} > /buildtarget.txt if [[ "${TARGETBUILD}" = "aas" ]]; then - # Azure AppService uses /home for persisent data & SSH on port 2222 - DATA_DIR=/home + # Azure AppService uses /home for persistent data & SSH on port 2222 + DATA_DIR="${DATA_DIR:-/home}" WEBSITES_ENABLE_APP_SERVICE_STORAGE=true mkdir -p $DATA_DIR/{search,minio,couch} mkdir -p $DATA_DIR/couch/{dbs,views} diff --git a/hosting/scripts/build-target-paths.sh b/hosting/scripts/build-target-paths.sh index 67e1765ca8..34227011f4 100644 --- a/hosting/scripts/build-target-paths.sh +++ b/hosting/scripts/build-target-paths.sh @@ -2,8 +2,8 @@ echo ${TARGETBUILD} > /buildtarget.txt if [[ "${TARGETBUILD}" = "aas" ]]; then - # Azure AppService uses /home for persisent data & SSH on port 2222 - DATA_DIR=/home + # Azure AppService uses /home for persistent data & SSH on port 2222 + DATA_DIR="${DATA_DIR:-/home}" WEBSITES_ENABLE_APP_SERVICE_STORAGE=true mkdir -p $DATA_DIR/{search,minio,couch} mkdir -p $DATA_DIR/couch/{dbs,views} diff --git a/hosting/single/runner.sh b/hosting/single/runner.sh index 9dc7aa25d8..87201c95c0 100644 --- a/hosting/single/runner.sh +++ b/hosting/single/runner.sh @@ -22,7 +22,7 @@ declare -a DOCKER_VARS=("APP_PORT" "APPS_URL" "ARCHITECTURE" "BUDIBASE_ENVIRONME # Azure App Service customisations if [[ "${TARGETBUILD}" = "aas" ]]; then - DATA_DIR=/home + DATA_DIR="${DATA_DIR:-/home}" WEBSITES_ENABLE_APP_SERVICE_STORAGE=true /etc/init.d/ssh start else From 1016fa97f53178b7ea4bcf546f4526a4cb9e7f6a Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 8 Nov 2023 13:49:53 +0000 Subject: [PATCH 5/5] Bump version to 2.13.5 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 765395227c..5605642877 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.13.4", + "version": "2.13.5", "npmClient": "yarn", "packages": [ "packages/*"