Ver código fonte

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.
maziggy 2 meses atrás
pai
commit
10ad9267e1

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
CHANGELOG.md


+ 3 - 3
frontend/src/components/PrintModal/index.tsx

@@ -1099,11 +1099,11 @@ export function PrintModal({
                 onAutoConfigurePrinter={multiPrinterMapping.autoConfigurePrinter}
                 onAutoConfigurePrinter={multiPrinterMapping.autoConfigurePrinter}
                 onUpdatePrinterConfig={multiPrinterMapping.updatePrinterConfig}
                 onUpdatePrinterConfig={multiPrinterMapping.updatePrinterConfig}
                 assignmentMode={assignmentMode}
                 assignmentMode={assignmentMode}
-                onAssignmentModeChange={!isEditing ? setAssignmentMode : undefined}
+                onAssignmentModeChange={setAssignmentMode}
                 targetModel={targetModel}
                 targetModel={targetModel}
-                onTargetModelChange={!isEditing ? setTargetModel : undefined}
+                onTargetModelChange={setTargetModel}
                 targetLocation={targetLocation}
                 targetLocation={targetLocation}
-                onTargetLocationChange={!isEditing ? setTargetLocation : undefined}
+                onTargetLocationChange={setTargetLocation}
                 slicedForModel={slicedForModel}
                 slicedForModel={slicedForModel}
               />
               />
             )}
             )}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
static/assets/index-BwslAeY1.js


+ 1 - 1
static/index.html

@@ -26,7 +26,7 @@
 
 
     <!-- Splash screens for iOS -->
     <!-- Splash screens for iOS -->
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
-    <script type="module" crossorigin src="/assets/index-DxxKVIUT.js"></script>
+    <script type="module" crossorigin src="/assets/index-BwslAeY1.js"></script>
     <link rel="stylesheet" crossorigin href="/assets/index-BxVhuRti.css">
     <link rel="stylesheet" crossorigin href="/assets/index-BxVhuRti.css">
   </head>
   </head>
   <body>
   <body>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff