@zeniai/client-epic-state 4.12.20 → 4.12.21
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/chargeCardTransaction/chargeCardTransaction.d.ts +0 -2
- package/lib/entity/chargeCardTransaction/chargeCardTransactionPayload.d.ts +0 -5
- package/lib/entity/chargeCardTransaction/chargeCardTransactionPayload.js +2 -4
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +2 -6
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +2 -8
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/entity/task/taskState.d.ts +3 -0
- package/lib/entity/task/taskState.js +13 -0
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/epic.d.ts +1 -4
- package/lib/epic.js +1 -4
- package/lib/index.d.ts +16 -18
- package/lib/index.js +5 -17
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
- package/lib/view/globalMerchantView/epics/fetchGlobalMerchantRecommendationEpic.d.ts +3 -3
- package/lib/view/globalMerchantView/epics/fetchGlobalMerchantRecommendationEpic.js +4 -20
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -5
- package/lib/view/globalMerchantView/globalMerchantViewReducer.js +3 -8
- package/lib/view/globalMerchantView/globalMerchantViewSelector.d.ts +1 -1
- package/lib/view/globalMerchantView/globalMerchantViewSelector.js +5 -6
- package/lib/view/globalMerchantView/globalMerchantViewState.d.ts +0 -1
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +0 -4
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +0 -9
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +0 -4
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +4 -10
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +29 -82
- package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +2 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +0 -6
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +0 -9
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +0 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -11
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +2 -20
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +0 -5
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +2 -27
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +4 -77
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +0 -8
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +2 -19
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionListEpic.js +1 -3
- package/lib/view/spendManagement/reimbursement/editRemiView/editRemiViewReducer.js +2 -4
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/taskDetail.js +1 -1
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.d.ts +0 -23
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.js +2 -3
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +0 -5
- package/lib/view/taskManager/taskListView/taskListReducer.js +3 -64
- package/lib/view/vendorReviewView/common/state/commonTypes.d.ts +1 -2
- package/lib/view/vendorReviewView/common/state/commonTypes.js +4 -4
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.d.ts +1 -7
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.js +1 -11
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.d.ts +4 -14
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +49 -57
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.d.ts +0 -10
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.js +1 -21
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.d.ts +2 -20
- package/lib/view/vendorReviewView/vendorGlobalReviewView/epics/fetchVendorGlobalReviewViewEpic.js +4 -4
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewPayload.d.ts +1 -1
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewPayload.js +2 -2
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewReducer.d.ts +1 -6
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewReducer.js +6 -18
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewSelector.d.ts +1 -3
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewSelector.js +5 -7
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.d.ts +1 -9
- package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewState.js +2 -2
- package/package.json +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionAttachmentsEpic.d.ts +0 -10
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionAttachmentsEpic.js +0 -42
- package/lib/view/taskManager/taskListView/updateTaskFromListViewEpic.d.ts +0 -8
- package/lib/view/taskManager/taskListView/updateTaskFromListViewEpic.js +0 -38
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorDetailsViewEpic.d.ts +0 -8
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorDetailsViewEpic.js +0 -62
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.updateVendorFirstReviewViewTransactionAttachmentsFailure = exports.updateVendorFirstReviewViewTransactionAttachments = exports.saveVendorFirstReviewViewSuccessOrFailure = exports.clearRecentlySavedErroredVendorData = exports.updateRecentlySavedErroredVendorData = exports.resetVendorFirstReviewLocalData = exports.updateVendorFirstReviewViewLocalData = exports.initializeVendorFirstReviewViewLocalData = exports.updateVendorFirstReviewSortUiState = exports.saveVendorFirstReviewView = exports.updateVendorFirstReviewViewPageToken = exports.updateVendorFirstReviewViewScrollYOffset = exports.clearVendorReviewView = exports.updateVendorFirstReviewViewFailure = exports.updateSavedVendorFirstReviewViewLocalData = exports.fetchVendorFirstReviewView = exports.fetchVendorFirstReviewAttachments = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const commonTypes_1 = require("../common/state/commonTypes");
|
|
7
7
|
const attachmentPayload_1 = require("../../../entity/transaction/payloadTypes/attachmentPayload");
|
|
@@ -22,7 +22,6 @@ exports.initialState = {
|
|
|
22
22
|
fetchState: 'Not-Started',
|
|
23
23
|
error: undefined,
|
|
24
24
|
},
|
|
25
|
-
vendorLocalData: null,
|
|
26
25
|
hasValidState() {
|
|
27
26
|
return this.fetchState == 'Completed';
|
|
28
27
|
},
|
|
@@ -74,7 +73,7 @@ const vendorFirstReviewView = (0, toolkit_1.createSlice)({
|
|
|
74
73
|
},
|
|
75
74
|
},
|
|
76
75
|
updateVendorFirstReviewSortUiState(draft, action) {
|
|
77
|
-
draft.uiState = Object.assign(Object.assign({}, draft.uiState), { sortKey: action.payload.
|
|
76
|
+
draft.uiState = Object.assign(Object.assign({}, draft.uiState), { sortKey: action.payload.sortkey, sortOrder: action.payload.sortOrder });
|
|
78
77
|
},
|
|
79
78
|
updateVendorFirstReviewViewPageToken(draft, action) {
|
|
80
79
|
draft.uiState = Object.assign(Object.assign({}, draft.uiState), { pageToken: action.payload.pageToken });
|
|
@@ -94,17 +93,48 @@ const vendorFirstReviewView = (0, toolkit_1.createSlice)({
|
|
|
94
93
|
draft.uiState = Object.assign(Object.assign({}, draft.uiState), { pageToken: (_a = query === null || query === void 0 ? void 0 : query.page_token) !== null && _a !== void 0 ? _a : null, totalCount: total_count });
|
|
95
94
|
},
|
|
96
95
|
updateVendorFirstReviewViewLocalData(draft, action) {
|
|
96
|
+
var _a, _b, _c;
|
|
97
97
|
const { vendorId, vendorRenamedText, selectedGlobalMerchantId, currentSelection, } = action.payload;
|
|
98
98
|
if (draft.vendorFirstReviewViewLocalDataById[vendorId]
|
|
99
99
|
.vendorFirstReviewViewLocalData != null) {
|
|
100
100
|
const vendorLocalData = draft.vendorFirstReviewViewLocalDataById[vendorId]
|
|
101
101
|
.vendorFirstReviewViewLocalData;
|
|
102
|
-
if (vendorRenamedText != null) {
|
|
103
|
-
|
|
102
|
+
if (selectedGlobalMerchantId != null || vendorRenamedText != null) {
|
|
103
|
+
let currentSelection = vendorRenamedText != null ? 'rename' : null;
|
|
104
|
+
if (selectedGlobalMerchantId != null) {
|
|
105
|
+
const isRecommendationSelected = selectedGlobalMerchantId != null &&
|
|
106
|
+
(selectedGlobalMerchantId ===
|
|
107
|
+
vendorLocalData.recommendationIds[0] ||
|
|
108
|
+
(vendorLocalData.recommendationIds.length === 0 &&
|
|
109
|
+
selectedGlobalMerchantId ===
|
|
110
|
+
((_a = vendorLocalData.recommendedNonExistingGlobalMerchants[0]) === null || _a === void 0 ? void 0 : _a.globalMerchantName)));
|
|
111
|
+
const isRetainSelected = selectedGlobalMerchantId != null &&
|
|
112
|
+
selectedGlobalMerchantId === vendorLocalData.vendorId;
|
|
113
|
+
currentSelection =
|
|
114
|
+
isRecommendationSelected === true
|
|
115
|
+
? 'update'
|
|
116
|
+
: isRetainSelected === true
|
|
117
|
+
? 'retain'
|
|
118
|
+
: 'custom_merchant';
|
|
119
|
+
}
|
|
120
|
+
draft.vendorFirstReviewViewLocalDataById[vendorId].vendorFirstReviewViewLocalData = Object.assign(Object.assign({}, vendorLocalData), { selectedVendorId: selectedGlobalMerchantId !== null && selectedGlobalMerchantId !== void 0 ? selectedGlobalMerchantId : vendorLocalData.vendorId, currentSelection,
|
|
104
121
|
vendorRenamedText });
|
|
105
122
|
}
|
|
106
123
|
else {
|
|
107
|
-
|
|
124
|
+
let updateSelectedGlobalMerchantId;
|
|
125
|
+
const { isRetainSelected, isUpdateSelected, bothRetainAndUpdateUnSelected, } = getCurrentSelectionStatus(vendorLocalData.currentSelection, currentSelection);
|
|
126
|
+
if (bothRetainAndUpdateUnSelected || isRetainSelected) {
|
|
127
|
+
updateSelectedGlobalMerchantId = vendorLocalData.vendorId;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
updateSelectedGlobalMerchantId =
|
|
131
|
+
(_b = vendorLocalData.recommendationIds[0]) !== null && _b !== void 0 ? _b : (_c = vendorLocalData.recommendedNonExistingGlobalMerchants[0]) === null || _c === void 0 ? void 0 : _c.globalMerchantName;
|
|
132
|
+
}
|
|
133
|
+
draft.vendorFirstReviewViewLocalDataById[vendorId].vendorFirstReviewViewLocalData = Object.assign(Object.assign({}, vendorLocalData), { vendorRenamedText: undefined, selectedVendorId: updateSelectedGlobalMerchantId, currentSelection: isRetainSelected
|
|
134
|
+
? 'retain'
|
|
135
|
+
: isUpdateSelected
|
|
136
|
+
? 'update'
|
|
137
|
+
: null });
|
|
108
138
|
}
|
|
109
139
|
}
|
|
110
140
|
},
|
|
@@ -182,52 +212,6 @@ const vendorFirstReviewView = (0, toolkit_1.createSlice)({
|
|
|
182
212
|
};
|
|
183
213
|
}
|
|
184
214
|
},
|
|
185
|
-
updateReviewVendorDetailLocalData(draft, action) {
|
|
186
|
-
const { vendorDetails } = action.payload;
|
|
187
|
-
const { id, qboId, websiteUrl, name, recommendationIds, recommendedNonExistingGlobalMerchants, } = vendorDetails;
|
|
188
|
-
draft.vendorLocalData = {
|
|
189
|
-
vendorDetails: {
|
|
190
|
-
id,
|
|
191
|
-
qboId,
|
|
192
|
-
name,
|
|
193
|
-
websiteUrl,
|
|
194
|
-
recommendationIds,
|
|
195
|
-
recommendedNonExistingGlobalMerchants,
|
|
196
|
-
},
|
|
197
|
-
saveStatus: { fetchState: 'Not-Started', error: undefined },
|
|
198
|
-
};
|
|
199
|
-
},
|
|
200
|
-
updateVendorDetailRecommendations(draft, action) {
|
|
201
|
-
const { recommendationIds, recommendedNonExistingGlobalMerchants } = action.payload;
|
|
202
|
-
if (draft.vendorLocalData != null) {
|
|
203
|
-
draft.vendorLocalData.vendorDetails.recommendationIds =
|
|
204
|
-
recommendationIds;
|
|
205
|
-
draft.vendorLocalData.vendorDetails.recommendedNonExistingGlobalMerchants =
|
|
206
|
-
recommendedNonExistingGlobalMerchants;
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
saveVendorDetailsView(draft) {
|
|
210
|
-
if (draft.vendorLocalData != null) {
|
|
211
|
-
draft.vendorLocalData = Object.assign(Object.assign({}, draft.vendorLocalData), { saveStatus: {
|
|
212
|
-
fetchState: 'In-Progress',
|
|
213
|
-
error: undefined,
|
|
214
|
-
} });
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
updateVendorDetailsViewFailureOrSuccess(draft, action) {
|
|
218
|
-
const { vendorId, fetchState, error } = action.payload;
|
|
219
|
-
if (draft.vendorLocalData != null) {
|
|
220
|
-
draft.vendorLocalData.saveStatus = {
|
|
221
|
-
fetchState: fetchState,
|
|
222
|
-
error: error,
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
if (fetchState === 'Completed') {
|
|
226
|
-
const vendorReviewViewLocalData = draft.vendorFirstReviewViewLocalDataById[vendorId]
|
|
227
|
-
.vendorFirstReviewViewLocalData;
|
|
228
|
-
draft.vendorFirstReviewViewLocalDataById[vendorId].vendorFirstReviewViewLocalData = Object.assign(Object.assign({}, vendorReviewViewLocalData), { isWebsiteUrlSaved: true });
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
215
|
clearRecentlySavedErroredVendorData(draft) {
|
|
232
216
|
draft.recentlySavedErroredVendorData = undefined;
|
|
233
217
|
},
|
|
@@ -267,6 +251,16 @@ const vendorFirstReviewView = (0, toolkit_1.createSlice)({
|
|
|
267
251
|
},
|
|
268
252
|
},
|
|
269
253
|
});
|
|
254
|
+
const getCurrentSelectionStatus = (stateCurrentSelection, currentSelection) => {
|
|
255
|
+
const isRetainSelected = stateCurrentSelection !== 'retain' && currentSelection.retain;
|
|
256
|
+
const isUpdateSelected = stateCurrentSelection !== 'update' && currentSelection.update;
|
|
257
|
+
const bothRetainAndUpdateUnSelected = !currentSelection.retain && !currentSelection.update;
|
|
258
|
+
return {
|
|
259
|
+
isRetainSelected,
|
|
260
|
+
isUpdateSelected,
|
|
261
|
+
bothRetainAndUpdateUnSelected,
|
|
262
|
+
};
|
|
263
|
+
};
|
|
270
264
|
const toVendorReviewViewUpdatedVendorLocalData = (vendorId, vendorPayload) => {
|
|
271
265
|
const vendorView = mapPayloadToVendorFirstReviewView(Object.assign(Object.assign({}, vendorPayload), { vendor_id: vendorId }));
|
|
272
266
|
return vendorView;
|
|
@@ -299,17 +293,15 @@ const mapPayloadToVendorFirstReviewView = (payload) => {
|
|
|
299
293
|
recommendationIds,
|
|
300
294
|
recommendedNonExistingGlobalMerchants: nonExistingRecommendations,
|
|
301
295
|
lastUpdatedVendorNameByUserId: (_a = payload.last_updated_vendor_name_by_user) === null || _a === void 0 ? void 0 : _a.user_id,
|
|
302
|
-
/* merge_vendor_name can be an empty string from platform in cases other than `merge_in_qbo` status.
|
|
303
|
-
So, to avoid further string length checks, making this undefined.*/
|
|
304
296
|
mergeVendorName: payload.merge_vendor_name != null && payload.merge_vendor_name.length > 0
|
|
305
297
|
? payload.merge_vendor_name
|
|
306
298
|
: undefined,
|
|
307
299
|
transactionAttachments: payload.transaction_attachments != null
|
|
308
300
|
? payload.transaction_attachments.map((attachmentPayload) => (0, attachmentPayload_1.toAttachment)(attachmentPayload))
|
|
309
301
|
: [],
|
|
310
|
-
|
|
311
|
-
|
|
302
|
+
/* merge_vendor_name can be an empty string from platform in cases other than `merge_in_qbo` status.
|
|
303
|
+
So, to avoid further string length checks, making this undefined.*/
|
|
312
304
|
};
|
|
313
305
|
};
|
|
314
|
-
_a = vendorFirstReviewView.actions, exports.fetchVendorFirstReviewAttachments = _a.fetchVendorFirstReviewAttachments, exports.fetchVendorFirstReviewView = _a.fetchVendorFirstReviewView, exports.updateSavedVendorFirstReviewViewLocalData = _a.updateSavedVendorFirstReviewViewLocalData, exports.updateVendorFirstReviewViewFailure = _a.updateVendorFirstReviewViewFailure, exports.clearVendorReviewView = _a.clearVendorReviewView, exports.updateVendorFirstReviewViewScrollYOffset = _a.updateVendorFirstReviewViewScrollYOffset, exports.updateVendorFirstReviewViewPageToken = _a.updateVendorFirstReviewViewPageToken, exports.saveVendorFirstReviewView = _a.saveVendorFirstReviewView, exports.updateVendorFirstReviewSortUiState = _a.updateVendorFirstReviewSortUiState, exports.initializeVendorFirstReviewViewLocalData = _a.initializeVendorFirstReviewViewLocalData, exports.updateVendorFirstReviewViewLocalData = _a.updateVendorFirstReviewViewLocalData, exports.resetVendorFirstReviewLocalData = _a.resetVendorFirstReviewLocalData, exports.updateRecentlySavedErroredVendorData = _a.updateRecentlySavedErroredVendorData, exports.clearRecentlySavedErroredVendorData = _a.clearRecentlySavedErroredVendorData, exports.saveVendorFirstReviewViewSuccessOrFailure = _a.saveVendorFirstReviewViewSuccessOrFailure, exports.updateVendorFirstReviewViewTransactionAttachments = _a.updateVendorFirstReviewViewTransactionAttachments, exports.updateVendorFirstReviewViewTransactionAttachmentsFailure = _a.updateVendorFirstReviewViewTransactionAttachmentsFailure
|
|
306
|
+
_a = vendorFirstReviewView.actions, exports.fetchVendorFirstReviewAttachments = _a.fetchVendorFirstReviewAttachments, exports.fetchVendorFirstReviewView = _a.fetchVendorFirstReviewView, exports.updateSavedVendorFirstReviewViewLocalData = _a.updateSavedVendorFirstReviewViewLocalData, exports.updateVendorFirstReviewViewFailure = _a.updateVendorFirstReviewViewFailure, exports.clearVendorReviewView = _a.clearVendorReviewView, exports.updateVendorFirstReviewViewScrollYOffset = _a.updateVendorFirstReviewViewScrollYOffset, exports.updateVendorFirstReviewViewPageToken = _a.updateVendorFirstReviewViewPageToken, exports.saveVendorFirstReviewView = _a.saveVendorFirstReviewView, exports.updateVendorFirstReviewSortUiState = _a.updateVendorFirstReviewSortUiState, exports.initializeVendorFirstReviewViewLocalData = _a.initializeVendorFirstReviewViewLocalData, exports.updateVendorFirstReviewViewLocalData = _a.updateVendorFirstReviewViewLocalData, exports.resetVendorFirstReviewLocalData = _a.resetVendorFirstReviewLocalData, exports.updateRecentlySavedErroredVendorData = _a.updateRecentlySavedErroredVendorData, exports.clearRecentlySavedErroredVendorData = _a.clearRecentlySavedErroredVendorData, exports.saveVendorFirstReviewViewSuccessOrFailure = _a.saveVendorFirstReviewViewSuccessOrFailure, exports.updateVendorFirstReviewViewTransactionAttachments = _a.updateVendorFirstReviewViewTransactionAttachments, exports.updateVendorFirstReviewViewTransactionAttachmentsFailure = _a.updateVendorFirstReviewViewTransactionAttachmentsFailure;
|
|
315
307
|
exports.default = vendorFirstReviewView.reducer;
|
|
@@ -27,7 +27,6 @@ export interface VendorFirstReviewSelectorView {
|
|
|
27
27
|
status: ReviewStatus;
|
|
28
28
|
lastUpdatedVendorNameByUser?: User;
|
|
29
29
|
mergeVendorName: string | undefined;
|
|
30
|
-
isWebsiteUrlSaved: boolean;
|
|
31
30
|
saveStatus: FetchStateAndError;
|
|
32
31
|
attachmentFetchStatus: FetchStateAndError;
|
|
33
32
|
recommendations: RecommendedNonExistingGlobalMerchant[];
|
|
@@ -40,19 +39,10 @@ interface RecentlySavedErroredVendorView {
|
|
|
40
39
|
oldRecommendedVendor?: RecommendedNonExistingGlobalMerchant;
|
|
41
40
|
newRecommendedVendor?: RecommendedNonExistingGlobalMerchant;
|
|
42
41
|
}
|
|
43
|
-
export interface FirstReviewVendorDetailSelectorView {
|
|
44
|
-
id?: ID;
|
|
45
|
-
qboId?: ID;
|
|
46
|
-
name?: string;
|
|
47
|
-
websiteUrl?: ZeniUrl;
|
|
48
|
-
recommendations: RecommendedNonExistingGlobalMerchant[];
|
|
49
|
-
saveStatus: FetchStateAndError;
|
|
50
|
-
}
|
|
51
42
|
export declare const getVendorFirstReviewView: (state: RootState) => VendorFirstReviewViewSelectorView;
|
|
52
43
|
export interface VendorFirstReviewSelectorAttachmentView {
|
|
53
44
|
attachmentFetchStatus: FetchStateAndError;
|
|
54
45
|
transactionAttachments: Attachment[];
|
|
55
46
|
}
|
|
56
47
|
export declare const getVendorFirstReviewAttachmentView: (state: RootState, vendorId: ID) => VendorFirstReviewSelectorAttachmentView | undefined;
|
|
57
|
-
export declare const getVendorDetailSelectorView: (state: RootState) => FirstReviewVendorDetailSelectorView;
|
|
58
48
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getVendorFirstReviewAttachmentView = exports.getVendorFirstReviewView = void 0;
|
|
4
4
|
const globalMerchantSelector_1 = require("../../../entity/globalMerchant/globalMerchantSelector");
|
|
5
5
|
const userSelector_1 = require("../../../entity/user/userSelector");
|
|
6
6
|
const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
@@ -63,7 +63,6 @@ const getVendorFirstReviewView = (state) => {
|
|
|
63
63
|
recommendations,
|
|
64
64
|
currentSelection: vendorLocalData.currentSelection,
|
|
65
65
|
mergeVendorName: vendorLocalData.mergeVendorName,
|
|
66
|
-
isWebsiteUrlSaved: vendorLocalData.isWebsiteUrlSaved,
|
|
67
66
|
transactionAttachments,
|
|
68
67
|
};
|
|
69
68
|
});
|
|
@@ -111,22 +110,3 @@ const getVendorFirstReviewAttachmentView = (state, vendorId) => {
|
|
|
111
110
|
};
|
|
112
111
|
};
|
|
113
112
|
exports.getVendorFirstReviewAttachmentView = getVendorFirstReviewAttachmentView;
|
|
114
|
-
const getVendorDetailSelectorView = (state) => {
|
|
115
|
-
var _a, _b, _c;
|
|
116
|
-
const { vendorFirstReviewViewState, globalMerchantState } = state;
|
|
117
|
-
const { vendorLocalData } = vendorFirstReviewViewState;
|
|
118
|
-
let recommendations = (0, globalMerchantSelector_1.getGlobalMerchantsByMerchantIds)(globalMerchantState, (_a = vendorLocalData === null || vendorLocalData === void 0 ? void 0 : vendorLocalData.vendorDetails.recommendationIds) !== null && _a !== void 0 ? _a : []);
|
|
119
|
-
recommendations = [
|
|
120
|
-
...recommendations,
|
|
121
|
-
...((_b = vendorLocalData === null || vendorLocalData === void 0 ? void 0 : vendorLocalData.vendorDetails.recommendedNonExistingGlobalMerchants) !== null && _b !== void 0 ? _b : []),
|
|
122
|
-
];
|
|
123
|
-
return {
|
|
124
|
-
id: vendorLocalData === null || vendorLocalData === void 0 ? void 0 : vendorLocalData.vendorDetails.id,
|
|
125
|
-
qboId: vendorLocalData === null || vendorLocalData === void 0 ? void 0 : vendorLocalData.vendorDetails.qboId,
|
|
126
|
-
name: vendorLocalData === null || vendorLocalData === void 0 ? void 0 : vendorLocalData.vendorDetails.name,
|
|
127
|
-
websiteUrl: vendorLocalData === null || vendorLocalData === void 0 ? void 0 : vendorLocalData.vendorDetails.websiteUrl,
|
|
128
|
-
recommendations,
|
|
129
|
-
saveStatus: (_c = vendorLocalData === null || vendorLocalData === void 0 ? void 0 : vendorLocalData.saveStatus) !== null && _c !== void 0 ? _c : { fetchState: 'Not-Started' },
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
exports.getVendorDetailSelectorView = getVendorDetailSelectorView;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { FetchedState, FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
|
-
import ZeniUrl from '../../../zeniUrl';
|
|
3
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
4
3
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
4
|
import { GlobalMerchant } from '../../../entity/globalMerchant/globalMerchantState';
|
|
6
5
|
import { Attachment } from '../../../entity/transaction/stateTypes/attachment';
|
|
7
6
|
import { VendorReviewRowCurrentSelection, ReviewStatus } from '../common/state/commonTypes';
|
|
8
|
-
export interface
|
|
7
|
+
export interface CurrentSelectionByColumn {
|
|
9
8
|
retain: boolean;
|
|
10
|
-
|
|
11
|
-
recommendedSecond: boolean;
|
|
12
|
-
rename: boolean;
|
|
13
|
-
customMerchant: boolean;
|
|
9
|
+
update: boolean;
|
|
14
10
|
}
|
|
15
11
|
export declare const toVendorFirstReviewViewColumnKeyType: (v: string) => "action" | "status" | "vendor" | "retain" | "updateTo" | "ytd" | "viewTenantInvoice";
|
|
16
12
|
export declare type VendorFirstReviewViewColumnKey = ReturnType<typeof toVendorFirstReviewViewColumnKeyType>;
|
|
@@ -36,7 +32,6 @@ export interface VendorFirstReviewViewLocalData {
|
|
|
36
32
|
lastUpdatedVendorNameByUserId?: ID;
|
|
37
33
|
mergeVendorName: string | undefined;
|
|
38
34
|
transactionAttachments: Attachment[];
|
|
39
|
-
isWebsiteUrlSaved: boolean;
|
|
40
35
|
}
|
|
41
36
|
interface RecentlySavedErroredVendorData {
|
|
42
37
|
vendorId: ID;
|
|
@@ -52,20 +47,7 @@ export interface VendorFirstReviewViewState extends FetchedState {
|
|
|
52
47
|
vendorFirstReviewViewLocalDataById: Record<ID, VendorFirstReviewView>;
|
|
53
48
|
recentlySavedErroredVendorData?: RecentlySavedErroredVendorData;
|
|
54
49
|
uiState: VendorFirstReviewViewUIState;
|
|
55
|
-
vendorLocalData: ReviewVendorViewLocalData | null;
|
|
56
50
|
attachmentFetchStatus: FetchStateAndError;
|
|
57
51
|
transactionAttachmentsByVendorId: Record<ID, Attachment[]>;
|
|
58
52
|
}
|
|
59
|
-
export interface VendorViewLocalData {
|
|
60
|
-
id: ID;
|
|
61
|
-
qboId: ID;
|
|
62
|
-
name: string;
|
|
63
|
-
websiteUrl?: ZeniUrl;
|
|
64
|
-
recommendationIds: ID[];
|
|
65
|
-
recommendedNonExistingGlobalMerchants: RecommendedNonExistingGlobalMerchant[];
|
|
66
|
-
}
|
|
67
|
-
export interface ReviewVendorViewLocalData {
|
|
68
|
-
vendorDetails: VendorViewLocalData;
|
|
69
|
-
saveStatus: FetchStateAndError;
|
|
70
|
-
}
|
|
71
53
|
export {};
|
package/lib/view/vendorReviewView/vendorGlobalReviewView/epics/fetchVendorGlobalReviewViewEpic.js
CHANGED
|
@@ -83,10 +83,10 @@ const mapGlobalReviewPayloadToGlobalMerchantsBasePayload = (vendorsResponse) =>
|
|
|
83
83
|
exports.mapGlobalReviewPayloadToGlobalMerchantsBasePayload = mapGlobalReviewPayloadToGlobalMerchantsBasePayload;
|
|
84
84
|
const toVendorGlobalReviewSortByKey = (columnKey) => {
|
|
85
85
|
switch (columnKey) {
|
|
86
|
-
case '
|
|
87
|
-
return '
|
|
88
|
-
case '
|
|
89
|
-
return '
|
|
86
|
+
case 'updatedFrom':
|
|
87
|
+
return 'old_merchant_name';
|
|
88
|
+
case 'vendors':
|
|
89
|
+
return 'merchant_name';
|
|
90
90
|
case 'recommended':
|
|
91
91
|
return 'recommended_global_merchant_name';
|
|
92
92
|
case 'tenants':
|
|
@@ -4,7 +4,7 @@ import { VendorReviewViewAllRecommendationsPayload } from '../common/payload/com
|
|
|
4
4
|
export interface VendorGlobalReviewPayload extends TenantMerchantPayload {
|
|
5
5
|
recommendations: VendorReviewViewAllRecommendationsPayload;
|
|
6
6
|
}
|
|
7
|
-
export declare const toVendorGlobalReviewSortByKeyType: (v: string) => "recommended_global_merchant_name" | "
|
|
7
|
+
export declare const toVendorGlobalReviewSortByKeyType: (v: string) => "recommended_global_merchant_name" | "old_merchant_name" | "merchant_name" | "tenant_name";
|
|
8
8
|
export declare type VendorGlobalReviewViewSortByKey = ReturnType<typeof toVendorGlobalReviewSortByKeyType>;
|
|
9
9
|
export interface VendorGlobalReviewViewQueryPayload {
|
|
10
10
|
entity_type: string;
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.toVendorGlobalReviewSortByKeyType = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
5
|
const VENDOR_GLOBAL_REVIEW_SORT_BY_KEYS = [
|
|
6
|
-
'
|
|
7
|
-
'
|
|
6
|
+
'old_merchant_name',
|
|
7
|
+
'merchant_name',
|
|
8
8
|
'tenant_name',
|
|
9
9
|
'recommended_global_merchant_name',
|
|
10
10
|
];
|
|
@@ -3,7 +3,6 @@ import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport
|
|
|
3
3
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
4
4
|
import { VendorGlobalReviewPayload, VendorGlobalReviewViewQueryPayload } from './vendorGlobalReviewViewPayload';
|
|
5
5
|
import { VendorGlobalReviewViewState, VendorGlobalReviewViewUIState } from './vendorGlobalReviewViewState';
|
|
6
|
-
import { GlobalVendorReviewRowCurrentSelection } from '../common/state/commonTypes';
|
|
7
6
|
export declare const initialState: VendorGlobalReviewViewState;
|
|
8
7
|
export declare const fetchVendorGlobalReviewView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[searchString?: string | undefined, keepExistingListItems?: any, pageToken?: PageToken | undefined], {
|
|
9
8
|
searchString: string | undefined;
|
|
@@ -30,10 +29,6 @@ export declare const fetchVendorGlobalReviewView: import("@reduxjs/toolkit").Act
|
|
|
30
29
|
}, string>, rejectVendorGlobalReviewFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
31
30
|
merchantId: ID;
|
|
32
31
|
status: ZeniAPIStatus;
|
|
33
|
-
}, string>, rejectVendorGlobalReviewSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, clearVendorGlobalReviewView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string
|
|
34
|
-
merchantId: ID;
|
|
35
|
-
currentSelection: GlobalVendorReviewRowCurrentSelection;
|
|
36
|
-
customMerchantId?: string | undefined;
|
|
37
|
-
}, string>;
|
|
32
|
+
}, string>, rejectVendorGlobalReviewSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, clearVendorGlobalReviewView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
38
33
|
declare const _default: import("@reduxjs/toolkit").Reducer<VendorGlobalReviewViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
39
34
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.clearVendorGlobalReviewView = exports.rejectVendorGlobalReviewSuccess = exports.rejectVendorGlobalReviewFailure = exports.approveVendorGlobalReviewFailure = exports.approveVendorGlobalReviewSuccess = exports.rejectVendorGlobalReview = exports.approveVendorGlobalReview = exports.updateSelectedGlobalMerchant = exports.updateVendorGlobalReviewViewUIState = exports.initializeVendorGlobalReviewViewLocalData = exports.fetchVendorGlobalReviewViewFailure = exports.fetchVendorGlobalReviewViewSuccess = exports.fetchVendorGlobalReviewView = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const vendorGlobalReviewViewPayload_1 = require("./vendorGlobalReviewViewPayload");
|
|
7
7
|
const commonTypes_1 = require("../common/state/commonTypes");
|
|
@@ -153,17 +153,6 @@ const vendorGlobalReviewView = (0, toolkit_1.createSlice)({
|
|
|
153
153
|
error: status,
|
|
154
154
|
};
|
|
155
155
|
},
|
|
156
|
-
updateVendorGlobalReviewViewLocalData(draft, action) {
|
|
157
|
-
const { merchantId, customMerchantId, currentSelection } = action.payload;
|
|
158
|
-
if (draft.vendorGlobalByMerchantId[merchantId]
|
|
159
|
-
.vendorGlobalReviewViewLocalData != null) {
|
|
160
|
-
const vendorLocalData = draft.vendorGlobalByMerchantId[merchantId]
|
|
161
|
-
.vendorGlobalReviewViewLocalData;
|
|
162
|
-
draft.vendorGlobalByMerchantId[merchantId].vendorGlobalReviewViewLocalData = Object.assign(Object.assign({}, vendorLocalData), { selectedMerchantId: customMerchantId != null
|
|
163
|
-
? customMerchantId
|
|
164
|
-
: vendorLocalData.merchantId, currentSelection: currentSelection });
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
156
|
rejectVendorGlobalReview: {
|
|
168
157
|
reducer(draft, action) {
|
|
169
158
|
const { merchantId } = action.payload;
|
|
@@ -200,7 +189,7 @@ const vendorGlobalReviewView = (0, toolkit_1.createSlice)({
|
|
|
200
189
|
},
|
|
201
190
|
},
|
|
202
191
|
});
|
|
203
|
-
_a = vendorGlobalReviewView.actions, exports.fetchVendorGlobalReviewView = _a.fetchVendorGlobalReviewView, exports.fetchVendorGlobalReviewViewSuccess = _a.fetchVendorGlobalReviewViewSuccess, exports.fetchVendorGlobalReviewViewFailure = _a.fetchVendorGlobalReviewViewFailure, exports.initializeVendorGlobalReviewViewLocalData = _a.initializeVendorGlobalReviewViewLocalData, exports.updateVendorGlobalReviewViewUIState = _a.updateVendorGlobalReviewViewUIState, exports.updateSelectedGlobalMerchant = _a.updateSelectedGlobalMerchant, exports.approveVendorGlobalReview = _a.approveVendorGlobalReview, exports.rejectVendorGlobalReview = _a.rejectVendorGlobalReview, exports.approveVendorGlobalReviewSuccess = _a.approveVendorGlobalReviewSuccess, exports.approveVendorGlobalReviewFailure = _a.approveVendorGlobalReviewFailure, exports.rejectVendorGlobalReviewFailure = _a.rejectVendorGlobalReviewFailure, exports.rejectVendorGlobalReviewSuccess = _a.rejectVendorGlobalReviewSuccess, exports.clearVendorGlobalReviewView = _a.clearVendorGlobalReviewView
|
|
192
|
+
_a = vendorGlobalReviewView.actions, exports.fetchVendorGlobalReviewView = _a.fetchVendorGlobalReviewView, exports.fetchVendorGlobalReviewViewSuccess = _a.fetchVendorGlobalReviewViewSuccess, exports.fetchVendorGlobalReviewViewFailure = _a.fetchVendorGlobalReviewViewFailure, exports.initializeVendorGlobalReviewViewLocalData = _a.initializeVendorGlobalReviewViewLocalData, exports.updateVendorGlobalReviewViewUIState = _a.updateVendorGlobalReviewViewUIState, exports.updateSelectedGlobalMerchant = _a.updateSelectedGlobalMerchant, exports.approveVendorGlobalReview = _a.approveVendorGlobalReview, exports.rejectVendorGlobalReview = _a.rejectVendorGlobalReview, exports.approveVendorGlobalReviewSuccess = _a.approveVendorGlobalReviewSuccess, exports.approveVendorGlobalReviewFailure = _a.approveVendorGlobalReviewFailure, exports.rejectVendorGlobalReviewFailure = _a.rejectVendorGlobalReviewFailure, exports.rejectVendorGlobalReviewSuccess = _a.rejectVendorGlobalReviewSuccess, exports.clearVendorGlobalReviewView = _a.clearVendorGlobalReviewView;
|
|
204
193
|
exports.default = vendorGlobalReviewView.reducer;
|
|
205
194
|
/**
|
|
206
195
|
* Helpers
|
|
@@ -231,15 +220,14 @@ const mapPayloadToVendorGlobalReviewView = (payload) => {
|
|
|
231
220
|
tenantId: payload.tenant_id,
|
|
232
221
|
recommendationIds,
|
|
233
222
|
recommendedNonExistingGlobalMerchants: nonExistingRecommendations,
|
|
234
|
-
currentSelection: null,
|
|
235
223
|
};
|
|
236
224
|
};
|
|
237
225
|
const toVendorGlobalReviewColumnSortKey = (sortByKey) => {
|
|
238
226
|
switch (sortByKey) {
|
|
239
|
-
case '
|
|
240
|
-
return '
|
|
241
|
-
case '
|
|
242
|
-
return '
|
|
227
|
+
case 'old_merchant_name':
|
|
228
|
+
return 'updatedFrom';
|
|
229
|
+
case 'merchant_name':
|
|
230
|
+
return 'vendors';
|
|
243
231
|
case 'recommended_global_merchant_name':
|
|
244
232
|
return 'recommended';
|
|
245
233
|
case 'tenant_name':
|
package/lib/view/vendorReviewView/vendorGlobalReviewView/vendorGlobalReviewViewSelector.d.ts
CHANGED
|
@@ -5,14 +5,12 @@ import { GlobalMerchantAutoCompleteView } from '../../globalMerchantView/globalM
|
|
|
5
5
|
import { RootState } from '../../../reducer';
|
|
6
6
|
import { VendorGlobalReviewViewUIState } from './vendorGlobalReviewViewState';
|
|
7
7
|
import { RecommendedNonExistingGlobalMerchant } from '../vendorFirstReviewView/vendorFirstReviewViewState';
|
|
8
|
-
import { GlobalVendorReviewRowCurrentSelection } from '../common/state/commonTypes';
|
|
9
8
|
export interface VendorGlobalReview {
|
|
10
9
|
merchant: TenantMerchant;
|
|
11
10
|
selectedMerchantId: ID;
|
|
12
11
|
approveStatus: FetchStateAndError;
|
|
13
12
|
rejectStatus: FetchStateAndError;
|
|
14
|
-
|
|
15
|
-
currentSelection: GlobalVendorReviewRowCurrentSelection;
|
|
13
|
+
recommendedMerchant?: RecommendedNonExistingGlobalMerchant;
|
|
16
14
|
}
|
|
17
15
|
export interface VendorGlobalReviewViewSelectorView extends SelectorView {
|
|
18
16
|
vendorGlobalReviewData: VendorGlobalReview[];
|
|
@@ -15,18 +15,16 @@ exports.getVendorGlobalReviewView = (0, toolkit_1.createSelector)((state) => sta
|
|
|
15
15
|
.map((merchantData) => {
|
|
16
16
|
const { vendorGlobalReviewViewLocalData: vendorLocalData, approveStatus, rejectStatus, } = merchantData;
|
|
17
17
|
const { tenantId, merchantId, selectedMerchantId, recommendationIds, recommendedNonExistingGlobalMerchants, } = vendorLocalData;
|
|
18
|
-
|
|
18
|
+
const recommendations = (0, globalMerchantSelector_1.getGlobalMerchantsByMerchantIds)(globalMerchantState, recommendationIds);
|
|
19
19
|
const merchant = (0, globalMerchantSelector_1.getTenantMerchantByMerchantKey)(globalMerchantState, (0, globalMerchantState_1.getTenantMerchantKey)(tenantId, merchantId));
|
|
20
20
|
if (merchant != null) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
];
|
|
21
|
+
const recommendedMerchant = recommendations.length > 0
|
|
22
|
+
? recommendations[0]
|
|
23
|
+
: recommendedNonExistingGlobalMerchants[0];
|
|
25
24
|
return {
|
|
26
25
|
merchant,
|
|
27
26
|
selectedMerchantId,
|
|
28
|
-
|
|
29
|
-
currentSelection: merchantData.vendorGlobalReviewViewLocalData.currentSelection,
|
|
27
|
+
recommendedMerchant,
|
|
30
28
|
approveStatus,
|
|
31
29
|
rejectStatus,
|
|
32
30
|
};
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
|
-
import { GlobalVendorReviewRowCurrentSelection } from '../common/state/commonTypes';
|
|
5
4
|
import { RecommendedNonExistingGlobalMerchant } from '../vendorFirstReviewView/vendorFirstReviewViewState';
|
|
6
|
-
export declare const toVendorGlobalReviewColumnSortKeyType: (v: string) => "
|
|
5
|
+
export declare const toVendorGlobalReviewColumnSortKeyType: (v: string) => "vendors" | "recommended" | "tenants" | "updatedFrom";
|
|
7
6
|
export declare type VendorGlobalReviewViewColumnSortKey = ReturnType<typeof toVendorGlobalReviewColumnSortKeyType>;
|
|
8
|
-
export interface GlobalReviewPageCurrentSelectionByColumn {
|
|
9
|
-
requested: boolean;
|
|
10
|
-
recommendedFirst: boolean;
|
|
11
|
-
recommendedSecond: boolean;
|
|
12
|
-
originalVendor: boolean;
|
|
13
|
-
}
|
|
14
7
|
export interface VendorGlobalReviewViewUIState {
|
|
15
8
|
searchText: string;
|
|
16
9
|
sortKey: VendorGlobalReviewViewColumnSortKey;
|
|
@@ -26,7 +19,6 @@ export interface VendorGlobalReviewViewLocalData {
|
|
|
26
19
|
tenantId: ID;
|
|
27
20
|
recommendationIds: ID[];
|
|
28
21
|
recommendedNonExistingGlobalMerchants: RecommendedNonExistingGlobalMerchant[];
|
|
29
|
-
currentSelection: GlobalVendorReviewRowCurrentSelection;
|
|
30
22
|
}
|
|
31
23
|
export interface VendorGlobalReviewView {
|
|
32
24
|
vendorGlobalReviewViewLocalData: VendorGlobalReviewViewLocalData;
|
|
@@ -4,9 +4,9 @@ exports.toVendorGlobalReviewColumnSortKeyType = void 0;
|
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
5
|
const VENDOR_GLOBAL_REVIEW_COLUMN_SORT_KEYS = [
|
|
6
6
|
'tenants',
|
|
7
|
-
'
|
|
7
|
+
'vendors',
|
|
8
|
+
'updatedFrom',
|
|
8
9
|
'recommended',
|
|
9
|
-
'requestedVendor',
|
|
10
10
|
];
|
|
11
11
|
const toVendorGlobalReviewColumnSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, VENDOR_GLOBAL_REVIEW_COLUMN_SORT_KEYS);
|
|
12
12
|
exports.toVendorGlobalReviewColumnSortKeyType = toVendorGlobalReviewColumnSortKeyType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.21",
|
|
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",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
-
import { fetchChargeCardTransactionAttachments, updateChargeCardTransactionAttachmentsInCardDetail, updateChargeCardTransactionAttachmentsFailure } from './chargeCardDetailReducer';
|
|
6
|
-
export declare type ActionType = ReturnType<typeof fetchChargeCardTransactionAttachments> | ReturnType<typeof updateChargeCardTransactionAttachmentsInCardDetail> | ReturnType<typeof updateChargeCardTransactionAttachmentsFailure>;
|
|
7
|
-
export declare const fetchChargeCardTransactionAttachmentsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
8
|
-
export interface ChargeCardTransactionAttachmentQueryPayload {
|
|
9
|
-
attachment_ids: string[];
|
|
10
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchChargeCardTransactionAttachmentsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const chargeCardDetailReducer_1 = require("./chargeCardDetailReducer");
|
|
8
|
-
const fetchChargeCardTransactionAttachmentsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardDetailReducer_1.fetchChargeCardTransactionAttachments.match), (0, operators_1.switchMap)((action) => {
|
|
9
|
-
const { transactionId, cardId, attachmentIds } = action.payload;
|
|
10
|
-
let apiUrl = `${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards/transactions/${transactionId}/attachments`;
|
|
11
|
-
const queryParam = {
|
|
12
|
-
attachment_ids: attachmentIds,
|
|
13
|
-
};
|
|
14
|
-
apiUrl =
|
|
15
|
-
apiUrl + `?query=${encodeURIComponent(JSON.stringify(queryParam))}`;
|
|
16
|
-
return zeniAPI
|
|
17
|
-
.getJSON(apiUrl)
|
|
18
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
|
-
if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
|
|
20
|
-
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardTransactionAttachmentsInCardDetail)({
|
|
21
|
-
transactionId,
|
|
22
|
-
cardId,
|
|
23
|
-
transactionAttachments: response.data.attachments,
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardTransactionAttachmentsFailure)({
|
|
28
|
-
cardId,
|
|
29
|
-
transactionId,
|
|
30
|
-
status: response.status,
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
}), (0, operators_1.catchError)((error) => {
|
|
34
|
-
return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardTransactionAttachmentsFailure)({
|
|
35
|
-
cardId,
|
|
36
|
-
transactionId,
|
|
37
|
-
status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch charge card transaction attachments API call errored out' +
|
|
38
|
-
JSON.stringify(error)),
|
|
39
|
-
}));
|
|
40
|
-
}));
|
|
41
|
-
}));
|
|
42
|
-
exports.fetchChargeCardTransactionAttachmentsEpic = fetchChargeCardTransactionAttachmentsEpic;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../reducer';
|
|
4
|
-
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
-
import { updateTaskFromListView, updateTasksListOnUpdateTaskSuccess, updateTasksListOnUpdateTaskFailure } from './taskListReducer';
|
|
6
|
-
import { updateTasks } from '../../../entity/task/taskReducer';
|
|
7
|
-
export declare type ActionType = ReturnType<typeof updateTaskFromListView> | ReturnType<typeof updateTasks> | ReturnType<typeof updateTasksListOnUpdateTaskFailure> | ReturnType<typeof updateTasksListOnUpdateTaskSuccess>;
|
|
8
|
-
export declare const updateTaskFromListViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateTaskFromListViewEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
-
const taskListReducer_1 = require("./taskListReducer");
|
|
8
|
-
const taskReducer_1 = require("../../../entity/task/taskReducer");
|
|
9
|
-
const bulkUpdateTaskListEpic_1 = require("./bulkUpdateTaskListEpic");
|
|
10
|
-
const updateTaskFromListViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.updateTaskFromListView.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
const state = state$.value;
|
|
12
|
-
const { task, updates } = action.payload;
|
|
13
|
-
const taskId = task.id;
|
|
14
|
-
const payload = {
|
|
15
|
-
tasks: (0, bulkUpdateTaskListEpic_1.getTasksListPayload)(state, [taskId], updates),
|
|
16
|
-
};
|
|
17
|
-
return zeniAPI
|
|
18
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload)
|
|
19
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
20
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
21
|
-
return (0, rxjs_1.from)([
|
|
22
|
-
(0, taskReducer_1.updateTasks)(response.data.tasks),
|
|
23
|
-
(0, taskListReducer_1.updateTasksListOnUpdateTaskSuccess)(),
|
|
24
|
-
]);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return (0, rxjs_1.of)((0, taskListReducer_1.updateTasksListOnUpdateTaskFailure)({
|
|
28
|
-
error: response.status,
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
}), (0, operators_1.catchError)((error) => {
|
|
32
|
-
return (0, rxjs_1.of)((0, taskListReducer_1.updateTasksListOnUpdateTaskFailure)({
|
|
33
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'update task from list view REST API call errored out' +
|
|
34
|
-
JSON.stringify(error)),
|
|
35
|
-
}));
|
|
36
|
-
}));
|
|
37
|
-
}));
|
|
38
|
-
exports.updateTaskFromListViewEpic = updateTaskFromListViewEpic;
|
package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorDetailsViewEpic.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
3
|
-
import { RootState } from '../../../../reducer';
|
|
4
|
-
import { saveVendorDetailsView, updateVendorDetailsViewFailureOrSuccess } from '../vendorFirstReviewViewReducer';
|
|
5
|
-
import { updateVendors } from '../../../../entity/vendor/vendorReducer';
|
|
6
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
7
|
-
export declare type ActionType = ReturnType<typeof saveVendorDetailsView> | ReturnType<typeof updateVendors> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateVendorDetailsViewFailureOrSuccess>;
|
|
8
|
-
export declare const saveVendorDetailsViewEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|