@zeniai/client-epic-state 4.14.80 → 4.14.81
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.
|
@@ -46,4 +46,4 @@ export interface ReimbursementView extends Reimbursement {
|
|
|
46
46
|
export declare const getRemiList: (state: RootState, currentTimePeriod: TimePeriod, isBulkActionFeatureEnabled: boolean) => RemiListReport;
|
|
47
47
|
export declare const getApproversOrRejectors: (reimbursement: Reimbursement, entityApprovalStatusState: EntityApprovalStatusState, userState: UserState) => Approvers;
|
|
48
48
|
export declare const getRemiListOnSort: (sortKey: ReimbursementViewSortKey, sortOrder: SortOrder, currentTab: RemiTabType, reimbursements: ReimbursementView[]) => ReimbursementView[];
|
|
49
|
-
export declare const getAllowedBulkActions: (selectedTab: RemiTabType, selectedSubTab: RemiSubTabType, isAllAwaitingMyApproval: boolean, isFirstBillProcessing: boolean,
|
|
49
|
+
export declare const getAllowedBulkActions: (selectedTab: RemiTabType, selectedSubTab: RemiSubTabType, isAllAwaitingMyApproval: boolean, isFirstBillProcessing: boolean, hasReimbursementFromOthersInBulkList: boolean) => BulkOperationType[];
|
|
@@ -85,6 +85,7 @@ const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
|
|
|
85
85
|
? checkIfBulkActionAllowed(remiListState.currentTab, remiListState.currentSubTab)
|
|
86
86
|
: false;
|
|
87
87
|
let firstSelectableRemi = undefined;
|
|
88
|
+
let hasReimbursementFromOthersInBulkList = false;
|
|
88
89
|
if (isBulkActionAllowed) {
|
|
89
90
|
reimbursementsDetailed = reimbursementsDetailed.map((transaction) => {
|
|
90
91
|
var _a, _b;
|
|
@@ -92,6 +93,11 @@ const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
|
|
|
92
93
|
if (isBulkActionAllowed) {
|
|
93
94
|
const isProcessing = (0, helpers_1.isBulkProcessing)((_a = transaction.bulkProcessingDetail) === null || _a === void 0 ? void 0 : _a.type);
|
|
94
95
|
const isError = ((_b = transaction.bulkProcessingDetail) === null || _b === void 0 ? void 0 : _b.type) === 'error';
|
|
96
|
+
if (hasReimbursementFromOthersInBulkList === false &&
|
|
97
|
+
remisSelectedForBulkAction.includes(transaction.id) &&
|
|
98
|
+
transaction.createdBy !== loggedInUserId) {
|
|
99
|
+
hasReimbursementFromOthersInBulkList = true;
|
|
100
|
+
}
|
|
95
101
|
const { isSelectableForBulkAction, isSelectableForBulkActionSelectAll, bulkSelectExceptionInfo, } = isProcessing || isError
|
|
96
102
|
? {
|
|
97
103
|
isSelectableForBulkAction: false,
|
|
@@ -112,10 +118,9 @@ const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
|
|
|
112
118
|
});
|
|
113
119
|
const allBulkRemisAwaitingMyApproval = (0, difference_1.default)(remisSelectedForBulkAction, pendingApprovalTransactionIDs)
|
|
114
120
|
.length === 0;
|
|
115
|
-
const hasReimbursementFromOthers = reimbursementsDetailed.some((remi) => remi.createdBy !== loggedInUserId);
|
|
116
121
|
const allowedBulkActions = isBulkActionAllowed
|
|
117
122
|
? (0, exports.getAllowedBulkActions)(remiListState.currentTab, remiListState.currentSubTab, allBulkRemisAwaitingMyApproval, (firstRemiInBulkList === null || firstRemiInBulkList === void 0 ? void 0 : firstRemiInBulkList.reimbursementInfo.billPaymentStatus.code) ===
|
|
118
|
-
'processing',
|
|
123
|
+
'processing', hasReimbursementFromOthersInBulkList)
|
|
119
124
|
: [];
|
|
120
125
|
remiListBulkActionInfo = {
|
|
121
126
|
isBulkActionAllowed,
|
|
@@ -511,10 +516,10 @@ const isRemiSelectableForBulkAction = (reimbursement, selectedTab, firstSelectab
|
|
|
511
516
|
}
|
|
512
517
|
return result;
|
|
513
518
|
};
|
|
514
|
-
const getAllowedBulkActions = (selectedTab, selectedSubTab, isAllAwaitingMyApproval, isFirstBillProcessing,
|
|
519
|
+
const getAllowedBulkActions = (selectedTab, selectedSubTab, isAllAwaitingMyApproval, isFirstBillProcessing, hasReimbursementFromOthersInBulkList) => {
|
|
515
520
|
switch (selectedTab) {
|
|
516
521
|
case 'draft':
|
|
517
|
-
return
|
|
522
|
+
return hasReimbursementFromOthersInBulkList
|
|
518
523
|
? ['delete']
|
|
519
524
|
: ['send_for_approval', 'delete'];
|
|
520
525
|
case 'pending_approval': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.81",
|
|
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",
|