@zeniai/client-epic-state 4.10.53 → 4.10.55
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/vendorExpense/vendorExpenseTrend.js +2 -1
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.js +2 -2
- package/lib/view/spendManagement/reimbursement/remiListView/fetchRemiListEpic.js +5 -5
- package/lib/view/spendManagement/reimbursement/remiListView/fetchRemiListPerTabEpic.js +2 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +4 -2
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.js +14 -4
- package/lib/view/vendorList/vendorListReducer.js +2 -2
- package/package.json +1 -1
|
@@ -139,7 +139,8 @@ const getYTDSpend = (months, firstMonthOfFY) => {
|
|
|
139
139
|
startYear = -1;
|
|
140
140
|
}
|
|
141
141
|
const startDate = (0, zeniDayJS_1.dateFromYearMonthDate)(startYear, firstMonthOfFY - 1, 1);
|
|
142
|
-
const YTDMonths = months.filter((month) => month.endDate.isAfter(startDate) &&
|
|
142
|
+
const YTDMonths = months.filter((month) => month.endDate.isAfter(startDate) &&
|
|
143
|
+
month.endDate.isSameOrBefore(currentDate));
|
|
143
144
|
return YTDMonths;
|
|
144
145
|
};
|
|
145
146
|
exports.getYTDSpend = getYTDSpend;
|
|
@@ -13,7 +13,7 @@ exports.initialVendorDetailLocalData = {
|
|
|
13
13
|
exports.initialState = {
|
|
14
14
|
vendorStateById: {},
|
|
15
15
|
selectedTabType: 'spend_transactions',
|
|
16
|
-
vendorSpendTrendFilterTabValue: '
|
|
16
|
+
vendorSpendTrendFilterTabValue: 'YTD_spend',
|
|
17
17
|
};
|
|
18
18
|
const vendorsTabVendorView = (0, toolkit_1.createSlice)({
|
|
19
19
|
name: 'vendorsTabVendorView',
|
|
@@ -28,7 +28,7 @@ const vendorsTabVendorView = (0, toolkit_1.createSlice)({
|
|
|
28
28
|
fetchState: 'Not-Started',
|
|
29
29
|
error: undefined,
|
|
30
30
|
} });
|
|
31
|
-
draft.vendorSpendTrendFilterTabValue = '
|
|
31
|
+
draft.vendorSpendTrendFilterTabValue = 'YTD_spend';
|
|
32
32
|
},
|
|
33
33
|
prepare(vendorId, cacheOverride = false) {
|
|
34
34
|
return { payload: { cacheOverride, vendorId } };
|
|
@@ -13,7 +13,7 @@ const reimbursementConfigReducer_1 = require("../reimbursementConfig/reimburseme
|
|
|
13
13
|
const fetchRemiListEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(remiListReducer_1.fetchRemiList.match), (0, operators_1.mergeMap)((action) => {
|
|
14
14
|
const fetchRemiListActions = [];
|
|
15
15
|
const state = state$.value;
|
|
16
|
-
const { period, cacheOverride, isShowDeletedReimbursementEnabled } = action.payload;
|
|
16
|
+
const { period, cacheOverride, isShowDeletedReimbursementEnabled, isIncludeLineItems, } = action.payload;
|
|
17
17
|
const tabIds = [
|
|
18
18
|
'draft',
|
|
19
19
|
'pending_approval',
|
|
@@ -22,7 +22,7 @@ const fetchRemiListEpic = (actions$, state$) => actions$.pipe((0, operators_1.fi
|
|
|
22
22
|
];
|
|
23
23
|
if (cacheOverride === true) {
|
|
24
24
|
fetchRemiListActions.push((0, reimbursementConfigReducer_1.fetchReimbursementConfig)());
|
|
25
|
-
tabIds.forEach((tab) => fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab, isShowDeletedReimbursementEnabled)));
|
|
25
|
+
tabIds.forEach((tab) => fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems)));
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
28
|
if (state.reimbursementConfigState.fetchState !== 'Completed' &&
|
|
@@ -31,9 +31,9 @@ const fetchRemiListEpic = (actions$, state$) => actions$.pipe((0, operators_1.fi
|
|
|
31
31
|
}
|
|
32
32
|
tabIds.forEach((tab) => {
|
|
33
33
|
const key = (0, remiListState_1.getRemiListKey)(period, tab);
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab, isShowDeletedReimbursementEnabled));
|
|
34
|
+
const remis = (0, get_1.default)(state.remiListState.byRemiListKey, key, undefined);
|
|
35
|
+
if (remis == null || remis.hasValidState() === false) {
|
|
36
|
+
fetchRemiListActions.push((0, remiListReducer_1.fetchRemiListPerTab)(period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems));
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
@@ -10,7 +10,7 @@ const reimbursementReducer_1 = require("../../../../entity/reimbursement/reimbur
|
|
|
10
10
|
const userReducer_1 = require("../../../../entity/user/userReducer");
|
|
11
11
|
const entityApprovalStatusReducer_1 = require("../../../../entity/entityApprovalStatus/entityApprovalStatusReducer");
|
|
12
12
|
const fetchRemiListPerTabEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiListReducer_1.fetchRemiListPerTab.match), (0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const { period, tab, isShowDeletedReimbursementEnabled } = action.payload;
|
|
13
|
+
const { period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems, } = action.payload;
|
|
14
14
|
const queryParam = {
|
|
15
15
|
start_date: (0, timePeriod_1.toString)(period.start),
|
|
16
16
|
end_date: (0, timePeriod_1.toString)(period.end),
|
|
@@ -25,6 +25,7 @@ const fetchRemiListPerTabEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0
|
|
|
25
25
|
is_include_deleted: isShowDeletedReimbursementEnabled
|
|
26
26
|
? tab !== 'draft'
|
|
27
27
|
: false,
|
|
28
|
+
is_include_line_items: isIncludeLineItems ? tab !== 'draft' : false,
|
|
28
29
|
};
|
|
29
30
|
return zeniAPI
|
|
30
31
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/reimbursements/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -4,14 +4,16 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
|
4
4
|
import { RemiListPayload } from './remiListPayload';
|
|
5
5
|
import { RemiListState, RemiTabType, SaveRemiStageCode, RemiListUIState, ReimbursementFilters, RemiListDownloadUIState } from './remiListState';
|
|
6
6
|
export declare const initialState: RemiListState;
|
|
7
|
-
export declare const fetchRemiList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, cacheOverride: any, isShowDeletedReimbursementEnabled: boolean], {
|
|
7
|
+
export declare const fetchRemiList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, cacheOverride: any, isShowDeletedReimbursementEnabled: boolean, isIncludeLineItems: boolean], {
|
|
8
8
|
period: TimePeriod;
|
|
9
9
|
cacheOverride: any;
|
|
10
10
|
isShowDeletedReimbursementEnabled: boolean;
|
|
11
|
-
|
|
11
|
+
isIncludeLineItems: boolean;
|
|
12
|
+
}, string, never, never>, fetchRemiListPerTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, tab: "paid" | "pending_approval" | "scheduled" | "draft", isShowDeletedReimbursementEnabled: boolean, isIncludeLineItems: boolean], {
|
|
12
13
|
period: TimePeriod;
|
|
13
14
|
tab: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
14
15
|
isShowDeletedReimbursementEnabled: boolean;
|
|
16
|
+
isIncludeLineItems: boolean;
|
|
15
17
|
}, string, never, never>, updateRemiListByStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
18
|
remiList: RemiListPayload;
|
|
17
19
|
tab: RemiTabType;
|
|
@@ -34,9 +34,14 @@ const remiList = (0, toolkit_1.createSlice)({
|
|
|
34
34
|
reducer() {
|
|
35
35
|
//do nothing
|
|
36
36
|
},
|
|
37
|
-
prepare(period, tab, isShowDeletedReimbursementEnabled) {
|
|
37
|
+
prepare(period, tab, isShowDeletedReimbursementEnabled, isIncludeLineItems) {
|
|
38
38
|
return {
|
|
39
|
-
payload: {
|
|
39
|
+
payload: {
|
|
40
|
+
period,
|
|
41
|
+
tab,
|
|
42
|
+
isShowDeletedReimbursementEnabled,
|
|
43
|
+
isIncludeLineItems,
|
|
44
|
+
},
|
|
40
45
|
};
|
|
41
46
|
},
|
|
42
47
|
},
|
|
@@ -63,9 +68,14 @@ const remiList = (0, toolkit_1.createSlice)({
|
|
|
63
68
|
: 'In-Progress', error: undefined });
|
|
64
69
|
});
|
|
65
70
|
},
|
|
66
|
-
prepare(period, cacheOverride = false, isShowDeletedReimbursementEnabled) {
|
|
71
|
+
prepare(period, cacheOverride = false, isShowDeletedReimbursementEnabled, isIncludeLineItems) {
|
|
67
72
|
return {
|
|
68
|
-
payload: {
|
|
73
|
+
payload: {
|
|
74
|
+
period,
|
|
75
|
+
cacheOverride,
|
|
76
|
+
isShowDeletedReimbursementEnabled,
|
|
77
|
+
isIncludeLineItems,
|
|
78
|
+
},
|
|
69
79
|
};
|
|
70
80
|
},
|
|
71
81
|
},
|
|
@@ -18,11 +18,11 @@ exports.initialState = {
|
|
|
18
18
|
},
|
|
19
19
|
lastRefreshSuccessTime: undefined,
|
|
20
20
|
uiState: {
|
|
21
|
-
sortKey: '
|
|
21
|
+
sortKey: 'year_to_date_spend',
|
|
22
22
|
sortOrder: 'descending',
|
|
23
23
|
pageToken: null,
|
|
24
24
|
scrollYOffset: 0,
|
|
25
|
-
ytdSpendSelection: '
|
|
25
|
+
ytdSpendSelection: 'year_to_date_spend',
|
|
26
26
|
},
|
|
27
27
|
fetchStateBillsTab: { fetchState: 'Not-Started', error: undefined },
|
|
28
28
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.55",
|
|
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",
|