@zeniai/client-epic-state 4.11.72 → 4.11.73
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/task/taskState.d.ts +1 -1
- package/lib/entity/task/taskState.js +4 -4
- package/lib/index.d.ts +6 -5
- package/lib/index.js +15 -2
- package/lib/view/companyHealthMetricView/companyHealthMetricViewSelector.d.ts +1 -1
- package/lib/view/settingsView/settingsViewSelector.js +4 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -2
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -1
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -2
- package/lib/view/taskManager/taskGroupView/epics/createNewTaskGroupEpic.js +4 -2
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.js +2 -5
- package/lib/view/taskManager/taskListView/dragNDropTasksEpic.d.ts +1 -1
- package/lib/view/taskManager/taskListView/dragNDropTasksEpic.js +6 -2
- package/lib/view/taskManager/taskListView/taskList.d.ts +20 -1
- package/lib/view/taskManager/taskListView/taskList.js +34 -1
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +5 -5
- package/lib/view/taskManager/taskListView/taskListReducer.js +250 -31
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +36 -5
- package/lib/view/taskManager/taskListView/taskListSelector.js +260 -35
- package/lib/view/taskManager/taskListView/taskListViewHelpers.d.ts +5 -0
- package/lib/view/taskManager/taskListView/taskListViewHelpers.js +55 -0
- package/lib/view/userListView/userListViewSelector.d.ts +4 -3
- package/lib/view/userListView/userListViewSelector.js +1 -2
- package/package.json +1 -1
|
@@ -1,23 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearTaskList = 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 =
|
|
4
|
+
exports.clearTaskList = 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;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
|
|
6
|
+
const taskList_1 = require("./taskList");
|
|
7
|
+
const taskState_1 = require("../../../entity/task/taskState");
|
|
8
|
+
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
9
|
+
const initialLocalData = {
|
|
7
10
|
newTaskGroupName: '',
|
|
8
11
|
existingTaskGroupNamesByGroupId: {},
|
|
9
12
|
selectedTaskIds: [],
|
|
10
13
|
defaultTaskGroupId: null,
|
|
11
14
|
};
|
|
15
|
+
const initialTaskIdsByPriority = {
|
|
16
|
+
urgent: [],
|
|
17
|
+
high: [],
|
|
18
|
+
medium: [],
|
|
19
|
+
low: [],
|
|
20
|
+
};
|
|
21
|
+
const initialTaskIdsByStatus = {
|
|
22
|
+
done: [],
|
|
23
|
+
in_progress: [],
|
|
24
|
+
on_hold: [],
|
|
25
|
+
resolved: [],
|
|
26
|
+
todo: [],
|
|
27
|
+
};
|
|
28
|
+
const initialTaskIdsByDueDate = {
|
|
29
|
+
overdue: [],
|
|
30
|
+
this_month: [],
|
|
31
|
+
this_week: [],
|
|
32
|
+
today: [],
|
|
33
|
+
upcoming: [],
|
|
34
|
+
};
|
|
12
35
|
exports.initialState = {
|
|
13
36
|
taskIds: [],
|
|
14
37
|
taskIdsByGroupsIds: {},
|
|
38
|
+
taskIdsByPriority: initialTaskIdsByPriority,
|
|
39
|
+
taskIdsByStatus: initialTaskIdsByStatus,
|
|
40
|
+
taskIdsByDueDate: initialTaskIdsByDueDate,
|
|
41
|
+
taskIdsByAssignees: {},
|
|
42
|
+
taskIdsByTags: {},
|
|
15
43
|
fetchState: 'Not-Started',
|
|
16
|
-
searchText: '',
|
|
17
44
|
error: undefined,
|
|
18
45
|
uiState: {
|
|
19
46
|
sortOrder: 'ascending',
|
|
20
47
|
sortKey: 'dueDate',
|
|
48
|
+
groupByKey: 'groupName',
|
|
49
|
+
searchText: '',
|
|
21
50
|
},
|
|
22
51
|
filters: {
|
|
23
52
|
categoryCombinationOperator: 'AND',
|
|
@@ -33,7 +62,7 @@ exports.initialState = {
|
|
|
33
62
|
hasValidState() {
|
|
34
63
|
return this.fetchState == 'Completed';
|
|
35
64
|
},
|
|
36
|
-
localData: Object.assign({},
|
|
65
|
+
localData: Object.assign({}, initialLocalData),
|
|
37
66
|
updateTasksFetchState: {
|
|
38
67
|
fetchState: 'Not-Started',
|
|
39
68
|
error: undefined,
|
|
@@ -61,21 +90,14 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
61
90
|
const { data } = action.payload;
|
|
62
91
|
draft.fetchState = 'Completed';
|
|
63
92
|
draft.error = undefined;
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
else {
|
|
73
|
-
taskIdsByGroupsIds[groupId] = [task.task_id];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
draft.taskIdsByGroupsIds = taskIdsByGroupsIds;
|
|
93
|
+
const { taskIds, taskIdsGroupedByPriority, taskIdsByGroupIds, taskIdsGroupedByStatus, taskIdsByAssignees, taskIdsByDueDate, taskIdsByTags, } = getGroupedTaskIds(data);
|
|
94
|
+
draft.taskIds = taskIds;
|
|
95
|
+
draft.taskIdsByGroupsIds = taskIdsByGroupIds;
|
|
96
|
+
draft.taskIdsByPriority = taskIdsGroupedByPriority;
|
|
97
|
+
draft.taskIdsByStatus = taskIdsGroupedByStatus;
|
|
98
|
+
draft.taskIdsByAssignees = taskIdsByAssignees;
|
|
99
|
+
draft.taskIdsByDueDate = taskIdsByDueDate;
|
|
100
|
+
draft.taskIdsByTags = taskIdsByTags;
|
|
79
101
|
},
|
|
80
102
|
initiateTaskListLocalData(draft, action) {
|
|
81
103
|
const { taskGroupById } = action.payload;
|
|
@@ -87,7 +109,7 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
87
109
|
defaultTaskGroupId = groupId;
|
|
88
110
|
}
|
|
89
111
|
});
|
|
90
|
-
draft.localData = Object.assign(Object.assign({},
|
|
112
|
+
draft.localData = Object.assign(Object.assign({}, initialLocalData), { defaultTaskGroupId,
|
|
91
113
|
existingTaskGroupNamesByGroupId });
|
|
92
114
|
},
|
|
93
115
|
updateTaskListLocalData(draft, action) {
|
|
@@ -98,7 +120,7 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
98
120
|
draft.error = action.payload.error;
|
|
99
121
|
},
|
|
100
122
|
updateTaskListSearchText(draft, action) {
|
|
101
|
-
draft.searchText = action.payload.searchText;
|
|
123
|
+
draft.uiState.searchText = action.payload.searchText;
|
|
102
124
|
},
|
|
103
125
|
updateTaskListUIState(draft, action) {
|
|
104
126
|
if (action.payload.uiState.sortKey != null) {
|
|
@@ -107,6 +129,9 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
107
129
|
if (action.payload.uiState.sortOrder != null) {
|
|
108
130
|
draft.uiState.sortOrder = action.payload.uiState.sortOrder;
|
|
109
131
|
}
|
|
132
|
+
if (action.payload.uiState.groupByKey != null) {
|
|
133
|
+
draft.uiState.groupByKey = action.payload.uiState.groupByKey;
|
|
134
|
+
}
|
|
110
135
|
if (action.payload.uiState.scrollYOffset != null) {
|
|
111
136
|
draft.uiState.scrollYOffset = action.payload.uiState.scrollYOffset;
|
|
112
137
|
}
|
|
@@ -127,11 +152,12 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
127
152
|
error: undefined,
|
|
128
153
|
};
|
|
129
154
|
},
|
|
130
|
-
prepare(taskIds, updates) {
|
|
155
|
+
prepare(taskIds, groupId, updates) {
|
|
131
156
|
return {
|
|
132
157
|
payload: {
|
|
133
158
|
taskIds,
|
|
134
159
|
updates,
|
|
160
|
+
groupId,
|
|
135
161
|
},
|
|
136
162
|
};
|
|
137
163
|
},
|
|
@@ -153,18 +179,82 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
153
179
|
const { taskIds, groupId } = action.payload;
|
|
154
180
|
draft.updateTasksFetchState.fetchState = 'Completed';
|
|
155
181
|
draft.updateTasksFetchState.error = undefined;
|
|
156
|
-
Object.keys(draft.taskIdsByGroupsIds).forEach((groupId) => {
|
|
157
|
-
draft.taskIdsByGroupsIds[groupId] = draft.taskIdsByGroupsIds[groupId].filter((taskId) => taskIds.includes(taskId) === false);
|
|
158
|
-
});
|
|
159
182
|
if (groupId != null) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
183
|
+
const { groupByKey } = draft.uiState;
|
|
184
|
+
if (groupByKey === 'groupName') {
|
|
185
|
+
Object.keys(draft.taskIdsByGroupsIds).forEach((gId) => {
|
|
186
|
+
draft.taskIdsByGroupsIds[gId] = draft.taskIdsByGroupsIds[gId].filter((taskId) => taskIds.includes(taskId) === false);
|
|
187
|
+
});
|
|
188
|
+
if (draft.taskIdsByGroupsIds[groupId] != null) {
|
|
189
|
+
draft.taskIdsByGroupsIds[groupId] = [
|
|
190
|
+
...draft.taskIdsByGroupsIds[groupId],
|
|
191
|
+
...taskIds,
|
|
192
|
+
];
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
draft.taskIdsByGroupsIds = Object.assign(Object.assign({}, draft.taskIdsByGroupsIds), { [groupId]: taskIds });
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
else if (groupByKey === 'assignee') {
|
|
199
|
+
Object.keys(draft.taskIdsByAssignees).forEach((gId) => {
|
|
200
|
+
draft.taskIdsByAssignees[gId] = draft.taskIdsByAssignees[gId].filter((taskId) => taskIds.includes(taskId) === false);
|
|
201
|
+
});
|
|
202
|
+
if (draft.taskIdsByAssignees[groupId] != null) {
|
|
203
|
+
draft.taskIdsByAssignees[groupId] = [
|
|
204
|
+
...draft.taskIdsByAssignees[groupId],
|
|
205
|
+
...taskIds,
|
|
206
|
+
];
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
draft.taskIdsByAssignees = Object.assign(Object.assign({}, draft.taskIdsByAssignees), { [groupId]: taskIds });
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else if (groupByKey === 'tag') {
|
|
213
|
+
Object.keys(draft.taskIdsByTags).forEach((gId) => {
|
|
214
|
+
draft.taskIdsByTags[gId] = draft.taskIdsByTags[gId].filter((taskId) => taskIds.includes(taskId) === false);
|
|
215
|
+
});
|
|
216
|
+
if (draft.taskIdsByTags[groupId] != null) {
|
|
217
|
+
draft.taskIdsByTags[groupId] = [
|
|
218
|
+
...draft.taskIdsByTags[groupId],
|
|
219
|
+
...taskIds,
|
|
220
|
+
];
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
draft.taskIdsByTags = Object.assign(Object.assign({}, draft.taskIdsByTags), { [groupId]: taskIds });
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
else if (groupByKey === 'dueDate') {
|
|
227
|
+
Object.keys(draft.taskIdsByDueDate).forEach((gId) => {
|
|
228
|
+
const groupKey = (0, taskList_1.toDueDateGroupKeyType)(gId);
|
|
229
|
+
draft.taskIdsByDueDate[groupKey] = draft.taskIdsByDueDate[groupKey].filter((taskId) => taskIds.includes(taskId) === false);
|
|
230
|
+
});
|
|
231
|
+
const groupKey = (0, taskList_1.toDueDateGroupKeyType)(groupId);
|
|
232
|
+
draft.taskIdsByDueDate[groupKey] = [
|
|
233
|
+
...draft.taskIdsByDueDate[groupKey],
|
|
163
234
|
...taskIds,
|
|
164
235
|
];
|
|
165
236
|
}
|
|
166
|
-
else {
|
|
167
|
-
|
|
237
|
+
else if (groupByKey === 'priority') {
|
|
238
|
+
Object.keys(draft.taskIdsByPriority).forEach((gId) => {
|
|
239
|
+
const groupKey = (0, taskState_1.toPriorityCodeType)(gId);
|
|
240
|
+
draft.taskIdsByPriority[groupKey] = draft.taskIdsByPriority[groupKey].filter((taskId) => taskIds.includes(taskId) === false);
|
|
241
|
+
});
|
|
242
|
+
const groupKey = (0, taskState_1.toPriorityCodeType)(groupId);
|
|
243
|
+
draft.taskIdsByPriority[groupKey] = [
|
|
244
|
+
...draft.taskIdsByPriority[groupKey],
|
|
245
|
+
...taskIds,
|
|
246
|
+
];
|
|
247
|
+
}
|
|
248
|
+
else if (groupByKey === 'status') {
|
|
249
|
+
Object.keys(draft.taskIdsByStatus).forEach((gId) => {
|
|
250
|
+
const groupKey = (0, taskState_1.toTaskStatusCodeType)(gId);
|
|
251
|
+
draft.taskIdsByStatus[groupKey] = draft.taskIdsByStatus[groupKey].filter((taskId) => taskIds.includes(taskId) === false);
|
|
252
|
+
});
|
|
253
|
+
const groupKey = (0, taskState_1.toTaskStatusCodeType)(groupId);
|
|
254
|
+
draft.taskIdsByStatus[groupKey] = [
|
|
255
|
+
...draft.taskIdsByStatus[groupKey],
|
|
256
|
+
...taskIds,
|
|
257
|
+
];
|
|
168
258
|
}
|
|
169
259
|
}
|
|
170
260
|
draft.localData = Object.assign(Object.assign({}, draft.localData), { newTaskGroupName: '', selectedTaskIds: [] });
|
|
@@ -190,8 +280,44 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
190
280
|
delete draft.localData.existingTaskGroupNamesByGroupId[taskGroupId];
|
|
191
281
|
},
|
|
192
282
|
updateTaskListOnNewTaskCreationSuccess(draft, action) {
|
|
193
|
-
const {
|
|
283
|
+
const { task, taskGroupId } = action.payload;
|
|
284
|
+
const taskId = task.task_id;
|
|
194
285
|
draft.taskIds.push(taskId);
|
|
286
|
+
const priorityKey = (0, taskState_1.toPriorityCodeType)(task.priority.code);
|
|
287
|
+
const statusKey = (0, taskState_1.toTaskStatusCodeType)(task.status.code);
|
|
288
|
+
const assigneeKey = getAssigneesGroupKey(task.assignees);
|
|
289
|
+
const dueDateKey = getDueDateGroupKey(task.due_date);
|
|
290
|
+
const tagsKey = getTagsGroupKey(task.tags);
|
|
291
|
+
draft.taskIdsByPriority[priorityKey] = [
|
|
292
|
+
taskId,
|
|
293
|
+
...draft.taskIdsByPriority[priorityKey],
|
|
294
|
+
];
|
|
295
|
+
draft.taskIdsByStatus[statusKey] = [
|
|
296
|
+
taskId,
|
|
297
|
+
...draft.taskIdsByStatus[statusKey],
|
|
298
|
+
];
|
|
299
|
+
draft.taskIdsByDueDate[dueDateKey] = [
|
|
300
|
+
taskId,
|
|
301
|
+
...draft.taskIdsByDueDate[dueDateKey],
|
|
302
|
+
];
|
|
303
|
+
if (draft.taskIdsByAssignees[assigneeKey] != null) {
|
|
304
|
+
draft.taskIdsByAssignees[assigneeKey] = [
|
|
305
|
+
taskId,
|
|
306
|
+
...draft.taskIdsByAssignees[assigneeKey],
|
|
307
|
+
];
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
draft.taskIdsByAssignees[assigneeKey] = [taskId];
|
|
311
|
+
}
|
|
312
|
+
if (draft.taskIdsByTags[tagsKey] != null) {
|
|
313
|
+
draft.taskIdsByTags[tagsKey] = [
|
|
314
|
+
taskId,
|
|
315
|
+
...draft.taskIdsByTags[tagsKey],
|
|
316
|
+
];
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
draft.taskIdsByTags[tagsKey] = [taskId];
|
|
320
|
+
}
|
|
195
321
|
if (draft.taskIdsByGroupsIds[taskGroupId] != null) {
|
|
196
322
|
draft.taskIdsByGroupsIds[taskGroupId] = [
|
|
197
323
|
taskId,
|
|
@@ -213,3 +339,96 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
213
339
|
});
|
|
214
340
|
_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.clearTaskList = _a.clearTaskList;
|
|
215
341
|
exports.default = taskList.reducer;
|
|
342
|
+
/**
|
|
343
|
+
* helpers
|
|
344
|
+
*/
|
|
345
|
+
const getDueDateGroupKey = (due_date) => {
|
|
346
|
+
if (due_date != null) {
|
|
347
|
+
const dueDate = (0, zeniDayJS_1.date)(due_date);
|
|
348
|
+
const today = (0, zeniDayJS_1.dateNow)();
|
|
349
|
+
if (dueDate.isBefore(today.startOf('day'))) {
|
|
350
|
+
return 'overdue';
|
|
351
|
+
}
|
|
352
|
+
if (today.isSame(dueDate, 'day')) {
|
|
353
|
+
return 'today';
|
|
354
|
+
}
|
|
355
|
+
if (today.isSame(dueDate, 'week')) {
|
|
356
|
+
return 'this_week';
|
|
357
|
+
}
|
|
358
|
+
if (today.isSame(dueDate, 'month')) {
|
|
359
|
+
return 'this_month';
|
|
360
|
+
}
|
|
361
|
+
if (today.isAfter(today.endOf('month'))) {
|
|
362
|
+
return 'upcoming';
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return 'upcoming';
|
|
366
|
+
};
|
|
367
|
+
const getAssigneesGroupKey = (assignees) => {
|
|
368
|
+
return [...assignees].sort().join(',');
|
|
369
|
+
};
|
|
370
|
+
const getTagsGroupKey = (tags) => {
|
|
371
|
+
const tagIds = tags.map((tag) => tag.tag_id);
|
|
372
|
+
tagIds.sort();
|
|
373
|
+
return tagIds.join(',');
|
|
374
|
+
};
|
|
375
|
+
const getGroupedTaskIds = (tasks) => {
|
|
376
|
+
const taskIds = [];
|
|
377
|
+
const taskIdsByGroupIds = {};
|
|
378
|
+
const taskIdsByAssignees = {};
|
|
379
|
+
const taskIdsGroupedByPriority = Object.assign({}, initialTaskIdsByPriority);
|
|
380
|
+
const taskIdsGroupedByStatus = Object.assign({}, initialTaskIdsByStatus);
|
|
381
|
+
const taskIdsByDueDate = Object.assign({}, initialTaskIdsByDueDate);
|
|
382
|
+
const taskIdsByTags = {};
|
|
383
|
+
tasks.forEach((task) => {
|
|
384
|
+
taskIds.push(task.task_id);
|
|
385
|
+
const priorityKey = (0, taskState_1.toPriorityCodeType)(task.priority.code);
|
|
386
|
+
const statusKey = (0, taskState_1.toTaskStatusCodeType)(task.status.code);
|
|
387
|
+
const assigneeKey = getAssigneesGroupKey(task.assignees);
|
|
388
|
+
const dueDateKey = getDueDateGroupKey(task.due_date);
|
|
389
|
+
const tagsKey = getTagsGroupKey(task.tags);
|
|
390
|
+
taskIdsGroupedByPriority[priorityKey] = [
|
|
391
|
+
...taskIdsGroupedByPriority[priorityKey],
|
|
392
|
+
task.task_id,
|
|
393
|
+
];
|
|
394
|
+
taskIdsGroupedByStatus[statusKey] = [
|
|
395
|
+
...taskIdsGroupedByStatus[statusKey],
|
|
396
|
+
task.task_id,
|
|
397
|
+
];
|
|
398
|
+
taskIdsByDueDate[dueDateKey] = [
|
|
399
|
+
...taskIdsByDueDate[dueDateKey],
|
|
400
|
+
task.task_id,
|
|
401
|
+
];
|
|
402
|
+
if (task.task_group_ids != null) {
|
|
403
|
+
task.task_group_ids.forEach((groupId) => {
|
|
404
|
+
if (taskIdsByGroupIds[groupId] != null) {
|
|
405
|
+
taskIdsByGroupIds[groupId].push(task.task_id);
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
taskIdsByGroupIds[groupId] = [task.task_id];
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
if (taskIdsByAssignees[assigneeKey] != null) {
|
|
413
|
+
taskIdsByAssignees[assigneeKey].push(task.task_id);
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
taskIdsByAssignees[assigneeKey] = [task.task_id];
|
|
417
|
+
}
|
|
418
|
+
if (taskIdsByTags[tagsKey] != null) {
|
|
419
|
+
taskIdsByTags[tagsKey].push(task.task_id);
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
taskIdsByTags[tagsKey] = [task.task_id];
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
return {
|
|
426
|
+
taskIds,
|
|
427
|
+
taskIdsGroupedByPriority,
|
|
428
|
+
taskIdsByGroupIds,
|
|
429
|
+
taskIdsGroupedByStatus,
|
|
430
|
+
taskIdsByTags,
|
|
431
|
+
taskIdsByAssignees,
|
|
432
|
+
taskIdsByDueDate,
|
|
433
|
+
};
|
|
434
|
+
};
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
2
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
3
|
-
import { Task } from '../../../entity/task/taskState';
|
|
3
|
+
import { Task, TaskState } from '../../../entity/task/taskState';
|
|
4
4
|
import { RootState } from '../../../reducer';
|
|
5
5
|
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
6
|
-
import { TaskListFilters, TaskListUIState, TaskListLocalData } from './taskList';
|
|
6
|
+
import { TaskListFilters, TaskListUIState, TaskListLocalData, TaskListState } from './taskList';
|
|
7
7
|
import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
8
|
-
import {
|
|
8
|
+
import { UserState } from '../../../entity/user/userState';
|
|
9
|
+
import { UserRoleState } from '../../../entity/userRole/userRoleState';
|
|
10
|
+
import { AddressState } from '../../../entity/address/addressState';
|
|
11
|
+
import { TagState } from '../../../entity/tag/tagState';
|
|
9
12
|
export interface TaskWithUserDetails extends Task {
|
|
10
13
|
assigneeUsers: UserAndRole[];
|
|
11
14
|
}
|
|
12
|
-
export interface TaskGroupWithTasksList
|
|
15
|
+
export interface TaskGroupWithTasksList {
|
|
16
|
+
groupName: string;
|
|
17
|
+
id: string;
|
|
13
18
|
tasks: TaskWithUserDetails[];
|
|
19
|
+
isDefault: boolean;
|
|
14
20
|
}
|
|
15
21
|
export interface TaskListSelectorView extends SelectorView {
|
|
16
22
|
taskGroupsWithTasksList: TaskGroupWithTasksList[];
|
|
17
|
-
searchText: string;
|
|
18
23
|
uiState: TaskListUIState;
|
|
19
24
|
filters: TaskListFilters;
|
|
20
25
|
userList: UserListSelectorView;
|
|
@@ -24,4 +29,30 @@ export interface TaskListSelectorView extends SelectorView {
|
|
|
24
29
|
taskGroupUpdateStatus: FetchStateAndError;
|
|
25
30
|
taskGroupCreationStatus: FetchStateAndError;
|
|
26
31
|
}
|
|
32
|
+
export declare const getTaskListGroupedByAssignees: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }: {
|
|
33
|
+
taskListState: TaskListState;
|
|
34
|
+
taskState: TaskState;
|
|
35
|
+
userState: UserState;
|
|
36
|
+
userRoleState: UserRoleState;
|
|
37
|
+
addressState: AddressState;
|
|
38
|
+
tagState: TagState;
|
|
39
|
+
}) => {
|
|
40
|
+
groupName: string;
|
|
41
|
+
id: string;
|
|
42
|
+
isDefault: boolean;
|
|
43
|
+
tasks: TaskWithUserDetails[];
|
|
44
|
+
}[];
|
|
45
|
+
export declare const getTaskListGroupedByPriority: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }: {
|
|
46
|
+
taskListState: TaskListState;
|
|
47
|
+
taskState: TaskState;
|
|
48
|
+
userState: UserState;
|
|
49
|
+
userRoleState: UserRoleState;
|
|
50
|
+
addressState: AddressState;
|
|
51
|
+
tagState: TagState;
|
|
52
|
+
}) => {
|
|
53
|
+
groupName: string;
|
|
54
|
+
id: "high" | "low" | "medium" | "urgent";
|
|
55
|
+
isDefault: boolean;
|
|
56
|
+
tasks: TaskWithUserDetails[];
|
|
57
|
+
}[];
|
|
27
58
|
export declare const getAllTasks: (state: RootState) => TaskListSelectorView;
|