From 3d504da94ce6f5caa7b808df69435c91db6fbf9c Mon Sep 17 00:00:00 2001 From: Adam French Date: Mon, 19 Oct 2026 19:53:19 +0100 Subject: [PATCH] =?UTF-8?q?fix(qa):=20ISSUE-002=20=E2=80=94=20confirm=20sa?= =?UTF-8?q?ves=20and=20make=20Cancel=20work=20on=20the=20admin=20forms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Admin.vue rendered the create forms without listening for their "done" and "cancel" events, so a successful save gave no feedback and every Cancel button did nothing. Show a "Saved." notice on done, and remount the form on cancel to clear it. Co-Authored-By: Claude Opus 5.5 --- vue/src/views/admin/Admin.vue | 37 +++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/vue/src/views/admin/Admin.vue b/vue/src/views/admin/Admin.vue index 33851f5..82d5843 100644 --- a/vue/src/views/admin/Admin.vue +++ b/vue/src/views/admin/Admin.vue @@ -42,6 +42,27 @@ const activeSection = computed(() => sections.find((s) => s.id === active.value), ); +// The create forms emit "done"/"cancel" and leave it to the host to react +// (the Feed widget's modal closes on them). Here the form stays open, so +// "done" needs a visible confirmation, and "cancel" remounts the form via +// formKey, which is the only way to clear fields the form keeps to itself. +const notice = ref(""); +const formKey = ref(0); + +function selectSection(id) { + active.value = id; + notice.value = ""; +} + +function onDone() { + notice.value = "Saved."; +} + +function onCancel() { + notice.value = ""; + formKey.value++; +} + // The requiresAdmin guard only runs on navigation, so logging out in place // would leave the panel on screen for a signed-out visitor; leave it instead. async function handleLogout() { @@ -70,7 +91,7 @@ async function handleLogout() { :key="section.id" class="admin-nav-link" :class="{ 'is-active': active === section.id }" - @click="active = section.id" + @click="selectSection(section.id)" > {{ section.label }} @@ -87,7 +108,13 @@ async function handleLogout() {
- + + {{ notice }}
@@ -162,6 +189,12 @@ async function handleLogout() { margin-top: 0; } +.admin-notice { + display: block; + margin-top: 8px; + color: var(--color-secondary); +} + @media (max-width: 700px) { .admin-body { grid-template-columns: 1fr;