@zeniai/client-epic-state 4.11.14 → 4.11.16
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/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -4
- package/lib/entity/task/taskPayload.d.ts +2 -2
- package/lib/entity/task/taskPayload.js +0 -1
- package/lib/entity/task/taskState.d.ts +0 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -4
- package/lib/entity/tenant/clearAllEpic.js +0 -6
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/entity/transaction/stateTypes/attachment.d.ts +0 -6
- package/lib/entity/transaction/stateTypes/transactionType.d.ts +0 -3
- package/lib/entity/transaction/stateTypes/transactionType.js +3 -7
- package/lib/entity/vendor/vendorPayload.d.ts +0 -2
- package/lib/entity/vendor/vendorPayload.js +1 -5
- package/lib/entity/vendor/vendorState.d.ts +0 -2
- package/lib/epic.d.ts +1 -8
- package/lib/epic.js +1 -8
- package/lib/index.d.ts +9 -12
- package/lib/index.js +3 -13
- package/lib/reducer.d.ts +0 -6
- package/lib/reducer.js +0 -6
- package/lib/view/companyView/selector/companyManagementViewSelector.js +7 -13
- package/lib/view/companyView/selector/companyPortfolioViewSelector.js +6 -1
- package/lib/view/fileView/fileUploadHelpers.d.ts +0 -5
- 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/reviewCompanyView/reviewCompanyViewSelector.js +9 -26
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/subscriptionView/subscriptionViewSelector.js +1 -5
- 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/epics/saveTaskDetailEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +4 -11
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +1 -2
- package/lib/view/taskManager/taskListView/fetchTaskListPageEpic.d.ts +1 -3
- package/lib/view/taskManager/taskListView/fetchTaskListPageEpic.js +0 -12
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -14
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +2 -31
- package/lib/view/taskManager/taskListView/taskListReducer.js +9 -136
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +2 -12
- package/lib/view/taskManager/taskListView/taskListSelector.js +23 -59
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +5 -22
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewViewEpic.js +0 -1
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorFirstReviewViewEpic.js +5 -11
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.d.ts +0 -15
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.d.ts +3 -13
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +3 -45
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.d.ts +0 -8
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.js +2 -17
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.d.ts +2 -6
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.js +1 -2
- package/package.json +1 -1
- package/lib/entity/taskGroup/taskGroupPayload.d.ts +0 -9
- package/lib/entity/taskGroup/taskGroupPayload.js +0 -14
- package/lib/entity/taskGroup/taskGroupReducer.d.ts +0 -6
- package/lib/entity/taskGroup/taskGroupReducer.js +0 -33
- package/lib/entity/taskGroup/taskGroupSelector.d.ts +0 -4
- package/lib/entity/taskGroup/taskGroupSelector.js +0 -18
- package/lib/entity/taskGroup/taskGroupState.d.ts +0 -12
- package/lib/entity/taskGroup/taskGroupState.js +0 -2
- package/lib/view/taskManager/taskGroupView/epics/createNewTaskGroupEpic.d.ts +0 -10
- package/lib/view/taskManager/taskGroupView/epics/createNewTaskGroupEpic.js +0 -57
- package/lib/view/taskManager/taskGroupView/epics/deleteTaskGroupEpic.d.ts +0 -10
- package/lib/view/taskManager/taskGroupView/epics/deleteTaskGroupEpic.js +0 -41
- package/lib/view/taskManager/taskGroupView/epics/fetchAllTaskGroupsEpic.d.ts +0 -8
- package/lib/view/taskManager/taskGroupView/epics/fetchAllTaskGroupsEpic.js +0 -33
- package/lib/view/taskManager/taskGroupView/epics/updateTaskGroupNameEpic.d.ts +0 -10
- package/lib/view/taskManager/taskGroupView/epics/updateTaskGroupNameEpic.js +0 -51
- package/lib/view/taskManager/taskGroupView/taskGroupViewPayload.d.ts +0 -6
- package/lib/view/taskManager/taskGroupView/taskGroupViewPayload.js +0 -2
- package/lib/view/taskManager/taskGroupView/taskGroupViewReducer.d.ts +0 -34
- package/lib/view/taskManager/taskGroupView/taskGroupViewReducer.js +0 -123
- package/lib/view/taskManager/taskGroupView/taskGroupViewState.d.ts +0 -7
- package/lib/view/taskManager/taskGroupView/taskGroupViewState.js +0 -2
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.d.ts +0 -8
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.js +0 -88
- package/lib/view/taskManager/taskListView/dragNDropTasksEpic.d.ts +0 -6
- package/lib/view/taskManager/taskListView/dragNDropTasksEpic.js +0 -20
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewAttachmentsEpic.d.ts +0 -10
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewAttachmentsEpic.js +0 -37
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
import { AttachmentPayload } from '../../../entity/transaction/payloadTypes/attachmentPayload';
|
|
2
|
-
import { ID } from '../../../commonStateTypes/common';
|
|
3
1
|
import { UserBasePayload } from '../../../entity/user/userPayload';
|
|
4
2
|
import { VendorPayload } from '../../../entity/vendor/vendorPayload';
|
|
5
3
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
6
4
|
import { AllGlobalMerchantBasePayload, VendorReviewViewAllRecommendationsPayload, VendorReviewViewRecommendationsPayload } from '../common/payload/commonTypes';
|
|
7
5
|
import { VendorFirstReviewViewColumnKey } from './vendorFirstReviewViewState';
|
|
8
|
-
export interface VendorTransactionAttachment {
|
|
9
|
-
attachmentEndpoint: string;
|
|
10
|
-
vendorId: ID;
|
|
11
|
-
attachmentIds: ID[];
|
|
12
|
-
}
|
|
13
|
-
export interface VendorTransactionAttachmentPayload {
|
|
14
|
-
vendor_id: ID;
|
|
15
|
-
attachment_ids: ID[];
|
|
16
|
-
}
|
|
17
6
|
export interface VendorFirstReviewViewPayload extends VendorPayload {
|
|
18
7
|
recommendations: VendorReviewViewAllRecommendationsPayload;
|
|
19
8
|
status: ReviewStatusPayload;
|
|
20
9
|
last_updated_vendor_name_by_user: UserBasePayload | null;
|
|
21
10
|
merge_vendor_name: string | null;
|
|
22
|
-
transaction_attachments?: AttachmentPayload[] | null;
|
|
23
11
|
}
|
|
24
12
|
export interface FetchVendorFirstReviewViewQuery {
|
|
25
13
|
search_text: string;
|
|
@@ -41,7 +29,6 @@ export interface VendorFirstReviewPayload {
|
|
|
41
29
|
query?: FetchVendorFirstReviewViewQuery;
|
|
42
30
|
}
|
|
43
31
|
export declare type VendorFirstReviewViewResponse = ZeniAPIResponse<VendorFirstReviewPayload>;
|
|
44
|
-
export declare type VendorFirstReviewAttachmentResponse = ZeniAPIResponse<VendorFirstReviewPayload>;
|
|
45
32
|
export declare type ReviewStatusPayload = {
|
|
46
33
|
code: string;
|
|
47
34
|
name: string;
|
|
@@ -51,7 +38,6 @@ export interface SaveVendorFirstReviewViewPayload extends VendorPayload {
|
|
|
51
38
|
last_updated_vendor_name_by_user: UserBasePayload | null;
|
|
52
39
|
status: ReviewStatusPayload;
|
|
53
40
|
merge_vendor_name: string | null;
|
|
54
|
-
transaction_attachments: AttachmentPayload[];
|
|
55
41
|
}
|
|
56
42
|
export interface SaveVendorFirstReviewView {
|
|
57
43
|
vendors?: SaveVendorFirstReviewViewPayload[];
|
|
@@ -64,7 +50,6 @@ export interface SaveVendorFirstReviewViewQueryPayload {
|
|
|
64
50
|
qbo_id: string | null;
|
|
65
51
|
selected_global_merchant: AllGlobalMerchantBasePayload | null;
|
|
66
52
|
is_employee: boolean;
|
|
67
|
-
is_local_contractor: boolean;
|
|
68
53
|
recommendations: VendorReviewViewAllRecommendationsPayload;
|
|
69
54
|
}
|
|
70
55
|
export declare type SaveVendorFirstReviewResponse = ZeniAPIResponse<SaveVendorFirstReviewView>;
|
|
@@ -4,12 +4,8 @@ import { ZeniAPIStatus } from '../../../responsePayload';
|
|
|
4
4
|
import { SaveVendorFirstReviewViewPayload, ReviewStatusPayload, VendorFirstReviewPayload } from './vendorFirstReviewViewPayload';
|
|
5
5
|
import { VendorFirstReviewViewColumnKey, VendorFirstReviewViewState, RecommendedNonExistingGlobalMerchant, CurrentSelectionByColumn } from './vendorFirstReviewViewState';
|
|
6
6
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
7
|
-
import { AttachmentPayload } from '../../../entity/transaction/payloadTypes/attachmentPayload';
|
|
8
7
|
export declare const initialState: VendorFirstReviewViewState;
|
|
9
|
-
export declare const
|
|
10
|
-
vendorId: string;
|
|
11
|
-
attachmentIds: string[];
|
|
12
|
-
}, string, never, never>, fetchVendorFirstReviewView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[pageToken: PageToken, searchString?: string | undefined, keepExistingListItems?: any], {
|
|
8
|
+
export declare const fetchVendorFirstReviewView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[pageToken: PageToken, searchString?: string | undefined, keepExistingListItems?: any], {
|
|
13
9
|
searchString: string | undefined;
|
|
14
10
|
keepExistingListItems: any;
|
|
15
11
|
pageToken: PageToken;
|
|
@@ -22,10 +18,9 @@ export declare const fetchVendorFirstReviewAttachments: import("@reduxjs/toolkit
|
|
|
22
18
|
scrollYOffset: number;
|
|
23
19
|
}, string>, updateVendorFirstReviewViewPageToken: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
24
20
|
pageToken: PageToken;
|
|
25
|
-
}, string>, saveVendorFirstReviewView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string, markAsEmployee?: any
|
|
21
|
+
}, string>, saveVendorFirstReviewView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[vendorId: string, markAsEmployee?: any], {
|
|
26
22
|
vendorId: string;
|
|
27
23
|
markAsEmployee: any;
|
|
28
|
-
markAsLocalContractor: any;
|
|
29
24
|
}, string, never, never>, updateVendorFirstReviewSortUiState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
30
25
|
sortOrder: SortOrder;
|
|
31
26
|
sortkey: VendorFirstReviewViewColumnKey;
|
|
@@ -51,11 +46,6 @@ export declare const fetchVendorFirstReviewAttachments: import("@reduxjs/toolkit
|
|
|
51
46
|
markAsEmployee: boolean;
|
|
52
47
|
error: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
53
48
|
reviewStatus: ReviewStatusPayload | undefined;
|
|
54
|
-
}, string, never, never
|
|
55
|
-
vendorId: ID;
|
|
56
|
-
transactionAttachments: AttachmentPayload[];
|
|
57
|
-
}, string>, updateVendorFirstReviewViewTransactionAttachmentsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
58
|
-
status: ZeniAPIStatus;
|
|
59
|
-
}, string>;
|
|
49
|
+
}, string, never, never>;
|
|
60
50
|
declare const _default: import("@reduxjs/toolkit").Reducer<VendorFirstReviewViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
61
51
|
export default _default;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
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.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const commonTypes_1 = require("../common/state/commonTypes");
|
|
7
|
-
const attachmentPayload_1 = require("../../../entity/transaction/payloadTypes/attachmentPayload");
|
|
8
7
|
exports.initialState = {
|
|
9
8
|
vendorFirstReviewViewLocalDataById: {},
|
|
10
9
|
fetchState: 'Not-Started',
|
|
@@ -17,11 +16,6 @@ exports.initialState = {
|
|
|
17
16
|
pageToken: null,
|
|
18
17
|
sortOrder: 'descending', //default sort order
|
|
19
18
|
},
|
|
20
|
-
transactionAttachmentsByVendorId: {},
|
|
21
|
-
attachmentFetchStatus: {
|
|
22
|
-
fetchState: 'Not-Started',
|
|
23
|
-
error: undefined,
|
|
24
|
-
},
|
|
25
19
|
hasValidState() {
|
|
26
20
|
return this.fetchState == 'Completed';
|
|
27
21
|
},
|
|
@@ -30,22 +24,6 @@ const vendorFirstReviewView = (0, toolkit_1.createSlice)({
|
|
|
30
24
|
name: 'vendorFirstReviewView',
|
|
31
25
|
initialState: exports.initialState,
|
|
32
26
|
reducers: {
|
|
33
|
-
fetchVendorFirstReviewAttachments: {
|
|
34
|
-
reducer(draft) {
|
|
35
|
-
draft.attachmentFetchStatus = {
|
|
36
|
-
fetchState: 'In-Progress',
|
|
37
|
-
error: undefined,
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
prepare(vendorId, attachmentIds) {
|
|
41
|
-
return {
|
|
42
|
-
payload: {
|
|
43
|
-
vendorId,
|
|
44
|
-
attachmentIds,
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
27
|
fetchVendorFirstReviewView: {
|
|
50
28
|
reducer(draft, action) {
|
|
51
29
|
var _a, _b;
|
|
@@ -162,12 +140,11 @@ const vendorFirstReviewView = (0, toolkit_1.createSlice)({
|
|
|
162
140
|
error: undefined,
|
|
163
141
|
} });
|
|
164
142
|
},
|
|
165
|
-
prepare(vendorId, markAsEmployee = false
|
|
143
|
+
prepare(vendorId, markAsEmployee = false) {
|
|
166
144
|
return {
|
|
167
145
|
payload: {
|
|
168
146
|
vendorId,
|
|
169
147
|
markAsEmployee,
|
|
170
|
-
markAsLocalContractor,
|
|
171
148
|
},
|
|
172
149
|
};
|
|
173
150
|
},
|
|
@@ -179,22 +156,6 @@ const vendorFirstReviewView = (0, toolkit_1.createSlice)({
|
|
|
179
156
|
draft.vendorFirstReviewViewLocalDataById[vendorId].vendorFirstReviewViewLocalData = toVendorReviewViewUpdatedVendorLocalData(vendorId, vendors[0]);
|
|
180
157
|
}
|
|
181
158
|
},
|
|
182
|
-
updateVendorFirstReviewViewTransactionAttachments(draft, action) {
|
|
183
|
-
const { vendorId, transactionAttachments } = action.payload;
|
|
184
|
-
draft.transactionAttachmentsByVendorId[vendorId] =
|
|
185
|
-
transactionAttachments.map((transactionAttachment) => (0, attachmentPayload_1.toAttachment)(transactionAttachment));
|
|
186
|
-
draft.attachmentFetchStatus = {
|
|
187
|
-
fetchState: 'Completed',
|
|
188
|
-
error: undefined,
|
|
189
|
-
};
|
|
190
|
-
},
|
|
191
|
-
updateVendorFirstReviewViewTransactionAttachmentsFailure(draft, action) {
|
|
192
|
-
const { status } = action.payload;
|
|
193
|
-
draft.attachmentFetchStatus = {
|
|
194
|
-
fetchState: 'Error',
|
|
195
|
-
error: status,
|
|
196
|
-
};
|
|
197
|
-
},
|
|
198
159
|
updateRecentlySavedErroredVendorData(draft, action) {
|
|
199
160
|
const { isQBOMergeError, vendorId, oldRecommendation, newRecommendation, vendorNameSentForReview, } = action.payload;
|
|
200
161
|
if (isQBOMergeError) {
|
|
@@ -293,12 +254,9 @@ const mapPayloadToVendorFirstReviewView = (payload) => {
|
|
|
293
254
|
mergeVendorName: payload.merge_vendor_name != null && payload.merge_vendor_name.length > 0
|
|
294
255
|
? payload.merge_vendor_name
|
|
295
256
|
: undefined,
|
|
296
|
-
transactionAttachments: payload.transaction_attachments != null
|
|
297
|
-
? payload.transaction_attachments.map((attachmentPayload) => (0, attachmentPayload_1.toAttachment)(attachmentPayload))
|
|
298
|
-
: [],
|
|
299
257
|
/* merge_vendor_name can be an empty string from platform in cases other than `merge_in_qbo` status.
|
|
300
258
|
So, to avoid further string length checks, making this undefined.*/
|
|
301
259
|
};
|
|
302
260
|
};
|
|
303
|
-
_a = vendorFirstReviewView.actions, exports.
|
|
261
|
+
_a = vendorFirstReviewView.actions, 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;
|
|
304
262
|
exports.default = vendorFirstReviewView.reducer;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import { Attachment } from '../../../entity/transaction/stateTypes/attachment';
|
|
4
3
|
import { User } from '../../../entity/user/userState';
|
|
5
4
|
import { Vendor } from '../../../entity/vendor/vendorState';
|
|
6
5
|
import { RootState } from '../../../reducer';
|
|
@@ -28,10 +27,8 @@ export interface VendorFirstReviewSelectorView {
|
|
|
28
27
|
lastUpdatedVendorNameByUser?: User;
|
|
29
28
|
mergeVendorName: string | undefined;
|
|
30
29
|
saveStatus: FetchStateAndError;
|
|
31
|
-
attachmentFetchStatus: FetchStateAndError;
|
|
32
30
|
recommendations: RecommendedNonExistingGlobalMerchant[];
|
|
33
31
|
currentSelection: VendorReviewRowCurrentSelection;
|
|
34
|
-
transactionAttachments: Attachment[];
|
|
35
32
|
}
|
|
36
33
|
export interface RecentlySavedErroredVendorView {
|
|
37
34
|
vendorId: ID;
|
|
@@ -40,8 +37,3 @@ export interface RecentlySavedErroredVendorView {
|
|
|
40
37
|
newRecommendedVendor?: RecommendedNonExistingGlobalMerchant;
|
|
41
38
|
}
|
|
42
39
|
export declare const getVendorFirstReviewView: (state: RootState) => VendorFirstReviewViewSelectorView;
|
|
43
|
-
export interface VendorFirstReviewSelectorAttachmentView {
|
|
44
|
-
attachmentFetchStatus: FetchStateAndError;
|
|
45
|
-
transactionAttachments: Attachment[];
|
|
46
|
-
}
|
|
47
|
-
export declare const getVendorFirstReviewAttachmentView: (state: RootState, vendorId: ID) => VendorFirstReviewSelectorAttachmentView | undefined;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
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");
|
|
7
7
|
const globalMerchantAutoCompleteViewSelector_1 = require("../../globalMerchantView/globalMerchantAutoCompleteView/globalMerchantAutoCompleteViewSelector");
|
|
8
8
|
const getVendorFirstReviewView = (state) => {
|
|
9
9
|
const { vendorFirstReviewViewState, userState, vendorState, globalMerchantState, } = state;
|
|
10
|
-
const { vendorFirstReviewViewLocalDataById, recentlySavedErroredVendorData,
|
|
10
|
+
const { vendorFirstReviewViewLocalDataById, recentlySavedErroredVendorData, uiState, fetchState, error, } = vendorFirstReviewViewState;
|
|
11
11
|
const userIds = [];
|
|
12
12
|
const globalMerchantAutoCompleteView = (0, globalMerchantAutoCompleteViewSelector_1.getGlobalMerchantAutoCompleteResults)(state);
|
|
13
13
|
const vendorReviewView = Object.keys(vendorFirstReviewViewLocalDataById).map((id) => {
|
|
@@ -23,7 +23,6 @@ const getVendorFirstReviewView = (state) => {
|
|
|
23
23
|
...recommendations,
|
|
24
24
|
...vendorLocalData.recommendedNonExistingGlobalMerchants,
|
|
25
25
|
];
|
|
26
|
-
const transactionAttachments = vendorLocalData.transactionAttachments;
|
|
27
26
|
let selectedVendor;
|
|
28
27
|
const vendor = (0, vendorSelector_1.getVendorByVendorId)(vendorState, vendorLocalData.selectedVendorId);
|
|
29
28
|
if (vendor != null) {
|
|
@@ -58,12 +57,10 @@ const getVendorFirstReviewView = (state) => {
|
|
|
58
57
|
selectedVendor,
|
|
59
58
|
status: vendorLocalData.status,
|
|
60
59
|
saveStatus: vendorFirstReviewViewLocalDataById[id].saveStatus,
|
|
61
|
-
attachmentFetchStatus,
|
|
62
60
|
lastUpdatedVendorNameByUser: users.find((user) => user.userId === vendorLocalData.lastUpdatedVendorNameByUserId),
|
|
63
61
|
recommendations,
|
|
64
62
|
currentSelection: vendorLocalData.currentSelection,
|
|
65
63
|
mergeVendorName: vendorLocalData.mergeVendorName,
|
|
66
|
-
transactionAttachments,
|
|
67
64
|
};
|
|
68
65
|
});
|
|
69
66
|
let recentlyUpdatedErroredVendorData = undefined;
|
|
@@ -98,15 +95,3 @@ const getVendorFirstReviewView = (state) => {
|
|
|
98
95
|
};
|
|
99
96
|
};
|
|
100
97
|
exports.getVendorFirstReviewView = getVendorFirstReviewView;
|
|
101
|
-
const getVendorFirstReviewAttachmentView = (state, vendorId) => {
|
|
102
|
-
const { vendorFirstReviewViewState } = state;
|
|
103
|
-
const { transactionAttachmentsByVendorId } = vendorFirstReviewViewState;
|
|
104
|
-
if (transactionAttachmentsByVendorId[vendorId] == null) {
|
|
105
|
-
return undefined;
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
attachmentFetchStatus: vendorFirstReviewViewState.attachmentFetchStatus,
|
|
109
|
-
transactionAttachments: transactionAttachmentsByVendorId[vendorId],
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
exports.getVendorFirstReviewAttachmentView = getVendorFirstReviewAttachmentView;
|
|
@@ -2,14 +2,13 @@ import { FetchedState, FetchStateAndError, ID } from '../../../commonStateTypes/
|
|
|
2
2
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
3
3
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { GlobalMerchant } from '../../../entity/globalMerchant/globalMerchantState';
|
|
5
|
-
import { Attachment } from '../../../entity/transaction/stateTypes/attachment';
|
|
6
5
|
import { VendorReviewRowCurrentSelection, ReviewStatus } from '../common/state/commonTypes';
|
|
7
|
-
export declare const VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS: readonly ["vendor", "updateTo", "retain", "status", "action", "ytd"
|
|
6
|
+
export declare const VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS: readonly ["vendor", "updateTo", "retain", "status", "action", "ytd"];
|
|
8
7
|
export interface CurrentSelectionByColumn {
|
|
9
8
|
retain: boolean;
|
|
10
9
|
update: boolean;
|
|
11
10
|
}
|
|
12
|
-
export declare const toVendorFirstReviewViewColumnKeyType: (v: string) => "action" | "status" | "vendor" | "retain" | "updateTo" | "ytd"
|
|
11
|
+
export declare const toVendorFirstReviewViewColumnKeyType: (v: string) => "action" | "status" | "vendor" | "retain" | "updateTo" | "ytd";
|
|
13
12
|
export declare type VendorFirstReviewViewColumnKey = ReturnType<typeof toVendorFirstReviewViewColumnKeyType>;
|
|
14
13
|
export interface RecommendedNonExistingGlobalMerchant extends Omit<GlobalMerchant, 'globalMerchantId'> {
|
|
15
14
|
globalMerchantId?: ID;
|
|
@@ -32,7 +31,6 @@ export interface VendorFirstReviewViewLocalData {
|
|
|
32
31
|
vendorRenamedText?: string;
|
|
33
32
|
lastUpdatedVendorNameByUserId?: ID;
|
|
34
33
|
mergeVendorName: string | undefined;
|
|
35
|
-
transactionAttachments: Attachment[];
|
|
36
34
|
}
|
|
37
35
|
export interface RecentlySavedErroredVendorData {
|
|
38
36
|
vendorId: ID;
|
|
@@ -48,6 +46,4 @@ export interface VendorFirstReviewViewState extends FetchedState {
|
|
|
48
46
|
vendorFirstReviewViewLocalDataById: Record<ID, VendorFirstReviewView>;
|
|
49
47
|
recentlySavedErroredVendorData?: RecentlySavedErroredVendorData;
|
|
50
48
|
uiState: VendorFirstReviewViewUIState;
|
|
51
|
-
attachmentFetchStatus: FetchStateAndError;
|
|
52
|
-
transactionAttachmentsByVendorId: Record<ID, Attachment[]>;
|
|
53
49
|
}
|
|
@@ -8,8 +8,7 @@ exports.VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS = [
|
|
|
8
8
|
'retain',
|
|
9
9
|
'status',
|
|
10
10
|
'action',
|
|
11
|
-
'ytd',
|
|
12
|
-
'viewTenantInvoice',
|
|
11
|
+
'ytd', // Note: this is not part of list view, we are keeping it to use for default sorting purpose since default sorting is by year_to_date_spend
|
|
13
12
|
];
|
|
14
13
|
const toVendorFirstReviewViewColumnKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.VENDOR_FIRST_REVIEW_VIEW_COLUMN_KEYS);
|
|
15
14
|
exports.toVendorFirstReviewViewColumnKeyType = toVendorFirstReviewViewColumnKeyType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.16",
|
|
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,9 +0,0 @@
|
|
|
1
|
-
import { TaskGroup } from './taskGroupState';
|
|
2
|
-
export interface TaskGroupPayload {
|
|
3
|
-
task_group_id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
is_default: boolean;
|
|
6
|
-
is_deleted: boolean;
|
|
7
|
-
created_at: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function mapTaskGroupPayloadToTaskGroup(payload: TaskGroupPayload): TaskGroup;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapTaskGroupPayloadToTaskGroup = void 0;
|
|
4
|
-
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
5
|
-
function mapTaskGroupPayloadToTaskGroup(payload) {
|
|
6
|
-
return {
|
|
7
|
-
id: payload.task_group_id,
|
|
8
|
-
name: payload.name,
|
|
9
|
-
isDefault: payload.is_default,
|
|
10
|
-
isDeleted: payload.is_deleted,
|
|
11
|
-
createdAt: (0, zeniDayJS_1.date)(payload.created_at),
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
exports.mapTaskGroupPayloadToTaskGroup = mapTaskGroupPayloadToTaskGroup;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TaskGroupPayload } from './taskGroupPayload';
|
|
2
|
-
import { TaskGroupState } from './taskGroupState';
|
|
3
|
-
export declare const initialState: TaskGroupState;
|
|
4
|
-
export declare const updateTaskGroups: import("@reduxjs/toolkit").ActionCreatorWithPayload<TaskGroupPayload[], string>, updateTaskGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<TaskGroupPayload, string>, removeTaskGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, clearAllTaskGroups: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
5
|
-
declare const _default: import("@reduxjs/toolkit").Reducer<TaskGroupState, import("@reduxjs/toolkit").AnyAction>;
|
|
6
|
-
export default _default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearAllTaskGroups = exports.removeTaskGroup = exports.updateTaskGroup = exports.updateTaskGroups = exports.initialState = void 0;
|
|
5
|
-
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const taskGroupPayload_1 = require("./taskGroupPayload");
|
|
7
|
-
exports.initialState = {
|
|
8
|
-
taskGroupById: {},
|
|
9
|
-
};
|
|
10
|
-
const taskGroup = (0, toolkit_1.createSlice)({
|
|
11
|
-
name: 'taskGroup',
|
|
12
|
-
initialState: exports.initialState,
|
|
13
|
-
reducers: {
|
|
14
|
-
updateTaskGroups(draft, action) {
|
|
15
|
-
action.payload.forEach((taskPayload) => {
|
|
16
|
-
const latestTaskGroup = (0, taskGroupPayload_1.mapTaskGroupPayloadToTaskGroup)(taskPayload);
|
|
17
|
-
draft.taskGroupById[latestTaskGroup.id] = latestTaskGroup;
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
updateTaskGroup(draft, action) {
|
|
21
|
-
const latestTaskGroup = (0, taskGroupPayload_1.mapTaskGroupPayloadToTaskGroup)(action.payload);
|
|
22
|
-
draft.taskGroupById[latestTaskGroup.id] = latestTaskGroup;
|
|
23
|
-
},
|
|
24
|
-
removeTaskGroup(draft, action) {
|
|
25
|
-
delete draft.taskGroupById[action.payload];
|
|
26
|
-
},
|
|
27
|
-
clearAllTaskGroups(draft) {
|
|
28
|
-
draft.taskGroupById = {};
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
_a = taskGroup.actions, exports.updateTaskGroups = _a.updateTaskGroups, exports.updateTaskGroup = _a.updateTaskGroup, exports.removeTaskGroup = _a.removeTaskGroup, exports.clearAllTaskGroups = _a.clearAllTaskGroups;
|
|
33
|
-
exports.default = taskGroup.reducer;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { TaskGroupState, TaskGroup } from './taskGroupState';
|
|
3
|
-
export declare function getTaskGroupByIds(taskGroupState: TaskGroupState, taskGroupIds: ID[]): TaskGroup[];
|
|
4
|
-
export declare function getTaskGroupById(taskGroupState: TaskGroupState, taskGroupId: ID): TaskGroup | undefined;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getTaskGroupById = exports.getTaskGroupByIds = void 0;
|
|
7
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
8
|
-
function getTaskGroupByIds(taskGroupState, taskGroupIds) {
|
|
9
|
-
const tasksGroups = taskGroupIds
|
|
10
|
-
.map((taskGroupId) => getTaskGroupById(taskGroupState, taskGroupId))
|
|
11
|
-
.filter((value) => value != null);
|
|
12
|
-
return tasksGroups;
|
|
13
|
-
}
|
|
14
|
-
exports.getTaskGroupByIds = getTaskGroupByIds;
|
|
15
|
-
function getTaskGroupById(taskGroupState, taskGroupId) {
|
|
16
|
-
return (0, get_1.default)(taskGroupState.taskGroupById, taskGroupId, undefined);
|
|
17
|
-
}
|
|
18
|
-
exports.getTaskGroupById = getTaskGroupById;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ID } from '../../commonStateTypes/common';
|
|
2
|
-
import { ZeniDate } from '../../zeniDayJS';
|
|
3
|
-
export interface TaskGroup {
|
|
4
|
-
id: ID;
|
|
5
|
-
name: string;
|
|
6
|
-
isDefault: boolean;
|
|
7
|
-
isDeleted: boolean;
|
|
8
|
-
createdAt: ZeniDate;
|
|
9
|
-
}
|
|
10
|
-
export interface TaskGroupState {
|
|
11
|
-
taskGroupById: Record<ID, TaskGroup>;
|
|
12
|
-
}
|
|
@@ -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 { createNewTaskGroup, updateTaskGroupCreationFetchStatus, updateTaskGroupViewOnTaskGroupCreationSuccess } from '../taskGroupViewReducer';
|
|
6
|
-
import { updateTaskListOnNewGroupCreationSuccess, bulkUpdateTaskList } from '../../taskListView/taskListReducer';
|
|
7
|
-
import { updateTaskGroup } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
8
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
|
-
export declare type ActionType = ReturnType<typeof createNewTaskGroup> | ReturnType<typeof updateTaskGroup> | ReturnType<typeof updateTaskListOnNewGroupCreationSuccess> | ReturnType<typeof updateTaskGroupViewOnTaskGroupCreationSuccess> | ReturnType<typeof openSnackbar> | ReturnType<typeof bulkUpdateTaskList> | ReturnType<typeof updateTaskGroupCreationFetchStatus>;
|
|
10
|
-
export declare const createNewTaskGroupEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createNewTaskGroupEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const taskGroupViewReducer_1 = require("../taskGroupViewReducer");
|
|
8
|
-
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
9
|
-
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
10
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
11
|
-
const createNewTaskGroupEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupViewReducer_1.createNewTaskGroup.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
-
const { groupName, updateSelectedTasks } = action.payload;
|
|
13
|
-
const state = state$.value;
|
|
14
|
-
const { localData } = state.taskListState;
|
|
15
|
-
const payload = {
|
|
16
|
-
name: groupName,
|
|
17
|
-
};
|
|
18
|
-
return zeniAPI
|
|
19
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/groups`, payload)
|
|
20
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
21
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
22
|
-
const actions = [
|
|
23
|
-
(0, taskGroupReducer_1.updateTaskGroup)(response.data.task_groups[0]),
|
|
24
|
-
(0, taskGroupViewReducer_1.updateTaskGroupViewOnTaskGroupCreationSuccess)({
|
|
25
|
-
newTaskGroupId: response.data.task_groups[0].task_group_id,
|
|
26
|
-
}),
|
|
27
|
-
(0, taskListReducer_1.updateTaskListOnNewGroupCreationSuccess)({
|
|
28
|
-
newTaskGroup: response.data.task_groups[0],
|
|
29
|
-
}),
|
|
30
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
31
|
-
messageSection: 'task_group_creation_success',
|
|
32
|
-
messageText: 'success',
|
|
33
|
-
type: 'success',
|
|
34
|
-
}),
|
|
35
|
-
];
|
|
36
|
-
if (updateSelectedTasks === true) {
|
|
37
|
-
actions.push((0, taskListReducer_1.bulkUpdateTaskList)(localData.selectedTaskIds, {
|
|
38
|
-
taskGroupIds: [response.data.task_groups[0].task_group_id],
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
return (0, rxjs_1.from)(actions);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupCreationFetchStatus)({
|
|
45
|
-
fetchState: 'Error',
|
|
46
|
-
error: response.status,
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
}), (0, operators_1.catchError)((error) => {
|
|
50
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupCreationFetchStatus)({
|
|
51
|
-
fetchState: 'Error',
|
|
52
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Create Task Group REST API call errored out' +
|
|
53
|
-
JSON.stringify(error)),
|
|
54
|
-
}));
|
|
55
|
-
}));
|
|
56
|
-
}));
|
|
57
|
-
exports.createNewTaskGroupEpic = createNewTaskGroupEpic;
|
|
@@ -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 { deleteTaskGroup, updateTaskGroupDeletionFetchStatus, updateTaskGroupViewOnTaskDeletionSuccess } from '../taskGroupViewReducer';
|
|
6
|
-
import { updateTaskListOnTaskGroupDeletion } from '../../taskListView/taskListReducer';
|
|
7
|
-
import { removeTaskGroup } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
8
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
|
-
export declare type ActionType = ReturnType<typeof deleteTaskGroup> | ReturnType<typeof removeTaskGroup> | ReturnType<typeof updateTaskListOnTaskGroupDeletion> | ReturnType<typeof updateTaskGroupDeletionFetchStatus> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateTaskGroupViewOnTaskDeletionSuccess>;
|
|
10
|
-
export declare const deleteTaskGroupEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteTaskGroupEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const taskGroupViewReducer_1 = require("../taskGroupViewReducer");
|
|
8
|
-
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
9
|
-
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
10
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
11
|
-
const deleteTaskGroupEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupViewReducer_1.deleteTaskGroup.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
-
const { taskGroupId } = action.payload;
|
|
13
|
-
return zeniAPI
|
|
14
|
-
.deleteAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/groups/${taskGroupId}`)
|
|
15
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
17
|
-
return (0, rxjs_1.of)((0, taskGroupReducer_1.removeTaskGroup)(taskGroupId), (0, taskGroupViewReducer_1.updateTaskGroupViewOnTaskDeletionSuccess)({
|
|
18
|
-
deletedTaskGroupId: taskGroupId,
|
|
19
|
-
}), (0, taskListReducer_1.updateTaskListOnTaskGroupDeletion)({
|
|
20
|
-
taskGroupId,
|
|
21
|
-
}), (0, snackbarReducer_1.openSnackbar)({
|
|
22
|
-
messageSection: 'task_group_deletion_success',
|
|
23
|
-
messageText: 'success',
|
|
24
|
-
type: 'success',
|
|
25
|
-
}));
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupDeletionFetchStatus)({
|
|
29
|
-
fetchState: 'Error',
|
|
30
|
-
error: response.status,
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
}), (0, operators_1.catchError)((error) => {
|
|
34
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupDeletionFetchStatus)({
|
|
35
|
-
fetchState: 'Error',
|
|
36
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Delete Task Group REST API call errored out' +
|
|
37
|
-
JSON.stringify(error)),
|
|
38
|
-
}));
|
|
39
|
-
}));
|
|
40
|
-
}));
|
|
41
|
-
exports.deleteTaskGroupEpic = deleteTaskGroupEpic;
|
|
@@ -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 { fetchAllTaskGroups, updateTaskGroupsOnSuccess, updateTaskGroupsFetchStatus } from '../taskGroupViewReducer';
|
|
6
|
-
import { updateTaskGroups } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
7
|
-
export declare type ActionType = ReturnType<typeof fetchAllTaskGroups> | ReturnType<typeof updateTaskGroups> | ReturnType<typeof updateTaskGroupsOnSuccess> | ReturnType<typeof updateTaskGroupsFetchStatus>;
|
|
8
|
-
export declare const fetchAllTaskGroupsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchAllTaskGroupsEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
-
const taskGroupViewReducer_1 = require("../taskGroupViewReducer");
|
|
8
|
-
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
9
|
-
const fetchAllTaskGroupsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupViewReducer_1.fetchAllTaskGroups.match), (0, operators_1.switchMap)(() => {
|
|
10
|
-
const queryParam = { filter_type: 'all' };
|
|
11
|
-
return zeniAPI
|
|
12
|
-
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/groups?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
13
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
15
|
-
return (0, rxjs_1.of)((0, taskGroupReducer_1.updateTaskGroups)(response.data.task_groups), (0, taskGroupViewReducer_1.updateTaskGroupsOnSuccess)({
|
|
16
|
-
data: response.data.task_groups,
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupsFetchStatus)({
|
|
21
|
-
fetchState: 'Error',
|
|
22
|
-
error: response.status,
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
25
|
-
}), (0, operators_1.catchError)((error) => {
|
|
26
|
-
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupsFetchStatus)({
|
|
27
|
-
fetchState: 'Error',
|
|
28
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch all task groups REST API call errored out' +
|
|
29
|
-
JSON.stringify(error)),
|
|
30
|
-
}));
|
|
31
|
-
}));
|
|
32
|
-
}));
|
|
33
|
-
exports.fetchAllTaskGroupsEpic = fetchAllTaskGroupsEpic;
|
|
@@ -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 { updateTaskGroupName, updateTaskGroupFetchStatus } from '../taskGroupViewReducer';
|
|
6
|
-
import { updateTaskListOnTaskGroupNameUpdate } from '../../taskListView/taskListReducer';
|
|
7
|
-
import { updateTaskGroup } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
8
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
|
-
export declare type ActionType = ReturnType<typeof updateTaskGroupName> | ReturnType<typeof updateTaskGroupFetchStatus> | ReturnType<typeof updateTaskGroup> | ReturnType<typeof updateTaskListOnTaskGroupNameUpdate> | ReturnType<typeof openSnackbar>;
|
|
10
|
-
export declare const updateTaskGroupNameEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|