From 2eab91241566e1f0acf3c89951ab32fffaa7cda4 Mon Sep 17 00:00:00 2001 From: Steve Jensen Date: Wed, 3 Jun 2026 09:24:25 -0600 Subject: [PATCH] chore: relocate Deductions onboarding flow into onboarding/ subfolder Precursor to migrating the Deductions dashboard card into a standalone management block. The top-level `Deductions.tsx` flow (plus its state machine, contextual adapters, and onboarding-only leaf components) now lives under `Deductions/onboarding/`, matching the canonical layout used by Compensation. This frees up `Deductions/management/` for the next PR to land a card-as-block migration without an existing flow in its way. The public surface is preserved: `Deductions/index.ts` re-exports from `./onboarding`, so the `Deductions` named export continues to resolve through `employeeOnboarding.ts` and the deprecated `Employee/index.ts` barrel. No behavior, event, prop, or i18n changes. Co-authored-by: Cursor --- src/components/Employee/Dashboard/DashboardComponents.tsx | 2 +- src/components/Employee/Deductions/index.ts | 2 +- .../Employee/Deductions/{ => onboarding}/Deductions.tsx | 0 .../{ => onboarding}/DeductionsForm/ChildSupportFormView.tsx | 4 ++-- .../{ => onboarding}/DeductionsForm/DeductionsForm.test.tsx | 0 .../{ => onboarding}/DeductionsForm/DeductionsForm.tsx | 0 .../{ => onboarding}/DeductionsForm/StandardDeductionForm.tsx | 4 ++-- .../{ => onboarding}/DeductionsList/DeductionsList.test.tsx | 2 +- .../{ => onboarding}/DeductionsList/DeductionsList.tsx | 4 ++-- .../IncludeDeductions/IncludeDeductions.module.scss | 0 .../IncludeDeductions/IncludeDeductions.test.tsx | 0 .../{ => onboarding}/IncludeDeductions/IncludeDeductions.tsx | 0 .../{ => onboarding}/deductionsContextualComponents.test.tsx | 0 .../{ => onboarding}/deductionsContextualComponents.tsx | 2 +- src/components/Employee/Deductions/onboarding/index.ts | 1 + .../Employee/Deductions/{ => onboarding}/stateMachine.ts | 0 .../OnboardingExecutionFlowComponents.tsx | 2 +- 17 files changed, 12 insertions(+), 11 deletions(-) rename src/components/Employee/Deductions/{ => onboarding}/Deductions.tsx (100%) rename src/components/Employee/Deductions/{ => onboarding}/DeductionsForm/ChildSupportFormView.tsx (97%) rename src/components/Employee/Deductions/{ => onboarding}/DeductionsForm/DeductionsForm.test.tsx (100%) rename src/components/Employee/Deductions/{ => onboarding}/DeductionsForm/DeductionsForm.tsx (100%) rename src/components/Employee/Deductions/{ => onboarding}/DeductionsForm/StandardDeductionForm.tsx (98%) rename src/components/Employee/Deductions/{ => onboarding}/DeductionsList/DeductionsList.test.tsx (97%) rename src/components/Employee/Deductions/{ => onboarding}/DeductionsList/DeductionsList.tsx (95%) rename src/components/Employee/Deductions/{ => onboarding}/IncludeDeductions/IncludeDeductions.module.scss (100%) rename src/components/Employee/Deductions/{ => onboarding}/IncludeDeductions/IncludeDeductions.test.tsx (100%) rename src/components/Employee/Deductions/{ => onboarding}/IncludeDeductions/IncludeDeductions.tsx (100%) rename src/components/Employee/Deductions/{ => onboarding}/deductionsContextualComponents.test.tsx (100%) rename src/components/Employee/Deductions/{ => onboarding}/deductionsContextualComponents.tsx (98%) create mode 100644 src/components/Employee/Deductions/onboarding/index.ts rename src/components/Employee/Deductions/{ => onboarding}/stateMachine.ts (100%) diff --git a/src/components/Employee/Dashboard/DashboardComponents.tsx b/src/components/Employee/Dashboard/DashboardComponents.tsx index 7b8eba5c5..d80cc65d3 100644 --- a/src/components/Employee/Dashboard/DashboardComponents.tsx +++ b/src/components/Employee/Dashboard/DashboardComponents.tsx @@ -10,7 +10,7 @@ import { ProfileEditForm } from '@/components/Employee/Profile/management/Profil import { BankForm } from '@/components/Employee/PaymentMethod/onboarding/BankForm' import { SplitView } from '@/components/Employee/PaymentMethod/onboarding/SplitView' import { DocumentManager } from '@/components/Employee/Documents/management/DocumentManager' -import { DeductionsForm } from '@/components/Employee/Deductions/DeductionsForm/DeductionsForm' +import { DeductionsForm } from '@/components/Employee/Deductions/onboarding/DeductionsForm/DeductionsForm' import { ManagementEditCompensation, ManagementEditPendingCompensation, diff --git a/src/components/Employee/Deductions/index.ts b/src/components/Employee/Deductions/index.ts index 914bfed9f..cb00e1b6d 100644 --- a/src/components/Employee/Deductions/index.ts +++ b/src/components/Employee/Deductions/index.ts @@ -1 +1 @@ -export * from './Deductions' +export * from './onboarding' diff --git a/src/components/Employee/Deductions/Deductions.tsx b/src/components/Employee/Deductions/onboarding/Deductions.tsx similarity index 100% rename from src/components/Employee/Deductions/Deductions.tsx rename to src/components/Employee/Deductions/onboarding/Deductions.tsx diff --git a/src/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.tsx b/src/components/Employee/Deductions/onboarding/DeductionsForm/ChildSupportFormView.tsx similarity index 97% rename from src/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.tsx rename to src/components/Employee/Deductions/onboarding/DeductionsForm/ChildSupportFormView.tsx index efe1b0522..28aeda5d7 100644 --- a/src/components/Employee/Deductions/DeductionsForm/ChildSupportFormView.tsx +++ b/src/components/Employee/Deductions/onboarding/DeductionsForm/ChildSupportFormView.tsx @@ -1,8 +1,8 @@ import { useTranslation } from 'react-i18next' import type { Garnishment } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment' import type { PaymentPeriod } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishmentchildsupport' -import { useChildSupportGarnishmentForm } from '../shared/useChildSupportGarnishmentForm' -import type { StateFieldEntry, CountyEntry } from '../shared/useChildSupportGarnishmentForm' +import { useChildSupportGarnishmentForm } from '../../shared/useChildSupportGarnishmentForm' +import type { StateFieldEntry, CountyEntry } from '../../shared/useChildSupportGarnishmentForm' import { Form } from '@/components/Common/Form' import { ActionsLayout } from '@/components/Common' import { Flex } from '@/components/Common/Flex/Flex' diff --git a/src/components/Employee/Deductions/DeductionsForm/DeductionsForm.test.tsx b/src/components/Employee/Deductions/onboarding/DeductionsForm/DeductionsForm.test.tsx similarity index 100% rename from src/components/Employee/Deductions/DeductionsForm/DeductionsForm.test.tsx rename to src/components/Employee/Deductions/onboarding/DeductionsForm/DeductionsForm.test.tsx diff --git a/src/components/Employee/Deductions/DeductionsForm/DeductionsForm.tsx b/src/components/Employee/Deductions/onboarding/DeductionsForm/DeductionsForm.tsx similarity index 100% rename from src/components/Employee/Deductions/DeductionsForm/DeductionsForm.tsx rename to src/components/Employee/Deductions/onboarding/DeductionsForm/DeductionsForm.tsx diff --git a/src/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.tsx b/src/components/Employee/Deductions/onboarding/DeductionsForm/StandardDeductionForm.tsx similarity index 98% rename from src/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.tsx rename to src/components/Employee/Deductions/onboarding/DeductionsForm/StandardDeductionForm.tsx index ad12d4351..0e8bfef9f 100644 --- a/src/components/Employee/Deductions/DeductionsForm/StandardDeductionForm.tsx +++ b/src/components/Employee/Deductions/onboarding/DeductionsForm/StandardDeductionForm.tsx @@ -5,8 +5,8 @@ import type { GarnishmentType, } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment' import type { Control } from 'react-hook-form' -import { useDeductionForm } from '../shared/useDeductionForm' -import type { DeductionFormData } from '../shared/useDeductionForm' +import { useDeductionForm } from '../../shared/useDeductionForm' +import type { DeductionFormData } from '../../shared/useDeductionForm' import { Form } from '@/components/Common/Form' import { ActionsLayout } from '@/components/Common' import { Flex } from '@/components/Common/Flex/Flex' diff --git a/src/components/Employee/Deductions/DeductionsList/DeductionsList.test.tsx b/src/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.test.tsx similarity index 97% rename from src/components/Employee/Deductions/DeductionsList/DeductionsList.test.tsx rename to src/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.test.tsx index c23b494d6..8190c1fe2 100644 --- a/src/components/Employee/Deductions/DeductionsList/DeductionsList.test.tsx +++ b/src/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.test.tsx @@ -2,7 +2,7 @@ import { describe, expect, it, vi } from 'vitest' import { screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' import type { Garnishment } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment' -import type { UseDeductionsListReady } from '../shared/useDeductionsList' +import type { UseDeductionsListReady } from '../../shared/useDeductionsList' import { DeductionsList } from './DeductionsList' import { renderWithProviders } from '@/test-utils/renderWithProviders' diff --git a/src/components/Employee/Deductions/DeductionsList/DeductionsList.tsx b/src/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.tsx similarity index 95% rename from src/components/Employee/Deductions/DeductionsList/DeductionsList.tsx rename to src/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.tsx index 0864b4bff..1b5c42ddd 100644 --- a/src/components/Employee/Deductions/DeductionsList/DeductionsList.tsx +++ b/src/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.tsx @@ -1,7 +1,7 @@ import { useTranslation } from 'react-i18next' import type { Garnishment } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment' -import type { UseDeductionsListReady } from '../shared/useDeductionsList' -import { formatDeductionAmount } from '../shared/formatDeductionAmount' +import type { UseDeductionsListReady } from '../../shared/useDeductionsList' +import { formatDeductionAmount } from '../../shared/formatDeductionAmount' import { useDataView, DataView } from '@/components/Common' import { ActionsLayout } from '@/components/Common' import { Flex } from '@/components/Common/Flex/Flex' diff --git a/src/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss b/src/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.module.scss similarity index 100% rename from src/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss rename to src/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.module.scss diff --git a/src/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.test.tsx b/src/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.test.tsx similarity index 100% rename from src/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.test.tsx rename to src/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.test.tsx diff --git a/src/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.tsx b/src/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.tsx similarity index 100% rename from src/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.tsx rename to src/components/Employee/Deductions/onboarding/IncludeDeductions/IncludeDeductions.tsx diff --git a/src/components/Employee/Deductions/deductionsContextualComponents.test.tsx b/src/components/Employee/Deductions/onboarding/deductionsContextualComponents.test.tsx similarity index 100% rename from src/components/Employee/Deductions/deductionsContextualComponents.test.tsx rename to src/components/Employee/Deductions/onboarding/deductionsContextualComponents.test.tsx diff --git a/src/components/Employee/Deductions/deductionsContextualComponents.tsx b/src/components/Employee/Deductions/onboarding/deductionsContextualComponents.tsx similarity index 98% rename from src/components/Employee/Deductions/deductionsContextualComponents.tsx rename to src/components/Employee/Deductions/onboarding/deductionsContextualComponents.tsx index bf9f68d7e..f3c6d6b3a 100644 --- a/src/components/Employee/Deductions/deductionsContextualComponents.tsx +++ b/src/components/Employee/Deductions/onboarding/deductionsContextualComponents.tsx @@ -1,8 +1,8 @@ import { type Garnishment } from '@gusto/embedded-api-v-2025-11-15/models/components/garnishment' +import { useDeductionsList } from '../shared/useDeductionsList' import { IncludeDeductions } from './IncludeDeductions/IncludeDeductions' import { DeductionsList } from './DeductionsList/DeductionsList' import { DeductionsForm } from './DeductionsForm/DeductionsForm' -import { useDeductionsList } from './shared/useDeductionsList' import { BaseLayout } from '@/components/Base/Base' import { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow' import { componentEvents } from '@/shared/constants' diff --git a/src/components/Employee/Deductions/onboarding/index.ts b/src/components/Employee/Deductions/onboarding/index.ts new file mode 100644 index 000000000..914bfed9f --- /dev/null +++ b/src/components/Employee/Deductions/onboarding/index.ts @@ -0,0 +1 @@ +export * from './Deductions' diff --git a/src/components/Employee/Deductions/stateMachine.ts b/src/components/Employee/Deductions/onboarding/stateMachine.ts similarity index 100% rename from src/components/Employee/Deductions/stateMachine.ts rename to src/components/Employee/Deductions/onboarding/stateMachine.ts diff --git a/src/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.tsx b/src/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.tsx index 947c55253..666348f5a 100644 --- a/src/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.tsx +++ b/src/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.tsx @@ -1,5 +1,5 @@ import type { PaymentMethodBankAccount } from '@gusto/embedded-api-v-2025-11-15/models/components/paymentmethodbankaccount' -import { Deductions } from '../Deductions/Deductions' +import { Deductions } from '../Deductions/onboarding/Deductions' import { FederalTaxes } from '../FederalTaxes/onboarding/FederalTaxes' import { StateTaxes } from '../StateTaxes/onboarding/StateTaxes' import type { ProfileDefaultValues } from '../Profile/onboarding/Profile'