Make a partly-undone import retryable, and refuse a plan it cannot deliver

This commit is contained in:
2026-09-03 09:16:01 -04:00
parent b0bd73f62d
commit ddf41c3e65
20 changed files with 588 additions and 37 deletions

View File

@@ -269,7 +269,7 @@
below if needed.
</template>
<template v-else-if="wincReport.blocking">
{{ wincReport.rowcount }} row(s) in scope, but unresolved values
{{ wincReport.rowcount }} row(s) in scope, but the problems below
block the import - nothing was written. Resolve them and preview
again.
</template>
@@ -314,6 +314,29 @@
</label>
</div>
<!-- Blocking and NOT acknowledgeable, unlike needscreate above.
The packet blocks on these, so the page must name them or the
banner points at nothing the admin can see. -->
<div
v-if="wincReport.uncreatable && Object.keys(wincReport.uncreatable).length"
class="problems"
>
<h4>Rows this import cannot create (blocking)</h4>
<p class="muted">
The export needs these, but this import only ever creates business
units. Create them in Settings first, or alias the export values
to rows that already exist, then preview again.
</p>
<ul>
<li v-for="(items, group) in wincReport.uncreatable" :key="group">
<strong>{{ group }}:</strong>
<span v-for="(count, name) in items" :key="name">
"{{ name }}" ({{ count }}){{ ' ' }}
</span>
</li>
</ul>
</div>
<div v-if="wincReport.unresolved && Object.keys(wincReport.unresolved).length" class="problems">
<h4>Unresolved values (blocking)</h4>
<p class="muted">
@@ -354,15 +377,27 @@
<td>{{ b.createdat }}</td>
<td>{{ b.createdby || '-' }}</td>
<td>{{ b.rowcount }}</td>
<td>{{ b.status }}</td>
<td>
{{ b.status }}
<small v-if="b.status === 'partially-undone'" class="muted">
- some rows could not be put back
</small>
</td>
<td>
<!-- 'partially-undone' is retryable and MUST offer the
button: that status exists because an undo stopped at a
conflict, and retrying once the conflict is resolved is
the whole point. Testing only for 'applied' left the
backend willing and the button hidden. -->
<button
v-if="b.status === 'applied'"
v-if="b.status === 'applied' || b.status === 'partially-undone'"
class="btn btn-secondary btn-sm"
:disabled="wincUndoingId === b.batchid"
@click="undoWincBatch(b.batchid)"
>
{{ wincUndoingId === b.batchid ? 'Undoing...' : 'Undo' }}
{{ wincUndoingId === b.batchid
? 'Undoing...'
: (b.status === 'partially-undone' ? 'Retry undo' : 'Undo') }}
</button>
<span v-else class="muted">undone</span>
</td>