@zeniai/client-epic-state 4.11.16 → 4.11.17
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/billPay/billTransaction/billTransactionPayload.d.ts +9 -0
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +15 -2
- package/lib/entity/billPay/billTransaction/billTransactionReducer.d.ts +2 -1
- package/lib/entity/billPay/billTransaction/billTransactionReducer.js +25 -2
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +11 -1
- package/lib/entity/billPay/billTransaction/billTransactionState.js +9 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +6 -0
- package/lib/entity/task/taskPayload.d.ts +2 -2
- package/lib/entity/task/taskPayload.js +1 -0
- package/lib/entity/task/taskState.d.ts +3 -2
- package/lib/entity/taskGroup/taskGroupPayload.d.ts +9 -0
- package/lib/entity/taskGroup/taskGroupPayload.js +14 -0
- package/lib/entity/taskGroup/taskGroupReducer.d.ts +6 -0
- package/lib/entity/taskGroup/taskGroupReducer.js +33 -0
- package/lib/entity/taskGroup/taskGroupSelector.d.ts +4 -0
- package/lib/entity/taskGroup/taskGroupSelector.js +18 -0
- package/lib/entity/taskGroup/taskGroupState.d.ts +12 -0
- package/lib/entity/taskGroup/taskGroupState.js +2 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +5 -2
- package/lib/entity/tenant/clearAllEpic.js +8 -0
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/entity/transaction/stateTypes/attachment.d.ts +6 -0
- package/lib/entity/transaction/stateTypes/transactionType.d.ts +3 -0
- package/lib/entity/transaction/stateTypes/transactionType.js +7 -3
- package/lib/entity/vendor/vendorPayload.d.ts +2 -0
- package/lib/entity/vendor/vendorPayload.js +5 -1
- package/lib/entity/vendor/vendorState.d.ts +2 -0
- package/lib/epic.d.ts +12 -1
- package/lib/epic.js +12 -1
- package/lib/index.d.ts +18 -12
- package/lib/index.js +37 -10
- package/lib/reducer.d.ts +9 -0
- package/lib/reducer.js +9 -0
- package/lib/view/companyView/selector/companyManagementViewSelector.js +13 -7
- package/lib/view/companyView/selector/companyPortfolioViewSelector.js +1 -6
- package/lib/view/fileView/fileUploadHelpers.d.ts +5 -0
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +26 -9
- package/lib/view/scheduleView/scheduleListView/scheduleListSelector.js +1 -1
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +3 -2
- package/lib/view/spendManagement/billPay/billList/billListReducer.js +9 -3
- package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +19 -2
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +150 -3
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +1 -0
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +2 -0
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +1 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewPayload.d.ts +32 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewPayload.js +2 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.d.ts +17 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewReducer.js +166 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.d.ts +24 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewSelector.js +45 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.d.ts +28 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/billsBulkActionViewState.js +7 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/approveOrRejectBillsBulkActionEpic.d.ts +9 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/approveOrRejectBillsBulkActionEpic.js +73 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/cancelOrDeleteBillsBulkActionEpic.d.ts +8 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/cancelOrDeleteBillsBulkActionEpic.js +74 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/reviewDraftBillsBulkActionEpic.ts.d.ts +7 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/reviewDraftBillsBulkActionEpic.ts.js +29 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic.d.ts +8 -0
- package/lib/view/spendManagement/billPay/billsBulkActionView/epics/submitDraftBillsBulkActionEpic.js +62 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +9 -8
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +6 -4
- package/lib/view/spendManagement/commonHistoryView/commonHistory.d.ts +1 -1
- package/lib/view/spendManagement/helpers.d.ts +3 -0
- package/lib/view/spendManagement/helpers.js +17 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListReducer.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +3 -3
- package/lib/view/subscriptionView/subscriptionViewSelector.js +5 -1
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +11 -4
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +2 -1
- package/lib/view/taskManager/taskGroupView/epics/createNewTaskGroupEpic.d.ts +10 -0
- package/lib/view/taskManager/taskGroupView/epics/createNewTaskGroupEpic.js +57 -0
- package/lib/view/taskManager/taskGroupView/epics/deleteTaskGroupEpic.d.ts +10 -0
- package/lib/view/taskManager/taskGroupView/epics/deleteTaskGroupEpic.js +41 -0
- package/lib/view/taskManager/taskGroupView/epics/fetchAllTaskGroupsEpic.d.ts +8 -0
- package/lib/view/taskManager/taskGroupView/epics/fetchAllTaskGroupsEpic.js +33 -0
- package/lib/view/taskManager/taskGroupView/epics/updateTaskGroupNameEpic.d.ts +10 -0
- package/lib/view/taskManager/taskGroupView/epics/updateTaskGroupNameEpic.js +51 -0
- package/lib/view/taskManager/taskGroupView/taskGroupViewPayload.d.ts +6 -0
- package/lib/view/taskManager/taskGroupView/taskGroupViewPayload.js +2 -0
- package/lib/view/taskManager/taskGroupView/taskGroupViewReducer.d.ts +34 -0
- package/lib/view/taskManager/taskGroupView/taskGroupViewReducer.js +123 -0
- package/lib/view/taskManager/taskGroupView/taskGroupViewState.d.ts +7 -0
- package/lib/view/taskManager/taskGroupView/taskGroupViewState.js +2 -0
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.d.ts +8 -0
- package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.js +88 -0
- package/lib/view/taskManager/taskListView/dragNDropTasksEpic.d.ts +6 -0
- package/lib/view/taskManager/taskListView/dragNDropTasksEpic.js +20 -0
- package/lib/view/taskManager/taskListView/fetchTaskListPageEpic.d.ts +3 -1
- package/lib/view/taskManager/taskListView/fetchTaskListPageEpic.js +12 -0
- package/lib/view/taskManager/taskListView/taskList.d.ts +14 -1
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +31 -2
- package/lib/view/taskManager/taskListView/taskListReducer.js +136 -9
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +12 -2
- package/lib/view/taskManager/taskListView/taskListSelector.js +59 -23
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +22 -5
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewAttachmentsEpic.d.ts +10 -0
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewAttachmentsEpic.js +37 -0
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewViewEpic.js +1 -0
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorFirstReviewViewEpic.js +11 -5
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.d.ts +15 -0
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.d.ts +13 -3
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +45 -3
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.d.ts +8 -0
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.js +17 -2
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.d.ts +6 -2
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { createNewTaskGroup, updateTaskGroupCreationFetchStatus, updateTaskGroupViewOnTaskGroupCreationSuccess } from '../taskGroupViewReducer';
|
|
6
|
+
import { updateTaskListOnNewGroupCreationSuccess, bulkUpdateTaskList } from '../../taskListView/taskListReducer';
|
|
7
|
+
import { updateTaskGroup } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
8
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
|
+
export declare type ActionType = ReturnType<typeof createNewTaskGroup> | ReturnType<typeof updateTaskGroup> | ReturnType<typeof updateTaskListOnNewGroupCreationSuccess> | ReturnType<typeof updateTaskGroupViewOnTaskGroupCreationSuccess> | ReturnType<typeof openSnackbar> | ReturnType<typeof bulkUpdateTaskList> | ReturnType<typeof updateTaskGroupCreationFetchStatus>;
|
|
10
|
+
export declare const createNewTaskGroupEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNewTaskGroupEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const taskGroupViewReducer_1 = require("../taskGroupViewReducer");
|
|
8
|
+
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
9
|
+
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
10
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
11
|
+
const createNewTaskGroupEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupViewReducer_1.createNewTaskGroup.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
+
const { groupName, updateSelectedTasks } = action.payload;
|
|
13
|
+
const state = state$.value;
|
|
14
|
+
const { localData } = state.taskListState;
|
|
15
|
+
const payload = {
|
|
16
|
+
name: groupName,
|
|
17
|
+
};
|
|
18
|
+
return zeniAPI
|
|
19
|
+
.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/groups`, payload)
|
|
20
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
21
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
22
|
+
const actions = [
|
|
23
|
+
(0, taskGroupReducer_1.updateTaskGroup)(response.data.task_groups[0]),
|
|
24
|
+
(0, taskGroupViewReducer_1.updateTaskGroupViewOnTaskGroupCreationSuccess)({
|
|
25
|
+
newTaskGroupId: response.data.task_groups[0].task_group_id,
|
|
26
|
+
}),
|
|
27
|
+
(0, taskListReducer_1.updateTaskListOnNewGroupCreationSuccess)({
|
|
28
|
+
newTaskGroup: response.data.task_groups[0],
|
|
29
|
+
}),
|
|
30
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
31
|
+
messageSection: 'task_group_creation_success',
|
|
32
|
+
messageText: 'success',
|
|
33
|
+
type: 'success',
|
|
34
|
+
}),
|
|
35
|
+
];
|
|
36
|
+
if (updateSelectedTasks === true) {
|
|
37
|
+
actions.push((0, taskListReducer_1.bulkUpdateTaskList)(localData.selectedTaskIds, {
|
|
38
|
+
taskGroupIds: [response.data.task_groups[0].task_group_id],
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
return (0, rxjs_1.from)(actions);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupCreationFetchStatus)({
|
|
45
|
+
fetchState: 'Error',
|
|
46
|
+
error: response.status,
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
}), (0, operators_1.catchError)((error) => {
|
|
50
|
+
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupCreationFetchStatus)({
|
|
51
|
+
fetchState: 'Error',
|
|
52
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Create Task Group REST API call errored out' +
|
|
53
|
+
JSON.stringify(error)),
|
|
54
|
+
}));
|
|
55
|
+
}));
|
|
56
|
+
}));
|
|
57
|
+
exports.createNewTaskGroupEpic = createNewTaskGroupEpic;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { deleteTaskGroup, updateTaskGroupDeletionFetchStatus, updateTaskGroupViewOnTaskDeletionSuccess } from '../taskGroupViewReducer';
|
|
6
|
+
import { updateTaskListOnTaskGroupDeletion } from '../../taskListView/taskListReducer';
|
|
7
|
+
import { removeTaskGroup } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
8
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
|
+
export declare type ActionType = ReturnType<typeof deleteTaskGroup> | ReturnType<typeof removeTaskGroup> | ReturnType<typeof updateTaskListOnTaskGroupDeletion> | ReturnType<typeof updateTaskGroupDeletionFetchStatus> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateTaskGroupViewOnTaskDeletionSuccess>;
|
|
10
|
+
export declare const deleteTaskGroupEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteTaskGroupEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const taskGroupViewReducer_1 = require("../taskGroupViewReducer");
|
|
8
|
+
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
9
|
+
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
10
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
11
|
+
const deleteTaskGroupEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupViewReducer_1.deleteTaskGroup.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
+
const { taskGroupId } = action.payload;
|
|
13
|
+
return zeniAPI
|
|
14
|
+
.deleteAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/groups/${taskGroupId}`)
|
|
15
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
16
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
17
|
+
return (0, rxjs_1.of)((0, taskGroupReducer_1.removeTaskGroup)(taskGroupId), (0, taskGroupViewReducer_1.updateTaskGroupViewOnTaskDeletionSuccess)({
|
|
18
|
+
deletedTaskGroupId: taskGroupId,
|
|
19
|
+
}), (0, taskListReducer_1.updateTaskListOnTaskGroupDeletion)({
|
|
20
|
+
taskGroupId,
|
|
21
|
+
}), (0, snackbarReducer_1.openSnackbar)({
|
|
22
|
+
messageSection: 'task_group_deletion_success',
|
|
23
|
+
messageText: 'success',
|
|
24
|
+
type: 'success',
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupDeletionFetchStatus)({
|
|
29
|
+
fetchState: 'Error',
|
|
30
|
+
error: response.status,
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}), (0, operators_1.catchError)((error) => {
|
|
34
|
+
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupDeletionFetchStatus)({
|
|
35
|
+
fetchState: 'Error',
|
|
36
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Delete Task Group REST API call errored out' +
|
|
37
|
+
JSON.stringify(error)),
|
|
38
|
+
}));
|
|
39
|
+
}));
|
|
40
|
+
}));
|
|
41
|
+
exports.deleteTaskGroupEpic = deleteTaskGroupEpic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { fetchAllTaskGroups, updateTaskGroupsOnSuccess, updateTaskGroupsFetchStatus } from '../taskGroupViewReducer';
|
|
6
|
+
import { updateTaskGroups } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
7
|
+
export declare type ActionType = ReturnType<typeof fetchAllTaskGroups> | ReturnType<typeof updateTaskGroups> | ReturnType<typeof updateTaskGroupsOnSuccess> | ReturnType<typeof updateTaskGroupsFetchStatus>;
|
|
8
|
+
export declare const fetchAllTaskGroupsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchAllTaskGroupsEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const taskGroupViewReducer_1 = require("../taskGroupViewReducer");
|
|
8
|
+
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
9
|
+
const fetchAllTaskGroupsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupViewReducer_1.fetchAllTaskGroups.match), (0, operators_1.switchMap)(() => {
|
|
10
|
+
const queryParam = { filter_type: 'all' };
|
|
11
|
+
return zeniAPI
|
|
12
|
+
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/groups?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
13
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
15
|
+
return (0, rxjs_1.of)((0, taskGroupReducer_1.updateTaskGroups)(response.data.task_groups), (0, taskGroupViewReducer_1.updateTaskGroupsOnSuccess)({
|
|
16
|
+
data: response.data.task_groups,
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupsFetchStatus)({
|
|
21
|
+
fetchState: 'Error',
|
|
22
|
+
error: response.status,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
}), (0, operators_1.catchError)((error) => {
|
|
26
|
+
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupsFetchStatus)({
|
|
27
|
+
fetchState: 'Error',
|
|
28
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch all task groups REST API call errored out' +
|
|
29
|
+
JSON.stringify(error)),
|
|
30
|
+
}));
|
|
31
|
+
}));
|
|
32
|
+
}));
|
|
33
|
+
exports.fetchAllTaskGroupsEpic = fetchAllTaskGroupsEpic;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
5
|
+
import { updateTaskGroupName, updateTaskGroupFetchStatus } from '../taskGroupViewReducer';
|
|
6
|
+
import { updateTaskListOnTaskGroupNameUpdate } from '../../taskListView/taskListReducer';
|
|
7
|
+
import { updateTaskGroup } from '../../../../entity/taskGroup/taskGroupReducer';
|
|
8
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
|
+
export declare type ActionType = ReturnType<typeof updateTaskGroupName> | ReturnType<typeof updateTaskGroupFetchStatus> | ReturnType<typeof updateTaskGroup> | ReturnType<typeof updateTaskListOnTaskGroupNameUpdate> | ReturnType<typeof openSnackbar>;
|
|
10
|
+
export declare const updateTaskGroupNameEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateTaskGroupNameEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
7
|
+
const taskGroupViewReducer_1 = require("../taskGroupViewReducer");
|
|
8
|
+
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
9
|
+
const taskGroupReducer_1 = require("../../../../entity/taskGroup/taskGroupReducer");
|
|
10
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
11
|
+
const updateTaskGroupNameEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskGroupViewReducer_1.updateTaskGroupName.match), (0, operators_1.switchMap)((action) => {
|
|
12
|
+
const { taskGroupId, taskGroupName } = action.payload;
|
|
13
|
+
const payload = {
|
|
14
|
+
name: taskGroupName,
|
|
15
|
+
};
|
|
16
|
+
return zeniAPI
|
|
17
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/groups/${taskGroupId}`, payload)
|
|
18
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
20
|
+
const actions = [
|
|
21
|
+
(0, taskGroupReducer_1.updateTaskGroup)(response.data.task_groups[0]),
|
|
22
|
+
(0, taskGroupViewReducer_1.updateTaskGroupFetchStatus)({
|
|
23
|
+
fetchState: 'Completed',
|
|
24
|
+
}),
|
|
25
|
+
(0, taskListReducer_1.updateTaskListOnTaskGroupNameUpdate)({
|
|
26
|
+
taskGroupId,
|
|
27
|
+
taskGroupName,
|
|
28
|
+
}),
|
|
29
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
30
|
+
messageSection: 'task_group_update_success',
|
|
31
|
+
messageText: 'success',
|
|
32
|
+
type: 'success',
|
|
33
|
+
}),
|
|
34
|
+
];
|
|
35
|
+
return (0, rxjs_1.from)(actions);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupFetchStatus)({
|
|
39
|
+
fetchState: 'Error',
|
|
40
|
+
error: response.status,
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
}), (0, operators_1.catchError)((error) => {
|
|
44
|
+
return (0, rxjs_1.of)((0, taskGroupViewReducer_1.updateTaskGroupFetchStatus)({
|
|
45
|
+
fetchState: 'Error',
|
|
46
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Update Task Group REST API call errored out' +
|
|
47
|
+
JSON.stringify(error)),
|
|
48
|
+
}));
|
|
49
|
+
}));
|
|
50
|
+
}));
|
|
51
|
+
exports.updateTaskGroupNameEpic = updateTaskGroupNameEpic;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TaskGroupPayload } from '../../../entity/taskGroup/taskGroupPayload';
|
|
2
|
+
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
3
|
+
export interface FetchTaskGroupsPayload {
|
|
4
|
+
task_groups: TaskGroupPayload[];
|
|
5
|
+
}
|
|
6
|
+
export declare type FetchTaskGroupsResponse = ZeniAPIResponse<FetchTaskGroupsPayload>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { TaskGroupPayload } from '../../../entity/taskGroup/taskGroupPayload';
|
|
3
|
+
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
4
|
+
import { TaskGroupViewState } from './taskGroupViewState';
|
|
5
|
+
export declare const initialState: TaskGroupViewState;
|
|
6
|
+
export declare const fetchAllTaskGroups: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateTaskGroupsOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
7
|
+
data: TaskGroupPayload[];
|
|
8
|
+
}, string>, updateTaskGroupsFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
9
|
+
fetchState: FetchState;
|
|
10
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
11
|
+
}, string>, createNewTaskGroup: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[groupName: string, updateSelectedTasks: boolean], {
|
|
12
|
+
groupName: string;
|
|
13
|
+
updateSelectedTasks: boolean;
|
|
14
|
+
}, string, never, never>, updateTaskGroupCreationFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
|
+
fetchState: FetchState;
|
|
16
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
17
|
+
}, string>, updateTaskGroupViewOnTaskGroupCreationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
|
+
newTaskGroupId: ID;
|
|
19
|
+
}, string>, deleteTaskGroup: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskGroupId: string], {
|
|
20
|
+
taskGroupId: string;
|
|
21
|
+
}, string, never, never>, updateTaskGroupDeletionFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
22
|
+
fetchState: FetchState;
|
|
23
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
24
|
+
}, string>, updateTaskGroupViewOnTaskDeletionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
25
|
+
deletedTaskGroupId: ID;
|
|
26
|
+
}, string>, updateTaskGroupName: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskGroupId: any, taskGroupName: any], {
|
|
27
|
+
taskGroupId: any;
|
|
28
|
+
taskGroupName: any;
|
|
29
|
+
}, string, never, never>, updateTaskGroupFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
30
|
+
fetchState: FetchState;
|
|
31
|
+
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
32
|
+
}, string>, clearTaskGroupView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
33
|
+
declare const _default: import("@reduxjs/toolkit").Reducer<TaskGroupViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearTaskGroupView = exports.updateTaskGroupFetchStatus = exports.updateTaskGroupName = exports.updateTaskGroupViewOnTaskDeletionSuccess = exports.updateTaskGroupDeletionFetchStatus = exports.deleteTaskGroup = exports.updateTaskGroupViewOnTaskGroupCreationSuccess = exports.updateTaskGroupCreationFetchStatus = exports.createNewTaskGroup = exports.updateTaskGroupsFetchStatus = exports.updateTaskGroupsOnSuccess = exports.fetchAllTaskGroups = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.initialState = {
|
|
7
|
+
taskGroupsIds: [],
|
|
8
|
+
fetchState: 'Not-Started',
|
|
9
|
+
error: undefined,
|
|
10
|
+
hasValidState() {
|
|
11
|
+
return this.fetchState == 'Completed';
|
|
12
|
+
},
|
|
13
|
+
taskGroupCreationStatus: {
|
|
14
|
+
fetchState: 'Not-Started',
|
|
15
|
+
error: undefined,
|
|
16
|
+
},
|
|
17
|
+
taskGroupDeleteStatus: {
|
|
18
|
+
fetchState: 'Not-Started',
|
|
19
|
+
error: undefined,
|
|
20
|
+
},
|
|
21
|
+
taskGroupUpdateStatus: {
|
|
22
|
+
fetchState: 'Not-Started',
|
|
23
|
+
error: undefined,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
const taskGroupView = (0, toolkit_1.createSlice)({
|
|
27
|
+
name: 'taskGroupView',
|
|
28
|
+
initialState: exports.initialState,
|
|
29
|
+
reducers: {
|
|
30
|
+
fetchAllTaskGroups(draft) {
|
|
31
|
+
draft.fetchState = 'In-Progress';
|
|
32
|
+
draft.error = undefined;
|
|
33
|
+
},
|
|
34
|
+
updateTaskGroupsOnSuccess(draft, action) {
|
|
35
|
+
const { data } = action.payload;
|
|
36
|
+
draft.fetchState = 'Completed';
|
|
37
|
+
draft.error = undefined;
|
|
38
|
+
draft.taskGroupsIds = data.map((task) => task.task_group_id);
|
|
39
|
+
},
|
|
40
|
+
updateTaskGroupsFetchStatus(draft, action) {
|
|
41
|
+
draft.fetchState = action.payload.fetchState;
|
|
42
|
+
draft.error = action.payload.error;
|
|
43
|
+
},
|
|
44
|
+
createNewTaskGroup: {
|
|
45
|
+
reducer(draft) {
|
|
46
|
+
draft.taskGroupCreationStatus = {
|
|
47
|
+
fetchState: 'In-Progress',
|
|
48
|
+
error: undefined,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
prepare(groupName, updateSelectedTasks) {
|
|
52
|
+
return {
|
|
53
|
+
payload: {
|
|
54
|
+
groupName,
|
|
55
|
+
updateSelectedTasks,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
updateTaskGroupViewOnTaskGroupCreationSuccess(draft, action) {
|
|
61
|
+
const { newTaskGroupId } = action.payload;
|
|
62
|
+
draft.taskGroupsIds = [...draft.taskGroupsIds, newTaskGroupId];
|
|
63
|
+
draft.taskGroupCreationStatus.fetchState = 'Completed';
|
|
64
|
+
draft.taskGroupCreationStatus.error = undefined;
|
|
65
|
+
},
|
|
66
|
+
updateTaskGroupCreationFetchStatus(draft, action) {
|
|
67
|
+
draft.taskGroupCreationStatus.fetchState = action.payload.fetchState;
|
|
68
|
+
draft.taskGroupCreationStatus.error = action.payload.error;
|
|
69
|
+
},
|
|
70
|
+
deleteTaskGroup: {
|
|
71
|
+
reducer(draft) {
|
|
72
|
+
draft.taskGroupDeleteStatus = {
|
|
73
|
+
fetchState: 'In-Progress',
|
|
74
|
+
error: undefined,
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
prepare(taskGroupId) {
|
|
78
|
+
return {
|
|
79
|
+
payload: {
|
|
80
|
+
taskGroupId,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
updateTaskGroupViewOnTaskDeletionSuccess(draft, action) {
|
|
86
|
+
const { deletedTaskGroupId } = action.payload;
|
|
87
|
+
draft.taskGroupsIds = draft.taskGroupsIds.filter((groupId) => groupId !== deletedTaskGroupId);
|
|
88
|
+
draft.taskGroupDeleteStatus.fetchState = 'Completed';
|
|
89
|
+
draft.taskGroupDeleteStatus.error = undefined;
|
|
90
|
+
},
|
|
91
|
+
updateTaskGroupDeletionFetchStatus(draft, action) {
|
|
92
|
+
draft.taskGroupDeleteStatus.fetchState = action.payload.fetchState;
|
|
93
|
+
draft.taskGroupDeleteStatus.error = action.payload.error;
|
|
94
|
+
},
|
|
95
|
+
updateTaskGroupName: {
|
|
96
|
+
reducer(draft) {
|
|
97
|
+
draft.taskGroupUpdateStatus = {
|
|
98
|
+
fetchState: 'In-Progress',
|
|
99
|
+
error: undefined,
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
prepare(taskGroupId, taskGroupName) {
|
|
103
|
+
return {
|
|
104
|
+
payload: {
|
|
105
|
+
taskGroupId,
|
|
106
|
+
taskGroupName,
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
updateTaskGroupFetchStatus(draft, action) {
|
|
112
|
+
draft.taskGroupUpdateStatus = {
|
|
113
|
+
fetchState: action.payload.fetchState,
|
|
114
|
+
error: action.payload.error,
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
clearTaskGroupView(draft) {
|
|
118
|
+
Object.assign(draft, exports.initialState);
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
_a = taskGroupView.actions, exports.fetchAllTaskGroups = _a.fetchAllTaskGroups, exports.updateTaskGroupsOnSuccess = _a.updateTaskGroupsOnSuccess, exports.updateTaskGroupsFetchStatus = _a.updateTaskGroupsFetchStatus, exports.createNewTaskGroup = _a.createNewTaskGroup, exports.updateTaskGroupCreationFetchStatus = _a.updateTaskGroupCreationFetchStatus, exports.updateTaskGroupViewOnTaskGroupCreationSuccess = _a.updateTaskGroupViewOnTaskGroupCreationSuccess, exports.deleteTaskGroup = _a.deleteTaskGroup, exports.updateTaskGroupDeletionFetchStatus = _a.updateTaskGroupDeletionFetchStatus, exports.updateTaskGroupViewOnTaskDeletionSuccess = _a.updateTaskGroupViewOnTaskDeletionSuccess, exports.updateTaskGroupName = _a.updateTaskGroupName, exports.updateTaskGroupFetchStatus = _a.updateTaskGroupFetchStatus, exports.clearTaskGroupView = _a.clearTaskGroupView;
|
|
123
|
+
exports.default = taskGroupView.reducer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ID, FetchedState, FetchStateAndError } from '../../../commonStateTypes/common';
|
|
2
|
+
export interface TaskGroupViewState extends FetchedState {
|
|
3
|
+
taskGroupsIds: ID[];
|
|
4
|
+
taskGroupCreationStatus: FetchStateAndError;
|
|
5
|
+
taskGroupDeleteStatus: FetchStateAndError;
|
|
6
|
+
taskGroupUpdateStatus: FetchStateAndError;
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { bulkUpdateTaskList, updateTasksListOnBulkUpdateTasksSuccess, updateTasksListOnBulkUpdateTasksFailure } from './taskListReducer';
|
|
6
|
+
import { updateTasks } from '../../../entity/task/taskReducer';
|
|
7
|
+
export declare type ActionType = ReturnType<typeof bulkUpdateTaskList> | ReturnType<typeof updateTasks> | ReturnType<typeof updateTasksListOnBulkUpdateTasksFailure> | ReturnType<typeof updateTasksListOnBulkUpdateTasksSuccess>;
|
|
8
|
+
export declare const bulkUpdateTaskListEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.bulkUpdateTaskListEpic = void 0;
|
|
7
|
+
const rxjs_1 = require("rxjs");
|
|
8
|
+
const operators_1 = require("rxjs/operators");
|
|
9
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
10
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
11
|
+
const taskListReducer_1 = require("./taskListReducer");
|
|
12
|
+
const taskReducer_1 = require("../../../entity/task/taskReducer");
|
|
13
|
+
const formatZeniDateFY_1 = require("../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY");
|
|
14
|
+
const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.bulkUpdateTaskList.match), (0, operators_1.switchMap)((action) => {
|
|
15
|
+
const state = state$.value;
|
|
16
|
+
const { taskIds, updates } = action.payload;
|
|
17
|
+
const payload = {
|
|
18
|
+
tasks: getTasksListPayload(state, taskIds, updates),
|
|
19
|
+
};
|
|
20
|
+
return zeniAPI
|
|
21
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload)
|
|
22
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
23
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
24
|
+
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(response.data.tasks), (0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
25
|
+
taskIds,
|
|
26
|
+
groupId: updates.taskGroupIds != null &&
|
|
27
|
+
updates.taskGroupIds.length > 0
|
|
28
|
+
? updates.taskGroupIds[0]
|
|
29
|
+
: null,
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return (0, rxjs_1.of)((0, taskListReducer_1.updateTasksListOnBulkUpdateTasksFailure)({
|
|
34
|
+
error: response.status,
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
}), (0, operators_1.catchError)((error) => {
|
|
38
|
+
return (0, rxjs_1.of)((0, taskListReducer_1.updateTasksListOnBulkUpdateTasksFailure)({
|
|
39
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Bulk update task list REST API call errored out' +
|
|
40
|
+
JSON.stringify(error)),
|
|
41
|
+
}));
|
|
42
|
+
}));
|
|
43
|
+
}));
|
|
44
|
+
exports.bulkUpdateTaskListEpic = bulkUpdateTaskListEpic;
|
|
45
|
+
const getTasksListPayload = (state, taskIds, updates) => {
|
|
46
|
+
const { taskState } = state;
|
|
47
|
+
const tasksList = taskIds
|
|
48
|
+
.map((taskId) => {
|
|
49
|
+
const task = (0, get_1.default)(taskState.taskByID, taskId);
|
|
50
|
+
return Object.assign(Object.assign({}, task), updates);
|
|
51
|
+
})
|
|
52
|
+
.filter((task) => task != null);
|
|
53
|
+
const tasksPayload = tasksList.map((task) => toTaskPayload(state, task));
|
|
54
|
+
return tasksPayload;
|
|
55
|
+
};
|
|
56
|
+
const toTaskPayload = (state, task) => {
|
|
57
|
+
var _a;
|
|
58
|
+
const { tagState } = state;
|
|
59
|
+
const tags = task.tagIds
|
|
60
|
+
.map((tagId) => {
|
|
61
|
+
return (0, get_1.default)(tagState.tagByID, tagId);
|
|
62
|
+
})
|
|
63
|
+
.filter((tag) => tag != null);
|
|
64
|
+
const tagPayload = tags.map((tag) => {
|
|
65
|
+
return tag.tagId;
|
|
66
|
+
});
|
|
67
|
+
const taskPayload = {
|
|
68
|
+
task_id: task.id,
|
|
69
|
+
name: task.name,
|
|
70
|
+
assignees: task.assignees,
|
|
71
|
+
description: task.description,
|
|
72
|
+
due_date: task.dueDate != null ? task.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) : null,
|
|
73
|
+
priority: task.priority.code,
|
|
74
|
+
status: task.status.code,
|
|
75
|
+
tags: tagPayload,
|
|
76
|
+
type: task.type.code,
|
|
77
|
+
file_ids: task.fileIds,
|
|
78
|
+
recurring_end_date: task.recurringEndDate != null
|
|
79
|
+
? task.recurringEndDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)
|
|
80
|
+
: null,
|
|
81
|
+
recurring_frequency: (_a = task.recurringFrequency) !== null && _a !== void 0 ? _a : null,
|
|
82
|
+
recurring_start_date: task.recurringStartDate != null
|
|
83
|
+
? task.recurringStartDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)
|
|
84
|
+
: null,
|
|
85
|
+
task_group_ids: task.taskGroupIds,
|
|
86
|
+
};
|
|
87
|
+
return taskPayload;
|
|
88
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { dragNDropTasks, bulkUpdateTaskList, updateTasksListOnBulkUpdateTasksSuccess } from './taskListReducer';
|
|
4
|
+
import { RootState } from '../../../reducer';
|
|
5
|
+
export declare type ActionType = ReturnType<typeof dragNDropTasks> | ReturnType<typeof bulkUpdateTaskList> | ReturnType<typeof updateTasksListOnBulkUpdateTasksSuccess>;
|
|
6
|
+
export declare const dragNDropTasksEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dragNDropTasksEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const taskListReducer_1 = require("./taskListReducer");
|
|
7
|
+
const dragNDropTasksEpic = (actions$,
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
|
+
_state$) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.dragNDropTasks.match), (0, operators_1.mergeMap)((action) => {
|
|
10
|
+
const { taskIds, groupId } = action.payload;
|
|
11
|
+
const actions = [
|
|
12
|
+
(0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
13
|
+
taskIds,
|
|
14
|
+
groupId,
|
|
15
|
+
}),
|
|
16
|
+
(0, taskListReducer_1.bulkUpdateTaskList)(taskIds, { taskGroupIds: [groupId] }),
|
|
17
|
+
];
|
|
18
|
+
return (0, rxjs_1.from)(actions);
|
|
19
|
+
}));
|
|
20
|
+
exports.dragNDropTasksEpic = dragNDropTasksEpic;
|
|
@@ -4,5 +4,7 @@ import { fetchTaskListPage, fetchTaskList } from './taskListReducer';
|
|
|
4
4
|
import { RootState } from '../../../reducer';
|
|
5
5
|
import { fetchUserListByType } from '../../userListView/userListViewReducer';
|
|
6
6
|
import { fetchClassList } from '../../classList/classListReducer';
|
|
7
|
-
|
|
7
|
+
import { fetchTagList } from '../../tagView/tagViewReducer';
|
|
8
|
+
import { fetchAllTaskGroups } from '../taskGroupView/taskGroupViewReducer';
|
|
9
|
+
export declare type ActionType = ReturnType<typeof fetchTaskListPage> | ReturnType<typeof fetchTaskList> | ReturnType<typeof fetchUserListByType> | ReturnType<typeof fetchTagList> | ReturnType<typeof fetchAllTaskGroups> | ReturnType<typeof fetchClassList>;
|
|
8
10
|
export declare const fetchTaskListPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -6,6 +6,8 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const taskListReducer_1 = require("./taskListReducer");
|
|
7
7
|
const userListViewReducer_1 = require("../../userListView/userListViewReducer");
|
|
8
8
|
const classListReducer_1 = require("../../classList/classListReducer");
|
|
9
|
+
const tagViewReducer_1 = require("../../tagView/tagViewReducer");
|
|
10
|
+
const taskGroupViewReducer_1 = require("../taskGroupView/taskGroupViewReducer");
|
|
9
11
|
const fetchTaskListPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.fetchTaskListPage.match), (0, operators_1.mergeMap)((action) => {
|
|
10
12
|
const { cacheOverride } = action.payload;
|
|
11
13
|
const taskListPageActions = [];
|
|
@@ -14,6 +16,8 @@ const fetchTaskListPageEpic = (actions$, state$) => actions$.pipe((0, operators_
|
|
|
14
16
|
taskListPageActions.push((0, taskListReducer_1.fetchTaskList)());
|
|
15
17
|
taskListPageActions.push((0, classListReducer_1.fetchClassList)());
|
|
16
18
|
taskListPageActions.push((0, userListViewReducer_1.fetchUserListByType)('taskManagerCandidate', true));
|
|
19
|
+
taskListPageActions.push((0, tagViewReducer_1.fetchTagList)());
|
|
20
|
+
taskListPageActions.push((0, taskGroupViewReducer_1.fetchAllTaskGroups)());
|
|
17
21
|
}
|
|
18
22
|
else {
|
|
19
23
|
taskListPageActions.push((0, taskListReducer_1.fetchTaskList)());
|
|
@@ -26,6 +30,14 @@ const fetchTaskListPageEpic = (actions$, state$) => actions$.pipe((0, operators_
|
|
|
26
30
|
taskManageUsers.fetchState !== 'In-Progress') {
|
|
27
31
|
taskListPageActions.push((0, userListViewReducer_1.fetchUserListByType)('taskManagerCandidate', false));
|
|
28
32
|
}
|
|
33
|
+
if (state.tagViewState.hasValidState() === false &&
|
|
34
|
+
state.tagViewState.fetchState !== 'In-Progress') {
|
|
35
|
+
taskListPageActions.push((0, tagViewReducer_1.fetchTagList)());
|
|
36
|
+
}
|
|
37
|
+
if (state.taskGroupViewState.hasValidState() === false &&
|
|
38
|
+
state.taskGroupViewState.fetchState !== 'In-Progress') {
|
|
39
|
+
taskListPageActions.push((0, taskGroupViewReducer_1.fetchAllTaskGroups)());
|
|
40
|
+
}
|
|
29
41
|
}
|
|
30
42
|
return (0, rxjs_1.concat)((0, rxjs_1.from)(taskListPageActions));
|
|
31
43
|
}));
|
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
import { FetchedState, ID } from '../../../commonStateTypes/common';
|
|
1
|
+
import { FetchedState, FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
3
3
|
import { SpendManagementUIState } from '../../spendManagement/billPay/billList/billListState';
|
|
4
4
|
import { CategoryCombinationOperator, FilterCategoryType } from '../../spendManagement/spendManagementFilterHelpers';
|
|
5
|
+
export interface NewTaskGroupLocalData {
|
|
6
|
+
taskIds: ID[];
|
|
7
|
+
groupName: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TaskListLocalData {
|
|
10
|
+
newTaskGroupName: string;
|
|
11
|
+
selectedTaskIds: ID[];
|
|
12
|
+
existingTaskGroupNamesByGroupId: Record<ID, string>;
|
|
13
|
+
defaultTaskGroupId: ID | null;
|
|
14
|
+
}
|
|
5
15
|
export interface TaskListState extends FetchedState {
|
|
6
16
|
taskIds: ID[];
|
|
17
|
+
taskIdsByGroupsIds: Record<ID, ID[]>;
|
|
7
18
|
uiState: TaskListUIState;
|
|
8
19
|
searchText: string;
|
|
9
20
|
filters: TaskListFilters;
|
|
21
|
+
localData: TaskListLocalData;
|
|
22
|
+
updateTasksFetchState: FetchStateAndError;
|
|
10
23
|
}
|
|
11
24
|
export interface TaskListFilters {
|
|
12
25
|
categoryCombinationOperator: CategoryCombinationOperator;
|