소스 검색

fix(inventory): "Print labels..." works in Spoolman mode (#1390 follow-up)

  The LabelTemplatePickerModal correctly branches on a spoolmanMode prop
  and the /spoolman/labels backend endpoint exists, but InventoryPage was
  instantiating the modal with spoolmanMode={false} hard-coded. Every
  click in Spoolman mode resolved to /inventory/labels with Spoolman spool
  IDs and returned 404 "Spool(s) not found".

  The hard-coded value came with a stale comment from the original label
  printing PR that said "Spoolman path hands users an iframe to Spoolman
  so the per-spool button never shows in that context" -- that assumption
  stopped being true when the unified inventory UI shipped.

  Pass the actual spoolmanMode value through, drop the stale comment.

  The existing LabelTemplatePickerModal.test.tsx already covers both
  branches at the component level (line 209: "routes to the Spoolman
  endpoint when spoolmanMode is true"). The gap was that no test exercised
  the InventoryPage wiring.
maziggy 4 달 전
부모
커밋
b07122e395
4개의 변경된 파일과 5개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 0
      CHANGELOG.md
  2. 1 5
      frontend/src/pages/InventoryPage.tsx
  3. 0 0
      static/assets/index-5ID0OvMM.js
  4. 1 1
      static/index.html

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 3 - 0
CHANGELOG.md


+ 1 - 5
frontend/src/pages/InventoryPage.tsx

@@ -1890,16 +1890,12 @@ function InventoryPage({ spoolmanMode = false, spoolmanModeReady = true }: { spo
         onSave={handleColumnConfigSave}
       />
 
-      {/* Label printing (#809) — local-mode only on dev. The Spoolman path
-          on this branch hands users an iframe straight to Spoolman, so the
-          per-spool button never shows in that context. The Spoolman label
-          endpoint is wired and tested for when the inventory UI lands. */}
       <LabelTemplatePickerModal
         isOpen={labelPickerSpoolIds !== null}
         onClose={() => setLabelPickerSpoolIds(null)}
         availableSpools={filteredSpools}
         initialSelectedIds={labelPickerSpoolIds ?? []}
-        spoolmanMode={false}
+        spoolmanMode={spoolmanMode}
       />
     </div>
   );

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
static/assets/index-5ID0OvMM.js


+ 1 - 1
static/index.html

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

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.