From 87bfbf0e93269fe866366bc1f9302608fb1ff2f9 Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 13 Dec 2024 09:26:53 +0000 Subject: [PATCH 001/163] Fix for progress circle appearing in the builder and allow binding of S3Upload value in S3Upload settings --- packages/client/manifest.json | 3 ++- .../src/components/app/forms/S3Upload.svelte | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/client/manifest.json b/packages/client/manifest.json index 6dd1b71b75..c236dd1ad9 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -5139,7 +5139,8 @@ { "type": "text", "label": "File name", - "key": "key" + "key": "key", + "nested": true }, { "type": "event", diff --git a/packages/client/src/components/app/forms/S3Upload.svelte b/packages/client/src/components/app/forms/S3Upload.svelte index 0147cbca6e..fc4c0f8f08 100644 --- a/packages/client/src/components/app/forms/S3Upload.svelte +++ b/packages/client/src/components/app/forms/S3Upload.svelte @@ -2,6 +2,8 @@ import Field from "./Field.svelte" import { CoreDropzone, ProgressCircle, Helpers } from "@budibase/bbui" import { getContext, onMount, onDestroy } from "svelte" + import { builderStore } from "stores/builder.js" + import { processStringSync } from "@budibase/string-templates" export let datasourceId export let bucket @@ -42,6 +44,9 @@ // Process the file input and return a serializable structure expected by // the dropzone component to display the file const processFiles = async fileList => { + if ($builderStore.inBuilder) { + return [] + } return await new Promise(resolve => { if (!fileList?.length) { return [] @@ -78,12 +83,15 @@ } const upload = async () => { + const processedFileKey = processStringSync(key, { + [$component.id]: fieldState, + }) loading = true try { const res = await API.externalUpload({ datasourceId, bucket, - key, + key: processedFileKey, data, }) notificationStore.actions.success("File uploaded successfully") @@ -131,7 +139,7 @@ bind:fieldApi defaultValue={[]} > -
+
{#if fieldState}