@zeniai/client-epic-state 5.0.32 → 5.0.33-betaRR0
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/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.d.ts +1 -0
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +2 -1
- package/lib/entity/file/fileState.d.ts +4 -4
- package/lib/entity/file/fileState.js +4 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +4 -0
- package/lib/entity/task/taskPayload.d.ts +3 -0
- package/lib/entity/task/taskPayload.js +5 -0
- package/lib/entity/task/taskState.d.ts +3 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -2
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
- package/lib/epic.d.ts +7 -1
- package/lib/epic.js +7 -1
- package/lib/esm/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +1 -0
- package/lib/esm/entity/file/fileState.js +4 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +4 -0
- package/lib/esm/entity/task/taskPayload.js +5 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +4 -0
- package/lib/esm/epic.js +7 -1
- package/lib/esm/index.js +10 -4
- package/lib/esm/init.js +24 -4
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponses.js +1 -0
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesPayload.js +12 -0
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +64 -0
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesSelector.js +3 -0
- package/lib/esm/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +17 -0
- package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +21 -0
- package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +29 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +3 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +5 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +66 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +57 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +4 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +60 -7
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +12 -0
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +56 -21
- package/lib/esm/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +1 -0
- package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +13 -4
- package/lib/esm/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +3 -2
- package/lib/esm/view/taskManager/taskListView/taskList.js +7 -0
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +106 -12
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +48 -39
- package/lib/esm/view/zeniOAuthView/epics/approveOAuthConsentEpic.js +64 -0
- package/lib/esm/view/zeniOAuthView/zeniOAuthParamsParser.js +41 -0
- package/lib/esm/view/zeniOAuthView/zeniOAuthReducer.js +49 -0
- package/lib/esm/view/zeniOAuthView/zeniOAuthSelector.js +3 -0
- package/lib/esm/view/zeniOAuthView/zeniOAuthState.js +1 -0
- package/lib/index.d.ts +12 -4
- package/lib/index.js +28 -5
- package/lib/init.d.ts +5 -3
- package/lib/init.js +24 -4
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/taskManager/cannedResponsesView/cannedResponses.d.ts +19 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponses.js +2 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesPayload.d.ts +21 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesPayload.js +15 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.d.ts +30 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +68 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesSelector.d.ts +3 -0
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesSelector.js +6 -0
- package/lib/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.d.ts +7 -0
- package/lib/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +21 -0
- package/lib/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.d.ts +7 -0
- package/lib/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +25 -0
- package/lib/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.d.ts +7 -0
- package/lib/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +33 -0
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +3 -0
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +5 -0
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.d.ts +9 -0
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +70 -0
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +9 -0
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +61 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +2 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.js +4 -0
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +10 -1
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +61 -8
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +5 -0
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +12 -0
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +6 -7
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +56 -22
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +1 -0
- package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +13 -4
- package/lib/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +3 -2
- package/lib/view/taskManager/taskListView/taskList.d.ts +14 -1
- package/lib/view/taskManager/taskListView/taskList.js +8 -1
- package/lib/view/taskManager/taskListView/taskListPayload.d.ts +3 -0
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +9 -6
- package/lib/view/taskManager/taskListView/taskListReducer.js +107 -13
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +9 -3
- package/lib/view/taskManager/taskListView/taskListSelector.js +48 -39
- package/lib/view/zeniOAuthView/epics/approveOAuthConsentEpic.d.ts +27 -0
- package/lib/view/zeniOAuthView/epics/approveOAuthConsentEpic.js +68 -0
- package/lib/view/zeniOAuthView/zeniOAuthParamsParser.d.ts +16 -0
- package/lib/view/zeniOAuthView/zeniOAuthParamsParser.js +44 -0
- package/lib/view/zeniOAuthView/zeniOAuthReducer.d.ts +29 -0
- package/lib/view/zeniOAuthView/zeniOAuthReducer.js +53 -0
- package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +5 -0
- package/lib/view/zeniOAuthView/zeniOAuthSelector.js +9 -0
- package/lib/view/zeniOAuthView/zeniOAuthState.d.ts +4 -0
- package/lib/view/zeniOAuthView/zeniOAuthState.js +2 -0
- package/package.json +1 -1
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getTaskPayload = exports.
|
|
6
|
+
exports.getTaskPayload = exports.bulkUpdateTaskListEpic = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const rxjs_1 = require("rxjs");
|
|
9
9
|
const operators_1 = require("rxjs/operators");
|
|
@@ -12,20 +12,25 @@ const formatZeniDateFY_1 = require("../../../../commonStateTypes/fiscalYearHelpe
|
|
|
12
12
|
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
13
13
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
14
14
|
const taskListReducer_1 = require("../taskListReducer");
|
|
15
|
-
const bulkUpdateTaskListEpic = (actions$,
|
|
16
|
-
const state = state$.value;
|
|
15
|
+
const bulkUpdateTaskListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.bulkUpdateTaskList.match), (0, operators_1.switchMap)((action) => {
|
|
17
16
|
const { taskIds, updates, groupId } = action.payload;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const bulkUpdates = toBulkUpdatesPayload(updates);
|
|
18
|
+
if (groupId != null) {
|
|
19
|
+
bulkUpdates.task_group_ids = [groupId];
|
|
20
|
+
}
|
|
21
|
+
const payload = { task_ids: taskIds, updates: bulkUpdates };
|
|
21
22
|
return zeniAPI
|
|
22
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload)
|
|
23
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/bulk-update`, payload)
|
|
23
24
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
24
25
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
26
|
+
const removeFromList = updates.isArchived === true ||
|
|
27
|
+
updates.isDeleted === true ||
|
|
28
|
+
('snoozedUntil' in updates && updates.snoozedUntil == null);
|
|
25
29
|
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(response.data.tasks), (0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
26
30
|
taskIds,
|
|
27
31
|
groupId,
|
|
28
|
-
|
|
32
|
+
removeFromList,
|
|
33
|
+
}), (0, taskListReducer_1.fetchTaskList)());
|
|
29
34
|
}
|
|
30
35
|
else {
|
|
31
36
|
return (0, rxjs_1.of)((0, taskListReducer_1.updateTasksListOnBulkUpdateTasksFailure)({
|
|
@@ -40,21 +45,47 @@ const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0,
|
|
|
40
45
|
}));
|
|
41
46
|
}));
|
|
42
47
|
exports.bulkUpdateTaskListEpic = bulkUpdateTaskListEpic;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Helpers
|
|
50
|
+
*/
|
|
51
|
+
const toBulkUpdatesPayload = (updates) => {
|
|
52
|
+
const payload = {};
|
|
53
|
+
if (updates.status != null) {
|
|
54
|
+
payload.status = updates.status.code;
|
|
55
|
+
}
|
|
56
|
+
if (updates.priority != null) {
|
|
57
|
+
payload.priority = updates.priority.code;
|
|
58
|
+
}
|
|
59
|
+
if (updates.assignees != null) {
|
|
60
|
+
payload.assignees = updates.assignees;
|
|
61
|
+
}
|
|
62
|
+
if (updates.groupAssignees != null) {
|
|
63
|
+
payload.group_assignees = updates.groupAssignees;
|
|
64
|
+
}
|
|
65
|
+
if (updates.dueDate != null) {
|
|
66
|
+
payload.due_date = updates.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT);
|
|
67
|
+
}
|
|
68
|
+
if (updates.tagIds != null) {
|
|
69
|
+
payload.tags = updates.tagIds;
|
|
70
|
+
}
|
|
71
|
+
if (updates.timeSpent != null) {
|
|
72
|
+
payload.time_spent = (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(updates.timeSpent.replace(/\D/g, ''));
|
|
73
|
+
}
|
|
74
|
+
if (updates.isArchived != null) {
|
|
75
|
+
payload.is_archived = updates.isArchived;
|
|
76
|
+
}
|
|
77
|
+
if (updates.isDeleted != null) {
|
|
78
|
+
payload.is_deleted = updates.isDeleted;
|
|
79
|
+
}
|
|
80
|
+
// Bulk snooze is not supported — only bulk unsnooze (clear all snooze fields)
|
|
81
|
+
if ('snoozedUntil' in updates) {
|
|
82
|
+
payload.snoozed_until = null;
|
|
83
|
+
payload.snoozed_by = null;
|
|
84
|
+
payload.snoozed_at = null;
|
|
85
|
+
payload.is_snooze_notification_sent = false;
|
|
86
|
+
}
|
|
87
|
+
return payload;
|
|
56
88
|
};
|
|
57
|
-
exports.getTasksListPayload = getTasksListPayload;
|
|
58
89
|
const getTaskPayload = (state, taskId, updates) => {
|
|
59
90
|
const { taskState } = state;
|
|
60
91
|
const taskData = (0, get_1.default)(taskState.taskByID, taskId);
|
|
@@ -80,6 +111,9 @@ const toTaskPayload = (state, task) => {
|
|
|
80
111
|
assignees: task.assignees,
|
|
81
112
|
description: task.description,
|
|
82
113
|
group_assignees: task.groupAssignees,
|
|
114
|
+
is_archived: task.isArchived,
|
|
115
|
+
is_deleted: task.isDeleted,
|
|
116
|
+
snoozed_until: task.snoozedUntil != null ? task.snoozedUntil.toISOString() : null,
|
|
83
117
|
due_date: task.dueDate != null ? task.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) : null,
|
|
84
118
|
priority: task.priority.code,
|
|
85
119
|
status: task.status.code,
|
|
@@ -14,6 +14,7 @@ const dragNDropTasksEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
|
|
|
14
14
|
(0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
15
15
|
taskIds,
|
|
16
16
|
groupId,
|
|
17
|
+
removeFromList: false,
|
|
17
18
|
}),
|
|
18
19
|
(0, taskListReducer_1.bulkUpdateTaskList)(taskIds, groupId, updates),
|
|
19
20
|
];
|
|
@@ -12,10 +12,19 @@ const fetchTaskListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, oper
|
|
|
12
12
|
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks?query=${encodeURIComponent(`{"task_type": "all"}`)}`)
|
|
13
13
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
14
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const { tasks, deleted, archived, snoozed } = response.data;
|
|
16
|
+
const allTasks = [
|
|
17
|
+
...tasks,
|
|
18
|
+
...(deleted ?? []),
|
|
19
|
+
...(archived ?? []),
|
|
20
|
+
...(snoozed ?? []),
|
|
21
|
+
];
|
|
22
|
+
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(allTasks), (0, taskListReducer_1.updateTaskList)({
|
|
23
|
+
data: tasks,
|
|
24
|
+
deleted: deleted ?? [],
|
|
25
|
+
archived: archived ?? [],
|
|
26
|
+
snoozed: snoozed ?? [],
|
|
27
|
+
}), (0, tagReducer_1.updateTags)(allTasks.map((task) => task.tags).flat()));
|
|
19
28
|
}
|
|
20
29
|
else {
|
|
21
30
|
return (0, rxjs_1.of)((0, taskListReducer_1.updateTaskListFetchStatus)({
|
|
@@ -11,9 +11,10 @@ const updateTaskFromListViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
11
11
|
const state = state$.value;
|
|
12
12
|
const { task, updates } = action.payload;
|
|
13
13
|
const taskId = task.id;
|
|
14
|
-
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
+
const { snoozed_until: _snoozedUntil, ...taskData } = (0, bulkUpdateTaskListEpic_1.getTaskPayload)(state, taskId, updates);
|
|
15
16
|
return zeniAPI
|
|
16
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}`,
|
|
17
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}`, taskData)
|
|
17
18
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
19
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
19
20
|
return (0, rxjs_1.from)([
|
|
@@ -3,6 +3,17 @@ import { PriorityCodeType, TaskStatusCodeType } from '../../../entity/task/taskS
|
|
|
3
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
4
|
import { SpendManagementUIState } from '../../spendManagement/billPay/billList/billListState';
|
|
5
5
|
import { CategoryCombinationOperator, FilterCategoryType } from '../../spendManagement/spendManagementFilterHelpers';
|
|
6
|
+
export declare const ALL_TASK_LIST_TABS: readonly ["live", "archived", "deleted", "snoozed"];
|
|
7
|
+
export type TaskListTab = (typeof ALL_TASK_LIST_TABS)[number];
|
|
8
|
+
export interface TaskListTabData {
|
|
9
|
+
taskIds: ID[];
|
|
10
|
+
taskIdsByAssignees: Record<ID, ID[]>;
|
|
11
|
+
taskIdsByDueDate: Record<DueDateGroupKey, ID[]>;
|
|
12
|
+
taskIdsByGroupsIds: Record<ID, ID[]>;
|
|
13
|
+
taskIdsByPriority: Record<PriorityCodeType, ID[]>;
|
|
14
|
+
taskIdsByStatus: Record<TaskStatusCodeType, ID[]>;
|
|
15
|
+
taskIdsByTags: Record<ID, ID[]>;
|
|
16
|
+
}
|
|
6
17
|
export interface TaskListLocalData {
|
|
7
18
|
defaultTaskGroupId: ID | null;
|
|
8
19
|
existingTaskGroupNamesByGroupId: Record<ID, string>;
|
|
@@ -13,6 +24,8 @@ export declare const DUE_DATE_GROUP_KEYS: readonly ["overdue", "today", "this_we
|
|
|
13
24
|
export declare const toDueDateGroupKeyType: (v: string) => "overdue" | "today" | "this_week" | "this_month" | "upcoming";
|
|
14
25
|
export declare type DueDateGroupKey = ReturnType<typeof toDueDateGroupKeyType>;
|
|
15
26
|
export interface TaskListState extends FetchedState {
|
|
27
|
+
byTab: Record<TaskListTab, TaskListTabData>;
|
|
28
|
+
currentTab: TaskListTab;
|
|
16
29
|
filters: TaskListFilters;
|
|
17
30
|
localData: TaskListLocalData;
|
|
18
31
|
taskIds: ID[];
|
|
@@ -45,7 +58,7 @@ export interface TaskListUIState extends SpendManagementUIState {
|
|
|
45
58
|
searchText: string;
|
|
46
59
|
sortKey: TaskListViewSortKey;
|
|
47
60
|
}
|
|
48
|
-
declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "dueDate" | "tag" | "priority" | "timeSpent" | "assignee" | "creationDate";
|
|
61
|
+
declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "dueDate" | "tag" | "priority" | "timeSpent" | "assignee" | "creationDate" | "visibility";
|
|
49
62
|
export declare type TaskListViewSortKey = ReturnType<typeof toTaskListSortKeyType>;
|
|
50
63
|
export declare const TASK_LIST_FILTER_CATEGORIES: TaskListFilterCategoryOption[];
|
|
51
64
|
interface TaskListFilterCategoryOption {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TASK_LIST_GROUP_BY_CATEGORIES = exports.TASK_LIST_FILTER_CATEGORIES = exports.toTaskListGroupByKeyTypeStrict = exports.toTaskListGroupByKeyType = exports.TASK_LIST_GROUP_BY_KEYS = exports.toDueDateGroupKeyType = exports.DUE_DATE_GROUP_KEYS = void 0;
|
|
3
|
+
exports.TASK_LIST_GROUP_BY_CATEGORIES = exports.TASK_LIST_FILTER_CATEGORIES = exports.toTaskListGroupByKeyTypeStrict = exports.toTaskListGroupByKeyType = exports.TASK_LIST_GROUP_BY_KEYS = exports.toDueDateGroupKeyType = exports.DUE_DATE_GROUP_KEYS = exports.ALL_TASK_LIST_TABS = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
+
exports.ALL_TASK_LIST_TABS = [
|
|
6
|
+
'live',
|
|
7
|
+
'archived',
|
|
8
|
+
'deleted',
|
|
9
|
+
'snoozed',
|
|
10
|
+
];
|
|
5
11
|
exports.DUE_DATE_GROUP_KEYS = [
|
|
6
12
|
'overdue',
|
|
7
13
|
'today',
|
|
@@ -32,6 +38,7 @@ const ALL_TASK_LIST_SORT_KEYS = [
|
|
|
32
38
|
'status',
|
|
33
39
|
'priority',
|
|
34
40
|
'timeSpent',
|
|
41
|
+
'visibility',
|
|
35
42
|
];
|
|
36
43
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
44
|
const toTaskListSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_TASK_LIST_SORT_KEYS);
|
|
@@ -2,6 +2,9 @@ import { TaskPayload } from '../../../entity/task/taskPayload';
|
|
|
2
2
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
3
3
|
interface FetchTaskListPayload {
|
|
4
4
|
tasks: TaskPayload[];
|
|
5
|
+
archived?: TaskPayload[];
|
|
6
|
+
deleted?: TaskPayload[];
|
|
7
|
+
snoozed?: TaskPayload[];
|
|
5
8
|
}
|
|
6
9
|
export type FetchTaskListResponse = ZeniAPIResponse<FetchTaskListPayload>;
|
|
7
10
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchState, ID
|
|
1
|
+
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { TaskPayload } from '../../../entity/task/taskPayload';
|
|
3
3
|
import { Task } from '../../../entity/task/taskState';
|
|
4
4
|
import { TaskGroupPayload } from '../../../entity/taskGroup/taskGroupPayload';
|
|
@@ -11,8 +11,10 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
11
11
|
isTaskTemplatesEnabled: boolean;
|
|
12
12
|
}, "taskList/fetchTaskListPage", never, never>, fetchTaskList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskList/fetchTaskList">, updateTaskList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
13
|
data: TaskPayload[];
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
archived?: TaskPayload[];
|
|
15
|
+
deleted?: TaskPayload[];
|
|
16
|
+
snoozed?: TaskPayload[];
|
|
17
|
+
}, "taskList/updateTaskList">, updateTaskListTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"deleted" | "live" | "archived" | "snoozed", "taskList/updateTaskListTab">, updateTaskListFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
18
|
fetchState: FetchState;
|
|
17
19
|
error?: ZeniAPIStatus;
|
|
18
20
|
}, "taskList/updateTaskListFetchStatus">, updateTaskListSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -23,12 +25,13 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
23
25
|
filters: TaskListFilters;
|
|
24
26
|
}, "taskList/updateTaskFilters">, updateTaskListOnNewGroupCreationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
25
27
|
newTaskGroup: TaskGroupPayload;
|
|
26
|
-
}, "taskList/updateTaskListOnNewGroupCreationSuccess">, bulkUpdateTaskList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskIds: string[], groupId: string, updates: Partial<Task>], {
|
|
28
|
+
}, "taskList/updateTaskListOnNewGroupCreationSuccess">, bulkUpdateTaskList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskIds: string[], groupId: string | null, updates: Partial<Task>], {
|
|
27
29
|
taskIds: string[];
|
|
28
30
|
updates: Partial<Task>;
|
|
29
|
-
groupId: string;
|
|
31
|
+
groupId: string | null;
|
|
30
32
|
}, "taskList/bulkUpdateTaskList", never, never>, updateTasksListOnBulkUpdateTasksSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
31
33
|
groupId: ID | null;
|
|
34
|
+
removeFromList: boolean;
|
|
32
35
|
taskIds: ID[];
|
|
33
36
|
}, "taskList/updateTasksListOnBulkUpdateTasksSuccess">, updateTasksListOnBulkUpdateTasksFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
34
37
|
error: ZeniAPIStatus;
|
|
@@ -55,6 +58,6 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
55
58
|
error: ZeniAPIStatus;
|
|
56
59
|
}, "taskList/updateTasksListOnUpdateTaskFailure">, updateTaskListOnCreateTaskFromTemplateSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
57
60
|
tasks: TaskPayload[];
|
|
58
|
-
}, "taskList/updateTaskListOnCreateTaskFromTemplateSuccess">, clearTaskList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskList/clearTaskList">;
|
|
61
|
+
}, "taskList/updateTaskListOnCreateTaskFromTemplateSuccess">, removeTaskFromList: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "taskList/removeTaskFromList">, clearTaskList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskList/clearTaskList">;
|
|
59
62
|
declare const _default: import("redux").Reducer<TaskListState>;
|
|
60
63
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearTaskList = exports.updateTaskListOnCreateTaskFromTemplateSuccess = exports.updateTasksListOnUpdateTaskFailure = exports.updateTasksListOnUpdateTaskSuccess = exports.updateTaskFromListView = exports.updateTaskListOnTaskGroupNameUpdate = exports.updateTaskListOnNewTaskCreationSuccess = exports.dragNDropTasks = exports.updateTaskListOnTaskGroupDeletion = exports.updateTaskListLocalData = exports.initiateTaskListLocalData = exports.updateTasksListOnBulkUpdateTasksFailure = exports.updateTasksListOnBulkUpdateTasksSuccess = exports.bulkUpdateTaskList = exports.updateTaskListOnNewGroupCreationSuccess = exports.updateTaskFilters = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.updateTaskListFetchStatus = exports.updateTaskList = exports.fetchTaskList = exports.fetchTaskListPage = exports.initialState = void 0;
|
|
4
|
+
exports.clearTaskList = exports.removeTaskFromList = exports.updateTaskListOnCreateTaskFromTemplateSuccess = exports.updateTasksListOnUpdateTaskFailure = exports.updateTasksListOnUpdateTaskSuccess = exports.updateTaskFromListView = exports.updateTaskListOnTaskGroupNameUpdate = exports.updateTaskListOnNewTaskCreationSuccess = exports.dragNDropTasks = exports.updateTaskListOnTaskGroupDeletion = exports.updateTaskListLocalData = exports.initiateTaskListLocalData = exports.updateTasksListOnBulkUpdateTasksFailure = exports.updateTasksListOnBulkUpdateTasksSuccess = exports.bulkUpdateTaskList = exports.updateTaskListOnNewGroupCreationSuccess = exports.updateTaskFilters = exports.updateTaskListUIState = exports.updateTaskListSearchText = exports.updateTaskListFetchStatus = exports.updateTaskListTab = exports.updateTaskList = exports.fetchTaskList = exports.fetchTaskListPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const taskState_1 = require("../../../entity/task/taskState");
|
|
7
7
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
@@ -33,7 +33,23 @@ const initialTaskIdsByDueDate = {
|
|
|
33
33
|
today: [],
|
|
34
34
|
upcoming: [],
|
|
35
35
|
};
|
|
36
|
+
const initialTabData = {
|
|
37
|
+
taskIds: [],
|
|
38
|
+
taskIdsByAssignees: {},
|
|
39
|
+
taskIdsByDueDate: { ...initialTaskIdsByDueDate },
|
|
40
|
+
taskIdsByGroupsIds: {},
|
|
41
|
+
taskIdsByPriority: { ...initialTaskIdsByPriority },
|
|
42
|
+
taskIdsByStatus: { ...initialTaskIdsByStatus },
|
|
43
|
+
taskIdsByTags: {},
|
|
44
|
+
};
|
|
36
45
|
exports.initialState = {
|
|
46
|
+
currentTab: 'live',
|
|
47
|
+
byTab: {
|
|
48
|
+
live: { ...initialTabData },
|
|
49
|
+
archived: { ...initialTabData },
|
|
50
|
+
deleted: { ...initialTabData },
|
|
51
|
+
snoozed: { ...initialTabData },
|
|
52
|
+
},
|
|
37
53
|
taskIds: [],
|
|
38
54
|
taskIdsByGroupsIds: {},
|
|
39
55
|
taskIdsByPriority: initialTaskIdsByPriority,
|
|
@@ -90,17 +106,30 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
90
106
|
draft.error = undefined;
|
|
91
107
|
},
|
|
92
108
|
updateTaskList(draft, action) {
|
|
93
|
-
const { data } = action.payload;
|
|
109
|
+
const { data, archived, deleted, snoozed } = action.payload;
|
|
94
110
|
draft.fetchState = 'Completed';
|
|
95
111
|
draft.error = undefined;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
draft.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
112
|
+
// Group live tasks
|
|
113
|
+
const liveGrouped = getGroupedTaskIds(data);
|
|
114
|
+
draft.byTab.live = toTabData(liveGrouped);
|
|
115
|
+
// Group other tabs if provided
|
|
116
|
+
if (archived != null) {
|
|
117
|
+
draft.byTab.archived = toTabData(getGroupedTaskIds(archived));
|
|
118
|
+
}
|
|
119
|
+
if (deleted != null) {
|
|
120
|
+
draft.byTab.deleted = toTabData(getGroupedTaskIds(deleted));
|
|
121
|
+
}
|
|
122
|
+
if (snoozed != null) {
|
|
123
|
+
draft.byTab.snoozed = toTabData(getGroupedTaskIds(snoozed));
|
|
124
|
+
}
|
|
125
|
+
// Copy active tab data to top-level fields
|
|
126
|
+
const activeTabData = draft.byTab[draft.currentTab];
|
|
127
|
+
copyTabDataToTopLevel(draft, activeTabData);
|
|
128
|
+
},
|
|
129
|
+
updateTaskListTab(draft, action) {
|
|
130
|
+
draft.currentTab = action.payload;
|
|
131
|
+
const activeTabData = draft.byTab[action.payload];
|
|
132
|
+
copyTabDataToTopLevel(draft, activeTabData);
|
|
104
133
|
},
|
|
105
134
|
initiateTaskListLocalData(draft, action) {
|
|
106
135
|
const { taskGroupById } = action.payload;
|
|
@@ -188,10 +217,13 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
188
217
|
},
|
|
189
218
|
},
|
|
190
219
|
updateTasksListOnBulkUpdateTasksSuccess(draft, action) {
|
|
191
|
-
const { taskIds, groupId } = action.payload;
|
|
220
|
+
const { taskIds, groupId, removeFromList } = action.payload;
|
|
192
221
|
draft.updateTasksFetchState.fetchState = 'Completed';
|
|
193
222
|
draft.updateTasksFetchState.error = undefined;
|
|
194
|
-
if (
|
|
223
|
+
if (removeFromList) {
|
|
224
|
+
removeTaskIds(draft, taskIds);
|
|
225
|
+
}
|
|
226
|
+
else if (groupId != null) {
|
|
195
227
|
const { groupByKey } = draft.uiState;
|
|
196
228
|
if (groupByKey === 'groupName') {
|
|
197
229
|
Object.keys(draft.taskIdsByGroupsIds).forEach((gId) => {
|
|
@@ -283,6 +315,7 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
283
315
|
newTaskGroupName: '',
|
|
284
316
|
selectedTaskIds: [],
|
|
285
317
|
};
|
|
318
|
+
syncTopLevelToActiveTab(draft);
|
|
286
319
|
},
|
|
287
320
|
updateTasksListOnBulkUpdateTasksFailure(draft, action) {
|
|
288
321
|
draft.updateTasksFetchState.fetchState = 'Error';
|
|
@@ -302,6 +335,7 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
302
335
|
}
|
|
303
336
|
delete draft.taskIdsByGroupsIds[taskGroupId];
|
|
304
337
|
delete draft.localData.existingTaskGroupNamesByGroupId[taskGroupId];
|
|
338
|
+
syncTopLevelToActiveTab(draft);
|
|
305
339
|
},
|
|
306
340
|
updateTaskListOnNewTaskCreationSuccess(draft, action) {
|
|
307
341
|
const { task, taskGroupId, currentTaskState } = action.payload;
|
|
@@ -336,6 +370,7 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
336
370
|
doUpdateTaskList(draft, task, taskGroupId);
|
|
337
371
|
}
|
|
338
372
|
});
|
|
373
|
+
syncTopLevelToActiveTab(draft);
|
|
339
374
|
},
|
|
340
375
|
updateTaskListOnTaskGroupNameUpdate(draft, action) {
|
|
341
376
|
const { taskGroupName, taskGroupId } = action.payload;
|
|
@@ -399,6 +434,7 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
399
434
|
};
|
|
400
435
|
}
|
|
401
436
|
}
|
|
437
|
+
syncTopLevelToActiveTab(draft);
|
|
402
438
|
},
|
|
403
439
|
updateTasksListOnUpdateTaskSuccess(draft) {
|
|
404
440
|
draft.updateTasksFetchState.fetchState = 'Completed';
|
|
@@ -408,12 +444,15 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
408
444
|
draft.updateTasksFetchState.fetchState = 'Error';
|
|
409
445
|
draft.updateTasksFetchState.error = action.payload.error;
|
|
410
446
|
},
|
|
447
|
+
removeTaskFromList(draft, action) {
|
|
448
|
+
removeTaskIds(draft, [action.payload]);
|
|
449
|
+
},
|
|
411
450
|
clearTaskList(draft) {
|
|
412
451
|
Object.assign(draft, exports.initialState);
|
|
413
452
|
},
|
|
414
453
|
},
|
|
415
454
|
});
|
|
416
|
-
_a = taskList.actions, exports.fetchTaskListPage = _a.fetchTaskListPage, exports.fetchTaskList = _a.fetchTaskList, exports.updateTaskList = _a.updateTaskList, exports.updateTaskListFetchStatus = _a.updateTaskListFetchStatus, exports.updateTaskListSearchText = _a.updateTaskListSearchText, exports.updateTaskListUIState = _a.updateTaskListUIState, exports.updateTaskFilters = _a.updateTaskFilters, exports.updateTaskListOnNewGroupCreationSuccess = _a.updateTaskListOnNewGroupCreationSuccess, exports.bulkUpdateTaskList = _a.bulkUpdateTaskList, exports.updateTasksListOnBulkUpdateTasksSuccess = _a.updateTasksListOnBulkUpdateTasksSuccess, exports.updateTasksListOnBulkUpdateTasksFailure = _a.updateTasksListOnBulkUpdateTasksFailure, exports.initiateTaskListLocalData = _a.initiateTaskListLocalData, exports.updateTaskListLocalData = _a.updateTaskListLocalData, exports.updateTaskListOnTaskGroupDeletion = _a.updateTaskListOnTaskGroupDeletion, exports.dragNDropTasks = _a.dragNDropTasks, exports.updateTaskListOnNewTaskCreationSuccess = _a.updateTaskListOnNewTaskCreationSuccess, exports.updateTaskListOnTaskGroupNameUpdate = _a.updateTaskListOnTaskGroupNameUpdate, exports.updateTaskFromListView = _a.updateTaskFromListView, exports.updateTasksListOnUpdateTaskSuccess = _a.updateTasksListOnUpdateTaskSuccess, exports.updateTasksListOnUpdateTaskFailure = _a.updateTasksListOnUpdateTaskFailure, exports.updateTaskListOnCreateTaskFromTemplateSuccess = _a.updateTaskListOnCreateTaskFromTemplateSuccess, exports.clearTaskList = _a.clearTaskList;
|
|
455
|
+
_a = taskList.actions, exports.fetchTaskListPage = _a.fetchTaskListPage, exports.fetchTaskList = _a.fetchTaskList, exports.updateTaskList = _a.updateTaskList, exports.updateTaskListTab = _a.updateTaskListTab, exports.updateTaskListFetchStatus = _a.updateTaskListFetchStatus, exports.updateTaskListSearchText = _a.updateTaskListSearchText, exports.updateTaskListUIState = _a.updateTaskListUIState, exports.updateTaskFilters = _a.updateTaskFilters, exports.updateTaskListOnNewGroupCreationSuccess = _a.updateTaskListOnNewGroupCreationSuccess, exports.bulkUpdateTaskList = _a.bulkUpdateTaskList, exports.updateTasksListOnBulkUpdateTasksSuccess = _a.updateTasksListOnBulkUpdateTasksSuccess, exports.updateTasksListOnBulkUpdateTasksFailure = _a.updateTasksListOnBulkUpdateTasksFailure, exports.initiateTaskListLocalData = _a.initiateTaskListLocalData, exports.updateTaskListLocalData = _a.updateTaskListLocalData, exports.updateTaskListOnTaskGroupDeletion = _a.updateTaskListOnTaskGroupDeletion, exports.dragNDropTasks = _a.dragNDropTasks, exports.updateTaskListOnNewTaskCreationSuccess = _a.updateTaskListOnNewTaskCreationSuccess, exports.updateTaskListOnTaskGroupNameUpdate = _a.updateTaskListOnTaskGroupNameUpdate, exports.updateTaskFromListView = _a.updateTaskFromListView, exports.updateTasksListOnUpdateTaskSuccess = _a.updateTasksListOnUpdateTaskSuccess, exports.updateTasksListOnUpdateTaskFailure = _a.updateTasksListOnUpdateTaskFailure, exports.updateTaskListOnCreateTaskFromTemplateSuccess = _a.updateTaskListOnCreateTaskFromTemplateSuccess, exports.removeTaskFromList = _a.removeTaskFromList, exports.clearTaskList = _a.clearTaskList;
|
|
417
456
|
exports.default = taskList.reducer;
|
|
418
457
|
/**
|
|
419
458
|
* helpers
|
|
@@ -492,6 +531,61 @@ const getTagsGroupKey = (tags) => {
|
|
|
492
531
|
tagIds.sort();
|
|
493
532
|
return tagIds.join(',');
|
|
494
533
|
};
|
|
534
|
+
const toTabData = (grouped) => ({
|
|
535
|
+
taskIds: grouped.taskIds,
|
|
536
|
+
taskIdsByAssignees: grouped.taskIdsByAssignees,
|
|
537
|
+
taskIdsByDueDate: grouped.taskIdsByDueDate,
|
|
538
|
+
taskIdsByGroupsIds: grouped.taskIdsByGroupIds,
|
|
539
|
+
taskIdsByPriority: grouped.taskIdsGroupedByPriority,
|
|
540
|
+
taskIdsByStatus: grouped.taskIdsGroupedByStatus,
|
|
541
|
+
taskIdsByTags: grouped.taskIdsByTags,
|
|
542
|
+
});
|
|
543
|
+
const syncTopLevelToActiveTab = (draft) => {
|
|
544
|
+
const tabData = draft.byTab[draft.currentTab];
|
|
545
|
+
tabData.taskIds = draft.taskIds;
|
|
546
|
+
tabData.taskIdsByGroupsIds = draft.taskIdsByGroupsIds;
|
|
547
|
+
tabData.taskIdsByPriority = draft.taskIdsByPriority;
|
|
548
|
+
tabData.taskIdsByStatus = draft.taskIdsByStatus;
|
|
549
|
+
tabData.taskIdsByAssignees = draft.taskIdsByAssignees;
|
|
550
|
+
tabData.taskIdsByDueDate = draft.taskIdsByDueDate;
|
|
551
|
+
tabData.taskIdsByTags = draft.taskIdsByTags;
|
|
552
|
+
};
|
|
553
|
+
const copyTabDataToTopLevel = (draft, tabData) => {
|
|
554
|
+
draft.taskIds = tabData.taskIds;
|
|
555
|
+
draft.taskIdsByGroupsIds = tabData.taskIdsByGroupsIds;
|
|
556
|
+
draft.taskIdsByPriority = tabData.taskIdsByPriority;
|
|
557
|
+
draft.taskIdsByStatus = tabData.taskIdsByStatus;
|
|
558
|
+
draft.taskIdsByAssignees = tabData.taskIdsByAssignees;
|
|
559
|
+
draft.taskIdsByDueDate = tabData.taskIdsByDueDate;
|
|
560
|
+
draft.taskIdsByTags = tabData.taskIdsByTags;
|
|
561
|
+
};
|
|
562
|
+
const removeIdsFromTabData = (tabData, taskIds) => {
|
|
563
|
+
const removedSet = new Set(taskIds);
|
|
564
|
+
const isRemoved = (id) => removedSet.has(id);
|
|
565
|
+
tabData.taskIds = tabData.taskIds.filter((id) => !isRemoved(id));
|
|
566
|
+
Object.keys(tabData.taskIdsByGroupsIds).forEach((gId) => {
|
|
567
|
+
tabData.taskIdsByGroupsIds[gId] = tabData.taskIdsByGroupsIds[gId].filter((id) => !isRemoved(id));
|
|
568
|
+
});
|
|
569
|
+
Object.keys(tabData.taskIdsByPriority).forEach((key) => {
|
|
570
|
+
tabData.taskIdsByPriority[key] = tabData.taskIdsByPriority[key].filter((id) => !isRemoved(id));
|
|
571
|
+
});
|
|
572
|
+
Object.keys(tabData.taskIdsByStatus).forEach((key) => {
|
|
573
|
+
tabData.taskIdsByStatus[key] = tabData.taskIdsByStatus[key].filter((id) => !isRemoved(id));
|
|
574
|
+
});
|
|
575
|
+
Object.keys(tabData.taskIdsByDueDate).forEach((key) => {
|
|
576
|
+
tabData.taskIdsByDueDate[key] = tabData.taskIdsByDueDate[key].filter((id) => !isRemoved(id));
|
|
577
|
+
});
|
|
578
|
+
Object.keys(tabData.taskIdsByAssignees).forEach((key) => {
|
|
579
|
+
tabData.taskIdsByAssignees[key] = tabData.taskIdsByAssignees[key].filter((id) => !isRemoved(id));
|
|
580
|
+
});
|
|
581
|
+
Object.keys(tabData.taskIdsByTags).forEach((key) => {
|
|
582
|
+
tabData.taskIdsByTags[key] = tabData.taskIdsByTags[key].filter((id) => !isRemoved(id));
|
|
583
|
+
});
|
|
584
|
+
};
|
|
585
|
+
const removeTaskIds = (draft, taskIds) => {
|
|
586
|
+
removeIdsFromTabData(draft, taskIds);
|
|
587
|
+
removeIdsFromTabData(draft.byTab[draft.currentTab], taskIds);
|
|
588
|
+
};
|
|
495
589
|
const getGroupedTaskIds = (tasks) => {
|
|
496
590
|
const taskIds = [];
|
|
497
591
|
const taskIdsByGroupIds = {};
|
|
@@ -5,14 +5,16 @@ import { TagState } from '../../../entity/tag/tagState';
|
|
|
5
5
|
import { Task, TaskState } from '../../../entity/task/taskState';
|
|
6
6
|
import { TaskGroupTemplate } from '../../../entity/taskGroupTemplate/taskGroupTemplateState';
|
|
7
7
|
import { UserState } from '../../../entity/user/userState';
|
|
8
|
+
import { UserGroupsState } from '../../../entity/userGroups/userGroupsState';
|
|
8
9
|
import { UserRoleState } from '../../../entity/userRole/userRoleState';
|
|
9
10
|
import { RootState } from '../../../reducer';
|
|
10
11
|
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
11
12
|
import { UserGroupListSelectorView } from '../../userGroupListView/userGroupListViewSelector';
|
|
12
13
|
import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
13
|
-
import { TaskListFilters, TaskListLocalData, TaskListState, TaskListUIState } from './taskList';
|
|
14
|
+
import { TaskListFilters, TaskListLocalData, TaskListState, TaskListTab, TaskListUIState } from './taskList';
|
|
14
15
|
export interface TaskWithUserDetails extends Task {
|
|
15
16
|
assigneeUsers: UserAndRole[];
|
|
17
|
+
firstAssigneeSortName: string;
|
|
16
18
|
}
|
|
17
19
|
export interface TaskGroupWithTasksList {
|
|
18
20
|
groupName: string;
|
|
@@ -21,8 +23,10 @@ export interface TaskGroupWithTasksList {
|
|
|
21
23
|
tasks: TaskWithUserDetails[];
|
|
22
24
|
}
|
|
23
25
|
export interface TaskListSelectorView extends SelectorView {
|
|
26
|
+
currentTab: TaskListTab;
|
|
24
27
|
filters: TaskListFilters;
|
|
25
28
|
localData: TaskListLocalData;
|
|
29
|
+
tabCounts: Record<TaskListTab, number>;
|
|
26
30
|
taskCreationFromTemplateStatus: FetchStateAndError;
|
|
27
31
|
taskGroupCreationStatus: FetchStateAndError;
|
|
28
32
|
taskGroupDeleteStatus: FetchStateAndError;
|
|
@@ -34,11 +38,12 @@ export interface TaskListSelectorView extends SelectorView {
|
|
|
34
38
|
userGroupList: UserGroupListSelectorView;
|
|
35
39
|
userList: UserListSelectorView;
|
|
36
40
|
}
|
|
37
|
-
export declare const getTaskListGroupedByAssignees: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }: {
|
|
41
|
+
export declare const getTaskListGroupedByAssignees: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, userGroupsState, }: {
|
|
38
42
|
addressState: AddressState;
|
|
39
43
|
tagState: TagState;
|
|
40
44
|
taskListState: TaskListState;
|
|
41
45
|
taskState: TaskState;
|
|
46
|
+
userGroupsState: UserGroupsState;
|
|
42
47
|
userRoleState: UserRoleState;
|
|
43
48
|
userState: UserState;
|
|
44
49
|
}) => {
|
|
@@ -47,11 +52,12 @@ export declare const getTaskListGroupedByAssignees: ({ taskListState, taskState,
|
|
|
47
52
|
isDefault: boolean;
|
|
48
53
|
tasks: TaskWithUserDetails[];
|
|
49
54
|
}[];
|
|
50
|
-
export declare const getTaskListGroupedByPriority: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }: {
|
|
55
|
+
export declare const getTaskListGroupedByPriority: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, userGroupsState, }: {
|
|
51
56
|
addressState: AddressState;
|
|
52
57
|
tagState: TagState;
|
|
53
58
|
taskListState: TaskListState;
|
|
54
59
|
taskState: TaskState;
|
|
60
|
+
userGroupsState: UserGroupsState;
|
|
55
61
|
userRoleState: UserRoleState;
|
|
56
62
|
userState: UserState;
|
|
57
63
|
}) => {
|