Skip to content

Commit ac3ef6b

Browse files
committed
fix(export): confirmation before all exports
1 parent f95acbe commit ac3ef6b

5 files changed

Lines changed: 64 additions & 26 deletions

File tree

frontend/app/components/export/ExportForm.vue

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,22 +168,25 @@ const selectMU1 = () =>
168168
const selectMU2 = () =>
169169
setLangs(props.config.languages.filter((l) => l.mu2).map((l) => l.code));
170170
171-
// Bulk runs can launch many workflows at once, so confirm first.
171+
// Every export is confirmed first — bulk runs can launch many workflows at
172+
// once, and single-asset runs are still irreversible.
172173
const confirmOpen = ref(false);
173174
175+
const confirmTitle = computed(() =>
176+
props.bulkMode ? t("export.bulkConfirmTitle") : t("export.confirmTitle"),
177+
);
178+
174179
const confirmMessage = computed(() =>
175-
t("export.bulkConfirmMessage", {
176-
n: exportableAssets.value.length,
177-
d: selectedDestCount.value,
178-
}),
180+
props.bulkMode
181+
? t("export.bulkConfirmMessage", {
182+
n: exportableAssets.value.length,
183+
d: selectedDestCount.value,
184+
})
185+
: t("export.confirmMessage", { d: selectedDestCount.value }),
179186
);
180187
181188
function attemptExport() {
182-
if (props.bulkMode) {
183-
confirmOpen.value = true;
184-
return;
185-
}
186-
startExport();
189+
confirmOpen.value = true;
187190
}
188191
189192
function confirmExport() {
@@ -534,10 +537,10 @@ function startExport() {
534537
</div>
535538
</div>
536539

537-
<!-- Bulk export confirmation -->
540+
<!-- Export confirmation (both single-asset and bulk) -->
538541
<DesignDialog
539542
v-model:open="confirmOpen"
540-
:title="$t('export.bulkConfirmTitle')"
543+
:title="confirmTitle"
541544
:description="confirmMessage"
542545
>
543546
<div class="flex w-full justify-end gap-2">
@@ -549,7 +552,11 @@ function startExport() {
549552
icon="tabler:file-export"
550553
@click="confirmExport"
551554
>
552-
{{ $t("export.bulkStart") }}
555+
{{
556+
bulkMode
557+
? $t("export.bulkStart")
558+
: $t("export.startExport")
559+
}}
553560
</DesignButton>
554561
</div>
555562
</DesignDialog>

frontend/app/components/vb-export/VbExportForm.vue

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,27 @@ const selectionSummary = computed(() =>
105105
106106
/* ---------------------------------------------------------------- actions --- */
107107
108-
// Bulk runs can launch many workflows at once, so confirm first.
108+
// Every export is confirmed first — bulk runs can launch many workflows at
109+
// once, and single-asset runs are still irreversible.
109110
const confirmOpen = ref(false);
110111
112+
const confirmTitle = computed(() =>
113+
props.bulkMode
114+
? t("vbExport.bulkConfirmTitle")
115+
: t("vbExport.confirmTitle"),
116+
);
117+
111118
const confirmMessage = computed(() =>
112-
t("vbExport.bulkConfirmMessage", {
113-
n: exportableAssets.value.length,
114-
d: selectedDestCount.value,
115-
}),
119+
props.bulkMode
120+
? t("vbExport.bulkConfirmMessage", {
121+
n: exportableAssets.value.length,
122+
d: selectedDestCount.value,
123+
})
124+
: t("vbExport.confirmMessage", { d: selectedDestCount.value }),
116125
);
117126
118127
function attemptExport() {
119-
if (props.bulkMode) {
120-
confirmOpen.value = true;
121-
return;
122-
}
123-
startExport();
128+
confirmOpen.value = true;
124129
}
125130
126131
function confirmExport() {
@@ -299,10 +304,10 @@ function startExport() {
299304
</div>
300305
</div>
301306

302-
<!-- Bulk export confirmation -->
307+
<!-- Export confirmation (both single-asset and bulk) -->
303308
<DesignDialog
304309
v-model:open="confirmOpen"
305-
:title="$t('vbExport.bulkConfirmTitle')"
310+
:title="confirmTitle"
306311
:description="confirmMessage"
307312
>
308313
<div class="flex w-full justify-end gap-2">
@@ -314,7 +319,11 @@ function startExport() {
314319
icon="tabler:file-export"
315320
@click="confirmExport"
316321
>
317-
{{ $t("vbExport.bulkStart") }}
322+
{{
323+
bulkMode
324+
? $t("vbExport.bulkStart")
325+
: $t("vbExport.startExport")
326+
}}
318327
</DesignButton>
319328
</div>
320329
</DesignDialog>

frontend/docs/design-system-migration.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,20 @@ files. Pending human visual review.
234234
changing the `DesignButton` variant.
235235
- Focus ring: every interactive `Design*` element carries `ds-focus-ring` (see prior entry).
236236

237+
### 2026-06-23 — confirm single-asset exports too (behavior change, not migration)
238+
239+
Investigated a report of "export started without a confirmation dialog." Root cause: the
240+
export-trigger logic (`attemptExport`) was **unchanged by the migration** (git diff of the script
241+
is empty) — confirmation only ever gated *bulk* mode; single-asset exports have always fired
242+
immediately. Verified `DesignDialog` opens correctly via `v-model:open` in isolation, so not a
243+
dialog regression.
244+
245+
Per user decision, single-asset exports now also confirm. Both `ExportForm.vue` and
246+
`VbExportForm.vue`: `attemptExport()` now always opens the dialog; added `confirmTitle` +
247+
branched `confirmMessage` computeds (bulk vs single); dialog confirm-button label is bulk/single
248+
aware. New i18n keys `export.confirmTitle`/`confirmMessage` and `vbExport.confirmTitle`/
249+
`confirmMessage` in `en.json` + `nb.json`. `pnpm typecheck` ✅.
250+
237251
### Next steps (pick up here)
238252

239253
1. **Human visual review** of `/export` (with and without `?id=`) in light + dark. Compare against

frontend/locales/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@
129129
"bulkStart": "Start bulk export",
130130
"bulkConfirmTitle": "Start bulk export?",
131131
"bulkConfirmMessage": "This will start export for {n} asset(s) to {d} destination(s).",
132+
"confirmTitle": "Start export?",
133+
"confirmMessage": "This will start the export to {d} destination(s).",
132134
"cancel": "Cancel",
133135
"bulkStartedCount": "Started export for {n} asset(s)",
134136
"bulkFailedCount": "{n} failed"
@@ -159,6 +161,8 @@
159161
"bulkStart": "Start bulk export",
160162
"bulkConfirmTitle": "Start bulk export?",
161163
"bulkConfirmMessage": "This will start export for {n} asset(s) to {d} destination(s).",
164+
"confirmTitle": "Start export?",
165+
"confirmMessage": "This will start the export to {d} destination(s).",
162166
"cancel": "Cancel",
163167
"bulkStartedCount": "Started export for {n} asset(s)",
164168
"bulkFailedCount": "{n} failed"

frontend/locales/nb.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@
129129
"bulkStart": "Start masseeksport",
130130
"bulkConfirmTitle": "Starte masseeksport?",
131131
"bulkConfirmMessage": "Dette starter eksport for {n} element(er) til {d} destinasjon(er).",
132+
"confirmTitle": "Starte eksport?",
133+
"confirmMessage": "Dette starter eksporten til {d} destinasjon(er).",
132134
"cancel": "Avbryt",
133135
"bulkStartedCount": "Startet eksport for {n} element(er)",
134136
"bulkFailedCount": "{n} feilet"
@@ -159,6 +161,8 @@
159161
"bulkStart": "Start masseeksport",
160162
"bulkConfirmTitle": "Starte masseeksport?",
161163
"bulkConfirmMessage": "Dette starter eksport for {n} element(er) til {d} destinasjon(er).",
164+
"confirmTitle": "Starte eksport?",
165+
"confirmMessage": "Dette starter eksporten til {d} destinasjon(er).",
162166
"cancel": "Avbryt",
163167
"bulkStartedCount": "Startet eksport for {n} element(er)",
164168
"bulkFailedCount": "{n} feilet"

0 commit comments

Comments
 (0)