@zeniai/client-epic-state 4.13.67 → 4.13.68
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.
|
@@ -10,5 +10,6 @@ import { MonthYearPeriod } from '../../../commonStateTypes/timePeriod';
|
|
|
10
10
|
import { ID } from '../../../commonStateTypes/common';
|
|
11
11
|
export declare type ActionType = ReturnType<typeof fetchAllTenants> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateTenantsSuccess> | ReturnType<typeof initializeSelectedPeriodForTenants> | ReturnType<typeof updateTenantsFailure>;
|
|
12
12
|
export declare const fetchAllTenantsEpic: (actions$: ActionsObservable<ActionType>, state: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
13
|
+
export declare const defaultMonthYearPeriod: MonthYearPeriod;
|
|
13
14
|
export declare const getDefaultSelectedPeriodsForTenants: (tenantsData: TenantsData) => Record<ID, MonthYearPeriod>;
|
|
14
15
|
export declare const getMonthYearPeriodFromBookCloseDate: (zeniBookCloseDate?: import("dayjs").Dayjs | undefined) => MonthYearPeriod;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMonthYearPeriodFromBookCloseDate = exports.getDefaultSelectedPeriodsForTenants = exports.fetchAllTenantsEpic = void 0;
|
|
3
|
+
exports.getMonthYearPeriodFromBookCloseDate = exports.getDefaultSelectedPeriodsForTenants = exports.defaultMonthYearPeriod = exports.fetchAllTenantsEpic = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const tenantReducer_1 = require("../tenantReducer");
|
|
@@ -52,7 +52,7 @@ const fetchAllTenantsEpic = (actions$, state, zeniAPI) => actions$.pipe((0, oper
|
|
|
52
52
|
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, tenantReducer_1.updateTenantsFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Fetch All Tenants REST API call errored out' +
|
|
53
53
|
JSON.stringify(error))))))));
|
|
54
54
|
exports.fetchAllTenantsEpic = fetchAllTenantsEpic;
|
|
55
|
-
|
|
55
|
+
exports.defaultMonthYearPeriod = {
|
|
56
56
|
month: (0, timePeriod_1.toMonth)((0, zeniDayJS_1.dateNow)().get('month') + 1),
|
|
57
57
|
year: (0, zeniDayJS_1.dateNow)().get('year'),
|
|
58
58
|
};
|
|
@@ -70,7 +70,7 @@ const getDefaultSelectedPeriodsForTenants = (tenantsData) => {
|
|
|
70
70
|
};
|
|
71
71
|
return Object.assign(Object.assign({}, prev), { [currentTenant.tenant_id]: nextMonthPeriod });
|
|
72
72
|
}
|
|
73
|
-
return Object.assign(Object.assign({}, prev), { [currentTenant.tenant_id]: defaultMonthYearPeriod });
|
|
73
|
+
return Object.assign(Object.assign({}, prev), { [currentTenant.tenant_id]: exports.defaultMonthYearPeriod });
|
|
74
74
|
}, {});
|
|
75
75
|
return defaultSelectedPeriodsForTenants;
|
|
76
76
|
};
|
|
@@ -81,6 +81,6 @@ const getMonthYearPeriodFromBookCloseDate = (zeniBookCloseDate) => {
|
|
|
81
81
|
month: (0, timePeriod_1.toMonth)(zeniBookCloseDate.add(1, 'month').get('month') + 1),
|
|
82
82
|
year: zeniBookCloseDate.add(1, 'month').get('year'),
|
|
83
83
|
}
|
|
84
|
-
: defaultMonthYearPeriod;
|
|
84
|
+
: exports.defaultMonthYearPeriod;
|
|
85
85
|
};
|
|
86
86
|
exports.getMonthYearPeriodFromBookCloseDate = getMonthYearPeriodFromBookCloseDate;
|
|
@@ -35,7 +35,7 @@ const fetchDashboardEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
|
|
|
35
35
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
36
36
|
const { userId, companyId, fetchFullReport, cacheOverride, excludeResources, tenantId, } = action.payload;
|
|
37
37
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
|
|
38
|
-
const
|
|
38
|
+
const zeniBookCloseMonthAndYear = currentTenant.zeniBookCloseMonthAndYear;
|
|
39
39
|
const isReimbursementFeatureEnabled = (_a = currentTenant.company) === null || _a === void 0 ? void 0 : _a.featuresActivationInfo.isReimbursementFeatureEnabled;
|
|
40
40
|
const isAdmin = Boolean(currentTenant === null || currentTenant === void 0 ? void 0 : currentTenant.userRole) === true
|
|
41
41
|
? (0, userRoleType_1.hasAdminLevelAccess)(currentTenant.userRole)
|
|
@@ -43,7 +43,7 @@ const fetchDashboardEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
|
|
|
43
43
|
const isInvestorBanker = (0, userRoleType_1.hasInvestorBankerLevelAccess)(currentTenant.userRole);
|
|
44
44
|
const arAgingDate = state$.value.arAgingState.uiState.selectedDate;
|
|
45
45
|
const apAgingDate = state$.value.apAgingState.uiState.selectedDate;
|
|
46
|
-
const monthEndChecksPeriod =
|
|
46
|
+
const monthEndChecksPeriod = zeniBookCloseMonthAndYear !== null && zeniBookCloseMonthAndYear !== void 0 ? zeniBookCloseMonthAndYear : fetchAllTenantsEpic_1.defaultMonthYearPeriod;
|
|
47
47
|
if (cacheOverride === true) {
|
|
48
48
|
const actions = [
|
|
49
49
|
(0, tenantReducer_1.fetchAllTenants)(userId),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.68",
|
|
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
|
"types": "lib/index.d.ts",
|