diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte index 8824113970..7144912536 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte @@ -3,15 +3,23 @@ import { store, allScreens } from "builderStore" import { tables } from "stores/backend" import { notifications } from "@budibase/bbui" - import { Icon, Popover, Button, Input } from "@budibase/bbui" + import { + ActionMenu, + MenuItem, + Icon, + Modal, + ModalContent, + Popover, + Button, + Input, + } from "@budibase/bbui" import ConfirmDialog from "components/common/ConfirmDialog.svelte" - import { DropdownContainer, DropdownItem } from "components/common/Dropdowns" export let table let anchor + let editorModal let dropdown - let editing let confirmDeleteDialog let error = "" let originalName = table.name @@ -19,15 +27,16 @@ let willBeDeleted function showEditor() { - editing = true + editorModal.show() + dropdown?.hide() } function hideEditor() { + editorModal.hide() dropdown?.hide() - editing = false } - function showModal() { + function showDeleteModal() { const screens = $allScreens templateScreens = screens.filter( (screen) => screen.autoTableId === table._id @@ -60,50 +69,35 @@ function checkValid(evt) { const tableName = evt.target.value error = - originalName !== tableName + originalName === tableName ? `Table with name ${tableName} already exists. Please choose another name.` : "" } -
-
+ +
- - {#if editing} -
-
Edit Table
- -
- - -
-
- {:else} - - - - - {/if} -
-
+ Edit + Delete + + + + + + +