@zeniai/client-epic-state 4.20.2-beta31RR → 4.20.2-beta33RR
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/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +15 -9
- package/lib/esm/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +1 -0
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +2 -4
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +15 -9
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +1 -0
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -0
- package/lib/view/taskManager/taskListView/taskListReducer.js +2 -4
- package/package.json +1 -1
|
@@ -9,17 +9,26 @@ import { bulkUpdateTaskList, updateTasksListOnBulkUpdateTasksFailure, updateTask
|
|
|
9
9
|
export const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(bulkUpdateTaskList.match), switchMap((action) => {
|
|
10
10
|
const state = state$.value;
|
|
11
11
|
const { taskIds, updates, groupId } = action.payload;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
// Move-to-group uses old endpoint with full task objects;
|
|
13
|
+
// all other bulk operations use the bulk-update endpoint
|
|
14
|
+
const isMoveToGroup = groupId != null;
|
|
15
|
+
const url = isMoveToGroup
|
|
16
|
+
? `${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`
|
|
17
|
+
: `${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/bulk-update`;
|
|
18
|
+
const payload = isMoveToGroup
|
|
19
|
+
? { tasks: getTasksListPayload(state, taskIds, updates) }
|
|
20
|
+
: { task_ids: taskIds, updates: toBulkUpdatesPayload(updates) };
|
|
16
21
|
return zeniAPI
|
|
17
|
-
.putAndGetJSON(
|
|
22
|
+
.putAndGetJSON(url, payload)
|
|
18
23
|
.pipe(mergeMap((response) => {
|
|
19
24
|
if (isSuccessResponse(response) && response.data != null) {
|
|
25
|
+
const removeFromList = updates.isArchived != null ||
|
|
26
|
+
updates.isDeleted != null ||
|
|
27
|
+
'snoozedUntil' in updates;
|
|
20
28
|
return of(updateTasks(response.data.tasks), updateTasksListOnBulkUpdateTasksSuccess({
|
|
21
29
|
taskIds,
|
|
22
30
|
groupId,
|
|
31
|
+
removeFromList,
|
|
23
32
|
}));
|
|
24
33
|
}
|
|
25
34
|
else {
|
|
@@ -34,7 +43,7 @@ export const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pi
|
|
|
34
43
|
}));
|
|
35
44
|
}));
|
|
36
45
|
}));
|
|
37
|
-
const toBulkUpdatesPayload = (
|
|
46
|
+
const toBulkUpdatesPayload = (updates) => {
|
|
38
47
|
const payload = {};
|
|
39
48
|
if (updates.status != null) {
|
|
40
49
|
payload.status = updates.status.code;
|
|
@@ -69,9 +78,6 @@ const toBulkUpdatesPayload = (_state, updates, groupId) => {
|
|
|
69
78
|
payload.snoozed_at = null;
|
|
70
79
|
payload.is_snooze_notification_sent = false;
|
|
71
80
|
}
|
|
72
|
-
if (groupId != null) {
|
|
73
|
-
payload.task_group_ids = [groupId];
|
|
74
|
-
}
|
|
75
81
|
return payload;
|
|
76
82
|
};
|
|
77
83
|
export const getTasksListPayload = (state, taskIds, updates) => {
|
|
@@ -213,12 +213,10 @@ const taskList = createSlice({
|
|
|
213
213
|
},
|
|
214
214
|
},
|
|
215
215
|
updateTasksListOnBulkUpdateTasksSuccess(draft, action) {
|
|
216
|
-
const { taskIds, groupId } = action.payload;
|
|
216
|
+
const { taskIds, groupId, removeFromList } = action.payload;
|
|
217
217
|
draft.updateTasksFetchState.fetchState = 'Completed';
|
|
218
218
|
draft.updateTasksFetchState.error = undefined;
|
|
219
|
-
if (
|
|
220
|
-
// Tab-changing operations (archive/delete/unarchive/undo-delete/unsnooze):
|
|
221
|
-
// Remove affected tasks from the current tab's top-level indices
|
|
219
|
+
if (removeFromList) {
|
|
222
220
|
removeTaskIdsFromTopLevel(draft, taskIds);
|
|
223
221
|
}
|
|
224
222
|
else if (groupId != null) {
|