From e4e6447cf6986252ffbd82262a917fd5927c8e0d Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:16:19 +0000 Subject: [PATCH 1/4] Use clickoutside library to stop mouseup closing side panel (#13193) * Use clickoutside library to stop mouseup closing side panel * Revert "Use clickoutside library to stop mouseup closing side panel" This reverts commit fbe574812e90491556183c157a254ecbf0953b01. * Use mousedown * Add allowedType for clickoutside event * Remove contextmenu listener --------- Co-authored-by: Martin McKeaveney --- packages/bbui/src/Actions/click_outside.js | 13 +++++++++---- packages/client/src/components/app/Layout.svelte | 5 ++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/bbui/src/Actions/click_outside.js b/packages/bbui/src/Actions/click_outside.js index 12c4c4d002..2c54427b3a 100644 --- a/packages/bbui/src/Actions/click_outside.js +++ b/packages/bbui/src/Actions/click_outside.js @@ -39,19 +39,23 @@ const handleClick = event => { return } + if (handler.allowedType && event.type !== handler.allowedType) { + return + } + handler.callback?.(event) }) } document.documentElement.addEventListener("click", handleClick, true) -document.documentElement.addEventListener("contextmenu", handleClick, true) +document.documentElement.addEventListener("mousedown", handleClick, true) /** * Adds or updates a click handler */ -const updateHandler = (id, element, anchor, callback) => { +const updateHandler = (id, element, anchor, callback, allowedType) => { let existingHandler = clickHandlers.find(x => x.id === id) if (!existingHandler) { - clickHandlers.push({ id, element, anchor, callback }) + clickHandlers.push({ id, element, anchor, callback, allowedType }) } else { existingHandler.callback = callback } @@ -77,7 +81,8 @@ export default (element, opts) => { const update = newOpts => { const callback = newOpts?.callback || newOpts const anchor = newOpts?.anchor || element - updateHandler(id, element, anchor, callback) + const allowedType = newOpts?.allowedType || "click" + updateHandler(id, element, anchor, callback, allowedType) } update(opts) return { diff --git a/packages/client/src/components/app/Layout.svelte b/packages/client/src/components/app/Layout.svelte index 1b92c0fefc..992a166143 100644 --- a/packages/client/src/components/app/Layout.svelte +++ b/packages/client/src/components/app/Layout.svelte @@ -291,7 +291,10 @@
From 3749f198f9e015429dcffdfbed8dbedfef55fd42 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 20 Mar 2024 15:23:07 +0000 Subject: [PATCH 2/4] Bump version to 2.22.7 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index dfd2aac356..3a92bc6d9a 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.22.6", + "version": "2.22.7", "npmClient": "yarn", "packages": [ "packages/*", From c70b50277f0c0d5f4fe7150bb6a559d1434a0c3f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 20 Mar 2024 17:37:27 +0100 Subject: [PATCH 3/4] Fix tsconfig.json --- packages/shared-core/tsconfig.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/shared-core/tsconfig.json b/packages/shared-core/tsconfig.json index ad028931e4..d0c5134f1c 100644 --- a/packages/shared-core/tsconfig.json +++ b/packages/shared-core/tsconfig.json @@ -1,6 +1,8 @@ { "extends": "./tsconfig.build.json", "compilerOptions": { + "baseUrl": "..", + "rootDir": "src", "composite": true, "types": ["node", "jest"] }, From b3bc092ee00afa18e98e293effe83b385fa946c9 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 20 Mar 2024 18:25:23 +0000 Subject: [PATCH 4/4] Allowing deletion of external tables, whether they were createrd in Budibase or not. --- .../popovers/EditTablePopover.svelte | 23 ++++++++----------- .../src/api/controllers/table/external.ts | 3 --- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte index c2cda1f2d8..f2c726c8bf 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte @@ -28,7 +28,6 @@ let deleteTableName $: externalTable = table?.sourceType === DB_TYPE_EXTERNAL - $: allowDeletion = !externalTable || table?.created function showDeleteModal() { templateScreens = $screenStore.screens.filter( @@ -56,7 +55,7 @@ $goto(`./datasource/${table.datasourceId}`) } } catch (error) { - notifications.error("Error deleting table") + notifications.error(`Error deleting table - ${error.message}`) } } @@ -86,17 +85,15 @@ } -{#if allowDeletion} - -
- -
- {#if !externalTable} - Edit - {/if} - Delete -
-{/if} + +
+ +
+ {#if !externalTable} + Edit + {/if} + Delete +