fix(ui): destructive actions confirm via AlertDialog, naming the item (#1749)
Quality / check (push) Canceled after 7m10s
deploy / gate (push) Successful in 4m49s
deploy / archied-image (push) Successful in 3m29s
deploy / agent-image (push) Successful in 12s
deploy / dist-zip (push) Skipped

Delete policy, remove member, revoke token, remove passkey and delete
source now open the shared AlertDialog confirmation that names the item,
matching the binding/mapping/event-type deletes that already confirmed.
This commit is contained in:
sam committed 2026-11-07 00:11:16 +11:00
1 parent ef623f6c68
commit 12eea5eee3
5 files changed
+74 -5

No files matched your search

+15 -1
View File
@@ -3,6 +3,7 @@ import { Check, Copy, KeyRound, Lock, LockOpen, Plus, Trash2 } from "@lucide/vue
import { onMounted, ref } from "vue";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@/components/ui/alert-dialog";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Section } from "@/components/ui/section";
@@ -53,6 +54,7 @@ const {
remove,
refusals,
} = useSources();
const pending = ref<Source | null>(null);
const customPath = ref("");
const copied = ref<string | null>(null);
@@ -214,7 +216,7 @@ function url(source: Source): string {
size="icon-sm"
aria-label="Delete source"
:disabled="busy"
@click="remove(source)"
@click="pending = source"
>
<Trash2 />
</Button>
@@ -232,4 +234,16 @@ function url(source: Source): string {
<EmptyHeader><EmptyTitle>No sources yet</EmptyTitle></EmptyHeader>
</Empty>
</section>
<AlertDialog :open="pending !== null" @update:open="(v: boolean) => { if (!v) pending = null; }">
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Delete source?</AlertDialogTitle>
<AlertDialogDescription>Delete the source "{{ pending?.path }}"? Its webhook endpoint stops accepting deliveries.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction @click="if (pending) { const src = pending; pending = null; remove(src); }">Delete source</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</template>