@zeniai/client-epic-state 5.1.66 → 5.1.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.
- package/lib/entity/approvalRule/approvalRuleState.d.ts +1 -0
- package/lib/entity/entityApprovalStatus/entityApprovalStatusPayload.d.ts +1 -0
- package/lib/entity/entityApprovalStatus/entityApprovalStatusPayload.js +1 -0
- package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +1 -0
- package/lib/epic.d.ts +4 -3
- package/lib/epic.js +4 -3
- package/lib/esm/entity/entityApprovalStatus/entityApprovalStatusPayload.js +1 -0
- package/lib/esm/epic.js +4 -3
- package/lib/esm/index.js +2 -2
- package/lib/esm/view/invoicing/createInvoice/createInvoiceReducer.js +15 -1
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +5 -1
- package/lib/esm/view/invoicing/createInvoice/epics/fetchCreateInvoiceFormPageEpic.js +50 -0
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +0 -1
- package/lib/esm/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +76 -37
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +14 -17
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +1 -3
- package/lib/esm/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +0 -14
- package/lib/esm/view/spendManagement/helpers.js +14 -0
- package/lib/esm/view/spendManagement/reimbursement/remiDetailView/remiDetailViewSelector.js +42 -17
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +14 -17
- package/lib/index.d.ts +2 -2
- package/lib/index.js +12 -11
- package/lib/view/invoicing/createInvoice/createInvoiceReducer.d.ts +5 -1
- package/lib/view/invoicing/createInvoice/createInvoiceReducer.js +16 -2
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +1 -0
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +5 -1
- package/lib/view/invoicing/createInvoice/epics/fetchCreateInvoiceFormPageEpic.d.ts +15 -0
- package/lib/view/invoicing/createInvoice/epics/fetchCreateInvoiceFormPageEpic.js +54 -0
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewPayload.js +0 -1
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +3 -0
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +75 -36
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +13 -16
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +1 -3
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.d.ts +1 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/fetchEditBillDetailPageEpic.js +0 -14
- package/lib/view/spendManagement/helpers.d.ts +5 -1
- package/lib/view/spendManagement/helpers.js +18 -1
- package/lib/view/spendManagement/reimbursement/remiDetailView/remiDetailViewSelector.d.ts +2 -0
- package/lib/view/spendManagement/reimbursement/remiDetailView/remiDetailViewSelector.js +41 -16
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +13 -16
- package/package.json +1 -1
|
@@ -11,7 +11,6 @@ const vendorTypeListReducer_1 = require("../../../../vendorTypeList/vendorTypeLi
|
|
|
11
11
|
const depositAccountListReducer_1 = require("../../../zeniAccounts/depositAccountList/depositAccountListReducer");
|
|
12
12
|
const paymentAccountListReducer_1 = require("../../../zeniAccounts/paymentAccountList/paymentAccountListReducer");
|
|
13
13
|
const billPayConfigReducer_1 = require("../../billPayConfig/billPayConfigReducer");
|
|
14
|
-
const billPaySetupApproverViewReducer_1 = require("../../billPaySetupApproverView/billPaySetupApproverViewReducer");
|
|
15
14
|
const editBillViewReducer_1 = require("../editBillViewReducer");
|
|
16
15
|
const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.fetchEditBillDetailPage.match), (0, operators_1.mergeMap)((action) => {
|
|
17
16
|
const { cacheOverride, billId, isShowDeletedBillsEnabled, hasZeniAssistAccess, isInternationalWireEnabled, } = action.payload;
|
|
@@ -41,10 +40,6 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
41
40
|
else {
|
|
42
41
|
billDetailActions.push((0, editBillViewReducer_1.updateShowAutofill)(true));
|
|
43
42
|
}
|
|
44
|
-
// Side-fetch from the edit-bill page bootstrap. The triggering
|
|
45
|
-
// action doesn't carry the V3 flag, so we explicitly target v1
|
|
46
|
-
// here; tenants on v3 re-fetch through their own screen connector.
|
|
47
|
-
billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, false));
|
|
48
43
|
}
|
|
49
44
|
else {
|
|
50
45
|
if (state.ownerListState.fetchState !== 'In-Progress' &&
|
|
@@ -83,15 +78,6 @@ const fetchEditBillDetailPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
83
78
|
if (billId != null) {
|
|
84
79
|
billDetailActions.push((0, editBillViewReducer_1.fetchBillAndInitializeLocalStore)(billId, false, isShowDeletedBillsEnabled, hasZeniAssistAccess));
|
|
85
80
|
}
|
|
86
|
-
const approvalViewFetchState = state.billPaySetupApproverViewState.fetchState;
|
|
87
|
-
// While opening New Bill Refresh Approval Rules and Payment Accounts
|
|
88
|
-
if (approvalViewFetchState !== 'In-Progress' &&
|
|
89
|
-
approvalViewFetchState !== 'Completed') {
|
|
90
|
-
// Side-fetch from the edit-bill page bootstrap. The triggering
|
|
91
|
-
// action doesn't carry the V3 flag, so we explicitly target v1
|
|
92
|
-
// here; tenants on v3 re-fetch through their own screen connector.
|
|
93
|
-
billDetailActions.push((0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, false));
|
|
94
|
-
}
|
|
95
81
|
}
|
|
96
82
|
return (0, rxjs_1.concat)((0, rxjs_1.from)(billDetailActions));
|
|
97
83
|
}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Amount } from '../../commonStateTypes/amount';
|
|
2
|
+
import { ID } from '../../commonStateTypes/common';
|
|
2
3
|
import { ReportIDPlusForecastID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
4
|
import { BillPayInfo, BulkProcessingStateType } from '../../entity/billPay/billTransaction/billTransactionState';
|
|
4
5
|
import { RecurringBillConfig } from '../../entity/billPay/recurringBills/recurringBillsState';
|
|
@@ -6,13 +7,16 @@ import { ReimbursementTypeCode } from '../../entity/reimbursement/reimbursementS
|
|
|
6
7
|
import { CurrentTenant } from '../../entity/tenant/tenantSelector';
|
|
7
8
|
import { RoleMap } from '../../entity/userRole/userRoleType';
|
|
8
9
|
import { ZeniDate } from '../../zeniDayJS';
|
|
9
|
-
import { BillActivity } from './billPay/billDetailView/billDetailViewSelector';
|
|
10
|
+
import { ActorActivityWithUser, BillActivity } from './billPay/billDetailView/billDetailViewSelector';
|
|
10
11
|
import { BillTransactionView } from './billPay/billList/billListSelector';
|
|
11
12
|
import { AccType, AccountTypeSubConfigCodeKeyType } from './billPay/billPayConfig/billPayConfigState';
|
|
12
13
|
import { RecurringBillConfigLocalData, RecurringBillInstance } from './billPay/editBillView/editBillViewState';
|
|
13
14
|
import { BusinessVerificationDetails, CompanyOfficersDetails } from './commonSetup/setupViewSelector';
|
|
14
15
|
import { SetupViewType } from './commonSetup/setupViewState';
|
|
15
16
|
import { RemiActivity } from './reimbursement/remiDetailView/remiDetailViewSelector';
|
|
17
|
+
export declare const isUserActorOnApprovalStep: (userId: ID, stepActorsActivity: ActorActivityWithUser[]) => boolean;
|
|
18
|
+
export declare const isSodExcludedViewerBlocked: (sodExcludedApproverUserId?: ID, signedInUserId?: ID, stepActorsActivity?: ActorActivityWithUser[]) => boolean;
|
|
19
|
+
export declare const isSodAdminFallbackEligibleForStep: (sodExcludedApproverUserId?: ID, isAdminFallbackApprover?: boolean, stepActorsActivity?: ActorActivityWithUser[]) => boolean;
|
|
16
20
|
export declare const getLatestApprovalDate: (allActivities: BillActivity[] | RemiActivity[]) => ZeniDate | undefined;
|
|
17
21
|
export declare function getSpendManagementEffectiveListPeriod(): import("../..").TimePeriod;
|
|
18
22
|
export declare const getSelectedCompanyOfficer: (verificationDetails: BusinessVerificationDetails) => CompanyOfficersDetails | undefined;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.toSameDayAchDisablementConfig = exports.checkIfLowBalance = exports.getReportIDPlusForecastIDFromSetupViewType = exports.isAwaitingMarkAsPaid = exports.isPaymentMethodOutsideZeni = exports.toAccountsPromoConfig = exports.getBulkOperationSuffix = exports.getRemiListUniqueType = exports.getBillListUniqueType = exports.isBulkProcessing = exports.getActualPaymentDate = exports.accountTypeSubConfigCodeToAccType = exports.isRecurringConfigChanged = exports.updateRecurringBillDetails = exports.getPaymentDateFromVendorReceiveDate = exports.getSelectedCompanyOfficer = exports.getLatestApprovalDate = void 0;
|
|
6
|
+
exports.toSameDayAchDisablementConfig = exports.checkIfLowBalance = exports.getReportIDPlusForecastIDFromSetupViewType = exports.isAwaitingMarkAsPaid = exports.isPaymentMethodOutsideZeni = exports.toAccountsPromoConfig = exports.getBulkOperationSuffix = exports.getRemiListUniqueType = exports.getBillListUniqueType = exports.isBulkProcessing = exports.getActualPaymentDate = exports.accountTypeSubConfigCodeToAccType = exports.isRecurringConfigChanged = exports.updateRecurringBillDetails = exports.getPaymentDateFromVendorReceiveDate = exports.getSelectedCompanyOfficer = exports.getLatestApprovalDate = exports.isSodAdminFallbackEligibleForStep = exports.isSodExcludedViewerBlocked = exports.isUserActorOnApprovalStep = void 0;
|
|
7
7
|
exports.getSpendManagementEffectiveListPeriod = getSpendManagementEffectiveListPeriod;
|
|
8
8
|
exports.showReimbursementPromoPage = showReimbursementPromoPage;
|
|
9
9
|
exports.showBillPayPromoPage = showBillPayPromoPage;
|
|
@@ -16,6 +16,23 @@ const workingDayHelper_1 = require("../../commonStateTypes/workingDayHelper");
|
|
|
16
16
|
const paymentAccountState_1 = require("../../entity/paymentAccount/paymentAccountState");
|
|
17
17
|
const userRoleType_1 = require("../../entity/userRole/userRoleType");
|
|
18
18
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
19
|
+
const getUserActorId = (activity) => activity.actor?.userId ?? activity.userId;
|
|
20
|
+
const isUserActorOnApprovalStep = (userId, stepActorsActivity) => stepActorsActivity.some((activity) => getUserActorId(activity) === userId);
|
|
21
|
+
exports.isUserActorOnApprovalStep = isUserActorOnApprovalStep;
|
|
22
|
+
const isSodExcludedViewerBlocked = (sodExcludedApproverUserId, signedInUserId, stepActorsActivity = []) => sodExcludedApproverUserId != null &&
|
|
23
|
+
signedInUserId != null &&
|
|
24
|
+
signedInUserId === sodExcludedApproverUserId &&
|
|
25
|
+
(0, exports.isUserActorOnApprovalStep)(sodExcludedApproverUserId, stepActorsActivity);
|
|
26
|
+
exports.isSodExcludedViewerBlocked = isSodExcludedViewerBlocked;
|
|
27
|
+
const isSodAdminFallbackEligibleForStep = (sodExcludedApproverUserId, isAdminFallbackApprover, stepActorsActivity = []) => {
|
|
28
|
+
if (sodExcludedApproverUserId == null || isAdminFallbackApprover !== true) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
const pendingResolvedApprovers = stepActorsActivity.filter((activity) => activity.activity === 'pending' && getUserActorId(activity) != null);
|
|
32
|
+
return (pendingResolvedApprovers.length > 0 &&
|
|
33
|
+
pendingResolvedApprovers.every((activity) => getUserActorId(activity) === sodExcludedApproverUserId));
|
|
34
|
+
};
|
|
35
|
+
exports.isSodAdminFallbackEligibleForStep = isSodAdminFallbackEligibleForStep;
|
|
19
36
|
const getLatestApprovalDate = (allActivities) => {
|
|
20
37
|
let allStepsWithStatus = [];
|
|
21
38
|
let allApprovedActions = [];
|
|
@@ -43,6 +43,7 @@ export interface RemiDetails extends Reimbursement {
|
|
|
43
43
|
export interface StepWithStatus extends StepWithUser {
|
|
44
44
|
actorsActivity: ActorActivityWithUser[];
|
|
45
45
|
isOriginalApprovalStep: boolean;
|
|
46
|
+
displayPendingApproverAsAdmin?: boolean;
|
|
46
47
|
}
|
|
47
48
|
export interface ActorActivityWithUser extends Actor {
|
|
48
49
|
activity: ActivityStatus;
|
|
@@ -66,6 +67,7 @@ export interface RemiActivity {
|
|
|
66
67
|
currentPendingStepIndex?: number;
|
|
67
68
|
entityApprovalId?: ID;
|
|
68
69
|
isAdminFallbackApprover?: boolean;
|
|
70
|
+
sodExcludedApproverUserId?: ID;
|
|
69
71
|
}
|
|
70
72
|
export declare const getRemiDetailView: (state: RootState, reimbursementId: ID) => RemiDetailViewSelector;
|
|
71
73
|
export declare const getRemiActivities: (state: RootState, reimbursementId: ID, billStageCode?: BillStageCodeType) => RemiActivity[];
|
|
@@ -151,7 +151,7 @@ const getRemiActivities = (state, reimbursementId, billStageCode) => {
|
|
|
151
151
|
const approvalRules = (0, approvalRuleSelector_1.getApprovalRulesByIds)(approvalRuleState, remiTransactionDetails.approvalRuleIds);
|
|
152
152
|
const entityApprovalStatusByIds = (0, entityApprovalStatusSelector_1.getEntityApprovalStatusByIds)(entityApprovalStatusState, remiTransactionDetails.entityApprovalIds);
|
|
153
153
|
remiActivities = entityApprovalStatusByIds.map((entityApprovalStatus) => {
|
|
154
|
-
const { approvalRuleId, entityType, createTime, updateTime, stepsApprovalStatus, areApprovalsSerialized, isAdminFallbackApprover, currentPendingStepIndex, isRealTimeApprovalEnabled, } = entityApprovalStatus;
|
|
154
|
+
const { approvalRuleId, entityType, createTime, updateTime, stepsApprovalStatus, areApprovalsSerialized, isAdminFallbackApprover, currentPendingStepIndex, isRealTimeApprovalEnabled, sodExcludedApproverUserId, } = entityApprovalStatus;
|
|
155
155
|
const approvalRule = approvalRules.find((rule) => rule.approvalRuleId === approvalRuleId);
|
|
156
156
|
return {
|
|
157
157
|
approvalRuleId,
|
|
@@ -163,21 +163,22 @@ const getRemiActivities = (state, reimbursementId, billStageCode) => {
|
|
|
163
163
|
isAdminFallbackApprover,
|
|
164
164
|
currentPendingStepIndex,
|
|
165
165
|
isRealTimeApprovalEnabled,
|
|
166
|
+
sodExcludedApproverUserId,
|
|
166
167
|
entityApprovalId: entityApprovalStatus.entityApprovalId,
|
|
167
168
|
stepsWithStatus: stepsApprovalStatus.map((step) => {
|
|
169
|
+
const actorsActivity = step.actorsActivity.map((activity) => ({
|
|
170
|
+
...activity,
|
|
171
|
+
actor: (0, userSelector_1.getUserByUserId)(userState, activity.userId),
|
|
172
|
+
}));
|
|
168
173
|
return {
|
|
169
174
|
...step,
|
|
170
175
|
actors: step.actors
|
|
171
176
|
.map((actor) => (0, userSelector_1.getUserByUserId)(userState, actor.userId))
|
|
172
177
|
.filter((user) => user != null),
|
|
173
178
|
nonUserActors: step.actors.filter((actor) => actor.userId == null && actor.type !== 'user'),
|
|
174
|
-
actorsActivity
|
|
175
|
-
return {
|
|
176
|
-
...activity,
|
|
177
|
-
actor: (0, userSelector_1.getUserByUserId)(userState, activity.userId),
|
|
178
|
-
};
|
|
179
|
-
}),
|
|
179
|
+
actorsActivity,
|
|
180
180
|
isOriginalApprovalStep: step.isOriginalApprovalStep,
|
|
181
|
+
displayPendingApproverAsAdmin: (0, helpers_1.isSodAdminFallbackEligibleForStep)(sodExcludedApproverUserId, isAdminFallbackApprover, actorsActivity),
|
|
181
182
|
};
|
|
182
183
|
}),
|
|
183
184
|
};
|
|
@@ -191,7 +192,7 @@ const checkApproveRejectBtnShow = (remiActivities, isUserAdmin, signedInUser) =>
|
|
|
191
192
|
let isApprovalorRejectBtnVisible = false;
|
|
192
193
|
let rejectedId = -1;
|
|
193
194
|
const stepsWithStatusData = remiActivities[0].stepsWithStatus;
|
|
194
|
-
const { areApprovalsSerialized, isAdminFallbackApprover, currentPendingStepIndex, } = remiActivities[0];
|
|
195
|
+
const { areApprovalsSerialized, isAdminFallbackApprover, currentPendingStepIndex, sodExcludedApproverUserId, } = remiActivities[0];
|
|
195
196
|
for (const [index, stepWithStatus] of stepsWithStatusData.entries()) {
|
|
196
197
|
if (stepWithStatus.action === 'require_approval') {
|
|
197
198
|
for (const actorActivity of stepWithStatus.actorsActivity) {
|
|
@@ -227,27 +228,39 @@ const checkApproveRejectBtnShow = (remiActivities, isUserAdmin, signedInUser) =>
|
|
|
227
228
|
break;
|
|
228
229
|
}
|
|
229
230
|
}
|
|
231
|
+
const sodBlocked = (0, helpers_1.isSodExcludedViewerBlocked)(sodExcludedApproverUserId, signedInUser?.userId, pendingStep.actorsActivity);
|
|
230
232
|
for (const actorActivity of pendingStep.actorsActivity) {
|
|
231
|
-
if (
|
|
233
|
+
if (!sodBlocked &&
|
|
234
|
+
actorActivity.actor?.userId === signedInUser?.userId &&
|
|
232
235
|
isAllActivitiesPending) {
|
|
233
236
|
isApprovalorRejectBtnVisible = true;
|
|
234
237
|
}
|
|
235
238
|
else if (actorActivity.subType === 'admin' &&
|
|
236
239
|
isUserAdmin &&
|
|
237
|
-
isAllActivitiesPending
|
|
240
|
+
isAllActivitiesPending &&
|
|
241
|
+
signedInUser?.userId != null &&
|
|
242
|
+
signedInUser.userId !== sodExcludedApproverUserId) {
|
|
238
243
|
isApprovalorRejectBtnVisible = true;
|
|
239
244
|
}
|
|
240
|
-
// admin will be fallback approver if vendor-owner/manager are not assigned any user id
|
|
241
245
|
else if (actorActivity.type === 'attribute' &&
|
|
242
246
|
(actorActivity.subType === 'manager' ||
|
|
243
247
|
actorActivity.subType === 'vendor_owner' ||
|
|
244
248
|
actorActivity.subType === 'manager_of_manager') &&
|
|
245
249
|
actorActivity.userId === null &&
|
|
246
250
|
isAdminFallbackApprover === true &&
|
|
247
|
-
isUserAdmin
|
|
251
|
+
isUserAdmin &&
|
|
252
|
+
signedInUser?.userId != null &&
|
|
253
|
+
signedInUser.userId !== sodExcludedApproverUserId) {
|
|
248
254
|
isApprovalorRejectBtnVisible = true;
|
|
249
255
|
}
|
|
250
256
|
}
|
|
257
|
+
if (!isApprovalorRejectBtnVisible &&
|
|
258
|
+
isUserAdmin &&
|
|
259
|
+
signedInUser?.userId != null &&
|
|
260
|
+
signedInUser.userId !== sodExcludedApproverUserId &&
|
|
261
|
+
pendingStep.displayPendingApproverAsAdmin === true) {
|
|
262
|
+
isApprovalorRejectBtnVisible = true;
|
|
263
|
+
}
|
|
251
264
|
}
|
|
252
265
|
}
|
|
253
266
|
}
|
|
@@ -261,27 +274,39 @@ const checkApproveRejectBtnShow = (remiActivities, isUserAdmin, signedInUser) =>
|
|
|
261
274
|
break;
|
|
262
275
|
}
|
|
263
276
|
}
|
|
277
|
+
const sodBlocked = (0, helpers_1.isSodExcludedViewerBlocked)(sodExcludedApproverUserId, signedInUser?.userId, stepWithStatus.actorsActivity);
|
|
264
278
|
for (const actorActivity of stepWithStatus.actorsActivity) {
|
|
265
|
-
if (
|
|
279
|
+
if (!sodBlocked &&
|
|
280
|
+
actorActivity.actor?.userId === signedInUser?.userId &&
|
|
266
281
|
isAllActivitiesPending) {
|
|
267
282
|
isApprovalorRejectBtnVisible = true;
|
|
268
283
|
}
|
|
269
284
|
else if (actorActivity.subType === 'admin' &&
|
|
270
285
|
isUserAdmin &&
|
|
271
|
-
isAllActivitiesPending
|
|
286
|
+
isAllActivitiesPending &&
|
|
287
|
+
signedInUser?.userId != null &&
|
|
288
|
+
signedInUser.userId !== sodExcludedApproverUserId) {
|
|
272
289
|
isApprovalorRejectBtnVisible = true;
|
|
273
290
|
}
|
|
274
|
-
// admin will be fallback approver if vendor-owner/manager are not assigned any user id
|
|
275
291
|
else if (actorActivity.type === 'attribute' &&
|
|
276
292
|
(actorActivity.subType === 'manager' ||
|
|
277
293
|
actorActivity.subType === 'vendor_owner' ||
|
|
278
294
|
actorActivity.subType === 'manager_of_manager') &&
|
|
279
295
|
actorActivity.userId === null &&
|
|
280
296
|
isAdminFallbackApprover === true &&
|
|
281
|
-
isUserAdmin
|
|
297
|
+
isUserAdmin &&
|
|
298
|
+
signedInUser?.userId != null &&
|
|
299
|
+
signedInUser.userId !== sodExcludedApproverUserId) {
|
|
282
300
|
isApprovalorRejectBtnVisible = true;
|
|
283
301
|
}
|
|
284
302
|
}
|
|
303
|
+
if (!isApprovalorRejectBtnVisible &&
|
|
304
|
+
isUserAdmin &&
|
|
305
|
+
signedInUser?.userId != null &&
|
|
306
|
+
signedInUser.userId !== sodExcludedApproverUserId &&
|
|
307
|
+
stepWithStatus.displayPendingApproverAsAdmin === true) {
|
|
308
|
+
isApprovalorRejectBtnVisible = true;
|
|
309
|
+
}
|
|
285
310
|
}
|
|
286
311
|
if (isApprovalorRejectBtnVisible) {
|
|
287
312
|
break;
|
|
@@ -216,7 +216,7 @@ const getApproversOrRejectors = (reimbursement, entityApprovalStatusState, userS
|
|
|
216
216
|
};
|
|
217
217
|
if (reimbursement.entityApprovalId !== null) {
|
|
218
218
|
const entityApprovalStatus = entityApprovalStatusState.entityApprovalStatusById[reimbursement.entityApprovalId];
|
|
219
|
-
const { areApprovalsSerialized, isAdminFallbackApprover, currentPendingStepIndex, } = entityApprovalStatus;
|
|
219
|
+
const { areApprovalsSerialized, isAdminFallbackApprover, currentPendingStepIndex, sodExcludedApproverUserId, } = entityApprovalStatus;
|
|
220
220
|
const isReimbursementSerailized = areApprovalsSerialized === true &&
|
|
221
221
|
currentPendingStepIndex != null &&
|
|
222
222
|
currentPendingStepIndex > -1;
|
|
@@ -244,23 +244,20 @@ const getApproversOrRejectors = (reimbursement, entityApprovalStatusState, userS
|
|
|
244
244
|
if (isReimbursementSerailized) {
|
|
245
245
|
requireApprovalInfo = [stepsApprovalStatus[currentPendingStepIndex]];
|
|
246
246
|
}
|
|
247
|
-
const pendingActivitiesList = [];
|
|
248
247
|
requireApprovalInfo.forEach((approvalStep) => {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (isReimbursementSerailized) {
|
|
252
|
-
pendingActivitiesList.push(...pendingActivities);
|
|
248
|
+
if (approvers.displayPendingApproverAsAdmin === true) {
|
|
249
|
+
return;
|
|
253
250
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
251
|
+
const pendingActivities = approvalStep.actorsActivity.filter((activity) => activity.activity === 'pending');
|
|
252
|
+
const sodDisplayAsAdmin = (0, helpers_1.isSodAdminFallbackEligibleForStep)(sodExcludedApproverUserId, isAdminFallbackApprover, approvalStep.actorsActivity);
|
|
253
|
+
const activitiesToShow = isReimbursementSerailized
|
|
254
|
+
? pendingActivities
|
|
255
|
+
: pendingActivities.slice(0, 1);
|
|
256
|
+
if (sodDisplayAsAdmin) {
|
|
257
|
+
approvers.displayPendingApproverAsAdmin = true;
|
|
258
|
+
return;
|
|
260
259
|
}
|
|
261
|
-
|
|
262
|
-
if (pendingActivitiesList.length > 0) {
|
|
263
|
-
pendingActivitiesList.forEach((activity) => {
|
|
260
|
+
activitiesToShow.forEach((activity) => {
|
|
264
261
|
const user = (0, userSelector_1.getUserByUserId)(userState, activity.userId);
|
|
265
262
|
if (user != null) {
|
|
266
263
|
approvers.users.push(user);
|
|
@@ -272,7 +269,7 @@ const getApproversOrRejectors = (reimbursement, entityApprovalStatusState, userS
|
|
|
272
269
|
}
|
|
273
270
|
}
|
|
274
271
|
});
|
|
275
|
-
}
|
|
272
|
+
});
|
|
276
273
|
}
|
|
277
274
|
}
|
|
278
275
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.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
|
"module": "lib/esm/index.js",
|