From 319fcabaa520c6f57878570bc8b466ce8b8cac06 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 18 Sep 2020 12:41:39 +0100 Subject: [PATCH] removing delete functionality - not necessary --- .../src/builderStore/buildStateOrigins.js | 28 ---------------- .../src/components/common/Dropzone.svelte | 6 +--- .../database/DataTable/AttachmentList.svelte | 4 +-- .../modals/RecordFieldControl.svelte | 4 +-- .../DataTable/popovers/EditRow.svelte | 14 +++++--- .../builder/tests/buildStateOrigins.spec.js | 32 ------------------- packages/server/src/api/controllers/static.js | 18 +---------- packages/server/src/api/routes/static.js | 5 --- 8 files changed, 16 insertions(+), 95 deletions(-) delete mode 100644 packages/builder/src/builderStore/buildStateOrigins.js delete mode 100644 packages/builder/tests/buildStateOrigins.spec.js diff --git a/packages/builder/src/builderStore/buildStateOrigins.js b/packages/builder/src/builderStore/buildStateOrigins.js deleted file mode 100644 index d368b3656e..0000000000 --- a/packages/builder/src/builderStore/buildStateOrigins.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * buildStateOrigins - * - * Builds an object that details all the bound state in the application, and what updates it. - * - * @param screenDefinition - the screen definition metadata. - * @returns {Object} an object with the client state values and how they are managed. - */ -export const buildStateOrigins = screenDefinition => { - const origins = {} - - function traverse(propValue) { - for (let key in propValue) { - if (!Array.isArray(propValue[key])) continue - - if (key === "_children") propValue[key].forEach(traverse) - - for (let element of propValue[key]) { - if (element["##eventHandlerType"] === "Set State") - origins[element.parameters.path] = element - } - } - } - - traverse(screenDefinition.props) - - return origins -} diff --git a/packages/builder/src/components/common/Dropzone.svelte b/packages/builder/src/components/common/Dropzone.svelte index 9ce8ed83b6..e98dd5f835 100644 --- a/packages/builder/src/components/common/Dropzone.svelte +++ b/packages/builder/src/components/common/Dropzone.svelte @@ -38,9 +38,6 @@ } async function removeFile() { - const response = await api.delete( - `/api/attachments/${selectedImage.fileName}` - ) files.splice(selectedImageIdx, 1) files = files selectedImageIdx = 0 @@ -82,7 +79,6 @@ on:dragenter={handleDragOver} on:drop={handleDrop} class:fileDragged> -