diff --git a/packages/builder/src/components/backend/DatasourceNavigator/QueryNavItem.svelte b/packages/builder/src/components/backend/DatasourceNavigator/QueryNavItem.svelte
index 5b611cc4df..227963f602 100644
--- a/packages/builder/src/components/backend/DatasourceNavigator/QueryNavItem.svelte
+++ b/packages/builder/src/components/backend/DatasourceNavigator/QueryNavItem.svelte
@@ -6,19 +6,18 @@
} from "@/helpers/data/utils"
import { goto as gotoStore, isActive } from "@roxi/routify"
import {
- datasources,
queries,
userSelectedResourceMap,
contextMenuStore,
} from "@/stores/builder"
import NavItem from "@/components/common/NavItem.svelte"
- import ConfirmDialog from "@/components/common/ConfirmDialog.svelte"
+ import DeleteDataConfirmModal from "@/components/backend/modals/DeleteDataConfirmationModal.svelte"
import { notifications, Icon } from "@budibase/bbui"
export let datasource
export let query
- let confirmDeleteDialog
+ let confirmDeleteModal
// goto won't work in the context menu callback if the store is called directly
$: goto = $gotoStore
@@ -31,7 +30,7 @@
keyBind: null,
visible: true,
disabled: false,
- callback: confirmDeleteDialog.show,
+ callback: confirmDeleteModal.show,
},
{
icon: "Duplicate",
@@ -51,20 +50,6 @@
]
}
- async function deleteQuery() {
- try {
- // Go back to the datasource if we are deleting the active query
- if ($queries.selectedQueryId === query._id) {
- goto(`./datasource/${query.datasourceId}`)
- }
- await queries.delete(query)
- await datasources.fetch()
- notifications.success("Query deleted")
- } catch (error) {
- notifications.error("Error deleting query")
- }
- }
-
const openContextMenu = e => {
e.preventDefault()
e.stopPropagation()
@@ -90,14 +75,7 @@
- Please enter the "{source?.name}" below to confirm. + Please enter the "{source?.name}" below to confirm.