@zeniai/client-epic-state 5.0.85-betaJK3 → 5.0.85-betaJK4
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/esm/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.js +13 -0
- package/lib/index.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.d.ts +2 -1
- package/lib/view/taskManager/taskDetailView/epics/fetchTaskDetailEpic.js +13 -0
- package/package.json +1 -1
|
@@ -4,13 +4,16 @@ import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
|
4
4
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
5
5
|
import { updateTags } from '../../../../entity/tag/tagReducer';
|
|
6
6
|
import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
7
|
+
import { getTaskById } from '../../../../entity/task/taskSelector';
|
|
7
8
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
8
9
|
import { fetchFileList } from '../../../fileView/fileViewReducer';
|
|
10
|
+
import { updateTaskListOnNewTaskCreationSuccess } from '../../taskListView/taskListReducer';
|
|
9
11
|
import { fetchTaskDetail, initializeTaskToLocalStore, removeTaskDetail, updateEditTaskFetchStatus, } from '../taskDetailReducer';
|
|
10
12
|
export const fetchTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchTaskDetail.match), mergeMap((action) => {
|
|
11
13
|
const { taskId, cacheOverride } = action.payload;
|
|
12
14
|
const taskActions = [];
|
|
13
15
|
const state = state$.value;
|
|
16
|
+
const isTaskListFetched = state.taskListState.fetchState === 'Completed';
|
|
14
17
|
const taskDetail = recordGet(state.taskDetailState.editTaskStateById, taskId, undefined);
|
|
15
18
|
if (cacheOverride === true) {
|
|
16
19
|
taskActions.push(removeTaskDetail(taskId));
|
|
@@ -32,6 +35,16 @@ export const fetchTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
32
35
|
updateTags(response.data.tasks.map((task) => task.tags).flat()),
|
|
33
36
|
initializeTaskToLocalStore(taskId),
|
|
34
37
|
];
|
|
38
|
+
if (isTaskListFetched === true) {
|
|
39
|
+
const taskGroupId = response.data.tasks[0].task_group_ids?.[0];
|
|
40
|
+
if (taskGroupId != null) {
|
|
41
|
+
fetchActions.push(updateTaskListOnNewTaskCreationSuccess({
|
|
42
|
+
taskGroupId,
|
|
43
|
+
task: response.data.tasks[0],
|
|
44
|
+
currentTaskState: getTaskById(state.taskState, taskId),
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
35
48
|
const fileIds = response.data.tasks[0].file_ids;
|
|
36
49
|
if (fileIds.length > 0) {
|
|
37
50
|
fetchActions.push(fetchFileList(fileIds));
|
package/lib/index.d.ts
CHANGED
|
@@ -125,6 +125,7 @@ import { SubscriptionSummary, SchemaKeys as SubscriptionSummarySchemaKeys } from
|
|
|
125
125
|
import { SubscriptionPaymentAccount } from './entity/subscriptionPaymentAccount/subscriptionPaymentAccountState';
|
|
126
126
|
import { Tag, TagState } from './entity/tag/tagState';
|
|
127
127
|
import { ALL_WEEK_DAYS, DayOfWeek, PriorityCodeType, Task, TaskCodeType, TaskPriority, TaskStatus, TaskStatusCodeType, TaskType, toDayOfWeek, toPriorityCodeType, toTaskStatusCodeType } from './entity/task/taskState';
|
|
128
|
+
import { TaskPayload } from './entity/task/taskPayload';
|
|
128
129
|
import { getTaskGroupById } from './entity/taskGroup/taskGroupSelector';
|
|
129
130
|
import { TaskGroupState } from './entity/taskGroup/taskGroupState';
|
|
130
131
|
import { TaskGroupTemplate } from './entity/taskGroupTemplate/taskGroupTemplateState';
|
|
@@ -878,7 +879,7 @@ export { fetchGlobalMerchantRecommendation, createGlobalMerchant, updateCreateGl
|
|
|
878
879
|
export { approveVendorGlobalReview, rejectVendorGlobalReview, fetchVendorGlobalReviewView, updateSelectedGlobalMerchant, updateVendorGlobalReviewViewUIState, getVendorGlobalReviewView, getTenantMerchantByMerchantId, toVendorGlobalReviewColumnSortKeyType, VendorGlobalReview, VendorGlobalReviewViewUIState, VendorGlobalReviewViewColumnSortKey, VendorGlobalReviewViewSelectorView, VendorGlobalReviewViewState, VendorGlobalReviewViewLocalData, updateVendorGlobalReviewViewLocalData, GlobalReviewPageCurrentSelectionByColumn, GlobalRecommendationFetchSource, };
|
|
879
880
|
export { fetchArAging, updateArAgingUIState, fetchArAgingDetail, updateArAgingDetailUIState, ArAgingReport, ArAgingDetail, NestedAgingBalancesByCustomer, getArAgingReport, getArAgingDetailForCustomer, updateArAgingNodeCollapseState, };
|
|
880
881
|
export { toRecurringBillFrequency, toRecurringBillFrequencyStrict, RecurringBillFrequency, RecurringBillDetail, RecurringBillConfig, RecurringBillStatus, RecurringBillPaymentStatus, };
|
|
881
|
-
export { Task, TaskListSelectorView, TaskWithUserDetails, TaskListViewSortKey, TaskListUIState, TaskDetailSelectorView, EditTaskLocalData, TaskStatusCodeType, PriorityCodeType, getTaskGroupById, TaskStatus, TaskPriority, TaskCodeType, getAllTasks, fetchTaskListPage, getTaskDetail, fetchTaskDetailPage, saveTaskUpdatesToLocalStore, saveTaskDetail, archiveTask, CannedResponse, CannedResponsesViewState, fetchCannedResponses, saveCannedResponse, deleteCannedResponse, getCannedResponsesView, updateTaskListSearchText, updateTaskListUIState, allTaskStatus, allTaskPriority, TaskListFilters, updateTaskFilters, TASK_LIST_FILTER_CATEGORIES, TASK_LIST_GROUP_BY_CATEGORIES, TaskListFilterCategoryField, deleteTask, discardTaskUpdatesInLocalStore, TaskFilterCategory, TaskType, TaskGroupWithTasksList, TaskListLocalData, bulkUpdateTaskList, createNewTaskGroup, initiateTaskListLocalData, deleteTaskGroup, updateTaskListLocalData, dragNDropTasks, updateTaskGroupName, TaskGroupState, TaskGroupKey, toTaskListGroupByKeyType, toTaskListGroupByKeyTypeStrict, getTaskUpdates, fetchAllTaskGroups, initialTaskDetail, getDueDateValueFromDueDateGroupId, toPriorityCodeType, toTaskStatusCodeType, DueDateGroupKey, toDueDateGroupKeyType, updateTaskFromListView, updateTaskListTab, removeTaskFromList, snoozeTask, unsnoozeTask, convertHHMMStrToMinutes, initialTaskDetailLocalData, TaskListTab, ALL_TASK_LIST_TABS, };
|
|
882
|
+
export { Task, TaskPayload, TaskListSelectorView, TaskWithUserDetails, TaskListViewSortKey, TaskListUIState, TaskDetailSelectorView, EditTaskLocalData, TaskStatusCodeType, PriorityCodeType, getTaskGroupById, TaskStatus, TaskPriority, TaskCodeType, getAllTasks, fetchTaskListPage, getTaskDetail, fetchTaskDetailPage, saveTaskUpdatesToLocalStore, saveTaskDetail, archiveTask, CannedResponse, CannedResponsesViewState, fetchCannedResponses, saveCannedResponse, deleteCannedResponse, getCannedResponsesView, updateTaskListSearchText, updateTaskListUIState, allTaskStatus, allTaskPriority, TaskListFilters, updateTaskFilters, TASK_LIST_FILTER_CATEGORIES, TASK_LIST_GROUP_BY_CATEGORIES, TaskListFilterCategoryField, deleteTask, discardTaskUpdatesInLocalStore, TaskFilterCategory, TaskType, TaskGroupWithTasksList, TaskListLocalData, bulkUpdateTaskList, createNewTaskGroup, initiateTaskListLocalData, deleteTaskGroup, updateTaskListLocalData, dragNDropTasks, updateTaskGroupName, TaskGroupState, TaskGroupKey, toTaskListGroupByKeyType, toTaskListGroupByKeyTypeStrict, getTaskUpdates, fetchAllTaskGroups, initialTaskDetail, getDueDateValueFromDueDateGroupId, toPriorityCodeType, toTaskStatusCodeType, DueDateGroupKey, toDueDateGroupKeyType, updateTaskFromListView, updateTaskListTab, removeTaskFromList, snoozeTask, unsnoozeTask, convertHHMMStrToMinutes, initialTaskDetailLocalData, TaskListTab, ALL_TASK_LIST_TABS, };
|
|
882
883
|
export { Tag, TagState, TagViewState, getAllTags, TagViewSelectorView, fetchTagList, createTag, deleteTag, };
|
|
883
884
|
export { CardPayment, CardPaymentViewState, SetupIntentData, CardPaymentSelectorView, getAllCardsAndBankPaymentMethods, createCardSetupIntent, confirmCardSetupIntent, addCardPaymentSource, fetchPaymentSources, resetCardPaymentErrorStatuses, clearCardPaymentView, AddCardPaymentSourceType, };
|
|
884
885
|
export { getAuditReportGroupViewSelectorView, getAuditRuleGroupViewSelectorView, getUserFromAllUsers, AuditReportGroupSelectorView, AuditReportGroupViewSelectorView, AuditRuleGroupViewSelectorView, fetchAuditRuleGroupView, fetchAuditReportGroupView, saveReasonForAuditRule, AuditRuleGroup, AuditRuleGroupReport, AuditReportRule, AuditRuleEntityType, AuditRuleEntityIdType, AuditRuleBypassReason, clearAuditReportGroupViewByCompanyId, };
|
|
@@ -6,6 +6,7 @@ import { updateTasks } from '../../../../entity/task/taskReducer';
|
|
|
6
6
|
import { RootState } from '../../../../reducer';
|
|
7
7
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
8
8
|
import { fetchFileList } from '../../../fileView/fileViewReducer';
|
|
9
|
+
import { updateTaskListOnNewTaskCreationSuccess } from '../../taskListView/taskListReducer';
|
|
9
10
|
import { fetchTaskDetail, initializeTaskToLocalStore, removeTaskDetail, updateEditTaskFetchStatus } from '../taskDetailReducer';
|
|
10
|
-
export type ActionType = ReturnType<typeof fetchTaskDetail> | ReturnType<typeof updateTags> | ReturnType<typeof updateEditTaskFetchStatus> | ReturnType<typeof removeTaskDetail> | ReturnType<typeof updateTasks> | ReturnType<typeof initializeTaskToLocalStore> | ReturnType<typeof fetchFileList> | ReturnType<typeof openSnackbar>;
|
|
11
|
+
export type ActionType = ReturnType<typeof fetchTaskDetail> | ReturnType<typeof updateTags> | ReturnType<typeof updateEditTaskFetchStatus> | ReturnType<typeof removeTaskDetail> | ReturnType<typeof updateTasks> | ReturnType<typeof initializeTaskToLocalStore> | ReturnType<typeof fetchFileList> | ReturnType<typeof openSnackbar> | ReturnType<typeof updateTaskListOnNewTaskCreationSuccess>;
|
|
11
12
|
export declare const fetchTaskDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -10,13 +10,16 @@ const operators_1 = require("rxjs/operators");
|
|
|
10
10
|
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
11
11
|
const tagReducer_1 = require("../../../../entity/tag/tagReducer");
|
|
12
12
|
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
13
|
+
const taskSelector_1 = require("../../../../entity/task/taskSelector");
|
|
13
14
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
14
15
|
const fileViewReducer_1 = require("../../../fileView/fileViewReducer");
|
|
16
|
+
const taskListReducer_1 = require("../../taskListView/taskListReducer");
|
|
15
17
|
const taskDetailReducer_1 = require("../taskDetailReducer");
|
|
16
18
|
const fetchTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskDetailReducer_1.fetchTaskDetail.match), (0, operators_1.mergeMap)((action) => {
|
|
17
19
|
const { taskId, cacheOverride } = action.payload;
|
|
18
20
|
const taskActions = [];
|
|
19
21
|
const state = state$.value;
|
|
22
|
+
const isTaskListFetched = state.taskListState.fetchState === 'Completed';
|
|
20
23
|
const taskDetail = (0, get_1.default)(state.taskDetailState.editTaskStateById, taskId, undefined);
|
|
21
24
|
if (cacheOverride === true) {
|
|
22
25
|
taskActions.push((0, taskDetailReducer_1.removeTaskDetail)(taskId));
|
|
@@ -38,6 +41,16 @@ const fetchTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
|
|
|
38
41
|
(0, tagReducer_1.updateTags)(response.data.tasks.map((task) => task.tags).flat()),
|
|
39
42
|
(0, taskDetailReducer_1.initializeTaskToLocalStore)(taskId),
|
|
40
43
|
];
|
|
44
|
+
if (isTaskListFetched === true) {
|
|
45
|
+
const taskGroupId = response.data.tasks[0].task_group_ids?.[0];
|
|
46
|
+
if (taskGroupId != null) {
|
|
47
|
+
fetchActions.push((0, taskListReducer_1.updateTaskListOnNewTaskCreationSuccess)({
|
|
48
|
+
taskGroupId,
|
|
49
|
+
task: response.data.tasks[0],
|
|
50
|
+
currentTaskState: (0, taskSelector_1.getTaskById)(state.taskState, taskId),
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
41
54
|
const fileIds = response.data.tasks[0].file_ids;
|
|
42
55
|
if (fileIds.length > 0) {
|
|
43
56
|
fetchActions.push((0, fileViewReducer_1.fetchFileList)(fileIds));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.85-
|
|
3
|
+
"version": "5.0.85-betaJK4",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|