@gusto/embedded-react-sdk 0.44.1 → 0.44.2
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 +13 -0
- package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -7
- package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +5 -5
- package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +7 -7
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js +19 -17
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.js.map +1 -1
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.module.scss.js +8 -0
- package/dist/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.module.scss.js.map +1 -0
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +71 -54
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +1 -1
- package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
- package/dist/helpers/dateFormatting.js +52 -56
- package/dist/helpers/dateFormatting.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/test-utils/assertions.d.ts +4 -0
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.44.2](https://github.com/Gusto/embedded-react-sdk/compare/v0.44.1...v0.44.2) (2026-05-12)
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- Fix full-width layout of `EmployeeStateTaxesView` container ([#1782](https://github.com/Gusto/embedded-react-sdk/issues/1782))
|
|
8
|
+
- Prevent layout shift (skeleton flash) when `TransitionPayrollAlert` has no content to display ([#1773](https://github.com/Gusto/embedded-react-sdk/issues/1773))
|
|
9
|
+
- Fix UTC roundtrip bug in date picker field where dates near midnight would shift by one day ([#1767](https://github.com/Gusto/embedded-react-sdk/issues/1767))
|
|
10
|
+
|
|
11
|
+
### Chores & Maintenance
|
|
12
|
+
|
|
13
|
+
- Bump `i18next` to `26.1.0` ([#1778](https://github.com/Gusto/embedded-react-sdk/issues/1778))
|
|
14
|
+
- Bump dev dependencies (`@playwright/test`, `typescript-eslint`, `vitest`)
|
|
15
|
+
|
|
3
16
|
## 0.44.1
|
|
4
17
|
|
|
5
18
|
### Chores & Maintenance
|
|
@@ -8,16 +8,16 @@ import { Flex as E } from "../../../Common/Flex/Flex.js";
|
|
|
8
8
|
import "classnames";
|
|
9
9
|
import { companyEvents as l } from "../../../../shared/constants.js";
|
|
10
10
|
import { ActionsLayout as _ } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { Form as k } from "../../../Common/Form/Form.js";
|
|
12
|
+
import { SDKFormProvider as I } from "../../../../partner-hook-utils/form/SDKFormProvider.js";
|
|
13
|
+
import { useComponentContext as M } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import { DocumentViewer as x } from "../../../Common/DocumentViewer/DocumentViewer.js";
|
|
15
15
|
function q(t) {
|
|
16
16
|
return /* @__PURE__ */ o(v, { ...t, children: /* @__PURE__ */ o(B, { ...t, children: t.children }) });
|
|
17
17
|
}
|
|
18
18
|
function B({ formId: t, children: u, dictionary: p }) {
|
|
19
19
|
L("Company.SignatureForm", p), R("Company.SignatureForm");
|
|
20
|
-
const { t: r } = S("Company.SignatureForm"), { onEvent: a } = w(), e =
|
|
20
|
+
const { t: r } = S("Company.SignatureForm"), { onEvent: a } = w(), e = M(), n = D({ formId: t });
|
|
21
21
|
if (n.isLoading)
|
|
22
22
|
return /* @__PURE__ */ o(d, { isLoading: !0, error: n.errorHandling.errors });
|
|
23
23
|
const { companyForm: i, pdfUrl: m } = n.data, { isPending: f } = n.status, { Signature: g, ConfirmSignature: h } = n.form.Fields, C = async () => {
|
|
@@ -26,7 +26,7 @@ function B({ formId: t, children: u, dictionary: p }) {
|
|
|
26
26
|
}, F = () => {
|
|
27
27
|
a(l.COMPANY_SIGN_FORM_BACK);
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */ o(d, { error: n.errorHandling.errors, children: /* @__PURE__ */ o(
|
|
29
|
+
return /* @__PURE__ */ o(d, { error: n.errorHandling.errors, children: /* @__PURE__ */ o(I, { formHookResult: n, children: /* @__PURE__ */ o(k, { onSubmit: C, children: /* @__PURE__ */ o(E, { flexDirection: "column", gap: 32, children: u ?? /* @__PURE__ */ s(y, { children: [
|
|
30
30
|
/* @__PURE__ */ s("section", { children: [
|
|
31
31
|
/* @__PURE__ */ o(e.Heading, { as: "h2", children: r("signatureFormTitle", { formTitle: i.title }) }),
|
|
32
32
|
m && /* @__PURE__ */ o(e.Text, { children: /* @__PURE__ */ o(
|
|
@@ -50,7 +50,7 @@ function B({ formId: t, children: u, dictionary: p }) {
|
|
|
50
50
|
) })
|
|
51
51
|
] }),
|
|
52
52
|
/* @__PURE__ */ o(
|
|
53
|
-
|
|
53
|
+
x,
|
|
54
54
|
{
|
|
55
55
|
url: m,
|
|
56
56
|
title: i.title,
|
|
@@ -10,10 +10,10 @@ import { componentEvents as f } from "../../../../shared/constants.js";
|
|
|
10
10
|
import { Flex as m } from "../../../Common/Flex/Flex.js";
|
|
11
11
|
import "classnames";
|
|
12
12
|
import { ActionsLayout as k } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { SDKFormProvider as F } from "../../../../partner-hook-utils/form/SDKFormProvider.js";
|
|
13
|
+
import { Form as w } from "../../../Common/Form/Form.js";
|
|
14
|
+
import { SDKFormProvider as B } from "../../../../partner-hook-utils/form/SDKFormProvider.js";
|
|
16
15
|
import { useComponentContext as h } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
16
|
+
import { DocumentViewer as F } from "../../../Common/DocumentViewer/DocumentViewer.js";
|
|
17
17
|
function ne(i) {
|
|
18
18
|
return /* @__PURE__ */ e(x, { ...i, children: /* @__PURE__ */ e(P, { ...i }) });
|
|
19
19
|
}
|
|
@@ -35,7 +35,7 @@ function P({ employeeId: i, formId: c, className: a }) {
|
|
|
35
35
|
l.Preparer3,
|
|
36
36
|
l.Preparer4
|
|
37
37
|
].filter((p) => p !== void 0);
|
|
38
|
-
return /* @__PURE__ */ e("section", { className: a, children: /* @__PURE__ */ e(C, { error: n.errorHandling.errors, children: /* @__PURE__ */ e(
|
|
38
|
+
return /* @__PURE__ */ e("section", { className: a, children: /* @__PURE__ */ e(C, { error: n.errorHandling.errors, children: /* @__PURE__ */ e(B, { formHookResult: n, children: /* @__PURE__ */ e(w, { onSubmit: () => void _(), children: /* @__PURE__ */ o(m, { flexDirection: "column", gap: 20, children: [
|
|
39
39
|
/* @__PURE__ */ o("section", { children: [
|
|
40
40
|
/* @__PURE__ */ e(r.Heading, { as: "h2", children: t("title") }),
|
|
41
41
|
/* @__PURE__ */ e(r.Text, { children: /* @__PURE__ */ e(
|
|
@@ -65,7 +65,7 @@ function P({ employeeId: i, formId: c, className: a }) {
|
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
67
|
/* @__PURE__ */ e(
|
|
68
|
-
|
|
68
|
+
F,
|
|
69
69
|
{
|
|
70
70
|
url: b,
|
|
71
71
|
title: S.title,
|
|
@@ -8,16 +8,16 @@ import { componentEvents as u } from "../../../../shared/constants.js";
|
|
|
8
8
|
import { Flex as p } from "../../../Common/Flex/Flex.js";
|
|
9
9
|
import "classnames";
|
|
10
10
|
import { ActionsLayout as w } from "../../../Common/ActionsLayout/ActionsLayout.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { Form as y } from "../../../Common/Form/Form.js";
|
|
12
|
+
import { SDKFormProvider as k } from "../../../../partner-hook-utils/form/SDKFormProvider.js";
|
|
13
|
+
import { useComponentContext as x } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
14
|
+
import { DocumentViewer as R } from "../../../Common/DocumentViewer/DocumentViewer.js";
|
|
15
15
|
function V(t) {
|
|
16
16
|
return /* @__PURE__ */ o(L, { ...t, children: /* @__PURE__ */ o(B, { ...t }) });
|
|
17
17
|
}
|
|
18
18
|
function B({ employeeId: t, formId: f, className: g }) {
|
|
19
19
|
D("Employee.DocumentSigner");
|
|
20
|
-
const { t: r } = S("Employee.DocumentSigner"), { onEvent: m } = v(), n =
|
|
20
|
+
const { t: r } = S("Employee.DocumentSigner"), { onEvent: m } = v(), n = x(), e = F({ employeeId: t, formId: f });
|
|
21
21
|
if (e.isLoading)
|
|
22
22
|
return /* @__PURE__ */ o(d, { isLoading: !0, error: e.errorHandling.errors });
|
|
23
23
|
const { form: i, pdfUrl: a } = e.data, { isPending: h } = e.status, { Fields: l } = e.form, E = () => {
|
|
@@ -26,7 +26,7 @@ function B({ employeeId: t, formId: f, className: g }) {
|
|
|
26
26
|
const c = await e.actions.onSubmit();
|
|
27
27
|
c && m(u.EMPLOYEE_SIGN_FORM, c.data);
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */ o("section", { className: g, children: /* @__PURE__ */ o(d, { error: e.errorHandling.errors, children: /* @__PURE__ */ o(
|
|
29
|
+
return /* @__PURE__ */ o("section", { className: g, children: /* @__PURE__ */ o(d, { error: e.errorHandling.errors, children: /* @__PURE__ */ o(k, { formHookResult: e, children: /* @__PURE__ */ o(y, { onSubmit: () => void b(), children: /* @__PURE__ */ s(p, { flexDirection: "column", children: [
|
|
30
30
|
/* @__PURE__ */ s("section", { children: [
|
|
31
31
|
/* @__PURE__ */ o(n.Heading, { as: "h2", children: r("signatureFormTitle", { formTitle: i.title }) }),
|
|
32
32
|
a && /* @__PURE__ */ o(n.Text, { children: /* @__PURE__ */ o(
|
|
@@ -50,7 +50,7 @@ function B({ employeeId: t, formId: f, className: g }) {
|
|
|
50
50
|
) })
|
|
51
51
|
] }),
|
|
52
52
|
/* @__PURE__ */ o(
|
|
53
|
-
|
|
53
|
+
R,
|
|
54
54
|
{
|
|
55
55
|
url: a,
|
|
56
56
|
title: i.title,
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as e } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment as x } from "react";
|
|
3
3
|
import { useTranslation as m } from "react-i18next";
|
|
4
|
-
import
|
|
4
|
+
import y from "classnames";
|
|
5
|
+
import C from "./EmployeeStateTaxesView.module.scss.js";
|
|
6
|
+
import { BaseLayout as F } from "../../../Base/Base.js";
|
|
5
7
|
import "../../../Base/useBase.js";
|
|
6
|
-
import { Form as
|
|
7
|
-
import { SDKFormProvider as
|
|
8
|
-
import { useComponentContext as
|
|
9
|
-
function
|
|
8
|
+
import { Form as H } from "../../../Common/Form/Form.js";
|
|
9
|
+
import { SDKFormProvider as N } from "../../../../partner-hook-utils/form/SDKFormProvider.js";
|
|
10
|
+
import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
11
|
+
function K({
|
|
10
12
|
stateTaxes: r,
|
|
11
|
-
onSubmit:
|
|
12
|
-
actions:
|
|
13
|
+
onSubmit: s,
|
|
14
|
+
actions: n,
|
|
13
15
|
alert: i,
|
|
14
16
|
className: a
|
|
15
17
|
}) {
|
|
16
|
-
const { t: c } = m("Employee.StateTaxes"), { t: l } = m("common"), p =
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
+
const { t: c } = m("Employee.StateTaxes"), { t: l } = m("common"), p = S(), f = r.form.Fields;
|
|
19
|
+
return /* @__PURE__ */ o("section", { className: y(C.container, a), children: /* @__PURE__ */ o(F, { error: r.errorHandling.errors, children: /* @__PURE__ */ o(N, { formHookResult: r, children: /* @__PURE__ */ e(H, { onSubmit: s, children: [
|
|
18
20
|
i,
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
+
f.map((t) => {
|
|
22
|
+
const d = l(`statesHash.${t.state}`, t.state);
|
|
21
23
|
return /* @__PURE__ */ e(x, { children: [
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
|
|
24
|
-
] },
|
|
24
|
+
/* @__PURE__ */ o(p.Heading, { as: "h2", children: c("stateTaxesTitle", { state: d }) }),
|
|
25
|
+
t.questions.map(({ questionId: h, Field: u }) => /* @__PURE__ */ o(u, {}, h))
|
|
26
|
+
] }, t.state);
|
|
25
27
|
}),
|
|
26
|
-
|
|
28
|
+
n
|
|
27
29
|
] }) }) }) });
|
|
28
30
|
}
|
|
29
31
|
export {
|
|
30
|
-
|
|
32
|
+
K as EmployeeStateTaxesView
|
|
31
33
|
};
|
|
32
34
|
//# sourceMappingURL=EmployeeStateTaxesView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmployeeStateTaxesView.js","sources":["../../../../../src/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.tsx"],"sourcesContent":["import { Fragment, type ReactNode } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { type useEmployeeStateTaxesForm } from './useEmployeeStateTaxesForm'\nimport { BaseLayout } from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype ReadyEmployeeStateTaxesForm = Extract<\n ReturnType<typeof useEmployeeStateTaxesForm>,\n { isLoading: false }\n>\n\nexport interface EmployeeStateTaxesViewProps {\n stateTaxes: ReadyEmployeeStateTaxesForm\n onSubmit: () => void | Promise<void>\n actions: ReactNode\n alert?: ReactNode\n className?: string\n}\n\nexport function EmployeeStateTaxesView({\n stateTaxes,\n onSubmit,\n actions,\n alert,\n className,\n}: EmployeeStateTaxesViewProps) {\n const { t } = useTranslation('Employee.StateTaxes')\n const { t: tCommon } = useTranslation('common')\n const Components = useComponentContext()\n const groups = stateTaxes.form.Fields\n\n return (\n <section className={className}>\n <BaseLayout error={stateTaxes.errorHandling.errors}>\n <SDKFormProvider formHookResult={stateTaxes}>\n <Form onSubmit={onSubmit}>\n {alert}\n\n {groups.map(group => {\n const stateName = tCommon(`statesHash.${group.state}`, group.state)\n return (\n <Fragment key={group.state}>\n <Components.Heading as=\"h2\">\n {t('stateTaxesTitle', { state: stateName })}\n </Components.Heading>\n\n {group.questions.map(({ questionId, Field }) => {\n return <Field key={questionId} />\n })}\n </Fragment>\n )\n })}\n\n {actions}\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EmployeeStateTaxesView","stateTaxes","onSubmit","actions","alert","className","t","useTranslation","tCommon","Components","useComponentContext","groups","jsx","BaseLayout","SDKFormProvider","jsxs","Form","group","stateName","Fragment","questionId","Field"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmployeeStateTaxesView.js","sources":["../../../../../src/components/Employee/StateTaxes/shared/EmployeeStateTaxesView.tsx"],"sourcesContent":["import { Fragment, type ReactNode } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport classNames from 'classnames'\nimport { type useEmployeeStateTaxesForm } from './useEmployeeStateTaxesForm'\nimport styles from './EmployeeStateTaxesView.module.scss'\nimport { BaseLayout } from '@/components/Base'\nimport { Form } from '@/components/Common/Form'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ntype ReadyEmployeeStateTaxesForm = Extract<\n ReturnType<typeof useEmployeeStateTaxesForm>,\n { isLoading: false }\n>\n\nexport interface EmployeeStateTaxesViewProps {\n stateTaxes: ReadyEmployeeStateTaxesForm\n onSubmit: () => void | Promise<void>\n actions: ReactNode\n alert?: ReactNode\n className?: string\n}\n\nexport function EmployeeStateTaxesView({\n stateTaxes,\n onSubmit,\n actions,\n alert,\n className,\n}: EmployeeStateTaxesViewProps) {\n const { t } = useTranslation('Employee.StateTaxes')\n const { t: tCommon } = useTranslation('common')\n const Components = useComponentContext()\n const groups = stateTaxes.form.Fields\n\n return (\n <section className={classNames(styles.container, className)}>\n <BaseLayout error={stateTaxes.errorHandling.errors}>\n <SDKFormProvider formHookResult={stateTaxes}>\n <Form onSubmit={onSubmit}>\n {alert}\n\n {groups.map(group => {\n const stateName = tCommon(`statesHash.${group.state}`, group.state)\n return (\n <Fragment key={group.state}>\n <Components.Heading as=\"h2\">\n {t('stateTaxesTitle', { state: stateName })}\n </Components.Heading>\n\n {group.questions.map(({ questionId, Field }) => {\n return <Field key={questionId} />\n })}\n </Fragment>\n )\n })}\n\n {actions}\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n </section>\n )\n}\n"],"names":["EmployeeStateTaxesView","stateTaxes","onSubmit","actions","alert","className","t","useTranslation","tCommon","Components","useComponentContext","groups","jsx","classNames","styles","BaseLayout","SDKFormProvider","jsxs","Form","group","stateName","Fragment","questionId","Field"],"mappings":";;;;;;;;;;AAuBO,SAASA,EAAuB;AAAA,EACrC,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AACF,GAAgC;AAC9B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,GAAGC,MAAYD,EAAe,QAAQ,GACxCE,IAAaC,EAAA,GACbC,IAASV,EAAW,KAAK;AAE/B,SACE,gBAAAW,EAAC,aAAQ,WAAWC,EAAWC,EAAO,WAAWT,CAAS,GACxD,UAAA,gBAAAO,EAACG,GAAA,EAAW,OAAOd,EAAW,cAAc,QAC1C,UAAA,gBAAAW,EAACI,GAAA,EAAgB,gBAAgBf,GAC/B,UAAA,gBAAAgB,EAACC,KAAK,UAAAhB,GACH,UAAA;AAAA,IAAAE;AAAA,IAEAO,EAAO,IAAI,CAAAQ,MAAS;AACnB,YAAMC,IAAYZ,EAAQ,cAAcW,EAAM,KAAK,IAAIA,EAAM,KAAK;AAClE,+BACGE,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAT,EAACH,EAAW,SAAX,EAAmB,IAAG,MACpB,UAAAH,EAAE,mBAAmB,EAAE,OAAOc,EAAA,CAAW,EAAA,CAC5C;AAAA,QAECD,EAAM,UAAU,IAAI,CAAC,EAAE,YAAAG,GAAY,OAAAC,QAC3B,gBAAAX,EAACW,OAAWD,CAAY,CAChC;AAAA,MAAA,EAAA,GAPYH,EAAM,KAQrB;AAAA,IAEJ,CAAC;AAAA,IAEAhB;AAAA,EAAA,GACH,EAAA,CACF,GACF,GACF;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmployeeStateTaxesView.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -4,5 +4,5 @@ interface TransitionPayrollAlertProps {
|
|
|
4
4
|
companyId: string;
|
|
5
5
|
onEvent: OnEventType<EventType, unknown>;
|
|
6
6
|
}
|
|
7
|
-
export declare function TransitionPayrollAlert(
|
|
7
|
+
export declare function TransitionPayrollAlert({ companyId, onEvent }: TransitionPayrollAlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
8
|
export {};
|
|
@@ -1,83 +1,100 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { usePayrollsSkipMutation as
|
|
6
|
-
import { PayrollType as
|
|
7
|
-
import { PayrollTypes as
|
|
8
|
-
import { RFCDate as
|
|
9
|
-
import { TransitionPayrollAlertPresentation as
|
|
10
|
-
import { BaseComponent as
|
|
11
|
-
import { useBase as
|
|
12
|
-
import { componentEvents as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import { jsx as D } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as P, useEffect as E, useState as A, useCallback as f } from "react";
|
|
3
|
+
import { usePaySchedulesGetPayPeriods as R } from "@gusto/embedded-api/react-query/paySchedulesGetPayPeriods";
|
|
4
|
+
import { usePaySchedulesGetAll as N } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
|
|
5
|
+
import { usePayrollsSkipMutation as O } from "@gusto/embedded-api/react-query/payrollsSkip";
|
|
6
|
+
import { PayrollType as w } from "@gusto/embedded-api/models/operations/postcompaniespayrollskipcompanyuuid";
|
|
7
|
+
import { PayrollTypes as g } from "@gusto/embedded-api/models/operations/getv1companiescompanyidpayperiods";
|
|
8
|
+
import { RFCDate as U } from "@gusto/embedded-api/types/rfcdate";
|
|
9
|
+
import { TransitionPayrollAlertPresentation as b } from "./TransitionPayrollAlertPresentation.js";
|
|
10
|
+
import { BaseComponent as _ } from "../../Base/Base.js";
|
|
11
|
+
import { useBase as L } from "../../Base/useBase.js";
|
|
12
|
+
import { componentEvents as h } from "../../../shared/constants.js";
|
|
13
|
+
import { useObservability as M } from "../../../contexts/ObservabilityProvider/useObservability.js";
|
|
14
|
+
import { normalizeToSDKError as C } from "../../../types/sdkError.js";
|
|
15
|
+
const v = 90, x = "Payroll.TransitionPayrollAlert";
|
|
16
|
+
function Z({ companyId: a, onEvent: i }) {
|
|
17
|
+
const { observability: r } = M(), c = P(() => {
|
|
18
|
+
const t = /* @__PURE__ */ new Date();
|
|
19
|
+
return t.setDate(t.getDate() + v), new U(t);
|
|
20
|
+
}, []), { data: n, error: p } = R({
|
|
21
|
+
companyId: a,
|
|
22
|
+
payrollTypes: g.Transition,
|
|
23
|
+
endDate: c
|
|
24
|
+
}), { data: l, error: d } = N({ companyId: a }), o = p ?? d;
|
|
25
|
+
E(() => {
|
|
26
|
+
if (!o) return;
|
|
27
|
+
i(h.ERROR, o);
|
|
28
|
+
const t = C(o);
|
|
29
|
+
r?.onError?.({
|
|
30
|
+
...t,
|
|
31
|
+
timestamp: Date.now(),
|
|
32
|
+
componentName: x
|
|
33
|
+
});
|
|
34
|
+
}, [o, i, r]);
|
|
35
|
+
const m = P(() => {
|
|
36
|
+
if (!n || !l) return [];
|
|
37
|
+
const t = l.payScheduleShowResponse ?? [], S = (n.payPeriods ?? []).filter(
|
|
38
|
+
(s) => !s.payroll?.processed
|
|
39
|
+
), e = /* @__PURE__ */ new Map();
|
|
40
|
+
for (const s of S) {
|
|
41
|
+
const y = s.payScheduleUuid ?? "unknown", u = e.get(y) ?? [];
|
|
42
|
+
u.push(s), e.set(y, u);
|
|
30
43
|
}
|
|
31
|
-
return Array.from(e.entries()).map(([s,
|
|
32
|
-
const
|
|
33
|
-
return { payScheduleUuid: s, payScheduleName:
|
|
44
|
+
return Array.from(e.entries()).map(([s, y]) => {
|
|
45
|
+
const u = t.find((k) => k.uuid === s), T = u?.customName || u?.name || "Transition";
|
|
46
|
+
return { payScheduleUuid: s, payScheduleName: T, payPeriods: y };
|
|
34
47
|
});
|
|
35
|
-
}, [
|
|
48
|
+
}, [n, l]);
|
|
49
|
+
return !n || !l || m.length === 0 ? null : /* @__PURE__ */ D(_, { onEvent: i, children: /* @__PURE__ */ D(B, { companyId: a, groupedPayPeriods: m }) });
|
|
50
|
+
}
|
|
51
|
+
function B({ companyId: a, groupedPayPeriods: i }) {
|
|
52
|
+
const { onEvent: r, baseSubmitHandler: c } = L(), [n, p] = A(!1), [l, d] = A(null), { mutateAsync: o } = O(), m = f(
|
|
36
53
|
(e) => {
|
|
37
|
-
|
|
54
|
+
r(h.RUN_TRANSITION_PAYROLL, {
|
|
38
55
|
startDate: e.startDate,
|
|
39
56
|
endDate: e.endDate,
|
|
40
57
|
payScheduleUuid: e.payScheduleUuid
|
|
41
58
|
});
|
|
42
59
|
},
|
|
43
|
-
[
|
|
44
|
-
),
|
|
60
|
+
[r]
|
|
61
|
+
), t = f(
|
|
45
62
|
async (e) => {
|
|
46
|
-
|
|
47
|
-
await
|
|
63
|
+
d(e), await c({}, async () => {
|
|
64
|
+
await o({
|
|
48
65
|
request: {
|
|
49
|
-
companyUuid:
|
|
66
|
+
companyUuid: a,
|
|
50
67
|
requestBody: {
|
|
51
|
-
payrollType:
|
|
68
|
+
payrollType: w.TransitionFromOldPaySchedule,
|
|
52
69
|
startDate: e.startDate,
|
|
53
70
|
endDate: e.endDate,
|
|
54
71
|
payScheduleUuid: e.payScheduleUuid ?? void 0
|
|
55
72
|
}
|
|
56
73
|
}
|
|
57
|
-
}),
|
|
74
|
+
}), p(!0), r(h.TRANSITION_PAYROLL_SKIPPED, {
|
|
58
75
|
startDate: e.startDate,
|
|
59
76
|
endDate: e.endDate,
|
|
60
77
|
payScheduleUuid: e.payScheduleUuid
|
|
61
78
|
});
|
|
62
|
-
}),
|
|
79
|
+
}), d(null);
|
|
63
80
|
},
|
|
64
|
-
[
|
|
65
|
-
),
|
|
66
|
-
|
|
81
|
+
[a, o, r, c]
|
|
82
|
+
), S = f(() => {
|
|
83
|
+
p(!1);
|
|
67
84
|
}, []);
|
|
68
|
-
return
|
|
69
|
-
|
|
85
|
+
return /* @__PURE__ */ D(
|
|
86
|
+
b,
|
|
70
87
|
{
|
|
71
|
-
groupedPayPeriods:
|
|
72
|
-
onRunPayroll:
|
|
73
|
-
onSkipPayroll:
|
|
74
|
-
showSkipSuccessAlert:
|
|
75
|
-
onDismissSkipSuccessAlert:
|
|
76
|
-
skippingPayPeriod:
|
|
88
|
+
groupedPayPeriods: i,
|
|
89
|
+
onRunPayroll: m,
|
|
90
|
+
onSkipPayroll: t,
|
|
91
|
+
showSkipSuccessAlert: n,
|
|
92
|
+
onDismissSkipSuccessAlert: S,
|
|
93
|
+
skippingPayPeriod: l
|
|
77
94
|
}
|
|
78
95
|
);
|
|
79
96
|
}
|
|
80
97
|
export {
|
|
81
|
-
|
|
98
|
+
Z as TransitionPayrollAlert
|
|
82
99
|
};
|
|
83
100
|
//# sourceMappingURL=TransitionPayrollAlert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionPayrollAlert.js","sources":["../../../../src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.tsx"],"sourcesContent":["import { useMemo, useState, useCallback } from 'react'\nimport {
|
|
1
|
+
{"version":3,"file":"TransitionPayrollAlert.js","sources":["../../../../src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.tsx"],"sourcesContent":["import { useMemo, useState, useCallback, useEffect } from 'react'\nimport { usePaySchedulesGetPayPeriods } from '@gusto/embedded-api/react-query/paySchedulesGetPayPeriods'\nimport { usePaySchedulesGetAll } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { usePayrollsSkipMutation } from '@gusto/embedded-api/react-query/payrollsSkip'\nimport { PayrollType } from '@gusto/embedded-api/models/operations/postcompaniespayrollskipcompanyuuid'\nimport { PayrollTypes } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayperiods'\nimport type { PayPeriod } from '@gusto/embedded-api/models/components/payperiod'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport {\n TransitionPayrollAlertPresentation,\n type TransitionPayPeriodGroup,\n} from './TransitionPayrollAlertPresentation'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { componentEvents } from '@/shared/constants'\nimport { useObservability } from '@/contexts/ObservabilityProvider/useObservability'\nimport { normalizeToSDKError } from '@/types/sdkError'\n\ninterface TransitionPayrollAlertProps {\n companyId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\ninterface RootProps {\n companyId: string\n groupedPayPeriods: TransitionPayPeriodGroup[]\n}\n\nconst LOOK_AHEAD_DAYS = 90\nconst COMPONENT_NAME = 'Payroll.TransitionPayrollAlert'\n\nexport function TransitionPayrollAlert({ companyId, onEvent }: TransitionPayrollAlertProps) {\n const { observability } = useObservability()\n\n const lookAheadEndDate = useMemo(() => {\n const date = new Date()\n date.setDate(date.getDate() + LOOK_AHEAD_DAYS)\n return new RFCDate(date)\n }, [])\n\n const { data: payPeriodsData, error: payPeriodsError } = usePaySchedulesGetPayPeriods({\n companyId,\n payrollTypes: PayrollTypes.Transition,\n endDate: lookAheadEndDate,\n })\n\n const { data: paySchedulesData, error: paySchedulesError } = usePaySchedulesGetAll({ companyId })\n\n const gateError = payPeriodsError ?? paySchedulesError\n\n useEffect(() => {\n if (!gateError) return\n onEvent(componentEvents.ERROR, gateError)\n const sdkError = normalizeToSDKError(gateError)\n observability?.onError?.({\n ...sdkError,\n timestamp: Date.now(),\n componentName: COMPONENT_NAME,\n })\n }, [gateError, onEvent, observability])\n\n const groupedPayPeriods = useMemo<TransitionPayPeriodGroup[]>(() => {\n if (!payPeriodsData || !paySchedulesData) return []\n const paySchedules = paySchedulesData.payScheduleShowResponse ?? []\n const unprocessed = (payPeriodsData.payPeriods ?? []).filter(\n (pp: PayPeriod) => !pp.payroll?.processed,\n )\n\n const groups = new Map<string, PayPeriod[]>()\n for (const period of unprocessed) {\n const uuid = period.payScheduleUuid ?? 'unknown'\n const existing = groups.get(uuid) ?? []\n existing.push(period)\n groups.set(uuid, existing)\n }\n\n return Array.from(groups.entries()).map(([payScheduleUuid, payPeriods]) => {\n const schedule = paySchedules.find(s => s.uuid === payScheduleUuid)\n const payScheduleName = schedule?.customName || schedule?.name || 'Transition'\n return { payScheduleUuid, payScheduleName, payPeriods }\n })\n }, [payPeriodsData, paySchedulesData])\n\n if (!payPeriodsData || !paySchedulesData || groupedPayPeriods.length === 0) {\n return null\n }\n\n return (\n <BaseComponent onEvent={onEvent}>\n <Root companyId={companyId} groupedPayPeriods={groupedPayPeriods} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, groupedPayPeriods }: RootProps) {\n const { onEvent, baseSubmitHandler } = useBase()\n\n const [showSkipSuccessAlert, setShowSkipSuccessAlert] = useState(false)\n const [skippingPayPeriod, setSkippingPayPeriod] = useState<PayPeriod | null>(null)\n\n const { mutateAsync: skipPayroll } = usePayrollsSkipMutation()\n\n const handleRunPayroll = useCallback(\n (payPeriod: PayPeriod) => {\n onEvent(componentEvents.RUN_TRANSITION_PAYROLL, {\n startDate: payPeriod.startDate,\n endDate: payPeriod.endDate,\n payScheduleUuid: payPeriod.payScheduleUuid,\n })\n },\n [onEvent],\n )\n\n const handleSkipPayroll = useCallback(\n async (payPeriod: PayPeriod) => {\n setSkippingPayPeriod(payPeriod)\n await baseSubmitHandler({}, async () => {\n await skipPayroll({\n request: {\n companyUuid: companyId,\n requestBody: {\n payrollType: PayrollType.TransitionFromOldPaySchedule,\n startDate: payPeriod.startDate,\n endDate: payPeriod.endDate,\n payScheduleUuid: payPeriod.payScheduleUuid ?? undefined,\n },\n },\n })\n setShowSkipSuccessAlert(true)\n onEvent(componentEvents.TRANSITION_PAYROLL_SKIPPED, {\n startDate: payPeriod.startDate,\n endDate: payPeriod.endDate,\n payScheduleUuid: payPeriod.payScheduleUuid,\n })\n })\n setSkippingPayPeriod(null)\n },\n [companyId, skipPayroll, onEvent, baseSubmitHandler],\n )\n\n const handleDismissSkipSuccessAlert = useCallback(() => {\n setShowSkipSuccessAlert(false)\n }, [])\n\n return (\n <TransitionPayrollAlertPresentation\n groupedPayPeriods={groupedPayPeriods}\n onRunPayroll={handleRunPayroll}\n onSkipPayroll={handleSkipPayroll}\n showSkipSuccessAlert={showSkipSuccessAlert}\n onDismissSkipSuccessAlert={handleDismissSkipSuccessAlert}\n skippingPayPeriod={skippingPayPeriod}\n />\n )\n}\n"],"names":["LOOK_AHEAD_DAYS","COMPONENT_NAME","TransitionPayrollAlert","companyId","onEvent","observability","useObservability","lookAheadEndDate","useMemo","date","RFCDate","payPeriodsData","payPeriodsError","usePaySchedulesGetPayPeriods","PayrollTypes","paySchedulesData","paySchedulesError","usePaySchedulesGetAll","gateError","useEffect","componentEvents","sdkError","normalizeToSDKError","groupedPayPeriods","paySchedules","unprocessed","pp","groups","period","uuid","existing","payScheduleUuid","payPeriods","schedule","s","payScheduleName","BaseComponent","Root","baseSubmitHandler","useBase","showSkipSuccessAlert","setShowSkipSuccessAlert","useState","skippingPayPeriod","setSkippingPayPeriod","skipPayroll","usePayrollsSkipMutation","handleRunPayroll","useCallback","payPeriod","handleSkipPayroll","PayrollType","handleDismissSkipSuccessAlert","jsx","TransitionPayrollAlertPresentation"],"mappings":"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"}
|
package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionPayrollAlertPresentation.js","sources":["../../../../src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { PayPeriod } from '@gusto/embedded-api/models/components/payperiod'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useI18n } from '@/i18n'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\
|
|
1
|
+
{"version":3,"file":"TransitionPayrollAlertPresentation.js","sources":["../../../../src/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { PayPeriod } from '@gusto/embedded-api/models/components/payperiod'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useI18n } from '@/i18n'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\nexport interface TransitionPayPeriodGroup {\n payScheduleUuid: string\n payScheduleName: string\n payPeriods: PayPeriod[]\n}\n\ninterface TransitionPayrollAlertPresentationProps {\n groupedPayPeriods: TransitionPayPeriodGroup[]\n onRunPayroll: (payPeriod: PayPeriod) => void\n onSkipPayroll: (payPeriod: PayPeriod) => void\n showSkipSuccessAlert: boolean\n onDismissSkipSuccessAlert: () => void\n skippingPayPeriod: PayPeriod | null\n}\n\nexport function TransitionPayrollAlertPresentation({\n groupedPayPeriods,\n onRunPayroll,\n onSkipPayroll,\n showSkipSuccessAlert,\n onDismissSkipSuccessAlert,\n skippingPayPeriod,\n}: TransitionPayrollAlertPresentationProps) {\n useI18n('Payroll.TransitionPayrollAlert')\n const { t } = useTranslation('Payroll.TransitionPayrollAlert')\n const { Alert, Button, Text, Dialog } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const [skipDialogPayPeriod, setSkipDialogPayPeriod] = useState<PayPeriod | null>(null)\n\n if (groupedPayPeriods.length === 0) {\n return null\n }\n\n const formatDateRange = (payPeriod: PayPeriod) =>\n dateFormatter.formatPayPeriodRange(payPeriod.startDate, payPeriod.endDate, {\n useShortMonth: true,\n })\n\n const handleConfirmSkip = () => {\n if (skipDialogPayPeriod) {\n onSkipPayroll(skipDialogPayPeriod)\n setSkipDialogPayPeriod(null)\n }\n }\n\n const hasMultipleGroups = groupedPayPeriods.length > 1\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {showSkipSuccessAlert && (\n <Alert status=\"info\" label={t('skipSuccessAlert')} onDismiss={onDismissSkipSuccessAlert} />\n )}\n {groupedPayPeriods.map((group, groupIndex) => (\n <Flex key={group.payScheduleUuid || `group-${groupIndex}`} flexDirection=\"column\" gap={16}>\n {hasMultipleGroups && <Text weight=\"semibold\">{group.payScheduleName}</Text>}\n {group.payPeriods.map(payPeriod => {\n const dateRange = formatDateRange(payPeriod)\n const isSkipping = skippingPayPeriod === payPeriod\n\n return (\n <Alert\n key={`${payPeriod.payScheduleUuid}-${payPeriod.startDate}`}\n status=\"warning\"\n label={t('alertTitle', { dateRange })}\n >\n <Flex flexDirection=\"column\" gap={16}>\n <Text>{t('alertDescription')}</Text>\n <Flex gap={12} alignItems=\"center\">\n <div>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onRunPayroll(payPeriod)\n }}\n >\n {t('runPayroll')}\n </Button>\n </div>\n <Button\n variant=\"tertiary\"\n onClick={() => {\n setSkipDialogPayPeriod(payPeriod)\n }}\n isLoading={isSkipping}\n >\n {t('skipPayroll')}\n </Button>\n </Flex>\n </Flex>\n </Alert>\n )\n })}\n </Flex>\n ))}\n <Dialog\n isOpen={skipDialogPayPeriod !== null}\n onClose={() => {\n setSkipDialogPayPeriod(null)\n }}\n onPrimaryActionClick={handleConfirmSkip}\n isDestructive\n title={t('skipDialog.title', {\n dateRange: skipDialogPayPeriod ? formatDateRange(skipDialogPayPeriod) : '',\n })}\n primaryActionLabel={t('skipDialog.confirmCta')}\n closeActionLabel={t('skipDialog.cancelCta')}\n >\n {t('skipDialog.body')}\n </Dialog>\n </Flex>\n )\n}\n"],"names":["TransitionPayrollAlertPresentation","groupedPayPeriods","onRunPayroll","onSkipPayroll","showSkipSuccessAlert","onDismissSkipSuccessAlert","skippingPayPeriod","useI18n","useTranslation","Alert","Button","Text","Dialog","useComponentContext","dateFormatter","useDateFormatter","skipDialogPayPeriod","setSkipDialogPayPeriod","useState","formatDateRange","payPeriod","handleConfirmSkip","hasMultipleGroups","jsxs","Flex","jsx","group","groupIndex","dateRange","isSkipping"],"mappings":"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"}
|