@zeniai/client-epic-state 5.0.61-betaJK1 → 5.0.61-betaSS1
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/project/projectPayload.d.ts +1 -1
- package/lib/entity/project/projectPayload.js +1 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/epic.d.ts +1 -2
- package/lib/epic.js +1 -2
- package/lib/esm/entity/project/projectPayload.js +1 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
- package/lib/esm/epic.js +1 -2
- package/lib/esm/index.js +14 -13
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +4 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +9 -1
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +80 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +20 -1
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +9 -0
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -2
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +1 -23
- package/lib/index.d.ts +16 -15
- package/lib/index.js +54 -53
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +4 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +8 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +15 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +2 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +8 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +81 -2
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +2 -1
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +14 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +20 -1
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +2 -0
- package/lib/view/expenseAutomationView/types/completedSubTab.js +13 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -2
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -4
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +35 -1
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +0 -12
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +2 -6
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +2 -24
- package/package.json +1 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/createSubTaskEpic.js +0 -62
- package/lib/view/taskManager/taskDetailView/epics/createSubTaskEpic.d.ts +0 -29
- package/lib/view/taskManager/taskDetailView/epics/createSubTaskEpic.js +0 -66
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSubTaskEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const formatMinutesToFromHHMM_1 = require("../../../../commonStateTypes/fiscalYearHelpers/formatMinutesToFromHHMM");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
9
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
10
|
-
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
11
|
-
const createSubTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.createSubTask.match), (0, operators_1.mergeMap)((action) => {
|
|
12
|
-
const payload = prepareSubTaskPayload(action.payload);
|
|
13
|
-
return zeniAPI
|
|
14
|
-
.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload)
|
|
15
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) &&
|
|
17
|
-
response.data != null &&
|
|
18
|
-
response.data.tasks.length > 0) {
|
|
19
|
-
const newTaskId = response.data.tasks[0].task_id;
|
|
20
|
-
return (0, rxjs_1.from)([
|
|
21
|
-
(0, taskReducer_1.updateTasks)(response.data.tasks),
|
|
22
|
-
(0, taskDetailReducer_1.createSubTaskSuccessOrFailure)({
|
|
23
|
-
fetchState: 'Completed',
|
|
24
|
-
newTaskId,
|
|
25
|
-
}),
|
|
26
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
27
|
-
messageSection: 'create_sub_task',
|
|
28
|
-
messageText: 'success',
|
|
29
|
-
type: 'success',
|
|
30
|
-
}),
|
|
31
|
-
]);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
return (0, rxjs_1.of)((0, taskDetailReducer_1.createSubTaskSuccessOrFailure)({
|
|
35
|
-
fetchState: 'Error',
|
|
36
|
-
error: response.status,
|
|
37
|
-
}), (0, snackbarReducer_1.openSnackbar)({
|
|
38
|
-
messageSection: 'create_sub_task',
|
|
39
|
-
messageText: 'failed',
|
|
40
|
-
type: 'error',
|
|
41
|
-
variables: [
|
|
42
|
-
{
|
|
43
|
-
variableName: '_api-error_',
|
|
44
|
-
variableValue: response.status.message,
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, taskDetailReducer_1.createSubTaskSuccessOrFailure)({
|
|
50
|
-
fetchState: 'Error',
|
|
51
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Create Sub Task REST API call errored out' +
|
|
52
|
-
JSON.stringify(error)),
|
|
53
|
-
}))));
|
|
54
|
-
}));
|
|
55
|
-
exports.createSubTaskEpic = createSubTaskEpic;
|
|
56
|
-
const prepareSubTaskPayload = (subTask) => ({
|
|
57
|
-
name: subTask.name,
|
|
58
|
-
assignees: subTask.assignee,
|
|
59
|
-
description: subTask.description,
|
|
60
|
-
priority: subTask.priority,
|
|
61
|
-
status: subTask.status,
|
|
62
|
-
tags: subTask.tagIds,
|
|
63
|
-
time_spent: (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(subTask.timeSpent),
|
|
64
|
-
group_assignees: subTask.groupAssignees,
|
|
65
|
-
parent_task_id: subTask.parentTaskId,
|
|
66
|
-
});
|