@zeniai/client-epic-state 5.2.40 → 5.2.41-beta2MM
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/entity/actualMatching/actualMatchingPayload.d.ts +31 -0
- package/lib/entity/actualMatching/actualMatchingPayload.js +52 -0
- package/lib/entity/actualMatching/actualMatchingReducer.d.ts +11 -0
- package/lib/entity/actualMatching/actualMatchingReducer.js +42 -0
- package/lib/entity/actualMatching/actualMatchingSelector.d.ts +3 -0
- package/lib/entity/actualMatching/actualMatchingSelector.js +6 -0
- package/lib/entity/actualMatching/actualMatchingState.d.ts +23 -0
- package/lib/entity/actualMatching/actualMatchingState.js +2 -0
- package/lib/entity/actualMatching/actualMatchingTypes.d.ts +1 -0
- package/lib/entity/actualMatching/actualMatchingTypes.js +2 -0
- package/lib/entity/file/fileReducer.d.ts +8 -0
- package/lib/entity/file/fileReducer.js +10 -2
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +14 -1
- package/lib/entity/jeSchedules/jeSchedulesPayload.d.ts +31 -0
- package/lib/entity/jeSchedules/jeSchedulesPayload.js +53 -0
- package/lib/entity/jeSchedules/jeSchedulesState.d.ts +33 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/epic.d.ts +9 -1
- package/lib/epic.js +16 -0
- package/lib/esm/entity/actualMatching/actualMatchingPayload.js +48 -0
- package/lib/esm/entity/actualMatching/actualMatchingReducer.js +38 -0
- package/lib/esm/entity/actualMatching/actualMatchingSelector.js +3 -0
- package/lib/esm/entity/actualMatching/actualMatchingState.js +1 -0
- package/lib/esm/entity/actualMatching/actualMatchingTypes.js +1 -0
- package/lib/esm/entity/file/fileReducer.js +10 -2
- package/lib/esm/entity/jeSchedules/jeSchedulesPayload.js +53 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/esm/epic.js +16 -0
- package/lib/esm/index.js +7 -3
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +25 -12
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.js +46 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +36 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingPageEpic.js +7 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +49 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +108 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/refreshActualMatchingList.js +16 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchAccrualsEpic.js +60 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +74 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.js +78 -0
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +40 -15
- package/lib/esm/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +19 -8
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewSelector.js +24 -6
- package/lib/esm/view/expenseAutomationView/expenseAutomationViewState.js +4 -2
- package/lib/esm/view/expenseAutomationView/payload/actualMatchingPayload.js +68 -0
- package/lib/esm/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +497 -0
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
- package/lib/esm/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +432 -0
- package/lib/esm/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -0
- package/lib/esm/view/expenseAutomationView/types/actualMatchingViewState.js +47 -0
- package/lib/esm/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -1
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +1 -1
- package/lib/esm/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +6 -0
- package/lib/esm/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +7 -0
- package/lib/esm/view/invoicing/settingsView/invoicingBrandingFormConfig.js +1 -1
- package/lib/esm/view/invoicing/settingsView/settingsViewSelector.js +5 -0
- package/lib/esm/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +9 -0
- package/lib/index.d.ts +14 -5
- package/lib/index.js +87 -48
- package/lib/reducer.d.ts +2 -0
- package/lib/reducer.js +6 -0
- package/lib/rootStateTypes.d.ts +4 -0
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +25 -12
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingEpic.js +50 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.d.ts +12 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingMatchEpic.js +40 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingPageEpic.d.ts +5 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/fetchActualMatchingPageEpic.js +11 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.d.ts +10 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/ignoreActualMatchingSuggestionEpic.js +53 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/matchAndReverseAccrualsEpic.js +112 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/refreshActualMatchingList.d.ts +3 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/refreshActualMatchingList.js +19 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchAccrualsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchAccrualsEpic.js +64 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/searchMatchTransactionsEpic.js +78 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/actualMatching/undoReversalAccrualsEpic.js +82 -0
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.d.ts +2 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/fetchJeSchedulePageEpic.js +13 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.d.ts +5 -1
- package/lib/view/expenseAutomationView/epics/jeSchedule/prefetchOtherJeSchedulesTabEpic.js +39 -14
- package/lib/view/expenseAutomationView/epics/jeSchedule/switchJESchedulesTabEpic.js +18 -7
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +24 -6
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewState.js +6 -3
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.d.ts +91 -0
- package/lib/view/expenseAutomationView/payload/actualMatchingPayload.js +74 -0
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.d.ts +88 -0
- package/lib/view/expenseAutomationView/reducers/actualMatchingViewReducer.js +501 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +6 -5
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +2 -1
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.d.ts +88 -0
- package/lib/view/expenseAutomationView/selectorTypes/actualMatchingViewSelectorTypes.js +2 -0
- package/lib/view/expenseAutomationView/selectorTypes/expenseAutomationViewSelectorTypes.d.ts +11 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.d.ts +40 -0
- package/lib/view/expenseAutomationView/selectors/actualMatchingViewSelector.js +452 -0
- package/lib/view/expenseAutomationView/selectors/jeSchedulesViewSelector.js +4 -0
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.d.ts +116 -0
- package/lib/view/expenseAutomationView/types/actualMatchingViewState.js +56 -0
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/jeSchedulesViewState.js +8 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +1 -1
- package/lib/view/invoicing/settingsView/epics/fetchInvoicingSettingsEpic.js +6 -0
- package/lib/view/invoicing/settingsView/epics/saveInvoicingSettingsEpic.js +7 -0
- package/lib/view/invoicing/settingsView/epics/settingsViewActionType.d.ts +2 -1
- package/lib/view/invoicing/settingsView/invoicingBrandingFormConfig.js +1 -1
- package/lib/view/invoicing/settingsView/settingsViewSelector.d.ts +8 -0
- package/lib/view/invoicing/settingsView/settingsViewSelector.js +5 -0
- package/lib/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.d.ts +2 -1
- package/lib/view/invoicing/settingsView/submitInvoicingBrandingFormEpic.js +9 -0
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import { ZeniDate } from '../../../zeniDayJS';
|
|
|
12
12
|
import { JETransactionLink } from '../../scheduleView/scheduleDetailView/scheduleDetailState';
|
|
13
13
|
export declare const toJEScheduleSortKey: (v: string) => "type" | "vendor" | "category" | "class" | "memo" | "jePostingDate" | "runningBalance" | "depCategory" | "scheduleCategory" | "startMonth" | "amortizationPeriod" | "remainingMonths" | "totalAmount" | "transactionDate";
|
|
14
14
|
export type JEScheduleSortKey = ReturnType<typeof toJEScheduleSortKey>;
|
|
15
|
-
export declare const toJEPageTab: (v: string) => "schedules" | "existing_schedules";
|
|
15
|
+
export declare const toJEPageTab: (v: string) => "schedules" | "actual_matching" | "existing_schedules";
|
|
16
16
|
export type JEPageTab = ReturnType<typeof toJEPageTab>;
|
|
17
17
|
export declare const ALL_JE_PAGE_TABS: readonly JEPageTab[];
|
|
18
18
|
export type JESchedulePeriodTabKey = `${JEPageTab}_${MonthYearPeriodId}`;
|
|
@@ -20,7 +20,14 @@ const JE_SCHEDULE_SORT_KEYS = [
|
|
|
20
20
|
];
|
|
21
21
|
const toJEScheduleSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_SCHEDULE_SORT_KEYS);
|
|
22
22
|
exports.toJEScheduleSortKey = toJEScheduleSortKey;
|
|
23
|
-
|
|
23
|
+
// `actual_matching` is chrome only: the JE tab bar includes it, but AM data is
|
|
24
|
+
// `expenseAutomationActualMatchingViewState`, not the schedules period-tab
|
|
25
|
+
// cache below. Walks of ALL_JE_PAGE_TABS that read schedule keys must skip it.
|
|
26
|
+
const JE_PAGE_TABS = [
|
|
27
|
+
'schedules',
|
|
28
|
+
'actual_matching',
|
|
29
|
+
'existing_schedules',
|
|
30
|
+
];
|
|
24
31
|
const toJEPageTab = (v) => (0, stringToUnion_1.stringToUnion)(v, JE_PAGE_TABS);
|
|
25
32
|
exports.toJEPageTab = toJEPageTab;
|
|
26
33
|
exports.ALL_JE_PAGE_TABS = JE_PAGE_TABS;
|
|
@@ -39,7 +39,7 @@ const getInvoicingCustomerRecord = (state, invoicingCustomerID) => {
|
|
|
39
39
|
brandingAccentColor: settings?.accent_color,
|
|
40
40
|
brandingCompanyName: settings?.company_name,
|
|
41
41
|
brandingEmail: settings?.email,
|
|
42
|
-
brandingLogoUrl: settings?.
|
|
42
|
+
brandingLogoUrl: settings?.logo_file?.signed_url,
|
|
43
43
|
stripeConnected: (0, invoicingSettingsHelpers_1.isStripeConnectedFromSettings)(settings),
|
|
44
44
|
fetchState: invoicingCustomerDetail?.fetchState ?? 'Not-Started',
|
|
45
45
|
error: invoicingCustomerDetail?.error,
|
|
@@ -4,6 +4,7 @@ exports.fetchInvoicingSettingsEpic = void 0;
|
|
|
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 fileReducer_1 = require("../../../../entity/file/fileReducer");
|
|
7
8
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
9
|
const settingsViewReducer_1 = require("../settingsViewReducer");
|
|
9
10
|
const fetchInvoicingSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchInvoicingSettings.match), (0, operators_1.switchMap)(() => {
|
|
@@ -11,8 +12,13 @@ const fetchInvoicingSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe
|
|
|
11
12
|
return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.switchMap)((response) => {
|
|
12
13
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
13
14
|
const address = response.data.address;
|
|
15
|
+
// The logo record goes to the file entity, like the address goes to
|
|
16
|
+
// the address entity: the settings view keeps only its id and reads
|
|
17
|
+
// the file back through the file selector, so one copy is canonical.
|
|
18
|
+
const logoFile = response.data.logo_file;
|
|
14
19
|
return [
|
|
15
20
|
...(address != null ? [(0, addressReducer_1.updateAddresses)([address])] : []),
|
|
21
|
+
...(logoFile != null ? [(0, fileReducer_1.updateFiles)({ files: [logoFile] })] : []),
|
|
16
22
|
(0, settingsViewReducer_1.updateInvoicingSettings)(response.data),
|
|
17
23
|
];
|
|
18
24
|
}
|
|
@@ -7,6 +7,7 @@ const snackbarApiError_1 = require("../../../../entity/snackbar/snackbarApiError
|
|
|
7
7
|
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
8
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
9
|
const settingsViewReducer_1 = require("../settingsViewReducer");
|
|
10
|
+
const fileReducer_1 = require("../../../../entity/file/fileReducer");
|
|
10
11
|
const saveInvoicingSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.saveInvoicingSettings.match), (0, operators_1.mergeMap)((action) => {
|
|
11
12
|
const apiUrl = `${zeniAPI.apiEndPoints.invoicingMicroServiceBaseUrl}/1.0/settings`;
|
|
12
13
|
const { settings, snackbarSection } = action.payload;
|
|
@@ -25,7 +26,13 @@ const saveInvoicingSettingsEpic = (actions$, _state$, zeniAPI) => actions$.pipe(
|
|
|
25
26
|
.putAndGetJSON(apiUrl, { ...settings })
|
|
26
27
|
.pipe((0, operators_1.switchMap)((response) => {
|
|
27
28
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
29
|
+
// Keep the file entity in step with what was persisted — the
|
|
30
|
+
// settings view resolves the logo by id, not from the response.
|
|
31
|
+
const savedLogoFile = response.data.logo_file;
|
|
28
32
|
return (0, rxjs_1.from)([
|
|
33
|
+
...(savedLogoFile != null
|
|
34
|
+
? [(0, fileReducer_1.updateFiles)({ files: [savedLogoFile] })]
|
|
35
|
+
: []),
|
|
29
36
|
(0, settingsViewReducer_1.saveInvoicingSettingsSuccess)(response.data),
|
|
30
37
|
...snackbar('success'),
|
|
31
38
|
]);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { updateAddresses } from '../../../../entity/address/addressReducer';
|
|
2
|
+
import { updateFiles } from '../../../../entity/file/fileReducer';
|
|
2
3
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
3
4
|
import { connectInvoicingStripe, disconnectInvoicingStripe, fetchInvoicingSettings, invoicingStripeConnectionFailure, saveInvoicingSettings, saveInvoicingSettingsFailure, saveInvoicingSettingsSuccess, submitInvoicingQboSettings, updateInvoicingSettings, updateInvoicingSettingsFailure, updateInvoicingStripeConnection } from '../settingsViewReducer';
|
|
4
5
|
/** Every action the settings epics accept or emit. */
|
|
5
|
-
export type InvoicingSettingsViewActionType = ReturnType<typeof fetchInvoicingSettings> | ReturnType<typeof updateInvoicingSettings> | ReturnType<typeof updateInvoicingSettingsFailure> | ReturnType<typeof saveInvoicingSettings> | ReturnType<typeof saveInvoicingSettingsSuccess> | ReturnType<typeof submitInvoicingQboSettings> | ReturnType<typeof saveInvoicingSettingsFailure> | ReturnType<typeof connectInvoicingStripe> | ReturnType<typeof disconnectInvoicingStripe> | ReturnType<typeof updateInvoicingStripeConnection> | ReturnType<typeof invoicingStripeConnectionFailure> | ReturnType<typeof updateAddresses> | ReturnType<typeof openSnackbar>;
|
|
6
|
+
export type InvoicingSettingsViewActionType = ReturnType<typeof fetchInvoicingSettings> | ReturnType<typeof updateInvoicingSettings> | ReturnType<typeof updateInvoicingSettingsFailure> | ReturnType<typeof saveInvoicingSettings> | ReturnType<typeof saveInvoicingSettingsSuccess> | ReturnType<typeof submitInvoicingQboSettings> | ReturnType<typeof saveInvoicingSettingsFailure> | ReturnType<typeof connectInvoicingStripe> | ReturnType<typeof disconnectInvoicingStripe> | ReturnType<typeof updateInvoicingStripeConnection> | ReturnType<typeof invoicingStripeConnectionFailure> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateFiles> | ReturnType<typeof openSnackbar>;
|
|
@@ -25,7 +25,7 @@ const entityToInvoicingBrandingFormLocalData = (settings) => ({
|
|
|
25
25
|
email: settings?.email ?? '',
|
|
26
26
|
invoiceFooterText: settings?.invoice_footer_text ?? '',
|
|
27
27
|
invoicePrefix: settings?.invoice_prefix ?? '',
|
|
28
|
-
logoFileId: settings?.
|
|
28
|
+
logoFileId: settings?.logo_file?.file_id ?? '',
|
|
29
29
|
phone: settings?.phone ?? '',
|
|
30
30
|
taxId: settings?.tax_id ?? '',
|
|
31
31
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { FetchState, FetchStateAndError } from '../../../commonStateTypes/common';
|
|
3
3
|
import { InvoicingDunningActionOption, InvoicingFieldHelpByCode, InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSettingsPayload } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
4
|
+
import { File } from '../../../entity/file/fileState';
|
|
4
5
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
5
6
|
import { RootState } from '../../../rootStateTypes';
|
|
6
7
|
import { InvoicingQboConnection, InvoicingQboSyncHealth } from '../invoicingQboView/invoicingQboViewPayload';
|
|
@@ -24,6 +25,13 @@ export interface InvoicingSettingsView {
|
|
|
24
25
|
saveState: FetchStateAndError;
|
|
25
26
|
stripeConnectState: FetchStateAndError;
|
|
26
27
|
error?: ZeniAPIStatus;
|
|
28
|
+
/**
|
|
29
|
+
* The tenant's logo, read back out of the file entity the settings fetch
|
|
30
|
+
* stored it in. `undefined` when no logo is set — the settings response
|
|
31
|
+
* returns no record then, which is also how a logo deleted out from under a
|
|
32
|
+
* stale id reads, so the screen has nothing to show either way.
|
|
33
|
+
*/
|
|
34
|
+
logoFile?: File;
|
|
27
35
|
settings?: InvoicingSettingsPayload;
|
|
28
36
|
}
|
|
29
37
|
/**
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getInvoicingBrandingFormView = exports.getInvoicingQboSettingsFormView = exports.getInvoicingSettingsHubView = exports.getInvoicingSettingsView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = void 0;
|
|
4
4
|
exports.deriveInvoicingEnablePrerequisites = deriveInvoicingEnablePrerequisites;
|
|
5
5
|
const invoicingCommonPayload_1 = require("../../../entity/invoicing/invoicingCommonPayload");
|
|
6
|
+
const fileSelector_1 = require("../../../entity/file/fileSelector");
|
|
6
7
|
const addressViewSelector_1 = require("../../addressView/addressViewSelector");
|
|
7
8
|
const invoicingConfigViewSelector_1 = require("../invoicingConfigView/invoicingConfigViewSelector");
|
|
8
9
|
const invoicingQboViewSelector_1 = require("../invoicingQboView/invoicingQboViewSelector");
|
|
@@ -31,10 +32,14 @@ exports.getInvoicingSettingsFetchState = getInvoicingSettingsFetchState;
|
|
|
31
32
|
*/
|
|
32
33
|
const getInvoicingSettingsView = (state) => {
|
|
33
34
|
const { error, fetchState, saveFetchState, settings, stripeFetchState } = state.invoicingSettingsViewState;
|
|
35
|
+
const logoFileId = settings?.logo_file?.file_id ?? '';
|
|
34
36
|
return {
|
|
35
37
|
fieldHelp: (0, invoicingConfigViewSelector_1.invoicingFieldHelpForGroup)(state, 'settings'),
|
|
36
38
|
error,
|
|
37
39
|
fetchState,
|
|
40
|
+
logoFile: logoFileId !== ''
|
|
41
|
+
? (0, fileSelector_1.getFileByFileId)(state.fileState, logoFileId)
|
|
42
|
+
: undefined,
|
|
38
43
|
saveState: saveFetchState,
|
|
39
44
|
settings,
|
|
40
45
|
stripeConnectState: stripeFetchState,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
|
+
import { updateFiles } from '../../../entity/file/fileReducer';
|
|
4
5
|
import { RootState } from '../../../rootStateTypes';
|
|
5
6
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
6
7
|
import { resetNewAddressDataInLocalStore } from '../../addressView/addressViewReducer';
|
|
7
8
|
import { saveInvoicingSettingsFailure, saveInvoicingSettingsSuccess, submitInvoicingBrandingForm } from './settingsViewReducer';
|
|
8
|
-
export type SubmitActionType = ReturnType<typeof submitInvoicingBrandingForm> | ReturnType<typeof saveInvoicingSettingsSuccess> | ReturnType<typeof saveInvoicingSettingsFailure> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateAddresses>;
|
|
9
|
+
export type SubmitActionType = ReturnType<typeof submitInvoicingBrandingForm> | ReturnType<typeof saveInvoicingSettingsSuccess> | ReturnType<typeof saveInvoicingSettingsFailure> | ReturnType<typeof resetNewAddressDataInLocalStore> | ReturnType<typeof updateAddresses> | ReturnType<typeof updateFiles>;
|
|
9
10
|
/**
|
|
10
11
|
* On `submitInvoicingBrandingForm`, PUT the settings body built from the branding
|
|
11
12
|
* draft + the business address captured via the shared Address screen. The
|
|
@@ -4,6 +4,7 @@ exports.submitInvoicingBrandingFormEpic = void 0;
|
|
|
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 fileReducer_1 = require("../../../entity/file/fileReducer");
|
|
7
8
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
9
|
const addressViewReducer_1 = require("../../addressView/addressViewReducer");
|
|
9
10
|
const invoicingBrandingFormConfig_1 = require("./invoicingBrandingFormConfig");
|
|
@@ -26,10 +27,18 @@ const submitInvoicingBrandingFormEpic = (actions$, state$, zeniAPI) => actions$.
|
|
|
26
27
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
27
28
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
28
29
|
const savedAddress = response.data.address;
|
|
30
|
+
// The saved logo goes to the file entity for the same reason the
|
|
31
|
+
// saved address goes to the address entity: the settings view
|
|
32
|
+
// resolves the file by id, so without this a save that changes
|
|
33
|
+
// the logo leaves the view resolving an id nothing holds.
|
|
34
|
+
const savedLogoFile = response.data.logo_file;
|
|
29
35
|
return [
|
|
30
36
|
...(savedAddress != null
|
|
31
37
|
? [(0, addressReducer_1.updateAddresses)([savedAddress])]
|
|
32
38
|
: []),
|
|
39
|
+
...(savedLogoFile != null
|
|
40
|
+
? [(0, fileReducer_1.updateFiles)({ files: [savedLogoFile] })]
|
|
41
|
+
: []),
|
|
33
42
|
(0, settingsViewReducer_1.saveInvoicingSettingsSuccess)(response.data),
|
|
34
43
|
(0, addressViewReducer_1.resetNewAddressDataInLocalStore)(invoicingBrandingFormConfig_1.INVOICING_BUSINESS_ADDRESS_TYPE),
|
|
35
44
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.41-beta2MM",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|