From 73859262afbed79e7c177f0ccf56065fc56fbd96 Mon Sep 17 00:00:00 2001 From: Arthur Bassi Date: Fri, 17 Jul 2026 14:48:46 -0300 Subject: [PATCH] fix(work-orders): align MUI v9 props for dialog and layout --- .../_components/comp-doc/comp-doc-dialog.tsx | 1 - .../_components/detail/audit-timeline.tsx | 7 ++++- .../detail/work-order-detail-sections.tsx | 12 ++++----- .../_components/dispatch-create-modal.tsx | 26 ++++++++++++++----- .../dispatch-checklist-section.tsx | 2 +- .../dispatch/dispatch-detail/index.tsx | 9 +------ .../uplift-decision-dialog.tsx | 6 +---- .../loading/detail-page-skeleton.tsx | 2 +- .../_components/media/media-upload-modal.tsx | 1 - .../_components/wizard/new-wo-wizard.tsx | 1 - .../_components/work-order-form.tsx | 4 +-- src/app/(protected)/workorders/index.tsx | 1 - .../api/api-formdata-content-type.test.ts | 5 ++-- 13 files changed, 40 insertions(+), 37 deletions(-) diff --git a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-dialog.tsx b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-dialog.tsx index 291ba462..459a27e9 100644 --- a/src/app/(protected)/workorders/_components/comp-doc/comp-doc-dialog.tsx +++ b/src/app/(protected)/workorders/_components/comp-doc/comp-doc-dialog.tsx @@ -223,7 +223,6 @@ export function CompDocDialog({ {entry.action && entry.fieldName ? ( - + {entry.fieldName} {entry.oldValue || entry.newValue ? `: ${entry.oldValue || "—"} → ${entry.newValue || "—"}` diff --git a/src/app/(protected)/workorders/_components/detail/work-order-detail-sections.tsx b/src/app/(protected)/workorders/_components/detail/work-order-detail-sections.tsx index 2ca5217c..0d1b533f 100644 --- a/src/app/(protected)/workorders/_components/detail/work-order-detail-sections.tsx +++ b/src/app/(protected)/workorders/_components/detail/work-order-detail-sections.tsx @@ -81,7 +81,7 @@ export function WorkOrderDetailsSection({ - + Assigned To }> - Classification + Classification @@ -111,7 +111,7 @@ export function WorkOrderDetailsSection({ }> - Schedule + Schedule @@ -128,7 +128,7 @@ export function WorkOrderDetailsSection({ }> - Financial + Financial @@ -144,7 +144,7 @@ export function WorkOrderDetailsSection({ }> - Dispatches ({wo.dispatches.length}) + Dispatches ({wo.dispatches.length}) {wo.dispatches.length ? ( @@ -202,7 +202,7 @@ export function WorkOrderDetailsSection({ }> - Description + Description {wo.description || "No description provided."} diff --git a/src/app/(protected)/workorders/_components/dispatch-create-modal.tsx b/src/app/(protected)/workorders/_components/dispatch-create-modal.tsx index cad420b9..95480505 100644 --- a/src/app/(protected)/workorders/_components/dispatch-create-modal.tsx +++ b/src/app/(protected)/workorders/_components/dispatch-create-modal.tsx @@ -110,7 +110,7 @@ export function DispatchCreateModal({ workOrder, onClose }: DispatchCreateModalP }; return ( - + Dispatch{" "} {selectedWOs.length > 1 @@ -126,7 +126,7 @@ export function DispatchCreateModal({ workOrder, onClose }: DispatchCreateModalP Work Orders ({selectedWOs.length}) - + {selectedWOs.map((wo) => ( {vendor.contactName && ( - + {vendor.contactName} )} {vendor.tradeSpecialties && ( - + {vendor.tradeSpecialties} )} {vendor.address && ( - + {vendor.address} )} @@ -244,7 +256,7 @@ export function DispatchCreateModal({ workOrder, onClose }: DispatchCreateModalP type="number" value={nteAmount} onChange={(event) => setNteAmount(event.target.value)} - inputProps={{ step: "0.01", min: 0 }} + slotProps={{ htmlInput: { step: "0.01", min: 0 } }} fullWidth /> 0 && ( - + {customItems.map((item, index) => ( )} diff --git a/src/app/(protected)/workorders/_components/dispatch/dispatch-detail/index.tsx b/src/app/(protected)/workorders/_components/dispatch/dispatch-detail/index.tsx index 4de67010..0f4c0838 100644 --- a/src/app/(protected)/workorders/_components/dispatch/dispatch-detail/index.tsx +++ b/src/app/(protected)/workorders/_components/dispatch/dispatch-detail/index.tsx @@ -43,14 +43,7 @@ export function DispatchDetailModal({ return ( <> - + + {type === "approve" ? `Approve uplift to $${requestedNTE.toFixed(2)}?` : "Deny Uplift"} diff --git a/src/app/(protected)/workorders/_components/loading/detail-page-skeleton.tsx b/src/app/(protected)/workorders/_components/loading/detail-page-skeleton.tsx index a5c0671e..c9dbd36e 100644 --- a/src/app/(protected)/workorders/_components/loading/detail-page-skeleton.tsx +++ b/src/app/(protected)/workorders/_components/loading/detail-page-skeleton.tsx @@ -39,7 +39,7 @@ export function DetailPageSkeleton({ variant = "view" }: DetailPageSkeletonProps ))} - + diff --git a/src/app/(protected)/workorders/_components/media/media-upload-modal.tsx b/src/app/(protected)/workorders/_components/media/media-upload-modal.tsx index f374de91..d56b4e30 100644 --- a/src/app/(protected)/workorders/_components/media/media-upload-modal.tsx +++ b/src/app/(protected)/workorders/_components/media/media-upload-modal.tsx @@ -47,7 +47,6 @@ export function MediaUploadModal({ row, open, onOpenChange }: MediaUploadModalPr @@ -348,7 +348,7 @@ export default function WorkOrderFormPage() { /> - + diff --git a/src/app/(protected)/workorders/index.tsx b/src/app/(protected)/workorders/index.tsx index 9b3d358e..412ec331 100644 --- a/src/app/(protected)/workorders/index.tsx +++ b/src/app/(protected)/workorders/index.tsx @@ -208,7 +208,6 @@ export default function WorkOrdersListPage() { Cancel work order? diff --git a/src/test/api/api-formdata-content-type.test.ts b/src/test/api/api-formdata-content-type.test.ts index 2db34987..4596309f 100644 --- a/src/test/api/api-formdata-content-type.test.ts +++ b/src/test/api/api-formdata-content-type.test.ts @@ -51,8 +51,9 @@ describe("api.post FormData Content-Type", () => { // Browser sets multipart/form-data; boundary=... when Content-Type was stripped. // In jsdom/fetch mock the runtime may leave it null or set multipart — both are OK // as long as it is not forced JSON. - if (capturedContentType) { - expect(capturedContentType.toLowerCase()).toContain("multipart/form-data"); + const contentType: string | null = capturedContentType; + if (contentType !== null) { + expect(contentType.toLowerCase()).toContain("multipart/form-data"); } }); });