@gusto/embedded-react-sdk 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +20 -4
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +20 -4
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +22 -6
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +20 -4
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +20 -4
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +28 -12
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +23 -7
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +20 -4
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +20 -4
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +20 -4
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +20 -4
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +20 -4
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Contractor/Address/useAddress.js +22 -6
- package/dist/components/Contractor/Address/useAddress.js.map +1 -1
- package/dist/components/Contractor/Profile/useContractorProfile.js +52 -42
- package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.d.ts +11 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +230 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js +8 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js.map +1 -0
- package/dist/components/Employee/Compensation/management/EditCompensation/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/management/index.d.ts +3 -0
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +6 -6
- package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +114 -111
- package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +8 -0
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +22 -17
- package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +12 -2
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +115 -110
- package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
- package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +8 -3
- package/dist/components/Employee/Dashboard/BasicDetailsView.js +108 -84
- package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/Dashboard.d.ts +2 -0
- package/dist/components/Employee/Dashboard/Dashboard.js +64 -58
- package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +5 -1
- package/dist/components/Employee/Dashboard/DashboardComponents.js +82 -65
- package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
- package/dist/components/Employee/Dashboard/DocumentsView.js +18 -11
- package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.js +358 -338
- package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +8 -0
- package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -0
- package/dist/components/Employee/Dashboard/TaxesView.d.ts +7 -2
- package/dist/components/Employee/Dashboard/TaxesView.js +68 -54
- package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js +16 -5
- package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +12 -5
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +21 -21
- package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +13 -3
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +55 -56
- package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +10 -4
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +10 -12
- package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +10 -3
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +19 -14
- package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -1
- package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
- package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +20 -4
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
- package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
- package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
- package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
- package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
- package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
- package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
- package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
- package/dist/components/Employee/Taxes/useTaxes.js +20 -4
- package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +34 -26
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +36 -22
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +52 -40
- package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
- package/dist/i18n/en/Employee.Compensation.json.js +48 -44
- package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
- package/dist/i18n/en/Employee.Dashboard.json.js +1 -1
- package/dist/i18n/en/Employee.DocumentManager.json.js +1 -1
- package/dist/i18n/en/common.json.d.ts +7 -0
- package/dist/shared/constants.d.ts +2 -0
- package/dist/shared/constants.js +19 -18
- package/dist/shared/constants.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/i18next.d.ts +22 -2
- package/package.json +1 -1
|
@@ -1,38 +1,52 @@
|
|
|
1
|
-
import { useState as M, useRef as
|
|
1
|
+
import { useState as M, useRef as m, useMemo as _, useCallback as y, useEffect as b } from "react";
|
|
2
2
|
import { usePayrollsPrepareMutation as L } from "@gusto/embedded-api/react-query/payrollsPrepare";
|
|
3
3
|
import { usePaySchedulesGet as D } from "@gusto/embedded-api/react-query/paySchedulesGet";
|
|
4
4
|
import { UnprocessableEntityError as T } from "@gusto/embedded-api/models/errors/unprocessableentityerror";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "react-error-boundary";
|
|
7
|
+
import "react-i18next";
|
|
8
|
+
import "@tanstack/react-query";
|
|
5
9
|
import { useBase as w } from "../Base/useBase.js";
|
|
10
|
+
import "@gusto/embedded-api/models/errors/apierror";
|
|
11
|
+
import "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
12
|
+
import "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
13
|
+
import "@gusto/embedded-api/models/errors/httpclienterrors";
|
|
14
|
+
import "dompurify";
|
|
15
|
+
import "../../contexts/LocaleProvider/useLocale.js";
|
|
16
|
+
import "../../shared/constants.js";
|
|
17
|
+
import "classnames";
|
|
18
|
+
import "../../contexts/ComponentAdapter/useComponentContext.js";
|
|
19
|
+
import "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
|
|
6
20
|
import { retryAsync as x } from "../../helpers/retryAsync.js";
|
|
7
|
-
const q = 4, v = 1500, B = (e) => e instanceof T ? e.errors.some((r) => r.category === "invalid_operation") : !1,
|
|
21
|
+
const q = 4, v = 1500, B = (e) => e instanceof T ? e.errors.some((r) => r.category === "invalid_operation") : !1, ee = ({
|
|
8
22
|
companyId: e,
|
|
9
23
|
payrollId: r,
|
|
10
|
-
employeeUuids:
|
|
11
|
-
sortBy:
|
|
24
|
+
employeeUuids: a,
|
|
25
|
+
sortBy: n,
|
|
12
26
|
onDataReady: l
|
|
13
27
|
}) => {
|
|
14
|
-
const { mutateAsync:
|
|
28
|
+
const { mutateAsync: p, isPending: c } = L(), [o, f] = M(), t = m(!1), u = m(!1), { baseSubmitHandler: d } = w(), h = _(() => a?.join(",") ?? "", [a]), { data: S, isLoading: E } = D(
|
|
15
29
|
{
|
|
16
30
|
companyId: e,
|
|
17
|
-
payScheduleId:
|
|
31
|
+
payScheduleId: o?.payPeriod?.payScheduleUuid || ""
|
|
18
32
|
},
|
|
19
33
|
{
|
|
20
|
-
enabled: !!
|
|
34
|
+
enabled: !!o?.payPeriod?.payScheduleUuid
|
|
21
35
|
}
|
|
22
|
-
), P =
|
|
23
|
-
const
|
|
36
|
+
), P = y(async () => {
|
|
37
|
+
const s = await p({
|
|
24
38
|
request: {
|
|
25
39
|
companyId: e,
|
|
26
40
|
payrollId: r,
|
|
27
|
-
sortBy:
|
|
41
|
+
sortBy: n,
|
|
28
42
|
requestBody: {
|
|
29
|
-
employeeUuids:
|
|
43
|
+
employeeUuids: a
|
|
30
44
|
}
|
|
31
45
|
}
|
|
32
46
|
});
|
|
33
|
-
|
|
34
|
-
}, [e, r,
|
|
35
|
-
await
|
|
47
|
+
f(s.payrollPrepared), s.payrollPrepared && (t.current = !0, l?.(s.payrollPrepared));
|
|
48
|
+
}, [e, r, p, h, n, l]), i = y(async () => {
|
|
49
|
+
await d(
|
|
36
50
|
null,
|
|
37
51
|
() => x(P, {
|
|
38
52
|
maxAttempts: q,
|
|
@@ -40,21 +54,21 @@ const q = 4, v = 1500, B = (e) => e instanceof T ? e.errors.some((r) => r.catego
|
|
|
40
54
|
shouldRetry: B
|
|
41
55
|
})
|
|
42
56
|
);
|
|
43
|
-
}, [
|
|
57
|
+
}, [d, P]);
|
|
44
58
|
b(() => {
|
|
45
|
-
|
|
46
|
-
}, [
|
|
47
|
-
const g =
|
|
59
|
+
u.current || (u.current = !0, i());
|
|
60
|
+
}, [i]);
|
|
61
|
+
const g = c && !t.current, R = c && t.current, A = g || E;
|
|
48
62
|
return {
|
|
49
|
-
handlePreparePayroll:
|
|
50
|
-
preparedPayroll:
|
|
63
|
+
handlePreparePayroll: i,
|
|
64
|
+
preparedPayroll: o,
|
|
51
65
|
paySchedule: S?.payScheduleShow,
|
|
52
66
|
isLoading: A,
|
|
53
67
|
isPaginating: R,
|
|
54
|
-
hasInitialData:
|
|
68
|
+
hasInitialData: t.current
|
|
55
69
|
};
|
|
56
70
|
};
|
|
57
71
|
export {
|
|
58
|
-
|
|
72
|
+
ee as usePreparedPayrollData
|
|
59
73
|
};
|
|
60
74
|
//# sourceMappingURL=usePreparedPayrollData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport type { QueryParamSortBy } from '@gusto/embedded-api/models/operations/putv1companiescompanyidpayrollspayrollidprepare'\nimport { UnprocessableEntityError } from '@gusto/embedded-api/models/errors/unprocessableentityerror'\nimport { useBase } from '../Base'\nimport { retryAsync } from '@/helpers/retryAsync'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: QueryParamSortBy\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleShow | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nconst PREPARE_MAX_ATTEMPTS = 4\nconst PREPARE_RETRY_DELAY_MS = 1500\n\nconst isPayrollBeingProcessedError = (error: unknown): boolean => {\n if (!(error instanceof UnprocessableEntityError)) return false\n return error.errors.some(e => e.category === 'invalid_operation')\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const hasFiredRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const executePrepare = useCallback(async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n }, [companyId, payrollId, preparePayroll, employeeUuidsKey, sortBy, onDataReady])\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, () =>\n retryAsync(executePrepare, {\n maxAttempts: PREPARE_MAX_ATTEMPTS,\n delayMs: PREPARE_RETRY_DELAY_MS,\n shouldRetry: isPayrollBeingProcessedError,\n }),\n )\n }, [baseSubmitHandler, executePrepare])\n\n useEffect(() => {\n if (hasFiredRef.current) return\n hasFiredRef.current = true\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleShow,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["PREPARE_MAX_ATTEMPTS","PREPARE_RETRY_DELAY_MS","isPayrollBeingProcessedError","error","UnprocessableEntityError","e","usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","hasFiredRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","executePrepare","useCallback","result","handlePreparePayroll","retryAsync","useEffect","isInitialLoading","isPaginating","isLoading"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef, useMemo } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport type { QueryParamSortBy } from '@gusto/embedded-api/models/operations/putv1companiescompanyidpayrollspayrollidprepare'\nimport { UnprocessableEntityError } from '@gusto/embedded-api/models/errors/unprocessableentityerror'\nimport { useBase } from '../Base'\nimport { retryAsync } from '@/helpers/retryAsync'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: QueryParamSortBy\n onDataReady?: (preparedPayroll: PayrollPrepared) => void\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleShow | undefined\n isLoading: boolean\n isPaginating: boolean\n hasInitialData: boolean\n}\n\nconst PREPARE_MAX_ATTEMPTS = 4\nconst PREPARE_RETRY_DELAY_MS = 1500\n\nconst isPayrollBeingProcessedError = (error: unknown): boolean => {\n if (!(error instanceof UnprocessableEntityError)) return false\n return error.errors.some(e => e.category === 'invalid_operation')\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n onDataReady,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const hasInitialDataRef = useRef(false)\n const hasFiredRef = useRef(false)\n const { baseSubmitHandler } = useBase()\n\n const employeeUuidsKey = useMemo(() => employeeUuids?.join(',') ?? '', [employeeUuids])\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const executePrepare = useCallback(async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n if (result.payrollPrepared) {\n hasInitialDataRef.current = true\n onDataReady?.(result.payrollPrepared)\n }\n }, [companyId, payrollId, preparePayroll, employeeUuidsKey, sortBy, onDataReady])\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, () =>\n retryAsync(executePrepare, {\n maxAttempts: PREPARE_MAX_ATTEMPTS,\n delayMs: PREPARE_RETRY_DELAY_MS,\n shouldRetry: isPayrollBeingProcessedError,\n }),\n )\n }, [baseSubmitHandler, executePrepare])\n\n useEffect(() => {\n if (hasFiredRef.current) return\n hasFiredRef.current = true\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isInitialLoading = isPreparePayrollPending && !hasInitialDataRef.current\n const isPaginating = isPreparePayrollPending && hasInitialDataRef.current\n const isLoading = isInitialLoading || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleShow,\n isLoading,\n isPaginating,\n hasInitialData: hasInitialDataRef.current,\n }\n}\n"],"names":["PREPARE_MAX_ATTEMPTS","PREPARE_RETRY_DELAY_MS","isPayrollBeingProcessedError","error","UnprocessableEntityError","e","usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","onDataReady","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","hasInitialDataRef","useRef","hasFiredRef","baseSubmitHandler","useBase","employeeUuidsKey","useMemo","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","executePrepare","useCallback","result","handlePreparePayroll","retryAsync","useEffect","isInitialLoading","isPaginating","isLoading"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,MAAMA,IAAuB,GACvBC,IAAyB,MAEzBC,IAA+B,CAACC,MAC9BA,aAAiBC,IAChBD,EAAM,OAAO,KAAK,CAAAE,MAAKA,EAAE,aAAa,mBAAmB,IADP,IAI9CC,KAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxCC,IAAoBC,EAAO,EAAK,GAChCC,IAAcD,EAAO,EAAK,GAC1B,EAAE,mBAAAE,EAAA,IAAsBC,EAAA,GAExBC,IAAmBC,EAAQ,MAAMf,GAAe,KAAK,GAAG,KAAK,IAAI,CAACA,CAAa,CAAC,GAEhF,E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jsxs as l, Fragment as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { useForm as k, useWatch as s, FormProvider as
|
|
4
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as e, jsxs as l, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { useId as t } from "react";
|
|
3
|
+
import { useForm as k, useWatch as s, FormProvider as U } from "react-hook-form";
|
|
4
|
+
import { useTranslation as W } from "react-i18next";
|
|
5
|
+
import { z as n } from "zod";
|
|
6
|
+
import { zodResolver as _ } from "@hookform/resolvers/zod";
|
|
5
7
|
import a from "./PolicySettings.module.scss.js";
|
|
6
|
-
import { Flex as
|
|
8
|
+
import { Flex as L } from "../../Common/Flex/Flex.js";
|
|
7
9
|
import "classnames";
|
|
8
10
|
import "../../../shared/constants.js";
|
|
9
|
-
import { ActionsLayout as
|
|
10
|
-
import { Form as
|
|
11
|
-
import { useComponentContext as
|
|
12
|
-
import { useI18n as
|
|
11
|
+
import { ActionsLayout as j } from "../../Common/ActionsLayout/ActionsLayout.js";
|
|
12
|
+
import { Form as z } from "../../Common/Form/Form.js";
|
|
13
|
+
import { useComponentContext as A } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import { useI18n as B } from "../../../i18n/I18n.js";
|
|
13
15
|
import { NumberInputField as c } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
14
|
-
import { SwitchField as
|
|
15
|
-
|
|
16
|
+
import { SwitchField as r } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
17
|
+
const q = n.object({
|
|
18
|
+
accrualMaximumEnabled: n.boolean(),
|
|
19
|
+
accrualMaximum: n.number().optional(),
|
|
20
|
+
balanceMaximumEnabled: n.boolean(),
|
|
21
|
+
balanceMaximum: n.number().optional(),
|
|
22
|
+
carryOverLimitEnabled: n.boolean(),
|
|
23
|
+
carryOverLimit: n.number().optional(),
|
|
24
|
+
waitingPeriodEnabled: n.boolean(),
|
|
25
|
+
waitingPeriod: n.number().int().optional(),
|
|
26
|
+
paidOutOnTermination: n.boolean()
|
|
27
|
+
});
|
|
28
|
+
function si({
|
|
16
29
|
accrualMethod: d,
|
|
17
|
-
onContinue:
|
|
30
|
+
onContinue: M,
|
|
18
31
|
onBack: E,
|
|
19
|
-
defaultValues:
|
|
32
|
+
defaultValues: P,
|
|
20
33
|
mode: w,
|
|
21
34
|
editingPolicyName: u,
|
|
22
|
-
isPending:
|
|
35
|
+
isPending: b = !1
|
|
23
36
|
}) {
|
|
24
|
-
|
|
25
|
-
const { t: i } =
|
|
37
|
+
B("Company.TimeOff.CreateTimeOffPolicy");
|
|
38
|
+
const { t: i } = W("Company.TimeOff.CreateTimeOffPolicy"), { Heading: N, Button: p } = A(), g = t(), y = t(), h = t(), f = t(), x = t(), m = k({
|
|
39
|
+
resolver: _(q),
|
|
26
40
|
defaultValues: {
|
|
27
41
|
accrualMaximumEnabled: !1,
|
|
28
42
|
balanceMaximumEnabled: !1,
|
|
29
43
|
carryOverLimitEnabled: !1,
|
|
30
44
|
waitingPeriodEnabled: !1,
|
|
31
45
|
paidOutOnTermination: !1,
|
|
32
|
-
...
|
|
46
|
+
...P
|
|
33
47
|
}
|
|
34
|
-
}), { control:
|
|
35
|
-
|
|
48
|
+
}), { control: o } = m, H = s({ control: o, name: "accrualMaximumEnabled" }), C = s({ control: o, name: "balanceMaximumEnabled" }), F = s({ control: o, name: "carryOverLimitEnabled" }), I = s({ control: o, name: "waitingPeriodEnabled" }), S = d === "hours_worked", v = d === "fixed_per_pay_period", T = S || v, D = S || v, R = (V) => {
|
|
49
|
+
M(V);
|
|
36
50
|
};
|
|
37
|
-
return /* @__PURE__ */ e(
|
|
38
|
-
/* @__PURE__ */ e(
|
|
39
|
-
/* @__PURE__ */ l(
|
|
40
|
-
T && /* @__PURE__ */ l(
|
|
51
|
+
return /* @__PURE__ */ e(U, { ...m, children: /* @__PURE__ */ e(z, { "aria-labelledby": g, onSubmit: m.handleSubmit(R), children: /* @__PURE__ */ e("div", { className: a.policySettings, children: /* @__PURE__ */ l(L, { flexDirection: "column", gap: 32, children: [
|
|
52
|
+
/* @__PURE__ */ e(N, { as: "h2", id: g, children: w === "edit" && u ? i("policySettings.editTitle", { name: u }) : i("policySettings.createTitle") }),
|
|
53
|
+
/* @__PURE__ */ l(L, { flexDirection: "column", gap: 20, children: [
|
|
54
|
+
T && /* @__PURE__ */ l(O, { children: [
|
|
41
55
|
/* @__PURE__ */ l("div", { className: a.settingRow, children: [
|
|
42
56
|
/* @__PURE__ */ e(
|
|
43
57
|
c,
|
|
@@ -49,13 +63,13 @@ function li({
|
|
|
49
63
|
description: i("policySettings.accrualMaximumHint"),
|
|
50
64
|
adornmentEnd: i("policySettings.hoursUnit"),
|
|
51
65
|
placeholder: i("policySettings.numberOfHoursPlaceholder"),
|
|
52
|
-
isDisabled: !
|
|
66
|
+
isDisabled: !H,
|
|
53
67
|
min: 0,
|
|
54
68
|
max: 2e4
|
|
55
69
|
}
|
|
56
70
|
),
|
|
57
71
|
/* @__PURE__ */ e("div", { className: a.toggleCell, children: /* @__PURE__ */ e(
|
|
58
|
-
|
|
72
|
+
r,
|
|
59
73
|
{
|
|
60
74
|
name: "accrualMaximumEnabled",
|
|
61
75
|
label: i("policySettings.accrualMaximumLabel"),
|
|
@@ -77,13 +91,13 @@ function li({
|
|
|
77
91
|
description: i("policySettings.balanceMaximumHint"),
|
|
78
92
|
adornmentEnd: i("policySettings.hoursUnit"),
|
|
79
93
|
placeholder: i("policySettings.numberOfHoursPlaceholder"),
|
|
80
|
-
isDisabled: !
|
|
94
|
+
isDisabled: !C,
|
|
81
95
|
min: 0,
|
|
82
96
|
max: 2e4
|
|
83
97
|
}
|
|
84
98
|
),
|
|
85
99
|
/* @__PURE__ */ e("div", { className: a.toggleCell, children: /* @__PURE__ */ e(
|
|
86
|
-
|
|
100
|
+
r,
|
|
87
101
|
{
|
|
88
102
|
name: "balanceMaximumEnabled",
|
|
89
103
|
label: i("policySettings.balanceMaximumLabel"),
|
|
@@ -104,13 +118,13 @@ function li({
|
|
|
104
118
|
description: i("policySettings.carryOverLimitHint"),
|
|
105
119
|
adornmentEnd: i("policySettings.hoursUnit"),
|
|
106
120
|
placeholder: i("policySettings.numberOfHoursPlaceholder"),
|
|
107
|
-
isDisabled: !
|
|
121
|
+
isDisabled: !F,
|
|
108
122
|
min: 0,
|
|
109
123
|
max: 2e4
|
|
110
124
|
}
|
|
111
125
|
),
|
|
112
126
|
/* @__PURE__ */ e("div", { className: a.toggleCell, children: /* @__PURE__ */ e(
|
|
113
|
-
|
|
127
|
+
r,
|
|
114
128
|
{
|
|
115
129
|
name: "carryOverLimitEnabled",
|
|
116
130
|
label: i("policySettings.carryOverLimitLabel"),
|
|
@@ -120,7 +134,7 @@ function li({
|
|
|
120
134
|
) })
|
|
121
135
|
] }),
|
|
122
136
|
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
123
|
-
D && /* @__PURE__ */ l(
|
|
137
|
+
D && /* @__PURE__ */ l(O, { children: [
|
|
124
138
|
/* @__PURE__ */ l("div", { className: a.settingRow, children: [
|
|
125
139
|
/* @__PURE__ */ e(
|
|
126
140
|
c,
|
|
@@ -132,17 +146,15 @@ function li({
|
|
|
132
146
|
description: i("policySettings.waitingPeriodHint"),
|
|
133
147
|
adornmentEnd: i("policySettings.daysUnit"),
|
|
134
148
|
placeholder: i("policySettings.numberOfDaysPlaceholder"),
|
|
135
|
-
isDisabled: !
|
|
149
|
+
isDisabled: !I,
|
|
136
150
|
min: 0,
|
|
137
151
|
max: 2e4,
|
|
138
152
|
maximumFractionDigits: 0,
|
|
139
|
-
|
|
140
|
-
validate: (o) => S && !isNaN(o) && !Number.isInteger(o) ? i("policySettings.errors.waitingPeriodMustBeWholeNumber") : !0
|
|
141
|
-
}
|
|
153
|
+
errorMessage: i("policySettings.errors.waitingPeriodMustBeWholeNumber")
|
|
142
154
|
}
|
|
143
155
|
),
|
|
144
156
|
/* @__PURE__ */ e("div", { className: a.toggleCell, children: /* @__PURE__ */ e(
|
|
145
|
-
|
|
157
|
+
r,
|
|
146
158
|
{
|
|
147
159
|
name: "waitingPeriodEnabled",
|
|
148
160
|
label: i("policySettings.waitingPeriodLabel"),
|
|
@@ -154,7 +166,7 @@ function li({
|
|
|
154
166
|
/* @__PURE__ */ e("hr", { className: a.divider })
|
|
155
167
|
] }),
|
|
156
168
|
/* @__PURE__ */ e(
|
|
157
|
-
|
|
169
|
+
r,
|
|
158
170
|
{
|
|
159
171
|
name: "paidOutOnTermination",
|
|
160
172
|
label: i("policySettings.paidOutOnTerminationLabel"),
|
|
@@ -162,14 +174,14 @@ function li({
|
|
|
162
174
|
}
|
|
163
175
|
),
|
|
164
176
|
/* @__PURE__ */ e("hr", { className: a.divider }),
|
|
165
|
-
/* @__PURE__ */ l(
|
|
166
|
-
/* @__PURE__ */ e(
|
|
167
|
-
/* @__PURE__ */ e(
|
|
177
|
+
/* @__PURE__ */ l(j, { children: [
|
|
178
|
+
/* @__PURE__ */ e(p, { variant: "secondary", onClick: E, isDisabled: b, children: i("backCta") }),
|
|
179
|
+
/* @__PURE__ */ e(p, { variant: "primary", type: "submit", isLoading: b, children: i("policySettings.continueCta") })
|
|
168
180
|
] })
|
|
169
181
|
] })
|
|
170
182
|
] }) }) }) });
|
|
171
183
|
}
|
|
172
184
|
export {
|
|
173
|
-
|
|
185
|
+
si as PolicySettingsPresentation
|
|
174
186
|
};
|
|
175
187
|
//# sourceMappingURL=PolicySettingsPresentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicySettingsPresentation.js","sources":["../../../../src/components/TimeOff/PolicySettings/PolicySettingsPresentation.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { PolicySettingsFormData, PolicySettingsPresentationProps } from './PolicySettingsTypes'\nimport styles from './PolicySettings.module.scss'\nimport { Flex, ActionsLayout, NumberInputField, SwitchField } from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport function PolicySettingsPresentation({\n accrualMethod,\n onContinue,\n onBack,\n defaultValues,\n mode,\n editingPolicyName,\n isPending = false,\n}: PolicySettingsPresentationProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { Heading, Button } = useComponentContext()\n const headingId = useId()\n\n const accrualMaxInputId = useId()\n const balanceMaxInputId = useId()\n const carryOverInputId = useId()\n const waitingPeriodInputId = useId()\n\n const formMethods = useForm<PolicySettingsFormData>({\n defaultValues: {\n accrualMaximumEnabled: false,\n balanceMaximumEnabled: false,\n carryOverLimitEnabled: false,\n waitingPeriodEnabled: false,\n paidOutOnTermination: false,\n ...defaultValues,\n },\n })\n\n const { control } = formMethods\n const accrualMaximumEnabled = useWatch({ control, name: 'accrualMaximumEnabled' })\n const balanceMaximumEnabled = useWatch({ control, name: 'balanceMaximumEnabled' })\n const carryOverLimitEnabled = useWatch({ control, name: 'carryOverLimitEnabled' })\n const waitingPeriodEnabled = useWatch({ control, name: 'waitingPeriodEnabled' })\n\n const isHoursWorked = accrualMethod === 'hours_worked'\n const isFixedPerPayPeriod = accrualMethod === 'fixed_per_pay_period'\n const showAccrualMaximum = isHoursWorked || isFixedPerPayPeriod\n const showWaitingPeriod = isHoursWorked || isFixedPerPayPeriod\n\n const handleSubmit = (data: PolicySettingsFormData) => {\n onContinue(data)\n }\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm aria-labelledby={headingId} onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <div className={styles.policySettings}>\n <Flex flexDirection=\"column\" gap={32}>\n <Heading as=\"h2\" id={headingId}>\n {mode === 'edit' && editingPolicyName\n ? t('policySettings.editTitle', { name: editingPolicyName })\n : t('policySettings.createTitle')}\n </Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {showAccrualMaximum && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={accrualMaxInputId}\n name=\"accrualMaximum\"\n label={t('policySettings.accrualMaximumLabel')}\n description={t('policySettings.accrualMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!accrualMaximumEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"accrualMaximumEnabled\"\n label={t('policySettings.accrualMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={accrualMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={balanceMaxInputId}\n name=\"balanceMaximum\"\n label={t('policySettings.balanceMaximumLabel')}\n description={t('policySettings.balanceMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!balanceMaximumEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"balanceMaximumEnabled\"\n label={t('policySettings.balanceMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={balanceMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={carryOverInputId}\n name=\"carryOverLimit\"\n label={t('policySettings.carryOverLimitLabel')}\n description={t('policySettings.carryOverLimitHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!carryOverLimitEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"carryOverLimitEnabled\"\n label={t('policySettings.carryOverLimitLabel')}\n shouldVisuallyHideLabel\n aria-controls={carryOverInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n {showWaitingPeriod && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={waitingPeriodInputId}\n name=\"waitingPeriod\"\n label={t('policySettings.waitingPeriodLabel')}\n description={t('policySettings.waitingPeriodHint')}\n adornmentEnd={t('policySettings.daysUnit')}\n placeholder={t('policySettings.numberOfDaysPlaceholder')}\n isDisabled={!waitingPeriodEnabled}\n min={0}\n max={20000}\n maximumFractionDigits={0}\n rules={{\n validate: (value: number) => {\n if (waitingPeriodEnabled && !isNaN(value) && !Number.isInteger(value)) {\n return t('policySettings.errors.waitingPeriodMustBeWholeNumber')\n }\n return true\n },\n }}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"waitingPeriodEnabled\"\n label={t('policySettings.waitingPeriodLabel')}\n shouldVisuallyHideLabel\n aria-controls={waitingPeriodInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <SwitchField\n name=\"paidOutOnTermination\"\n label={t('policySettings.paidOutOnTerminationLabel')}\n description={t('policySettings.paidOutOnTerminationHint')}\n />\n\n <hr className={styles.divider} />\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onBack} isDisabled={isPending}>\n {t('backCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\" isLoading={isPending}>\n {t('policySettings.continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n </div>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicySettingsPresentation","accrualMethod","onContinue","onBack","defaultValues","mode","editingPolicyName","isPending","useI18n","t","useTranslation","Heading","Button","useComponentContext","headingId","useId","accrualMaxInputId","balanceMaxInputId","carryOverInputId","waitingPeriodInputId","formMethods","useForm","control","accrualMaximumEnabled","useWatch","balanceMaximumEnabled","carryOverLimitEnabled","waitingPeriodEnabled","isHoursWorked","isFixedPerPayPeriod","showAccrualMaximum","showWaitingPeriod","handleSubmit","data","jsx","FormProvider","HtmlForm","styles","Flex","jsxs","Fragment","NumberInputField","SwitchField","value","ActionsLayout"],"mappings":";;;;;;;;;;;;;;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,QACA,gBAAAyB,EAACtB,GAAA,EAAO,SAAQ,WAAU,MAAK,UAAS,WAAWL,GAChD,UAAAE,EAAE,4BAA4B,EAAA,CACjC;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"PolicySettingsPresentation.js","sources":["../../../../src/components/TimeOff/PolicySettings/PolicySettingsPresentation.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport type { PolicySettingsFormData, PolicySettingsPresentationProps } from './PolicySettingsTypes'\nimport styles from './PolicySettings.module.scss'\nimport { Flex, ActionsLayout, NumberInputField, SwitchField } from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nconst PolicySettingsSchema = z.object({\n accrualMaximumEnabled: z.boolean(),\n accrualMaximum: z.number().optional(),\n balanceMaximumEnabled: z.boolean(),\n balanceMaximum: z.number().optional(),\n carryOverLimitEnabled: z.boolean(),\n carryOverLimit: z.number().optional(),\n waitingPeriodEnabled: z.boolean(),\n waitingPeriod: z.number().int().optional(),\n paidOutOnTermination: z.boolean(),\n})\n\nexport function PolicySettingsPresentation({\n accrualMethod,\n onContinue,\n onBack,\n defaultValues,\n mode,\n editingPolicyName,\n isPending = false,\n}: PolicySettingsPresentationProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { Heading, Button } = useComponentContext()\n const headingId = useId()\n\n const accrualMaxInputId = useId()\n const balanceMaxInputId = useId()\n const carryOverInputId = useId()\n const waitingPeriodInputId = useId()\n\n const formMethods = useForm<PolicySettingsFormData>({\n resolver: zodResolver(PolicySettingsSchema),\n defaultValues: {\n accrualMaximumEnabled: false,\n balanceMaximumEnabled: false,\n carryOverLimitEnabled: false,\n waitingPeriodEnabled: false,\n paidOutOnTermination: false,\n ...defaultValues,\n },\n })\n\n const { control } = formMethods\n const accrualMaximumEnabled = useWatch({ control, name: 'accrualMaximumEnabled' })\n const balanceMaximumEnabled = useWatch({ control, name: 'balanceMaximumEnabled' })\n const carryOverLimitEnabled = useWatch({ control, name: 'carryOverLimitEnabled' })\n const waitingPeriodEnabled = useWatch({ control, name: 'waitingPeriodEnabled' })\n\n const isHoursWorked = accrualMethod === 'hours_worked'\n const isFixedPerPayPeriod = accrualMethod === 'fixed_per_pay_period'\n const showAccrualMaximum = isHoursWorked || isFixedPerPayPeriod\n const showWaitingPeriod = isHoursWorked || isFixedPerPayPeriod\n\n const handleSubmit = (data: PolicySettingsFormData) => {\n onContinue(data)\n }\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm aria-labelledby={headingId} onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <div className={styles.policySettings}>\n <Flex flexDirection=\"column\" gap={32}>\n <Heading as=\"h2\" id={headingId}>\n {mode === 'edit' && editingPolicyName\n ? t('policySettings.editTitle', { name: editingPolicyName })\n : t('policySettings.createTitle')}\n </Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n {showAccrualMaximum && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={accrualMaxInputId}\n name=\"accrualMaximum\"\n label={t('policySettings.accrualMaximumLabel')}\n description={t('policySettings.accrualMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!accrualMaximumEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"accrualMaximumEnabled\"\n label={t('policySettings.accrualMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={accrualMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={balanceMaxInputId}\n name=\"balanceMaximum\"\n label={t('policySettings.balanceMaximumLabel')}\n description={t('policySettings.balanceMaximumHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!balanceMaximumEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"balanceMaximumEnabled\"\n label={t('policySettings.balanceMaximumLabel')}\n shouldVisuallyHideLabel\n aria-controls={balanceMaxInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={carryOverInputId}\n name=\"carryOverLimit\"\n label={t('policySettings.carryOverLimitLabel')}\n description={t('policySettings.carryOverLimitHint')}\n adornmentEnd={t('policySettings.hoursUnit')}\n placeholder={t('policySettings.numberOfHoursPlaceholder')}\n isDisabled={!carryOverLimitEnabled}\n min={0}\n max={20000}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"carryOverLimitEnabled\"\n label={t('policySettings.carryOverLimitLabel')}\n shouldVisuallyHideLabel\n aria-controls={carryOverInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n\n {showWaitingPeriod && (\n <>\n <div className={styles.settingRow}>\n <NumberInputField\n className={styles.settingField}\n id={waitingPeriodInputId}\n name=\"waitingPeriod\"\n label={t('policySettings.waitingPeriodLabel')}\n description={t('policySettings.waitingPeriodHint')}\n adornmentEnd={t('policySettings.daysUnit')}\n placeholder={t('policySettings.numberOfDaysPlaceholder')}\n isDisabled={!waitingPeriodEnabled}\n min={0}\n max={20000}\n maximumFractionDigits={0}\n errorMessage={t('policySettings.errors.waitingPeriodMustBeWholeNumber')}\n />\n <div className={styles.toggleCell}>\n <SwitchField\n name=\"waitingPeriodEnabled\"\n label={t('policySettings.waitingPeriodLabel')}\n shouldVisuallyHideLabel\n aria-controls={waitingPeriodInputId}\n />\n </div>\n </div>\n\n <hr className={styles.divider} />\n </>\n )}\n\n <SwitchField\n name=\"paidOutOnTermination\"\n label={t('policySettings.paidOutOnTerminationLabel')}\n description={t('policySettings.paidOutOnTerminationHint')}\n />\n\n <hr className={styles.divider} />\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onBack} isDisabled={isPending}>\n {t('backCta')}\n </Button>\n <Button variant=\"primary\" type=\"submit\" isLoading={isPending}>\n {t('policySettings.continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n </div>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicySettingsSchema","z","PolicySettingsPresentation","accrualMethod","onContinue","onBack","defaultValues","mode","editingPolicyName","isPending","useI18n","t","useTranslation","Heading","Button","useComponentContext","headingId","useId","accrualMaxInputId","balanceMaxInputId","carryOverInputId","waitingPeriodInputId","formMethods","useForm","zodResolver","control","accrualMaximumEnabled","useWatch","balanceMaximumEnabled","carryOverLimitEnabled","waitingPeriodEnabled","isHoursWorked","isFixedPerPayPeriod","showAccrualMaximum","showWaitingPeriod","handleSubmit","data","jsx","FormProvider","HtmlForm","styles","Flex","jsxs","Fragment","NumberInputField","SwitchField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;AAYA,MAAMA,IAAuBC,EAAE,OAAO;AAAA,EACpC,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,uBAAuBA,EAAE,QAAA;AAAA,EACzB,gBAAgBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC3B,sBAAsBA,EAAE,QAAA;AAAA,EACxB,eAAeA,EAAE,OAAA,EAAS,IAAA,EAAM,SAAA;AAAA,EAChC,sBAAsBA,EAAE,QAAA;AAC1B,CAAC;AAEM,SAASC,GAA2B;AAAA,EACz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AAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -1,66 +1,70 @@
|
|
|
1
|
-
const e = "+ Add another job", t = "Adjust for minimum wage", o = "Determines whether the compensation should be adjusted for minimum wage. Only applies to Nonexempt employees.", a = "Minimum wage",
|
|
1
|
+
const e = "+ Add another job", t = "Adjust for minimum wage", o = "Determines whether the compensation should be adjusted for minimum wage. Only applies to Nonexempt employees.", a = "Minimum wage", i = "What minimum wage requirement should compensation be adjusted to", n = { amountColumn: "Amount", deleteCta: "Delete", editCta: "Edit", jobColumn: "Job title", perColumn: "Per", tableLabel: "List of all jobs for the employee", typeColumn: "Pay type" }, s = "Compensation amount", l = "Back", c = "Cancel", m = "Cancel", r = '<ClassificationLink href="https://support.gusto.com/team-management/team-payments/pay-rates/1001671771/Employee-classification-options.htm" target="_blank">Learn more about employee classifications.</ClassificationLink>', d = "Employee type", p = { "Commission Only Exempt": "Commission Only/No Overtime", "Commission Only Nonexempt": "Commission Only/Eligible for overtime", Exempt: "Salary/No overtime", Nonexempt: "Paid by the hour", Owner: "Owner's draw", "Salaried Nonexempt": "Salary/Eligible for overtime" }, h = "Job actions", u = "Job Title", y = "The period over which the compensation amount is tracked (e.g., hourly, daily, weekly, monthly, annually).", f = "Per", b = { Hour: "Hour", Month: "Month", Paycheck: "Paycheck", Week: "Week", Year: "Year" }, C = "Save job", g = "Continue", k = "Compensation", w = "Edit job", v = "Add job", W = "Effective date", L = { editCompensationTitle: "Edit compensation", jobTitleLabel: "Job title", wageLabel: "Wage", wageFrequencyLabel: "Wage frequency", wageFrequencyOptions: { Hour: "Hourly", Week: "Weekly", Month: "Monthly", Year: "Annually", Paycheck: "Per paycheck" }, twoPercentShareholderLabel: "This employee is a 2% shareholder", saveCta: "Save", scheduledClassificationChangeNotification: "Scheduling this classification change will delete the employee's additional jobs when it goes into effect." }, j = { classificationChangeNotification: "Changing this employee's classification will delete the employee's additional pay rates.", exemptThreshold: "Most employees who make under {{limit}}/year should be eligible for overtime.", paymentUnit: "Payment unit must be one of Hour, Week, Month, or Year", rate: "Amount is a required field", nonZeroRate: "Amount must be at least $1.00", rateExemptThreshold: "FLSA Exempt employees must meet salary threshold of {{limit}}/year", title: "Title is a required field", minimumWage: "Please select minimum wage for adjustment", stateWcClassCode: "Please select a risk class code", effectiveDate: "Effective date is a required field", effectiveDateBeforeHire: "Effective date cannot be before the employee's hire date.", jobTitleSentence: "Job title is a required field" }, E = "Workers' compensation coverage", T = "Washington administers <wcLink>workers’ compensation insurance</wcLink> to protect workers and employers from the financial impact of a work-related injury. Indicate here if this employee is exempt from the workers’ comp tax.", x = { yes: "Yes, this employee is covered", no: "No, this employee is not covered" }, P = "Risk class code", S = "The risk class code associated with this employee’s job function. We need this to pay and file your taxes correctly.", N = "Select if employee is a 2% shareholder", O = {
|
|
2
2
|
addAnotherJobCta: e,
|
|
3
3
|
adjustForMinimumWage: t,
|
|
4
4
|
adjustForMinimumWageDescription: o,
|
|
5
5
|
minimumWageLabel: a,
|
|
6
|
-
minimumWageDescription:
|
|
7
|
-
allCompensations:
|
|
8
|
-
amount:
|
|
9
|
-
backCta:
|
|
10
|
-
cancelCta:
|
|
11
|
-
cancelNewJobCta:
|
|
12
|
-
classificationLink:
|
|
13
|
-
employeeClassification:
|
|
14
|
-
flsaStatusLabels:
|
|
15
|
-
hamburgerTitle:
|
|
16
|
-
jobTitle:
|
|
6
|
+
minimumWageDescription: i,
|
|
7
|
+
allCompensations: n,
|
|
8
|
+
amount: s,
|
|
9
|
+
backCta: l,
|
|
10
|
+
cancelCta: c,
|
|
11
|
+
cancelNewJobCta: m,
|
|
12
|
+
classificationLink: r,
|
|
13
|
+
employeeClassification: d,
|
|
14
|
+
flsaStatusLabels: p,
|
|
15
|
+
hamburgerTitle: h,
|
|
16
|
+
jobTitle: u,
|
|
17
17
|
paymentUnitDescription: y,
|
|
18
|
-
paymentUnitLabel:
|
|
18
|
+
paymentUnitLabel: f,
|
|
19
19
|
paymentUnitOptions: b,
|
|
20
|
-
saveNewJobCta:
|
|
21
|
-
submitCta:
|
|
22
|
-
title:
|
|
20
|
+
saveNewJobCta: C,
|
|
21
|
+
submitCta: g,
|
|
22
|
+
title: k,
|
|
23
23
|
editTitle: w,
|
|
24
|
-
addTitle:
|
|
24
|
+
addTitle: v,
|
|
25
|
+
effectiveDateLabel: W,
|
|
26
|
+
management: L,
|
|
25
27
|
validations: j,
|
|
26
|
-
stateWcCoveredLabel:
|
|
27
|
-
stateWcCoveredDescription:
|
|
28
|
+
stateWcCoveredLabel: E,
|
|
29
|
+
stateWcCoveredDescription: T,
|
|
28
30
|
stateWcCoveredOptions: x,
|
|
29
|
-
stateWcClassCodeLabel:
|
|
30
|
-
stateWcClassCodeDescription:
|
|
31
|
-
twoPercentStakeholderLabel:
|
|
31
|
+
stateWcClassCodeLabel: P,
|
|
32
|
+
stateWcClassCodeDescription: S,
|
|
33
|
+
twoPercentStakeholderLabel: N
|
|
32
34
|
};
|
|
33
35
|
export {
|
|
34
36
|
e as addAnotherJobCta,
|
|
35
|
-
|
|
37
|
+
v as addTitle,
|
|
36
38
|
t as adjustForMinimumWage,
|
|
37
39
|
o as adjustForMinimumWageDescription,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
n as allCompensations,
|
|
41
|
+
s as amount,
|
|
42
|
+
l as backCta,
|
|
43
|
+
c as cancelCta,
|
|
44
|
+
m as cancelNewJobCta,
|
|
45
|
+
r as classificationLink,
|
|
46
|
+
O as default,
|
|
45
47
|
w as editTitle,
|
|
46
|
-
|
|
47
|
-
d as
|
|
48
|
-
|
|
49
|
-
h as
|
|
50
|
-
|
|
48
|
+
W as effectiveDateLabel,
|
|
49
|
+
d as employeeClassification,
|
|
50
|
+
p as flsaStatusLabels,
|
|
51
|
+
h as hamburgerTitle,
|
|
52
|
+
u as jobTitle,
|
|
53
|
+
L as management,
|
|
54
|
+
i as minimumWageDescription,
|
|
51
55
|
a as minimumWageLabel,
|
|
52
56
|
y as paymentUnitDescription,
|
|
53
|
-
|
|
57
|
+
f as paymentUnitLabel,
|
|
54
58
|
b as paymentUnitOptions,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
C as saveNewJobCta,
|
|
60
|
+
S as stateWcClassCodeDescription,
|
|
61
|
+
P as stateWcClassCodeLabel,
|
|
62
|
+
T as stateWcCoveredDescription,
|
|
63
|
+
E as stateWcCoveredLabel,
|
|
60
64
|
x as stateWcCoveredOptions,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
g as submitCta,
|
|
66
|
+
k as title,
|
|
67
|
+
N as twoPercentStakeholderLabel,
|
|
64
68
|
j as validations
|
|
65
69
|
};
|
|
66
70
|
//# sourceMappingURL=Employee.Compensation.json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Employee.Compensation.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Employee.Compensation.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "Employee Dashboard", t = "Employee dashboard tabs", a = { basicDetails: "Basic details", jobAndPay: "Job and pay", taxes: "Taxes", documents: "Documents" }, n = { title: "Basic details", editCta: "Edit", legalName: "Legal name", startDate: "Start date", socialSecurityNumber: "Social security number", dateOfBirth: "Date of birth", personalEmail: "Personal email" }, o = { title: "Home address", manageCta: "Manage", currentAddress: "Current address", noAddress: "No home address on file" }, i = { title: "Work address", manageCta: "Manage", currentAddress: "Current address", noAddress: "No work address on file" }, d = { compensation: { title: "Compensation", editCta: "Edit", jobTitle: "Job title", type: "Type", types: { hourly: "Hourly/Overtime eligible", salary: "Salary/No overtime" }, wage: "Wage",
|
|
1
|
+
const e = "Employee Dashboard", t = "Employee dashboard tabs", a = { basicDetails: "Basic details", jobAndPay: "Job and pay", taxes: "Taxes", documents: "Documents" }, n = { title: "Basic details", editCta: "Edit", legalName: "Legal name", startDate: "Start date", socialSecurityNumber: "Social security number", dateOfBirth: "Date of birth", personalEmail: "Personal email" }, o = { title: "Home address", manageCta: "Manage", currentAddress: "Current address", noAddress: "No home address on file" }, i = { title: "Work address", manageCta: "Manage", currentAddress: "Current address", noAddress: "No work address on file" }, d = { compensation: { title: "Compensation", editCta: "Edit", jobTitle: "Job title", type: "Type", types: { hourly: "Hourly/Overtime eligible", salary: "Salary/No overtime" }, wage: "Wage", effectiveDate: "Effective date", addJobCta: "Add job", addAnotherJobCta: "Add another job", tableLabel: "List of jobs", hamburgerTitle: "Job actions", editJobCta: "Edit", deleteJobCta: "Delete", columns: { jobTitle: "Job title", payType: "Pay type", effectiveDate: "Effective date" }, deleteJobDialog: { title: "Delete job?", description: "{{jobTitle}} will be permanently removed.", confirmCta: "Delete", cancelCta: "Cancel" }, emptyState: { title: "No compensation", description: "Compensation will appear here once added" }, pendingChange: { alertLabel: "Compensation will change on {{date}}.", alertLabelWithJob: "Compensation for {{jobTitle}} will change on {{date}}.", summaryLabel: "There are multiple pending changes to {{name}}'s compensation.", reviewCta: "Review", cancelCta: "Cancel change", modal: { title: "Review pending changes", description: "These compensation changes are scheduled to take effect on the dates below. Cancel any change to remove it.", closeCta: "Close" }, details: { titleChange: "Job title will change to {{title}}", payChange: "Pay will change to {{formattedRate}}", flsaChange: "Employee type will change to {{flsaLabel}}", newJob: "{{name}} will start an additional job as {{title}} at {{formattedRate}}", newJobNoTitle: "{{name}} will start an additional job at {{formattedRate}}", newJobNoRate: "{{name}} will start an additional job as {{title}}", newJobMinimal: "{{name}} will start an additional job", minWageEnabled: "Minimum wage adjustment will be enabled at {{formattedWage}}", minWageEnabledNoRate: "Minimum wage adjustment will be enabled", minWageDisabled: "Minimum wage adjustment will be removed", minWageChanged: "Minimum wage adjustment rate will change to {{formattedWage}}", minWageChangedNoRate: "Minimum wage adjustment will change" } } }, payment: { title: "Payment", splitPaycheckCta: "Split paycheck", addBankAccountCta: "Add bank account", listLabel: "List of bank accounts", nickname: "Nickname", routingNumber: "Routing number", accountType: "Account type", emptyState: { title: "No bank accounts", description: "Bank accounts will appear here once added" } }, deductions: { title: "Deductions", addDeductionCta: "Add deduction", listLabel: "List of deductions", deduction: "Deduction", frequency: "Frequency", withhold: "Withheld", recurring: "Recurring", oneTime: "One-time", amountPerPaycheck: "{{value}} per paycheck", emptyState: { title: "No deductions", description: "Employee deductions will appear here" } }, paystubs: { title: "Paystubs", listLabel: "List of paystubs", payday: "Payday", checkAmount: "Check amount", grossPay: "Gross pay", paymentMethod: "Payment method", noPaymentMethod: "Not available", downloadCta: "Download paystub", downloadError: "Unable to download paystub", downloadLoadingMessage: "Generating paystub…", emptyState: { title: "No paystubs", description: "Paystubs will appear here after payroll is run" } } }, s = { federal: { title: "Federal taxes", editCta: "Edit", filingStatus: "Filing status", multipleJobs: "Multiple jobs", dependentsAndOtherCredits: "Dependents and other credits", otherIncome: "Other income", deductions: "Deductions", extraWithholding: "Extra withholding" }, state: { title: "State taxes", editCta: "Edit", noStateTaxes: "No state taxes on file" } }, l = { title: "Forms", listLabel: "List of employee forms", viewCta: "View", columns: { title: "Form", year: "Year", status: "Status", requiresSigning: "Signing status", actions: "Actions" }, signingStatus: { signed: "Signed", notSigned: "Not signed" }, status: { draft: "Draft", final: "Final" }, emptyState: { title: "No forms", description: "Employee forms will appear here once available" } }, c = { yes: "Yes", no: "No" }, r = { bankAccountAdded: "Bank account successfully added.", bankAccountDeleted: "Bank account successfully deleted.", splitUpdated: "Split payment successfully updated.", deductionAdded: "Deduction successfully added.", deductionUpdated: "Deduction successfully updated.", deductionDeleted: "Deduction successfully deleted." }, m = { addJobTitle: "Add a job", editTitle: "Edit compensation", addAnotherJobTitle: "Add another job" }, u = {
|
|
2
2
|
title: e,
|
|
3
3
|
tabsLabel: t,
|
|
4
4
|
tabs: a,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const o = "View document", n = "You can also <downloadLink>download this document
|
|
1
|
+
const o = "View document", n = "You can also <downloadLink>download this document</downloadLink>.", a = "Back", t = {
|
|
2
2
|
viewDocumentCta: o,
|
|
3
3
|
downloadDocumentCta: n,
|
|
4
4
|
backCta: a
|
|
@@ -85,6 +85,13 @@ declare const _default: {
|
|
|
85
85
|
"yearly": "{{amount}} per year",
|
|
86
86
|
"paycheck": "{{amount}} per paycheck"
|
|
87
87
|
},
|
|
88
|
+
"compensationRateFormats": {
|
|
89
|
+
"hourly": "{{amount}} per hour",
|
|
90
|
+
"weekly": "{{amount}} per week",
|
|
91
|
+
"monthly": "{{amount}} per month",
|
|
92
|
+
"yearly": "{{amount}} per year",
|
|
93
|
+
"paycheck": "{{amount}} per paycheck"
|
|
94
|
+
},
|
|
88
95
|
"validations": {
|
|
89
96
|
"accountName": "Account name is required",
|
|
90
97
|
"routingNumber": "Routing number should be a number (9 digits)",
|
|
@@ -68,6 +68,7 @@ export declare const employeeEvents: {
|
|
|
68
68
|
readonly EMPLOYEE_ONBOARDING_DOCUMENTS_CONFIG_UPDATED: "employee/onboardingDocumentsConfig/updated";
|
|
69
69
|
readonly EMPLOYEE_DOCUMENTS_DONE: "employee/documents/done";
|
|
70
70
|
readonly EMPLOYEE_REHIRE: "employee/rehire";
|
|
71
|
+
readonly EMPLOYEE_DASHBOARD_TAB_CHANGE: "employee/dashboard/tabChange";
|
|
71
72
|
};
|
|
72
73
|
export declare const companyEvents: {
|
|
73
74
|
readonly COMPANY_INDUSTRY: "company/industry";
|
|
@@ -473,6 +474,7 @@ export declare const componentEvents: {
|
|
|
473
474
|
readonly EMPLOYEE_ONBOARDING_DOCUMENTS_CONFIG_UPDATED: "employee/onboardingDocumentsConfig/updated";
|
|
474
475
|
readonly EMPLOYEE_DOCUMENTS_DONE: "employee/documents/done";
|
|
475
476
|
readonly EMPLOYEE_REHIRE: "employee/rehire";
|
|
477
|
+
readonly EMPLOYEE_DASHBOARD_TAB_CHANGE: "employee/dashboard/tabChange";
|
|
476
478
|
readonly ROBOT_MACHINE_DONE: "done";
|
|
477
479
|
readonly ERROR: "ERROR";
|
|
478
480
|
readonly CANCEL: "CANCEL";
|