@zeniai/client-epic-state 4.14.44 → 4.14.45
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 +3 -3
- package/lib/entity/task/taskState.js +7 -1
- package/lib/entity/taskGroupTemplate/taskGroupTemplatePayload.d.ts +8 -0
- package/lib/entity/taskGroupTemplate/taskGroupTemplatePayload.js +2 -0
- package/lib/entity/taskGroupTemplate/taskGroupTemplateReducer.d.ts +6 -0
- package/lib/entity/taskGroupTemplate/taskGroupTemplateReducer.js +28 -0
- package/lib/entity/taskGroupTemplate/taskGroupTemplateSelector.d.ts +4 -0
- package/lib/entity/taskGroupTemplate/taskGroupTemplateSelector.js +17 -0
- package/lib/entity/taskGroupTemplate/taskGroupTemplateState.d.ts +13 -0
- package/lib/entity/taskGroupTemplate/taskGroupTemplateState.js +2 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +4 -2
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.js +5 -2
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +1 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.js +18 -17
- package/lib/view/taskManager/taskGroupTemplateView/epics/createTaskFromTaskGroupTemplateEpic.d.ts +12 -0
- package/lib/view/taskManager/taskGroupTemplateView/epics/createTaskFromTaskGroupTemplateEpic.js +54 -0
- package/lib/view/taskManager/taskGroupTemplateView/epics/fetchTaskGroupTemplatesEpic.d.ts +8 -0
- package/lib/view/taskManager/taskGroupTemplateView/epics/fetchTaskGroupTemplatesEpic.js +34 -0
- package/lib/view/taskManager/taskGroupTemplateView/taskGroupTemplateViewPayload.d.ts +14 -0
- package/lib/view/taskManager/taskGroupTemplateView/taskGroupTemplateViewPayload.js +2 -0
- package/lib/view/taskManager/taskGroupTemplateView/taskGroupTemplateViewReducer.d.ts +10 -0
- package/lib/view/taskManager/taskGroupTemplateView/taskGroupTemplateViewReducer.js +59 -0
- package/lib/view/taskManager/taskGroupTemplateView/taskGroupTemplateViewSelector.d.ts +7 -0
- package/lib/view/taskManager/taskGroupTemplateView/taskGroupTemplateViewSelector.js +10 -0
- package/lib/view/taskManager/taskGroupTemplateView/taskGroupTemplateViewState.d.ts +5 -0
- package/lib/view/taskManager/taskGroupTemplateView/taskGroupTemplateViewState.js +2 -0
- package/lib/view/taskManager/taskListView/epics/fetchTaskListPageEpic.d.ts +2 -1
- package/lib/view/taskManager/taskListView/epics/fetchTaskListPageEpic.js +6 -0
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +3 -1
- package/lib/view/taskManager/taskListView/taskListReducer.js +57 -46
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +4 -1
- package/lib/view/taskManager/taskListView/taskListSelector.js +6 -1
- package/package.json +1 -1
package/lib/reducer.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ import { SubscriptionPaymentAccountState } from './entity/subscriptionPaymentAcc
|
|
|
46
46
|
import { TagState } from './entity/tag/tagState';
|
|
47
47
|
import { TaskState } from './entity/task/taskState';
|
|
48
48
|
import { TaskGroupState } from './entity/taskGroup/taskGroupState';
|
|
49
|
+
import { TaskGroupTemplateState } from './entity/taskGroupTemplate/taskGroupTemplateState';
|
|
49
50
|
import { TaskSummaryState } from './entity/taskSummary/taskSummaryState';
|
|
50
51
|
import { TenantState } from './entity/tenant/tenantState';
|
|
51
52
|
import { ToastNotificationState } from './entity/toastNotification/toastNotificationState';
|
|
@@ -164,6 +165,7 @@ import { ZeniAccountsConfigState } from './view/spendManagement/zeniAccounts/zen
|
|
|
164
165
|
import { SubscriptionViewState } from './view/subscriptionView/subscriptionViewState';
|
|
165
166
|
import { TagViewState } from './view/tagView/tagViewState';
|
|
166
167
|
import { TaskDetailViewState } from './view/taskManager/taskDetailView/taskDetail';
|
|
168
|
+
import { TaskGroupTemplateViewState } from './view/taskManager/taskGroupTemplateView/taskGroupTemplateViewState';
|
|
167
169
|
import { TaskGroupViewState } from './view/taskManager/taskGroupView/taskGroupViewState';
|
|
168
170
|
import { TaskListState } from './view/taskManager/taskListView/taskList';
|
|
169
171
|
import { TasksCardState } from './view/tasksCard/tasksCardState';
|
|
@@ -234,6 +236,7 @@ type EntitiesState = {
|
|
|
234
236
|
subscriptionSummaryState: SubscriptionSummaryState;
|
|
235
237
|
tagState: TagState;
|
|
236
238
|
taskGroupState: TaskGroupState;
|
|
239
|
+
taskGroupTemplateState: TaskGroupTemplateState;
|
|
237
240
|
taskState: TaskState;
|
|
238
241
|
taskSummaryState: TaskSummaryState;
|
|
239
242
|
tenantState: TenantState;
|
|
@@ -348,6 +351,7 @@ type ViewsState = {
|
|
|
348
351
|
subscriptionViewState: SubscriptionViewState;
|
|
349
352
|
tagViewState: TagViewState;
|
|
350
353
|
taskDetailState: TaskDetailViewState;
|
|
354
|
+
taskGroupTemplateViewState: TaskGroupTemplateViewState;
|
|
351
355
|
taskGroupViewState: TaskGroupViewState;
|
|
352
356
|
taskListState: TaskListState;
|
|
353
357
|
tasksCardState: TasksCardState;
|
|
@@ -483,6 +487,7 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
483
487
|
scheduleDetailState: ScheduleDetailViewState;
|
|
484
488
|
scheduleAccruedDetailState: ScheduleAccruedDetailViewState;
|
|
485
489
|
taskDetailState: TaskDetailViewState;
|
|
490
|
+
taskGroupTemplateViewState: TaskGroupTemplateViewState;
|
|
486
491
|
taskGroupViewState: TaskGroupViewState;
|
|
487
492
|
taskListState: TaskListState;
|
|
488
493
|
tagViewState: TagViewState;
|
|
@@ -560,6 +565,7 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
560
565
|
subscriptionSummaryState: SubscriptionSummaryState;
|
|
561
566
|
tagState: TagState;
|
|
562
567
|
taskGroupState: TaskGroupState;
|
|
568
|
+
taskGroupTemplateState: TaskGroupTemplateState;
|
|
563
569
|
taskState: TaskState;
|
|
564
570
|
taskSummaryState: TaskSummaryState;
|
|
565
571
|
tenantState: TenantState;
|
package/lib/reducer.js
CHANGED
|
@@ -86,6 +86,7 @@ const subscriptionPaymentAccountReducer_1 = __importStar(require("./entity/subsc
|
|
|
86
86
|
const tagReducer_1 = __importStar(require("./entity/tag/tagReducer"));
|
|
87
87
|
const taskReducer_1 = __importStar(require("./entity/task/taskReducer"));
|
|
88
88
|
const taskGroupReducer_1 = __importStar(require("./entity/taskGroup/taskGroupReducer"));
|
|
89
|
+
const taskGroupTemplateReducer_1 = __importStar(require("./entity/taskGroupTemplate/taskGroupTemplateReducer"));
|
|
89
90
|
const taskSummaryReducer_1 = __importStar(require("./entity/taskSummary/taskSummaryReducer"));
|
|
90
91
|
const tenantReducer_1 = __importStar(require("./entity/tenant/tenantReducer"));
|
|
91
92
|
const toastNotificationReducer_1 = __importStar(require("./entity/toastNotification/toastNotificationReducer"));
|
|
@@ -205,6 +206,7 @@ const zeniAccountsConfigReducer_1 = __importStar(require("./view/spendManagement
|
|
|
205
206
|
const subscriptionViewReducer_1 = __importStar(require("./view/subscriptionView/subscriptionViewReducer"));
|
|
206
207
|
const tagViewReducer_1 = __importStar(require("./view/tagView/tagViewReducer"));
|
|
207
208
|
const taskDetailReducer_1 = __importStar(require("./view/taskManager/taskDetailView/taskDetailReducer"));
|
|
209
|
+
const taskGroupTemplateViewReducer_1 = __importStar(require("./view/taskManager/taskGroupTemplateView/taskGroupTemplateViewReducer"));
|
|
208
210
|
const taskGroupViewReducer_1 = __importStar(require("./view/taskManager/taskGroupView/taskGroupViewReducer"));
|
|
209
211
|
const taskListReducer_1 = __importStar(require("./view/taskManager/taskListView/taskListReducer"));
|
|
210
212
|
const tasksCardReducer_1 = __importStar(require("./view/tasksCard/tasksCardReducer"));
|
|
@@ -276,6 +278,7 @@ const initialEntitiesState = {
|
|
|
276
278
|
subscriptionSummaryState: subscriptionSummaryReducer_1.initialState,
|
|
277
279
|
tagState: tagReducer_1.initialState,
|
|
278
280
|
taskGroupState: taskGroupReducer_1.initialState,
|
|
281
|
+
taskGroupTemplateState: taskGroupTemplateReducer_1.initialState,
|
|
279
282
|
taskState: taskReducer_1.initialState,
|
|
280
283
|
taskSummaryState: taskSummaryReducer_1.initialState,
|
|
281
284
|
tenantState: tenantReducer_1.initialState,
|
|
@@ -391,6 +394,7 @@ const initialViewsState = {
|
|
|
391
394
|
subscriptionViewState: subscriptionViewReducer_1.initialState,
|
|
392
395
|
tagViewState: tagViewReducer_1.initialState,
|
|
393
396
|
taskDetailState: taskDetailReducer_1.initialState,
|
|
397
|
+
taskGroupTemplateViewState: taskGroupTemplateViewReducer_1.initialState,
|
|
394
398
|
taskGroupViewState: taskGroupViewReducer_1.initialState,
|
|
395
399
|
taskListState: taskListReducer_1.initialState,
|
|
396
400
|
tasksCardState: tasksCardReducer_1.initialState,
|
|
@@ -473,6 +477,7 @@ const entityReducers = {
|
|
|
473
477
|
subscriptionSummaryState: subscriptionSummaryReducer_1.default,
|
|
474
478
|
tagState: tagReducer_1.default,
|
|
475
479
|
taskGroupState: taskGroupReducer_1.default,
|
|
480
|
+
taskGroupTemplateState: taskGroupTemplateReducer_1.default,
|
|
476
481
|
taskState: taskReducer_1.default,
|
|
477
482
|
taskSummaryState: taskSummaryReducer_1.default,
|
|
478
483
|
tenantState: tenantReducer_1.default,
|
|
@@ -587,6 +592,7 @@ const viewReducers = {
|
|
|
587
592
|
scheduleDetailState: scheduleDetailReducer_1.default,
|
|
588
593
|
scheduleAccruedDetailState: scheduleAccruedDetailReducer_1.default,
|
|
589
594
|
taskDetailState: taskDetailReducer_1.default,
|
|
595
|
+
taskGroupTemplateViewState: taskGroupTemplateViewReducer_1.default,
|
|
590
596
|
taskGroupViewState: taskGroupViewReducer_1.default,
|
|
591
597
|
taskListState: taskListReducer_1.default,
|
|
592
598
|
tagViewState: tagViewReducer_1.default,
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialTaskDetail = void 0;
|
|
3
|
+
exports.initialTaskDetail = exports.initialTaskDetailLocalData = void 0;
|
|
4
|
+
exports.initialTaskDetailLocalData = {
|
|
5
|
+
name: '',
|
|
6
|
+
description: '',
|
|
7
|
+
status: 'todo',
|
|
8
|
+
assignee: [],
|
|
9
|
+
dueDate: undefined,
|
|
10
|
+
priority: 'medium',
|
|
11
|
+
tagIds: [],
|
|
12
|
+
fileIds: [],
|
|
13
|
+
type: {
|
|
14
|
+
code: 'one_time',
|
|
15
|
+
name: 'One Time',
|
|
16
|
+
},
|
|
17
|
+
recurringEndDateLocalData: {},
|
|
18
|
+
timeSpent: '',
|
|
19
|
+
};
|
|
4
20
|
exports.initialTaskDetail = {
|
|
5
21
|
fetchTaskStatus: {
|
|
6
22
|
fetchState: 'Not-Started',
|
|
@@ -18,20 +34,5 @@ exports.initialTaskDetail = {
|
|
|
18
34
|
fetchState: 'Not-Started',
|
|
19
35
|
error: undefined,
|
|
20
36
|
},
|
|
21
|
-
taskDetailLocalData:
|
|
22
|
-
name: '',
|
|
23
|
-
description: '',
|
|
24
|
-
status: 'todo',
|
|
25
|
-
assignee: [],
|
|
26
|
-
dueDate: undefined,
|
|
27
|
-
priority: 'medium',
|
|
28
|
-
tagIds: [],
|
|
29
|
-
fileIds: [],
|
|
30
|
-
type: {
|
|
31
|
-
code: 'one_time',
|
|
32
|
-
name: 'One Time',
|
|
33
|
-
},
|
|
34
|
-
recurringEndDateLocalData: {},
|
|
35
|
-
timeSpent: '',
|
|
36
|
-
},
|
|
37
|
+
taskDetailLocalData: exports.initialTaskDetailLocalData,
|
|
37
38
|
};
|
package/lib/view/taskManager/taskGroupTemplateView/epics/createTaskFromTaskGroupTemplateEpic.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
4
|
+
import { updateTaskGroups } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
5
|
+
import { updateTaskGroupTemplates } from '../../../../entity/taskGroupTemplate/taskGroupTemplateReducer';
|
|
6
|
+
import { RootState } from '../../../../reducer';
|
|
7
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
8
|
+
import { updateTaskGroupViewOnTaskGroupCreationSuccess } from '../../taskGroupView/taskGroupViewReducer';
|
|
9
|
+
import { updateTaskListOnCreateTaskFromTemplateSuccess } from '../../taskListView/taskListReducer';
|
|
10
|
+
import { createTaskFromTaskGroupTemplate, updateTaskGroupTemplatesViewOnCreateTaskFailure, updateTaskGroupTemplatesViewOnCreateTaskSuccess } from '../taskGroupTemplateViewReducer';
|
|
11
|
+
export type ActionType = ReturnType<typeof createTaskFromTaskGroupTemplate> | ReturnType<typeof updateTaskGroupTemplates> | ReturnType<typeof updateTasks> | ReturnType<typeof updateTaskGroups> | ReturnType<typeof updateTaskGroupViewOnTaskGroupCreationSuccess> | ReturnType<typeof updateTaskListOnCreateTaskFromTemplateSuccess> | ReturnType<typeof updateTaskGroupTemplatesViewOnCreateTaskFailure> | ReturnType<typeof updateTaskGroupTemplatesViewOnCreateTaskSuccess>;
|
|
12
|
+
export declare const createTaskFromTaskGroupTemplateEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
package/lib/view/taskManager/taskGroupTemplateView/epics/createTaskFromTaskGroupTemplateEpic.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTaskFromTaskGroupTemplateEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
7
|
+
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
8
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
9
|
+
const taskGroupViewReducer_1 = require("../../taskGroupView/taskGroupViewReducer");
|
|
10
|
+
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
11
|
+
const taskGroupTemplateViewReducer_1 = require("../taskGroupTemplateViewReducer");
|
|
12
|
+
const createTaskFromTaskGroupTemplateEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupTemplateViewReducer_1.createTaskFromTaskGroupTemplate.match), (0, operators_1.switchMap)((action) => {
|
|
13
|
+
const { taskGroupTemplateId, taskIds } = action.payload;
|
|
14
|
+
const state = state$.value;
|
|
15
|
+
const existingTaskGroupIds = state.taskGroupViewState.taskGroupsIds;
|
|
16
|
+
const payload = {
|
|
17
|
+
group_name: taskGroupTemplateId,
|
|
18
|
+
is_create_all_tasks_inside_group: taskIds.length === 0,
|
|
19
|
+
task_names: taskIds,
|
|
20
|
+
};
|
|
21
|
+
return zeniAPI
|
|
22
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/templates`, payload)
|
|
23
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
24
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
25
|
+
const actions = [
|
|
26
|
+
(0, taskGroupReducer_1.updateTaskGroups)(response.data.groups),
|
|
27
|
+
(0, taskReducer_1.updateTasks)(response.data.tasks),
|
|
28
|
+
(0, taskGroupTemplateViewReducer_1.updateTaskGroupTemplatesViewOnCreateTaskSuccess)(),
|
|
29
|
+
(0, taskListReducer_1.updateTaskListOnCreateTaskFromTemplateSuccess)({
|
|
30
|
+
tasks: response.data.tasks,
|
|
31
|
+
}),
|
|
32
|
+
];
|
|
33
|
+
if (existingTaskGroupIds.includes(response.data.groups[0].task_group_id) === false) {
|
|
34
|
+
actions.push((0, taskGroupViewReducer_1.updateTaskGroupViewOnTaskGroupCreationSuccess)({
|
|
35
|
+
newTaskGroupId: response.data.groups[0].task_group_id,
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
return (0, rxjs_1.from)(actions);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
const actions = [
|
|
42
|
+
(0, taskGroupTemplateViewReducer_1.updateTaskGroupTemplatesViewOnCreateTaskFailure)(response.status),
|
|
43
|
+
];
|
|
44
|
+
return (0, rxjs_1.from)(actions);
|
|
45
|
+
}
|
|
46
|
+
}), (0, operators_1.catchError)((error) => {
|
|
47
|
+
const actions = [
|
|
48
|
+
(0, taskGroupTemplateViewReducer_1.updateTaskGroupTemplatesViewOnCreateTaskFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'Create task from templates REST API call errored out' +
|
|
49
|
+
JSON.stringify(error))),
|
|
50
|
+
];
|
|
51
|
+
return (0, rxjs_1.from)(actions);
|
|
52
|
+
}));
|
|
53
|
+
}));
|
|
54
|
+
exports.createTaskFromTaskGroupTemplateEpic = createTaskFromTaskGroupTemplateEpic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateTaskGroupTemplates } from '../../../../entity/taskGroupTemplate/taskGroupTemplateReducer';
|
|
4
|
+
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
+
import { fetchTaskGroupTemplates, updateTaskGroupTemplatesViewOnFetchFailure, updateTaskGroupTemplatesViewOnFetchSuccess } from '../taskGroupTemplateViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof fetchTaskGroupTemplates> | ReturnType<typeof updateTaskGroupTemplates> | ReturnType<typeof updateTaskGroupTemplatesViewOnFetchSuccess> | ReturnType<typeof updateTaskGroupTemplatesViewOnFetchFailure>;
|
|
8
|
+
export declare const fetchTaskGroupTemplatesEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchTaskGroupTemplatesEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const taskGroupTemplateReducer_1 = require("../../../../entity/taskGroupTemplate/taskGroupTemplateReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
+
const taskGroupTemplateViewReducer_1 = require("../taskGroupTemplateViewReducer");
|
|
9
|
+
const fetchTaskGroupTemplatesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupTemplateViewReducer_1.fetchTaskGroupTemplates.match), (0, operators_1.switchMap)(() => {
|
|
10
|
+
return zeniAPI
|
|
11
|
+
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/templates`)
|
|
12
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
13
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
14
|
+
const actions = [
|
|
15
|
+
(0, taskGroupTemplateViewReducer_1.updateTaskGroupTemplatesViewOnFetchSuccess)(response.data),
|
|
16
|
+
(0, taskGroupTemplateReducer_1.updateTaskGroupTemplates)(response.data.templates),
|
|
17
|
+
];
|
|
18
|
+
return (0, rxjs_1.from)(actions);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const actions = [
|
|
22
|
+
(0, taskGroupTemplateViewReducer_1.updateTaskGroupTemplatesViewOnFetchFailure)(response.status),
|
|
23
|
+
];
|
|
24
|
+
return (0, rxjs_1.from)(actions);
|
|
25
|
+
}
|
|
26
|
+
}), (0, operators_1.catchError)((error) => {
|
|
27
|
+
const actions = [
|
|
28
|
+
(0, taskGroupTemplateViewReducer_1.updateTaskGroupTemplatesViewOnFetchFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected error', 'fetch task group templates REST API call errored out' +
|
|
29
|
+
JSON.stringify(error))),
|
|
30
|
+
];
|
|
31
|
+
return (0, rxjs_1.from)(actions);
|
|
32
|
+
}));
|
|
33
|
+
}));
|
|
34
|
+
exports.fetchTaskGroupTemplatesEpic = fetchTaskGroupTemplatesEpic;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TaskPayload } from '../../../entity/task/taskPayload';
|
|
2
|
+
import { TaskGroupPayload } from '../../../entity/taskGroup/taskGroupPayload';
|
|
3
|
+
import { TaskGroupTemplatePayload } from '../../../entity/taskGroupTemplate/taskGroupTemplatePayload';
|
|
4
|
+
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
5
|
+
export interface FetchTaskGroupTemplatesPayload {
|
|
6
|
+
templates: TaskGroupTemplatePayload[];
|
|
7
|
+
}
|
|
8
|
+
export type FetchTaskGroupTemplatesResponse = ZeniAPIResponse<FetchTaskGroupTemplatesPayload>;
|
|
9
|
+
interface CreateTaskFromTaskGroupTemplatePayload {
|
|
10
|
+
tasks: TaskPayload[];
|
|
11
|
+
groups: TaskGroupPayload[];
|
|
12
|
+
}
|
|
13
|
+
export type CreateTaskFromTaskGroupTemplateResponse = ZeniAPIResponse<CreateTaskFromTaskGroupTemplatePayload>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
2
|
+
import { FetchTaskGroupTemplatesPayload } from './taskGroupTemplateViewPayload';
|
|
3
|
+
import { TaskGroupTemplateViewState } from './taskGroupTemplateViewState';
|
|
4
|
+
export declare const initialState: TaskGroupTemplateViewState;
|
|
5
|
+
export declare const fetchTaskGroupTemplates: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskGroupTemplateView/fetchTaskGroupTemplates">, updateTaskGroupTemplatesViewOnFetchSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<FetchTaskGroupTemplatesPayload, "taskGroupTemplateView/updateTaskGroupTemplatesViewOnFetchSuccess">, updateTaskGroupTemplatesViewOnFetchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "taskGroupTemplateView/updateTaskGroupTemplatesViewOnFetchFailure">, clearTaskGroupTemplatesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskGroupTemplateView/clearTaskGroupTemplatesView">, createTaskFromTaskGroupTemplate: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskGroupTemplateId: string, taskIds: string[]], {
|
|
6
|
+
taskGroupTemplateId: string;
|
|
7
|
+
taskIds: string[];
|
|
8
|
+
}, "taskGroupTemplateView/createTaskFromTaskGroupTemplate", never, never>, updateTaskGroupTemplatesViewOnCreateTaskSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskGroupTemplateView/updateTaskGroupTemplatesViewOnCreateTaskSuccess">, updateTaskGroupTemplatesViewOnCreateTaskFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "taskGroupTemplateView/updateTaskGroupTemplatesViewOnCreateTaskFailure">;
|
|
9
|
+
declare const _default: import("redux").Reducer<TaskGroupTemplateViewState>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.updateTaskGroupTemplatesViewOnCreateTaskFailure = exports.updateTaskGroupTemplatesViewOnCreateTaskSuccess = exports.createTaskFromTaskGroupTemplate = exports.clearTaskGroupTemplatesView = exports.updateTaskGroupTemplatesViewOnFetchFailure = exports.updateTaskGroupTemplatesViewOnFetchSuccess = exports.fetchTaskGroupTemplates = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.initialState = {
|
|
7
|
+
taskGroupTemplateIds: [],
|
|
8
|
+
fetchState: 'Not-Started',
|
|
9
|
+
error: undefined,
|
|
10
|
+
hasValidState() {
|
|
11
|
+
return this.fetchState === 'Completed';
|
|
12
|
+
},
|
|
13
|
+
createTaskFetchState: {
|
|
14
|
+
fetchState: 'Not-Started',
|
|
15
|
+
error: undefined,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const taskGroupTemplateView = (0, toolkit_1.createSlice)({
|
|
19
|
+
name: 'taskGroupTemplateView',
|
|
20
|
+
initialState: exports.initialState,
|
|
21
|
+
reducers: {
|
|
22
|
+
fetchTaskGroupTemplates(draft) {
|
|
23
|
+
draft.fetchState = 'In-Progress';
|
|
24
|
+
draft.error = undefined;
|
|
25
|
+
},
|
|
26
|
+
updateTaskGroupTemplatesViewOnFetchSuccess(draft, action) {
|
|
27
|
+
draft.fetchState = 'Completed';
|
|
28
|
+
draft.error = undefined;
|
|
29
|
+
const { templates } = action.payload;
|
|
30
|
+
draft.taskGroupTemplateIds = templates.map((template) => template.group_name);
|
|
31
|
+
},
|
|
32
|
+
updateTaskGroupTemplatesViewOnFetchFailure(draft, action) {
|
|
33
|
+
draft.fetchState = 'Error';
|
|
34
|
+
draft.error = action.payload;
|
|
35
|
+
},
|
|
36
|
+
createTaskFromTaskGroupTemplate: {
|
|
37
|
+
prepare(taskGroupTemplateId, taskIds) {
|
|
38
|
+
return { payload: { taskGroupTemplateId, taskIds } };
|
|
39
|
+
},
|
|
40
|
+
reducer(draft) {
|
|
41
|
+
draft.createTaskFetchState.fetchState = 'In-Progress';
|
|
42
|
+
draft.createTaskFetchState.error = undefined;
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
updateTaskGroupTemplatesViewOnCreateTaskSuccess(draft) {
|
|
46
|
+
draft.createTaskFetchState.fetchState = 'Completed';
|
|
47
|
+
draft.createTaskFetchState.error = undefined;
|
|
48
|
+
},
|
|
49
|
+
updateTaskGroupTemplatesViewOnCreateTaskFailure(draft, action) {
|
|
50
|
+
draft.createTaskFetchState.fetchState = 'Error';
|
|
51
|
+
draft.createTaskFetchState.error = action.payload;
|
|
52
|
+
},
|
|
53
|
+
clearTaskGroupTemplatesView(draft) {
|
|
54
|
+
Object.assign(draft, exports.initialState);
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
_a = taskGroupTemplateView.actions, exports.fetchTaskGroupTemplates = _a.fetchTaskGroupTemplates, exports.updateTaskGroupTemplatesViewOnFetchSuccess = _a.updateTaskGroupTemplatesViewOnFetchSuccess, exports.updateTaskGroupTemplatesViewOnFetchFailure = _a.updateTaskGroupTemplatesViewOnFetchFailure, exports.clearTaskGroupTemplatesView = _a.clearTaskGroupTemplatesView, exports.createTaskFromTaskGroupTemplate = _a.createTaskFromTaskGroupTemplate, exports.updateTaskGroupTemplatesViewOnCreateTaskSuccess = _a.updateTaskGroupTemplatesViewOnCreateTaskSuccess, exports.updateTaskGroupTemplatesViewOnCreateTaskFailure = _a.updateTaskGroupTemplatesViewOnCreateTaskFailure;
|
|
59
|
+
exports.default = taskGroupTemplateView.reducer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
|
+
import { TaskGroupTemplate } from '../../../entity/taskGroupTemplate/taskGroupTemplateState';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
export interface TaskGroupTemplateView extends SelectorView {
|
|
5
|
+
templates: TaskGroupTemplate[];
|
|
6
|
+
}
|
|
7
|
+
export declare const getTaskGroupTemplateView: (state: RootState) => TaskGroupTemplateView;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTaskGroupTemplateView = void 0;
|
|
4
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
|
+
const taskGroupTemplateSelector_1 = require("../../../entity/taskGroupTemplate/taskGroupTemplateSelector");
|
|
6
|
+
exports.getTaskGroupTemplateView = (0, toolkit_1.createSelector)((state) => state.taskGroupTemplateState, (state) => state.taskGroupTemplateViewState, (taskGroupTemplateState, taskGroupTemplateViewState) => {
|
|
7
|
+
const { fetchState, error, taskGroupTemplateIds } = taskGroupTemplateViewState;
|
|
8
|
+
const taskGroupTemplates = (0, taskGroupTemplateSelector_1.getTaskGroupTemplateByIds)(taskGroupTemplateState, taskGroupTemplateIds);
|
|
9
|
+
return { fetchState, error, templates: taskGroupTemplates };
|
|
10
|
+
});
|
|
@@ -4,7 +4,8 @@ import { RootState } from '../../../../reducer';
|
|
|
4
4
|
import { fetchClassList } from '../../../classList/classListReducer';
|
|
5
5
|
import { fetchTagList } from '../../../tagView/tagViewReducer';
|
|
6
6
|
import { fetchUserListByType } from '../../../userListView/userListViewReducer';
|
|
7
|
+
import { fetchTaskGroupTemplates } from '../../taskGroupTemplateView/taskGroupTemplateViewReducer';
|
|
7
8
|
import { fetchAllTaskGroups } from '../../taskGroupView/taskGroupViewReducer';
|
|
8
9
|
import { fetchTaskList, fetchTaskListPage } from '../taskListReducer';
|
|
9
|
-
export type ActionType = ReturnType<typeof fetchTaskListPage> | ReturnType<typeof fetchTaskList> | ReturnType<typeof fetchUserListByType> | ReturnType<typeof fetchTagList> | ReturnType<typeof fetchAllTaskGroups> | ReturnType<typeof fetchClassList>;
|
|
10
|
+
export type ActionType = ReturnType<typeof fetchTaskListPage> | ReturnType<typeof fetchTaskList> | ReturnType<typeof fetchUserListByType> | ReturnType<typeof fetchTagList> | ReturnType<typeof fetchAllTaskGroups> | ReturnType<typeof fetchTaskGroupTemplates> | ReturnType<typeof fetchClassList>;
|
|
10
11
|
export declare const fetchTaskListPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -6,6 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const classListReducer_1 = require("../../../classList/classListReducer");
|
|
7
7
|
const tagViewReducer_1 = require("../../../tagView/tagViewReducer");
|
|
8
8
|
const userListViewReducer_1 = require("../../../userListView/userListViewReducer");
|
|
9
|
+
const taskGroupTemplateViewReducer_1 = require("../../taskGroupTemplateView/taskGroupTemplateViewReducer");
|
|
9
10
|
const taskGroupViewReducer_1 = require("../../taskGroupView/taskGroupViewReducer");
|
|
10
11
|
const taskListReducer_1 = require("../taskListReducer");
|
|
11
12
|
const fetchTaskListPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.fetchTaskListPage.match), (0, operators_1.mergeMap)((action) => {
|
|
@@ -18,6 +19,7 @@ const fetchTaskListPageEpic = (actions$, state$) => actions$.pipe((0, operators_
|
|
|
18
19
|
taskListPageActions.push((0, userListViewReducer_1.fetchUserListByType)('taskManagerCandidate', true));
|
|
19
20
|
taskListPageActions.push((0, tagViewReducer_1.fetchTagList)());
|
|
20
21
|
taskListPageActions.push((0, taskGroupViewReducer_1.fetchAllTaskGroups)());
|
|
22
|
+
taskListPageActions.push((0, taskGroupTemplateViewReducer_1.fetchTaskGroupTemplates)());
|
|
21
23
|
}
|
|
22
24
|
else {
|
|
23
25
|
if (state.taskListState.fetchState !== 'In-Progress' &&
|
|
@@ -41,6 +43,10 @@ const fetchTaskListPageEpic = (actions$, state$) => actions$.pipe((0, operators_
|
|
|
41
43
|
state.taskGroupViewState.fetchState !== 'In-Progress') {
|
|
42
44
|
taskListPageActions.push((0, taskGroupViewReducer_1.fetchAllTaskGroups)());
|
|
43
45
|
}
|
|
46
|
+
if (state.taskGroupTemplateViewState.hasValidState() === false &&
|
|
47
|
+
state.taskGroupTemplateViewState.fetchState !== 'In-Progress') {
|
|
48
|
+
taskListPageActions.push((0, taskGroupTemplateViewReducer_1.fetchTaskGroupTemplates)());
|
|
49
|
+
}
|
|
44
50
|
}
|
|
45
51
|
return (0, rxjs_1.concat)((0, rxjs_1.from)(taskListPageActions));
|
|
46
52
|
}));
|
|
@@ -52,6 +52,8 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
52
52
|
updates: Partial<Task>;
|
|
53
53
|
}, "taskList/updateTaskFromListView">, updateTasksListOnUpdateTaskSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskList/updateTasksListOnUpdateTaskSuccess">, updateTasksListOnUpdateTaskFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
54
54
|
error: ZeniAPIStatus;
|
|
55
|
-
}, "taskList/updateTasksListOnUpdateTaskFailure">,
|
|
55
|
+
}, "taskList/updateTasksListOnUpdateTaskFailure">, updateTaskListOnCreateTaskFromTemplateSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
56
|
+
tasks: TaskPayload[];
|
|
57
|
+
}, "taskList/updateTaskListOnCreateTaskFromTemplateSuccess">, clearTaskList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskList/clearTaskList">;
|
|
56
58
|
declare const _default: import("redux").Reducer<TaskListState>;
|
|
57
59
|
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.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.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;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const taskState_1 = require("../../../entity/task/taskState");
|
|
7
7
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
@@ -17,6 +17,7 @@ const initialTaskIdsByPriority = {
|
|
|
17
17
|
high: [],
|
|
18
18
|
medium: [],
|
|
19
19
|
low: [],
|
|
20
|
+
normal: [],
|
|
20
21
|
};
|
|
21
22
|
const initialTaskIdsByStatus = {
|
|
22
23
|
done: [],
|
|
@@ -302,50 +303,16 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
302
303
|
draft.taskIdsByDueDate[dueDateKey] = draft.taskIdsByDueDate[dueDateKey].filter((taskId) => taskId !== currentTaskState.id);
|
|
303
304
|
draft.taskIdsByGroupsIds[taskGroupId] = draft.taskIdsByGroupsIds[taskGroupId].filter((taskId) => taskId !== currentTaskState.id);
|
|
304
305
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
const
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
taskId,
|
|
316
|
-
...draft.taskIdsByStatus[statusKey],
|
|
317
|
-
];
|
|
318
|
-
draft.taskIdsByDueDate[dueDateKey] = [
|
|
319
|
-
taskId,
|
|
320
|
-
...draft.taskIdsByDueDate[dueDateKey],
|
|
321
|
-
];
|
|
322
|
-
if (draft.taskIdsByAssignees[assigneeKey] != null) {
|
|
323
|
-
draft.taskIdsByAssignees[assigneeKey] = [
|
|
324
|
-
taskId,
|
|
325
|
-
...draft.taskIdsByAssignees[assigneeKey],
|
|
326
|
-
];
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
draft.taskIdsByAssignees[assigneeKey] = [taskId];
|
|
330
|
-
}
|
|
331
|
-
if (draft.taskIdsByTags[tagsKey] != null) {
|
|
332
|
-
draft.taskIdsByTags[tagsKey] = [
|
|
333
|
-
taskId,
|
|
334
|
-
...draft.taskIdsByTags[tagsKey],
|
|
335
|
-
];
|
|
336
|
-
}
|
|
337
|
-
else {
|
|
338
|
-
draft.taskIdsByTags[tagsKey] = [taskId];
|
|
339
|
-
}
|
|
340
|
-
if (draft.taskIdsByGroupsIds[taskGroupId] != null) {
|
|
341
|
-
draft.taskIdsByGroupsIds[taskGroupId] = [
|
|
342
|
-
taskId,
|
|
343
|
-
...draft.taskIdsByGroupsIds[taskGroupId],
|
|
344
|
-
];
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
347
|
-
draft.taskIdsByGroupsIds[taskGroupId] = [taskId];
|
|
348
|
-
}
|
|
306
|
+
doUpdateTaskList(draft, task, taskGroupId);
|
|
307
|
+
},
|
|
308
|
+
updateTaskListOnCreateTaskFromTemplateSuccess(draft, action) {
|
|
309
|
+
const { tasks } = action.payload;
|
|
310
|
+
tasks.forEach((task) => {
|
|
311
|
+
const taskGroupId = task.task_group_ids != null ? task.task_group_ids[0] : null;
|
|
312
|
+
if (taskGroupId != null) {
|
|
313
|
+
doUpdateTaskList(draft, task, taskGroupId);
|
|
314
|
+
}
|
|
315
|
+
});
|
|
349
316
|
},
|
|
350
317
|
updateTaskListOnTaskGroupNameUpdate(draft, action) {
|
|
351
318
|
const { taskGroupName, taskGroupId } = action.payload;
|
|
@@ -415,11 +382,55 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
415
382
|
},
|
|
416
383
|
},
|
|
417
384
|
});
|
|
418
|
-
_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.clearTaskList = _a.clearTaskList;
|
|
385
|
+
_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;
|
|
419
386
|
exports.default = taskList.reducer;
|
|
420
387
|
/**
|
|
421
388
|
* helpers
|
|
422
389
|
*/
|
|
390
|
+
const doUpdateTaskList = (draft, task, taskGroupId) => {
|
|
391
|
+
const taskId = task.task_id;
|
|
392
|
+
const priorityKey = (0, taskState_1.toPriorityCodeType)(task.priority.code);
|
|
393
|
+
const statusKey = (0, taskState_1.toTaskStatusCodeType)(task.status.code);
|
|
394
|
+
const assigneeKey = getAssigneesGroupKey(task.assignees);
|
|
395
|
+
const dueDateKey = getDueDateGroupKey(task.due_date);
|
|
396
|
+
const tagsKey = getTagsGroupKey(task.tags);
|
|
397
|
+
draft.taskIdsByPriority[priorityKey] = [
|
|
398
|
+
taskId,
|
|
399
|
+
...draft.taskIdsByPriority[priorityKey],
|
|
400
|
+
];
|
|
401
|
+
draft.taskIdsByStatus[statusKey] = [
|
|
402
|
+
taskId,
|
|
403
|
+
...draft.taskIdsByStatus[statusKey],
|
|
404
|
+
];
|
|
405
|
+
draft.taskIdsByDueDate[dueDateKey] = [
|
|
406
|
+
taskId,
|
|
407
|
+
...draft.taskIdsByDueDate[dueDateKey],
|
|
408
|
+
];
|
|
409
|
+
if (draft.taskIdsByAssignees[assigneeKey] != null) {
|
|
410
|
+
draft.taskIdsByAssignees[assigneeKey] = [
|
|
411
|
+
taskId,
|
|
412
|
+
...draft.taskIdsByAssignees[assigneeKey],
|
|
413
|
+
];
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
draft.taskIdsByAssignees[assigneeKey] = [taskId];
|
|
417
|
+
}
|
|
418
|
+
if (draft.taskIdsByTags[tagsKey] != null) {
|
|
419
|
+
draft.taskIdsByTags[tagsKey] = [taskId, ...draft.taskIdsByTags[tagsKey]];
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
draft.taskIdsByTags[tagsKey] = [taskId];
|
|
423
|
+
}
|
|
424
|
+
if (draft.taskIdsByGroupsIds[taskGroupId] != null) {
|
|
425
|
+
draft.taskIdsByGroupsIds[taskGroupId] = [
|
|
426
|
+
taskId,
|
|
427
|
+
...draft.taskIdsByGroupsIds[taskGroupId],
|
|
428
|
+
];
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
draft.taskIdsByGroupsIds[taskGroupId] = [taskId];
|
|
432
|
+
}
|
|
433
|
+
};
|
|
423
434
|
const getDueDateGroupKey = (due_date) => {
|
|
424
435
|
if (due_date != null) {
|
|
425
436
|
const dueDate = (0, zeniDayJS_1.date)(due_date);
|
|
@@ -3,6 +3,7 @@ import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndRep
|
|
|
3
3
|
import { AddressState } from '../../../entity/address/addressState';
|
|
4
4
|
import { TagState } from '../../../entity/tag/tagState';
|
|
5
5
|
import { Task, TaskState } from '../../../entity/task/taskState';
|
|
6
|
+
import { TaskGroupTemplate } from '../../../entity/taskGroupTemplate/taskGroupTemplateState';
|
|
6
7
|
import { UserState } from '../../../entity/user/userState';
|
|
7
8
|
import { UserRoleState } from '../../../entity/userRole/userRoleState';
|
|
8
9
|
import { RootState } from '../../../reducer';
|
|
@@ -24,10 +25,12 @@ export interface TaskListSelectorView extends SelectorView {
|
|
|
24
25
|
filters: TaskListFilters;
|
|
25
26
|
userList: UserListSelectorView;
|
|
26
27
|
localData: TaskListLocalData;
|
|
28
|
+
taskGroupTemplates: TaskGroupTemplate[];
|
|
27
29
|
updateTasksFetchState: FetchStateAndError;
|
|
28
30
|
taskGroupDeleteStatus: FetchStateAndError;
|
|
29
31
|
taskGroupUpdateStatus: FetchStateAndError;
|
|
30
32
|
taskGroupCreationStatus: FetchStateAndError;
|
|
33
|
+
taskCreationFromTemplateStatus: FetchStateAndError;
|
|
31
34
|
}
|
|
32
35
|
export declare const getTaskListGroupedByAssignees: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }: {
|
|
33
36
|
taskListState: TaskListState;
|
|
@@ -51,7 +54,7 @@ export declare const getTaskListGroupedByPriority: ({ taskListState, taskState,
|
|
|
51
54
|
tagState: TagState;
|
|
52
55
|
}) => {
|
|
53
56
|
groupName: string;
|
|
54
|
-
id: "high" | "low" | "medium" | "urgent";
|
|
57
|
+
id: "normal" | "high" | "low" | "medium" | "urgent";
|
|
55
58
|
isDefault: boolean;
|
|
56
59
|
tasks: TaskWithUserDetails[];
|
|
57
60
|
}[];
|