Просмотр исходного кода

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 месяцев назад
Родитель
Сommit
0c7480f9ea
3 измененных файлов с 4 добавлено и 4 удалено
  1. 3 3
      frontend/src/components/PrintModal/index.tsx
  2. 0 0
      static/assets/index-BwslAeY1.js
  3. 1 1
      static/index.html

+ 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}
               />
               />
             )}
             )}

Разница между файлами не показана из-за своего большого размера
+ 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>

Некоторые файлы не были показаны из-за большого количества измененных файлов