@gusto/embedded-react-sdk 0.56.4 → 0.56.5
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/Common/DocumentEmbed/DocumentEmbed.js +18 -0
- package/dist/components/Common/DocumentEmbed/DocumentEmbed.js.map +1 -0
- package/dist/components/Common/DocumentViewer/DocumentViewer.js +35 -29
- package/dist/components/Common/DocumentViewer/DocumentViewer.js.map +1 -1
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +6 -3
- package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +6 -3
- package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js +8 -5
- package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
- package/dist/components/Company/BankAccount/BankAccountForm/context.js +6 -3
- package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +6 -3
- package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js +11 -8
- package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
- package/dist/components/Company/Industry/Context.js +9 -6
- package/dist/components/Company/Industry/Context.js.map +1 -1
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js +6 -3
- package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js +6 -3
- package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
- package/dist/components/Company/OnboardingOverview/context.js +6 -3
- package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +6 -3
- package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js +6 -3
- package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +6 -3
- package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js +64 -61
- package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map +1 -1
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +133 -134
- package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -1
- package/dist/components/Contractor/ContractorListFlow/ContractorListFlow.js.map +1 -1
- package/dist/components/Contractor/ContractorListFlow/ContractorListFlowComponents.js +22 -9
- package/dist/components/Contractor/ContractorListFlow/ContractorListFlowComponents.js.map +1 -1
- package/dist/components/Contractor/ContractorListFlow/contractorListStateMachine.js +51 -20
- package/dist/components/Contractor/ContractorListFlow/contractorListStateMachine.js.map +1 -1
- package/dist/components/Contractor/Dismissal/Dismissal.js +77 -0
- package/dist/components/Contractor/Dismissal/Dismissal.js.map +1 -0
- package/dist/components/Contractor/Dismissal/DismissalPresentation.js +57 -0
- package/dist/components/Contractor/Dismissal/DismissalPresentation.js.map +1 -0
- package/dist/components/Contractor/Dismissal/useDismissal/useDismissal.js +44 -0
- package/dist/components/Contractor/Dismissal/useDismissal/useDismissal.js.map +1 -0
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +45 -41
- package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
- package/dist/components/Contractor/exports/contractorManagement.js +56 -54
- package/dist/components/Contractor/exports/contractorManagement.js.map +1 -1
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +6 -3
- package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
- package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +201 -196
- package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js +55 -52
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/fields.js.map +1 -1
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.js +38 -29
- package/dist/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +17 -14
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js +72 -68
- package/dist/components/Payroll/UNSTABLE_PayrollEditEmployee/UNSTABLE_PayrollEditEmployee.js.map +1 -1
- package/dist/components/Payroll/usePreparedPayrollData.js +10 -7
- package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
- package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
- package/dist/i18n/I18n.js +1 -0
- package/dist/i18n/I18n.js.map +1 -1
- package/dist/i18n/en/Contractor.Dismissal.json.js +20 -0
- package/dist/i18n/en/Contractor.Dismissal.json.js.map +1 -0
- package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +2 -2
- package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +38 -38
- package/dist/i18n/en/Payroll.UNSTABLE_PayrollEditEmployee.json.js +31 -31
- package/dist/i18n/en/common.json.js +37 -35
- package/dist/i18n/en/common.json.js.map +1 -1
- package/dist/package.json.js +1 -1
- package/dist/shared/constants.js +1 -0
- package/dist/shared/constants.js.map +1 -1
- package/dist/src/components/Common/DocumentEmbed/DocumentEmbed.d.ts +3 -0
- package/dist/src/components/Common/DocumentEmbed/DocumentEmbedTypes.d.ts +25 -0
- package/dist/src/components/Common/DocumentEmbed/index.d.ts +2 -0
- package/dist/src/components/Contractor/ContractorList/management/ManagementContractorList.d.ts +2 -0
- package/dist/src/components/Contractor/ContractorList/management/ManagementContractorListView.d.ts +3 -1
- package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlow.d.ts +6 -4
- package/dist/src/components/Contractor/ContractorListFlow/ContractorListFlowComponents.d.ts +2 -0
- package/dist/src/components/Contractor/ContractorListFlow/contractorListStateMachine.d.ts +1 -0
- package/dist/src/components/Contractor/ContractorListFlow/contractorListStateMachine.test.d.ts +1 -0
- package/dist/src/components/Contractor/Dismissal/Dismissal.d.ts +45 -0
- package/dist/src/components/Contractor/Dismissal/DismissalPresentation.d.ts +17 -0
- package/dist/src/components/Contractor/Dismissal/useDismissal/useDismissal.d.ts +41 -0
- package/dist/src/components/Contractor/Dismissal/useDismissal/useDismissal.test.d.ts +1 -0
- package/dist/src/components/Contractor/exports/contractorManagement.d.ts +1 -0
- package/dist/src/components/Payroll/PayrollEditEmployee/shared/usePayrollEditEmployeeForm/payrollEditEmployeeSchema.d.ts +19 -0
- package/dist/src/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
- package/dist/src/contexts/ComponentAdapter/useComponentContext.d.ts +5 -2
- package/dist/src/i18n/en/common.json.d.ts +3 -0
- package/dist/src/i18n/types.d.ts +47 -0
- package/dist/src/shared/constants.d.ts +2 -0
- package/docs/guides/endpoint-inventory.json +18 -0
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useContractorList as
|
|
4
|
-
import { ManagementContractorListView as
|
|
5
|
-
import { BaseBoundaries as
|
|
6
|
-
import { useI18n as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R } from "react";
|
|
3
|
+
import { useContractorList as f } from "../shared/useContractorList.js";
|
|
4
|
+
import { ManagementContractorListView as E } from "./ManagementContractorListView.js";
|
|
5
|
+
import { BaseBoundaries as _, BaseLayout as T } from "../../../Base/Base.js";
|
|
6
|
+
import { useI18n as S, useComponentDictionary as b } from "../../../../i18n/I18n.js";
|
|
7
7
|
import { componentEvents as o } from "../../../../shared/constants.js";
|
|
8
|
-
const
|
|
9
|
-
switch (
|
|
8
|
+
const M = (e) => {
|
|
9
|
+
switch (e) {
|
|
10
10
|
case "active":
|
|
11
11
|
return "active";
|
|
12
12
|
case "onboarding":
|
|
@@ -15,88 +15,91 @@ const _ = (r) => {
|
|
|
15
15
|
return "terminated";
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
companyId:
|
|
18
|
+
function w({
|
|
19
|
+
companyId: e,
|
|
20
20
|
initialTab: i = "active",
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
successMessage: c,
|
|
22
|
+
onEvent: a,
|
|
23
|
+
dictionary: g,
|
|
24
|
+
LoaderComponent: C,
|
|
25
|
+
className: l
|
|
25
26
|
}) {
|
|
26
|
-
|
|
27
|
-
const [
|
|
28
|
-
companyId:
|
|
29
|
-
contractorType:
|
|
27
|
+
S("Contractor.ManagementContractorList"), b("Contractor.ManagementContractorList", g);
|
|
28
|
+
const [d, O] = R(i), [u, r] = R(c), n = f({
|
|
29
|
+
companyId: e,
|
|
30
|
+
contractorType: M(d)
|
|
30
31
|
});
|
|
31
|
-
if (
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
32
|
+
if (n.isLoading)
|
|
33
|
+
return /* @__PURE__ */ s(
|
|
34
|
+
T,
|
|
34
35
|
{
|
|
35
36
|
isLoading: !0,
|
|
36
|
-
error:
|
|
37
|
-
LoaderComponent:
|
|
37
|
+
error: n.errorHandling.errors,
|
|
38
|
+
LoaderComponent: C
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
}, O = (t) => {
|
|
43
|
-
n(o.CONTRACTOR_VIEW, { contractorId: t });
|
|
44
|
-
}, g = () => {
|
|
45
|
-
n(o.CONTRACTOR_CREATE);
|
|
46
|
-
}, u = (t) => {
|
|
47
|
-
n(o.CONTRACTOR_DISMISS, { contractorId: t });
|
|
48
|
-
}, A = (t) => {
|
|
49
|
-
n(o.CONTRACTOR_REHIRE, { contractorId: t });
|
|
41
|
+
const A = (t) => {
|
|
42
|
+
a(o.CONTRACTOR_UPDATE, { contractorId: t });
|
|
50
43
|
}, L = (t) => {
|
|
51
|
-
|
|
44
|
+
a(o.CONTRACTOR_VIEW, { contractorId: t });
|
|
45
|
+
}, h = () => {
|
|
46
|
+
a(o.CONTRACTOR_CREATE);
|
|
47
|
+
}, D = (t) => {
|
|
48
|
+
a(o.CONTRACTOR_DISMISS, { contractorId: t });
|
|
49
|
+
}, N = (t) => {
|
|
50
|
+
a(o.CONTRACTOR_REHIRE, { contractorId: t });
|
|
51
|
+
}, p = (t) => {
|
|
52
|
+
r(void 0), O(t);
|
|
52
53
|
};
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
|
|
54
|
+
return /* @__PURE__ */ s(T, { error: n.errorHandling.errors, LoaderComponent: C, children: /* @__PURE__ */ s(
|
|
55
|
+
E,
|
|
55
56
|
{
|
|
56
|
-
className:
|
|
57
|
-
selectedTab:
|
|
58
|
-
onTabChange:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
className: l,
|
|
58
|
+
selectedTab: d,
|
|
59
|
+
onTabChange: p,
|
|
60
|
+
successMessage: u,
|
|
61
|
+
contractors: n.data.contractors,
|
|
62
|
+
isFetching: n.status.isFetching,
|
|
63
|
+
pagination: n.pagination,
|
|
64
|
+
status: n.status,
|
|
65
|
+
onEdit: A,
|
|
66
|
+
onView: L,
|
|
67
|
+
onDismiss: D,
|
|
68
|
+
onRehire: N,
|
|
67
69
|
onDelete: async (t) => {
|
|
68
|
-
await
|
|
70
|
+
r(void 0), await n.actions.onDelete(t), a(o.CONTRACTOR_DELETED, { contractorId: t });
|
|
69
71
|
},
|
|
70
72
|
onCancelSelfOnboarding: async (t) => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
r(void 0);
|
|
74
|
+
const m = await n.actions.onCancelSelfOnboarding(t);
|
|
75
|
+
m && a(o.CONTRACTOR_SELF_ONBOARDING_CANCELLED, m);
|
|
73
76
|
},
|
|
74
77
|
onCancelDismissal: async (t) => {
|
|
75
|
-
await
|
|
78
|
+
r(void 0), await n.actions.onCancelDismissal(t), a(o.CONTRACTOR_DISMISSAL_CANCELLED, { contractorId: t });
|
|
76
79
|
},
|
|
77
80
|
onCancelRehire: async (t) => {
|
|
78
|
-
await
|
|
81
|
+
r(void 0), await n.actions.onCancelRehire(t), a(o.CONTRACTOR_REHIRE_CANCELLED, { contractorId: t });
|
|
79
82
|
},
|
|
80
|
-
onAddContractor:
|
|
83
|
+
onAddContractor: h
|
|
81
84
|
}
|
|
82
85
|
) });
|
|
83
86
|
}
|
|
84
|
-
function
|
|
85
|
-
FallbackComponent:
|
|
87
|
+
function j({
|
|
88
|
+
FallbackComponent: e,
|
|
86
89
|
LoaderComponent: i,
|
|
87
|
-
...
|
|
90
|
+
...c
|
|
88
91
|
}) {
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
|
|
92
|
+
return /* @__PURE__ */ s(
|
|
93
|
+
_,
|
|
91
94
|
{
|
|
92
95
|
componentName: "Contractor.ManagementContractorList",
|
|
93
|
-
FallbackComponent:
|
|
96
|
+
FallbackComponent: e,
|
|
94
97
|
LoaderComponent: i,
|
|
95
|
-
children: /* @__PURE__ */
|
|
98
|
+
children: /* @__PURE__ */ s(w, { LoaderComponent: i, ...c })
|
|
96
99
|
}
|
|
97
100
|
);
|
|
98
101
|
}
|
|
99
102
|
export {
|
|
100
|
-
|
|
103
|
+
j as ManagementContractorList
|
|
101
104
|
};
|
|
102
105
|
//# sourceMappingURL=ManagementContractorList.js.map
|
package/dist/components/Contractor/ContractorList/management/ManagementContractorList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManagementContractorList.js","sources":["../../../../../src/components/Contractor/ContractorList/management/ManagementContractorList.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useContractorList, type ContractorType } from '../shared/useContractorList'\nimport { ManagementContractorListView } from './ManagementContractorListView'\nimport { BaseBoundaries, BaseLayout, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * The tab currently selected on {@link ManagementContractorList}.\n *\n * @public\n */\nexport type ContractorTab = 'active' | 'onboarding' | 'dismissed'\n\n/**\n * Props for {@link ManagementContractorList}.\n *\n * @public\n */\nexport interface ManagementContractorListProps extends BaseComponentInterface<'Contractor.ManagementContractorList'> {\n /** The associated company identifier. */\n companyId: string\n /** Tab to render first: Active, Onboarding, or Dismissed. Defaults to `'active'`. */\n initialTab?: ContractorTab\n}\n\nconst mapTabToContractorType = (tab: ContractorTab): ContractorType => {\n switch (tab) {\n case 'active':\n return 'active'\n case 'onboarding':\n return 'onboarding'\n case 'dismissed':\n return 'terminated'\n }\n}\n\nfunction ManagementContractorListRoot({\n companyId,\n initialTab = 'active',\n onEvent,\n dictionary,\n LoaderComponent,\n className,\n}: ManagementContractorListProps) {\n useI18n('Contractor.ManagementContractorList')\n useComponentDictionary('Contractor.ManagementContractorList', dictionary)\n\n const [selectedTab, setSelectedTab] = useState<ContractorTab>(initialTab)\n\n const contractorList = useContractorList({\n companyId,\n contractorType: mapTabToContractorType(selectedTab),\n })\n\n if (contractorList.isLoading) {\n return (\n <BaseLayout\n isLoading\n error={contractorList.errorHandling.errors}\n LoaderComponent={LoaderComponent}\n />\n )\n }\n\n const handleEdit = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_UPDATE, { contractorId })\n }\n\n const handleView = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_VIEW, { contractorId })\n }\n\n const handleAddContractor = () => {\n onEvent(componentEvents.CONTRACTOR_CREATE)\n }\n\n const handleDismiss = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_DISMISS, { contractorId })\n }\n\n const handleRehire = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_REHIRE, { contractorId })\n }\n\n const handleTabChange = (tab: ContractorTab) => {\n setSelectedTab(tab)\n }\n\n return (\n <BaseLayout error={contractorList.errorHandling.errors} LoaderComponent={LoaderComponent}>\n <ManagementContractorListView\n className={className}\n selectedTab={selectedTab}\n onTabChange={handleTabChange}\n contractors={contractorList.data.contractors}\n isFetching={contractorList.status.isFetching}\n pagination={contractorList.pagination}\n status={contractorList.status}\n onEdit={handleEdit}\n onView={handleView}\n onDismiss={handleDismiss}\n onRehire={handleRehire}\n onDelete={async (contractorId: string) => {\n await contractorList.actions.onDelete(contractorId)\n onEvent(componentEvents.CONTRACTOR_DELETED, { contractorId })\n }}\n onCancelSelfOnboarding={async (contractorId: string) => {\n const onboardingStatus = await contractorList.actions.onCancelSelfOnboarding(contractorId)\n if (!onboardingStatus) return\n onEvent(componentEvents.CONTRACTOR_SELF_ONBOARDING_CANCELLED, onboardingStatus)\n }}\n onCancelDismissal={async (contractorId: string) => {\n await contractorList.actions.onCancelDismissal(contractorId)\n onEvent(componentEvents.CONTRACTOR_DISMISSAL_CANCELLED, { contractorId })\n }}\n onCancelRehire={async (contractorId: string) => {\n await contractorList.actions.onCancelRehire(contractorId)\n onEvent(componentEvents.CONTRACTOR_REHIRE_CANCELLED, { contractorId })\n }}\n onAddContractor={handleAddContractor}\n />\n </BaseLayout>\n )\n}\n\n/**\n * Renders a tabbed list of a company's contractors split across Active, Onboarding, and Dismissed\n * tabs, with per-row actions tailored to each tab (edit, delete, view details, dismiss, rehire,\n * cancel a scheduled dismissal or rehire).\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/create` | Fired when the user clicks \"Add contractor\". | — |\n * | `contractor/update` | Fired when the user selects \"Edit\"/\"Review\" on an onboarding-tab row. | `{ contractorId: string }` |\n * | `contractor/view` | Fired when the user selects \"View details\" on an active or dismissed row. | `{ contractorId: string }` |\n * | `contractor/deleted` | Fired after an onboarding-tab row's \"Remove\" action completes. | `{ contractorId: string }` |\n * | `contractor/selfOnboarding/cancelled` | Fired after the \"Cancel self-onboarding\" action updates a contractor's onboarding status. | The updated `contractorOnboardingStatus` returned by the API. |\n * | `contractor/dismiss` | Fired when the user selects \"Dismiss\" on an active row. No mutation is performed by this component. | `{ contractorId: string }` |\n * | `contractor/rehire` | Fired when the user selects \"Rehire\" on a dismissed row. No mutation is performed by this component. | `{ contractorId: string }` |\n * | `contractor/dismissal/cancelled` | Fired after a scheduled dismissal is cancelled via the confirm dialog. | `{ contractorId: string }` |\n * | `contractor/rehire/cancelled` | Fired after a scheduled rehire is cancelled via the confirm dialog. | `{ contractorId: string }` |\n *\n * @public\n */\nexport function ManagementContractorList({\n FallbackComponent,\n LoaderComponent,\n ...props\n}: ManagementContractorListProps) {\n return (\n <BaseBoundaries\n componentName=\"Contractor.ManagementContractorList\"\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n >\n <ManagementContractorListRoot LoaderComponent={LoaderComponent} {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["mapTabToContractorType","tab","ManagementContractorListRoot","companyId","initialTab","onEvent","dictionary","LoaderComponent","className","useI18n","useComponentDictionary","selectedTab","setSelectedTab","useState","contractorList","useContractorList","jsx","BaseLayout","handleEdit","contractorId","componentEvents","handleView","handleAddContractor","handleDismiss","handleRehire","handleTabChange","ManagementContractorListView","onboardingStatus","ManagementContractorList","FallbackComponent","props","BaseBoundaries"],"mappings":";;;;;;;AA0BA,MAAMA,IAAyB,CAACC,MAAuC;AACrE,UAA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jF;"}
|
|
1
|
+
{"version":3,"file":"ManagementContractorList.js","sources":["../../../../../src/components/Contractor/ContractorList/management/ManagementContractorList.tsx"],"sourcesContent":["import { useState } from 'react'\nimport { useContractorList, type ContractorType } from '../shared/useContractorList'\nimport { ManagementContractorListView } from './ManagementContractorListView'\nimport { BaseBoundaries, BaseLayout, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\n\n/**\n * The tab currently selected on {@link ManagementContractorList}.\n *\n * @public\n */\nexport type ContractorTab = 'active' | 'onboarding' | 'dismissed'\n\n/**\n * Props for {@link ManagementContractorList}.\n *\n * @public\n */\nexport interface ManagementContractorListProps extends BaseComponentInterface<'Contractor.ManagementContractorList'> {\n /** The associated company identifier. */\n companyId: string\n /** Tab to render first: Active, Onboarding, or Dismissed. Defaults to `'active'`. */\n initialTab?: ContractorTab\n /** Success message to display in an alert above the list, typically after a dismissal is scheduled. */\n successMessage?: string\n}\n\nconst mapTabToContractorType = (tab: ContractorTab): ContractorType => {\n switch (tab) {\n case 'active':\n return 'active'\n case 'onboarding':\n return 'onboarding'\n case 'dismissed':\n return 'terminated'\n }\n}\n\nfunction ManagementContractorListRoot({\n companyId,\n initialTab = 'active',\n successMessage,\n onEvent,\n dictionary,\n LoaderComponent,\n className,\n}: ManagementContractorListProps) {\n useI18n('Contractor.ManagementContractorList')\n useComponentDictionary('Contractor.ManagementContractorList', dictionary)\n\n const [selectedTab, setSelectedTab] = useState<ContractorTab>(initialTab)\n // Seeded from the prop on mount only — the prop changes only when the owning flow\n // remounts this component on the way back from a sub-flow (e.g. Dismissal), so a fresh\n // mount always starts with the latest message. Cleared locally on any further\n // interaction below so a stale banner doesn't linger past the action it announced.\n const [bannerMessage, setBannerMessage] = useState(successMessage)\n\n const contractorList = useContractorList({\n companyId,\n contractorType: mapTabToContractorType(selectedTab),\n })\n\n if (contractorList.isLoading) {\n return (\n <BaseLayout\n isLoading\n error={contractorList.errorHandling.errors}\n LoaderComponent={LoaderComponent}\n />\n )\n }\n\n const handleEdit = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_UPDATE, { contractorId })\n }\n\n const handleView = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_VIEW, { contractorId })\n }\n\n const handleAddContractor = () => {\n onEvent(componentEvents.CONTRACTOR_CREATE)\n }\n\n const handleDismiss = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_DISMISS, { contractorId })\n }\n\n const handleRehire = (contractorId: string) => {\n onEvent(componentEvents.CONTRACTOR_REHIRE, { contractorId })\n }\n\n const handleTabChange = (tab: ContractorTab) => {\n setBannerMessage(undefined)\n setSelectedTab(tab)\n }\n\n return (\n <BaseLayout error={contractorList.errorHandling.errors} LoaderComponent={LoaderComponent}>\n <ManagementContractorListView\n className={className}\n selectedTab={selectedTab}\n onTabChange={handleTabChange}\n successMessage={bannerMessage}\n contractors={contractorList.data.contractors}\n isFetching={contractorList.status.isFetching}\n pagination={contractorList.pagination}\n status={contractorList.status}\n onEdit={handleEdit}\n onView={handleView}\n onDismiss={handleDismiss}\n onRehire={handleRehire}\n onDelete={async (contractorId: string) => {\n setBannerMessage(undefined)\n await contractorList.actions.onDelete(contractorId)\n onEvent(componentEvents.CONTRACTOR_DELETED, { contractorId })\n }}\n onCancelSelfOnboarding={async (contractorId: string) => {\n setBannerMessage(undefined)\n const onboardingStatus = await contractorList.actions.onCancelSelfOnboarding(contractorId)\n if (!onboardingStatus) return\n onEvent(componentEvents.CONTRACTOR_SELF_ONBOARDING_CANCELLED, onboardingStatus)\n }}\n onCancelDismissal={async (contractorId: string) => {\n setBannerMessage(undefined)\n await contractorList.actions.onCancelDismissal(contractorId)\n onEvent(componentEvents.CONTRACTOR_DISMISSAL_CANCELLED, { contractorId })\n }}\n onCancelRehire={async (contractorId: string) => {\n setBannerMessage(undefined)\n await contractorList.actions.onCancelRehire(contractorId)\n onEvent(componentEvents.CONTRACTOR_REHIRE_CANCELLED, { contractorId })\n }}\n onAddContractor={handleAddContractor}\n />\n </BaseLayout>\n )\n}\n\n/**\n * Renders a tabbed list of a company's contractors split across Active, Onboarding, and Dismissed\n * tabs, with per-row actions tailored to each tab (edit, delete, view details, dismiss, rehire,\n * cancel a scheduled dismissal or rehire).\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `contractor/create` | Fired when the user clicks \"Add contractor\". | — |\n * | `contractor/update` | Fired when the user selects \"Edit\"/\"Review\" on an onboarding-tab row. | `{ contractorId: string }` |\n * | `contractor/view` | Fired when the user selects \"View details\" on an active or dismissed row. | `{ contractorId: string }` |\n * | `contractor/deleted` | Fired after an onboarding-tab row's \"Remove\" action completes. | `{ contractorId: string }` |\n * | `contractor/selfOnboarding/cancelled` | Fired after the \"Cancel self-onboarding\" action updates a contractor's onboarding status. | The updated `contractorOnboardingStatus` returned by the API. |\n * | `contractor/dismiss` | Fired when the user selects \"Dismiss\" on an active row. No mutation is performed by this component. | `{ contractorId: string }` |\n * | `contractor/rehire` | Fired when the user selects \"Rehire\" on a dismissed row. No mutation is performed by this component. | `{ contractorId: string }` |\n * | `contractor/dismissal/cancelled` | Fired after a scheduled dismissal is cancelled via the confirm dialog. | `{ contractorId: string }` |\n * | `contractor/rehire/cancelled` | Fired after a scheduled rehire is cancelled via the confirm dialog. | `{ contractorId: string }` |\n *\n * @public\n */\nexport function ManagementContractorList({\n FallbackComponent,\n LoaderComponent,\n ...props\n}: ManagementContractorListProps) {\n return (\n <BaseBoundaries\n componentName=\"Contractor.ManagementContractorList\"\n FallbackComponent={FallbackComponent}\n LoaderComponent={LoaderComponent}\n >\n <ManagementContractorListRoot LoaderComponent={LoaderComponent} {...props} />\n </BaseBoundaries>\n )\n}\n"],"names":["mapTabToContractorType","tab","ManagementContractorListRoot","companyId","initialTab","successMessage","onEvent","dictionary","LoaderComponent","className","useI18n","useComponentDictionary","selectedTab","setSelectedTab","useState","bannerMessage","setBannerMessage","contractorList","useContractorList","jsx","BaseLayout","handleEdit","contractorId","componentEvents","handleView","handleAddContractor","handleDismiss","handleRehire","handleTabChange","ManagementContractorListView","onboardingStatus","ManagementContractorList","FallbackComponent","props","BaseBoundaries"],"mappings":";;;;;;;AA4BA,MAAMA,IAAyB,CAACC,MAAuC;AACrE,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,EAAA;AAEb;AAEA,SAASC,EAA6B;AAAA,EACpC,WAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,gBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AACF,GAAkC;AAChC,EAAAC,EAAQ,qCAAqC,GAC7CC,EAAuB,uCAAuCJ,CAAU;AAExE,QAAM,CAACK,GAAaC,CAAc,IAAIC,EAAwBV,CAAU,GAKlE,CAACW,GAAeC,CAAgB,IAAIF,EAAST,CAAc,GAE3DY,IAAiBC,EAAkB;AAAA,IACvC,WAAAf;AAAA,IACA,gBAAgBH,EAAuBY,CAAW;AAAA,EAAA,CACnD;AAED,MAAIK,EAAe;AACjB,WACE,gBAAAE;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,WAAS;AAAA,QACT,OAAOH,EAAe,cAAc;AAAA,QACpC,iBAAAT;AAAA,MAAA;AAAA,IAAA;AAKN,QAAMa,IAAa,CAACC,MAAyB;AAC3C,IAAAhB,EAAQiB,EAAgB,mBAAmB,EAAE,cAAAD,EAAA,CAAc;AAAA,EAC7D,GAEME,IAAa,CAACF,MAAyB;AAC3C,IAAAhB,EAAQiB,EAAgB,iBAAiB,EAAE,cAAAD,EAAA,CAAc;AAAA,EAC3D,GAEMG,IAAsB,MAAM;AAChC,IAAAnB,EAAQiB,EAAgB,iBAAiB;AAAA,EAC3C,GAEMG,IAAgB,CAACJ,MAAyB;AAC9C,IAAAhB,EAAQiB,EAAgB,oBAAoB,EAAE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xDhB,EAAQiB,EAAgB,6BAA6B,EAAE,cAAAD,EAAA,CAAc;AAAA,MACvE;AAAA,MACA,iBAAiBG;AAAA,IAAA;AAAA,EAAA,GAErB;AAEJ;AAsBO,SAASM,EAAyB;AAAA,EACvC,mBAAAC;AAAA,EACA,iBAAAxB;AAAA,EACA,GAAGyB;AACL,GAAkC;AAChC,SACE,gBAAAd;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,eAAc;AAAA,MACd,mBAAAF;AAAA,MACA,iBAAAxB;AAAA,MAEA,UAAA,gBAAAW,EAACjB,GAAA,EAA6B,iBAAAM,GAAmC,GAAGyB,EAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGjF;"}
|
package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js
CHANGED
|
@@ -1,73 +1,71 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as b, useEffect as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import G from "
|
|
1
|
+
import { jsxs as s, Fragment as j, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useEffect as $ } from "react";
|
|
3
|
+
import { useTranslation as z } from "react-i18next";
|
|
4
|
+
import { getContractorDisplayName as y } from "../../shared/helpers.js";
|
|
5
|
+
import { Flex as d } from "../../../Common/Flex/Flex.js";
|
|
6
|
+
import { EmptyData as F } from "../../../Common/EmptyData/EmptyData.js";
|
|
7
|
+
import { HamburgerMenu as L } from "../../../Common/HamburgerMenu/HamburgerMenu.js";
|
|
8
|
+
import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
9
|
+
import { ContractorOnboardingStatusBadge as G } from "../../../Common/OnboardingStatusBadge/index.js";
|
|
10
|
+
import W from "../../../../assets/icons/trashcan.svg.js";
|
|
10
11
|
import D from "../../../../assets/icons/x-circle.svg.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const l = A();
|
|
25
|
-
return /* @__PURE__ */ o(m, { flexDirection: "column", gap: 0, children: [
|
|
26
|
-
/* @__PURE__ */ a(l.Text, { size: "sm", weight: "medium", children: w(n) }),
|
|
27
|
-
/* @__PURE__ */ a(l.Text, { variant: "supporting", size: "sm", children: n.type ?? "–" })
|
|
12
|
+
import X from "../../../../assets/icons/eye.svg.js";
|
|
13
|
+
import q from "../../../../assets/icons/slash-circle.svg.js";
|
|
14
|
+
import J from "../../../../assets/icons/plus-circle.svg.js";
|
|
15
|
+
import { normalizeToDate as K, formatDateLong as Q, formatDateLongWithYear as U } from "../../../../helpers/dateFormatting.js";
|
|
16
|
+
import { ContractorOnboardingStatus as w } from "../../../../shared/constants.js";
|
|
17
|
+
import { VisuallyHidden as Z } from "../../../Common/VisuallyHidden/VisuallyHidden.js";
|
|
18
|
+
import { useDataView as ee } from "../../../Common/DataView/useDataView.js";
|
|
19
|
+
import { DataView as ie } from "../../../Common/DataView/DataView.js";
|
|
20
|
+
function te({ contractor: l }) {
|
|
21
|
+
const r = S();
|
|
22
|
+
return /* @__PURE__ */ s(d, { flexDirection: "column", gap: 0, children: [
|
|
23
|
+
/* @__PURE__ */ t(r.Text, { size: "sm", weight: "medium", children: y(l) }),
|
|
24
|
+
/* @__PURE__ */ t(r.Text, { variant: "supporting", size: "sm", children: l.type ?? "–" })
|
|
28
25
|
] });
|
|
29
26
|
}
|
|
30
|
-
function p(
|
|
31
|
-
const
|
|
32
|
-
return
|
|
27
|
+
function p(l) {
|
|
28
|
+
const r = K(l);
|
|
29
|
+
return r ? r.getFullYear() === (/* @__PURE__ */ new Date()).getFullYear() ? Q(r) : U(r) : "";
|
|
33
30
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
31
|
+
function ae(l) {
|
|
32
|
+
return l === w.ADMIN_ONBOARDING_REVIEW || l === w.SELF_ONBOARDING_REVIEW;
|
|
36
33
|
}
|
|
37
34
|
function Ae({
|
|
38
|
-
className:
|
|
39
|
-
contractors:
|
|
40
|
-
isFetching:
|
|
41
|
-
selectedTab:
|
|
42
|
-
onTabChange:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
className: l,
|
|
36
|
+
contractors: r,
|
|
37
|
+
isFetching: c,
|
|
38
|
+
selectedTab: u,
|
|
39
|
+
onTabChange: k,
|
|
40
|
+
successMessage: v,
|
|
41
|
+
status: A,
|
|
42
|
+
pagination: I,
|
|
43
|
+
onEdit: E,
|
|
46
44
|
onView: R,
|
|
47
|
-
onDismiss:
|
|
48
|
-
onRehire:
|
|
49
|
-
onDelete:
|
|
50
|
-
onCancelSelfOnboarding:
|
|
51
|
-
onCancelDismissal:
|
|
52
|
-
onCancelRehire:
|
|
53
|
-
onAddContractor:
|
|
45
|
+
onDismiss: B,
|
|
46
|
+
onRehire: O,
|
|
47
|
+
onDelete: T,
|
|
48
|
+
onCancelSelfOnboarding: x,
|
|
49
|
+
onCancelDismissal: N,
|
|
50
|
+
onCancelRehire: P,
|
|
51
|
+
onAddContractor: _
|
|
54
52
|
}) {
|
|
55
|
-
const { t: e } =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
const
|
|
53
|
+
const { t: e } = z("Contractor.ManagementContractorList"), n = S(), [f, h] = b(null), [o, g] = b(null), [m, V] = b(u);
|
|
54
|
+
$(() => {
|
|
55
|
+
c || V(u);
|
|
56
|
+
}, [u, c]);
|
|
57
|
+
const H = [
|
|
60
58
|
{ id: "active", label: e("tabs.active"), content: null },
|
|
61
59
|
{ id: "onboarding", label: e("tabs.onboarding"), content: null },
|
|
62
60
|
{ id: "dismissed", label: e("tabs.dismissed"), content: null }
|
|
63
61
|
], M = () => {
|
|
64
|
-
const
|
|
62
|
+
const a = {
|
|
65
63
|
key: "name",
|
|
66
64
|
title: e("nameLabel"),
|
|
67
|
-
render: (i) => /* @__PURE__ */
|
|
65
|
+
render: (i) => /* @__PURE__ */ t(te, { contractor: i })
|
|
68
66
|
};
|
|
69
|
-
return
|
|
70
|
-
|
|
67
|
+
return m === "active" ? [
|
|
68
|
+
a,
|
|
71
69
|
{
|
|
72
70
|
key: "rate",
|
|
73
71
|
title: e("rateLabel"),
|
|
@@ -75,147 +73,148 @@ function Ae({
|
|
|
75
73
|
},
|
|
76
74
|
{
|
|
77
75
|
key: "status",
|
|
78
|
-
title: /* @__PURE__ */
|
|
79
|
-
render: (i) => i.upcomingEmployment?.startDate ? /* @__PURE__ */
|
|
76
|
+
title: /* @__PURE__ */ t(Z, { children: e("statusColumnLabel") }),
|
|
77
|
+
render: (i) => i.upcomingEmployment?.startDate ? /* @__PURE__ */ t(n.Badge, { status: "info", children: e("startsBadge", {
|
|
80
78
|
date: p(i.upcomingEmployment.startDate)
|
|
81
|
-
}) }) : i.dismissalDate ? /* @__PURE__ */
|
|
79
|
+
}) }) : i.dismissalDate ? /* @__PURE__ */ t(n.Badge, { status: "warning", children: e("lastDayBadge", { date: p(i.dismissalDate) }) }) : null
|
|
82
80
|
}
|
|
83
|
-
] :
|
|
84
|
-
|
|
81
|
+
] : m === "onboarding" ? [
|
|
82
|
+
a,
|
|
85
83
|
{
|
|
86
84
|
key: "status",
|
|
87
85
|
title: e("onboardingStatusLabel"),
|
|
88
|
-
render: (i) => /* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
86
|
+
render: (i) => /* @__PURE__ */ s(d, { alignItems: "center", gap: 8, children: [
|
|
87
|
+
/* @__PURE__ */ t(
|
|
88
|
+
G,
|
|
91
89
|
{
|
|
92
90
|
onboarded: i.onboarded,
|
|
93
91
|
onboardingStatus: i.onboardingStatus
|
|
94
92
|
}
|
|
95
93
|
),
|
|
96
|
-
i.onboardingStatus ===
|
|
94
|
+
i.onboardingStatus === w.ONBOARDING_COMPLETED && i.upcomingEmployment?.startDate && /* @__PURE__ */ t(n.Badge, { status: "info", children: e("startsBadge", {
|
|
97
95
|
date: p(i.upcomingEmployment.startDate)
|
|
98
96
|
}) })
|
|
99
97
|
] })
|
|
100
98
|
}
|
|
101
99
|
] : [
|
|
102
|
-
|
|
100
|
+
a,
|
|
103
101
|
{
|
|
104
102
|
key: "dismissalDate",
|
|
105
103
|
title: e("dismissalDateLabel"),
|
|
106
104
|
render: (i) => i.dismissalDate ? p(i.dismissalDate) : "–"
|
|
107
105
|
}
|
|
108
106
|
];
|
|
109
|
-
}, { ...Y } =
|
|
110
|
-
data:
|
|
107
|
+
}, { ...Y } = ee({
|
|
108
|
+
data: r,
|
|
111
109
|
columns: M(),
|
|
112
|
-
itemMenu: (
|
|
113
|
-
if (
|
|
110
|
+
itemMenu: (a) => {
|
|
111
|
+
if (m === "onboarding") {
|
|
114
112
|
const C = [];
|
|
115
|
-
return
|
|
113
|
+
return a.allowedActions.includes("cancel_self_onboarding") && C.push({
|
|
116
114
|
label: e("cancelSelfOnboardingCta"),
|
|
117
115
|
onClick: () => {
|
|
118
|
-
|
|
116
|
+
x(a.uuid);
|
|
119
117
|
},
|
|
120
|
-
icon: /* @__PURE__ */
|
|
121
|
-
}),
|
|
118
|
+
icon: /* @__PURE__ */ t(D, { "aria-hidden": !0 })
|
|
119
|
+
}), a.allowedActions.includes("delete") && C.push({
|
|
122
120
|
label: e("removeCta"),
|
|
123
121
|
onClick: () => {
|
|
124
|
-
h(
|
|
122
|
+
h(a.uuid);
|
|
125
123
|
},
|
|
126
|
-
icon: /* @__PURE__ */
|
|
127
|
-
}), /* @__PURE__ */
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
icon: /* @__PURE__ */ t(W, { "aria-hidden": !0 })
|
|
125
|
+
}), /* @__PURE__ */ s(d, { alignItems: "center", justifyContent: "flex-end", gap: 4, children: [
|
|
126
|
+
a.allowedActions.includes("edit") && /* @__PURE__ */ t(
|
|
127
|
+
n.Button,
|
|
130
128
|
{
|
|
131
129
|
variant: "secondary",
|
|
132
130
|
onClick: () => {
|
|
133
|
-
|
|
131
|
+
E(a.uuid);
|
|
134
132
|
},
|
|
135
|
-
children:
|
|
133
|
+
children: ae(a.onboardingStatus) ? e("reviewCta") : e("continueCta")
|
|
136
134
|
}
|
|
137
135
|
),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
|
|
136
|
+
/* @__PURE__ */ t(
|
|
137
|
+
L,
|
|
140
138
|
{
|
|
141
139
|
items: C,
|
|
142
|
-
triggerLabel: e("hamburgerTitle", { name:
|
|
140
|
+
triggerLabel: e("hamburgerTitle", { name: y(a) })
|
|
143
141
|
}
|
|
144
142
|
)
|
|
145
143
|
] });
|
|
146
144
|
}
|
|
147
145
|
const i = [];
|
|
148
|
-
return
|
|
146
|
+
return a.allowedActions.includes("view") && i.push({
|
|
149
147
|
label: e("viewDetailsCta"),
|
|
150
148
|
onClick: () => {
|
|
151
|
-
R(
|
|
149
|
+
R(a.uuid);
|
|
152
150
|
},
|
|
153
|
-
icon: /* @__PURE__ */
|
|
154
|
-
}),
|
|
151
|
+
icon: /* @__PURE__ */ t(X, { "aria-hidden": !0 })
|
|
152
|
+
}), a.allowedActions.includes("cancel_rehire") && i.push({
|
|
155
153
|
label: e("cancelRehireCta"),
|
|
156
154
|
onClick: () => {
|
|
157
|
-
g({ contractorId:
|
|
155
|
+
g({ contractorId: a.uuid, type: "rehire" });
|
|
158
156
|
},
|
|
159
|
-
icon: /* @__PURE__ */
|
|
160
|
-
}),
|
|
157
|
+
icon: /* @__PURE__ */ t(D, { "aria-hidden": !0 })
|
|
158
|
+
}), a.allowedActions.includes("cancel_dismissal") && i.push({
|
|
161
159
|
label: e("cancelDismissalCta"),
|
|
162
160
|
onClick: () => {
|
|
163
|
-
g({ contractorId:
|
|
161
|
+
g({ contractorId: a.uuid, type: "dismissal" });
|
|
164
162
|
},
|
|
165
|
-
icon: /* @__PURE__ */
|
|
166
|
-
}),
|
|
163
|
+
icon: /* @__PURE__ */ t(D, { "aria-hidden": !0 })
|
|
164
|
+
}), a.allowedActions.includes("dismiss") && i.push({
|
|
167
165
|
label: e("dismissCta"),
|
|
168
166
|
onClick: () => {
|
|
169
|
-
|
|
167
|
+
B(a.uuid);
|
|
170
168
|
},
|
|
171
|
-
icon: /* @__PURE__ */
|
|
172
|
-
}),
|
|
169
|
+
icon: /* @__PURE__ */ t(q, { "aria-hidden": !0 })
|
|
170
|
+
}), a.allowedActions.includes("rehire") && i.push({
|
|
173
171
|
label: e("rehireCta"),
|
|
174
172
|
onClick: () => {
|
|
175
|
-
|
|
173
|
+
O(a.uuid);
|
|
176
174
|
},
|
|
177
|
-
icon: /* @__PURE__ */
|
|
178
|
-
}), /* @__PURE__ */
|
|
179
|
-
|
|
175
|
+
icon: /* @__PURE__ */ t(J, { "aria-hidden": !0 })
|
|
176
|
+
}), /* @__PURE__ */ t(
|
|
177
|
+
L,
|
|
180
178
|
{
|
|
181
179
|
items: i,
|
|
182
|
-
triggerLabel: e("hamburgerTitle", { name:
|
|
180
|
+
triggerLabel: e("hamburgerTitle", { name: y(a) })
|
|
183
181
|
}
|
|
184
182
|
);
|
|
185
183
|
},
|
|
186
|
-
isFetching:
|
|
187
|
-
pagination:
|
|
188
|
-
emptyState: () => /* @__PURE__ */
|
|
189
|
-
|
|
184
|
+
isFetching: c,
|
|
185
|
+
pagination: I,
|
|
186
|
+
emptyState: () => /* @__PURE__ */ t(
|
|
187
|
+
F,
|
|
190
188
|
{
|
|
191
|
-
title: e(`emptyState.${
|
|
192
|
-
description: e(`emptyState.${
|
|
189
|
+
title: e(`emptyState.${m}.title`),
|
|
190
|
+
description: e(`emptyState.${m}.description`)
|
|
193
191
|
}
|
|
194
192
|
)
|
|
195
193
|
});
|
|
196
|
-
return /* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
|
|
200
|
-
/* @__PURE__ */
|
|
194
|
+
return /* @__PURE__ */ s(j, { children: [
|
|
195
|
+
/* @__PURE__ */ s(d, { className: l, flexDirection: "column", gap: 32, children: [
|
|
196
|
+
v && /* @__PURE__ */ t(n.Alert, { label: v, status: "success" }),
|
|
197
|
+
/* @__PURE__ */ s(d, { justifyContent: "space-between", alignItems: "center", children: [
|
|
198
|
+
/* @__PURE__ */ t(n.Heading, { as: "h2", children: e("title") }),
|
|
199
|
+
/* @__PURE__ */ t(n.Button, { variant: "secondary", onClick: _, children: e("addContractorCta") })
|
|
201
200
|
] }),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
|
|
201
|
+
/* @__PURE__ */ s(d, { flexDirection: "column", gap: 0, children: [
|
|
202
|
+
/* @__PURE__ */ t(
|
|
203
|
+
n.Tabs,
|
|
205
204
|
{
|
|
206
|
-
tabs:
|
|
207
|
-
selectedId:
|
|
208
|
-
onSelectionChange: (
|
|
209
|
-
|
|
205
|
+
tabs: H,
|
|
206
|
+
selectedId: u,
|
|
207
|
+
onSelectionChange: (a) => {
|
|
208
|
+
k(a);
|
|
210
209
|
},
|
|
211
210
|
"aria-label": e("tabsLabel")
|
|
212
211
|
}
|
|
213
212
|
),
|
|
214
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ t(ie, { label: e("contractorListLabel"), ...Y })
|
|
215
214
|
] })
|
|
216
215
|
] }),
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
|
|
216
|
+
/* @__PURE__ */ t(
|
|
217
|
+
n.Dialog,
|
|
219
218
|
{
|
|
220
219
|
isOpen: !!f,
|
|
221
220
|
onClose: () => {
|
|
@@ -224,11 +223,11 @@ function Ae({
|
|
|
224
223
|
onPrimaryActionClick: async () => {
|
|
225
224
|
if (f)
|
|
226
225
|
try {
|
|
227
|
-
await
|
|
226
|
+
await T(f), h(null);
|
|
228
227
|
} catch {
|
|
229
228
|
}
|
|
230
229
|
},
|
|
231
|
-
isPrimaryActionLoading:
|
|
230
|
+
isPrimaryActionLoading: A.isPending,
|
|
232
231
|
isDestructive: !0,
|
|
233
232
|
title: e("removeDialog.title"),
|
|
234
233
|
primaryActionLabel: e("removeDialog.confirmCta"),
|
|
@@ -236,25 +235,25 @@ function Ae({
|
|
|
236
235
|
children: e("removeDialog.description")
|
|
237
236
|
}
|
|
238
237
|
),
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
|
|
238
|
+
/* @__PURE__ */ t(
|
|
239
|
+
n.Dialog,
|
|
241
240
|
{
|
|
242
|
-
isOpen: !!
|
|
241
|
+
isOpen: !!o,
|
|
243
242
|
onClose: () => {
|
|
244
243
|
g(null);
|
|
245
244
|
},
|
|
246
245
|
onPrimaryActionClick: async () => {
|
|
247
|
-
if (
|
|
246
|
+
if (o)
|
|
248
247
|
try {
|
|
249
|
-
|
|
248
|
+
o.type === "rehire" ? await P(o.contractorId) : await N(o.contractorId), g(null);
|
|
250
249
|
} catch {
|
|
251
250
|
}
|
|
252
251
|
},
|
|
253
|
-
isPrimaryActionLoading:
|
|
254
|
-
title:
|
|
255
|
-
primaryActionLabel:
|
|
256
|
-
closeActionLabel:
|
|
257
|
-
children:
|
|
252
|
+
isPrimaryActionLoading: A.isPending,
|
|
253
|
+
title: o?.type === "rehire" ? e("cancelRehireDialog.title") : e("cancelDismissalDialog.title"),
|
|
254
|
+
primaryActionLabel: o?.type === "rehire" ? e("cancelRehireDialog.confirmCta") : e("cancelDismissalDialog.confirmCta"),
|
|
255
|
+
closeActionLabel: o?.type === "rehire" ? e("cancelRehireDialog.cancelCta") : e("cancelDismissalDialog.cancelCta"),
|
|
256
|
+
children: o?.type === "rehire" ? e("cancelRehireDialog.description") : e("cancelDismissalDialog.description")
|
|
258
257
|
}
|
|
259
258
|
)
|
|
260
259
|
] });
|