@gusto/embedded-react-sdk 0.23.1 → 0.24.1

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.
Files changed (213) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/components/Common/PayrollLoading/PayrollLoading.d.ts +2 -0
  3. package/dist/components/Common/PayrollLoading/PayrollLoading.js +19 -0
  4. package/dist/components/Common/PayrollLoading/PayrollLoading.js.map +1 -0
  5. package/dist/components/Common/PayrollLoading/PayrollLoadingTypes.d.ts +5 -0
  6. package/dist/components/Common/PayrollLoading/index.d.ts +3 -0
  7. package/dist/components/Common/SignatureForm/SignatureForm.js +11 -12
  8. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  9. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormFields.js +2 -2
  11. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  12. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  13. package/dist/components/Common/index.d.ts +1 -0
  14. package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
  15. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
  16. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  17. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  21. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  22. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  24. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  25. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  26. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -6
  27. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  28. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  29. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  30. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -6
  31. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  32. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
  33. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  34. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  35. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
  36. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  37. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  38. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
  39. package/dist/components/Company/FederalTaxes/Form.js +3 -4
  40. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  41. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -9
  42. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  43. package/dist/components/Company/Industry/Context.js +6 -7
  44. package/dist/components/Company/Industry/Context.js.map +1 -1
  45. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  46. package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
  47. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  48. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  49. package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -2
  50. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  51. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  52. package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
  53. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  54. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
  55. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  56. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
  57. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  58. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  59. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
  60. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  61. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
  62. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  63. package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
  64. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  65. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
  66. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  67. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  68. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  69. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  70. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  71. package/dist/components/Contractor/Address/Address.js +2 -2
  72. package/dist/components/Contractor/Address/Form.js +1 -1
  73. package/dist/components/Contractor/Address/useAddress.js +5 -6
  74. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  75. package/dist/components/Contractor/ContractorList/index.js +17 -17
  76. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
  77. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
  78. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +13 -14
  79. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  80. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +10 -10
  81. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +9 -10
  82. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  83. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
  84. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  85. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +12 -13
  86. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  87. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  88. package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
  89. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  90. package/dist/components/Contractor/Submit/Submit.js +1 -1
  91. package/dist/components/Employee/Compensation/Edit.js +14 -14
  92. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -11
  93. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  94. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -12
  95. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  96. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -12
  97. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  98. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
  99. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
  100. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  101. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  102. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  103. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  104. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
  105. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  106. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  107. package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
  108. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  109. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  110. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  111. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
  112. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  113. package/dist/components/Employee/FederalTaxes/FederalForm.js +9 -7
  114. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  115. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
  116. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  117. package/dist/components/Employee/Landing/Landing.js +8 -8
  118. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  119. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
  120. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
  121. package/dist/components/Employee/PaymentMethod/Split.js +8 -8
  122. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
  123. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  124. package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
  125. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  126. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  127. package/dist/components/Employee/Profile/useProfile.js +3 -4
  128. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  129. package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
  130. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  131. package/dist/components/Employee/Taxes/FederalForm.js +8 -6
  132. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  133. package/dist/components/Employee/Taxes/useTaxes.js +3 -4
  134. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  135. package/dist/components/Flow/Flow.js +2 -3
  136. package/dist/components/Flow/Flow.js.map +1 -1
  137. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +4 -4
  138. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +26 -21
  139. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  140. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
  141. package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -1
  142. package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +8 -1
  143. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +6 -7
  144. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  145. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +2 -3
  146. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  147. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +2 -1
  148. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +56 -54
  149. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  150. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +2 -1
  151. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +90 -91
  152. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  153. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +2 -1
  154. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +33 -31
  155. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  156. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +2 -1
  157. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +72 -71
  158. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  159. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +8 -9
  160. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  161. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
  162. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +24 -18
  163. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
  164. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +5 -0
  165. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +77 -51
  166. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  167. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -18
  168. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  169. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +4 -1
  170. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +29 -21
  171. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  172. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +5 -0
  173. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +36 -26
  174. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  175. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +16 -17
  176. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  177. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +4 -1
  178. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -60
  179. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  180. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  181. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +237 -232
  182. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  183. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
  184. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  185. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +2 -1
  186. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +25 -15
  187. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  188. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +2 -1
  189. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +152 -138
  190. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  191. package/dist/components/Payroll/index.d.ts +1 -0
  192. package/dist/components/Payroll/usePreparedPayrollData.js +5 -6
  193. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  194. package/dist/contexts/ApiProvider/ApiProvider.d.ts +3 -1
  195. package/dist/contexts/ApiProvider/ApiProvider.js +26 -18
  196. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  197. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  198. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  199. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  200. package/dist/contexts/GustoProvider/GustoProvider.d.ts +2 -0
  201. package/dist/contexts/GustoProvider/GustoProvider.js +12 -11
  202. package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
  203. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +24 -14
  204. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  205. package/dist/i18n/en/common.json.d.ts +1 -0
  206. package/dist/i18n/en/common.json.js +1 -1
  207. package/dist/index.d.ts +1 -0
  208. package/dist/shared/constants.d.ts +1 -1
  209. package/dist/shared/constants.js +6 -5
  210. package/dist/shared/constants.js.map +1 -1
  211. package/dist/style.css +1 -1
  212. package/dist/types/i18next.d.ts +1 -0
  213. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollListPresentation.js","sources":["../../../../src/components/Payroll/PayrollList/PayrollListPresentation.tsx"],"sourcesContent":["import type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport { useState, useRef } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { ApiPayrollBlocker } from '../PayrollBlocker/payrollHelpers'\nimport { PayrollBlockerAlerts } from '../PayrollBlocker/components/PayrollBlockerAlerts'\nimport { PayrollStatusBadges } from '../PayrollStatusBadges'\nimport { getPayrollType } from '../helpers'\nimport styles from './PayrollListPresentation.module.scss'\nimport { DataView, Flex, HamburgerMenu } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport FeatureIconCheck from '@/assets/icons/feature-icon-check.svg?react'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\ninterface PayrollListPresentationProps {\n onRunPayroll: ({ payrollUuid, payPeriod }: Pick<Payroll, 'payrollUuid' | 'payPeriod'>) => void\n onSubmitPayroll: ({ payrollUuid, payPeriod }: Pick<Payroll, 'payrollUuid' | 'payPeriod'>) => void\n onSkipPayroll: ({ payrollUuid }: Pick<Payroll, 'payrollUuid'>) => void\n onViewBlockers?: () => void\n payrolls: Payroll[]\n paySchedules: PayScheduleList[]\n showSkipSuccessAlert: boolean\n onDismissSkipSuccessAlert: () => void\n skippingPayrollId: string | null\n blockers: ApiPayrollBlocker[]\n wireInRequests: WireInRequest[]\n}\n\nexport const PayrollListPresentation = ({\n onRunPayroll,\n onSubmitPayroll,\n onSkipPayroll,\n onViewBlockers,\n payrolls,\n paySchedules,\n showSkipSuccessAlert,\n onDismissSkipSuccessAlert,\n skippingPayrollId,\n blockers,\n wireInRequests,\n}: PayrollListPresentationProps) => {\n const { Button, Dialog, Heading, Text, Alert } = useComponentContext()\n useI18n('Payroll.PayrollList')\n const { t } = useTranslation('Payroll.PayrollList')\n const dateFormatter = useDateFormatter()\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isDesktop = breakpoints.includes('small')\n const [skipPayrollDialogState, setSkipPayrollDialogState] = useState<{\n isOpen: boolean\n payrollId: string | null\n payPeriod: string | null\n }>({\n isOpen: false,\n payrollId: null,\n payPeriod: null,\n })\n\n const handleOpenSkipDialog = (payrollId: string, payPeriod: string) => {\n setSkipPayrollDialogState({\n isOpen: true,\n payrollId,\n payPeriod,\n })\n }\n\n const handleCloseSkipDialog = () => {\n setSkipPayrollDialogState({\n isOpen: false,\n payrollId: null,\n payPeriod: null,\n })\n }\n\n const handleConfirmSkipPayroll = () => {\n if (skipPayrollDialogState.payrollId) {\n onSkipPayroll({ payrollUuid: skipPayrollDialogState.payrollId })\n handleCloseSkipDialog()\n }\n }\n\n const formatPayPeriod = (startDate: string | undefined, endDate: string | undefined) => {\n const formattedStartDate = dateFormatter.formatShort(startDate)\n const formattedEndDate = dateFormatter.formatShortWithYear(endDate)\n\n return {\n startDate: formattedStartDate,\n endDate: formattedEndDate,\n fullPeriod: dateFormatter.formatPayPeriodRange(startDate, endDate, { useShortMonth: true }),\n }\n }\n\n return (\n <div ref={containerRef} className={styles.container}>\n <Flex flexDirection=\"column\" gap={16}>\n {showSkipSuccessAlert && (\n <div className={styles.alertContainer}>\n <Alert\n status=\"info\"\n label={t('skipSuccessAlert')}\n onDismiss={onDismissSkipSuccessAlert}\n />\n </div>\n )}\n <PayrollBlockerAlerts blockers={blockers} onMultipleViewClick={onViewBlockers} />\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Flex>\n <Heading as=\"h2\">{t('title')}</Heading>\n </Flex>\n </Flex>\n\n <DataView\n emptyState={() => (\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={24}>\n <FeatureIconCheck />\n <Text>{t('emptyState')}</Text>\n </Flex>\n )}\n data={payrolls}\n columns={[\n {\n render: ({ payPeriod }) => {\n const { startDate, endDate } = formatPayPeriod(\n payPeriod?.startDate,\n payPeriod?.endDate,\n )\n\n return (\n <Flex flexDirection=\"column\" gap={0}>\n <Text>\n {startDate} - {endDate}\n </Text>\n <Text variant=\"supporting\">\n {paySchedules.find(schedule => schedule.uuid === payPeriod?.payScheduleUuid)\n ?.name ||\n paySchedules.find(schedule => schedule.uuid === payPeriod?.payScheduleUuid)\n ?.customName}\n </Text>\n </Flex>\n )\n },\n title: t('tableHeaders.0'),\n },\n {\n render: payroll => <Text>{t(`type.${getPayrollType(payroll)}`)}</Text>,\n title: t('tableHeaders.1'),\n },\n {\n render: ({ checkDate }) => (\n <Text>{dateFormatter.formatShortWithWeekdayAndYear(checkDate)}</Text>\n ),\n title: t('tableHeaders.2'),\n },\n {\n title: t('tableHeaders.3'),\n render: ({ payrollDeadline }) => (\n <Text>{dateFormatter.formatShortWithWeekdayAndYear(payrollDeadline)}</Text>\n ),\n },\n {\n title: t('tableHeaders.4'),\n render: payroll => {\n const wireInRequest = wireInRequests.find(\n wire => wire.paymentUuid === payroll.payrollUuid,\n )\n return <PayrollStatusBadges payroll={payroll} wireInRequest={wireInRequest} />\n },\n },\n {\n title: '',\n render: ({ payrollUuid, calculatedAt, processed, payPeriod }) => {\n if (processed) {\n return null\n }\n\n const isProcessingSkipPayroll = skippingPayrollId === payrollUuid\n\n const button = calculatedAt ? (\n <Button\n isLoading={isProcessingSkipPayroll}\n onClick={() => {\n onSubmitPayroll({ payrollUuid, payPeriod })\n }}\n title={t('submitPayrollCta')}\n variant=\"secondary\"\n >\n {t('submitPayrollCta')}\n </Button>\n ) : (\n <Button\n isLoading={isProcessingSkipPayroll}\n onClick={() => {\n onRunPayroll({ payrollUuid, payPeriod })\n }}\n title={t('runPayrollTitle')}\n variant=\"secondary\"\n >\n {t('runPayrollTitle')}\n </Button>\n )\n\n return isDesktop ? (\n button\n ) : (\n <Flex flexDirection=\"column\" alignItems=\"stretch\" gap={12}>\n {button}\n </Flex>\n )\n },\n },\n ]}\n label={t('payrollsListLabel')}\n itemMenu={({ payrollUuid, processed, payPeriod }) => {\n if (processed) {\n return null\n }\n\n const isProcessingSkipPayroll = skippingPayrollId === payrollUuid\n\n const { fullPeriod: payPeriodString } = formatPayPeriod(\n payPeriod?.startDate,\n payPeriod?.endDate,\n )\n\n const todayDateString = formatDateToStringDate(new Date())\n const todayAtMidnight = todayDateString ? new Date(todayDateString) : null\n const payPeriodStartDate = payPeriod?.startDate ? new Date(payPeriod.startDate) : null\n\n const canSkipPayroll =\n blockers.length === 0 &&\n todayAtMidnight &&\n payPeriodStartDate &&\n todayAtMidnight >= payPeriodStartDate\n\n if (!canSkipPayroll) {\n return null\n }\n\n return (\n <HamburgerMenu\n isLoading={isProcessingSkipPayroll}\n menuLabel={t('payrollMenuLabel')}\n items={[\n {\n label: t('skipPayrollCta'),\n onClick: () => {\n handleOpenSkipDialog(payrollUuid!, payPeriodString)\n },\n },\n ]}\n />\n )\n }}\n />\n <Dialog\n isOpen={skipPayrollDialogState.isOpen}\n onClose={handleCloseSkipDialog}\n onPrimaryActionClick={handleConfirmSkipPayroll}\n isDestructive={true}\n title={t('skipPayrollDialog.title', { payPeriod: skipPayrollDialogState.payPeriod })}\n primaryActionLabel={t('skipPayrollDialog.confirmCta')}\n closeActionLabel={t('skipPayrollDialog.cancelCta')}\n >\n {t('skipPayrollDialog.body')}\n </Dialog>\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollListPresentation","onRunPayroll","onSubmitPayroll","onSkipPayroll","onViewBlockers","payrolls","paySchedules","showSkipSuccessAlert","onDismissSkipSuccessAlert","skippingPayrollId","blockers","wireInRequests","Button","Dialog","Heading","Text","Alert","useComponentContext","useI18n","t","useTranslation","dateFormatter","useDateFormatter","containerRef","useRef","isDesktop","useContainerBreakpoints","skipPayrollDialogState","setSkipPayrollDialogState","useState","handleOpenSkipDialog","payrollId","payPeriod","handleCloseSkipDialog","handleConfirmSkipPayroll","formatPayPeriod","startDate","endDate","formattedStartDate","formattedEndDate","jsx","styles","jsxs","Flex","PayrollBlockerAlerts","DataView","FeatureIconCheck","schedule","payroll","getPayrollType","checkDate","payrollDeadline","wireInRequest","wire","PayrollStatusBadges","payrollUuid","calculatedAt","processed","isProcessingSkipPayroll","button","payPeriodString","todayDateString","formatDateToStringDate","todayAtMidnight","payPeriodStartDate","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;;;;AAgCO,MAAMA,KAA0B,CAAC;AAAA,EACtC,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AACF,MAAoC;AAClC,QAAM,EAAE,QAAAC,GAAQ,QAAAC,GAAQ,SAAAC,GAAS,MAAAC,GAAM,OAAAC,EAAA,IAAUC,EAAA;AACjD,EAAAC,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAgBC,EAAA,GAChBC,IAAeC,EAAuB,IAAI,GAE1CC,IADcC,EAAwB,EAAE,KAAKH,GAAc,EACnC,SAAS,OAAO,GACxC,CAACI,GAAwBC,CAAyB,IAAIC,EAIzD;AAAA,IACD,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,WAAW;AAAA,EAA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W;AAAA,QACnF,oBAAoBR,EAAE,8BAA8B;AAAA,QACpD,kBAAkBA,EAAE,6BAA6B;AAAA,QAEhD,YAAE,wBAAwB;AAAA,MAAA;AAAA,IAAA;AAAA,EAC7B,EAAA,CACF,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"PayrollListPresentation.js","sources":["../../../../src/components/Payroll/PayrollList/PayrollListPresentation.tsx"],"sourcesContent":["import type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { WireInRequest } from '@gusto/embedded-api/models/components/wireinrequest'\nimport { useState, useRef } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { ApiPayrollBlocker } from '../PayrollBlocker/payrollHelpers'\nimport { PayrollBlockerAlerts } from '../PayrollBlocker/components/PayrollBlockerAlerts'\nimport { PayrollStatusBadges } from '../PayrollStatusBadges'\nimport { getPayrollType } from '../helpers'\nimport styles from './PayrollListPresentation.module.scss'\nimport { DataView, Flex, HamburgerMenu } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { formatDateToStringDate } from '@/helpers/dateFormatting'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport FeatureIconCheck from '@/assets/icons/feature-icon-check.svg?react'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\ninterface PayrollListPresentationProps {\n onRunPayroll: ({ payrollUuid, payPeriod }: Pick<Payroll, 'payrollUuid' | 'payPeriod'>) => void\n onSubmitPayroll: ({ payrollUuid, payPeriod }: Pick<Payroll, 'payrollUuid' | 'payPeriod'>) => void\n onSkipPayroll: ({ payrollUuid }: Pick<Payroll, 'payrollUuid'>) => void\n onViewBlockers?: () => void\n payrolls: Payroll[]\n paySchedules: PayScheduleList[]\n showSkipSuccessAlert: boolean\n onDismissSkipSuccessAlert: () => void\n skippingPayrollId: string | null\n blockers: ApiPayrollBlocker[]\n wireInRequests: WireInRequest[]\n}\n\nexport const PayrollListPresentation = ({\n onRunPayroll,\n onSubmitPayroll,\n onSkipPayroll,\n onViewBlockers,\n payrolls,\n paySchedules,\n showSkipSuccessAlert,\n onDismissSkipSuccessAlert,\n skippingPayrollId,\n blockers,\n wireInRequests,\n}: PayrollListPresentationProps) => {\n const { Button, Dialog, Heading, Text, Alert } = useComponentContext()\n useI18n('Payroll.PayrollList')\n const { t } = useTranslation('Payroll.PayrollList')\n const dateFormatter = useDateFormatter()\n const containerRef = useRef<HTMLDivElement>(null)\n const breakpoints = useContainerBreakpoints({ ref: containerRef })\n const isDesktop = breakpoints.includes('small')\n const [skipPayrollDialogState, setSkipPayrollDialogState] = useState<{\n isOpen: boolean\n payrollId: string | null\n payPeriod: string | null\n }>({\n isOpen: false,\n payrollId: null,\n payPeriod: null,\n })\n\n const handleOpenSkipDialog = (payrollId: string, payPeriod: string) => {\n setSkipPayrollDialogState({\n isOpen: true,\n payrollId,\n payPeriod,\n })\n }\n\n const handleCloseSkipDialog = () => {\n setSkipPayrollDialogState({\n isOpen: false,\n payrollId: null,\n payPeriod: null,\n })\n }\n\n const handleConfirmSkipPayroll = () => {\n if (skipPayrollDialogState.payrollId) {\n onSkipPayroll({ payrollUuid: skipPayrollDialogState.payrollId })\n handleCloseSkipDialog()\n }\n }\n\n const formatPayPeriod = (startDate: string | undefined, endDate: string | undefined) => {\n const formattedStartDate = dateFormatter.formatShort(startDate)\n const formattedEndDate = dateFormatter.formatShortWithYear(endDate)\n\n return {\n startDate: formattedStartDate,\n endDate: formattedEndDate,\n fullPeriod: dateFormatter.formatPayPeriodRange(startDate, endDate, { useShortMonth: true }),\n }\n }\n\n return (\n <div ref={containerRef} className={styles.container}>\n <Flex flexDirection=\"column\" gap={16}>\n {showSkipSuccessAlert && (\n <div className={styles.alertContainer}>\n <Alert\n status=\"info\"\n label={t('skipSuccessAlert')}\n onDismiss={onDismissSkipSuccessAlert}\n />\n </div>\n )}\n <PayrollBlockerAlerts blockers={blockers} onMultipleViewClick={onViewBlockers} />\n <Flex\n flexDirection={{ base: 'column', medium: 'row' }}\n justifyContent=\"space-between\"\n alignItems=\"flex-start\"\n gap={{ base: 12, medium: 24 }}\n >\n <Flex>\n <Heading as=\"h2\">{t('title')}</Heading>\n </Flex>\n </Flex>\n\n <DataView\n emptyState={() => (\n <Flex flexDirection=\"column\" alignItems=\"center\" gap={24}>\n <FeatureIconCheck />\n <Text>{t('emptyState')}</Text>\n </Flex>\n )}\n data={payrolls}\n columns={[\n {\n render: ({ payPeriod }) => {\n const { startDate, endDate } = formatPayPeriod(\n payPeriod?.startDate,\n payPeriod?.endDate,\n )\n\n return (\n <Flex flexDirection=\"column\" gap={0}>\n <Text>\n {startDate} - {endDate}\n </Text>\n <Text variant=\"supporting\">\n {paySchedules.find(schedule => schedule.uuid === payPeriod?.payScheduleUuid)\n ?.name ||\n paySchedules.find(schedule => schedule.uuid === payPeriod?.payScheduleUuid)\n ?.customName}\n </Text>\n </Flex>\n )\n },\n title: t('tableHeaders.0'),\n },\n {\n render: payroll => <Text>{t(`type.${getPayrollType(payroll)}`)}</Text>,\n title: t('tableHeaders.1'),\n },\n {\n render: ({ checkDate }) => (\n <Text>{dateFormatter.formatShortWithWeekdayAndYear(checkDate)}</Text>\n ),\n title: t('tableHeaders.2'),\n },\n {\n title: t('tableHeaders.3'),\n render: ({ payrollDeadline }) => (\n <Text>{dateFormatter.formatShortWithWeekdayAndYear(payrollDeadline)}</Text>\n ),\n },\n {\n title: t('tableHeaders.4'),\n render: payroll => {\n const wireInRequest = wireInRequests.find(\n wire => wire.paymentUuid === payroll.payrollUuid,\n )\n return <PayrollStatusBadges payroll={payroll} wireInRequest={wireInRequest} />\n },\n },\n {\n title: '',\n render: ({ payrollUuid, calculatedAt, processed, payPeriod }) => {\n if (processed) {\n return null\n }\n\n const isProcessingSkipPayroll = skippingPayrollId === payrollUuid\n\n const button = calculatedAt ? (\n <Button\n isLoading={isProcessingSkipPayroll}\n onClick={() => {\n onSubmitPayroll({ payrollUuid, payPeriod })\n }}\n title={t('submitPayrollCta')}\n variant=\"secondary\"\n >\n {t('submitPayrollCta')}\n </Button>\n ) : (\n <Button\n isLoading={isProcessingSkipPayroll}\n onClick={() => {\n onRunPayroll({ payrollUuid, payPeriod })\n }}\n title={t('runPayrollTitle')}\n variant=\"secondary\"\n >\n {t('runPayrollTitle')}\n </Button>\n )\n\n return isDesktop ? (\n button\n ) : (\n <Flex flexDirection=\"column\" alignItems=\"stretch\" gap={12}>\n {button}\n </Flex>\n )\n },\n },\n ]}\n label={t('payrollsListLabel')}\n itemMenu={({ payrollUuid, processed, payPeriod }) => {\n if (processed) {\n return null\n }\n\n const isProcessingSkipPayroll = skippingPayrollId === payrollUuid\n\n const { fullPeriod: payPeriodString } = formatPayPeriod(\n payPeriod?.startDate,\n payPeriod?.endDate,\n )\n\n const todayDateString = formatDateToStringDate(new Date())\n const todayAtMidnight = todayDateString ? new Date(todayDateString) : null\n const payPeriodStartDate = payPeriod?.startDate ? new Date(payPeriod.startDate) : null\n\n const canSkipPayroll =\n blockers.length === 0 &&\n todayAtMidnight &&\n payPeriodStartDate &&\n todayAtMidnight >= payPeriodStartDate\n\n if (!canSkipPayroll) {\n return null\n }\n\n return (\n <HamburgerMenu\n isLoading={isProcessingSkipPayroll}\n menuLabel={t('payrollMenuLabel')}\n items={[\n {\n label: t('skipPayrollCta'),\n onClick: () => {\n handleOpenSkipDialog(payrollUuid!, payPeriodString)\n },\n },\n ]}\n />\n )\n }}\n />\n <Dialog\n isOpen={skipPayrollDialogState.isOpen}\n onClose={handleCloseSkipDialog}\n onPrimaryActionClick={handleConfirmSkipPayroll}\n isDestructive={true}\n title={t('skipPayrollDialog.title', { payPeriod: skipPayrollDialogState.payPeriod })}\n primaryActionLabel={t('skipPayrollDialog.confirmCta')}\n closeActionLabel={t('skipPayrollDialog.cancelCta')}\n >\n {t('skipPayrollDialog.body')}\n </Dialog>\n </Flex>\n </div>\n )\n}\n"],"names":["PayrollListPresentation","onRunPayroll","onSubmitPayroll","onSkipPayroll","onViewBlockers","payrolls","paySchedules","showSkipSuccessAlert","onDismissSkipSuccessAlert","skippingPayrollId","blockers","wireInRequests","Button","Dialog","Heading","Text","Alert","useComponentContext","useI18n","t","useTranslation","dateFormatter","useDateFormatter","containerRef","useRef","isDesktop","useContainerBreakpoints","skipPayrollDialogState","setSkipPayrollDialogState","useState","handleOpenSkipDialog","payrollId","payPeriod","handleCloseSkipDialog","handleConfirmSkipPayroll","formatPayPeriod","startDate","endDate","formattedStartDate","formattedEndDate","jsx","styles","jsxs","Flex","PayrollBlockerAlerts","DataView","FeatureIconCheck","schedule","payroll","getPayrollType","checkDate","payrollDeadline","wireInRequest","wire","PayrollStatusBadges","payrollUuid","calculatedAt","processed","isProcessingSkipPayroll","button","payPeriodString","todayDateString","formatDateToStringDate","todayAtMidnight","payPeriodStartDate","HamburgerMenu"],"mappings":";;;;;;;;;;;;;;;;;AAgCO,MAAMA,KAA0B,CAAC;AAAA,EACtC,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,2BAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AACF,MAAoC;AAClC,QAAM,EAAE,QAAAC,GAAQ,QAAAC,GAAQ,SAAAC,GAAS,MAAAC,GAAM,OAAAC,EAAA,IAAUC,EAAA;AACjD,EAAAC,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAgBC,EAAA,GAChBC,IAAeC,EAAuB,IAAI,GAE1CC,IADcC,EAAwB,EAAE,KAAKH,GAAc,EACnC,SAAS,OAAO,GACxC,CAACI,GAAwBC,CAAyB,IAAIC,EAIzD;AAAA,IACD,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,WAAW;AA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uB,WAAW;AAAA,QACnF,oBAAoBR,EAAE,8BAA8B;AAAA,QACpD,kBAAkBA,EAAE,6BAA6B;AAAA,QAEhD,YAAE,wBAAwB;AAAA,MAAA;AAAA,IAAA;AAAA,EAC7B,EAAA,CACF,EAAA,CACF;AAEJ;"}
@@ -1,10 +1,13 @@
1
1
  import { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents';
2
+ import { ConfirmWireDetailsComponentType } from '../ConfirmWireDetails/ConfirmWireDetails';
2
3
  import { BaseComponentInterface } from '../../Base';
3
4
  interface PayrollOverviewProps extends BaseComponentInterface<'Payroll.PayrollOverview'> {
4
5
  companyId: string;
5
6
  payrollId: string;
6
7
  alerts?: PayrollFlowAlert[];
8
+ withReimbursements?: boolean;
9
+ ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType;
7
10
  }
8
11
  export declare function PayrollOverview(props: PayrollOverviewProps): import("react/jsx-runtime").JSX.Element;
9
- export declare const Root: ({ companyId, payrollId, dictionary, onEvent, alerts, }: PayrollOverviewProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const Root: ({ companyId, payrollId, dictionary, onEvent, alerts, withReimbursements, ConfirmWireDetailsComponent, }: PayrollOverviewProps) => import("react/jsx-runtime").JSX.Element;
10
13
  export {};
@@ -1,64 +1,73 @@
1
- import { jsx as c, jsxs as z } from "react/jsx-runtime";
2
- import { usePayrollsSubmitMutation as J } from "@gusto/embedded-api/react-query/payrollsSubmit";
3
- import { usePayrollsCancelMutation as Q } from "@gusto/embedded-api/react-query/payrollsCancel";
4
- import { usePayrollsGetSuspense as X } from "@gusto/embedded-api/react-query/payrollsGet";
5
- import { useTranslation as Z } from "react-i18next";
6
- import { useBankAccountsGetSuspense as $ } from "@gusto/embedded-api/react-query/bankAccountsGet";
7
- import { useEmployeesListSuspense as ee } from "@gusto/embedded-api/react-query/employeesList";
8
- import { useWireInRequestsGet as te } from "@gusto/embedded-api/react-query/wireInRequestsGet";
1
+ import { jsx as c, jsxs as Q } from "react/jsx-runtime";
2
+ import { usePayrollsSubmitMutation as X } from "@gusto/embedded-api/react-query/payrollsSubmit";
3
+ import { usePayrollsCancelMutation as Z } from "@gusto/embedded-api/react-query/payrollsCancel";
4
+ import { usePayrollsGetSuspense as $ } from "@gusto/embedded-api/react-query/payrollsGet";
5
+ import { useTranslation as ee } from "react-i18next";
6
+ import { useBankAccountsGetSuspense as te } from "@gusto/embedded-api/react-query/bankAccountsGet";
7
+ import { useEmployeesListSuspense as se } from "@gusto/embedded-api/react-query/employeesList";
8
+ import { useWireInRequestsGet as oe } from "@gusto/embedded-api/react-query/wireInRequestsGet";
9
9
  import { useState as b, useEffect as S } from "react";
10
- import { useGustoEmbeddedContext as se } from "@gusto/embedded-api/react-query/_context";
11
- import { payrollsGetPayStub as oe } from "@gusto/embedded-api/funcs/payrollsGetPayStub";
12
- import { useErrorBoundary as re } from "react-error-boundary";
13
- import { ConfirmWireDetails as ne } from "../ConfirmWireDetails/ConfirmWireDetails.js";
14
- import { PayrollOverviewPresentation as ie } from "./PayrollOverviewPresentation.js";
15
- import { PAYROLL_PROCESSING_STATUS as R, componentEvents as l, PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES as ae, payrollWireEvents as le } from "../../../shared/constants.js";
16
- import { BaseComponent as ce } from "../../Base/Base.js";
17
- import { useBase as ue } from "../../Base/useBase.js";
18
- import { useComponentDictionary as me, useI18n as pe } from "../../../i18n/I18n.js";
19
- import { readableStreamToBlob as de } from "../../../helpers/readableStreamToBlob.js";
20
- import fe from "../../../hooks/useNumberFormatter.js";
21
- import { useDateFormatter as ye } from "../../../hooks/useDateFormatter.js";
22
- import { useComponentContext as Pe } from "../../../contexts/ComponentAdapter/useComponentContext.js";
23
- import { renderErrorList as be } from "../../../helpers/apiErrorToList.js";
24
- import { Flex as Re } from "../../Common/Flex/Flex.js";
10
+ import { useGustoEmbeddedContext as re } from "@gusto/embedded-api/react-query/_context";
11
+ import { payrollsGetPayStub as ne } from "@gusto/embedded-api/funcs/payrollsGetPayStub";
12
+ import { useErrorBoundary as ie } from "react-error-boundary";
13
+ import { ConfirmWireDetails as ae } from "../ConfirmWireDetails/ConfirmWireDetails.js";
14
+ import { PayrollOverviewPresentation as le } from "./PayrollOverviewPresentation.js";
15
+ import { PAYROLL_PROCESSING_STATUS as R, componentEvents as l, PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES as ce, payrollWireEvents as ue } from "../../../shared/constants.js";
16
+ import { BaseComponent as me } from "../../Base/Base.js";
17
+ import { useBase as pe } from "../../Base/useBase.js";
18
+ import { useComponentDictionary as de, useI18n as fe } from "../../../i18n/I18n.js";
19
+ import { readableStreamToBlob as ye } from "../../../helpers/readableStreamToBlob.js";
20
+ import Pe from "../../../hooks/useNumberFormatter.js";
21
+ import { useDateFormatter as be } from "../../../hooks/useDateFormatter.js";
22
+ import { useComponentContext as Re } from "../../../contexts/ComponentAdapter/useComponentContext.js";
23
+ import { renderErrorList as we } from "../../../helpers/apiErrorToList.js";
24
+ import { Flex as Se } from "../../Common/Flex/Flex.js";
25
25
  import "classnames";
26
- const we = (o = []) => o.filter(
26
+ const Oe = (o = []) => o.filter(
27
27
  (i) => i.status === "unresolved" && i.unblockOptions && i.unblockOptions.length > 0
28
- ), Se = (o = []) => {
28
+ ), Le = (o = []) => {
29
29
  const i = o.find((n) => n.status === "unresolved");
30
30
  return i?.unblockOptions ? i.unblockOptions.find(
31
31
  (n) => n.unblockType === "submit_wire"
32
32
  )?.metadata.wireInRequestUuid : void 0;
33
33
  };
34
- function Ze(o) {
35
- return /* @__PURE__ */ c(ce, { ...o, children: /* @__PURE__ */ c(Oe, { ...o, children: o.children }) });
34
+ function et(o) {
35
+ return /* @__PURE__ */ c(me, { ...o, children: /* @__PURE__ */ c(De, { ...o, children: o.children }) });
36
36
  }
37
- const Oe = ({
37
+ const De = ({
38
38
  companyId: o,
39
39
  payrollId: i,
40
40
  dictionary: O,
41
41
  onEvent: n,
42
- alerts: k
42
+ alerts: k,
43
+ withReimbursements: A = !0,
44
+ ConfirmWireDetailsComponent: g = ae
43
45
  }) => {
44
- me("Payroll.PayrollOverview", O), pe("Payroll.PayrollOverview");
45
- const { baseSubmitHandler: L } = ue(), { t: a } = Z("Payroll.PayrollOverview"), [u, p] = b(!1), [A, d] = b(k || []), [D, g] = b({}), [f, m] = b(!1), { showBoundary: B } = re(), _ = fe("currency"), y = ye(), { Button: v, UnorderedList: T, Text: h } = Pe(), { data: w } = X(
46
+ de("Payroll.PayrollOverview", O), fe("Payroll.PayrollOverview");
47
+ const { baseSubmitHandler: L } = pe(), { t: a } = ee("Payroll.PayrollOverview"), [u, p] = b(!1), [B, d] = b(k || []), [D, v] = b({}), [f, m] = b(!1), { showBoundary: T } = ie(), _ = Pe("currency"), y = be(), { Button: q, UnorderedList: N, Text: h } = Re(), { data: w } = $(
46
48
  {
47
49
  companyId: o,
48
50
  payrollId: i,
49
51
  include: ["taxes", "benefits", "deductions"]
50
52
  },
51
53
  { refetchInterval: u ? 5e3 : !1 }
52
- ), e = w.payrollShow, q = we(e.submissionBlockers), P = Se(e.creditBlockers), { data: N } = te(
54
+ ), e = w.payrollShow, I = Oe(e.submissionBlockers), P = Le(e.creditBlockers), { data: W } = oe(
53
55
  {
54
56
  wireInRequestUuid: P || ""
55
57
  },
56
58
  { enabled: !!P }
57
- ), E = N?.wireInRequest, C = () => {
59
+ ), E = W?.wireInRequest, C = () => {
58
60
  n(l.RUN_PAYROLL_EDIT);
59
- }, I = P && /* @__PURE__ */ c(ne, { companyId: o, wireInId: P, onEvent: (t, r) => {
60
- t === le.PAYROLL_WIRE_FORM_DONE && m(!0), n(t, r);
61
- } });
61
+ }, Y = P && /* @__PURE__ */ c(
62
+ g,
63
+ {
64
+ companyId: o,
65
+ wireInId: P,
66
+ onEvent: (t, r) => {
67
+ t === ue.PAYROLL_WIRE_FORM_DONE && m(!0), n(t, r);
68
+ }
69
+ }
70
+ );
62
71
  S(() => {
63
72
  E?.status === "pending_review" && !f && m(!0);
64
73
  }, [E?.status, f]), S(() => {
@@ -91,9 +100,9 @@ const Oe = ({
91
100
  {
92
101
  type: "error",
93
102
  title: a("alerts.payrollProcessingFailedTitle"),
94
- content: /* @__PURE__ */ z(Re, { flexDirection: "column", gap: 16, children: [
95
- /* @__PURE__ */ c(T, { items: be(e.processingRequest.errors ?? []) }),
96
- /* @__PURE__ */ c(v, { variant: "secondary", onClick: C, children: a("alerts.payrollProcessingFailedCtaLabel") })
103
+ content: /* @__PURE__ */ Q(Se, { flexDirection: "column", gap: 16, children: [
104
+ /* @__PURE__ */ c(N, { items: we(e.processingRequest.errors ?? []) }),
105
+ /* @__PURE__ */ c(q, { variant: "secondary", onClick: C, children: a("alerts.payrollProcessingFailedCtaLabel") })
97
106
  ] })
98
107
  }
99
108
  ]), m(!1), p(!1));
@@ -108,14 +117,14 @@ const Oe = ({
108
117
  e.payrollStatusMeta?.expectedDebitTime,
109
118
  e.payrollDeadline
110
119
  ]);
111
- const { data: W } = $({
120
+ const { data: F } = te({
112
121
  companyId: o
113
- }), Y = W.companyBankAccounts?.[0], { data: F } = ee({
122
+ }), M = F.companyBankAccounts?.[0], { data: G } = se({
114
123
  companyId: o
115
- }), { mutateAsync: M, isPending: G } = J(), { mutateAsync: x, isPending: j } = Q();
124
+ }), { mutateAsync: x, isPending: j } = X(), { mutateAsync: V, isPending: H } = Z();
116
125
  if (!e.calculatedAt)
117
126
  throw new Error(a("alerts.payrollNotCalculated"));
118
- const V = se(), H = e.employeeCompensations?.reduce(
127
+ const K = re(), z = e.employeeCompensations?.reduce(
119
128
  (t, r) => (r.taxes?.forEach((s) => {
120
129
  t[s.name] = {
121
130
  employee: (t[s.name]?.employee ?? 0) + (s.employer ? 0 : s.amount),
@@ -125,18 +134,18 @@ const Oe = ({
125
134
  {}
126
135
  ) || {};
127
136
  return /* @__PURE__ */ c(
128
- ie,
137
+ le,
129
138
  {
130
139
  onEdit: C,
131
140
  onSubmit: async () => {
132
141
  await L(w, async () => {
133
- const t = await M({
142
+ const t = await x({
134
143
  request: {
135
144
  companyId: o,
136
145
  payrollId: i,
137
146
  requestBody: {
138
147
  submissionBlockers: Object.entries(D).filter(
139
- ([r]) => ae.includes(r)
148
+ ([r]) => ce.includes(r)
140
149
  ).map(([r, s]) => ({
141
150
  blockerType: r,
142
151
  selectedOption: s
@@ -149,7 +158,7 @@ const Oe = ({
149
158
  },
150
159
  onCancel: async () => {
151
160
  await L(w, async () => {
152
- const t = await x({
161
+ const t = await V({
153
162
  request: {
154
163
  companyId: o,
155
164
  payrollId: i
@@ -164,33 +173,34 @@ const Oe = ({
164
173
  onPaystubDownload: async (t) => {
165
174
  const r = window.open("", "_blank");
166
175
  try {
167
- const s = await oe(V, { payrollId: i, employeeId: t });
176
+ const s = await ne(K, { payrollId: i, employeeId: t });
168
177
  if (!s.value?.responseStream)
169
178
  throw new Error(a("alerts.paystubPdfError"));
170
- const K = await de(s.value.responseStream, "application/pdf"), U = URL.createObjectURL(K);
179
+ const J = await ye(s.value.responseStream, "application/pdf"), U = URL.createObjectURL(J);
171
180
  r && (r.location.href = U), n(l.RUN_PAYROLL_PDF_PAYSTUB_VIEWED, { employeeId: t }), URL.revokeObjectURL(U);
172
181
  } catch (s) {
173
- r && r.close(), B(s);
182
+ r && r.close(), T(s);
174
183
  }
175
184
  },
176
- isSubmitting: G || u || j,
185
+ isSubmitting: j || u || H,
177
186
  isProcessed: e.processingRequest?.status === R.submit_success,
178
187
  payrollData: e,
179
- bankAccount: Y,
180
- employeeDetails: F.showEmployees || [],
181
- taxes: H,
182
- alerts: A,
183
- submissionBlockers: q,
188
+ bankAccount: M,
189
+ employeeDetails: G.showEmployees || [],
190
+ taxes: z,
191
+ alerts: B,
192
+ submissionBlockers: I,
184
193
  selectedUnblockOptions: D,
185
194
  onUnblockOptionChange: (t, r) => {
186
- g((s) => ({ ...s, [t]: r }));
195
+ v((s) => ({ ...s, [t]: r }));
187
196
  },
188
- wireInConfirmationRequest: I
197
+ wireInConfirmationRequest: Y,
198
+ withReimbursements: A
189
199
  }
190
200
  );
191
201
  };
192
202
  export {
193
- Ze as PayrollOverview,
194
- Oe as Root
203
+ et as PayrollOverview,
204
+ De as Root
195
205
  };
196
206
  //# sourceMappingURL=PayrollOverview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollOverview.js","sources":["../../../../src/components/Payroll/PayrollOverview/PayrollOverview.tsx"],"sourcesContent":["import { usePayrollsSubmitMutation } from '@gusto/embedded-api/react-query/payrollsSubmit'\nimport { usePayrollsCancelMutation } from '@gusto/embedded-api/react-query/payrollsCancel'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { useTranslation } from 'react-i18next'\nimport { useBankAccountsGetSuspense } from '@gusto/embedded-api/react-query/bankAccountsGet'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { useWireInRequestsGet } from '@gusto/embedded-api/react-query/wireInRequestsGet'\nimport { useEffect, useState } from 'react'\nimport { useGustoEmbeddedContext } from '@gusto/embedded-api/react-query/_context'\nimport { payrollsGetPayStub } from '@gusto/embedded-api/funcs/payrollsGetPayStub'\nimport { useErrorBoundary } from 'react-error-boundary'\nimport type { PayrollSubmissionBlockersType } from '@gusto/embedded-api/models/components/payrollsubmissionblockerstype'\nimport type { PayrollCreditBlockersType } from '@gusto/embedded-api/models/components/payrollcreditblockerstype'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport { ConfirmWireDetails } from '../ConfirmWireDetails/ConfirmWireDetails'\nimport { PayrollOverviewPresentation } from './PayrollOverviewPresentation'\nimport {\n componentEvents,\n payrollWireEvents,\n PAYROLL_PROCESSING_STATUS,\n PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES,\n type EventType,\n} from '@/shared/constants'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { readableStreamToBlob } from '@/helpers/readableStreamToBlob'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { renderErrorList } from '@/helpers/apiErrorToList'\nimport { Flex } from '@/components/Common'\n\ninterface PayrollOverviewProps extends BaseComponentInterface<'Payroll.PayrollOverview'> {\n companyId: string\n payrollId: string\n alerts?: PayrollFlowAlert[]\n}\n\nconst findUnresolvedBlockersWithOptions = (blockers: PayrollSubmissionBlockersType[] = []) => {\n return blockers.filter(\n blocker =>\n blocker.status === 'unresolved' &&\n blocker.unblockOptions &&\n blocker.unblockOptions.length > 0,\n )\n}\n\nconst findWireInRequestUuid = (\n creditBlockers: PayrollCreditBlockersType[] = [],\n): string | undefined => {\n const unresolvedCreditBlocker = creditBlockers.find(blocker => blocker.status === 'unresolved')\n\n if (!unresolvedCreditBlocker?.unblockOptions) {\n return undefined\n }\n\n const wireUnblockOption = unresolvedCreditBlocker.unblockOptions.find(\n option => option.unblockType === 'submit_wire',\n )\n\n return wireUnblockOption?.metadata.wireInRequestUuid\n}\n\nexport function PayrollOverview(props: PayrollOverviewProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n companyId,\n payrollId,\n dictionary,\n onEvent,\n alerts,\n}: PayrollOverviewProps) => {\n useComponentDictionary('Payroll.PayrollOverview', dictionary)\n useI18n('Payroll.PayrollOverview')\n const { baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.PayrollOverview')\n const [isPolling, setIsPolling] = useState(false)\n const [internalAlerts, setInternalAlerts] = useState<PayrollFlowAlert[]>(alerts || [])\n const [selectedUnblockOptions, setSelectedUnblockOptions] = useState<Record<string, string>>({})\n const [showWireDetailsConfirmation, setShowWireDetailsConfirmation] = useState(false)\n const { showBoundary } = useErrorBoundary()\n const formatCurrency = useNumberFormatter('currency')\n const dateFormatter = useDateFormatter()\n const { Button, UnorderedList, Text } = useComponentContext()\n const { data } = usePayrollsGetSuspense(\n {\n companyId,\n payrollId: payrollId,\n include: ['taxes', 'benefits', 'deductions'],\n },\n { refetchInterval: isPolling ? 5_000 : false },\n )\n const payrollData = data.payrollShow!\n const submissionBlockers = findUnresolvedBlockersWithOptions(payrollData.submissionBlockers)\n const wireInId = findWireInRequestUuid(payrollData.creditBlockers)\n\n const { data: wireInRequestData } = useWireInRequestsGet(\n {\n wireInRequestUuid: wireInId || '',\n },\n { enabled: !!wireInId },\n )\n const wireInRequest = wireInRequestData?.wireInRequest\n\n const onEdit = () => {\n onEvent(componentEvents.RUN_PAYROLL_EDIT)\n }\n\n const handleWireEvent = (type: EventType, data?: unknown) => {\n if (type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE) {\n setShowWireDetailsConfirmation(true)\n }\n onEvent(type, data)\n }\n\n const wireInConfirmationRequest = wireInId && (\n <ConfirmWireDetails companyId={companyId} wireInId={wireInId} onEvent={handleWireEvent} />\n )\n\n useEffect(() => {\n if (wireInRequest?.status === 'pending_review' && !showWireDetailsConfirmation) {\n setShowWireDetailsConfirmation(true)\n }\n }, [wireInRequest?.status, showWireDetailsConfirmation])\n\n useEffect(() => {\n if (showWireDetailsConfirmation) {\n const checkDate = dateFormatter.formatShortWithYear(payrollData.checkDate)\n\n setInternalAlerts([\n {\n type: 'success',\n title: t('alerts.wireDetailsSubmittedTitle'),\n content: <Text>{t('alerts.wireDetailsSubmittedMessage', { checkDate })}</Text>,\n onDismiss: () => {\n setShowWireDetailsConfirmation(false)\n },\n },\n ])\n }\n }, [showWireDetailsConfirmation, payrollData.checkDate, t, dateFormatter, Text])\n\n useEffect(() => {\n // Start polling when payroll is submitting and not already polling\n if (\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submitting &&\n !isPolling\n ) {\n setIsPolling(true)\n }\n // Stop polling and emit event when payroll is processed successfully\n if (\n isPolling &&\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submit_success\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSED)\n setInternalAlerts([\n {\n type: 'success',\n title: t('alerts.payrollProcessedTitle'),\n content: t('alerts.payrollProcessedMessage', {\n amount: formatCurrency(Number(payrollData.totals?.netPayDebit)),\n date: dateFormatter.formatShortWithYear(\n payrollData.payrollStatusMeta?.expectedDebitTime ?? payrollData.payrollDeadline,\n ),\n }),\n },\n ])\n setShowWireDetailsConfirmation(false)\n setIsPolling(false)\n }\n // If we are polling and payroll is in failed state, stop polling, and emit failure event\n if (\n isPolling &&\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.processing_failed\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setInternalAlerts([\n {\n type: 'error',\n title: t('alerts.payrollProcessingFailedTitle'),\n content: (\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={renderErrorList(payrollData.processingRequest.errors ?? [])} />\n <Button variant=\"secondary\" onClick={onEdit}>\n {t('alerts.payrollProcessingFailedCtaLabel')}\n </Button>\n </Flex>\n ),\n },\n ])\n setShowWireDetailsConfirmation(false)\n setIsPolling(false)\n }\n }, [\n payrollData.processingRequest?.status,\n isPolling,\n onEvent,\n t,\n dateFormatter,\n formatCurrency,\n payrollData.totals?.netPayDebit,\n payrollData.payrollStatusMeta?.expectedDebitTime,\n payrollData.payrollDeadline,\n ])\n\n const { data: bankAccountData } = useBankAccountsGetSuspense({\n companyId,\n })\n const bankAccount = bankAccountData.companyBankAccounts?.[0]\n\n const { data: employeeData } = useEmployeesListSuspense({\n companyId,\n })\n\n const { mutateAsync: submitPayroll, isPending } = usePayrollsSubmitMutation()\n\n const { mutateAsync: cancelPayroll, isPending: isPendingCancel } = usePayrollsCancelMutation()\n\n if (!payrollData.calculatedAt) {\n throw new Error(t('alerts.payrollNotCalculated'))\n }\n const gustoEmbedded = useGustoEmbeddedContext()\n\n const taxes =\n payrollData.employeeCompensations?.reduce(\n (acc, compensation) => {\n compensation.taxes?.forEach(tax => {\n acc[tax.name] = {\n employee: (acc[tax.name]?.employee ?? 0) + (tax.employer ? 0 : tax.amount),\n employer: (acc[tax.name]?.employer ?? 0) + (tax.employer ? tax.amount : 0),\n }\n })\n\n return acc\n },\n {} as Record<string, { employee: number; employer: number }>,\n ) || {}\n\n const onCancel = async () => {\n await baseSubmitHandler(data, async () => {\n const result = await cancelPayroll({\n request: {\n companyId,\n payrollId,\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_CANCELLED, result)\n setInternalAlerts([])\n })\n }\n const onPayrollReceipt = () => {\n onEvent(componentEvents.RUN_PAYROLL_RECEIPT_GET, { payrollId })\n }\n\n const onPaystubDownload = async (employeeId: string) => {\n // Open a blank window *synchronously* with the click\n const newWindow = window.open('', '_blank')\n\n try {\n // Fetch the PDF from your API\n const response = await payrollsGetPayStub(gustoEmbedded, { payrollId, employeeId })\n if (!response.value?.responseStream) {\n throw new Error(t('alerts.paystubPdfError'))\n }\n const pdfBlob = await readableStreamToBlob(response.value.responseStream, 'application/pdf')\n\n const url = URL.createObjectURL(pdfBlob)\n\n // Load the PDF into the new window\n if (newWindow) {\n newWindow.location.href = url\n }\n onEvent(componentEvents.RUN_PAYROLL_PDF_PAYSTUB_VIEWED, { employeeId })\n URL.revokeObjectURL(url) // Clean up the URL object after use\n } catch (err) {\n if (newWindow) {\n newWindow.close()\n }\n showBoundary(err)\n }\n }\n const onSubmit = async () => {\n await baseSubmitHandler(data, async () => {\n const result = await submitPayroll({\n request: {\n companyId,\n payrollId,\n requestBody: {\n submissionBlockers: Object.entries(selectedUnblockOptions)\n .filter(([blockerType]) =>\n PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES.includes(blockerType),\n )\n .map(([blockerType, selectedOption]) => ({\n blockerType,\n selectedOption,\n })),\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_SUBMITTED, result)\n setIsPolling(true)\n })\n }\n\n return (\n <PayrollOverviewPresentation\n onEdit={onEdit}\n onSubmit={onSubmit}\n onCancel={onCancel}\n onPayrollReceipt={onPayrollReceipt}\n onPaystubDownload={onPaystubDownload}\n isSubmitting={isPending || isPolling || isPendingCancel}\n isProcessed={\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submit_success\n }\n payrollData={payrollData}\n bankAccount={bankAccount}\n employeeDetails={employeeData.showEmployees || []}\n taxes={taxes}\n alerts={internalAlerts}\n submissionBlockers={submissionBlockers}\n selectedUnblockOptions={selectedUnblockOptions}\n onUnblockOptionChange={(blockerType, value) => {\n setSelectedUnblockOptions(prev => ({ ...prev, [blockerType]: value }))\n }}\n wireInConfirmationRequest={wireInConfirmationRequest}\n />\n )\n}\n"],"names":["findUnresolvedBlockersWithOptions","blockers","blocker","findWireInRequestUuid","creditBlockers","unresolvedCreditBlocker","option","PayrollOverview","props","jsx","BaseComponent","Root","companyId","payrollId","dictionary","onEvent","alerts","useComponentDictionary","useI18n","baseSubmitHandler","useBase","t","useTranslation","isPolling","setIsPolling","useState","internalAlerts","setInternalAlerts","selectedUnblockOptions","setSelectedUnblockOptions","showWireDetailsConfirmation","setShowWireDetailsConfirmation","showBoundary","useErrorBoundary","formatCurrency","useNumberFormatter","dateFormatter","useDateFormatter","Button","UnorderedList","Text","useComponentContext","data","usePayrollsGetSuspense","payrollData","submissionBlockers","wireInId","wireInRequestData","useWireInRequestsGet","wireInRequest","onEdit","componentEvents","wireInConfirmationRequest","ConfirmWireDetails","type","payrollWireEvents","useEffect","checkDate","PAYROLL_PROCESSING_STATUS","jsxs","Flex","renderErrorList","bankAccountData","useBankAccountsGetSuspense","bankAccount","employeeData","useEmployeesListSuspense","submitPayroll","isPending","usePayrollsSubmitMutation","cancelPayroll","isPendingCancel","usePayrollsCancelMutation","gustoEmbedded","useGustoEmbeddedContext","taxes","acc","compensation","tax","PayrollOverviewPresentation","result","blockerType","PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES","selectedOption","employeeId","newWindow","response","payrollsGetPayStub","pdfBlob","readableStreamToBlob","url","err","value","prev"],"mappings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AY,mBAAmB,WAAWc,EAA0B;AAAA,MAEtE,aAAAd;AAAA,MACA,aAAAoB;AAAA,MACA,iBAAiBC,EAAa,iBAAiB,CAAA;AAAA,MAC/C,OAAAU;AAAA,MACA,QAAQjD;AAAA,MACR,oBAAAmB;AAAA,MACA,wBAAAjB;AAAA,MACA,uBAAuB,CAACqD,GAAaW,MAAU;AAC7C,QAAA/D,EAA0B,CAAAgE,OAAS,EAAE,GAAGA,GAAM,CAACZ,CAAW,GAAGW,IAAQ;AAAA,MACvE;AAAA,MACA,2BAAAxC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PayrollOverview.js","sources":["../../../../src/components/Payroll/PayrollOverview/PayrollOverview.tsx"],"sourcesContent":["import { usePayrollsSubmitMutation } from '@gusto/embedded-api/react-query/payrollsSubmit'\nimport { usePayrollsCancelMutation } from '@gusto/embedded-api/react-query/payrollsCancel'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { useTranslation } from 'react-i18next'\nimport { useBankAccountsGetSuspense } from '@gusto/embedded-api/react-query/bankAccountsGet'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { useWireInRequestsGet } from '@gusto/embedded-api/react-query/wireInRequestsGet'\nimport { useEffect, useState } from 'react'\nimport { useGustoEmbeddedContext } from '@gusto/embedded-api/react-query/_context'\nimport { payrollsGetPayStub } from '@gusto/embedded-api/funcs/payrollsGetPayStub'\nimport { useErrorBoundary } from 'react-error-boundary'\nimport type { PayrollSubmissionBlockersType } from '@gusto/embedded-api/models/components/payrollsubmissionblockerstype'\nimport type { PayrollCreditBlockersType } from '@gusto/embedded-api/models/components/payrollcreditblockerstype'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport {\n ConfirmWireDetails,\n type ConfirmWireDetailsComponentType,\n} from '../ConfirmWireDetails/ConfirmWireDetails'\nimport { PayrollOverviewPresentation } from './PayrollOverviewPresentation'\nimport {\n componentEvents,\n payrollWireEvents,\n PAYROLL_PROCESSING_STATUS,\n PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES,\n type EventType,\n} from '@/shared/constants'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { readableStreamToBlob } from '@/helpers/readableStreamToBlob'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { renderErrorList } from '@/helpers/apiErrorToList'\nimport { Flex } from '@/components/Common'\n\ninterface PayrollOverviewProps extends BaseComponentInterface<'Payroll.PayrollOverview'> {\n companyId: string\n payrollId: string\n alerts?: PayrollFlowAlert[]\n withReimbursements?: boolean\n ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType\n}\n\nconst findUnresolvedBlockersWithOptions = (blockers: PayrollSubmissionBlockersType[] = []) => {\n return blockers.filter(\n blocker =>\n blocker.status === 'unresolved' &&\n blocker.unblockOptions &&\n blocker.unblockOptions.length > 0,\n )\n}\n\nconst findWireInRequestUuid = (\n creditBlockers: PayrollCreditBlockersType[] = [],\n): string | undefined => {\n const unresolvedCreditBlocker = creditBlockers.find(blocker => blocker.status === 'unresolved')\n\n if (!unresolvedCreditBlocker?.unblockOptions) {\n return undefined\n }\n\n const wireUnblockOption = unresolvedCreditBlocker.unblockOptions.find(\n option => option.unblockType === 'submit_wire',\n )\n\n return wireUnblockOption?.metadata.wireInRequestUuid\n}\n\nexport function PayrollOverview(props: PayrollOverviewProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n companyId,\n payrollId,\n dictionary,\n onEvent,\n alerts,\n withReimbursements = true,\n ConfirmWireDetailsComponent = ConfirmWireDetails,\n}: PayrollOverviewProps) => {\n useComponentDictionary('Payroll.PayrollOverview', dictionary)\n useI18n('Payroll.PayrollOverview')\n const { baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.PayrollOverview')\n const [isPolling, setIsPolling] = useState(false)\n const [internalAlerts, setInternalAlerts] = useState<PayrollFlowAlert[]>(alerts || [])\n const [selectedUnblockOptions, setSelectedUnblockOptions] = useState<Record<string, string>>({})\n const [showWireDetailsConfirmation, setShowWireDetailsConfirmation] = useState(false)\n const { showBoundary } = useErrorBoundary()\n const formatCurrency = useNumberFormatter('currency')\n const dateFormatter = useDateFormatter()\n const { Button, UnorderedList, Text } = useComponentContext()\n const { data } = usePayrollsGetSuspense(\n {\n companyId,\n payrollId: payrollId,\n include: ['taxes', 'benefits', 'deductions'],\n },\n { refetchInterval: isPolling ? 5_000 : false },\n )\n const payrollData = data.payrollShow!\n const submissionBlockers = findUnresolvedBlockersWithOptions(payrollData.submissionBlockers)\n const wireInId = findWireInRequestUuid(payrollData.creditBlockers)\n\n const { data: wireInRequestData } = useWireInRequestsGet(\n {\n wireInRequestUuid: wireInId || '',\n },\n { enabled: !!wireInId },\n )\n const wireInRequest = wireInRequestData?.wireInRequest\n\n const onEdit = () => {\n onEvent(componentEvents.RUN_PAYROLL_EDIT)\n }\n\n const handleWireEvent = (type: EventType, data?: unknown) => {\n if (type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE) {\n setShowWireDetailsConfirmation(true)\n }\n onEvent(type, data)\n }\n\n const wireInConfirmationRequest = wireInId && (\n <ConfirmWireDetailsComponent\n companyId={companyId}\n wireInId={wireInId}\n onEvent={handleWireEvent}\n />\n )\n\n useEffect(() => {\n if (wireInRequest?.status === 'pending_review' && !showWireDetailsConfirmation) {\n setShowWireDetailsConfirmation(true)\n }\n }, [wireInRequest?.status, showWireDetailsConfirmation])\n\n useEffect(() => {\n if (showWireDetailsConfirmation) {\n const checkDate = dateFormatter.formatShortWithYear(payrollData.checkDate)\n\n setInternalAlerts([\n {\n type: 'success',\n title: t('alerts.wireDetailsSubmittedTitle'),\n content: <Text>{t('alerts.wireDetailsSubmittedMessage', { checkDate })}</Text>,\n onDismiss: () => {\n setShowWireDetailsConfirmation(false)\n },\n },\n ])\n }\n }, [showWireDetailsConfirmation, payrollData.checkDate, t, dateFormatter, Text])\n\n useEffect(() => {\n // Start polling when payroll is submitting and not already polling\n if (\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submitting &&\n !isPolling\n ) {\n setIsPolling(true)\n }\n // Stop polling and emit event when payroll is processed successfully\n if (\n isPolling &&\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submit_success\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSED)\n setInternalAlerts([\n {\n type: 'success',\n title: t('alerts.payrollProcessedTitle'),\n content: t('alerts.payrollProcessedMessage', {\n amount: formatCurrency(Number(payrollData.totals?.netPayDebit)),\n date: dateFormatter.formatShortWithYear(\n payrollData.payrollStatusMeta?.expectedDebitTime ?? payrollData.payrollDeadline,\n ),\n }),\n },\n ])\n setShowWireDetailsConfirmation(false)\n setIsPolling(false)\n }\n // If we are polling and payroll is in failed state, stop polling, and emit failure event\n if (\n isPolling &&\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.processing_failed\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setInternalAlerts([\n {\n type: 'error',\n title: t('alerts.payrollProcessingFailedTitle'),\n content: (\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={renderErrorList(payrollData.processingRequest.errors ?? [])} />\n <Button variant=\"secondary\" onClick={onEdit}>\n {t('alerts.payrollProcessingFailedCtaLabel')}\n </Button>\n </Flex>\n ),\n },\n ])\n setShowWireDetailsConfirmation(false)\n setIsPolling(false)\n }\n }, [\n payrollData.processingRequest?.status,\n isPolling,\n onEvent,\n t,\n dateFormatter,\n formatCurrency,\n payrollData.totals?.netPayDebit,\n payrollData.payrollStatusMeta?.expectedDebitTime,\n payrollData.payrollDeadline,\n ])\n\n const { data: bankAccountData } = useBankAccountsGetSuspense({\n companyId,\n })\n const bankAccount = bankAccountData.companyBankAccounts?.[0]\n\n const { data: employeeData } = useEmployeesListSuspense({\n companyId,\n })\n\n const { mutateAsync: submitPayroll, isPending } = usePayrollsSubmitMutation()\n\n const { mutateAsync: cancelPayroll, isPending: isPendingCancel } = usePayrollsCancelMutation()\n\n if (!payrollData.calculatedAt) {\n throw new Error(t('alerts.payrollNotCalculated'))\n }\n const gustoEmbedded = useGustoEmbeddedContext()\n\n const taxes =\n payrollData.employeeCompensations?.reduce(\n (acc, compensation) => {\n compensation.taxes?.forEach(tax => {\n acc[tax.name] = {\n employee: (acc[tax.name]?.employee ?? 0) + (tax.employer ? 0 : tax.amount),\n employer: (acc[tax.name]?.employer ?? 0) + (tax.employer ? tax.amount : 0),\n }\n })\n\n return acc\n },\n {} as Record<string, { employee: number; employer: number }>,\n ) || {}\n\n const onCancel = async () => {\n await baseSubmitHandler(data, async () => {\n const result = await cancelPayroll({\n request: {\n companyId,\n payrollId,\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_CANCELLED, result)\n setInternalAlerts([])\n })\n }\n const onPayrollReceipt = () => {\n onEvent(componentEvents.RUN_PAYROLL_RECEIPT_GET, { payrollId })\n }\n\n const onPaystubDownload = async (employeeId: string) => {\n // Open a blank window *synchronously* with the click\n const newWindow = window.open('', '_blank')\n\n try {\n // Fetch the PDF from your API\n const response = await payrollsGetPayStub(gustoEmbedded, { payrollId, employeeId })\n if (!response.value?.responseStream) {\n throw new Error(t('alerts.paystubPdfError'))\n }\n const pdfBlob = await readableStreamToBlob(response.value.responseStream, 'application/pdf')\n\n const url = URL.createObjectURL(pdfBlob)\n\n // Load the PDF into the new window\n if (newWindow) {\n newWindow.location.href = url\n }\n onEvent(componentEvents.RUN_PAYROLL_PDF_PAYSTUB_VIEWED, { employeeId })\n URL.revokeObjectURL(url) // Clean up the URL object after use\n } catch (err) {\n if (newWindow) {\n newWindow.close()\n }\n showBoundary(err)\n }\n }\n const onSubmit = async () => {\n await baseSubmitHandler(data, async () => {\n const result = await submitPayroll({\n request: {\n companyId,\n payrollId,\n requestBody: {\n submissionBlockers: Object.entries(selectedUnblockOptions)\n .filter(([blockerType]) =>\n PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES.includes(blockerType),\n )\n .map(([blockerType, selectedOption]) => ({\n blockerType,\n selectedOption,\n })),\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_SUBMITTED, result)\n setIsPolling(true)\n })\n }\n\n return (\n <PayrollOverviewPresentation\n onEdit={onEdit}\n onSubmit={onSubmit}\n onCancel={onCancel}\n onPayrollReceipt={onPayrollReceipt}\n onPaystubDownload={onPaystubDownload}\n isSubmitting={isPending || isPolling || isPendingCancel}\n isProcessed={\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submit_success\n }\n payrollData={payrollData}\n bankAccount={bankAccount}\n employeeDetails={employeeData.showEmployees || []}\n taxes={taxes}\n alerts={internalAlerts}\n submissionBlockers={submissionBlockers}\n selectedUnblockOptions={selectedUnblockOptions}\n onUnblockOptionChange={(blockerType, value) => {\n setSelectedUnblockOptions(prev => ({ ...prev, [blockerType]: value }))\n }}\n wireInConfirmationRequest={wireInConfirmationRequest}\n withReimbursements={withReimbursements}\n />\n )\n}\n"],"names":["findUnresolvedBlockersWithOptions","blockers","blocker","findWireInRequestUuid","creditBlockers","unresolvedCreditBlocker","option","PayrollOverview","props","jsx","BaseComponent","Root","companyId","payrollId","dictionary","onEvent","alerts","withReimbursements","ConfirmWireDetailsComponent","ConfirmWireDetails","useComponentDictionary","useI18n","baseSubmitHandler","useBase","t","useTranslation","isPolling","setIsPolling","useState","internalAlerts","setInternalAlerts","selectedUnblockOptions","setSelectedUnblockOptions","showWireDetailsConfirmation","setShowWireDetailsConfirmation","showBoundary","useErrorBoundary","formatCurrency","useNumberFormatter","dateFormatter","useDateFormatter","Button","UnorderedList","Text","useComponentContext","data","usePayrollsGetSuspense","payrollData","submissionBlockers","wireInId","wireInRequestData","useWireInRequestsGet","wireInRequest","onEdit","componentEvents","wireInConfirmationRequest","type","payrollWireEvents","useEffect","checkDate","PAYROLL_PROCESSING_STATUS","jsxs","Flex","renderErrorList","bankAccountData","useBankAccountsGetSuspense","bankAccount","employeeData","useEmployeesListSuspense","submitPayroll","isPending","usePayrollsSubmitMutation","cancelPayroll","isPendingCancel","usePayrollsCancelMutation","gustoEmbedded","useGustoEmbeddedContext","taxes","acc","compensation","tax","PayrollOverviewPresentation","result","blockerType","PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES","selectedOption","employeeId","newWindow","response","payrollsGetPayStub","pdfBlob","readableStreamToBlob","url","err","value","prev"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAMA,KAAoC,CAACC,IAA4C,OAC9EA,EAAS;AAAA,EACd,CAAAC,MACEA,EAAQ,WAAW,gBACnBA,EAAQ,kBACRA,EAAQ,eAAe,SAAS;AAAA,GAIhCC,KAAwB,CAC5BC,IAA8C,OACvB;AACvB,QAAMC,IAA0BD,EAAe,KAAK,CAAAF,MAAWA,EAAQ,WAAW,YAAY;AAE9F,SAAKG,GAAyB,iBAIJA,EAAwB,eAAe;AAAA,IAC/D,CAAAC,MAAUA,EAAO,gBAAgB;AAAA,EAAA,GAGT,SAAS,oBAPjC;AAQJ;AAEO,SAASC,GAAgBC,GAA6B;AAC3D,SACE,gBAAAC,EAACC,IAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,KAAO,CAAC;AAAA,EACnB,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,6BAAAC,IAA8BC;AAChC,MAA4B;AAC1B,EAAAC,GAAuB,2BAA2BN,CAAU,GAC5DO,GAAQ,yBAAyB;AACjC,QAAM,EAAE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EAAE,WAAA9D,GAAW,YAAAyE,GAAY;AAClF,cAAI,CAACE,EAAS,OAAO;AACnB,kBAAM,IAAI,MAAMhE,EAAE,wBAAwB,CAAC;AAE7C,gBAAMkE,IAAU,MAAMC,GAAqBH,EAAS,MAAM,gBAAgB,iBAAiB,GAErFI,IAAM,IAAI,gBAAgBF,CAAO;AAGvC,UAAIH,MACFA,EAAU,SAAS,OAAOK,IAE5B7E,EAAQuC,EAAgB,gCAAgC,EAAE,YAAAgC,EAAA,CAAY,GACtE,IAAI,gBAAgBM,CAAG;AAAA,QACzB,SAASC,GAAK;AACZ,UAAIN,KACFA,EAAU,MAAA,GAEZpD,EAAa0D,CAAG;AAAA,QAClB;AAAA,MACF;AAAA,MA+BI,cAAcvB,KAAa5C,KAAa+C;AAAA,MACxC,aACE1B,EAAY,mBAAmB,WAAWa,EAA0B;AAAA,MAEtE,aAAAb;AAAA,MACA,aAAAmB;AAAA,MACA,iBAAiBC,EAAa,iBAAiB,CAAA;AAAA,MAC/C,OAAAU;AAAA,MACA,QAAQhD;AAAA,MACR,oBAAAmB;AAAA,MACA,wBAAAjB;AAAA,MACA,uBAAuB,CAACoD,GAAaW,MAAU;AAC7C,QAAA9D,EAA0B,CAAA+D,OAAS,EAAE,GAAGA,GAAM,CAACZ,CAAW,GAAGW,IAAQ;AAAA,MACvE;AAAA,MACA,2BAAAvC;AAAA,MACA,oBAAAtC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -23,6 +23,7 @@ interface PayrollOverviewProps {
23
23
  onPayrollReceipt: () => void;
24
24
  onPaystubDownload: (employeeId: string) => void;
25
25
  onUnblockOptionChange?: (blockerType: string, value: string) => void;
26
+ withReimbursements?: boolean;
26
27
  }
27
- export declare const PayrollOverviewPresentation: ({ onEdit, onSubmit, onCancel, onPayrollReceipt, onPaystubDownload, employeeDetails, payrollData, bankAccount, taxes, isSubmitting, isProcessed, alerts, submissionBlockers, selectedUnblockOptions, onUnblockOptionChange, wireInConfirmationRequest, }: PayrollOverviewProps) => import("react/jsx-runtime").JSX.Element;
28
+ export declare const PayrollOverviewPresentation: ({ onEdit, onSubmit, onCancel, onPayrollReceipt, onPaystubDownload, employeeDetails, payrollData, bankAccount, taxes, isSubmitting, isProcessed, alerts, submissionBlockers, selectedUnblockOptions, onUnblockOptionChange, wireInConfirmationRequest, withReimbursements, }: PayrollOverviewProps) => import("react/jsx-runtime").JSX.Element;
28
29
  export {};