@zeniai/client-epic-state 5.0.3-betaND1 → 5.0.3-betaND3
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/task/taskPayload.d.ts +1 -0
- package/lib/entity/task/taskPayload.js +46 -39
- package/lib/entity/task/taskState.d.ts +2 -0
- package/lib/esm/entity/task/taskPayload.js +46 -39
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +4 -0
- package/lib/esm/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +6 -2
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +2 -0
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +4 -0
- package/lib/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +6 -2
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +2 -0
- package/package.json +1 -1
|
@@ -28,6 +28,8 @@ interface UpdateTaskPayload {
|
|
|
28
28
|
task_id: string;
|
|
29
29
|
time_spent: number;
|
|
30
30
|
type: string;
|
|
31
|
+
/** Included when the task is or should become a subtask. */
|
|
32
|
+
parent_task_id?: string;
|
|
31
33
|
}
|
|
32
34
|
export declare const getTasksListPayload: (state: RootState, taskIds: ID[], updates: Partial<Task>) => UpdateTaskPayload[];
|
|
33
35
|
export declare const getTaskPayload: (state: RootState, taskId: ID, updates: Partial<Task>) => UpdateTaskPayload;
|
|
@@ -96,5 +96,9 @@ const toTaskPayload = (state, task) => {
|
|
|
96
96
|
task_group_ids: task.taskGroupIds,
|
|
97
97
|
time_spent: (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(task.timeSpent),
|
|
98
98
|
};
|
|
99
|
+
const parentTaskId = task.parentTaskId;
|
|
100
|
+
if (typeof parentTaskId === 'string' && parentTaskId.length > 0) {
|
|
101
|
+
taskPayload.parent_task_id = parentTaskId;
|
|
102
|
+
}
|
|
99
103
|
return taskPayload;
|
|
100
104
|
};
|
|
@@ -9,9 +9,13 @@ const taskListReducer_1 = require("../taskListReducer");
|
|
|
9
9
|
const bulkUpdateTaskListEpic_1 = require("./bulkUpdateTaskListEpic");
|
|
10
10
|
const updateTaskFromListViewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.updateTaskFromListView.match), (0, operators_1.switchMap)((action) => {
|
|
11
11
|
const state = state$.value;
|
|
12
|
-
const { task, updates } = action.payload;
|
|
12
|
+
const { task, updates, parentTaskId } = action.payload;
|
|
13
13
|
const taskId = task.id;
|
|
14
|
-
const
|
|
14
|
+
const mergedUpdates = { ...updates };
|
|
15
|
+
if (typeof parentTaskId === 'string' && parentTaskId.length > 0) {
|
|
16
|
+
mergedUpdates.parentTaskId = parentTaskId;
|
|
17
|
+
}
|
|
18
|
+
const taskData = (0, bulkUpdateTaskListEpic_1.getTaskPayload)(state, taskId, mergedUpdates);
|
|
15
19
|
return zeniAPI
|
|
16
20
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}`, { ...taskData })
|
|
17
21
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
@@ -52,6 +52,8 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
52
52
|
}, "taskList/updateTaskListOnTaskGroupNameUpdate">, updateTaskFromListView: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
53
53
|
task: Task;
|
|
54
54
|
updates: Partial<Task>;
|
|
55
|
+
/** Merged into the update request as parent_task_id (subtask creation / reparenting). */
|
|
56
|
+
parentTaskId?: ID;
|
|
55
57
|
}, "taskList/updateTaskFromListView">, updateTasksListOnUpdateTaskSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskList/updateTasksListOnUpdateTaskSuccess">, updateTasksListOnUpdateTaskFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
56
58
|
error: ZeniAPIStatus;
|
|
57
59
|
}, "taskList/updateTasksListOnUpdateTaskFailure">, updateTaskListOnCreateTaskFromTemplateSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.3-
|
|
3
|
+
"version": "5.0.3-betaND3",
|
|
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",
|