feat(console): confirm removing filled editor rows

Filter conditions and groups, delivery targets, saved fragments and forge
hosts vanished on a single click, taking whatever had been typed with
them. Rows holding content now ask first, while empty, never-filled
rows (`isBlankNode`: default operator, no path, no values, not negated)
are still removed directly.
This commit is contained in:
翅膀 committed 2026-10-17 00:58:24 +08:00
1 parent 85f8cb74bc
commit 84fc63663e
8 files changed
+104 -12

No files matched your search

+11 -1
View File
@@ -85,7 +85,7 @@
variant="destructive"
size="icon"
class="[grid-area:del] justify-self-end"
@click="form.forgeSources.splice(i, 1)"
@click="removeForgeSource(s)"
>
✕
</RcButton>
@@ -240,6 +240,7 @@ import { reactive, watch } from "vue";
import type { ForgeSource, Group } from "~/types";
const { t } = useI18n();
const { confirm } = useConfirm();
const props = defineProps<{
open: boolean;
@@ -285,6 +286,15 @@ const owners = computed({
function addForgeSource(): void {
form.forgeSources.push({ host: "", type: "github" });
}
async function removeForgeSource(source: ForgeSource): Promise<void> {
const label = source.host.trim() || source.name?.trim();
if (label && !(await confirm({ title: t("confirm.removeForgeSource", { name: label }) }))) {
return;
}
const index = form.forgeSources.indexOf(source);
if (index >= 0) form.forgeSources.splice(index, 1);
}
function toggleProvider(p: "github" | "gitea", checked: boolean): void {
form.providers = checked
? [...new Set([...form.providers, p])]