@zeniai/client-epic-state 5.1.93 → 5.1.95-betaAK0
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/lib/commonStateTypes/viewAndReport/reportIDHelper.d.ts +16 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +22 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +7 -0
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +3 -2
- package/lib/entity/aiCfo/aiCfoReducer.js +25 -2
- package/lib/entity/aiCfo/aiCfoState.d.ts +7 -0
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classSelectorV2.d.ts +2 -1
- package/lib/entity/class/classSelectorV2.js +7 -7
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/company/companyPayload.d.ts +4 -0
- package/lib/entity/company/companyPayload.js +18 -8
- package/lib/entity/company/companyStateTypes.d.ts +4 -0
- package/lib/entity/customerSatisfaction/customerSatisfactionReducer.d.ts +1 -1
- package/lib/entity/customerSatisfaction/customerSatisfactionReducer.js +6 -2
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +9 -0
- package/lib/entity/invoicing/invoicingCommonPayload.js +7 -0
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionClassesViewV2/sectionClassesViewSelector.d.ts +2 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewSelector.js +3 -3
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +2 -1
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +4 -4
- package/lib/entity/snackbar/snackbarApiError.d.ts +8 -0
- package/lib/entity/snackbar/snackbarApiError.js +15 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +31 -0
- package/lib/entity/tenant/tenantReducer.d.ts +5 -1
- package/lib/entity/tenant/tenantReducer.js +21 -2
- package/lib/epic.d.ts +7 -1
- package/lib/epic.js +9 -1
- package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +17 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +23 -1
- package/lib/esm/entity/class/classSelectorV2.js +7 -7
- package/lib/esm/entity/company/companyPayload.js +18 -8
- package/lib/esm/entity/customerSatisfaction/customerSatisfactionReducer.js +4 -1
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +6 -0
- package/lib/esm/entity/sectionClassesViewV2/sectionClassesViewSelector.js +3 -3
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +4 -4
- package/lib/esm/entity/snackbar/snackbarApiError.js +11 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +31 -0
- package/lib/esm/entity/tenant/tenantReducer.js +20 -1
- package/lib/esm/epic.js +9 -1
- package/lib/esm/index.js +19 -12
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewEpic.js +30 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewPayload.js +1 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewReducer.js +132 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewSelector.js +90 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewSelectorTypes.js +1 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewState.js +1 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetForTimeframeClassesViewEpic.js +61 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetForTimeframeProjectViewEpic.js +63 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewEpic.js +30 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewPayload.js +1 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewReducer.js +128 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewSelector.js +90 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewState.js +1 -0
- package/lib/esm/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +4 -1
- package/lib/esm/view/companyView/companyViewReducer.js +58 -1
- package/lib/esm/view/companyView/epic/updateCompanyProductServicesEpic.js +91 -0
- package/lib/esm/view/companyView/epic/updateCompanyQboRealmIdEpic.js +58 -0
- package/lib/esm/view/companyView/selector/companyManagementViewSelector.js +52 -0
- package/lib/esm/view/companyView/types/cockpitTypes.js +13 -1
- package/lib/esm/view/companyView/types/companyManagementViewState.js +2 -0
- package/lib/esm/view/financeStatement/financeStatementSelector.js +21 -1
- package/lib/esm/view/invoicing/createCreditNote/createCreditNoteEpic.js +26 -4
- package/lib/esm/view/invoicing/createInvoice/createInvoiceEpic.js +26 -4
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +37 -10
- package/lib/esm/view/invoicing/discountAction/discountActionEpic.js +37 -10
- package/lib/esm/view/invoicing/dunningAction/dunningActionEpic.js +39 -10
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -1
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +5 -4
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +35 -5
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +25 -3
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +26 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +16 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +34 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +26 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +20 -3
- package/lib/esm/view/invoicing/invoiceAction/invoiceActionEpic.js +65 -18
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +35 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +4 -29
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.js +26 -0
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.js +16 -0
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.js +9 -1
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.js +50 -1
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.js +14 -1
- package/lib/esm/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +31 -10
- package/lib/esm/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +30 -5
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +26 -4
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +22 -14
- package/lib/esm/view/invoicing/recordPayment/recordPaymentEpic.js +49 -7
- package/lib/esm/view/invoicing/settingsView/settingsViewEpics.js +30 -9
- package/lib/esm/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +56 -1
- package/lib/esm/view/invoicing/subscriptionAction/subscriptionActionEpic.js +45 -10
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +7 -2
- package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +1 -1
- package/lib/esm/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +4 -1
- package/lib/esm/view/vendorTabView/vendorTabViewReducer.js +4 -1
- package/lib/index.d.ts +32 -18
- package/lib/index.js +90 -50
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewEpic.d.ts +6 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewEpic.js +34 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewPayload.d.ts +20 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewPayload.js +2 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewReducer.d.ts +34 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewReducer.js +136 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelector.d.ts +7 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelector.js +94 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelectorTypes.d.ts +7 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelectorTypes.js +2 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewState.d.ts +23 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewState.js +2 -0
- package/lib/view/balanceSheetClassesView/balanceSheetForTimeframeClassesViewEpic.d.ts +9 -0
- package/lib/view/balanceSheetClassesView/balanceSheetForTimeframeClassesViewEpic.js +66 -0
- package/lib/view/balanceSheetProjectView/balanceSheetForTimeframeProjectViewEpic.d.ts +10 -0
- package/lib/view/balanceSheetProjectView/balanceSheetForTimeframeProjectViewEpic.js +68 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewEpic.d.ts +6 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewEpic.js +34 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewPayload.d.ts +20 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewPayload.js +2 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewReducer.d.ts +33 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewReducer.js +132 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelector.d.ts +7 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelector.js +94 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelectorTypes.d.ts +18 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelectorTypes.js +2 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewState.d.ts +22 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewState.js +2 -0
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.d.ts +1 -1
- package/lib/view/companyHealthMetricView/companyHealthMetricConfigReducer.js +5 -2
- package/lib/view/companyView/companyViewReducer.d.ts +22 -1
- package/lib/view/companyView/companyViewReducer.js +60 -3
- package/lib/view/companyView/epic/updateCompanyProductServicesEpic.d.ts +10 -0
- package/lib/view/companyView/epic/updateCompanyProductServicesEpic.js +95 -0
- package/lib/view/companyView/epic/updateCompanyQboRealmIdEpic.d.ts +8 -0
- package/lib/view/companyView/epic/updateCompanyQboRealmIdEpic.js +62 -0
- package/lib/view/companyView/selector/companyManagementViewSelector.d.ts +3 -0
- package/lib/view/companyView/selector/companyManagementViewSelector.js +55 -0
- package/lib/view/companyView/types/cockpitTypes.d.ts +7 -3
- package/lib/view/companyView/types/cockpitTypes.js +15 -1
- package/lib/view/companyView/types/companyManagementViewState.d.ts +2 -0
- package/lib/view/companyView/types/companyManagementViewState.js +2 -0
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementSelector.d.ts +4 -0
- package/lib/view/financeStatement/financeStatementSelector.js +21 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.d.ts +2 -1
- package/lib/view/invoicing/createCreditNote/createCreditNoteEpic.js +25 -3
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.d.ts +2 -1
- package/lib/view/invoicing/createInvoice/createInvoiceEpic.js +25 -3
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +22 -8
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +37 -10
- package/lib/view/invoicing/discountAction/discountActionEpic.d.ts +2 -1
- package/lib/view/invoicing/discountAction/discountActionEpic.js +35 -8
- package/lib/view/invoicing/dunningAction/dunningActionEpic.d.ts +2 -1
- package/lib/view/invoicing/dunningAction/dunningActionEpic.js +37 -8
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.d.ts +3 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload.js +5 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewPayload.js +5 -4
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/saveInvoicingCatalogItemEpic.js +34 -4
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCouponDetailView/saveInvoicingCouponEpic.js +24 -2
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/saveInvoicingCustomerEpic.js +25 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.d.ts +4 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +15 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +17 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.d.ts +7 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +37 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/saveInvoicingSubscriptionEpic.js +25 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.d.ts +2 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/syncInvoicingSubscriptionCouponsEpic.js +19 -2
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.d.ts +2 -1
- package/lib/view/invoicing/invoiceAction/invoiceActionEpic.js +63 -16
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +15 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +34 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +11 -31
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +4 -29
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +22 -1
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.d.ts +7 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewEpic.js +30 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.d.ts +6 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/fetchInvoicingDunningEmailPreviewPageEpic.js +20 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewEpics.d.ts +2 -2
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.d.ts +12 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewPayload.js +11 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.d.ts +21 -4
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewReducer.js +51 -2
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.d.ts +3 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.js +16 -2
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewState.d.ts +13 -0
- package/lib/view/invoicing/invoicingQboView/epics/invoicingQboViewActionType.d.ts +2 -1
- package/lib/view/invoicing/invoicingQboView/epics/retryInvoicingQboSyncTaskEpic.js +30 -9
- package/lib/view/invoicing/invoicingQboView/epics/startInvoicingQboBackfillEpic.js +29 -4
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.d.ts +2 -1
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteEpic.js +25 -3
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +24 -7
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +23 -16
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.d.ts +2 -1
- package/lib/view/invoicing/recordPayment/recordPaymentEpic.js +48 -6
- package/lib/view/invoicing/settingsView/settingsViewEpics.d.ts +2 -1
- package/lib/view/invoicing/settingsView/settingsViewEpics.js +28 -7
- package/lib/view/invoicing/settingsView/settingsViewReducer.d.ts +10 -1
- package/lib/view/invoicing/settingsView/settingsViewReducer.js +1 -1
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +44 -2
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +59 -2
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.d.ts +2 -1
- package/lib/view/invoicing/subscriptionAction/subscriptionActionEpic.js +43 -8
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +1 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +7 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/spendManagement/spendManagementFilterHelpers.js +1 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.d.ts +1 -1
- package/lib/view/vendorFiling1099/vendorFiling1099UploadDetails/vendorFiling1099UploadDetailsReducer.js +5 -2
- package/lib/view/vendorTabView/vendorTabViewReducer.d.ts +1 -1
- package/lib/view/vendorTabView/vendorTabViewReducer.js +5 -2
- package/package.json +2 -2
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateInvoicingCreditNotes } from '../../../entity/invoicing/creditNote/creditNoteReducer';
|
|
4
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
5
|
import { RootState } from '../../../reducer';
|
|
5
6
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
7
|
import { fetchInvoiceDetail } from '../invoiceDetail/invoiceDetailReducer';
|
|
7
8
|
import { issueCreditNoteFailure, issueCreditNoteSuccess, submitIssueCreditNote } from './issueCreditNoteReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof submitIssueCreditNote> | ReturnType<typeof issueCreditNoteSuccess> | ReturnType<typeof issueCreditNoteFailure> | ReturnType<typeof updateInvoicingCreditNotes> | ReturnType<typeof fetchInvoiceDetail>;
|
|
9
|
+
export type ActionType = ReturnType<typeof submitIssueCreditNote> | ReturnType<typeof issueCreditNoteSuccess> | ReturnType<typeof issueCreditNoteFailure> | ReturnType<typeof updateInvoicingCreditNotes> | ReturnType<typeof fetchInvoiceDetail> | ReturnType<typeof openSnackbar>;
|
|
9
10
|
export declare const issueCreditNoteEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,6 +4,8 @@ exports.issueCreditNoteEpic = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const creditNoteReducer_1 = require("../../../entity/invoicing/creditNote/creditNoteReducer");
|
|
7
|
+
const snackbarApiError_1 = require("../../../entity/snackbar/snackbarApiError");
|
|
8
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
7
9
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
10
|
const invoiceDetailReducer_1 = require("../invoiceDetail/invoiceDetailReducer");
|
|
9
11
|
const issueCreditNotePayload_1 = require("./issueCreditNotePayload");
|
|
@@ -21,10 +23,30 @@ const issueCreditNoteEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
21
23
|
(0, creditNoteReducer_1.updateInvoicingCreditNotes)([response.data], 'merge'),
|
|
22
24
|
(0, invoiceDetailReducer_1.fetchInvoiceDetail)({ invoiceId }),
|
|
23
25
|
(0, issueCreditNoteReducer_1.issueCreditNoteSuccess)({ creditNoteId: response.data.id }),
|
|
26
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
27
|
+
messageSection: 'invoicing_credit_note_saved',
|
|
28
|
+
messageText: 'success',
|
|
29
|
+
type: 'success',
|
|
30
|
+
}),
|
|
24
31
|
];
|
|
25
32
|
}
|
|
26
|
-
return (0, rxjs_1.
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
return (0, rxjs_1.from)([
|
|
34
|
+
(0, issueCreditNoteReducer_1.issueCreditNoteFailure)(response.status),
|
|
35
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
36
|
+
messageSection: 'invoicing_credit_note_saved',
|
|
37
|
+
messageText: 'failed',
|
|
38
|
+
type: 'error',
|
|
39
|
+
variables: (0, snackbarApiError_1.apiErrorSnackbarVariables)(response.status),
|
|
40
|
+
}),
|
|
41
|
+
]);
|
|
42
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
43
|
+
(0, issueCreditNoteReducer_1.issueCreditNoteFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Issue credit note REST API call errored out ' +
|
|
44
|
+
JSON.stringify(error))),
|
|
45
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
46
|
+
messageSection: 'invoicing_credit_note_saved',
|
|
47
|
+
messageText: 'failed',
|
|
48
|
+
type: 'error',
|
|
49
|
+
}),
|
|
50
|
+
])));
|
|
29
51
|
}));
|
|
30
52
|
exports.issueCreditNoteEpic = issueCreditNoteEpic;
|
|
@@ -1,13 +1,30 @@
|
|
|
1
|
-
import { ID } from '../../../commonStateTypes/common';
|
|
1
|
+
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
+
import { InvoicingInvoice } from '../../../entity/invoicing/invoice/invoiceState';
|
|
3
4
|
import { RootState } from '../../../reducer';
|
|
4
5
|
import { IssueCreditNoteFormLocalData } from './issueCreditNoteState';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Everything the issue-credit-note screen renders, in one view: the invoice being
|
|
8
|
+
* credited, the form draft and the submit run-state. `fetchState`/`error` track
|
|
9
|
+
* the invoice load (what gates the page); the submit action is exposed separately
|
|
10
|
+
* as `submitState` so a save failure can't be mistaken for a load failure.
|
|
11
|
+
*/
|
|
12
|
+
export interface IssueCreditNoteView extends SelectorView {
|
|
13
|
+
/**
|
|
14
|
+
* True once the invoice has loaded and the draft for *this* invoice has line
|
|
15
|
+
* items to credit.
|
|
16
|
+
*/
|
|
17
|
+
isPageReady: boolean;
|
|
10
18
|
localData: IssueCreditNoteFormLocalData;
|
|
11
19
|
reasonCodeValues: string[];
|
|
20
|
+
submitState: FetchStateAndError;
|
|
21
|
+
invoice?: InvoicingInvoice;
|
|
22
|
+
issuedCreditNoteId?: ID;
|
|
12
23
|
}
|
|
13
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The draft is a single global slice, so a draft seeded for a previously opened
|
|
26
|
+
* invoice can still be in state when another invoice's screen mounts. Anything
|
|
27
|
+
* that would render that stale draft next to this invoice is dropped until the
|
|
28
|
+
* screen re-seeds it for `invoiceId`.
|
|
29
|
+
*/
|
|
30
|
+
export declare const getIssueCreditNoteView: (state: RootState, invoiceId: ID) => IssueCreditNoteView;
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getIssueCreditNoteView = void 0;
|
|
4
|
+
const invoiceDetailSelector_1 = require("../invoiceDetail/invoiceDetailSelector");
|
|
4
5
|
const issueCreditNoteFormConfig_1 = require("./issueCreditNoteFormConfig");
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The draft is a single global slice, so a draft seeded for a previously opened
|
|
8
|
+
* invoice can still be in state when another invoice's screen mounts. Anything
|
|
9
|
+
* that would render that stale draft next to this invoice is dropped until the
|
|
10
|
+
* screen re-seeds it for `invoiceId`.
|
|
11
|
+
*/
|
|
12
|
+
const getIssueCreditNoteView = (state, invoiceId) => {
|
|
13
|
+
const invoiceView = (0, invoiceDetailSelector_1.getInvoiceDetail)(state, invoiceId);
|
|
14
|
+
const { draft, error, fetchState, issuedCreditNoteId } = state.invoicingIssueCreditNoteState;
|
|
15
|
+
const isDraftForInvoice = draft.invoiceId === invoiceId;
|
|
7
16
|
return {
|
|
8
|
-
|
|
9
|
-
fetchState
|
|
17
|
+
invoice: invoiceView.invoice,
|
|
18
|
+
isPageReady: invoiceView.fetchState === 'Completed' &&
|
|
19
|
+
isDraftForInvoice &&
|
|
20
|
+
draft.lineItems.length > 0,
|
|
10
21
|
issuedCreditNoteId,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exports.getIssueCreditNoteView = getIssueCreditNoteView;
|
|
15
|
-
const getIssueCreditNoteFormView = (state) => {
|
|
16
|
-
const { draft, error, fetchState } = state.invoicingIssueCreditNoteState;
|
|
17
|
-
return {
|
|
18
|
-
localData: draft,
|
|
22
|
+
localData: isDraftForInvoice
|
|
23
|
+
? draft
|
|
24
|
+
: (0, issueCreditNoteFormConfig_1.initialIssueCreditNoteFormLocalData)(invoiceId),
|
|
19
25
|
reasonCodeValues: [...issueCreditNoteFormConfig_1.INVOICING_CREDIT_NOTE_REASON_CODES],
|
|
20
|
-
error,
|
|
21
|
-
|
|
26
|
+
submitState: { error, fetchState },
|
|
27
|
+
error: invoiceView.error,
|
|
28
|
+
fetchState: invoiceView.fetchState,
|
|
22
29
|
version: 1.0,
|
|
23
30
|
};
|
|
24
31
|
};
|
|
25
|
-
exports.
|
|
32
|
+
exports.getIssueCreditNoteView = getIssueCreditNoteView;
|
|
@@ -2,10 +2,11 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateInvoices } from '../../../entity/invoicing/invoice/invoiceReducer';
|
|
4
4
|
import { updateInvoicingTransactions } from '../../../entity/invoicing/invoicingTransaction/invoicingTransactionReducer';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
6
|
import { RootState } from '../../../reducer';
|
|
6
7
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
7
8
|
import { fetchInvoiceDetail } from '../invoiceDetail/invoiceDetailReducer';
|
|
8
9
|
import { addInvoicingTransactionToList } from '../invoicingTransactionListView/invoicingTransactionListViewReducer';
|
|
9
10
|
import { recordPaymentFailure, recordPaymentSuccess, submitRecordPayment } from './recordPaymentReducer';
|
|
10
|
-
export type ActionType = ReturnType<typeof submitRecordPayment> | ReturnType<typeof recordPaymentSuccess> | ReturnType<typeof recordPaymentFailure> | ReturnType<typeof updateInvoicingTransactions> | ReturnType<typeof addInvoicingTransactionToList> | ReturnType<typeof updateInvoices> | ReturnType<typeof fetchInvoiceDetail>;
|
|
11
|
+
export type ActionType = ReturnType<typeof submitRecordPayment> | ReturnType<typeof recordPaymentSuccess> | ReturnType<typeof recordPaymentFailure> | ReturnType<typeof updateInvoicingTransactions> | ReturnType<typeof addInvoicingTransactionToList> | ReturnType<typeof updateInvoices> | ReturnType<typeof fetchInvoiceDetail> | ReturnType<typeof openSnackbar>;
|
|
11
12
|
export declare const recordPaymentEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -5,6 +5,8 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const invoiceReducer_1 = require("../../../entity/invoicing/invoice/invoiceReducer");
|
|
7
7
|
const invoicingTransactionReducer_1 = require("../../../entity/invoicing/invoicingTransaction/invoicingTransactionReducer");
|
|
8
|
+
const snackbarApiError_1 = require("../../../entity/snackbar/snackbarApiError");
|
|
9
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
8
10
|
const responsePayload_1 = require("../../../responsePayload");
|
|
9
11
|
const invoiceDetailReducer_1 = require("../invoiceDetail/invoiceDetailReducer");
|
|
10
12
|
const invoicingTransactionListViewReducer_1 = require("../invoicingTransactionListView/invoicingTransactionListViewReducer");
|
|
@@ -29,11 +31,31 @@ const recordPaymentEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, opera
|
|
|
29
31
|
(0, invoiceReducer_1.updateInvoices)([response.data], 'merge'),
|
|
30
32
|
(0, invoiceDetailReducer_1.fetchInvoiceDetail)({ invoiceId }),
|
|
31
33
|
(0, recordPaymentReducer_1.recordPaymentSuccess)({ invoiceId }),
|
|
34
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
35
|
+
messageSection: 'invoicing_payment_recorded',
|
|
36
|
+
messageText: 'success',
|
|
37
|
+
type: 'success',
|
|
38
|
+
}),
|
|
32
39
|
];
|
|
33
40
|
}
|
|
34
|
-
return (0, rxjs_1.
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
return (0, rxjs_1.from)([
|
|
42
|
+
(0, recordPaymentReducer_1.recordPaymentFailure)(response.status),
|
|
43
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
44
|
+
messageSection: 'invoicing_payment_recorded',
|
|
45
|
+
messageText: 'failed',
|
|
46
|
+
type: 'error',
|
|
47
|
+
variables: (0, snackbarApiError_1.apiErrorSnackbarVariables)(response.status),
|
|
48
|
+
}),
|
|
49
|
+
]);
|
|
50
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
51
|
+
(0, recordPaymentReducer_1.recordPaymentFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Record payment REST API call errored out ' +
|
|
52
|
+
JSON.stringify(error))),
|
|
53
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
54
|
+
messageSection: 'invoicing_payment_recorded',
|
|
55
|
+
messageText: 'failed',
|
|
56
|
+
type: 'error',
|
|
57
|
+
}),
|
|
58
|
+
])));
|
|
37
59
|
}
|
|
38
60
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/payments`;
|
|
39
61
|
const data = (0, recordPaymentPayload_1.localDataToRecordPaymentPayload)(draft);
|
|
@@ -52,10 +74,30 @@ const recordPaymentEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, opera
|
|
|
52
74
|
if (linkedInvoiceId != null) {
|
|
53
75
|
successActions.push((0, invoiceDetailReducer_1.fetchInvoiceDetail)({ invoiceId: linkedInvoiceId }));
|
|
54
76
|
}
|
|
77
|
+
successActions.push((0, snackbarReducer_1.openSnackbar)({
|
|
78
|
+
messageSection: 'invoicing_payment_recorded',
|
|
79
|
+
messageText: 'success',
|
|
80
|
+
type: 'success',
|
|
81
|
+
}));
|
|
55
82
|
return successActions;
|
|
56
83
|
}
|
|
57
|
-
return (0, rxjs_1.
|
|
58
|
-
|
|
59
|
-
|
|
84
|
+
return (0, rxjs_1.from)([
|
|
85
|
+
(0, recordPaymentReducer_1.recordPaymentFailure)(response.status),
|
|
86
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
87
|
+
messageSection: 'invoicing_payment_recorded',
|
|
88
|
+
messageText: 'failed',
|
|
89
|
+
type: 'error',
|
|
90
|
+
variables: (0, snackbarApiError_1.apiErrorSnackbarVariables)(response.status),
|
|
91
|
+
}),
|
|
92
|
+
]);
|
|
93
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
94
|
+
(0, recordPaymentReducer_1.recordPaymentFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Record payment REST API call errored out ' +
|
|
95
|
+
JSON.stringify(error))),
|
|
96
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
97
|
+
messageSection: 'invoicing_payment_recorded',
|
|
98
|
+
messageText: 'failed',
|
|
99
|
+
type: 'error',
|
|
100
|
+
}),
|
|
101
|
+
])));
|
|
60
102
|
}));
|
|
61
103
|
exports.recordPaymentEpic = recordPaymentEpic;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
4
5
|
import { RootState } from '../../../reducer';
|
|
5
6
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
7
|
import { connectInvoicingStripe, disconnectInvoicingStripe, fetchInvoicingSettings, invoicingStripeConnectionFailure, saveInvoicingSettings, saveInvoicingSettingsFailure, saveInvoicingSettingsSuccess, updateInvoicingSettings, updateInvoicingSettingsFailure, updateInvoicingStripeConnection } from './settingsViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchInvoicingSettings> | ReturnType<typeof updateInvoicingSettings> | ReturnType<typeof updateInvoicingSettingsFailure> | ReturnType<typeof saveInvoicingSettings> | ReturnType<typeof saveInvoicingSettingsSuccess> | ReturnType<typeof saveInvoicingSettingsFailure> | ReturnType<typeof connectInvoicingStripe> | ReturnType<typeof disconnectInvoicingStripe> | ReturnType<typeof updateInvoicingStripeConnection> | ReturnType<typeof invoicingStripeConnectionFailure> | ReturnType<typeof updateAddresses>;
|
|
8
|
+
export type ActionType = ReturnType<typeof fetchInvoicingSettings> | ReturnType<typeof updateInvoicingSettings> | ReturnType<typeof updateInvoicingSettingsFailure> | ReturnType<typeof saveInvoicingSettings> | ReturnType<typeof saveInvoicingSettingsSuccess> | ReturnType<typeof saveInvoicingSettingsFailure> | ReturnType<typeof connectInvoicingStripe> | ReturnType<typeof disconnectInvoicingStripe> | ReturnType<typeof updateInvoicingStripeConnection> | ReturnType<typeof invoicingStripeConnectionFailure> | ReturnType<typeof updateAddresses> | ReturnType<typeof openSnackbar>;
|
|
8
9
|
export declare const fetchInvoicingSettingsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
9
10
|
export declare const connectInvoicingStripeEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
10
11
|
export declare const disconnectInvoicingStripeEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -4,6 +4,8 @@ exports.saveInvoicingSettingsEpic = exports.disconnectInvoicingStripeEpic = expo
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const addressReducer_1 = require("../../../entity/address/addressReducer");
|
|
7
|
+
const snackbarApiError_1 = require("../../../entity/snackbar/snackbarApiError");
|
|
8
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
7
9
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
10
|
const settingsViewReducer_1 = require("./settingsViewReducer");
|
|
9
11
|
const fetchInvoicingSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchInvoicingSettings.match), (0, operators_1.switchMap)(() => {
|
|
@@ -63,16 +65,35 @@ const disconnectInvoicingStripeEpic = (actions$, _state$, zeniAPI) => actions$.p
|
|
|
63
65
|
exports.disconnectInvoicingStripeEpic = disconnectInvoicingStripeEpic;
|
|
64
66
|
const saveInvoicingSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.saveInvoicingSettings.match), (0, operators_1.mergeMap)((action) => {
|
|
65
67
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/settings`;
|
|
68
|
+
const { settings, snackbarSection } = action.payload;
|
|
69
|
+
/** `status` surfaces the platform's error text; omit it to keep the generic copy. */
|
|
70
|
+
const snackbar = (messageText, status) => snackbarSection == null
|
|
71
|
+
? []
|
|
72
|
+
: [
|
|
73
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
74
|
+
messageSection: snackbarSection,
|
|
75
|
+
messageText,
|
|
76
|
+
type: messageText === 'success' ? 'success' : 'error',
|
|
77
|
+
variables: (0, snackbarApiError_1.apiErrorSnackbarVariables)(status),
|
|
78
|
+
}),
|
|
79
|
+
];
|
|
66
80
|
return zeniAPI
|
|
67
|
-
.putAndGetJSON(apiUrl, {
|
|
68
|
-
...action.payload,
|
|
69
|
-
})
|
|
81
|
+
.putAndGetJSON(apiUrl, { ...settings })
|
|
70
82
|
.pipe((0, operators_1.switchMap)((response) => {
|
|
71
83
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
72
|
-
return (0, rxjs_1.
|
|
84
|
+
return (0, rxjs_1.from)([
|
|
85
|
+
(0, settingsViewReducer_1.saveInvoicingSettingsSuccess)(response.data),
|
|
86
|
+
...snackbar('success'),
|
|
87
|
+
]);
|
|
73
88
|
}
|
|
74
|
-
return (0, rxjs_1.
|
|
75
|
-
|
|
76
|
-
|
|
89
|
+
return (0, rxjs_1.from)([
|
|
90
|
+
(0, settingsViewReducer_1.saveInvoicingSettingsFailure)(response.status),
|
|
91
|
+
...snackbar('failed', response.status),
|
|
92
|
+
]);
|
|
93
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
94
|
+
(0, settingsViewReducer_1.saveInvoicingSettingsFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Save settings REST API call errored out ' +
|
|
95
|
+
JSON.stringify(error))),
|
|
96
|
+
...snackbar('failed'),
|
|
97
|
+
])));
|
|
77
98
|
}));
|
|
78
99
|
exports.saveInvoicingSettingsEpic = saveInvoicingSettingsEpic;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
2
|
+
import { SnackbarMessageSections } from '../../../entity/snackbar/snackbarTypes';
|
|
2
3
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
4
|
import { InvoicingBrandingFormLocalData } from './invoicingBrandingFormConfig';
|
|
4
5
|
import { StripeConnectCredentials } from './settingsViewPayload';
|
|
@@ -7,8 +8,16 @@ export interface InvoicingStripeConnectionUpdate {
|
|
|
7
8
|
stripe_connected: boolean;
|
|
8
9
|
publishable_key?: string;
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* `settings` is the request body; `snackbarSection` only picks which snackbar the
|
|
13
|
+
* epic raises, so it is deliberately kept out of the payload sent to the API.
|
|
14
|
+
*/
|
|
15
|
+
export interface SaveInvoicingSettingsPayload {
|
|
16
|
+
settings: Partial<InvoicingSettingsPayload>;
|
|
17
|
+
snackbarSection?: SnackbarMessageSections;
|
|
18
|
+
}
|
|
10
19
|
export declare const initialState: InvoicingSettingsViewState;
|
|
11
|
-
export declare const fetchInvoicingSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSettingsView/fetchInvoicingSettings">, updateInvoicingSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingSettingsPayload, "invoicingSettingsView/updateInvoicingSettings">, updateInvoicingSettingsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSettingsView/updateInvoicingSettingsFailure">, saveInvoicingSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<
|
|
20
|
+
export declare const fetchInvoicingSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSettingsView/fetchInvoicingSettings">, updateInvoicingSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingSettingsPayload, "invoicingSettingsView/updateInvoicingSettings">, updateInvoicingSettingsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSettingsView/updateInvoicingSettingsFailure">, saveInvoicingSettings: import("@reduxjs/toolkit").ActionCreatorWithPayload<SaveInvoicingSettingsPayload, "invoicingSettingsView/saveInvoicingSettings">, saveInvoicingSettingsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingSettingsPayload, "invoicingSettingsView/saveInvoicingSettingsSuccess">, saveInvoicingSettingsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSettingsView/saveInvoicingSettingsFailure">, resetSaveInvoicingSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSettingsView/resetSaveInvoicingSettings">, updateInvoicingBrandingFormDraft: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
12
21
|
localData: InvoicingBrandingFormLocalData;
|
|
13
22
|
}, "invoicingSettingsView/updateInvoicingBrandingFormDraft">, submitInvoicingBrandingForm: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSettingsView/submitInvoicingBrandingForm">, resetInvoicingBrandingFormDraft: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSettingsView/resetInvoicingBrandingFormDraft">, connectInvoicingStripe: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[credentials: StripeConnectCredentials], StripeConnectCredentials, "invoicingSettingsView/connectInvoicingStripe", never, never>, disconnectInvoicingStripe: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSettingsView/disconnectInvoicingStripe">, updateInvoicingStripeConnection: import("@reduxjs/toolkit").ActionCreatorWithPayload<InvoicingStripeConnectionUpdate, "invoicingSettingsView/updateInvoicingStripeConnection">, invoicingStripeConnectionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "invoicingSettingsView/invoicingStripeConnectionFailure">, clearInvoicingSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"invoicingSettingsView/clearInvoicingSettings">;
|
|
14
23
|
declare const _default: import("redux").Reducer<InvoicingSettingsViewState>;
|
|
@@ -34,7 +34,7 @@ const settingsView = (0, toolkit_1.createSlice)({
|
|
|
34
34
|
saveInvoicingSettings(draft, action) {
|
|
35
35
|
draft.saveFetchState = { fetchState: 'In-Progress', error: undefined };
|
|
36
36
|
if (draft.settings != null) {
|
|
37
|
-
draft.settings = { ...draft.settings, ...action.payload };
|
|
37
|
+
draft.settings = { ...draft.settings, ...action.payload.settings };
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
saveInvoicingSettingsSuccess(draft, action) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
|
-
import { InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
2
|
+
import { InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
3
|
import { RootState } from '../../../reducer';
|
|
4
4
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
5
|
+
import { InvoicingOnboardingStatus } from '../invoicingConfigView/invoicingConfigViewPayload';
|
|
5
6
|
import { InvoicingBrandingFormLocalData } from './invoicingBrandingFormConfig';
|
|
6
7
|
/**
|
|
7
8
|
* Shared primitive: the raw invoicing settings. Consumed internally by other
|
|
@@ -27,7 +28,47 @@ export interface InvoicingSettingsView {
|
|
|
27
28
|
* Stripe-connect fetch state.
|
|
28
29
|
*/
|
|
29
30
|
export declare const getInvoicingSettingsView: (state: RootState) => InvoicingSettingsView;
|
|
31
|
+
export interface InvoicingEnablePrerequisites {
|
|
32
|
+
canEnable: boolean;
|
|
33
|
+
isQboConfigured: boolean;
|
|
34
|
+
isStripeConnected: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Gates the Enable Invoicing action: payments must be able to land (Stripe
|
|
38
|
+
* connected *and* accepting charges) and the QBO accounting step must be
|
|
39
|
+
* finished, so an enabled tenant can always book what it invoices.
|
|
40
|
+
*
|
|
41
|
+
* Deliberately not part of `deriveInvoicingOnboardingStatus`, which routes the
|
|
42
|
+
* module off the config flags alone. Folding these in there would (a) demote a
|
|
43
|
+
* live tenant to the settings tree the moment an integration broke, stranding
|
|
44
|
+
* its existing invoices, and (b) deadlock the route gate, which fetches only the
|
|
45
|
+
* config — never the settings or QBO connection these read.
|
|
46
|
+
*/
|
|
47
|
+
export declare function deriveInvoicingEnablePrerequisites(settings: InvoicingSettingsPayload | undefined, isQboConnected: boolean, qboAccountMappingKindOptions: InvoicingQboAccountMappingKindOption[]): InvoicingEnablePrerequisites;
|
|
48
|
+
export interface InvoicingSettingsHubView {
|
|
49
|
+
canEnableInvoicing: boolean;
|
|
50
|
+
isEnablingInvoicing: boolean;
|
|
51
|
+
isQboConfigured: boolean;
|
|
52
|
+
isStripeConnected: boolean;
|
|
53
|
+
status?: InvoicingOnboardingStatus;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The settings hub's composite of everything it derives from the store: whether
|
|
57
|
+
* to offer Enable Invoicing at all, the in-flight flag for that action, and the
|
|
58
|
+
* two integration prerequisites kept separate so the hub can name the step still
|
|
59
|
+
* outstanding instead of showing a dead button.
|
|
60
|
+
*
|
|
61
|
+
* `canEnableInvoicing` folds in the onboarding step, so the screen does not need
|
|
62
|
+
* to re-check it: the footer is only offered mid-onboarding and only once both
|
|
63
|
+
* integrations are ready.
|
|
64
|
+
*
|
|
65
|
+
* Deliberately not folded into `getInvoicingConfigView`: that selector gates
|
|
66
|
+
* every invoicing route and stays a pure read of the config slice. The settings
|
|
67
|
+
* and QBO slices read here are only fetched once a settings screen is mounted.
|
|
68
|
+
*/
|
|
69
|
+
export declare const getInvoicingSettingsHubView: (state: RootState) => InvoicingSettingsHubView;
|
|
30
70
|
export interface InvoicingBrandingFormView {
|
|
71
|
+
dateFormatOptions: InvoicingNamedOption[];
|
|
31
72
|
localData: InvoicingBrandingFormLocalData;
|
|
32
73
|
saveState: FetchStateAndError;
|
|
33
74
|
addressLabel?: string;
|
|
@@ -37,6 +78,7 @@ export interface InvoicingBrandingFormView {
|
|
|
37
78
|
* Bundled view for the branding settings form: the draft `localData` (seeded
|
|
38
79
|
* from the existing settings until the user edits), the business-address label
|
|
39
80
|
* (from the shared Address screen, seeded on load from `address_id`), the raw
|
|
40
|
-
* settings (for the logo/preview)
|
|
81
|
+
* settings (for the logo/preview), the backend date-format choices and the
|
|
82
|
+
* save fetch state.
|
|
41
83
|
*/
|
|
42
84
|
export declare const getInvoicingBrandingFormView: (state: RootState) => InvoicingBrandingFormView;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInvoicingBrandingFormView = exports.getInvoicingSettingsView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = void 0;
|
|
3
|
+
exports.getInvoicingBrandingFormView = exports.getInvoicingSettingsHubView = exports.getInvoicingSettingsView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = void 0;
|
|
4
|
+
exports.deriveInvoicingEnablePrerequisites = deriveInvoicingEnablePrerequisites;
|
|
5
|
+
const invoicingCommonPayload_1 = require("../../../entity/invoicing/invoicingCommonPayload");
|
|
4
6
|
const addressViewSelector_1 = require("../../addressView/addressViewSelector");
|
|
7
|
+
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
5
8
|
const invoicingBrandingFormConfig_1 = require("./invoicingBrandingFormConfig");
|
|
6
9
|
/**
|
|
7
10
|
* Shared primitive: the raw invoicing settings. Consumed internally by other
|
|
@@ -35,11 +38,64 @@ const getInvoicingSettingsView = (state) => {
|
|
|
35
38
|
};
|
|
36
39
|
};
|
|
37
40
|
exports.getInvoicingSettingsView = getInvoicingSettingsView;
|
|
41
|
+
/**
|
|
42
|
+
* Gates the Enable Invoicing action: payments must be able to land (Stripe
|
|
43
|
+
* connected *and* accepting charges) and the QBO accounting step must be
|
|
44
|
+
* finished, so an enabled tenant can always book what it invoices.
|
|
45
|
+
*
|
|
46
|
+
* Deliberately not part of `deriveInvoicingOnboardingStatus`, which routes the
|
|
47
|
+
* module off the config flags alone. Folding these in there would (a) demote a
|
|
48
|
+
* live tenant to the settings tree the moment an integration broke, stranding
|
|
49
|
+
* its existing invoices, and (b) deadlock the route gate, which fetches only the
|
|
50
|
+
* config — never the settings or QBO connection these read.
|
|
51
|
+
*/
|
|
52
|
+
function deriveInvoicingEnablePrerequisites(settings, isQboConnected, qboAccountMappingKindOptions) {
|
|
53
|
+
const isStripeConnected = settings?.stripe_connected === true &&
|
|
54
|
+
settings?.stripe_account?.charges_enabled === true;
|
|
55
|
+
const accountMappings = settings?.qbo?.account_mappings ?? undefined;
|
|
56
|
+
// An empty option list means the config has not landed yet — treating that as
|
|
57
|
+
// configured would let `every` pass vacuously and unlock the button early.
|
|
58
|
+
const isQboConfigured = isQboConnected &&
|
|
59
|
+
qboAccountMappingKindOptions.length > 0 &&
|
|
60
|
+
qboAccountMappingKindOptions.every((option) => (0, invoicingCommonPayload_1.getInvoicingQboAccountMappingId)(accountMappings, option.code) != null);
|
|
61
|
+
return {
|
|
62
|
+
canEnable: isStripeConnected && isQboConfigured,
|
|
63
|
+
isQboConfigured,
|
|
64
|
+
isStripeConnected,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The settings hub's composite of everything it derives from the store: whether
|
|
69
|
+
* to offer Enable Invoicing at all, the in-flight flag for that action, and the
|
|
70
|
+
* two integration prerequisites kept separate so the hub can name the step still
|
|
71
|
+
* outstanding instead of showing a dead button.
|
|
72
|
+
*
|
|
73
|
+
* `canEnableInvoicing` folds in the onboarding step, so the screen does not need
|
|
74
|
+
* to re-check it: the footer is only offered mid-onboarding and only once both
|
|
75
|
+
* integrations are ready.
|
|
76
|
+
*
|
|
77
|
+
* Deliberately not folded into `getInvoicingConfigView`: that selector gates
|
|
78
|
+
* every invoicing route and stays a pure read of the config slice. The settings
|
|
79
|
+
* and QBO slices read here are only fetched once a settings screen is mounted.
|
|
80
|
+
*/
|
|
81
|
+
const getInvoicingSettingsHubView = (state) => {
|
|
82
|
+
const { enableState, qboAccountMappingKindOptions, status } = (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state);
|
|
83
|
+
const { canEnable, isQboConfigured, isStripeConnected } = deriveInvoicingEnablePrerequisites(state.invoicingSettingsViewState.settings, state.invoicingQboViewState.connection?.connected === true, qboAccountMappingKindOptions);
|
|
84
|
+
return {
|
|
85
|
+
canEnableInvoicing: status === 'settings' && canEnable,
|
|
86
|
+
isEnablingInvoicing: enableState.fetchState === 'In-Progress',
|
|
87
|
+
isQboConfigured,
|
|
88
|
+
isStripeConnected,
|
|
89
|
+
status,
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
exports.getInvoicingSettingsHubView = getInvoicingSettingsHubView;
|
|
38
93
|
/**
|
|
39
94
|
* Bundled view for the branding settings form: the draft `localData` (seeded
|
|
40
95
|
* from the existing settings until the user edits), the business-address label
|
|
41
96
|
* (from the shared Address screen, seeded on load from `address_id`), the raw
|
|
42
|
-
* settings (for the logo/preview)
|
|
97
|
+
* settings (for the logo/preview), the backend date-format choices and the
|
|
98
|
+
* save fetch state.
|
|
43
99
|
*/
|
|
44
100
|
const getInvoicingBrandingFormView = (state) => {
|
|
45
101
|
const { brandingDraft, saveFetchState, settings } = state.invoicingSettingsViewState;
|
|
@@ -49,6 +105,7 @@ const getInvoicingBrandingFormView = (state) => {
|
|
|
49
105
|
: undefined;
|
|
50
106
|
return {
|
|
51
107
|
addressLabel,
|
|
108
|
+
dateFormatOptions: (0, invoicingConfigViewSelector_1.getInvoicingConfigView)(state).dateFormatOptions,
|
|
52
109
|
localData: brandingDraft ?? (0, invoicingBrandingFormConfig_1.entityToInvoicingBrandingFormLocalData)(settings),
|
|
53
110
|
saveState: saveFetchState,
|
|
54
111
|
settings,
|
|
@@ -2,8 +2,9 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
4
|
import { updateInvoicingSubscriptions } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
5
6
|
import { RootState } from '../../../reducer';
|
|
6
7
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
7
8
|
import { runInvoicingSubscriptionAction, runInvoicingSubscriptionActionFailure, runInvoicingSubscriptionActionSuccess } from './subscriptionActionReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof runInvoicingSubscriptionAction> | ReturnType<typeof runInvoicingSubscriptionActionSuccess> | ReturnType<typeof runInvoicingSubscriptionActionFailure> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoicingSubscriptions>;
|
|
9
|
+
export type ActionType = ReturnType<typeof runInvoicingSubscriptionAction> | ReturnType<typeof runInvoicingSubscriptionActionSuccess> | ReturnType<typeof runInvoicingSubscriptionActionFailure> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateInvoicingSubscriptions> | ReturnType<typeof openSnackbar>;
|
|
9
10
|
export declare const runInvoicingSubscriptionActionEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -6,11 +6,39 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const addressReducer_1 = require("../../../entity/address/addressReducer");
|
|
7
7
|
const invoicingSubscriptionPayload_1 = require("../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionPayload");
|
|
8
8
|
const invoicingSubscriptionReducer_1 = require("../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionReducer");
|
|
9
|
+
const snackbarApiError_1 = require("../../../entity/snackbar/snackbarApiError");
|
|
10
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
9
11
|
const responsePayload_1 = require("../../../responsePayload");
|
|
10
12
|
const subscriptionActionReducer_1 = require("./subscriptionActionReducer");
|
|
13
|
+
/**
|
|
14
|
+
* Each lifecycle action reports with its own copy. Keyed loosely because the
|
|
15
|
+
* action payload carries a plain `string`; an unmapped kind stays silent.
|
|
16
|
+
*/
|
|
17
|
+
const SNACKBAR_SECTION_BY_ACTION = {
|
|
18
|
+
activate: 'invoicing_subscription_activated',
|
|
19
|
+
cancel: 'invoicing_subscription_cancelled',
|
|
20
|
+
change_term_end: 'invoicing_subscription_term_end_changed',
|
|
21
|
+
pause: 'invoicing_subscription_paused',
|
|
22
|
+
reactivate: 'invoicing_subscription_reactivated',
|
|
23
|
+
remove_scheduled_cancellation: 'invoicing_subscription_cancellation_removed',
|
|
24
|
+
resume: 'invoicing_subscription_resumed',
|
|
25
|
+
set_non_renewing: 'invoicing_subscription_non_renewing',
|
|
26
|
+
};
|
|
11
27
|
const runInvoicingSubscriptionActionEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(subscriptionActionReducer_1.runInvoicingSubscriptionAction.match), (0, operators_1.mergeMap)((action) => {
|
|
12
28
|
const { action: kind, body, id } = action.payload;
|
|
13
29
|
const requestBody = { action: kind, ...(body ?? {}) };
|
|
30
|
+
const snackbarSection = SNACKBAR_SECTION_BY_ACTION[kind];
|
|
31
|
+
/** `status` surfaces the platform's error text; omit it to keep the generic copy. */
|
|
32
|
+
const snackbar = (messageText, status) => snackbarSection == null
|
|
33
|
+
? []
|
|
34
|
+
: [
|
|
35
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
36
|
+
messageSection: snackbarSection,
|
|
37
|
+
messageText,
|
|
38
|
+
type: messageText === 'success' ? 'success' : 'error',
|
|
39
|
+
variables: (0, snackbarApiError_1.apiErrorSnackbarVariables)(status),
|
|
40
|
+
}),
|
|
41
|
+
];
|
|
14
42
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/subscriptions/${encodeURIComponent(id)}/actions`;
|
|
15
43
|
return zeniAPI
|
|
16
44
|
.postAndGetJSON(apiUrl, requestBody)
|
|
@@ -20,16 +48,23 @@ const runInvoicingSubscriptionActionEpic = (actions$, _state$, zeniAPI) => actio
|
|
|
20
48
|
(0, invoicingSubscriptionReducer_1.updateInvoicingSubscriptions)([response.data], 'merge'),
|
|
21
49
|
(0, addressReducer_1.updateAddresses)((0, invoicingSubscriptionPayload_1.extractInvoicingSubscriptionAddresses)([response.data])),
|
|
22
50
|
(0, subscriptionActionReducer_1.runInvoicingSubscriptionActionSuccess)({ id }),
|
|
51
|
+
...snackbar('success'),
|
|
23
52
|
];
|
|
24
53
|
}
|
|
25
|
-
return (0, rxjs_1.
|
|
26
|
-
|
|
54
|
+
return (0, rxjs_1.from)([
|
|
55
|
+
(0, subscriptionActionReducer_1.runInvoicingSubscriptionActionFailure)({
|
|
56
|
+
error: response.status,
|
|
57
|
+
id,
|
|
58
|
+
}),
|
|
59
|
+
...snackbar('failed', response.status),
|
|
60
|
+
]);
|
|
61
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
62
|
+
(0, subscriptionActionReducer_1.runInvoicingSubscriptionActionFailure)({
|
|
63
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Subscription action REST API call errored out ' +
|
|
64
|
+
JSON.stringify(error)),
|
|
27
65
|
id,
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
JSON.stringify(error)),
|
|
32
|
-
id,
|
|
33
|
-
}))));
|
|
66
|
+
}),
|
|
67
|
+
...snackbar('failed'),
|
|
68
|
+
])));
|
|
34
69
|
}));
|
|
35
70
|
exports.runInvoicingSubscriptionActionEpic = runInvoicingSubscriptionActionEpic;
|
|
@@ -81,13 +81,18 @@ const profitAndLossProjectView = (0, toolkit_1.createSlice)({
|
|
|
81
81
|
draft.uiState.projectsToFilterOut = action.payload.projectsToFilterOut;
|
|
82
82
|
},
|
|
83
83
|
updateProfitAndLossProjectViewUIState(draft, action) {
|
|
84
|
-
const { nodeCollapseState, scrollPosition } = action.payload;
|
|
84
|
+
const { nodeCollapseState, scrollPosition, resetLeftScroll } = action.payload;
|
|
85
85
|
if (nodeCollapseState != null) {
|
|
86
86
|
draft.uiState.nodeCollapseState = Object.assign({}, draft.uiState.nodeCollapseState, {
|
|
87
87
|
[nodeCollapseState.nodeId]: nodeCollapseState.isCollapsed,
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
// Mutually exclusive: resetLeftScroll clears only scrollLeft from the
|
|
91
|
+
// recorded position, scrollPosition replaces the whole record.
|
|
92
|
+
if (resetLeftScroll === true && draft.uiState.scrollPosition != null) {
|
|
93
|
+
draft.uiState.scrollPosition.scrollLeft = undefined;
|
|
94
|
+
}
|
|
95
|
+
else if (scrollPosition != null) {
|
|
91
96
|
draft.uiState.scrollPosition = scrollPosition;
|
|
92
97
|
}
|
|
93
98
|
},
|