@gusto/embedded-react-sdk 0.55.8 → 0.56.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 +40 -0
- package/dist/components/Common/UI/Menu/MenuTypes.js.map +1 -1
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +43 -42
- package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +7 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +4 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +4 -3
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +4 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +70 -69
- package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js +2 -2
- package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js +51 -42
- package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +29 -26
- package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -1
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +2 -2
- package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +11 -11
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +3 -3
- package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -1
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +76 -79
- package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +2 -2
- package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +2 -2
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +10 -10
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +49 -45
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +83 -76
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +63 -60
- package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +184 -165
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/useCalculationPoll.js +48 -34
- package/dist/components/Payroll/PayrollConfiguration/useCalculationPoll.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +185 -171
- package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/useSubmissionPoll.js +45 -34
- package/dist/components/Payroll/PayrollOverview/useSubmissionPoll.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +44 -44
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.module.scss.js +14 -14
- package/dist/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.js +16 -16
- package/dist/components/Payroll/PrintChecks/PrintChecksFailure/PrintChecksFailure.js.map +1 -1
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/useGenerationPoll.js +52 -37
- package/dist/components/Payroll/PrintChecks/PrintChecksForm/useGenerationPoll.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +9 -8
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ApiProvider/ApiProvider.js +29 -28
- package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
- package/dist/contexts/ApiProvider/apiVersionMismatchHook.js +15 -0
- package/dist/contexts/ApiProvider/apiVersionMismatchHook.js.map +1 -0
- package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
- package/dist/contexts/ThemeProvider/ThemeProvider.js +32 -26
- package/dist/contexts/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/hooks/usePollingTask/usePollingTask.js +53 -41
- package/dist/hooks/usePollingTask/usePollingTask.js.map +1 -1
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +28 -24
- package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
- package/dist/i18n/en/Payroll.GrossUpModal.json.js +12 -10
- package/dist/i18n/en/Payroll.GrossUpModal.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +8 -8
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +15 -15
- package/dist/package.json.js +1 -1
- package/dist/src/components/Common/UI/ComboBox/ComboBoxTypes.d.ts +1 -1
- package/dist/src/components/Common/UI/DatePicker/DatePickerTypes.d.ts +2 -1
- package/dist/src/components/Common/UI/Menu/MenuTypes.d.ts +1 -1
- package/dist/src/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.d.ts +1 -1
- package/dist/src/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +5 -0
- package/dist/src/components/Common/UI/Select/SelectTypes.d.ts +2 -1
- package/dist/src/components/Employee/EmployeeList/shared/useEmployeeList.d.ts +7 -2
- package/dist/src/components/Employee/EmployeeListFlow/employeeListStateMachine.test.d.ts +1 -0
- package/dist/src/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
- package/dist/src/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +6 -0
- package/dist/src/components/Payroll/PayrollConfiguration/useCalculationPoll.d.ts +6 -1
- package/dist/src/components/Payroll/PayrollOverview/useSubmissionPoll.d.ts +10 -1
- package/dist/src/contexts/ApiProvider/ApiProvider.d.ts +5 -3
- package/dist/src/contexts/ApiProvider/apiVersionMismatchHook.d.ts +3 -0
- package/dist/src/contexts/ApiProvider/apiVersionMismatchHook.test.d.ts +1 -0
- package/dist/src/contexts/GustoProvider/GustoProviderCustomUIAdapter.d.ts +9 -1
- package/dist/src/contexts/ThemeProvider/ThemeProvider.d.ts +8 -3
- package/dist/src/hooks/usePollingTask/usePollingTask.d.ts +55 -14
- package/dist/src/i18n/types.d.ts +14 -0
- package/dist/style.css +1 -1
- package/docs/guides/endpoint-inventory.json +5 -0
- package/package.json +6 -6
|
@@ -1,50 +1,62 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
s.current =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { useRef as c, useState as R, useCallback as d, useEffect as g } from "react";
|
|
2
|
+
import { SDKValidationError as h } from "@gusto/embedded-api/models/errors/sdkvalidationerror";
|
|
3
|
+
import { GustoEmbeddedError as k } from "@gusto/embedded-api/models/errors/gustoembeddederror";
|
|
4
|
+
const C = /* @__PURE__ */ new Set([401, 403]);
|
|
5
|
+
function x(t) {
|
|
6
|
+
return t instanceof h ? !0 : t instanceof k && C.has(t.httpMeta.response.status);
|
|
7
|
+
}
|
|
8
|
+
const y = 5e3, O = 180 * 1e3;
|
|
9
|
+
function B(t) {
|
|
10
|
+
const l = c(t);
|
|
11
|
+
l.current = t;
|
|
12
|
+
const a = c(0), s = c(null), i = c(null), [L, E] = R(!1), [, _] = R(0), e = d(() => {
|
|
13
|
+
a.current += 1, s.current !== null && (clearTimeout(s.current), s.current = null), i.current?.abort(), i.current = null;
|
|
14
|
+
}, []), r = d(() => {
|
|
15
|
+
e(), E(!1);
|
|
16
|
+
}, [e]), v = d(() => {
|
|
17
|
+
e();
|
|
18
|
+
const S = a.current, T = new AbortController();
|
|
19
|
+
i.current = T;
|
|
20
|
+
const { intervalMs: p = y, deadlineMs: A = O } = l.current, P = Date.now() + A;
|
|
21
|
+
let o = null;
|
|
22
|
+
E(!0);
|
|
23
|
+
const m = () => a.current === S, D = async () => {
|
|
24
|
+
if (!m()) return;
|
|
25
|
+
const { fetch: w, evaluate: b, onDone: I, onError: M, onDeadline: N } = l.current;
|
|
26
|
+
let f;
|
|
20
27
|
try {
|
|
21
|
-
n =
|
|
22
|
-
|
|
28
|
+
const n = await w(T.signal);
|
|
29
|
+
o = { value: n }, f = { success: !0, data: n };
|
|
30
|
+
} catch (n) {
|
|
31
|
+
f = { success: !1, error: n, lastData: o ? o.value : null };
|
|
32
|
+
}
|
|
33
|
+
if (!m()) return;
|
|
34
|
+
_((n) => n + 1);
|
|
35
|
+
const u = b(f);
|
|
36
|
+
if (u.status === "done") {
|
|
37
|
+
r(), I(u.value);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (u.status === "error") {
|
|
41
|
+
r(), M(u.error);
|
|
42
|
+
return;
|
|
23
43
|
}
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (o.done) {
|
|
28
|
-
r(), g(o.value);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (Date.now() >= A) {
|
|
33
|
-
r(), k(n ? n.value : null);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
e.current = setTimeout(() => {
|
|
37
|
-
D();
|
|
38
|
-
}, m);
|
|
44
|
+
if (Date.now() >= P) {
|
|
45
|
+
r(), N(o ? o.value : null);
|
|
46
|
+
return;
|
|
39
47
|
}
|
|
48
|
+
s.current = setTimeout(() => {
|
|
49
|
+
D();
|
|
50
|
+
}, p);
|
|
40
51
|
};
|
|
41
52
|
D();
|
|
42
|
-
}, [
|
|
43
|
-
return
|
|
53
|
+
}, [e, r]);
|
|
54
|
+
return g(() => e, [e]), { start: v, stop: r, isPolling: L };
|
|
44
55
|
}
|
|
45
56
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
O as DEFAULT_POLL_DEADLINE_MS,
|
|
58
|
+
y as DEFAULT_POLL_INTERVAL_MS,
|
|
59
|
+
x as isNonRetryablePollError,
|
|
60
|
+
B as usePollingTask
|
|
49
61
|
};
|
|
50
62
|
//# sourceMappingURL=usePollingTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePollingTask.js","sources":["../../../src/hooks/usePollingTask/usePollingTask.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react'\n\n/**\n * The outcome of evaluating a single poll tick.\n *\n * @typeParam TValue - The terminal value handed to `onDone`.\n * @internal\n */\nexport type PollTickResult<TValue> = { done: true; value: TValue } | { done: false }\n\n/**\n * Configuration for {@link usePollingTask}.\n *\n * @typeParam TData - The value each poll read resolves to.\n * @typeParam TValue - The terminal value produced by `evaluate` and handed to `onDone`.\n * @internal\n */\nexport interface UsePollingTaskOptions<TData, TValue> {\n /** Reads the current server state for one tick. Rejections are tolerated and retried next tick. */\n fetch: (signal: AbortSignal) => Promise<TData>\n /**\n * Decides whether the operation has reached a terminal state, from the data this tick just\n * read. Must not depend on rendered state — that dependency is the bug this hook exists to\n * avoid.\n */\n evaluate: (data: TData) => PollTickResult<TValue>\n /** Called once, from the poll loop, when `evaluate` reports a terminal state. */\n onDone: (value: TValue) => void\n /**\n * Called once when `deadlineMs` elapses without a terminal state, with the most recent data\n * successfully read (or `null` if no read ever succeeded). Verify against that data before\n * reporting a failure.\n */\n onDeadline: (lastData: TData | null) => void\n /** Delay between the end of one tick and the start of the next. Defaults to {@link DEFAULT_POLL_INTERVAL_MS}. */\n intervalMs?: number\n /** How long the task may run before `onDeadline` is called. Defaults to {@link DEFAULT_POLL_DEADLINE_MS}. */\n deadlineMs?: number\n}\n\n/**\n * Default delay between polling reads.\n *\n * @internal\n */\nexport const DEFAULT_POLL_INTERVAL_MS = 5_000\n\n/**\n * Default duration a polling task may run before its deadline fires.\n *\n * @internal\n */\nexport const DEFAULT_POLL_DEADLINE_MS = 3 * 60 * 1000\n\n/**\n * An imperative handle to a polling task.\n *\n * @internal\n */\nexport interface PollingTask {\n /** Begins polling, reading once immediately. Restarts the task if one is already running. */\n start: () => void\n /** Stops polling without calling `onDone` or `onDeadline`. */\n stop: () => void\n /** Whether the task is currently running. Safe to render; not used to decide completion. */\n isPolling: boolean\n}\n\n/**\n * Polls an async operation to completion in a self-contained loop that owns its own timer and\n * decides the terminal state from the data it reads.\n *\n * @remarks\n * Use this instead of driving a poll from a query's `refetchInterval` and reacting to the result\n * in an effect. That pattern makes completion depend on a render arriving — if the query\n * observer never notifies the component, the operation finishes on the server and the screen\n * never advances (SDK-1291). Here the loop reads the server directly and evaluates the result in\n * its own closure, so the terminal decision does not depend on the component rendering.\n *\n * Behavior worth knowing:\n *\n * - `start()` reads immediately, then every `intervalMs` after the previous read settles, so a\n * slow read never stacks up overlapping requests.\n * - A rejected read is not a failed task. It is ignored and retried on the next tick, which\n * matters because SDK queries are configured with `retry: false`. Note that when `fetch` reads\n * through a shared query key, the failure is still recorded on that key, so observers of it\n * see the error state even though the task carries on.\n * - A terminal result on the deadline tick wins over the deadline, and `onDeadline` receives the\n * last data read so the caller can verify before declaring failure.\n * - Each tick bumps internal state, which gives the calling component a render source\n * independent of any query observer. Fresh cache data is then picked up on that render.\n * - `stop()` and unmount abort the in-flight read and guarantee no further callbacks fire.\n *\n * Callbacks are read through a ref, so changing their identity between renders never restarts\n * the loop.\n *\n * @typeParam TData - The value each poll read resolves to.\n * @typeParam TValue - The terminal value produced by `evaluate` and handed to `onDone`.\n * @param options - See {@link UsePollingTaskOptions}.\n * @returns The {@link PollingTask} handle.\n * @internal\n */\nexport function usePollingTask<TData, TValue>(\n options: UsePollingTaskOptions<TData, TValue>,\n): PollingTask {\n const optionsRef = useRef(options)\n optionsRef.current = options\n\n const runIdRef = useRef(0)\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const controllerRef = useRef<AbortController | null>(null)\n const [isPolling, setIsPolling] = useState(false)\n const [, setTickCount] = useState(0)\n\n const teardown = useCallback(() => {\n runIdRef.current += 1\n if (timeoutRef.current !== null) {\n clearTimeout(timeoutRef.current)\n timeoutRef.current = null\n }\n controllerRef.current?.abort()\n controllerRef.current = null\n }, [])\n\n const stop = useCallback(() => {\n teardown()\n setIsPolling(false)\n }, [teardown])\n\n const start = useCallback(() => {\n teardown()\n\n const runId = runIdRef.current\n const controller = new AbortController()\n controllerRef.current = controller\n const { intervalMs = DEFAULT_POLL_INTERVAL_MS, deadlineMs = DEFAULT_POLL_DEADLINE_MS } =\n optionsRef.current\n const deadline = Date.now() + deadlineMs\n let last: { value: TData } | null = null\n\n setIsPolling(true)\n\n const isCurrentRun = () => runIdRef.current === runId\n\n const tick = async () => {\n if (!isCurrentRun()) return\n\n const { fetch: read, evaluate, onDone, onDeadline } = optionsRef.current\n\n try {\n last = { value: await read(controller.signal) }\n } catch {\n // One failed read is not a failed task — try again on the next tick.\n }\n\n if (!isCurrentRun()) return\n\n setTickCount(count => count + 1)\n\n if (last) {\n const result = evaluate(last.value)\n if (result.done) {\n stop()\n onDone(result.value)\n return\n }\n }\n\n if (Date.now() >= deadline) {\n stop()\n onDeadline(last ? last.value : null)\n return\n }\n\n timeoutRef.current = setTimeout(() => {\n void tick()\n }, intervalMs)\n }\n\n void tick()\n }, [teardown, stop])\n\n useEffect(() => teardown, [teardown])\n\n return { start, stop, isPolling }\n}\n"],"names":["DEFAULT_POLL_INTERVAL_MS","DEFAULT_POLL_DEADLINE_MS","usePollingTask","options","optionsRef","useRef","runIdRef","timeoutRef","controllerRef","isPolling","setIsPolling","useState","setTickCount","teardown","useCallback","stop","start","runId","controller","intervalMs","deadlineMs","deadline","last","isCurrentRun","tick","read","evaluate","onDone","onDeadline","count","result","useEffect"],"mappings":";AA6CO,MAAMA,IAA2B,KAO3BC,IAA2B,MAAS;AAkD1C,SAASC,EACdC,GACa;AACb,QAAMC,IAAaC,EAAOF,CAAO;AACjC,EAAAC,EAAW,UAAUD;AAErB,QAAMG,IAAWD,EAAO,CAAC,GACnBE,IAAaF,EAA6C,IAAI,GAC9DG,IAAgBH,EAA+B,IAAI,GACnD,CAACI,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,GAAGC,CAAY,IAAID,EAAS,CAAC,GAE7BE,IAAWC,EAAY,MAAM;AACjC,IAAAR,EAAS,WAAW,GAChBC,EAAW,YAAY,SACzB,aAAaA,EAAW,OAAO,GAC/BA,EAAW,UAAU,OAEvBC,EAAc,SAAS,MAAA,GACvBA,EAAc,UAAU;AAAA,EAC1B,GAAG,CAAA,CAAE,GAECO,IAAOD,EAAY,MAAM;AAC7B,IAAAD,EAAA,GACAH,EAAa,EAAK;AAAA,EACpB,GAAG,CAACG,CAAQ,CAAC,GAEPG,IAAQF,EAAY,MAAM;AAC9B,IAAAD,EAAA;AAEA,UAAMI,IAAQX,EAAS,SACjBY,IAAa,IAAI,gBAAA;AACvB,IAAAV,EAAc,UAAUU;AACxB,UAAM,EAAE,YAAAC,IAAanB,GAA0B,YAAAoB,IAAanB,EAAA,IAC1DG,EAAW,SACPiB,IAAW,KAAK,IAAA,IAAQD;AAC9B,QAAIE,IAAgC;AAEpC,IAAAZ,EAAa,EAAI;AAEjB,UAAMa,IAAe,MAAMjB,EAAS,YAAYW,GAE1CO,IAAO,YAAY;AACvB,UAAI,CAACD,IAAgB;AAErB,YAAM,EAAE,OAAOE,GAAM,UAAAC,GAAU,QAAAC,GAAQ,YAAAC,EAAA,IAAexB,EAAW;AAEjE,UAAI;AACF,QAAAkB,IAAO,EAAE,OAAO,MAAMG,EAAKP,EAAW,MAAM,EAAA;AAAA,MAC9C,QAAQ;AAAA,MAER;AAEA,UAAKK,KAIL;AAAA,YAFAX,EAAa,CAAAiB,MAASA,IAAQ,CAAC,GAE3BP,GAAM;AACR,gBAAMQ,IAASJ,EAASJ,EAAK,KAAK;AAClC,cAAIQ,EAAO,MAAM;AACf,YAAAf,EAAA,GACAY,EAAOG,EAAO,KAAK;AACnB;AAAA,UACF;AAAA,QACF;AAEA,YAAI,KAAK,IAAA,KAAST,GAAU;AAC1B,UAAAN,EAAA,GACAa,EAAWN,IAAOA,EAAK,QAAQ,IAAI;AACnC;AAAA,QACF;AAEA,QAAAf,EAAW,UAAU,WAAW,MAAM;AACpC,UAAKiB,EAAA;AAAA,QACP,GAAGL,CAAU;AAAA;AAAA,IACf;AAEA,IAAKK,EAAA;AAAA,EACP,GAAG,CAACX,GAAUE,CAAI,CAAC;AAEnB,SAAAgB,EAAU,MAAMlB,GAAU,CAACA,CAAQ,CAAC,GAE7B,EAAE,OAAAG,GAAO,MAAAD,GAAM,WAAAN,EAAA;AACxB;"}
|
|
1
|
+
{"version":3,"file":"usePollingTask.js","sources":["../../../src/hooks/usePollingTask/usePollingTask.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react'\nimport { SDKValidationError } from '@gusto/embedded-api/models/errors/sdkvalidationerror'\nimport { GustoEmbeddedError } from '@gusto/embedded-api/models/errors/gustoembeddederror'\n\n/**\n * The outcome of evaluating a single poll tick.\n *\n * @remarks\n * `'done'` (a domain-understood outcome, success or real failure) and `'error'` (the read failed\n * in a way not worth retrying, so the poll never learned what happened) are both terminal but go\n * to different callbacks — `onDone` and `onError` — so callers can't conflate the two.\n *\n * @typeParam TValue - The terminal value handed to `onDone`.\n * @internal\n */\nexport type PollTickResult<TValue> =\n { status: 'polling' } | { status: 'done'; value: TValue } | { status: 'error'; error: unknown }\n\n/**\n * The result of one poll tick's read — the data it resolved to, or the error it rejected with.\n *\n * @remarks\n * `lastData` (rejection only) is the most recent successfully-read data, or `null` if none has\n * succeeded yet — the same value `onDeadline` receives, and worth verifying against for the same\n * reason.\n *\n * @typeParam TData - The value a successful read resolves to.\n * @internal\n */\nexport type PollReadOutcome<TData> =\n { success: true; data: TData } | { success: false; error: unknown; lastData: TData | null }\n\nconst NON_RETRYABLE_HTTP_STATUSES = new Set([401, 403])\n\n/**\n * Whether a poll read's error is not worth retrying.\n *\n * @remarks\n * `SDKValidationError` (also matches `ResponseValidationError`) means the response failed schema\n * validation. A 401/403 means the session that started the poll expired mid-poll (SDK-1291) --\n * neither recovers by retrying. Everything else (network blips, timeouts, transient 5xx) may\n * still succeed on the next tick.\n *\n * @internal\n */\nexport function isNonRetryablePollError(error: unknown): boolean {\n if (error instanceof SDKValidationError) return true\n return (\n error instanceof GustoEmbeddedError &&\n NON_RETRYABLE_HTTP_STATUSES.has(error.httpMeta.response.status)\n )\n}\n\n/**\n * Configuration for {@link usePollingTask}.\n *\n * @typeParam TData - The value each poll read resolves to.\n * @typeParam TValue - The terminal value produced by `evaluate` and handed to `onDone`.\n * @internal\n */\nexport interface UsePollingTaskOptions<TData, TValue> {\n /** Reads the current server state for one tick. Rejections are passed to `evaluate`, not thrown. */\n fetch: (signal: AbortSignal) => Promise<TData>\n /**\n * Decides whether the operation has reached a terminal state, from this tick's read outcome.\n * Called on every tick, including ones where `fetch` rejected — see {@link PollReadOutcome} and\n * {@link isNonRetryablePollError}.\n */\n evaluate: (outcome: PollReadOutcome<TData>) => PollTickResult<TValue>\n /** Called once, from the poll loop, when `evaluate` reports a `'done'` terminal state. */\n onDone: (value: TValue) => void\n /** Called once, from the poll loop, when `evaluate` reports an `'error'` terminal state. */\n onError: (error: unknown) => void\n /**\n * Called once when `deadlineMs` elapses without a terminal state, with the most recent data\n * successfully read (or `null` if no read ever succeeded). Verify against that data before\n * reporting a failure.\n */\n onDeadline: (lastData: TData | null) => void\n /** Delay between the end of one tick and the start of the next. Defaults to {@link DEFAULT_POLL_INTERVAL_MS}. */\n intervalMs?: number\n /** How long the task may run before `onDeadline` is called. Defaults to {@link DEFAULT_POLL_DEADLINE_MS}. */\n deadlineMs?: number\n}\n\n/**\n * Default delay between polling reads.\n *\n * @internal\n */\nexport const DEFAULT_POLL_INTERVAL_MS = 5_000\n\n/**\n * Default duration a polling task may run before its deadline fires.\n *\n * @internal\n */\nexport const DEFAULT_POLL_DEADLINE_MS = 3 * 60 * 1000\n\n/**\n * An imperative handle to a polling task.\n *\n * @internal\n */\nexport interface PollingTask {\n /** Begins polling, reading once immediately. Restarts the task if one is already running. */\n start: () => void\n /** Stops polling without calling `onDone` or `onDeadline`. */\n stop: () => void\n /** Whether the task is currently running. Safe to render; not used to decide completion. */\n isPolling: boolean\n}\n\n/**\n * Polls an async operation to completion in a self-contained loop that owns its own timer and\n * decides the terminal state from the data it reads.\n *\n * @remarks\n * Use this instead of driving a poll from a query's `refetchInterval` and reacting to the result\n * in an effect. That pattern makes completion depend on a render arriving — if the query\n * observer never notifies the component, the operation finishes on the server and the screen\n * never advances (SDK-1291). Here the loop reads the server directly and evaluates the result in\n * its own closure, so the terminal decision does not depend on the component rendering.\n *\n * Behavior worth knowing:\n *\n * - `start()` reads immediately, then every `intervalMs` after the previous read settles, so a\n * slow read never stacks up overlapping requests.\n * - A rejected read isn't thrown; it's handed to `evaluate` as a {@link PollReadOutcome}, since\n * SDK queries are configured with `retry: false`. See {@link PollTickResult} for how `evaluate`\n * routes a read error to `'polling'` (retry) vs `'error'` (give up). When `fetch` reads through\n * a shared query key, observers of that key still see the error even though the task carries on.\n * - A `'done'` or `'error'` result on the deadline tick wins over the deadline, and `onDeadline`\n * receives the last data read so the caller can verify before declaring failure.\n * - Each tick bumps internal state, which gives the calling component a render source\n * independent of any query observer. Fresh cache data is then picked up on that render.\n * - `stop()` and unmount abort the in-flight read and guarantee no further callbacks fire.\n *\n * Callbacks are read through a ref, so changing their identity between renders never restarts\n * the loop.\n *\n * @typeParam TData - The value each poll read resolves to.\n * @typeParam TValue - The terminal value produced by `evaluate` and handed to `onDone`.\n * @param options - See {@link UsePollingTaskOptions}.\n * @returns The {@link PollingTask} handle.\n * @internal\n */\nexport function usePollingTask<TData, TValue>(\n options: UsePollingTaskOptions<TData, TValue>,\n): PollingTask {\n const optionsRef = useRef(options)\n optionsRef.current = options\n\n const runIdRef = useRef(0)\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n const controllerRef = useRef<AbortController | null>(null)\n const [isPolling, setIsPolling] = useState(false)\n const [, setTickCount] = useState(0)\n\n const teardown = useCallback(() => {\n runIdRef.current += 1\n if (timeoutRef.current !== null) {\n clearTimeout(timeoutRef.current)\n timeoutRef.current = null\n }\n controllerRef.current?.abort()\n controllerRef.current = null\n }, [])\n\n const stop = useCallback(() => {\n teardown()\n setIsPolling(false)\n }, [teardown])\n\n const start = useCallback(() => {\n teardown()\n\n const runId = runIdRef.current\n const controller = new AbortController()\n controllerRef.current = controller\n const { intervalMs = DEFAULT_POLL_INTERVAL_MS, deadlineMs = DEFAULT_POLL_DEADLINE_MS } =\n optionsRef.current\n const deadline = Date.now() + deadlineMs\n let last: { value: TData } | null = null\n\n setIsPolling(true)\n\n const isCurrentRun = () => runIdRef.current === runId\n\n const tick = async () => {\n if (!isCurrentRun()) return\n\n const { fetch: read, evaluate, onDone, onError, onDeadline } = optionsRef.current\n\n let outcome: PollReadOutcome<TData>\n try {\n const data = await read(controller.signal)\n last = { value: data }\n outcome = { success: true, data }\n } catch (error) {\n outcome = { success: false, error, lastData: last ? last.value : null }\n }\n\n if (!isCurrentRun()) return\n\n setTickCount(count => count + 1)\n\n const result = evaluate(outcome)\n if (result.status === 'done') {\n stop()\n onDone(result.value)\n return\n }\n if (result.status === 'error') {\n stop()\n onError(result.error)\n return\n }\n\n if (Date.now() >= deadline) {\n stop()\n onDeadline(last ? last.value : null)\n return\n }\n\n timeoutRef.current = setTimeout(() => {\n void tick()\n }, intervalMs)\n }\n\n void tick()\n }, [teardown, stop])\n\n useEffect(() => teardown, [teardown])\n\n return { start, stop, isPolling }\n}\n"],"names":["NON_RETRYABLE_HTTP_STATUSES","isNonRetryablePollError","error","SDKValidationError","GustoEmbeddedError","DEFAULT_POLL_INTERVAL_MS","DEFAULT_POLL_DEADLINE_MS","usePollingTask","options","optionsRef","useRef","runIdRef","timeoutRef","controllerRef","isPolling","setIsPolling","useState","setTickCount","teardown","useCallback","stop","start","runId","controller","intervalMs","deadlineMs","deadline","last","isCurrentRun","tick","read","evaluate","onDone","onError","onDeadline","outcome","data","count","result","useEffect"],"mappings":";;;AAgCA,MAAMA,IAA8B,oBAAI,IAAI,CAAC,KAAK,GAAG,CAAC;AAa/C,SAASC,EAAwBC,GAAyB;AAC/D,SAAIA,aAAiBC,IAA2B,KAE9CD,aAAiBE,KACjBJ,EAA4B,IAAIE,EAAM,SAAS,SAAS,MAAM;AAElE;AAuCO,MAAMG,IAA2B,KAO3BC,IAA2B,MAAS;AAkD1C,SAASC,EACdC,GACa;AACb,QAAMC,IAAaC,EAAOF,CAAO;AACjC,EAAAC,EAAW,UAAUD;AAErB,QAAMG,IAAWD,EAAO,CAAC,GACnBE,IAAaF,EAA6C,IAAI,GAC9DG,IAAgBH,EAA+B,IAAI,GACnD,CAACI,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,GAAGC,CAAY,IAAID,EAAS,CAAC,GAE7BE,IAAWC,EAAY,MAAM;AACjC,IAAAR,EAAS,WAAW,GAChBC,EAAW,YAAY,SACzB,aAAaA,EAAW,OAAO,GAC/BA,EAAW,UAAU,OAEvBC,EAAc,SAAS,MAAA,GACvBA,EAAc,UAAU;AAAA,EAC1B,GAAG,CAAA,CAAE,GAECO,IAAOD,EAAY,MAAM;AAC7B,IAAAD,EAAA,GACAH,EAAa,EAAK;AAAA,EACpB,GAAG,CAACG,CAAQ,CAAC,GAEPG,IAAQF,EAAY,MAAM;AAC9B,IAAAD,EAAA;AAEA,UAAMI,IAAQX,EAAS,SACjBY,IAAa,IAAI,gBAAA;AACvB,IAAAV,EAAc,UAAUU;AACxB,UAAM,EAAE,YAAAC,IAAanB,GAA0B,YAAAoB,IAAanB,EAAA,IAC1DG,EAAW,SACPiB,IAAW,KAAK,IAAA,IAAQD;AAC9B,QAAIE,IAAgC;AAEpC,IAAAZ,EAAa,EAAI;AAEjB,UAAMa,IAAe,MAAMjB,EAAS,YAAYW,GAE1CO,IAAO,YAAY;AACvB,UAAI,CAACD,IAAgB;AAErB,YAAM,EAAE,OAAOE,GAAM,UAAAC,GAAU,QAAAC,GAAQ,SAAAC,GAAS,YAAAC,MAAezB,EAAW;AAE1E,UAAI0B;AACJ,UAAI;AACF,cAAMC,IAAO,MAAMN,EAAKP,EAAW,MAAM;AACzC,QAAAI,IAAO,EAAE,OAAOS,EAAA,GAChBD,IAAU,EAAE,SAAS,IAAM,MAAAC,EAAA;AAAA,MAC7B,SAASlC,GAAO;AACd,QAAAiC,IAAU,EAAE,SAAS,IAAO,OAAAjC,GAAO,UAAUyB,IAAOA,EAAK,QAAQ,KAAA;AAAA,MACnE;AAEA,UAAI,CAACC,IAAgB;AAErB,MAAAX,EAAa,CAAAoB,MAASA,IAAQ,CAAC;AAE/B,YAAMC,IAASP,EAASI,CAAO;AAC/B,UAAIG,EAAO,WAAW,QAAQ;AAC5B,QAAAlB,EAAA,GACAY,EAAOM,EAAO,KAAK;AACnB;AAAA,MACF;AACA,UAAIA,EAAO,WAAW,SAAS;AAC7B,QAAAlB,EAAA,GACAa,EAAQK,EAAO,KAAK;AACpB;AAAA,MACF;AAEA,UAAI,KAAK,IAAA,KAASZ,GAAU;AAC1B,QAAAN,EAAA,GACAc,EAAWP,IAAOA,EAAK,QAAQ,IAAI;AACnC;AAAA,MACF;AAEA,MAAAf,EAAW,UAAU,WAAW,MAAM;AACpC,QAAKiB,EAAA;AAAA,MACP,GAAGL,CAAU;AAAA,IACf;AAEA,IAAKK,EAAA;AAAA,EACP,GAAG,CAACX,GAAUE,CAAI,CAAC;AAEnB,SAAAmB,EAAU,MAAMrB,GAAU,CAACA,CAAQ,CAAC,GAE7B,EAAE,OAAAG,GAAO,MAAAD,GAAM,WAAAN,EAAA;AACxB;"}
|
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
const e = "Employees", t = "Add employee", o = "Back to employees",
|
|
1
|
+
const e = "Employees", t = "Add employee", o = "Back to employees", s = "Employee status tabs", a = { active: "Active", onboarding: "Onboarding", dismissed: "Dismissed" }, n = "Employee name", i = "Job title", l = "Start date", c = "Status", d = "Last day", m = "Pending dismissal", p = "Last day {{date}}", r = "Edit employee", y = "Dismiss employee", b = "Cancel onboarding", g = "Employee actions menu", L = "List of employees", h = { active: { title: "There are no active employees", description: "Employees who have completed onboarding will appear here" }, onboarding: { title: "There are no employees onboarding", description: "Employees currently being onboarded will appear here" }, dismissed: { title: "There are no dismissed employees", description: "Terminated employees will appear here" } }, u = { title: "Cancel employee onboarding?", description: "This will permanently delete this employee from your account. This action cannot be undone.", confirmCta: "Delete employee", cancelCta: "Cancel" }, C = {
|
|
2
2
|
title: e,
|
|
3
3
|
addEmployeeCta: t,
|
|
4
4
|
backToListCta: o,
|
|
5
|
-
tabsLabel:
|
|
6
|
-
tabs:
|
|
5
|
+
tabsLabel: s,
|
|
6
|
+
tabs: a,
|
|
7
7
|
nameLabel: n,
|
|
8
|
-
jobTitleLabel:
|
|
9
|
-
startDateLabel:
|
|
8
|
+
jobTitleLabel: i,
|
|
9
|
+
startDateLabel: l,
|
|
10
10
|
statusLabel: c,
|
|
11
|
-
lastDayLabel:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
lastDayLabel: d,
|
|
12
|
+
pendingDismissalLabel: m,
|
|
13
|
+
pendingDismissalBadge: p,
|
|
14
|
+
editCta: r,
|
|
15
|
+
dismissCta: y,
|
|
16
|
+
cancelCta: b,
|
|
17
|
+
hamburgerTitle: g,
|
|
18
|
+
employeeListLabel: L,
|
|
17
19
|
emptyState: h,
|
|
18
|
-
deleteDialog:
|
|
20
|
+
deleteDialog: u
|
|
19
21
|
};
|
|
20
22
|
export {
|
|
21
23
|
t as addEmployeeCta,
|
|
22
24
|
o as backToListCta,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
b as cancelCta,
|
|
26
|
+
C as default,
|
|
27
|
+
u as deleteDialog,
|
|
28
|
+
y as dismissCta,
|
|
29
|
+
r as editCta,
|
|
30
|
+
L as employeeListLabel,
|
|
29
31
|
h as emptyState,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
g as hamburgerTitle,
|
|
33
|
+
i as jobTitleLabel,
|
|
34
|
+
d as lastDayLabel,
|
|
33
35
|
n as nameLabel,
|
|
34
|
-
|
|
36
|
+
p as pendingDismissalBadge,
|
|
37
|
+
m as pendingDismissalLabel,
|
|
38
|
+
l as startDateLabel,
|
|
35
39
|
c as statusLabel,
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
a as tabs,
|
|
41
|
+
s as tabsLabel,
|
|
38
42
|
e as title
|
|
39
43
|
};
|
|
40
44
|
//# sourceMappingURL=Employee.ManagementEmployeeList.json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Employee.ManagementEmployeeList.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Employee.ManagementEmployeeList.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const t = "Enter a net amount", a = "Please enter the net amount you want this employee to receive. We'll then automatically calculate the gross amount you need to pay, including taxes and deductions.", e = "This will override any previously entered amounts.", n = "Net amount", o = "Calculate", l = "Calculating...", s = "Apply", c = "
|
|
1
|
+
const t = "Enter a net amount", a = "Please enter the net amount you want this employee to receive. We'll then automatically calculate the gross amount you need to pay, including taxes and deductions.", e = "This will override any previously entered amounts.", n = "Net amount", o = "Calculate", l = "Calculating...", s = "Apply", c = "Calculate a gross amount first to apply it.", r = "Cancel", u = "Calculated gross pay", i = "Unable to calculate gross up. Please try again.", y = { netPay: "Net amount must be greater than zero cents" }, p = {
|
|
2
2
|
title: t,
|
|
3
3
|
description: a,
|
|
4
4
|
warning: e,
|
|
@@ -6,23 +6,25 @@ const t = "Enter a net amount", a = "Please enter the net amount you want this e
|
|
|
6
6
|
calculateCta: o,
|
|
7
7
|
calculatingCta: l,
|
|
8
8
|
applyCta: s,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
applyHint: c,
|
|
10
|
+
cancelCta: r,
|
|
11
|
+
grossPayResult: u,
|
|
12
|
+
errorMessage: i,
|
|
13
|
+
validations: y
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
16
|
s as applyCta,
|
|
17
|
+
c as applyHint,
|
|
16
18
|
o as calculateCta,
|
|
17
19
|
l as calculatingCta,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
r as cancelCta,
|
|
21
|
+
p as default,
|
|
20
22
|
a as description,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
i as errorMessage,
|
|
24
|
+
u as grossPayResult,
|
|
23
25
|
n as netPayLabel,
|
|
24
26
|
t as title,
|
|
25
|
-
|
|
27
|
+
y as validations,
|
|
26
28
|
e as warning
|
|
27
29
|
};
|
|
28
30
|
//# sourceMappingURL=Payroll.GrossUpModal.json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Payroll.GrossUpModal.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Payroll.GrossUpModal.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const e = "Edit Payroll", a = "{{payrollType}} payroll for <dateWrapper>{{startDate}} - {{endDate}}</dateWrapper>", l = "{{payrollType}} payroll", o = "Edit Payroll for {{startDate}} - {{endDate}}", t = "Edit Dismissal Payroll",
|
|
1
|
+
const e = "Edit Payroll", a = "{{payrollType}} payroll for <dateWrapper>{{startDate}} - {{endDate}}</dateWrapper>", l = "{{payrollType}} payroll", o = "Edit Payroll for {{startDate}} - {{endDate}}", t = "Edit Dismissal Payroll", s = "Save and exit", i = "Calculate and review", n = "Calculate and review", r = "Hours and additional earnings", p = "Review and update your employee's hours, reimbursements, and additional earnings below.", d = "Employee compensations", y = { employees: "Employees", hours: "Hours", timeOff: "Time off", additionalEarnings: "Additional earnings", reimbursements: "Reimbursements", totalPay: "Total pay" }, c = "Skipped", u = "Unknown employee", m = { edit: "Edit", skip: "Skip employee", unskip: "Unskip employee", setNetEarnings: "Set employee net earnings" }, g = { alreadyProcessed: "This payroll is already processed. If you'd like to make changes, please cancel and re-run it.", progressSaved: "Your progress has been saved", directDepositDeadline: "To pay your employees with direct deposit by {{payDate}}, you'll need to run payroll by {{time}} on {{date}}.", directDepositDeadlineText: "Make sure to submit before the deadline to ensure timely payments.", payrollLate: "Your original pay date was {{initialCheckDate}}", payrollLateText: "Run payroll before {{time}} on {{date}} to pay your employees on {{newCheckDate}}.", payrollDeadline: { label: "Payroll Deadline", message: "To pay your employees with direct deposit by the check date, you'll need to run payroll by the deadline." }, skippedEmployees: { label: "Skipped Employees", employeeAddressNotVerified: "Employee address not verified" }, employeeUpdated: { label: "{{employeeName}} updated successfully" }, processingFailed: { label: "This payroll couldn't be calculated", message: "Please try calculating again." } }, b = "Preparing payroll...", h = "This may take a minute or two. You can navigate away while this happens.", k = "Calculating payroll...", D = "This may take a minute or two. You can navigate away while this happens.", T = "Calculating payroll...", w = {
|
|
2
2
|
pageTitle: e,
|
|
3
3
|
description: a,
|
|
4
4
|
descriptionDismissal: l,
|
|
5
5
|
breadcrumbLabel: o,
|
|
6
6
|
breadcrumbLabelDismissal: t,
|
|
7
|
-
exitFlowCta:
|
|
7
|
+
exitFlowCta: s,
|
|
8
8
|
calculatePayroll: i,
|
|
9
|
-
calculatePayrollTitle:
|
|
9
|
+
calculatePayrollTitle: n,
|
|
10
10
|
hoursAndEarningsTitle: r,
|
|
11
11
|
hoursAndEarningsDescription: p,
|
|
12
12
|
employeeCompensationsTitle: d,
|
|
@@ -19,23 +19,23 @@ const e = "Edit Payroll", a = "{{payrollType}} payroll for <dateWrapper>{{startD
|
|
|
19
19
|
loadingDescription: h,
|
|
20
20
|
calculatingTitle: k,
|
|
21
21
|
calculatingDescription: D,
|
|
22
|
-
calculatingPayroll:
|
|
22
|
+
calculatingPayroll: T
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
25
25
|
g as alerts,
|
|
26
26
|
o as breadcrumbLabel,
|
|
27
27
|
t as breadcrumbLabelDismissal,
|
|
28
28
|
i as calculatePayroll,
|
|
29
|
-
|
|
29
|
+
n as calculatePayrollTitle,
|
|
30
30
|
D as calculatingDescription,
|
|
31
|
-
|
|
31
|
+
T as calculatingPayroll,
|
|
32
32
|
k as calculatingTitle,
|
|
33
|
-
|
|
33
|
+
w as default,
|
|
34
34
|
a as description,
|
|
35
35
|
l as descriptionDismissal,
|
|
36
36
|
m as editMenu,
|
|
37
37
|
d as employeeCompensationsTitle,
|
|
38
|
-
|
|
38
|
+
s as exitFlowCta,
|
|
39
39
|
p as hoursAndEarningsDescription,
|
|
40
40
|
r as hoursAndEarningsTitle,
|
|
41
41
|
h as loadingDescription,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "Submit", a = "Back", t = "Save and exit", o = "Review payroll", l = "Payroll summary", s = "{{payrollType}} payroll for <dateWrapper>{{startDate}} - {{endDate}}</dateWrapper>", i = "{{payrollType}} payroll", n = "Submit", r = "Edit", y = "Cancel payroll", p = "Cancel {{startDate}} - {{endDate}} payroll?", c = "Cancel payroll?", d = "You may cancel this payroll and run it again later. Your changes will be saved.", m = "Run this payroll by {{deadline}} to pay your employees on time.", u = "Yes, cancel payroll", b = "No, go back", T = "View payroll receipt", g = "Download paystub pdf",
|
|
1
|
+
const e = "Submit", a = "Back", t = "Save and exit", o = "Review payroll", l = "Payroll summary", s = "{{payrollType}} payroll for <dateWrapper>{{startDate}} - {{endDate}}</dateWrapper>", i = "{{payrollType}} payroll", n = "Submit", r = "Edit", y = "Cancel payroll", p = "Cancel {{startDate}} - {{endDate}} payroll?", c = "Cancel payroll?", d = "You may cancel this payroll and run it again later. Your changes will be saved.", m = "Run this payroll by {{deadline}} to pay your employees on time.", u = "Yes, cancel payroll", b = "No, go back", T = "View payroll receipt", g = "Download paystub pdf", h = "Generating paystub…", D = "Submitting payroll...", f = "This may take a minute or two. You can navigate away while this happens.", w = "Loading payroll...", P = "Cancelling payroll...", x = "This payroll has been cancelled.", k = "Skipped", C = { payrollNotCalculated: "Payroll is not calculated", payrollLoadFailed: "There was an issue loading this payroll. Please try again.", directDepositDeadline: "To pay your employees with direct deposit by {{payDate}}, you'll need to run payroll by {{time}} on {{date}}.", directDepositDeadlineText: "Make sure to submit before the deadline to ensure timely payments.", paystubPdfError: "There was an issue generating the paystub PDF. Please try again later.", payrollProcessedTitle: "Payroll submitted", payrollProcessedMessage: "{{amount}} will be debited on {{date}}. Make sure you have these funds available.", payrollProcessingFailedTitle: "There was an error submitting payroll", payrollProcessingFailedCtaLabel: "Recalculate payroll", wireDetailsSubmittedTitle: "Wire details submitted", wireDetailsSubmittedMessage: "Once we receive the funds from your bank we'll pay your team on {{checkDate}}" }, L = "Payroll Summary", S = "Payroll summary (Wire funds)", v = "Payroll summary (4-day direct deposit)", E = "Payroll summary table", B = { label: "Payroll details", companyPaysTab: "Company pays", companyPaysTable: "Company pays by employee", hoursWorkedTab: "Hours worked", hoursWorkedTable: "Hours worked by employee", employeeTakeHomeTab: "Employee take home", employeeTakeHomeTable: "Employee take home by employee", taxesTab: "Taxed and debited", taxesTable: "Taxes breakdown", debitedTable: "Debited totals by company" }, W = { totalPayroll: "Total payroll", debitAmount: "Debit amount", wireAmount: "Wire amount", wireTransferDeadline: "Wire transfer deadline", employees: "Employees", grossPay: "Gross Pay", reimbursements: "Reimbursements", debitAccount: "Debit account", debitDate: "Debit date", employeePayDate: "Employee pay date", companyTaxes: "Company taxes", companyBenefits: "Company benefits", companyPays: "Company pays", compensationType: "Compensation type", regular: "Regular", overtime: "Overtime (1.5x)", doubleOT: "Overtime (2x)", timeOff: "Paid time off", totalHours: "Total hours", paymentType: "Payment type", employeeTaxes: "Employee taxes", employeeBenefits: "Employee benefits", payment: "Payment", deductions: "Deductions", taxDescription: "Tax description", byYourEmployees: "By your employees", byYourCompany: "By your company", debitedByGusto: "Debited by Gusto", taxesTotal: "Total", paystub: "Paystub", footerTotalsLabel: "Totals", footerTotalsDescription: "All employees in this payroll" }, F = "Totals", _ = "Direct deposits", O = "Reimbursements", Y = "Garnishments", H = "Taxes (Employees and Employers)", R = { exempt: "Salaried / Exempt", nonexempt: "Hourly / Nonexempt" }, M = { genericBlockerTitle: "Submission blocked", genericBlockerMessage: "This payroll cannot be submitted. Please contact support for assistance.", fastAchOptions: { description: "Payroll can still be funded by selecting one of the options below. The selected funding method will only be used for this cycle and will not apply to future payroll.", fundingOptionsLabel: "Funding options", wireLabel: "Wire funds", wireFastestBadge: "Fastest", wireDescription: "Pay your employees on time by sending a wire transfer. We'll provide instructions on the next step.", directDepositLabel: "Switch to 4-day direct deposit", directDepositDescription: "Delay your employees pay date by four days and process using regular debits.", employeePayDate: "Employee pay date: {{date}}" }, fast_ach_threshold_exceeded: { title: "You have exceeded the limit at which you can process {{days}} payroll." }, needs_earned_access_for_fast_ach: { title: "You have not yet earned access to faster payroll." } }, A = {
|
|
2
2
|
breadcrumbLabel: e,
|
|
3
3
|
backCta: a,
|
|
4
4
|
exitFlowCta: t,
|
|
@@ -17,22 +17,22 @@ const e = "Submit", a = "Back", t = "Save and exit", o = "Review payroll", l = "
|
|
|
17
17
|
declineCancelCta: b,
|
|
18
18
|
payrollReceiptCta: T,
|
|
19
19
|
downloadPaystubLabel: g,
|
|
20
|
-
downloadLoadingMessage:
|
|
21
|
-
loadingTitle:
|
|
20
|
+
downloadLoadingMessage: h,
|
|
21
|
+
loadingTitle: D,
|
|
22
22
|
loadingDescription: f,
|
|
23
23
|
dataLoadingTitle: w,
|
|
24
24
|
cancellingTitle: P,
|
|
25
25
|
cancelledEmptyState: x,
|
|
26
26
|
skippedBadge: k,
|
|
27
27
|
alerts: C,
|
|
28
|
-
payrollSummaryTitle:
|
|
29
|
-
payrollSummaryTitleWire:
|
|
30
|
-
payrollSummaryTitleFourDay:
|
|
28
|
+
payrollSummaryTitle: L,
|
|
29
|
+
payrollSummaryTitleWire: S,
|
|
30
|
+
payrollSummaryTitleFourDay: v,
|
|
31
31
|
payrollSummaryLabel: E,
|
|
32
32
|
dataViews: B,
|
|
33
33
|
tableHeaders: W,
|
|
34
|
-
totalsLabel:
|
|
35
|
-
directDepositLabel:
|
|
34
|
+
totalsLabel: F,
|
|
35
|
+
directDepositLabel: _,
|
|
36
36
|
reimbursementLabel: O,
|
|
37
37
|
garnishmentsLabel: Y,
|
|
38
38
|
taxesLabel: H,
|
|
@@ -56,22 +56,22 @@ export {
|
|
|
56
56
|
B as dataViews,
|
|
57
57
|
b as declineCancelCta,
|
|
58
58
|
A as default,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
_ as directDepositLabel,
|
|
60
|
+
h as downloadLoadingMessage,
|
|
61
61
|
g as downloadPaystubLabel,
|
|
62
62
|
r as editCta,
|
|
63
63
|
t as exitFlowCta,
|
|
64
64
|
Y as garnishmentsLabel,
|
|
65
65
|
f as loadingDescription,
|
|
66
|
-
|
|
66
|
+
D as loadingTitle,
|
|
67
67
|
o as overviewTitle,
|
|
68
68
|
s as pageSubtitle,
|
|
69
69
|
i as pageSubtitleDismissal,
|
|
70
70
|
T as payrollReceiptCta,
|
|
71
71
|
E as payrollSummaryLabel,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
L as payrollSummaryTitle,
|
|
73
|
+
v as payrollSummaryTitleFourDay,
|
|
74
|
+
S as payrollSummaryTitleWire,
|
|
75
75
|
O as reimbursementLabel,
|
|
76
76
|
k as skippedBadge,
|
|
77
77
|
M as submissionBlockers,
|
|
@@ -79,6 +79,6 @@ export {
|
|
|
79
79
|
l as summaryTitle,
|
|
80
80
|
W as tableHeaders,
|
|
81
81
|
H as taxesLabel,
|
|
82
|
-
|
|
82
|
+
F as totalsLabel
|
|
83
83
|
};
|
|
84
84
|
//# sourceMappingURL=Payroll.PayrollOverview.json.js.map
|
package/dist/package.json.js
CHANGED
|
@@ -64,7 +64,7 @@ export interface ComboBoxProps extends SharedFieldLayoutProps, Pick<InputHTMLAtt
|
|
|
64
64
|
allowsCustomValue?: boolean;
|
|
65
65
|
/**
|
|
66
66
|
* Element to use as the portal container for the dropdown popover.
|
|
67
|
-
* Overrides the default
|
|
67
|
+
* Overrides the SDK's default portal root (a themed element appended to `document.body`).
|
|
68
68
|
*/
|
|
69
69
|
portalContainer?: HTMLElement;
|
|
70
70
|
}
|
|
@@ -41,7 +41,8 @@ export interface DatePickerProps extends SharedFieldLayoutProps, Pick<InputHTMLA
|
|
|
41
41
|
*/
|
|
42
42
|
placeholder?: string;
|
|
43
43
|
/**
|
|
44
|
-
* Element to use as the portal container
|
|
44
|
+
* Element to use as the portal container for the popover.
|
|
45
|
+
* Overrides the SDK's default portal root (a themed element appended to `document.body`).
|
|
45
46
|
*/
|
|
46
47
|
portalContainer?: HTMLElement;
|
|
47
48
|
/**
|
|
@@ -61,7 +61,7 @@ export interface MenuProps extends DataAttributes {
|
|
|
61
61
|
'aria-label': string;
|
|
62
62
|
/**
|
|
63
63
|
* Element to use as the portal container for the menu popover.
|
|
64
|
-
* Overrides the default
|
|
64
|
+
* Overrides the SDK's default portal root (a themed element appended to `document.body`).
|
|
65
65
|
*/
|
|
66
66
|
portalContainer?: HTMLElement;
|
|
67
67
|
/**
|
|
@@ -6,4 +6,4 @@ import { MultiSelectComboBoxProps } from './MultiSelectComboBoxTypes';
|
|
|
6
6
|
* @returns The rendered multi-select combo box field.
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
export declare function MultiSelectComboBox({ className, description, errorMessage, id, inputRef: inputRefFromProps, isDisabled, isInvalid, isLoading, isRequired, label, name, onBlur, onChange, options, placeholder, value: selectedValues, shouldVisuallyHideLabel, }: MultiSelectComboBoxProps): import("react").JSX.Element;
|
|
9
|
+
export declare function MultiSelectComboBox({ className, description, errorMessage, id, inputRef: inputRefFromProps, isDisabled, isInvalid, isLoading, isRequired, label, name, onBlur, onChange, options, placeholder, portalContainer, value: selectedValues, shouldVisuallyHideLabel, }: MultiSelectComboBoxProps): import("react").JSX.Element;
|
|
@@ -65,4 +65,9 @@ export interface MultiSelectComboBoxProps extends SharedFieldLayoutProps, Pick<I
|
|
|
65
65
|
* Handler for blur events
|
|
66
66
|
*/
|
|
67
67
|
onBlur?: () => void;
|
|
68
|
+
/**
|
|
69
|
+
* Element to use as the portal container for the dropdown popover.
|
|
70
|
+
* Overrides the SDK's default portal root (a themed element appended to `document.body`).
|
|
71
|
+
*/
|
|
72
|
+
portalContainer?: HTMLElement;
|
|
68
73
|
}
|
|
@@ -62,7 +62,8 @@ export interface SelectProps extends SharedFieldLayoutProps, Pick<SelectHTMLAttr
|
|
|
62
62
|
*/
|
|
63
63
|
inputRef?: Ref<HTMLButtonElement>;
|
|
64
64
|
/**
|
|
65
|
-
* Element to use as the portal container
|
|
65
|
+
* Element to use as the portal container for the popover.
|
|
66
|
+
* Overrides the SDK's default portal root (a themed element appended to `document.body`).
|
|
66
67
|
*/
|
|
67
68
|
portalContainer?: HTMLElement;
|
|
68
69
|
}
|
|
@@ -20,6 +20,8 @@ export interface EmployeeWithActions extends Employee {
|
|
|
20
20
|
allowedActions: EmployeeAction[];
|
|
21
21
|
/** The employee's primary job, if one is marked primary. */
|
|
22
22
|
primaryJob?: Job;
|
|
23
|
+
/** Effective date of a termination that hasn't gone into effect yet, if one is scheduled. */
|
|
24
|
+
pendingDismissalDate?: string;
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
25
27
|
* Filter applied to {@link useEmployeeList} that scopes the result set and tailors the per-row action list.
|
|
@@ -73,8 +75,11 @@ export type UseEmployeeListResult = HookLoadingResult | UseEmployeeListReady;
|
|
|
73
75
|
*
|
|
74
76
|
* @remarks
|
|
75
77
|
* `employeeType` maps to a server-side filter and changes which actions appear on each row:
|
|
76
|
-
* `'active'` adds `dismiss
|
|
77
|
-
* to list every employee.
|
|
78
|
+
* `'active'` adds `dismiss` unless the employee already has a termination scheduled for a future
|
|
79
|
+
* date, `'terminated'` adds `rehire`, `'onboarding'` adds none. Omit it to list every employee.
|
|
80
|
+
*
|
|
81
|
+
* An `'active'` row with a pending termination carries its effective date on
|
|
82
|
+
* `pendingDismissalDate` instead of the `dismiss` action.
|
|
78
83
|
*
|
|
79
84
|
* `'onboarding'` includes employees who haven't completed onboarding as well as employees who
|
|
80
85
|
* have completed onboarding but whose primary job's hire date hasn't arrived yet, so `onboarded`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OffCycleCreationPresentationProps } from './OffCycleCreationTypes';
|
|
2
2
|
/** @internal */
|
|
3
|
-
export declare function OffCycleCreationPresentation({ employees, isPending, minCheckDate, minCheckOnlyDate, maxDate, minPayPeriodDate, taxWithholdingConfig, isTaxWithholdingModalOpen, onTaxWithholdingEditClick, onTaxWithholdingModalDone, onTaxWithholdingModalCancel, className, }: OffCycleCreationPresentationProps): import("react").JSX.Element;
|
|
3
|
+
export declare function OffCycleCreationPresentation({ employees, blockers, isPending, minCheckDate, minCheckOnlyDate, maxDate, minPayPeriodDate, taxWithholdingConfig, isTaxWithholdingModalOpen, onTaxWithholdingEditClick, onTaxWithholdingModalDone, onTaxWithholdingModalCancel, className, }: OffCycleCreationPresentationProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OffCycleReason } from '../OffCycleReasonSelection';
|
|
2
2
|
import { OffCyclePayPeriodDateFormData, OffCyclePayrollDateType } from '../OffCyclePayPeriodDateForm';
|
|
3
3
|
import { OffCycleTaxWithholdingConfig } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes';
|
|
4
|
+
import { ApiPayrollBlocker } from '../PayrollBlocker/payrollHelpers';
|
|
4
5
|
import { MultiSelectComboBoxOption } from '../../Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes';
|
|
5
6
|
import { BaseComponentInterface } from '../../Base/Base';
|
|
6
7
|
/**
|
|
@@ -33,6 +34,11 @@ export interface OffCycleCreationFormData extends OffCyclePayPeriodDateFormData
|
|
|
33
34
|
export interface OffCycleCreationPresentationProps {
|
|
34
35
|
/** Selectable employees rendered in the multi-select. */
|
|
35
36
|
employees: MultiSelectComboBoxOption[];
|
|
37
|
+
/**
|
|
38
|
+
* Run-payroll blockers for the company. When non-empty, a blocker alert is shown and the
|
|
39
|
+
* submit action is disabled so the off-cycle payroll cannot be created while a blocker is active.
|
|
40
|
+
*/
|
|
41
|
+
blockers: ApiPayrollBlocker[];
|
|
36
42
|
/** Whether the off-cycle create mutation is in flight. */
|
|
37
43
|
isPending?: boolean;
|
|
38
44
|
/** Earliest selectable payment date for direct deposit (today plus the ACH lead time). */
|
|
@@ -35,6 +35,11 @@ export interface UseCalculationPollOptions {
|
|
|
35
35
|
refetch: () => Promise<QueryObserverResult<PayrollsGetQueryData, PayrollsGetQueryError>>;
|
|
36
36
|
onCalculated: (payroll: PayrollShow | undefined) => void;
|
|
37
37
|
onProcessingFailed: (payroll: PayrollShow | undefined) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Called when the poll gives up on a non-retryable read error, without ever confirming a
|
|
40
|
+
* calculated/failed outcome. The raw error is reported to observability by this hook already.
|
|
41
|
+
*/
|
|
42
|
+
onError: () => void;
|
|
38
43
|
}
|
|
39
44
|
/** @internal */
|
|
40
45
|
export interface CalculationPoll {
|
|
@@ -46,5 +51,5 @@ export interface CalculationPoll {
|
|
|
46
51
|
*
|
|
47
52
|
* @internal
|
|
48
53
|
*/
|
|
49
|
-
export declare function useCalculationPoll({ refetch, onCalculated, onProcessingFailed, }: UseCalculationPollOptions): CalculationPoll;
|
|
54
|
+
export declare function useCalculationPoll({ refetch, onCalculated, onProcessingFailed, onError, }: UseCalculationPollOptions): CalculationPoll;
|
|
50
55
|
export {};
|
|
@@ -25,6 +25,15 @@ export interface UseSubmissionPollOptions {
|
|
|
25
25
|
refetch: () => Promise<QueryObserverResult<PayrollsGetQueryData, PayrollsGetQueryError>>;
|
|
26
26
|
onProcessed: (payroll: PayrollShow | undefined) => void;
|
|
27
27
|
onProcessingFailed: (payroll: PayrollShow | undefined) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Called when the poll gives up on a non-retryable read error, but only for a run that was
|
|
30
|
+
* actually tracking a submission (`baseline` set, or a `submitting` status observed mid-run).
|
|
31
|
+
* A baseline-less mount poll that never saw `submitting` swallows the error here -- it was only
|
|
32
|
+
* guarding the initial render, not watching a real submission, so surfacing it as a processing
|
|
33
|
+
* failure would be a false failure. The raw error is reported to observability by this hook
|
|
34
|
+
* either way.
|
|
35
|
+
*/
|
|
36
|
+
onError: () => void;
|
|
28
37
|
}
|
|
29
38
|
/** @internal */
|
|
30
39
|
export interface SubmissionPoll {
|
|
@@ -36,4 +45,4 @@ export interface SubmissionPoll {
|
|
|
36
45
|
*
|
|
37
46
|
* @internal
|
|
38
47
|
*/
|
|
39
|
-
export declare function useSubmissionPoll({ refetch, onProcessed, onProcessingFailed, }: UseSubmissionPollOptions): SubmissionPoll;
|
|
48
|
+
export declare function useSubmissionPoll({ refetch, onProcessed, onProcessingFailed, onError, }: UseSubmissionPollOptions): SubmissionPoll;
|
|
@@ -21,9 +21,11 @@ export interface ApiProviderProps {
|
|
|
21
21
|
* Wires the `@gusto/embedded-api-v-2026-06-15` client and a React Query client into the React tree.
|
|
22
22
|
*
|
|
23
23
|
* @remarks
|
|
24
|
-
* Registers the SDK's `X-Gusto-API-Version` header on every request,
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* Registers the SDK's `X-Gusto-API-Version` header on every request, warns via `console.warn` if a
|
|
25
|
+
* response reports a different `X-Gusto-API-Version` than was requested (e.g. a proxy rewriting the
|
|
26
|
+
* header), applies any default `headers`, and registers user-supplied lifecycle hooks
|
|
27
|
+
* (`beforeCreateRequest`, `beforeRequest`, `afterSuccess`, `afterError`). When no `queryClient` is
|
|
28
|
+
* supplied, one is created with the SDK's defaults so
|
|
27
29
|
* successful mutations under the `['@gusto/embedded-api-v-2026-06-15']` key invalidate every SDK
|
|
28
30
|
* query automatically. Partners who supply their own `QueryClient` are responsible for matching that
|
|
29
31
|
* contract.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|