From 2f9941f40ce4536c138773a0e5d85180f5acb34e Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 22 Nov 2021 11:13:33 +0000 Subject: [PATCH 1/4] v0.9.185-alpha.13 --- 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 b6952a4d2a..8039af5d22 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.185-alpha.12", + "version": "0.9.185-alpha.13", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index ca4f5e322c..e6060cf4a6 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.185-alpha.12", + "version": "0.9.185-alpha.13", "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 4383afc0c3..0458650132 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": "0.9.185-alpha.12", + "version": "0.9.185-alpha.13", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 0a5426f223..2ab1cef2ba 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.185-alpha.12", + "version": "0.9.185-alpha.13", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.185-alpha.12", - "@budibase/client": "^0.9.185-alpha.12", + "@budibase/bbui": "^0.9.185-alpha.13", + "@budibase/client": "^0.9.185-alpha.13", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.185-alpha.12", + "@budibase/string-templates": "^0.9.185-alpha.13", "@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 c0919198c9..bc1653691a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.185-alpha.12", + "version": "0.9.185-alpha.13", "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 7ab4994e82..19c585f942 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.185-alpha.12", + "version": "0.9.185-alpha.13", "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": "^0.9.185-alpha.12", + "@budibase/bbui": "^0.9.185-alpha.13", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.185-alpha.12", + "@budibase/string-templates": "^0.9.185-alpha.13", "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 dc065c1c12..39490a663e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.185-alpha.12", + "version": "0.9.185-alpha.13", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -68,9 +68,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.185-alpha.12", - "@budibase/client": "^0.9.185-alpha.12", - "@budibase/string-templates": "^0.9.185-alpha.12", + "@budibase/auth": "^0.9.185-alpha.13", + "@budibase/client": "^0.9.185-alpha.13", + "@budibase/string-templates": "^0.9.185-alpha.13", "@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 f37b9abc6b..f7aee0e419 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.185-alpha.12", + "version": "0.9.185-alpha.13", "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 2779282b24..73c8204d6a 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.185-alpha.12", + "version": "0.9.185-alpha.13", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -29,8 +29,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.185-alpha.12", - "@budibase/string-templates": "^0.9.185-alpha.12", + "@budibase/auth": "^0.9.185-alpha.13", + "@budibase/string-templates": "^0.9.185-alpha.13", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0", From ea0000df5139651bec83b77b66cc330c2ca242d4 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 22 Nov 2021 15:26:24 +0000 Subject: [PATCH 2/4] Updating UI to have a table/column deletion check which makes sure the user understands what they are doing, also disabling external table deletion. --- packages/bbui/src/Form/Core/TextField.svelte | 2 + packages/bbui/src/Form/Input.svelte | 2 + .../cypress/integration/createTable.spec.js | 2 + .../DataTable/modals/CreateEditColumn.svelte | 16 ++++++- .../popovers/EditTablePopover.svelte | 47 +++++++++++++------ .../pages/builder/portal/apps/index.svelte | 6 ++- packages/builder/src/stores/backend/tables.js | 11 +++-- .../src/api/controllers/table/external.js | 9 +++- 8 files changed, 74 insertions(+), 21 deletions(-) diff --git a/packages/bbui/src/Form/Core/TextField.svelte b/packages/bbui/src/Form/Core/TextField.svelte index 37989a291e..85c71338f7 100644 --- a/packages/bbui/src/Form/Core/TextField.svelte +++ b/packages/bbui/src/Form/Core/TextField.svelte @@ -11,6 +11,7 @@ export let readonly = false export let updateOnChange = true export let quiet = false + export let dataCy const dispatch = createEventDispatcher() let focus = false @@ -78,6 +79,7 @@ {disabled} {readonly} {id} + data-cy={dataCy} value={value || ""} placeholder={placeholder || ""} on:click diff --git a/packages/bbui/src/Form/Input.svelte b/packages/bbui/src/Form/Input.svelte index d1dbaff50b..1660b67799 100644 --- a/packages/bbui/src/Form/Input.svelte +++ b/packages/bbui/src/Form/Input.svelte @@ -13,6 +13,7 @@ export let error = null export let updateOnChange = true export let quiet = false + export let dataCy const dispatch = createEventDispatcher() const onChange = e => { @@ -23,6 +24,7 @@ { cy.get(".spectrum-Table-editIcon > use").click() cy.contains("Delete").click() cy.wait(50) + cy.get(`[data-cy="delete-column-confirm"]`).type("nameupdated") cy.contains("Delete Column").click() cy.contains("nameupdated").should("not.exist") }) @@ -66,6 +67,7 @@ context("Create a Table", () => { cy.get(".actions .spectrum-Icon").click({ force: true }) }) cy.get(".spectrum-Menu > :nth-child(2)").click() + cy.get(`[data-cy="delete-table-confirm"]`).type("dog") cy.contains("Delete Table").click() cy.contains("dog").should("not.exist") }) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 83ed741b75..86ad625c2c 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -62,6 +62,7 @@ let indexes = [...($tables.selected.indexes || [])] let confirmDeleteDialog let deletion + let deleteColName $: checkConstraints(field) $: required = !!field?.constraints?.presence || primaryDisplay @@ -408,9 +409,20 @@ + disabled={deleteColName !== field.name} +> +

+ Are you sure you wish to delete the column {field.name}? + Your data will be deleted and this action cannot be undone - enter the column + name to confirm. +

+ +
diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte index 04094b881a..0c0f8efe4f 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte @@ -21,8 +21,10 @@ let originalName = table.name let templateScreens let willBeDeleted + let deleteTableName $: external = table?.type === "external" + $: allowDeletion = !external || table?.created function showDeleteModal() { templateScreens = $allScreens.filter( @@ -36,15 +38,19 @@ async function deleteTable() { const wasSelectedTable = $tables.selected - await tables.delete(table) - store.actions.screens.delete(templateScreens) - await tables.fetch() - notifications.success("Table deleted") - if (table.type === "external") { - await datasources.fetch() - } - if (wasSelectedTable && wasSelectedTable._id === table._id) { - $goto("./table") + try { + await tables.delete(table) + await store.actions.screens.delete(templateScreens) + await tables.fetch() + if (table.type === "external") { + await datasources.fetch() + } + notifications.success("Table deleted") + if (wasSelectedTable && wasSelectedTable._id === table._id) { + $goto("./table") + } + } catch (err) { + notifications.error(err) } } @@ -67,7 +73,9 @@ Edit - Delete + {#if allowDeletion} + Delete + {/if} @@ -91,10 +99,13 @@ okText="Delete Table" onOk={deleteTable} title="Confirm Deletion" + disabled={deleteTableName !== table.name} > - Are you sure you wish to delete the table - {table.name}? - The following will also be deleted: +

+ Are you sure you wish to delete the table + {table.name}? + The following will also be deleted: +

{#each willBeDeleted as item} @@ -102,7 +113,15 @@ {/each}
- This action cannot be undone. +

+ This action cannot be undone - to continue please enter the table name below + to confirm. +

+