@zeniai/client-epic-state 5.0.14-betaRR01 → 5.0.14
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/file/fileState.d.ts +4 -4
- package/lib/entity/file/fileState.js +0 -4
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/entity/task/taskPayload.d.ts +0 -3
- package/lib/entity/task/taskPayload.js +0 -5
- package/lib/entity/task/taskState.d.ts +0 -3
- package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
- package/lib/epic.d.ts +1 -3
- package/lib/epic.js +1 -3
- package/lib/esm/entity/file/fileState.js +0 -4
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/esm/entity/task/taskPayload.js +0 -5
- package/lib/esm/epic.js +1 -3
- package/lib/esm/index.js +4 -4
- package/lib/esm/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +0 -3
- package/lib/esm/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +0 -5
- package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -1
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +0 -4
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +1 -51
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -15
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +21 -56
- package/lib/esm/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +0 -1
- package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +3 -13
- package/lib/esm/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +2 -3
- package/lib/esm/view/taskManager/taskListView/taskList.js +0 -7
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +12 -91
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +39 -48
- package/lib/index.d.ts +4 -4
- package/lib/index.js +4 -9
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +0 -3
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +0 -5
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +0 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -1
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +0 -2
- package/lib/view/taskManager/taskDetailView/taskDetail.js +0 -4
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +1 -10
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +2 -52
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +0 -5
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -15
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +7 -6
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +22 -56
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +0 -1
- package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +3 -13
- package/lib/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +2 -3
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -14
- package/lib/view/taskManager/taskListView/taskList.js +1 -8
- package/lib/view/taskManager/taskListView/taskListPayload.d.ts +0 -3
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +2 -6
- package/lib/view/taskManager/taskListView/taskListReducer.js +13 -92
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +3 -9
- package/lib/view/taskManager/taskListView/taskListSelector.js +39 -48
- package/package.json +1 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -65
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -56
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -69
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -60
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.snoozeTaskEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
|
-
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
-
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
10
|
-
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
11
|
-
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
12
|
-
const snoozeTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.snoozeTask.match), (0, operators_1.mergeMap)((action) => handleSnoozeTask(action.payload.taskId, action.payload.snoozedUntil, zeniAPI)));
|
|
13
|
-
exports.snoozeTaskEpic = snoozeTaskEpic;
|
|
14
|
-
const formatSnoozedUntilForDisplay = (snoozedUntil) => (0, zeniDayJS_1.date)(snoozedUntil).format('MMM D, h:mm A');
|
|
15
|
-
const handleSnoozeTask = (taskId, snoozedUntil, zeniAPI) => {
|
|
16
|
-
const snoozeTaskApi$ = zeniAPI.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}/snooze`, { snoozed_until: snoozedUntil });
|
|
17
|
-
return snoozeTaskApi$.pipe((0, operators_1.mergeMap)((response) => handleApiResponse(response, taskId, snoozedUntil)), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
18
|
-
fetchState: 'Error',
|
|
19
|
-
taskId,
|
|
20
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Snooze Task REST API call errored out: ' + JSON.stringify(error)),
|
|
21
|
-
}))));
|
|
22
|
-
};
|
|
23
|
-
const handleApiResponse = (response, taskId, snoozedUntil) => {
|
|
24
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) &&
|
|
25
|
-
response.data != null &&
|
|
26
|
-
response.data.tasks.length > 0) {
|
|
27
|
-
const fetchActions = [
|
|
28
|
-
(0, taskReducer_1.updateTasks)(response.data.tasks),
|
|
29
|
-
(0, taskListReducer_1.removeTaskFromList)(taskId),
|
|
30
|
-
(0, taskListReducer_1.fetchTaskList)(),
|
|
31
|
-
(0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
32
|
-
fetchState: 'Completed',
|
|
33
|
-
taskId,
|
|
34
|
-
}),
|
|
35
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
36
|
-
messageSection: 'snooze_task',
|
|
37
|
-
messageText: 'success',
|
|
38
|
-
type: 'success',
|
|
39
|
-
variables: [
|
|
40
|
-
{
|
|
41
|
-
variableName: '_snoozed_until_',
|
|
42
|
-
variableValue: formatSnoozedUntilForDisplay(snoozedUntil),
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
}),
|
|
46
|
-
];
|
|
47
|
-
return (0, rxjs_1.from)(fetchActions);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
return (0, rxjs_1.from)([
|
|
51
|
-
(0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
52
|
-
fetchState: 'Error',
|
|
53
|
-
taskId,
|
|
54
|
-
error: response.status,
|
|
55
|
-
}),
|
|
56
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
57
|
-
messageSection: 'snooze_task',
|
|
58
|
-
messageText: 'failed',
|
|
59
|
-
type: 'error',
|
|
60
|
-
variables: [
|
|
61
|
-
{
|
|
62
|
-
variableName: '_api-error_',
|
|
63
|
-
variableValue: response.status.message,
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
}),
|
|
67
|
-
]);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
3
|
-
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
4
|
-
import { RootState } from '../../../../reducer';
|
|
5
|
-
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
-
import { fetchTaskList } from '../../taskListView/taskListReducer';
|
|
7
|
-
import { snoozeTaskSuccessOrFailure, unsnoozeTask } from '../taskDetailReducer';
|
|
8
|
-
export type ActionType = ReturnType<typeof unsnoozeTask> | ReturnType<typeof updateTasks> | ReturnType<typeof openSnackbar> | ReturnType<typeof fetchTaskList> | ReturnType<typeof snoozeTaskSuccessOrFailure>;
|
|
9
|
-
export declare const unsnoozeTaskEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unsnoozeTaskEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
|
-
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
-
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
10
|
-
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
11
|
-
const unsnoozeTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.unsnoozeTask.match), (0, operators_1.mergeMap)((action) => handleUnsnoozeTask(action.payload.taskId, zeniAPI)));
|
|
12
|
-
exports.unsnoozeTaskEpic = unsnoozeTaskEpic;
|
|
13
|
-
const handleUnsnoozeTask = (taskId, zeniAPI) => {
|
|
14
|
-
const unsnoozeTaskApi$ = zeniAPI.deleteAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}/snooze`);
|
|
15
|
-
return unsnoozeTaskApi$.pipe((0, operators_1.mergeMap)((response) => handleApiResponse(response, taskId)), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
16
|
-
fetchState: 'Error',
|
|
17
|
-
taskId,
|
|
18
|
-
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Unsnooze Task REST API call errored out: ' + JSON.stringify(error)),
|
|
19
|
-
}))));
|
|
20
|
-
};
|
|
21
|
-
const handleApiResponse = (response, taskId) => {
|
|
22
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) &&
|
|
23
|
-
response.data != null &&
|
|
24
|
-
response.data.tasks.length > 0) {
|
|
25
|
-
const fetchActions = [
|
|
26
|
-
(0, taskReducer_1.updateTasks)(response.data.tasks),
|
|
27
|
-
(0, taskListReducer_1.fetchTaskList)(),
|
|
28
|
-
(0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
29
|
-
fetchState: 'Completed',
|
|
30
|
-
taskId,
|
|
31
|
-
}),
|
|
32
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
33
|
-
messageSection: 'unsnooze_task',
|
|
34
|
-
messageText: 'success',
|
|
35
|
-
type: 'success',
|
|
36
|
-
}),
|
|
37
|
-
];
|
|
38
|
-
return (0, rxjs_1.from)(fetchActions);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
return (0, rxjs_1.from)([
|
|
42
|
-
(0, taskDetailReducer_1.snoozeTaskSuccessOrFailure)({
|
|
43
|
-
fetchState: 'Error',
|
|
44
|
-
taskId,
|
|
45
|
-
error: response.status,
|
|
46
|
-
}),
|
|
47
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
48
|
-
messageSection: 'unsnooze_task',
|
|
49
|
-
messageText: 'failed',
|
|
50
|
-
type: 'error',
|
|
51
|
-
variables: [
|
|
52
|
-
{
|
|
53
|
-
variableName: '_api-error_',
|
|
54
|
-
variableValue: response.status.message,
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
}),
|
|
58
|
-
]);
|
|
59
|
-
}
|
|
60
|
-
};
|