@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
|
@@ -15,17 +15,26 @@ const taskListReducer_1 = require("../taskListReducer");
|
|
|
15
15
|
const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.bulkUpdateTaskList.match), (0, operators_1.switchMap)((action) => {
|
|
16
16
|
const state = state$.value;
|
|
17
17
|
const { taskIds, updates, groupId } = action.payload;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
// Move-to-group uses old endpoint with full task objects;
|
|
19
|
+
// all other bulk operations use the bulk-update endpoint
|
|
20
|
+
const isMoveToGroup = groupId != null;
|
|
21
|
+
const url = isMoveToGroup
|
|
22
|
+
? `${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`
|
|
23
|
+
: `${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/bulk-update`;
|
|
24
|
+
const payload = isMoveToGroup
|
|
25
|
+
? { tasks: (0, exports.getTasksListPayload)(state, taskIds, updates) }
|
|
26
|
+
: { task_ids: taskIds, updates: toBulkUpdatesPayload(updates) };
|
|
22
27
|
return zeniAPI
|
|
23
|
-
.putAndGetJSON(
|
|
28
|
+
.putAndGetJSON(url, payload)
|
|
24
29
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
25
30
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
31
|
+
const removeFromList = updates.isArchived != null ||
|
|
32
|
+
updates.isDeleted != null ||
|
|
33
|
+
'snoozedUntil' in updates;
|
|
26
34
|
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(response.data.tasks), (0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
27
35
|
taskIds,
|
|
28
36
|
groupId,
|
|
37
|
+
removeFromList,
|
|
29
38
|
}));
|
|
30
39
|
}
|
|
31
40
|
else {
|
|
@@ -41,7 +50,7 @@ const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
41
50
|
}));
|
|
42
51
|
}));
|
|
43
52
|
exports.bulkUpdateTaskListEpic = bulkUpdateTaskListEpic;
|
|
44
|
-
const toBulkUpdatesPayload = (
|
|
53
|
+
const toBulkUpdatesPayload = (updates) => {
|
|
45
54
|
const payload = {};
|
|
46
55
|
if (updates.status != null) {
|
|
47
56
|
payload.status = updates.status.code;
|
|
@@ -76,9 +85,6 @@ const toBulkUpdatesPayload = (_state, updates, groupId) => {
|
|
|
76
85
|
payload.snoozed_at = null;
|
|
77
86
|
payload.is_snooze_notification_sent = false;
|
|
78
87
|
}
|
|
79
|
-
if (groupId != null) {
|
|
80
|
-
payload.task_group_ids = [groupId];
|
|
81
|
-
}
|
|
82
88
|
return payload;
|
|
83
89
|
};
|
|
84
90
|
const getTasksListPayload = (state, taskIds, updates) => {
|
|
@@ -14,6 +14,7 @@ const dragNDropTasksEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
|
|
|
14
14
|
(0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
15
15
|
taskIds,
|
|
16
16
|
groupId,
|
|
17
|
+
removeFromList: false,
|
|
17
18
|
}),
|
|
18
19
|
(0, taskListReducer_1.bulkUpdateTaskList)(taskIds, groupId, updates),
|
|
19
20
|
];
|
|
@@ -32,6 +32,7 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
32
32
|
groupId: string | null;
|
|
33
33
|
}, "taskList/bulkUpdateTaskList", never, never>, updateTasksListOnBulkUpdateTasksSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
34
34
|
groupId: ID | null;
|
|
35
|
+
removeFromList: boolean;
|
|
35
36
|
taskIds: ID[];
|
|
36
37
|
}, "taskList/updateTasksListOnBulkUpdateTasksSuccess">, updateTasksListOnBulkUpdateTasksFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
37
38
|
error: ZeniAPIStatus;
|
|
@@ -217,12 +217,10 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
217
217
|
},
|
|
218
218
|
},
|
|
219
219
|
updateTasksListOnBulkUpdateTasksSuccess(draft, action) {
|
|
220
|
-
const { taskIds, groupId } = action.payload;
|
|
220
|
+
const { taskIds, groupId, removeFromList } = action.payload;
|
|
221
221
|
draft.updateTasksFetchState.fetchState = 'Completed';
|
|
222
222
|
draft.updateTasksFetchState.error = undefined;
|
|
223
|
-
if (
|
|
224
|
-
// Tab-changing operations (archive/delete/unarchive/undo-delete/unsnooze):
|
|
225
|
-
// Remove affected tasks from the current tab's top-level indices
|
|
223
|
+
if (removeFromList) {
|
|
226
224
|
removeTaskIdsFromTopLevel(draft, taskIds);
|
|
227
225
|
}
|
|
228
226
|
else if (groupId != null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.20.2-
|
|
3
|
+
"version": "4.20.2-beta33RR",
|
|
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
|
"module": "lib/esm/index.js",
|