@zeniai/client-epic-state 4.20.2-beta35RR → 4.20.2-beta37RR
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/taskDetailView/epics/archiveTaskEpic.js +2 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +2 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +2 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +2 -0
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +7 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.d.ts +2 -2
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.d.ts +2 -2
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.d.ts +2 -2
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +2 -0
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +1 -0
- package/lib/view/taskManager/taskListView/taskListSelector.js +7 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
|
4
4
|
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
5
5
|
import { getTaskById } from '../../../../entity/task/taskSelector';
|
|
6
6
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
7
|
-
import { removeTaskFromList } from '../../taskListView/taskListReducer';
|
|
7
|
+
import { fetchTaskList, removeTaskFromList, } from '../../taskListView/taskListReducer';
|
|
8
8
|
import { archiveTask, archiveTaskSuccessOrFailure } from '../taskDetailReducer';
|
|
9
9
|
// Epic function to handle archiving of tasks
|
|
10
10
|
export const archiveTaskEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(archiveTask.match), mergeMap((action) => handleArchiveTask(action.payload.taskId, state$, zeniAPI)));
|
|
@@ -27,6 +27,7 @@ const handleApiResponse = (response, taskId) => {
|
|
|
27
27
|
const fetchActions = [
|
|
28
28
|
updateTasks(response.data.tasks),
|
|
29
29
|
removeTaskFromList(taskId),
|
|
30
|
+
fetchTaskList(),
|
|
30
31
|
archiveTaskSuccessOrFailure({
|
|
31
32
|
fetchState: 'Completed',
|
|
32
33
|
taskId,
|
|
@@ -2,7 +2,7 @@ import { from, of } from 'rxjs';
|
|
|
2
2
|
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
3
3
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
4
|
import { createZeniAPIStatus, isSuccessStatus, } from '../../../../responsePayload';
|
|
5
|
-
import { removeTaskFromList } from '../../taskListView/taskListReducer';
|
|
5
|
+
import { fetchTaskList, removeTaskFromList, } from '../../taskListView/taskListReducer';
|
|
6
6
|
import { deleteTask, deleteTaskSuccessOrFailure } from '../taskDetailReducer';
|
|
7
7
|
export const deleteTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(deleteTask.match), mergeMap((action) => {
|
|
8
8
|
const { taskId } = action.payload;
|
|
@@ -14,6 +14,7 @@ export const deleteTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filt
|
|
|
14
14
|
if (taskId != null) {
|
|
15
15
|
actions.push(removeTaskFromList(taskId));
|
|
16
16
|
}
|
|
17
|
+
actions.push(fetchTaskList());
|
|
17
18
|
actions.push(deleteTaskSuccessOrFailure({ fetchState: 'Completed', taskId }));
|
|
18
19
|
return from(actions);
|
|
19
20
|
}
|
|
@@ -4,7 +4,7 @@ import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
|
4
4
|
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
5
5
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
6
6
|
import { date } from '../../../../zeniDayJS';
|
|
7
|
-
import { removeTaskFromList } from '../../taskListView/taskListReducer';
|
|
7
|
+
import { fetchTaskList, removeTaskFromList, } from '../../taskListView/taskListReducer';
|
|
8
8
|
import { snoozeTask, snoozeTaskSuccessOrFailure } from '../taskDetailReducer';
|
|
9
9
|
export const snoozeTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(snoozeTask.match), mergeMap((action) => handleSnoozeTask(action.payload.taskId, action.payload.snoozedUntil, zeniAPI)));
|
|
10
10
|
const formatSnoozedUntilForDisplay = (snoozedUntil) => date(snoozedUntil).format('MMM D, h:mm A');
|
|
@@ -23,6 +23,7 @@ const handleApiResponse = (response, taskId, snoozedUntil) => {
|
|
|
23
23
|
const fetchActions = [
|
|
24
24
|
updateTasks(response.data.tasks),
|
|
25
25
|
removeTaskFromList(taskId),
|
|
26
|
+
fetchTaskList(),
|
|
26
27
|
snoozeTaskSuccessOrFailure({
|
|
27
28
|
fetchState: 'Completed',
|
|
28
29
|
taskId,
|
|
@@ -3,6 +3,7 @@ import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
|
3
3
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
4
|
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
5
5
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
6
|
+
import { fetchTaskList } from '../../taskListView/taskListReducer';
|
|
6
7
|
import { snoozeTaskSuccessOrFailure, unsnoozeTask, } from '../taskDetailReducer';
|
|
7
8
|
export const unsnoozeTaskEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(unsnoozeTask.match), mergeMap((action) => handleUnsnoozeTask(action.payload.taskId, zeniAPI)));
|
|
8
9
|
const handleUnsnoozeTask = (taskId, zeniAPI) => {
|
|
@@ -19,6 +20,7 @@ const handleApiResponse = (response, taskId) => {
|
|
|
19
20
|
response.data.tasks.length > 0) {
|
|
20
21
|
const fetchActions = [
|
|
21
22
|
updateTasks(response.data.tasks),
|
|
23
|
+
fetchTaskList(),
|
|
22
24
|
snoozeTaskSuccessOrFailure({
|
|
23
25
|
fetchState: 'Completed',
|
|
24
26
|
taskId,
|
|
@@ -335,8 +335,15 @@ export const getAllTasks = createSelector((state) => state.taskListState, (state
|
|
|
335
335
|
}
|
|
336
336
|
const { fetchState, error } = reduceAnyFetchState(fetchStateVariables);
|
|
337
337
|
const taskGroupTemplates = getTaskGroupTemplateByIds(taskGroupTemplateState, taskGroupTemplateViewState.taskGroupTemplateIds);
|
|
338
|
+
const tabCounts = {
|
|
339
|
+
live: taskListState.byTab.live.taskIds.length,
|
|
340
|
+
archived: taskListState.byTab.archived.taskIds.length,
|
|
341
|
+
deleted: taskListState.byTab.deleted.taskIds.length,
|
|
342
|
+
snoozed: taskListState.byTab.snoozed.taskIds.length,
|
|
343
|
+
};
|
|
338
344
|
return {
|
|
339
345
|
currentTab: taskListState.currentTab,
|
|
346
|
+
tabCounts,
|
|
340
347
|
uiState: taskListState.uiState,
|
|
341
348
|
filters: taskListState.filters,
|
|
342
349
|
taskGroupTemplates,
|