From de944480da676891b1ff2a50fcc4beb42ad2b08a Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Tue, 17 Aug 2021 23:57:11 +0200 Subject: [PATCH 1/2] update the name of the datasource --- .../bbui/src/ActionMenu/ActionMenu.svelte | 7 ++- .../modals/UpdateDatasourceModal.svelte | 62 +++++++++++++++++++ .../popovers/EditDatasourcePopover.svelte | 4 ++ .../builder/src/stores/backend/datasources.js | 11 +++- .../server/src/api/controllers/datasource.js | 22 +++++++ packages/server/src/api/routes/datasource.js | 5 ++ 6 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 packages/builder/src/components/backend/DatasourceNavigator/modals/UpdateDatasourceModal.svelte diff --git a/packages/bbui/src/ActionMenu/ActionMenu.svelte b/packages/bbui/src/ActionMenu/ActionMenu.svelte index 45bb65b527..1c05021d12 100644 --- a/packages/bbui/src/ActionMenu/ActionMenu.svelte +++ b/packages/bbui/src/ActionMenu/ActionMenu.svelte @@ -23,8 +23,11 @@ dropdown.show() } - const openMenu = () => { - if (!disabled) show() + const openMenu = (event) => { + if (!disabled) { + event.stopPropagation() + show() + } } setContext("actionMenu", { show, hide }) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/UpdateDatasourceModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/UpdateDatasourceModal.svelte new file mode 100644 index 0000000000..44148ebb6e --- /dev/null +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/UpdateDatasourceModal.svelte @@ -0,0 +1,62 @@ + + + + + + + + diff --git a/packages/builder/src/components/backend/DatasourceNavigator/popovers/EditDatasourcePopover.svelte b/packages/builder/src/components/backend/DatasourceNavigator/popovers/EditDatasourcePopover.svelte index 71a85f38fb..7f2f104278 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/popovers/EditDatasourcePopover.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/popovers/EditDatasourcePopover.svelte @@ -4,10 +4,12 @@ import { notifications } from "@budibase/bbui" import { ActionMenu, MenuItem, Icon } from "@budibase/bbui" import ConfirmDialog from "components/common/ConfirmDialog.svelte" + import UpdateDatasourceModal from "components/backend/DatasourceNavigator/modals/UpdateDatasourceModal.svelte" export let datasource let confirmDeleteDialog + let updateDatasourceDialog async function deleteDatasource() { const wasSelectedSource = $datasources.selected @@ -24,6 +26,7 @@
+ Update Delete @@ -37,6 +40,7 @@ {datasource.name}? This action cannot be undone. +