@zeniai/client-epic-state 4.19.86-betaRD2 → 4.19.86-betaRD4
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/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewSelector.js +5 -5
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPayApproversDetailsEpic.js +7 -2
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
3
3
|
import { reduceAllFetchState, reduceAnyFetchState, } from '../../../../commonStateTypes/reduceFetchState';
|
|
4
4
|
import { getApprovalRulesByIds } from '../../../../entity/approvalRule/approvalRuleSelector';
|
|
5
5
|
import { getClassesByIds } from '../../../../entity/class/classSelector';
|
|
6
|
+
import { getIsAccountingClassesEnabled } from '../../../../entity/tenant/tenantSelector';
|
|
6
7
|
import { getUserByUserId } from '../../../../entity/user/userSelector';
|
|
7
8
|
import { getUserRoleByUserId } from '../../../../entity/userRole/userRoleSelector';
|
|
8
9
|
export const getBillPaySetupApproverView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (billPaySetupApproverViewState, approvalRuleState, userState) => {
|
|
@@ -44,7 +45,7 @@ export const getBillPaySetupApproverView = createSelector((state) => state.billP
|
|
|
44
45
|
newApprovalRuleId,
|
|
45
46
|
};
|
|
46
47
|
});
|
|
47
|
-
export const getBillPaySetupApproverUpdateDataView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState) => {
|
|
48
|
+
export const getBillPaySetupApproverUpdateDataView = createSelector((state) => state.billPaySetupApproverViewState, (state) => state.approvalRuleState, (state) => state.userState, (state) => state.classState, (state) => state.classListState, (state) => state.userRoleState, (state) => getIsAccountingClassesEnabled(state), (billPaySetupApproverViewState, approvalRuleState, userState, classState, classListState, userRoleState, isAccountingClassesEnabled) => {
|
|
48
49
|
const { affectedEntityIds, approvalRuleIds, approverListState, billPaySetupApproverViewUpdateData, fetchState, error, listeningToPusherEvent, } = billPaySetupApproverViewState;
|
|
49
50
|
const { approverIds, attributes } = approverListState;
|
|
50
51
|
const allApprovalRules = getApprovalRulesByIds(approvalRuleState, approvalRuleIds);
|
|
@@ -92,10 +93,9 @@ export const getBillPaySetupApproverUpdateDataView = createSelector((state) => s
|
|
|
92
93
|
allAttributes,
|
|
93
94
|
filteredAttributes,
|
|
94
95
|
billPaySetupApproverViewUpdateData,
|
|
95
|
-
approverListFetchStatus:
|
|
96
|
-
approverListState.fetchStatus,
|
|
97
|
-
|
|
98
|
-
]),
|
|
96
|
+
approverListFetchStatus: isAccountingClassesEnabled
|
|
97
|
+
? reduceAllFetchState([approverListState.fetchStatus, classListState])
|
|
98
|
+
: approverListState.fetchStatus,
|
|
99
99
|
fetchState,
|
|
100
100
|
allAccountingClasses,
|
|
101
101
|
error,
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { concat, from } from 'rxjs';
|
|
2
2
|
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
+
import { getIsAccountingClassesEnabled } from '../../../../../entity/tenant/tenantSelector';
|
|
3
4
|
import { fetchClassList } from '../../../../classList/classListReducer';
|
|
4
5
|
import { fetchBillPayApproversDetails, fetchBillPayApproversList, } from '../billPaySetupApproverViewReducer';
|
|
5
6
|
export const fetchBillPayApproversDetailsEpic = (actions$, state$) => actions$.pipe(filter(fetchBillPayApproversDetails.match), mergeMap((action) => {
|
|
6
7
|
const { cacheOverride, includeUserRoles } = action.payload;
|
|
7
8
|
const { billPaySetupApproverViewState, classListState } = state$.value;
|
|
8
9
|
const { approverListState } = billPaySetupApproverViewState;
|
|
10
|
+
const isAccountingClassesEnabled = getIsAccountingClassesEnabled(state$.value);
|
|
9
11
|
const actions = [];
|
|
10
12
|
if (cacheOverride === true) {
|
|
11
13
|
actions.push(fetchBillPayApproversList(cacheOverride, includeUserRoles));
|
|
12
|
-
|
|
14
|
+
if (isAccountingClassesEnabled) {
|
|
15
|
+
actions.push(fetchClassList());
|
|
16
|
+
}
|
|
13
17
|
}
|
|
14
18
|
else {
|
|
15
19
|
if (billPaySetupApproverViewState.hasValidState() === false &&
|
|
16
20
|
approverListState.fetchStatus.fetchState !== 'In-Progress') {
|
|
17
21
|
actions.push(fetchBillPayApproversList(true, includeUserRoles));
|
|
18
22
|
}
|
|
19
|
-
if (
|
|
23
|
+
if (isAccountingClassesEnabled &&
|
|
24
|
+
classListState.hasValidState() === false &&
|
|
20
25
|
classListState.fetchState !== 'In-Progress') {
|
|
21
26
|
actions.push(fetchClassList());
|
|
22
27
|
}
|