fix(queue): edit modal shows printer/model selection for model-assigned items

Editing a queue item that was created with "Any of model X" left the
printer selection area completely blank — the assignmentMode was
initialised to 'model' from queueItem.target_model, but the three
model-mode props (onAssignmentModeChange, onTargetModelChange,
onTargetLocationChange) were gated behind !isEditing. That flipped
modelAssignmentAvailable to false in PrinterSelector and hid the mode
toggle, the model dropdown, AND the location filter; combined with the
assignmentMode === 'printer' gate on the printer list, the whole
selector rendered empty.

Users hit this whenever they queued something to "Any of model X" and
then wanted to change the target model / location — the only workaround
was delete + re-queue.

Fix: drop the !isEditing gate on all three PrinterSelector props. The
submit path already handles both flavours (target_model+target_location
with printer_id=null vs. printer_id with the target fields nulled), so
un-gating the UI just surfaces the machinery that was already there.
Edit is still only offered on pending items, so the mode-flip can't race
an in-flight dispatch.
This commit is contained in:
maziggy
2026-07-02 09:39:56 +02:00
parent 2d13e77f1b
commit 10ad9267e1
4 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -1099,11 +1099,11 @@ export function PrintModal({
onAutoConfigurePrinter={multiPrinterMapping.autoConfigurePrinter}
onUpdatePrinterConfig={multiPrinterMapping.updatePrinterConfig}
assignmentMode={assignmentMode}
onAssignmentModeChange={!isEditing ? setAssignmentMode : undefined}
onAssignmentModeChange={setAssignmentMode}
targetModel={targetModel}
onTargetModelChange={!isEditing ? setTargetModel : undefined}
onTargetModelChange={setTargetModel}
targetLocation={targetLocation}
onTargetLocationChange={!isEditing ? setTargetLocation : undefined}
onTargetLocationChange={setTargetLocation}
slicedForModel={slicedForModel}
/>
)}