@zeniai/client-epic-state 5.1.40-betaDI2 → 5.1.40
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 -1
- package/lib/entity/task/taskPayload.d.ts +1 -2
- package/lib/entity/task/taskPayload.js +1 -8
- package/lib/entity/task/taskReducer.d.ts +1 -8
- package/lib/entity/task/taskReducer.js +4 -29
- package/lib/entity/task/taskState.d.ts +0 -1
- package/lib/epic.d.ts +3 -5
- package/lib/epic.js +3 -5
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/esm/entity/task/taskPayload.js +1 -8
- package/lib/esm/entity/task/taskReducer.js +3 -28
- package/lib/esm/epic.js +3 -5
- package/lib/esm/index.js +2 -2
- package/lib/esm/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +0 -3
- package/lib/esm/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +1 -7
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +3 -2
- package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +9 -70
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +2 -56
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +9 -32
- package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +1 -3
- package/lib/esm/view/taskManager/taskListView/taskList.js +0 -1
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +12 -240
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +0 -1
- package/lib/index.d.ts +5 -5
- package/lib/index.js +9 -12
- package/lib/view/companyTaskManagerView/epics/fetchCompanyTaskManagerViewEpic.js +0 -3
- package/lib/view/companyTaskManagerView/epics/fetchTaskManagerMetricsEpic.js +1 -7
- package/lib/view/companyView/types/cockpitTypes.d.ts +0 -3
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +3 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +0 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.d.ts +2 -2
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +8 -69
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +0 -15
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +2 -14
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +3 -57
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +7 -30
- package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +1 -3
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
- package/lib/view/taskManager/taskListView/taskList.js +0 -1
- package/lib/view/taskManager/taskListView/taskListPayload.d.ts +0 -4
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +2 -6
- package/lib/view/taskManager/taskListView/taskListReducer.js +13 -241
- package/lib/view/taskManager/taskListView/taskListSelector.js +0 -1
- package/package.json +1 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/createSubTaskEpic.js +0 -96
- package/lib/esm/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.js +0 -53
- package/lib/view/taskManager/taskDetailView/epics/createSubTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/createSubTaskEpic.js +0 -100
- package/lib/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.d.ts +0 -8
- package/lib/view/taskManager/taskDetailView/epics/fetchSubTasksEpic.js +0 -57
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchSubTasksEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
7
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
-
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
9
|
-
const fetchSubTasksEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.fetchSubTasks.match),
|
|
10
|
-
// Use mergeMap, not switchMap: switchMap cancels in-flight requests for
|
|
11
|
-
// the previous parent without dispatching success or failure, leaving
|
|
12
|
-
// subTaskListFetchStatusByParentId stuck at In-Progress and blocking the
|
|
13
|
-
// detail page's combined fetchStatus via reduceAnyFetchState. Per-parent
|
|
14
|
-
// races on the same parentTaskId are handled last-write-wins downstream.
|
|
15
|
-
(0, operators_1.mergeMap)((action) => {
|
|
16
|
-
const { parentTaskId } = action.payload;
|
|
17
|
-
const query = JSON.stringify({
|
|
18
|
-
task_type: 'subtasks',
|
|
19
|
-
parent_task_id: parentTaskId,
|
|
20
|
-
});
|
|
21
|
-
return zeniAPI
|
|
22
|
-
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks?query=${encodeURIComponent(query)}`)
|
|
23
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
24
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
25
|
-
const { tasks } = response.data;
|
|
26
|
-
// Keep the parent's `subTasksIds` in sync with the fetched
|
|
27
|
-
// bucket. Without this, the parent entity record can drift
|
|
28
|
-
// out of sync with what the children fetch returned —
|
|
29
|
-
// e.g. a server-side delete won't drop from the parent
|
|
30
|
-
// record until the next list re-fetch.
|
|
31
|
-
const fetchedChildIds = tasks
|
|
32
|
-
.filter((t) => t.parent_task_id === parentTaskId)
|
|
33
|
-
.map((t) => t.task_id);
|
|
34
|
-
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(tasks), (0, taskReducer_1.setSubTaskIds)({
|
|
35
|
-
parentTaskId,
|
|
36
|
-
subTaskIds: fetchedChildIds,
|
|
37
|
-
}), (0, taskDetailReducer_1.updateSubTasks)({
|
|
38
|
-
parentTaskId,
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return (0, rxjs_1.of)((0, taskDetailReducer_1.updateSubTasksFetchStatus)({
|
|
43
|
-
parentTaskId,
|
|
44
|
-
fetchState: 'Error',
|
|
45
|
-
error: response.status,
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
}), (0, operators_1.catchError)((error) => {
|
|
49
|
-
return (0, rxjs_1.of)((0, taskDetailReducer_1.updateSubTasksFetchStatus)({
|
|
50
|
-
parentTaskId,
|
|
51
|
-
fetchState: 'Error',
|
|
52
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Sub Tasks REST API call errored out' +
|
|
53
|
-
JSON.stringify(error)),
|
|
54
|
-
}));
|
|
55
|
-
}));
|
|
56
|
-
}));
|
|
57
|
-
exports.fetchSubTasksEpic = fetchSubTasksEpic;
|