@zeniai/client-epic-state 4.11.14 → 4.11.16

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.
Files changed (83) hide show
  1. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  2. package/lib/entity/snackbar/snackbarTypes.js +0 -4
  3. package/lib/entity/task/taskPayload.d.ts +2 -2
  4. package/lib/entity/task/taskPayload.js +0 -1
  5. package/lib/entity/task/taskState.d.ts +0 -1
  6. package/lib/entity/tenant/clearAllEpic.d.ts +2 -4
  7. package/lib/entity/tenant/clearAllEpic.js +0 -6
  8. package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
  9. package/lib/entity/transaction/stateTypes/attachment.d.ts +0 -6
  10. package/lib/entity/transaction/stateTypes/transactionType.d.ts +0 -3
  11. package/lib/entity/transaction/stateTypes/transactionType.js +3 -7
  12. package/lib/entity/vendor/vendorPayload.d.ts +0 -2
  13. package/lib/entity/vendor/vendorPayload.js +1 -5
  14. package/lib/entity/vendor/vendorState.d.ts +0 -2
  15. package/lib/epic.d.ts +1 -8
  16. package/lib/epic.js +1 -8
  17. package/lib/index.d.ts +9 -12
  18. package/lib/index.js +3 -13
  19. package/lib/reducer.d.ts +0 -6
  20. package/lib/reducer.js +0 -6
  21. package/lib/view/companyView/selector/companyManagementViewSelector.js +7 -13
  22. package/lib/view/companyView/selector/companyPortfolioViewSelector.js +6 -1
  23. package/lib/view/fileView/fileUploadHelpers.d.ts +0 -5
  24. package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
  25. package/lib/view/people/deletePersonEpic.d.ts +1 -1
  26. package/lib/view/people/invitePeopleEpic.d.ts +1 -1
  27. package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
  28. package/lib/view/people/resendInviteEpic.d.ts +1 -1
  29. package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +9 -26
  30. package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
  31. package/lib/view/subscriptionView/subscriptionViewSelector.js +1 -5
  32. package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
  33. package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
  34. package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.d.ts +1 -2
  35. package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +4 -11
  36. package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +1 -2
  37. package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +1 -2
  38. package/lib/view/taskManager/taskListView/fetchTaskListPageEpic.d.ts +1 -3
  39. package/lib/view/taskManager/taskListView/fetchTaskListPageEpic.js +0 -12
  40. package/lib/view/taskManager/taskListView/taskList.d.ts +1 -14
  41. package/lib/view/taskManager/taskListView/taskListReducer.d.ts +2 -31
  42. package/lib/view/taskManager/taskListView/taskListReducer.js +9 -136
  43. package/lib/view/taskManager/taskListView/taskListSelector.d.ts +2 -12
  44. package/lib/view/taskManager/taskListView/taskListSelector.js +23 -59
  45. package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +5 -22
  46. package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewViewEpic.js +0 -1
  47. package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorFirstReviewViewEpic.js +5 -11
  48. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.d.ts +0 -15
  49. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.d.ts +3 -13
  50. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +3 -45
  51. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.d.ts +0 -8
  52. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewSelector.js +2 -17
  53. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.d.ts +2 -6
  54. package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewState.js +1 -2
  55. package/package.json +1 -1
  56. package/lib/entity/taskGroup/taskGroupPayload.d.ts +0 -9
  57. package/lib/entity/taskGroup/taskGroupPayload.js +0 -14
  58. package/lib/entity/taskGroup/taskGroupReducer.d.ts +0 -6
  59. package/lib/entity/taskGroup/taskGroupReducer.js +0 -33
  60. package/lib/entity/taskGroup/taskGroupSelector.d.ts +0 -4
  61. package/lib/entity/taskGroup/taskGroupSelector.js +0 -18
  62. package/lib/entity/taskGroup/taskGroupState.d.ts +0 -12
  63. package/lib/entity/taskGroup/taskGroupState.js +0 -2
  64. package/lib/view/taskManager/taskGroupView/epics/createNewTaskGroupEpic.d.ts +0 -10
  65. package/lib/view/taskManager/taskGroupView/epics/createNewTaskGroupEpic.js +0 -57
  66. package/lib/view/taskManager/taskGroupView/epics/deleteTaskGroupEpic.d.ts +0 -10
  67. package/lib/view/taskManager/taskGroupView/epics/deleteTaskGroupEpic.js +0 -41
  68. package/lib/view/taskManager/taskGroupView/epics/fetchAllTaskGroupsEpic.d.ts +0 -8
  69. package/lib/view/taskManager/taskGroupView/epics/fetchAllTaskGroupsEpic.js +0 -33
  70. package/lib/view/taskManager/taskGroupView/epics/updateTaskGroupNameEpic.d.ts +0 -10
  71. package/lib/view/taskManager/taskGroupView/epics/updateTaskGroupNameEpic.js +0 -51
  72. package/lib/view/taskManager/taskGroupView/taskGroupViewPayload.d.ts +0 -6
  73. package/lib/view/taskManager/taskGroupView/taskGroupViewPayload.js +0 -2
  74. package/lib/view/taskManager/taskGroupView/taskGroupViewReducer.d.ts +0 -34
  75. package/lib/view/taskManager/taskGroupView/taskGroupViewReducer.js +0 -123
  76. package/lib/view/taskManager/taskGroupView/taskGroupViewState.d.ts +0 -7
  77. package/lib/view/taskManager/taskGroupView/taskGroupViewState.js +0 -2
  78. package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.d.ts +0 -8
  79. package/lib/view/taskManager/taskListView/bulkUpdateTaskListEpic.js +0 -88
  80. package/lib/view/taskManager/taskListView/dragNDropTasksEpic.d.ts +0 -6
  81. package/lib/view/taskManager/taskListView/dragNDropTasksEpic.js +0 -20
  82. package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewAttachmentsEpic.d.ts +0 -10
  83. package/lib/view/vendorReviewView/vendorFirstReviewView/epics/fetchVendorFirstReviewAttachmentsEpic.js +0 -37
@@ -1,51 +0,0 @@
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;
@@ -1,6 +0,0 @@
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>;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,34 +0,0 @@
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;
@@ -1,123 +0,0 @@
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;
@@ -1,7 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +0,0 @@
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>;
@@ -1,88 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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>;
@@ -1,20 +0,0 @@
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;
@@ -1,10 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { RootState } from '../../../../reducer';
4
- import { ZeniAPI } from '../../../../zeniAPI';
5
- import { fetchVendorFirstReviewAttachments, updateVendorFirstReviewViewTransactionAttachments, updateVendorFirstReviewViewTransactionAttachmentsFailure } from '../vendorFirstReviewViewReducer';
6
- export declare type ActionType = ReturnType<typeof fetchVendorFirstReviewAttachments> | ReturnType<typeof updateVendorFirstReviewViewTransactionAttachments> | ReturnType<typeof updateVendorFirstReviewViewTransactionAttachmentsFailure>;
7
- export declare const fetchVendorFirstReviewAttachmentsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
8
- export interface VendorFirstReviewAttachementQueryPayload {
9
- attachment_ids: string[];
10
- }
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchVendorFirstReviewAttachmentsEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../../responsePayload");
7
- const vendorFirstReviewViewReducer_1 = require("../vendorFirstReviewViewReducer");
8
- const fetchVendorFirstReviewAttachmentsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorFirstReviewViewReducer_1.fetchVendorFirstReviewAttachments.match), (0, operators_1.switchMap)((action) => {
9
- const { attachmentIds, vendorId } = action.payload;
10
- let apiUrl = `${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/vendors/${vendorId}/attachments`;
11
- const queryParam = {
12
- attachment_ids: attachmentIds,
13
- };
14
- apiUrl =
15
- apiUrl + `?query=${encodeURIComponent(JSON.stringify(queryParam))}`;
16
- return zeniAPI.getJSON(apiUrl).pipe((0, operators_1.switchMap)((response) => {
17
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
18
- const actions = [];
19
- actions.push((0, vendorFirstReviewViewReducer_1.updateVendorFirstReviewViewTransactionAttachments)({
20
- vendorId,
21
- transactionAttachments: response.data.transaction_attachments,
22
- }));
23
- return actions;
24
- }
25
- else {
26
- return (0, rxjs_1.of)((0, vendorFirstReviewViewReducer_1.updateVendorFirstReviewViewTransactionAttachmentsFailure)({
27
- status: response.status,
28
- }));
29
- }
30
- }), (0, operators_1.catchError)((error) => {
31
- return (0, rxjs_1.of)((0, vendorFirstReviewViewReducer_1.updateVendorFirstReviewViewTransactionAttachmentsFailure)({
32
- status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Vendor First Review View REST API call errored out' +
33
- JSON.stringify(error)),
34
- }));
35
- }));
36
- }));
37
- exports.fetchVendorFirstReviewAttachmentsEpic = fetchVendorFirstReviewAttachmentsEpic;