@zeniai/client-epic-state 4.9.20 → 4.9.22
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.
|
@@ -3,10 +3,10 @@ import { RoleMap, UserRoleType } from '../../entity/userRole/userRoleType';
|
|
|
3
3
|
import { NotificationSettings } from './settingsViewState';
|
|
4
4
|
export declare const isAccountingTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined) => boolean;
|
|
5
5
|
export declare const isApprovalRulesTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap | undefined) => boolean;
|
|
6
|
-
export declare const isBusinessVerificationTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap | undefined) => boolean;
|
|
7
6
|
export declare const isBankConnectionsTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap | undefined) => boolean;
|
|
7
|
+
export declare const isBusinessVerificationTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap | undefined) => boolean;
|
|
8
8
|
export declare const isCompanyDetailsTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap | undefined) => boolean;
|
|
9
9
|
export declare const isIntegrationsTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined) => boolean;
|
|
10
10
|
export declare const isSettingsVisible: (currentTenant: CurrentTenant | undefined) => boolean;
|
|
11
|
-
export declare const isMyBankConnectionsTabVisible: (
|
|
11
|
+
export declare const isMyBankConnectionsTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap | undefined) => boolean;
|
|
12
12
|
export declare const isNotificationsTabVisible: (notificationSettingsView: NotificationSettings) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNotificationsTabVisible = exports.isMyBankConnectionsTabVisible = exports.isSettingsVisible = exports.isIntegrationsTabVisible = exports.isCompanyDetailsTabVisible = exports.
|
|
3
|
+
exports.isNotificationsTabVisible = exports.isMyBankConnectionsTabVisible = exports.isSettingsVisible = exports.isIntegrationsTabVisible = exports.isCompanyDetailsTabVisible = exports.isBusinessVerificationTabVisible = exports.isBankConnectionsTabVisible = exports.isApprovalRulesTabVisible = exports.isAccountingTabVisible = void 0;
|
|
4
4
|
const userRoleType_1 = require("../../entity/userRole/userRoleType");
|
|
5
5
|
const isAccountingTabVisible = (userRole, currentTenant) => {
|
|
6
6
|
if ((0, exports.isSettingsVisible)(currentTenant)) {
|
|
@@ -29,7 +29,7 @@ const isApprovalRulesTabVisible = (userRole, currentTenant, userRoleMap) => {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
exports.isApprovalRulesTabVisible = isApprovalRulesTabVisible;
|
|
32
|
-
const
|
|
32
|
+
const isBankConnectionsTabVisible = (currentTenant, userRoleMap) => {
|
|
33
33
|
if (currentTenant == null || userRoleMap == null) {
|
|
34
34
|
return false;
|
|
35
35
|
}
|
|
@@ -37,16 +37,14 @@ const isBusinessVerificationTabVisible = (userRole, currentTenant, userRoleMap)
|
|
|
37
37
|
return ((0, userRoleType_1.hasBillPayAccessible)(currentTenant, userRoleMap) ||
|
|
38
38
|
(0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
|
|
39
39
|
(0, userRoleType_1.hasZeniAccountsAccessible)(currentTenant, userRoleMap) ||
|
|
40
|
-
(0, userRoleType_1.hasChargeCardAccessible)(currentTenant, userRoleMap)
|
|
41
|
-
((0, userRoleType_1.hasAnySpendManagementTOSAccepted)(currentTenant) &&
|
|
42
|
-
(0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole)));
|
|
40
|
+
(0, userRoleType_1.hasChargeCardAccessible)(currentTenant, userRoleMap));
|
|
43
41
|
}
|
|
44
42
|
else {
|
|
45
43
|
return false;
|
|
46
44
|
}
|
|
47
45
|
};
|
|
48
|
-
exports.
|
|
49
|
-
const
|
|
46
|
+
exports.isBankConnectionsTabVisible = isBankConnectionsTabVisible;
|
|
47
|
+
const isBusinessVerificationTabVisible = (currentTenant, userRoleMap) => {
|
|
50
48
|
if (currentTenant == null || userRoleMap == null) {
|
|
51
49
|
return false;
|
|
52
50
|
}
|
|
@@ -60,7 +58,7 @@ const isBankConnectionsTabVisible = (currentTenant, userRoleMap) => {
|
|
|
60
58
|
return false;
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
|
-
exports.
|
|
61
|
+
exports.isBusinessVerificationTabVisible = isBusinessVerificationTabVisible;
|
|
64
62
|
const isCompanyDetailsTabVisible = (userRole, currentTenant, userRoleMap) => {
|
|
65
63
|
if (currentTenant == null || userRoleMap == null) {
|
|
66
64
|
return false;
|
|
@@ -94,17 +92,14 @@ const isSettingsVisible = (currentTenant) => {
|
|
|
94
92
|
}
|
|
95
93
|
};
|
|
96
94
|
exports.isSettingsVisible = isSettingsVisible;
|
|
97
|
-
const isMyBankConnectionsTabVisible = (
|
|
95
|
+
const isMyBankConnectionsTabVisible = (currentTenant, userRoleMap) => {
|
|
98
96
|
var _a;
|
|
99
97
|
if (currentTenant == null) {
|
|
100
98
|
return false;
|
|
101
99
|
}
|
|
102
100
|
if ((0, exports.isSettingsVisible)(currentTenant)) {
|
|
103
|
-
const isReimbursementTOSAccepted = Boolean((_a = currentTenant
|
|
104
|
-
return
|
|
105
|
-
((0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole) ||
|
|
106
|
-
(0, userRoleType_1.hasLiteLevelAccess)(userRole) ||
|
|
107
|
-
(0, userRoleType_1.hasEmployeeLevelAccess)(currentTenant)));
|
|
101
|
+
const isReimbursementTOSAccepted = Boolean((_a = currentTenant.company) === null || _a === void 0 ? void 0 : _a.companyReimbursementInfo.isReimbursementTOSAccepted);
|
|
102
|
+
return isReimbursementTOSAccepted && (0, userRoleType_1.hasReimbursementAccess)(userRoleMap);
|
|
108
103
|
}
|
|
109
104
|
else {
|
|
110
105
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.22",
|
|
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",
|