From 1ba7ce000316a550f0e1566a6c3083ea7543b4eb Mon Sep 17 00:00:00 2001 From: "arthur.bassi" Date: Mon, 3 Aug 2026 14:17:36 -0300 Subject: [PATCH] style(work-orders): prettier wizard duplicate dialog files --- .../_components/wizard/new-wo-wizard.tsx | 125 +++++++++--------- .../new-wo-wizard-duplicate.test.tsx | 4 +- 2 files changed, 63 insertions(+), 66 deletions(-) diff --git a/src/app/(protected)/workorders/_components/wizard/new-wo-wizard.tsx b/src/app/(protected)/workorders/_components/wizard/new-wo-wizard.tsx index 123dfd11..c56a78ee 100644 --- a/src/app/(protected)/workorders/_components/wizard/new-wo-wizard.tsx +++ b/src/app/(protected)/workorders/_components/wizard/new-wo-wizard.tsx @@ -162,8 +162,7 @@ export function NewWoWizard({ } }; - const resolveDuplicate = (woNumber: string) => - findDuplicateWoNumberRow(woNumber, existingRows); + const resolveDuplicate = (woNumber: string) => findDuplicateWoNumberRow(woNumber, existingRows); const handleDuplicateFound = (woNumber: string) => { const duplicate = resolveDuplicate(woNumber); @@ -184,75 +183,75 @@ export function NewWoWizard({ return ( <> onOpenChange(false)} - maxWidth={false} - slotProps={{ - ...dialogBlurBackdropSlotProps, - paper: { - className: "flex flex-col overflow-hidden p-0", - style: { - borderRadius: 12, - width: 768, - maxWidth: 768, - height: 680, - maxHeight: 680, + open={open} + onClose={() => onOpenChange(false)} + maxWidth={false} + slotProps={{ + ...dialogBlurBackdropSlotProps, + paper: { + className: "flex flex-col overflow-hidden p-0", + style: { + borderRadius: 12, + width: 768, + maxWidth: 768, + height: 680, + maxHeight: 680, + }, }, - }, - }} - > - Guided setup for creating a new work order + }} + > + Guided setup for creating a new work order -
- +
+ -
- +
+ - {step === 1 && ( - - )} + {step === 1 && ( + + )} - {step === 2 && ( - ({ id: p.id, value: p.value }))} - onUpdate={setField} - onPatch={patchDraft} - /> - )} + {step === 2 && ( + ({ id: p.id, value: p.value }))} + onUpdate={setField} + onPatch={patchDraft} + /> + )} - {step === 3 && ( - - )} + {step === 3 && ( + + )} +
-
- onOpenChange(false)} - onBack={() => setStep((s) => s - 1)} - onContinue={() => setStep((s) => s + 1)} - onCreate={handleCreate} - isCreating={createMutation.isPending} - /> + onOpenChange(false)} + onBack={() => setStep((s) => s - 1)} + onContinue={() => setStep((s) => s + 1)} + onCreate={handleCreate} + isCreating={createMutation.isPending} + />
{ fireEvent.blur(woNumberInput); expect(screen.getByText("Duplicate Work Order Number")).toBeInTheDocument(); - expect( - screen.getByText(/is already assigned to another work order/i), - ).toBeInTheDocument(); + expect(screen.getByText(/is already assigned to another work order/i)).toBeInTheDocument(); }); });