Skip to content

Commit 858b617

Browse files
authored
fix: update deductions copy and export components (#459)
1 parent c337c71 commit 858b617

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

src/components/Employee/Deductions/Deductions.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import {
99
DeductionsListContextual,
1010
} from './DeductionsComponents'
1111
import { deductionsStateMachine } from './stateMachine'
12+
import { DeductionsForm } from './DeductionsForm/DeductionsForm'
13+
import { DeductionsList } from './DeductionsList/DeductionsList'
14+
import { IncludeDeductionsForm } from './IncludeDeductionsForm/IncludeDeductionsForm'
1215
import { Flow } from '@/components/Flow/Flow'
1316
import { BaseComponent, type BaseComponentInterface } from '@/components/Base'
1417
import { useComponentDictionary } from '@/i18n/I18n'
@@ -78,3 +81,7 @@ export const DeductionsContextual = () => {
7881
}
7982
return <Deductions employeeId={employeeId} onEvent={onEvent} />
8083
}
84+
85+
Deductions.DeductionsForm = DeductionsForm
86+
Deductions.DeductionsList = DeductionsList
87+
Deductions.IncludeDeductionsForm = IncludeDeductionsForm

src/components/Employee/Deductions/DeductionsComponents.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'
22
import { IncludeDeductionsForm } from './IncludeDeductionsForm/IncludeDeductionsForm'
33
import { DeductionsList } from './DeductionsList/DeductionsList'
4-
import { DeductionForm } from './DeductionForm/DeductionForm'
4+
import { DeductionsForm } from './DeductionsForm/DeductionsForm'
55
import { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'
66
import type { componentEvents } from '@/shared/constants'
77
import { ensureRequired } from '@/helpers/ensureRequired'
@@ -39,7 +39,7 @@ export function DeductionFormContextual() {
3939
const { employeeId, onEvent, currentDeductionId } = useFlow<DeductionsContextInterface>()
4040

4141
return (
42-
<DeductionForm
42+
<DeductionsForm
4343
onEvent={onEvent}
4444
employeeId={ensureRequired(employeeId)}
4545
deductionId={currentDeductionId}

src/components/Employee/Deductions/DeductionForm/DeductionForm.tsx renamed to src/components/Employee/Deductions/DeductionsForm/DeductionsForm.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,20 @@ export const DeductionSchema = z.object({
4949
export type DeductionInputs = z.input<typeof DeductionSchema>
5050
export type DeductionPayload = z.output<typeof DeductionSchema>
5151

52-
interface DeductionFormProps extends CommonComponentInterface<'Employee.Deductions'> {
52+
interface DeductionsFormProps extends CommonComponentInterface<'Employee.Deductions'> {
5353
employeeId: string
5454
deductionId?: string | null
5555
}
5656

57-
export function DeductionForm(props: DeductionFormProps & BaseComponentInterface) {
57+
export function DeductionsForm(props: DeductionsFormProps & BaseComponentInterface) {
5858
return (
5959
<BaseComponent {...props}>
6060
<Root {...props}>{props.children}</Root>
6161
</BaseComponent>
6262
)
6363
}
6464

65-
function Root({ className, children, employeeId, deductionId, dictionary }: DeductionFormProps) {
65+
function Root({ className, children, employeeId, deductionId, dictionary }: DeductionsFormProps) {
6666
const { onEvent, baseSubmitHandler } = useBase()
6767
const { t } = useTranslation('Employee.Deductions')
6868
const Components = useComponentContext()

src/i18n/en/Employee.Deductions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"continueCta": "Continue",
88
"addDeductionTitle": "Add Deduction",
99
"editDeductionTitle": "Edit Deduction",
10-
"addDeuctionDescription": "Deductions from employee net pay will start on their next pay period and appear on their paystub and payroll receipts as a separate line item. Note: All deductions are post-tax.",
1110
"descriptionLabel": "Deduction description",
1211
"frequencyLabel": "Deduction frequency",
1312
"frequencyRecurringOption": "This deduction occurs every payroll",
@@ -16,7 +15,7 @@
1615
"deductionTypeLabel": "Deduction type",
1716
"deductionTypePercentageOption": "Percentage",
1817
"deductionTypeFixedAmountOption": "Fixed dollar amount",
19-
"deductionAmountLabel": "Step 4c: Extra withholding",
18+
"deductionAmountLabel": "Amount to withhold",
2019
"annualMaxLabel": "Annual maximum",
2120
"courtOrderedLabel": "This is a court-ordered deduction",
2221
"nameColumn": "Deduction",

src/types/i18next.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,6 @@ export interface EmployeeDeductions{
594594
"continueCta":string;
595595
"addDeductionTitle":string;
596596
"editDeductionTitle":string;
597-
"addDeuctionDescription":string;
598597
"descriptionLabel":string;
599598
"frequencyLabel":string;
600599
"frequencyRecurringOption":string;

0 commit comments

Comments
 (0)