No input required for deletion.

This commit is contained in:
mike12345567 2025-02-05 16:29:21 +00:00
parent 78c16334b5
commit 877f30b7a0
2 changed files with 36 additions and 48 deletions

View File

@ -1,5 +1,5 @@
<script lang="ts">
import { InlineAlert, Link, Input, notifications } from "@budibase/bbui"
import { InlineAlert, Link, notifications } from "@budibase/bbui"
import {
appStore,
datasources,
@ -22,7 +22,6 @@
let affectedScreens: { text: string; url: string }[] = []
let sourceType: SourceType | undefined = undefined
let isInternal: boolean = false
let deleteSourceName: string | undefined
$: isInternalTable = isInternal && sourceType === SourceType.TABLE
@ -87,11 +86,7 @@
}
function hideDeleteDialog() {
deleteSourceName = ""
}
const autofillSourceName = () => {
deleteSourceName = source?.name
sourceType = undefined
}
async function deleteTable(table: Table & { datasourceId?: string }) {
@ -192,14 +187,14 @@
}
</script>
<ConfirmDialog
{#if sourceType}
<ConfirmDialog
bind:this={confirmDeleteDialog}
okText="Delete"
onOk={deleteSource}
onCancel={hideDeleteDialog}
title={`Are you sure you want to delete ${source?.name}?`}
disabled={deleteSourceName !== source?.name}
>
>
<div class="content">
<p class="warning">
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
@ -224,7 +219,8 @@
</div>
{/if}
</div>
</ConfirmDialog>
</ConfirmDialog>
{/if}
<style>
.content {
@ -232,14 +228,6 @@
max-width: 320px;
}
.sourceName {
flex-grow: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
}
.warning {
margin: 0;
max-width: 100%;

View File

@ -8,7 +8,7 @@
export let onOk = undefined
export let onCancel = undefined
export let warning = true
export let disabled
export let disabled = false
let modal