@zeniai/client-epic-state 4.11.15 → 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/billPay/billTransaction/billTransactionPayload.d.ts +0 -9
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +2 -15
- package/lib/entity/billPay/billTransaction/billTransactionReducer.d.ts +1 -2
- package/lib/entity/billPay/billTransaction/billTransactionReducer.js +2 -25
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +1 -11
- package/lib/entity/billPay/billTransaction/billTransactionState.js +1 -9
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -6
- package/lib/entity/task/taskPayload.d.ts +2 -2
- package/lib/entity/task/taskPayload.js +0 -1
- package/lib/entity/task/taskState.d.ts +2 -3
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -5
- package/lib/entity/tenant/clearAllEpic.js +0 -8
- 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 -12
- package/lib/epic.js +1 -12
- package/lib/index.d.ts +12 -18
- package/lib/index.js +10 -37
- package/lib/reducer.d.ts +0 -9
- package/lib/reducer.js +0 -9
- 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/spendManagement/billPay/billList/billListReducer.d.ts +2 -3
- package/lib/view/spendManagement/billPay/billList/billListReducer.js +3 -9
- package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +2 -19
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +3 -150
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +0 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +0 -2
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +0 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +8 -9
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +4 -6
- package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -1
- package/lib/view/spendManagement/helpers.d.ts +0 -3
- package/lib/view/spendManagement/helpers.js +1 -17
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
- 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/spendManagement/billPay/billsBulkActionView/billsBulkActionViewPayload.d.ts +0 -32
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewPayload.js +0 -2
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.d.ts +0 -17
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.js +0 -166
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.d.ts +0 -24
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.js +0 -45
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.d.ts +0 -28
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.js +0 -7
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/approveOrRejectBillsBulkActionEpic.d.ts +0 -9
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/approveOrRejectBillsBulkActionEpic.js +0 -73
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/cancelOrDeleteBillsBulkActionEpic.d.ts +0 -8
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/cancelOrDeleteBillsBulkActionEpic.js +0 -74
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/reviewDraftBillsBulkActionEpic.ts.d.ts +0 -7
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/reviewDraftBillsBulkActionEpic.ts.js +0 -29
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic.d.ts +0 -8
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic.js +0 -62
- 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,17 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearTaskList = exports.
|
|
4
|
+
exports.clearTaskList = exports.updateTaskFilters = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.updateTaskListFetchStatus = exports.updateTaskList = exports.fetchTaskList = exports.fetchTaskListPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
exports.initialLocalData = {
|
|
7
|
-
newTaskGroupName: '',
|
|
8
|
-
existingTaskGroupNamesByGroupId: {},
|
|
9
|
-
selectedTaskIds: [],
|
|
10
|
-
defaultTaskGroupId: null,
|
|
11
|
-
};
|
|
12
6
|
exports.initialState = {
|
|
13
7
|
taskIds: [],
|
|
14
|
-
taskIdsByGroupsIds: {},
|
|
15
8
|
fetchState: 'Not-Started',
|
|
16
9
|
searchText: '',
|
|
17
10
|
error: undefined,
|
|
@@ -33,11 +26,6 @@ exports.initialState = {
|
|
|
33
26
|
hasValidState() {
|
|
34
27
|
return this.fetchState == 'Completed';
|
|
35
28
|
},
|
|
36
|
-
localData: Object.assign({}, exports.initialLocalData),
|
|
37
|
-
updateTasksFetchState: {
|
|
38
|
-
fetchState: 'Not-Started',
|
|
39
|
-
error: undefined,
|
|
40
|
-
},
|
|
41
29
|
};
|
|
42
30
|
const taskList = (0, toolkit_1.createSlice)({
|
|
43
31
|
name: 'taskList',
|
|
@@ -58,40 +46,15 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
58
46
|
draft.error = undefined;
|
|
59
47
|
},
|
|
60
48
|
updateTaskList(draft, action) {
|
|
61
|
-
|
|
49
|
+
var _a;
|
|
50
|
+
const { data, updateType } = action.payload;
|
|
62
51
|
draft.fetchState = 'Completed';
|
|
63
52
|
draft.error = undefined;
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (taskIdsByGroupsIds[groupId] != null) {
|
|
70
|
-
taskIdsByGroupsIds[groupId].push(task.task_id);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
taskIdsByGroupsIds[groupId] = [task.task_id];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
draft.taskIdsByGroupsIds = taskIdsByGroupsIds;
|
|
79
|
-
},
|
|
80
|
-
initiateTaskListLocalData(draft, action) {
|
|
81
|
-
const { taskGroupById } = action.payload;
|
|
82
|
-
const existingTaskGroupNamesByGroupId = {};
|
|
83
|
-
let defaultTaskGroupId = null;
|
|
84
|
-
Object.keys(taskGroupById).forEach((groupId) => {
|
|
85
|
-
existingTaskGroupNamesByGroupId[groupId] = taskGroupById[groupId].name;
|
|
86
|
-
if (taskGroupById[groupId].isDefault === true) {
|
|
87
|
-
defaultTaskGroupId = groupId;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
draft.localData = Object.assign(Object.assign({}, exports.initialLocalData), { defaultTaskGroupId,
|
|
91
|
-
existingTaskGroupNamesByGroupId });
|
|
92
|
-
},
|
|
93
|
-
updateTaskListLocalData(draft, action) {
|
|
94
|
-
draft.localData = action.payload.localData;
|
|
53
|
+
const newAccounts = (_a = data.map((task) => task.task_id)) !== null && _a !== void 0 ? _a : [];
|
|
54
|
+
draft.taskIds =
|
|
55
|
+
updateType === 'merge'
|
|
56
|
+
? [...new Set([...draft.taskIds, ...newAccounts])]
|
|
57
|
+
: newAccounts;
|
|
95
58
|
},
|
|
96
59
|
updateTaskListFetchStatus(draft, action) {
|
|
97
60
|
draft.fetchState = action.payload.fetchState;
|
|
@@ -116,100 +79,10 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
116
79
|
draft.filters = action.payload.filters;
|
|
117
80
|
}
|
|
118
81
|
},
|
|
119
|
-
updateTaskListOnNewGroupCreationSuccess(draft, action) {
|
|
120
|
-
const { newTaskGroup } = action.payload;
|
|
121
|
-
draft.localData = Object.assign(Object.assign({}, draft.localData), { existingTaskGroupNamesByGroupId: Object.assign(Object.assign({}, draft.localData.existingTaskGroupNamesByGroupId), { [newTaskGroup.task_group_id]: newTaskGroup.name }) });
|
|
122
|
-
},
|
|
123
|
-
bulkUpdateTaskList: {
|
|
124
|
-
reducer(draft) {
|
|
125
|
-
draft.updateTasksFetchState = {
|
|
126
|
-
fetchState: 'In-Progress',
|
|
127
|
-
error: undefined,
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
prepare(taskIds, updates) {
|
|
131
|
-
return {
|
|
132
|
-
payload: {
|
|
133
|
-
taskIds,
|
|
134
|
-
updates,
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
dragNDropTasks: {
|
|
140
|
-
reducer() {
|
|
141
|
-
//do nothing
|
|
142
|
-
},
|
|
143
|
-
prepare(taskIds, groupId) {
|
|
144
|
-
return {
|
|
145
|
-
payload: {
|
|
146
|
-
taskIds,
|
|
147
|
-
groupId,
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
updateTasksListOnBulkUpdateTasksSuccess(draft, action) {
|
|
153
|
-
const { taskIds, groupId } = action.payload;
|
|
154
|
-
draft.updateTasksFetchState.fetchState = 'Completed';
|
|
155
|
-
draft.updateTasksFetchState.error = undefined;
|
|
156
|
-
Object.keys(draft.taskIdsByGroupsIds).forEach((groupId) => {
|
|
157
|
-
draft.taskIdsByGroupsIds[groupId] = draft.taskIdsByGroupsIds[groupId].filter((taskId) => taskIds.includes(taskId) === false);
|
|
158
|
-
});
|
|
159
|
-
if (groupId != null) {
|
|
160
|
-
if (draft.taskIdsByGroupsIds[groupId] != null) {
|
|
161
|
-
draft.taskIdsByGroupsIds[groupId] = [
|
|
162
|
-
...draft.taskIdsByGroupsIds[groupId],
|
|
163
|
-
...taskIds,
|
|
164
|
-
];
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
draft.taskIdsByGroupsIds = Object.assign(Object.assign({}, draft.taskIdsByGroupsIds), { [groupId]: taskIds });
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
draft.localData = Object.assign(Object.assign({}, draft.localData), { newTaskGroupName: '', selectedTaskIds: [] });
|
|
171
|
-
},
|
|
172
|
-
updateTasksListOnBulkUpdateTasksFailure(draft, action) {
|
|
173
|
-
draft.updateTasksFetchState.fetchState = 'Error';
|
|
174
|
-
draft.updateTasksFetchState.error = action.payload.error;
|
|
175
|
-
},
|
|
176
|
-
updateTaskListOnTaskGroupDeletion(draft, action) {
|
|
177
|
-
var _a;
|
|
178
|
-
const { taskGroupId } = action.payload;
|
|
179
|
-
const { defaultTaskGroupId } = draft.localData;
|
|
180
|
-
if (((_a = draft.taskIdsByGroupsIds[taskGroupId]) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
181
|
-
const tasks = draft.taskIdsByGroupsIds[taskGroupId];
|
|
182
|
-
if (defaultTaskGroupId != null) {
|
|
183
|
-
draft.taskIdsByGroupsIds[defaultTaskGroupId] = [
|
|
184
|
-
...draft.taskIdsByGroupsIds[defaultTaskGroupId],
|
|
185
|
-
...tasks,
|
|
186
|
-
];
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
delete draft.taskIdsByGroupsIds[taskGroupId];
|
|
190
|
-
delete draft.localData.existingTaskGroupNamesByGroupId[taskGroupId];
|
|
191
|
-
},
|
|
192
|
-
updateTaskListOnNewTaskCreationSuccess(draft, action) {
|
|
193
|
-
const { taskId, taskGroupId } = action.payload;
|
|
194
|
-
draft.taskIds.push(taskId);
|
|
195
|
-
if (draft.taskIdsByGroupsIds[taskGroupId] != null) {
|
|
196
|
-
draft.taskIdsByGroupsIds[taskGroupId] = [
|
|
197
|
-
taskId,
|
|
198
|
-
...draft.taskIdsByGroupsIds[taskGroupId],
|
|
199
|
-
];
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
draft.taskIdsByGroupsIds[taskGroupId] = [taskId];
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
updateTaskListOnTaskGroupNameUpdate(draft, action) {
|
|
206
|
-
const { taskGroupName, taskGroupId } = action.payload;
|
|
207
|
-
draft.localData.existingTaskGroupNamesByGroupId = Object.assign(Object.assign({}, draft.localData.existingTaskGroupNamesByGroupId), { [taskGroupId]: taskGroupName });
|
|
208
|
-
},
|
|
209
82
|
clearTaskList(draft) {
|
|
210
83
|
Object.assign(draft, exports.initialState);
|
|
211
84
|
},
|
|
212
85
|
},
|
|
213
86
|
});
|
|
214
|
-
_a = taskList.actions, exports.fetchTaskListPage = _a.fetchTaskListPage, exports.fetchTaskList = _a.fetchTaskList, exports.updateTaskList = _a.updateTaskList, exports.updateTaskListFetchStatus = _a.updateTaskListFetchStatus, exports.updateTaskListSearchText = _a.updateTaskListSearchText, exports.updateTaskListUIState = _a.updateTaskListUIState, exports.updateTaskFilters = _a.updateTaskFilters, exports.
|
|
87
|
+
_a = taskList.actions, exports.fetchTaskListPage = _a.fetchTaskListPage, exports.fetchTaskList = _a.fetchTaskList, exports.updateTaskList = _a.updateTaskList, exports.updateTaskListFetchStatus = _a.updateTaskListFetchStatus, exports.updateTaskListSearchText = _a.updateTaskListSearchText, exports.updateTaskListUIState = _a.updateTaskListUIState, exports.updateTaskFilters = _a.updateTaskFilters, exports.clearTaskList = _a.clearTaskList;
|
|
215
88
|
exports.default = taskList.reducer;
|
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
1
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
2
|
import { Task } from '../../../entity/task/taskState';
|
|
4
3
|
import { RootState } from '../../../reducer';
|
|
5
4
|
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
6
|
-
import { TaskListFilters, TaskListUIState
|
|
5
|
+
import { TaskListFilters, TaskListUIState } from './taskList';
|
|
7
6
|
import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
8
|
-
import { TaskGroup } from '../../../entity/taskGroup/taskGroupState';
|
|
9
7
|
export interface TaskWithUserDetails extends Task {
|
|
10
8
|
assigneeUsers: UserAndRole[];
|
|
11
9
|
}
|
|
12
|
-
export interface TaskGroupWithTasksList extends TaskGroup {
|
|
13
|
-
tasks: TaskWithUserDetails[];
|
|
14
|
-
}
|
|
15
10
|
export interface TaskListSelectorView extends SelectorView {
|
|
16
|
-
|
|
11
|
+
taskList: TaskWithUserDetails[];
|
|
17
12
|
searchText: string;
|
|
18
13
|
uiState: TaskListUIState;
|
|
19
14
|
filters: TaskListFilters;
|
|
20
15
|
userList: UserListSelectorView;
|
|
21
|
-
localData: TaskListLocalData;
|
|
22
|
-
updateTasksFetchState: FetchStateAndError;
|
|
23
|
-
taskGroupDeleteStatus: FetchStateAndError;
|
|
24
|
-
taskGroupUpdateStatus: FetchStateAndError;
|
|
25
|
-
taskGroupCreationStatus: FetchStateAndError;
|
|
26
16
|
}
|
|
27
17
|
export declare const getAllTasks: (state: RootState) => TaskListSelectorView;
|
|
@@ -12,10 +12,26 @@ const userAndRole_1 = require("../../companyView/types/userAndRole");
|
|
|
12
12
|
const userListViewSelector_1 = require("../../userListView/userListViewSelector");
|
|
13
13
|
const spendManagementFilterHelpers_1 = require("../../spendManagement/spendManagementFilterHelpers");
|
|
14
14
|
const tagSelector_1 = require("../../../entity/tag/tagSelector");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
15
|
+
const getAllTasks = (state) => {
|
|
16
|
+
const { taskListState, taskState, userState, userRoleState, addressState } = state;
|
|
17
|
+
const searchText = taskListState.searchText;
|
|
18
|
+
const unFilteredTaskList = taskListState.taskIds
|
|
19
|
+
.map((taskId) => {
|
|
20
|
+
const task = (0, taskSelector_1.getTaskById)(taskState, taskId);
|
|
21
|
+
if (task != null) {
|
|
22
|
+
const assigneeUsers = task.assignees
|
|
23
|
+
.map((userId) => (0, userAndRole_1.getUserAndUserRole)(userState, userRoleState, addressState, userId))
|
|
24
|
+
.filter((value) => value != null);
|
|
25
|
+
return Object.assign(Object.assign({}, task), { assigneeUsers });
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
})
|
|
29
|
+
.filter((value) => value != null);
|
|
30
|
+
const searchedTaskList = unFilteredTaskList.filter((task) => task.name.toLowerCase().includes(searchText.toLowerCase()));
|
|
31
|
+
const sortKey = taskListState.uiState.sortKey;
|
|
32
|
+
const sortOrder = (0, sortOrderPayload_1.getSortOrder)(taskListState.uiState.sortOrder);
|
|
33
|
+
const filteredTaskList = (0, spendManagementFilterHelpers_1.applyAdvancedFiltersOnList)('task_management', searchedTaskList, taskListState.filters);
|
|
34
|
+
const tasksInOrder = (0, orderBy_1.default)(filteredTaskList, (task) => {
|
|
19
35
|
var _a, _b;
|
|
20
36
|
const tagsByIds = (0, tagSelector_1.getTagsByIds)(state.tagState, task.tagIds);
|
|
21
37
|
switch (sortKey) {
|
|
@@ -34,67 +50,15 @@ const sortTasksList = (state, tasksList, sortKey, sortOrder) => {
|
|
|
34
50
|
return task.name.toLowerCase();
|
|
35
51
|
}
|
|
36
52
|
}, sortOrder);
|
|
37
|
-
return tasksInOrder;
|
|
38
|
-
};
|
|
39
|
-
const getAllTasks = (state) => {
|
|
40
|
-
const { taskListState, taskState, userState, userRoleState, addressState, taskGroupState, taskGroupViewState, tagViewState, } = state;
|
|
41
|
-
const { localData, searchText } = taskListState;
|
|
42
|
-
const sortKey = taskListState.uiState.sortKey;
|
|
43
|
-
const sortOrder = (0, sortOrderPayload_1.getSortOrder)(taskListState.uiState.sortOrder);
|
|
44
|
-
const taskGroupIds = taskGroupViewState.taskGroupsIds;
|
|
45
|
-
const taskGroupsWithTasksList = taskGroupIds
|
|
46
|
-
.map((taskGroupId) => {
|
|
47
|
-
var _a;
|
|
48
|
-
const taskGroup = (0, taskGroupSelector_1.getTaskGroupById)(taskGroupState, taskGroupId);
|
|
49
|
-
const taskIds = (_a = taskListState.taskIdsByGroupsIds[taskGroupId]) !== null && _a !== void 0 ? _a : [];
|
|
50
|
-
const tasks = taskIds
|
|
51
|
-
.map((taskId) => {
|
|
52
|
-
const task = (0, taskSelector_1.getTaskById)(taskState, taskId);
|
|
53
|
-
if (task != null) {
|
|
54
|
-
const assigneeUsers = task.assignees
|
|
55
|
-
.map((userId) => (0, userAndRole_1.getUserAndUserRole)(userState, userRoleState, addressState, userId))
|
|
56
|
-
.filter((value) => value != null);
|
|
57
|
-
return Object.assign(Object.assign({}, task), { assigneeUsers });
|
|
58
|
-
}
|
|
59
|
-
return undefined;
|
|
60
|
-
})
|
|
61
|
-
.filter((value) => (value === null || value === void 0 ? void 0 : value.name.toLowerCase().includes(searchText.toLowerCase())) ===
|
|
62
|
-
true);
|
|
63
|
-
if (taskGroup != null) {
|
|
64
|
-
const filteredTaskList = (0, spendManagementFilterHelpers_1.applyAdvancedFiltersOnList)('task_management', tasks, taskListState.filters);
|
|
65
|
-
const sortedTaskList = sortTasksList(state, filteredTaskList, sortKey, sortOrder);
|
|
66
|
-
return Object.assign(Object.assign({}, taskGroup), { tasks: sortedTaskList });
|
|
67
|
-
}
|
|
68
|
-
return undefined;
|
|
69
|
-
})
|
|
70
|
-
.filter((value) => value != null);
|
|
71
|
-
taskGroupsWithTasksList.sort((a, b) => {
|
|
72
|
-
return b.createdAt.valueOf() - a.createdAt.valueOf();
|
|
73
|
-
});
|
|
74
|
-
const sortedTaskGroupsWithTasksList = taskGroupsWithTasksList.filter((taskGroup) => taskGroup.isDefault === false);
|
|
75
|
-
const defaultTaskGroup = taskGroupsWithTasksList.find((taskGroup) => taskGroup.isDefault === true);
|
|
76
|
-
if (defaultTaskGroup != null) {
|
|
77
|
-
sortedTaskGroupsWithTasksList.push(defaultTaskGroup);
|
|
78
|
-
}
|
|
79
|
-
const { fetchState, error } = (0, reduceFetchState_1.reduceAnyFetchState)([
|
|
80
|
-
taskListState,
|
|
81
|
-
taskGroupViewState,
|
|
82
|
-
tagViewState,
|
|
83
|
-
]);
|
|
84
53
|
return {
|
|
54
|
+
taskList: tasksInOrder,
|
|
85
55
|
searchText: taskListState.searchText,
|
|
86
56
|
uiState: taskListState.uiState,
|
|
87
57
|
filters: taskListState.filters,
|
|
88
|
-
fetchState: fetchState,
|
|
58
|
+
fetchState: taskListState.fetchState,
|
|
89
59
|
userList: (0, userListViewSelector_1.getUserList)(state, 'taskManagerCandidate'),
|
|
90
|
-
error: error,
|
|
60
|
+
error: taskListState.error,
|
|
91
61
|
version: 0,
|
|
92
|
-
taskGroupsWithTasksList: sortedTaskGroupsWithTasksList,
|
|
93
|
-
localData,
|
|
94
|
-
updateTasksFetchState: taskListState.updateTasksFetchState,
|
|
95
|
-
taskGroupDeleteStatus: taskGroupViewState.taskGroupDeleteStatus,
|
|
96
|
-
taskGroupUpdateStatus: taskGroupViewState.taskGroupUpdateStatus,
|
|
97
|
-
taskGroupCreationStatus: taskGroupViewState.taskGroupCreationStatus,
|
|
98
62
|
};
|
|
99
63
|
};
|
|
100
64
|
exports.getAllTasks = getAllTasks;
|
|
@@ -23,8 +23,8 @@ const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
|
23
23
|
const recommendationPayload_1 = require("../../../commonPayloadTypes/recommendationPayload");
|
|
24
24
|
const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
25
25
|
const vendorReducer_1 = require("../../../entity/vendor/vendorReducer");
|
|
26
|
-
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
27
26
|
const transactionType_1 = require("../../../entity/transaction/stateTypes/transactionType");
|
|
27
|
+
const transactionSelector_1 = require("../../../entity/transaction/transactionSelector");
|
|
28
28
|
const updateTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionDetailReducer_1.updateTransactionDetail.match), (0, operators_1.mergeMap)((action) => {
|
|
29
29
|
const { transactionState, vendorState, transactionDetailState } = state$.value;
|
|
30
30
|
return zeniAPI
|
|
@@ -63,15 +63,11 @@ const updateTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
63
63
|
}));
|
|
64
64
|
actions.push((0, transactionDetailReducer_1.updateTransactionDetailSaveStatus)(transactionIdResp, 'Completed'));
|
|
65
65
|
let callMarkTransactionAsNotMiscategorized = true;
|
|
66
|
-
// NOTE: If tran is vendorType
|
|
66
|
+
// NOTE: If tran is vendorType transaction and there is no vendor chosen on this tranaction while saving,
|
|
67
67
|
// then we need to skip mark-miscategorized-as-correct api call
|
|
68
|
-
if ((0, transactionType_1.toVendorTransactionTypeStrict)(response.data.transaction.transaction_type) != null
|
|
69
|
-
(0, transactionType_1.toJEAndDepositTransactionTypeStrict)(response.data.transaction.transaction_type) != null) {
|
|
68
|
+
if ((0, transactionType_1.toVendorTransactionTypeStrict)(response.data.transaction.transaction_type) != null) {
|
|
70
69
|
const isAnyClassMissing = checkIfClassMissingForAnyLineItem(response.data.transaction);
|
|
71
|
-
|
|
72
|
-
if (((vendorUpdates === null || vendorUpdates === void 0 ? void 0 : vendorUpdates.id) == null &&
|
|
73
|
-
isVendorOrCustomerMissingInAnyLine == true) ||
|
|
74
|
-
isAnyClassMissing == true) {
|
|
70
|
+
if ((vendorUpdates === null || vendorUpdates === void 0 ? void 0 : vendorUpdates.id) == null || isAnyClassMissing == true) {
|
|
75
71
|
callMarkTransactionAsNotMiscategorized = false;
|
|
76
72
|
}
|
|
77
73
|
}
|
|
@@ -200,7 +196,7 @@ const toTransactionUpdatePayload = (updates, detail, vendorUpdates) => {
|
|
|
200
196
|
};
|
|
201
197
|
const checkIfClassMissingForAnyLineItem = (transactionPayload) => {
|
|
202
198
|
let isAnyClassMissing = false;
|
|
203
|
-
if (transactionPayload.lines != null) {
|
|
199
|
+
if ((transactionPayload === null || transactionPayload === void 0 ? void 0 : transactionPayload.lines) != null) {
|
|
204
200
|
transactionPayload.lines.forEach((line) => {
|
|
205
201
|
var _a;
|
|
206
202
|
if (((_a = line.line_detail) === null || _a === void 0 ? void 0 : _a.class.accounting_class_id) == null) {
|
|
@@ -210,19 +206,6 @@ const checkIfClassMissingForAnyLineItem = (transactionPayload) => {
|
|
|
210
206
|
}
|
|
211
207
|
return isAnyClassMissing;
|
|
212
208
|
};
|
|
213
|
-
const checkIfVendorOrCustomerMissingForAnyLineItem = (transactionPayload) => {
|
|
214
|
-
let isAnyVendorOrCustomerMissing = false;
|
|
215
|
-
if (transactionPayload.lines != null) {
|
|
216
|
-
transactionPayload.lines.forEach((line) => {
|
|
217
|
-
var _a, _b;
|
|
218
|
-
if (((_a = line.line_detail) === null || _a === void 0 ? void 0 : _a.vendor) == null &&
|
|
219
|
-
((_b = line.line_detail) === null || _b === void 0 ? void 0 : _b.customer) == null) {
|
|
220
|
-
isAnyVendorOrCustomerMissing = true;
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
return isAnyVendorOrCustomerMissing;
|
|
225
|
-
};
|
|
226
209
|
const toEntityUpdatePayload = (entityUpdates) => {
|
|
227
210
|
const entityUpdatesPayload = [];
|
|
228
211
|
let entityKey;
|
package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewViewEpic.js
CHANGED
|
@@ -67,7 +67,6 @@ const mapVendorPayloadFromVendorFirstReviewViewResponse = (vendor) => {
|
|
|
67
67
|
qbo_id: vendor.qbo_id,
|
|
68
68
|
currency_code: vendor.currency_code,
|
|
69
69
|
currency_symbol: vendor.currency_symbol,
|
|
70
|
-
transaction_attachments: vendor.transaction_attachments,
|
|
71
70
|
};
|
|
72
71
|
};
|
|
73
72
|
const mapUsersPayloadFromVendorFirstReviewViewResponse = (vendorsResponse) => {
|
package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorFirstReviewViewEpic.js
CHANGED
|
@@ -21,12 +21,12 @@ const fetchVendorFirstReviewViewEpic_1 = require("./fetchVendorFirstReviewViewEp
|
|
|
21
21
|
const globalMerchantSelector_1 = require("../../../../entity/globalMerchant/globalMerchantSelector");
|
|
22
22
|
const saveVendorFirstReviewViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorFirstReviewViewReducer_1.saveVendorFirstReviewView.match), (0, operators_1.mergeMap)((action) => {
|
|
23
23
|
const { vendorFirstReviewViewState, globalMerchantState, vendorState } = state$.value;
|
|
24
|
-
const { vendorId, markAsEmployee
|
|
24
|
+
const { vendorId, markAsEmployee } = action.payload;
|
|
25
25
|
const currentVendorLocalData = vendorFirstReviewViewState.vendorFirstReviewViewLocalDataById[vendorId]
|
|
26
26
|
.vendorFirstReviewViewLocalData;
|
|
27
27
|
const currentVendor = (0, vendorSelector_1.getVendorByVendorId)(state$.value.vendorState, vendorId);
|
|
28
28
|
const { vendorName, selectedGlobalMerchant, recommendations, nonExistingRecommendations, } = getSaveVendorFirstReviewViewPayloadDetails(currentVendorLocalData, globalMerchantState, vendorState);
|
|
29
|
-
const payload = Object.assign({}, prepareSaveVendorFirstReviewViewPayload(vendorName, recommendations, nonExistingRecommendations, markAsEmployee,
|
|
29
|
+
const payload = Object.assign({}, prepareSaveVendorFirstReviewViewPayload(vendorName, recommendations, nonExistingRecommendations, markAsEmployee, currentVendor === null || currentVendor === void 0 ? void 0 : currentVendor.qboId, selectedGlobalMerchant));
|
|
30
30
|
const queryParam = {
|
|
31
31
|
view: 'merchant_review_list',
|
|
32
32
|
};
|
|
@@ -68,14 +68,9 @@ const saveVendorFirstReviewViewEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
68
68
|
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
69
69
|
messageSection: payload.is_employee === true
|
|
70
70
|
? 'save_vendor_marked_as_employee'
|
|
71
|
-
:
|
|
72
|
-
? 'save_vendor_marked_as_local_contractor'
|
|
73
|
-
: 'save_vendor_sent_for_review',
|
|
71
|
+
: 'save_vendor_sent_for_review',
|
|
74
72
|
messageText: 'success',
|
|
75
|
-
type: payload.is_employee === true
|
|
76
|
-
payload.is_local_contractor === true
|
|
77
|
-
? 'success'
|
|
78
|
-
: 'info',
|
|
73
|
+
type: payload.is_employee === true ? 'success' : 'info',
|
|
79
74
|
variables: [
|
|
80
75
|
{
|
|
81
76
|
variableName: '_vendor_name_',
|
|
@@ -148,7 +143,7 @@ exports.saveVendorFirstReviewViewEpic = saveVendorFirstReviewViewEpic;
|
|
|
148
143
|
/**
|
|
149
144
|
* Helpers
|
|
150
145
|
*/
|
|
151
|
-
const prepareSaveVendorFirstReviewViewPayload = (vendorName, recommendations, nonExistingRecommendations, markAsEmployee,
|
|
146
|
+
const prepareSaveVendorFirstReviewViewPayload = (vendorName, recommendations, nonExistingRecommendations, markAsEmployee, vendorQboId, selectedGlobalMerchant) => {
|
|
152
147
|
const selectedGlobalMerchantBase = (selectedGlobalMerchant === null || selectedGlobalMerchant === void 0 ? void 0 : selectedGlobalMerchant.globalMerchantId) != null
|
|
153
148
|
? (0, omit_1.default)((0, globalMerchantPayload_1.toGlobalMerchantBasePayload)(selectedGlobalMerchant), ['create_time', 'update_time'])
|
|
154
149
|
: selectedGlobalMerchant != null
|
|
@@ -160,7 +155,6 @@ const prepareSaveVendorFirstReviewViewPayload = (vendorName, recommendations, no
|
|
|
160
155
|
selected_global_merchant: markAsEmployee === true ? null : selectedGlobalMerchantBase,
|
|
161
156
|
recommendations: (0, commonTypes_2.toVendorReviewViewRecommendationPayload)(recommendations, nonExistingRecommendations),
|
|
162
157
|
is_employee: markAsEmployee,
|
|
163
|
-
is_local_contractor: markAsLocalContractor,
|
|
164
158
|
};
|
|
165
159
|
return payload;
|
|
166
160
|
};
|
|
@@ -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;
|