@zeniai/client-epic-state 4.17.92 → 4.17.93
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.
|
@@ -18,9 +18,10 @@ import { fetchOpEx } from '../opEx/opExReducer';
|
|
|
18
18
|
import { fetchRewardsPlan } from '../referralView/referralReducer';
|
|
19
19
|
import { fetchReimbursementCard } from '../reimbursementCard/reimbursementCardReducer';
|
|
20
20
|
import { fetchRevenue } from '../revenue/revenueReducer';
|
|
21
|
+
import { fetchTreasuryFunds } from '../spendManagement/treasury/treasurySetUp/treasurySetupViewReducer';
|
|
21
22
|
import { fetchTasksCard } from '../tasksCard/tasksCardReducer';
|
|
22
23
|
import { fetchTopEx } from '../topEx/topExReducer';
|
|
23
24
|
import { fetchZeniAccountsPromoCard } from '../zeniAccountsPromoCard/zeniAccountsPromoCardReducer';
|
|
24
25
|
import { fetchDashboard } from './dashboardReducer';
|
|
25
|
-
export type ActionType = ReturnType<typeof fetchDashboard> | ReturnType<typeof fetchAllTenants> | ReturnType<typeof fetchCardBalance> | ReturnType<typeof fetchCashBalance> | ReturnType<typeof fetchOpEx> | ReturnType<typeof fetchRevenue> | ReturnType<typeof fetchNetBurnOrIncome> | ReturnType<typeof fetchNetBurnOrIncomeStoryCard> | ReturnType<typeof fetchTopEx> | ReturnType<typeof fetchCashPosition> | ReturnType<typeof fetchCashInCashOut> | ReturnType<typeof fetchInsightsCard> | ReturnType<typeof fetchCompanyPassportView> | ReturnType<typeof fetchTasksCard> | ReturnType<typeof fetchBillPayCard> | ReturnType<typeof fetchApAging> | ReturnType<typeof fetchArAging> | ReturnType<typeof fetchReimbursementCard> | ReturnType<typeof fetchZeniAccountsPromoCard> | ReturnType<typeof fetchRewardsPlan> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchDashboardLayout>;
|
|
26
|
+
export type ActionType = ReturnType<typeof fetchDashboard> | ReturnType<typeof fetchAllTenants> | ReturnType<typeof fetchCardBalance> | ReturnType<typeof fetchCashBalance> | ReturnType<typeof fetchOpEx> | ReturnType<typeof fetchRevenue> | ReturnType<typeof fetchNetBurnOrIncome> | ReturnType<typeof fetchNetBurnOrIncomeStoryCard> | ReturnType<typeof fetchTopEx> | ReturnType<typeof fetchCashPosition> | ReturnType<typeof fetchCashInCashOut> | ReturnType<typeof fetchInsightsCard> | ReturnType<typeof fetchCompanyPassportView> | ReturnType<typeof fetchTasksCard> | ReturnType<typeof fetchBillPayCard> | ReturnType<typeof fetchApAging> | ReturnType<typeof fetchArAging> | ReturnType<typeof fetchReimbursementCard> | ReturnType<typeof fetchZeniAccountsPromoCard> | ReturnType<typeof fetchRewardsPlan> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof fetchDashboardLayout> | ReturnType<typeof fetchTreasuryFunds>;
|
|
26
27
|
export declare const fetchDashboardEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => import("rxjs").Observable<ActionType>;
|
|
@@ -28,6 +28,7 @@ const referralReducer_1 = require("../referralView/referralReducer");
|
|
|
28
28
|
const reimbursementCardReducer_1 = require("../reimbursementCard/reimbursementCardReducer");
|
|
29
29
|
const revenueReducer_1 = require("../revenue/revenueReducer");
|
|
30
30
|
const revenueSelector_1 = require("../revenue/revenueSelector");
|
|
31
|
+
const treasurySetupViewReducer_1 = require("../spendManagement/treasury/treasurySetUp/treasurySetupViewReducer");
|
|
31
32
|
const tasksCardReducer_1 = require("../tasksCard/tasksCardReducer");
|
|
32
33
|
const topExReducer_1 = require("../topEx/topExReducer");
|
|
33
34
|
const zeniAccountsPromoCardReducer_1 = require("../zeniAccountsPromoCard/zeniAccountsPromoCardReducer");
|
|
@@ -36,6 +37,7 @@ const fetchDashboardEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
|
|
|
36
37
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
37
38
|
const { userId, companyId, fetchFullReport, cacheOverride, excludeResources, tenantId, } = action.payload;
|
|
38
39
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
|
|
40
|
+
const userRoleMap = (0, userRoleType_1.getUserRoleMap)(currentTenant.userRole);
|
|
39
41
|
const isReimbursementFeatureEnabled = (_a = currentTenant.company) === null || _a === void 0 ? void 0 : _a.featuresActivationInfo.isReimbursementFeatureEnabled;
|
|
40
42
|
const isAdmin = Boolean(currentTenant === null || currentTenant === void 0 ? void 0 : currentTenant.userRole) === true
|
|
41
43
|
? (0, userRoleType_1.hasAdminLevelAccess)(currentTenant.userRole)
|
|
@@ -87,6 +89,9 @@ const fetchDashboardEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
|
|
|
87
89
|
refreshViewInBackground: false,
|
|
88
90
|
}));
|
|
89
91
|
}
|
|
92
|
+
if ((0, userRoleType_1.hasTreasuryAccess)(userRoleMap)) {
|
|
93
|
+
actions.push((0, treasurySetupViewReducer_1.fetchTreasuryFunds)());
|
|
94
|
+
}
|
|
90
95
|
return (0, rxjs_1.from)(actions);
|
|
91
96
|
}
|
|
92
97
|
else {
|
|
@@ -196,6 +201,13 @@ const fetchDashboardEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
|
|
|
196
201
|
refreshViewInBackground: false,
|
|
197
202
|
}));
|
|
198
203
|
}
|
|
204
|
+
if (state.treasurySetupViewState.treasuryFundsDetails.fetchStatus
|
|
205
|
+
.fetchState !== 'In-Progress' &&
|
|
206
|
+
state.treasurySetupViewState.treasuryFundsDetails.fetchStatus
|
|
207
|
+
.fetchState !== 'Completed' &&
|
|
208
|
+
(0, userRoleType_1.hasTreasuryAccess)(userRoleMap)) {
|
|
209
|
+
fetchActions.push((0, treasurySetupViewReducer_1.fetchTreasuryFunds)());
|
|
210
|
+
}
|
|
199
211
|
return (0, rxjs_1.from)(fetchActions);
|
|
200
212
|
}
|
|
201
213
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.17.
|
|
3
|
+
"version": "4.17.93",
|
|
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",
|