@zeniai/client-epic-state 5.0.2-betaRR9 → 5.0.3-beta0ND
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/coreEpics.js +2 -1
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.d.ts +44 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +55 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.d.ts +10 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +51 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.d.ts +48 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +66 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.d.ts +52 -0
- package/lib/entity/aiAccountantCustomer/aiAccountantCustomerState.js +37 -0
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +2 -2
- package/lib/entity/chargeCard/chargeCard.d.ts +1 -1
- package/lib/entity/depositAccountTransaction/depositAccountTransaction.d.ts +1 -1
- package/lib/entity/entityApprovalStatus/entityApprovalStatusState.d.ts +2 -2
- package/lib/entity/file/fileState.d.ts +4 -4
- package/lib/entity/file/fileState.js +0 -4
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +2 -2
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/entity/task/taskPayload.d.ts +0 -3
- package/lib/entity/task/taskPayload.js +0 -5
- package/lib/entity/task/taskState.d.ts +0 -3
- package/lib/entity/tenant/SessionManager.d.ts +38 -0
- package/lib/entity/tenant/SessionManager.js +171 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +3 -1
- package/lib/entity/tenant/clearAllEpic.js +4 -0
- package/lib/entity/tenant/epic/sessionHeartbeatEpic.d.ts +16 -0
- package/lib/entity/tenant/epic/sessionHeartbeatEpic.js +16 -0
- package/lib/entity/tenant/sessionTypes.d.ts +26 -0
- package/lib/entity/tenant/sessionTypes.js +12 -0
- package/lib/entity/tenant/tenantReducer.d.ts +5 -1
- package/lib/entity/tenant/tenantReducer.js +23 -2
- package/lib/entity/tenant/tenantState.d.ts +1 -0
- package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
- package/lib/entity/userRole/userRoleType.d.ts +2 -2
- package/lib/epic.d.ts +5 -3
- package/lib/epic.js +5 -3
- package/lib/esm/coreEpics.js +2 -1
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerPayload.js +49 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerReducer.js +47 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerSelector.js +62 -0
- package/lib/esm/entity/aiAccountantCustomer/aiAccountantCustomerState.js +31 -0
- package/lib/esm/entity/file/fileState.js +0 -4
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/esm/entity/task/taskPayload.js +0 -5
- package/lib/esm/entity/tenant/SessionManager.js +167 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +4 -0
- package/lib/esm/entity/tenant/epic/sessionHeartbeatEpic.js +12 -0
- package/lib/esm/entity/tenant/sessionTypes.js +9 -0
- package/lib/esm/entity/tenant/tenantReducer.js +21 -1
- package/lib/esm/epic.js +5 -3
- package/lib/esm/index.js +16 -6
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewPayload.js +2 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewReducer.js +149 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewSelector.js +72 -0
- package/lib/esm/view/aiAccountantView/aiAccountantViewState.js +11 -0
- package/lib/esm/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +46 -0
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +27 -0
- package/lib/esm/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +47 -0
- package/lib/esm/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +52 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +0 -3
- package/lib/esm/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +0 -5
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +0 -4
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +1 -49
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +2 -15
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +21 -56
- package/lib/esm/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +0 -1
- package/lib/esm/view/taskManager/taskListView/epics/fetchTaskListEpic.js +3 -13
- package/lib/esm/view/taskManager/taskListView/taskList.js +0 -7
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +12 -91
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +15 -56
- package/lib/index.d.ts +18 -6
- package/lib/index.js +63 -35
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/aiAccountantView/aiAccountantViewPayload.d.ts +31 -0
- package/lib/view/aiAccountantView/aiAccountantViewPayload.js +8 -0
- package/lib/view/aiAccountantView/aiAccountantViewReducer.d.ts +29 -0
- package/lib/view/aiAccountantView/aiAccountantViewReducer.js +153 -0
- package/lib/view/aiAccountantView/aiAccountantViewSelector.d.ts +14 -0
- package/lib/view/aiAccountantView/aiAccountantViewSelector.js +78 -0
- package/lib/view/aiAccountantView/aiAccountantViewState.d.ts +26 -0
- package/lib/view/aiAccountantView/aiAccountantViewState.js +13 -0
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.d.ts +33 -0
- package/lib/view/aiAccountantView/epics/cancelAiAccountantOnboardingEpic.js +50 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.d.ts +23 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantCustomersEpic.js +31 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.d.ts +33 -0
- package/lib/view/aiAccountantView/epics/fetchAiAccountantJobsEpic.js +51 -0
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.d.ts +28 -0
- package/lib/view/aiAccountantView/epics/triggerAiAccountantJobEpic.js +56 -0
- package/lib/view/companyView/types/cockpitTypes.d.ts +6 -5
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +1 -1
- package/lib/view/onboardingView/cockpitView/types/onboardingCockpitViewTypes.d.ts +1 -1
- package/lib/view/reviewCompanyView/reviewCompanyViewState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +4 -4
- 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/types/subscriptionTypes.d.ts +1 -1
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/archiveTaskEpic.js +0 -3
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.d.ts +1 -2
- package/lib/view/taskManager/taskDetailView/epics/deleteTaskEpic.js +0 -5
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +0 -1
- package/lib/view/taskManager/taskDetailView/taskDetail.js +0 -4
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +1 -10
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +2 -50
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +0 -5
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +2 -15
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +7 -6
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +22 -56
- package/lib/view/taskManager/taskListView/epics/dragNDropTasksEpic.js +0 -1
- package/lib/view/taskManager/taskListView/epics/fetchTaskListEpic.js +3 -13
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -14
- package/lib/view/taskManager/taskListView/taskList.js +1 -8
- package/lib/view/taskManager/taskListView/taskListPayload.d.ts +0 -3
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +2 -6
- package/lib/view/taskManager/taskListView/taskListReducer.js +13 -92
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +3 -9
- package/lib/view/taskManager/taskListView/taskListSelector.js +15 -56
- package/package.json +1 -1
- package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -65
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -56
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -69
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -60
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getTaskPayload = exports.bulkUpdateTaskListEpic = void 0;
|
|
6
|
+
exports.getTaskPayload = exports.getTasksListPayload = exports.bulkUpdateTaskListEpic = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const rxjs_1 = require("rxjs");
|
|
9
9
|
const operators_1 = require("rxjs/operators");
|
|
@@ -12,25 +12,20 @@ const formatZeniDateFY_1 = require("../../../../commonStateTypes/fiscalYearHelpe
|
|
|
12
12
|
const taskReducer_1 = require("../../../../entity/task/taskReducer");
|
|
13
13
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
14
14
|
const taskListReducer_1 = require("../taskListReducer");
|
|
15
|
-
const bulkUpdateTaskListEpic = (actions$,
|
|
15
|
+
const bulkUpdateTaskListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(taskListReducer_1.bulkUpdateTaskList.match), (0, operators_1.switchMap)((action) => {
|
|
16
|
+
const state = state$.value;
|
|
16
17
|
const { taskIds, updates, groupId } = action.payload;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
const payload = { task_ids: taskIds, updates: bulkUpdates };
|
|
18
|
+
const payload = {
|
|
19
|
+
tasks: (0, exports.getTasksListPayload)(state, taskIds, updates),
|
|
20
|
+
};
|
|
22
21
|
return zeniAPI
|
|
23
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks
|
|
22
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload)
|
|
24
23
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
25
24
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
26
|
-
const removeFromList = updates.isArchived != null ||
|
|
27
|
-
updates.isDeleted != null ||
|
|
28
|
-
'snoozedUntil' in updates;
|
|
29
25
|
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(response.data.tasks), (0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
30
26
|
taskIds,
|
|
31
27
|
groupId,
|
|
32
|
-
|
|
33
|
-
}), (0, taskListReducer_1.fetchTaskList)());
|
|
28
|
+
}));
|
|
34
29
|
}
|
|
35
30
|
else {
|
|
36
31
|
return (0, rxjs_1.of)((0, taskListReducer_1.updateTasksListOnBulkUpdateTasksFailure)({
|
|
@@ -45,47 +40,21 @@ const bulkUpdateTaskListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0,
|
|
|
45
40
|
}));
|
|
46
41
|
}));
|
|
47
42
|
exports.bulkUpdateTaskListEpic = bulkUpdateTaskListEpic;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
if (updates.groupAssignees != null) {
|
|
63
|
-
payload.group_assignees = updates.groupAssignees;
|
|
64
|
-
}
|
|
65
|
-
if (updates.dueDate != null) {
|
|
66
|
-
payload.due_date = updates.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT);
|
|
67
|
-
}
|
|
68
|
-
if (updates.tagIds != null) {
|
|
69
|
-
payload.tags = updates.tagIds;
|
|
70
|
-
}
|
|
71
|
-
if (updates.timeSpent != null) {
|
|
72
|
-
payload.time_spent = (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(updates.timeSpent.replace(/\D/g, ''));
|
|
73
|
-
}
|
|
74
|
-
if (updates.isArchived != null) {
|
|
75
|
-
payload.is_archived = updates.isArchived;
|
|
76
|
-
}
|
|
77
|
-
if (updates.isDeleted != null) {
|
|
78
|
-
payload.is_deleted = updates.isDeleted;
|
|
79
|
-
}
|
|
80
|
-
// Bulk snooze is not supported — only bulk unsnooze (clear all snooze fields)
|
|
81
|
-
if ('snoozedUntil' in updates) {
|
|
82
|
-
payload.snoozed_until = null;
|
|
83
|
-
payload.snoozed_by = null;
|
|
84
|
-
payload.snoozed_at = null;
|
|
85
|
-
payload.is_snooze_notification_sent = false;
|
|
86
|
-
}
|
|
87
|
-
return payload;
|
|
43
|
+
const getTasksListPayload = (state, taskIds, updates) => {
|
|
44
|
+
const { taskState } = state;
|
|
45
|
+
const tasksList = taskIds
|
|
46
|
+
.map((taskId) => {
|
|
47
|
+
const task = (0, get_1.default)(taskState.taskByID, taskId);
|
|
48
|
+
return {
|
|
49
|
+
...task,
|
|
50
|
+
...updates,
|
|
51
|
+
};
|
|
52
|
+
})
|
|
53
|
+
.filter((task) => task != null);
|
|
54
|
+
const tasksPayload = tasksList.map((task) => toTaskPayload(state, task));
|
|
55
|
+
return tasksPayload;
|
|
88
56
|
};
|
|
57
|
+
exports.getTasksListPayload = getTasksListPayload;
|
|
89
58
|
const getTaskPayload = (state, taskId, updates) => {
|
|
90
59
|
const { taskState } = state;
|
|
91
60
|
const taskData = (0, get_1.default)(taskState.taskByID, taskId);
|
|
@@ -111,9 +80,6 @@ const toTaskPayload = (state, task) => {
|
|
|
111
80
|
assignees: task.assignees,
|
|
112
81
|
description: task.description,
|
|
113
82
|
group_assignees: task.groupAssignees,
|
|
114
|
-
is_archived: task.isArchived,
|
|
115
|
-
is_deleted: task.isDeleted,
|
|
116
|
-
snoozed_until: task.snoozedUntil != null ? task.snoozedUntil.toISOString() : null,
|
|
117
83
|
due_date: task.dueDate != null ? task.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) : null,
|
|
118
84
|
priority: task.priority.code,
|
|
119
85
|
status: task.status.code,
|
|
@@ -14,7 +14,6 @@ const dragNDropTasksEpic = (actions$, state$) => actions$.pipe((0, operators_1.f
|
|
|
14
14
|
(0, taskListReducer_1.updateTasksListOnBulkUpdateTasksSuccess)({
|
|
15
15
|
taskIds,
|
|
16
16
|
groupId,
|
|
17
|
-
removeFromList: false,
|
|
18
17
|
}),
|
|
19
18
|
(0, taskListReducer_1.bulkUpdateTaskList)(taskIds, groupId, updates),
|
|
20
19
|
];
|
|
@@ -12,20 +12,10 @@ const fetchTaskListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, oper
|
|
|
12
12
|
.getJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks?query=${encodeURIComponent(`{"task_type": "all"}`)}`)
|
|
13
13
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
14
14
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...tasks,
|
|
18
|
-
...(deleted ?? []),
|
|
19
|
-
...(archived ?? []),
|
|
20
|
-
...(snoozed ?? []),
|
|
21
|
-
];
|
|
22
|
-
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(allTasks), (0, taskListReducer_1.updateTaskList)({
|
|
23
|
-
data: tasks,
|
|
24
|
-
deleted: deleted ?? [],
|
|
25
|
-
archived: archived ?? [],
|
|
26
|
-
snoozed: snoozed ?? [],
|
|
15
|
+
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(response.data.tasks), (0, taskListReducer_1.updateTaskList)({
|
|
16
|
+
data: response.data.tasks,
|
|
27
17
|
updateType: 'replace',
|
|
28
|
-
}), (0, tagReducer_1.updateTags)(
|
|
18
|
+
}), (0, tagReducer_1.updateTags)(response.data.tasks.map((task) => task.tags).flat()));
|
|
29
19
|
}
|
|
30
20
|
else {
|
|
31
21
|
return (0, rxjs_1.of)((0, taskListReducer_1.updateTaskListFetchStatus)({
|
|
@@ -3,17 +3,6 @@ import { PriorityCodeType, TaskStatusCodeType } from '../../../entity/task/taskS
|
|
|
3
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
4
|
import { SpendManagementUIState } from '../../spendManagement/billPay/billList/billListState';
|
|
5
5
|
import { CategoryCombinationOperator, FilterCategoryType } from '../../spendManagement/spendManagementFilterHelpers';
|
|
6
|
-
export declare const ALL_TASK_LIST_TABS: readonly ["live", "archived", "deleted", "snoozed"];
|
|
7
|
-
export type TaskListTab = (typeof ALL_TASK_LIST_TABS)[number];
|
|
8
|
-
export interface TaskListTabData {
|
|
9
|
-
taskIds: ID[];
|
|
10
|
-
taskIdsByAssignees: Record<ID, ID[]>;
|
|
11
|
-
taskIdsByDueDate: Record<DueDateGroupKey, ID[]>;
|
|
12
|
-
taskIdsByGroupsIds: Record<ID, ID[]>;
|
|
13
|
-
taskIdsByPriority: Record<PriorityCodeType, ID[]>;
|
|
14
|
-
taskIdsByStatus: Record<TaskStatusCodeType, ID[]>;
|
|
15
|
-
taskIdsByTags: Record<ID, ID[]>;
|
|
16
|
-
}
|
|
17
6
|
export interface TaskListLocalData {
|
|
18
7
|
defaultTaskGroupId: ID | null;
|
|
19
8
|
existingTaskGroupNamesByGroupId: Record<ID, string>;
|
|
@@ -24,8 +13,6 @@ export declare const DUE_DATE_GROUP_KEYS: readonly ["overdue", "today", "this_we
|
|
|
24
13
|
export declare const toDueDateGroupKeyType: (v: string) => "overdue" | "today" | "this_week" | "this_month" | "upcoming";
|
|
25
14
|
export declare type DueDateGroupKey = ReturnType<typeof toDueDateGroupKeyType>;
|
|
26
15
|
export interface TaskListState extends FetchedState {
|
|
27
|
-
byTab: Record<TaskListTab, TaskListTabData>;
|
|
28
|
-
currentTab: TaskListTab;
|
|
29
16
|
filters: TaskListFilters;
|
|
30
17
|
localData: TaskListLocalData;
|
|
31
18
|
taskIds: ID[];
|
|
@@ -58,7 +45,7 @@ export interface TaskListUIState extends SpendManagementUIState {
|
|
|
58
45
|
searchText: string;
|
|
59
46
|
sortKey: TaskListViewSortKey;
|
|
60
47
|
}
|
|
61
|
-
declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "dueDate" | "tag" | "priority" | "timeSpent" | "assignee" | "creationDate"
|
|
48
|
+
declare const toTaskListSortKeyType: (v: string) => "status" | "name" | "dueDate" | "tag" | "priority" | "timeSpent" | "assignee" | "creationDate";
|
|
62
49
|
export declare type TaskListViewSortKey = ReturnType<typeof toTaskListSortKeyType>;
|
|
63
50
|
export declare const TASK_LIST_FILTER_CATEGORIES: TaskListFilterCategoryOption[];
|
|
64
51
|
interface TaskListFilterCategoryOption {
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TASK_LIST_GROUP_BY_CATEGORIES = exports.TASK_LIST_FILTER_CATEGORIES = exports.toTaskListGroupByKeyTypeStrict = exports.toTaskListGroupByKeyType = exports.TASK_LIST_GROUP_BY_KEYS = exports.toDueDateGroupKeyType = exports.DUE_DATE_GROUP_KEYS =
|
|
3
|
+
exports.TASK_LIST_GROUP_BY_CATEGORIES = exports.TASK_LIST_FILTER_CATEGORIES = exports.toTaskListGroupByKeyTypeStrict = exports.toTaskListGroupByKeyType = exports.TASK_LIST_GROUP_BY_KEYS = exports.toDueDateGroupKeyType = exports.DUE_DATE_GROUP_KEYS = void 0;
|
|
4
4
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
5
|
-
exports.ALL_TASK_LIST_TABS = [
|
|
6
|
-
'live',
|
|
7
|
-
'archived',
|
|
8
|
-
'deleted',
|
|
9
|
-
'snoozed',
|
|
10
|
-
];
|
|
11
5
|
exports.DUE_DATE_GROUP_KEYS = [
|
|
12
6
|
'overdue',
|
|
13
7
|
'today',
|
|
@@ -38,7 +32,6 @@ const ALL_TASK_LIST_SORT_KEYS = [
|
|
|
38
32
|
'status',
|
|
39
33
|
'priority',
|
|
40
34
|
'timeSpent',
|
|
41
|
-
'visibility',
|
|
42
35
|
];
|
|
43
36
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
44
37
|
const toTaskListSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_TASK_LIST_SORT_KEYS);
|
|
@@ -2,9 +2,6 @@ import { TaskPayload } from '../../../entity/task/taskPayload';
|
|
|
2
2
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
3
3
|
interface FetchTaskListPayload {
|
|
4
4
|
tasks: TaskPayload[];
|
|
5
|
-
archived?: TaskPayload[];
|
|
6
|
-
deleted?: TaskPayload[];
|
|
7
|
-
snoozed?: TaskPayload[];
|
|
8
5
|
}
|
|
9
6
|
export type FetchTaskListResponse = ZeniAPIResponse<FetchTaskListPayload>;
|
|
10
7
|
export {};
|
|
@@ -12,10 +12,7 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
12
12
|
}, "taskList/fetchTaskListPage", never, never>, fetchTaskList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskList/fetchTaskList">, updateTaskList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
13
|
data: TaskPayload[];
|
|
14
14
|
updateType: UpdateType;
|
|
15
|
-
|
|
16
|
-
deleted?: TaskPayload[];
|
|
17
|
-
snoozed?: TaskPayload[];
|
|
18
|
-
}, "taskList/updateTaskList">, updateTaskListTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"deleted" | "live" | "archived" | "snoozed", "taskList/updateTaskListTab">, updateTaskListFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
|
+
}, "taskList/updateTaskList">, updateTaskListFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
19
16
|
fetchState: FetchState;
|
|
20
17
|
error?: ZeniAPIStatus;
|
|
21
18
|
}, "taskList/updateTaskListFetchStatus">, updateTaskListSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -32,7 +29,6 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
32
29
|
groupId: string;
|
|
33
30
|
}, "taskList/bulkUpdateTaskList", never, never>, updateTasksListOnBulkUpdateTasksSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
34
31
|
groupId: ID | null;
|
|
35
|
-
removeFromList: boolean;
|
|
36
32
|
taskIds: ID[];
|
|
37
33
|
}, "taskList/updateTasksListOnBulkUpdateTasksSuccess">, updateTasksListOnBulkUpdateTasksFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
38
34
|
error: ZeniAPIStatus;
|
|
@@ -59,6 +55,6 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
59
55
|
error: ZeniAPIStatus;
|
|
60
56
|
}, "taskList/updateTasksListOnUpdateTaskFailure">, updateTaskListOnCreateTaskFromTemplateSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
61
57
|
tasks: TaskPayload[];
|
|
62
|
-
}, "taskList/updateTaskListOnCreateTaskFromTemplateSuccess">,
|
|
58
|
+
}, "taskList/updateTaskListOnCreateTaskFromTemplateSuccess">, clearTaskList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskList/clearTaskList">;
|
|
63
59
|
declare const _default: import("redux").Reducer<TaskListState>;
|
|
64
60
|
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.
|
|
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");
|
|
@@ -33,23 +33,7 @@ const initialTaskIdsByDueDate = {
|
|
|
33
33
|
today: [],
|
|
34
34
|
upcoming: [],
|
|
35
35
|
};
|
|
36
|
-
const initialTabData = {
|
|
37
|
-
taskIds: [],
|
|
38
|
-
taskIdsByAssignees: {},
|
|
39
|
-
taskIdsByDueDate: { ...initialTaskIdsByDueDate },
|
|
40
|
-
taskIdsByGroupsIds: {},
|
|
41
|
-
taskIdsByPriority: { ...initialTaskIdsByPriority },
|
|
42
|
-
taskIdsByStatus: { ...initialTaskIdsByStatus },
|
|
43
|
-
taskIdsByTags: {},
|
|
44
|
-
};
|
|
45
36
|
exports.initialState = {
|
|
46
|
-
currentTab: 'live',
|
|
47
|
-
byTab: {
|
|
48
|
-
live: { ...initialTabData },
|
|
49
|
-
archived: { ...initialTabData },
|
|
50
|
-
deleted: { ...initialTabData },
|
|
51
|
-
snoozed: { ...initialTabData },
|
|
52
|
-
},
|
|
53
37
|
taskIds: [],
|
|
54
38
|
taskIdsByGroupsIds: {},
|
|
55
39
|
taskIdsByPriority: initialTaskIdsByPriority,
|
|
@@ -106,30 +90,17 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
106
90
|
draft.error = undefined;
|
|
107
91
|
},
|
|
108
92
|
updateTaskList(draft, action) {
|
|
109
|
-
const { data
|
|
93
|
+
const { data } = action.payload;
|
|
110
94
|
draft.fetchState = 'Completed';
|
|
111
95
|
draft.error = undefined;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
draft.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
draft.byTab.deleted = toTabData(getGroupedTaskIds(deleted));
|
|
121
|
-
}
|
|
122
|
-
if (snoozed != null) {
|
|
123
|
-
draft.byTab.snoozed = toTabData(getGroupedTaskIds(snoozed));
|
|
124
|
-
}
|
|
125
|
-
// Copy active tab data to top-level fields
|
|
126
|
-
const activeTabData = draft.byTab[draft.currentTab];
|
|
127
|
-
copyTabDataToTopLevel(draft, activeTabData);
|
|
128
|
-
},
|
|
129
|
-
updateTaskListTab(draft, action) {
|
|
130
|
-
draft.currentTab = action.payload;
|
|
131
|
-
const activeTabData = draft.byTab[action.payload];
|
|
132
|
-
copyTabDataToTopLevel(draft, activeTabData);
|
|
96
|
+
const { taskIds, taskIdsGroupedByPriority, taskIdsByGroupIds, taskIdsGroupedByStatus, taskIdsByAssignees, taskIdsByDueDate, taskIdsByTags, } = getGroupedTaskIds(data);
|
|
97
|
+
draft.taskIds = taskIds;
|
|
98
|
+
draft.taskIdsByGroupsIds = taskIdsByGroupIds;
|
|
99
|
+
draft.taskIdsByPriority = taskIdsGroupedByPriority;
|
|
100
|
+
draft.taskIdsByStatus = taskIdsGroupedByStatus;
|
|
101
|
+
draft.taskIdsByAssignees = taskIdsByAssignees;
|
|
102
|
+
draft.taskIdsByDueDate = taskIdsByDueDate;
|
|
103
|
+
draft.taskIdsByTags = taskIdsByTags;
|
|
133
104
|
},
|
|
134
105
|
initiateTaskListLocalData(draft, action) {
|
|
135
106
|
const { taskGroupById } = action.payload;
|
|
@@ -217,13 +188,10 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
217
188
|
},
|
|
218
189
|
},
|
|
219
190
|
updateTasksListOnBulkUpdateTasksSuccess(draft, action) {
|
|
220
|
-
const { taskIds, groupId
|
|
191
|
+
const { taskIds, groupId } = action.payload;
|
|
221
192
|
draft.updateTasksFetchState.fetchState = 'Completed';
|
|
222
193
|
draft.updateTasksFetchState.error = undefined;
|
|
223
|
-
if (
|
|
224
|
-
removeTaskIds(draft, taskIds);
|
|
225
|
-
}
|
|
226
|
-
else if (groupId != null) {
|
|
194
|
+
if (groupId != null) {
|
|
227
195
|
const { groupByKey } = draft.uiState;
|
|
228
196
|
if (groupByKey === 'groupName') {
|
|
229
197
|
Object.keys(draft.taskIdsByGroupsIds).forEach((gId) => {
|
|
@@ -440,15 +408,12 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
440
408
|
draft.updateTasksFetchState.fetchState = 'Error';
|
|
441
409
|
draft.updateTasksFetchState.error = action.payload.error;
|
|
442
410
|
},
|
|
443
|
-
removeTaskFromList(draft, action) {
|
|
444
|
-
removeTaskIds(draft, [action.payload]);
|
|
445
|
-
},
|
|
446
411
|
clearTaskList(draft) {
|
|
447
412
|
Object.assign(draft, exports.initialState);
|
|
448
413
|
},
|
|
449
414
|
},
|
|
450
415
|
});
|
|
451
|
-
_a = taskList.actions, exports.fetchTaskListPage = _a.fetchTaskListPage, exports.fetchTaskList = _a.fetchTaskList, exports.updateTaskList = _a.updateTaskList, exports.
|
|
416
|
+
_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;
|
|
452
417
|
exports.default = taskList.reducer;
|
|
453
418
|
/**
|
|
454
419
|
* helpers
|
|
@@ -527,50 +492,6 @@ const getTagsGroupKey = (tags) => {
|
|
|
527
492
|
tagIds.sort();
|
|
528
493
|
return tagIds.join(',');
|
|
529
494
|
};
|
|
530
|
-
const toTabData = (grouped) => ({
|
|
531
|
-
taskIds: grouped.taskIds,
|
|
532
|
-
taskIdsByAssignees: grouped.taskIdsByAssignees,
|
|
533
|
-
taskIdsByDueDate: grouped.taskIdsByDueDate,
|
|
534
|
-
taskIdsByGroupsIds: grouped.taskIdsByGroupIds,
|
|
535
|
-
taskIdsByPriority: grouped.taskIdsGroupedByPriority,
|
|
536
|
-
taskIdsByStatus: grouped.taskIdsGroupedByStatus,
|
|
537
|
-
taskIdsByTags: grouped.taskIdsByTags,
|
|
538
|
-
});
|
|
539
|
-
const copyTabDataToTopLevel = (draft, tabData) => {
|
|
540
|
-
draft.taskIds = tabData.taskIds;
|
|
541
|
-
draft.taskIdsByGroupsIds = tabData.taskIdsByGroupsIds;
|
|
542
|
-
draft.taskIdsByPriority = tabData.taskIdsByPriority;
|
|
543
|
-
draft.taskIdsByStatus = tabData.taskIdsByStatus;
|
|
544
|
-
draft.taskIdsByAssignees = tabData.taskIdsByAssignees;
|
|
545
|
-
draft.taskIdsByDueDate = tabData.taskIdsByDueDate;
|
|
546
|
-
draft.taskIdsByTags = tabData.taskIdsByTags;
|
|
547
|
-
};
|
|
548
|
-
const removeIdsFromTabData = (tabData, taskIds) => {
|
|
549
|
-
const isRemoved = (id) => taskIds.includes(id);
|
|
550
|
-
tabData.taskIds = tabData.taskIds.filter((id) => !isRemoved(id));
|
|
551
|
-
Object.keys(tabData.taskIdsByGroupsIds).forEach((gId) => {
|
|
552
|
-
tabData.taskIdsByGroupsIds[gId] = tabData.taskIdsByGroupsIds[gId].filter((id) => !isRemoved(id));
|
|
553
|
-
});
|
|
554
|
-
Object.keys(tabData.taskIdsByPriority).forEach((key) => {
|
|
555
|
-
tabData.taskIdsByPriority[key] = tabData.taskIdsByPriority[key].filter((id) => !isRemoved(id));
|
|
556
|
-
});
|
|
557
|
-
Object.keys(tabData.taskIdsByStatus).forEach((key) => {
|
|
558
|
-
tabData.taskIdsByStatus[key] = tabData.taskIdsByStatus[key].filter((id) => !isRemoved(id));
|
|
559
|
-
});
|
|
560
|
-
Object.keys(tabData.taskIdsByDueDate).forEach((key) => {
|
|
561
|
-
tabData.taskIdsByDueDate[key] = tabData.taskIdsByDueDate[key].filter((id) => !isRemoved(id));
|
|
562
|
-
});
|
|
563
|
-
Object.keys(tabData.taskIdsByAssignees).forEach((key) => {
|
|
564
|
-
tabData.taskIdsByAssignees[key] = tabData.taskIdsByAssignees[key].filter((id) => !isRemoved(id));
|
|
565
|
-
});
|
|
566
|
-
Object.keys(tabData.taskIdsByTags).forEach((key) => {
|
|
567
|
-
tabData.taskIdsByTags[key] = tabData.taskIdsByTags[key].filter((id) => !isRemoved(id));
|
|
568
|
-
});
|
|
569
|
-
};
|
|
570
|
-
const removeTaskIds = (draft, taskIds) => {
|
|
571
|
-
removeIdsFromTabData(draft, taskIds);
|
|
572
|
-
removeIdsFromTabData(draft.byTab[draft.currentTab], taskIds);
|
|
573
|
-
};
|
|
574
495
|
const getGroupedTaskIds = (tasks) => {
|
|
575
496
|
const taskIds = [];
|
|
576
497
|
const taskIdsByGroupIds = {};
|
|
@@ -5,16 +5,14 @@ import { TagState } from '../../../entity/tag/tagState';
|
|
|
5
5
|
import { Task, TaskState } from '../../../entity/task/taskState';
|
|
6
6
|
import { TaskGroupTemplate } from '../../../entity/taskGroupTemplate/taskGroupTemplateState';
|
|
7
7
|
import { UserState } from '../../../entity/user/userState';
|
|
8
|
-
import { UserGroupsState } from '../../../entity/userGroups/userGroupsState';
|
|
9
8
|
import { UserRoleState } from '../../../entity/userRole/userRoleState';
|
|
10
9
|
import { RootState } from '../../../reducer';
|
|
11
10
|
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
12
11
|
import { UserGroupListSelectorView } from '../../userGroupListView/userGroupListViewSelector';
|
|
13
12
|
import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
14
|
-
import { TaskListFilters, TaskListLocalData, TaskListState,
|
|
13
|
+
import { TaskListFilters, TaskListLocalData, TaskListState, TaskListUIState } from './taskList';
|
|
15
14
|
export interface TaskWithUserDetails extends Task {
|
|
16
15
|
assigneeUsers: UserAndRole[];
|
|
17
|
-
firstAssigneeSortName: string;
|
|
18
16
|
}
|
|
19
17
|
export interface TaskGroupWithTasksList {
|
|
20
18
|
groupName: string;
|
|
@@ -23,10 +21,8 @@ export interface TaskGroupWithTasksList {
|
|
|
23
21
|
tasks: TaskWithUserDetails[];
|
|
24
22
|
}
|
|
25
23
|
export interface TaskListSelectorView extends SelectorView {
|
|
26
|
-
currentTab: TaskListTab;
|
|
27
24
|
filters: TaskListFilters;
|
|
28
25
|
localData: TaskListLocalData;
|
|
29
|
-
tabCounts: Record<TaskListTab, number>;
|
|
30
26
|
taskCreationFromTemplateStatus: FetchStateAndError;
|
|
31
27
|
taskGroupCreationStatus: FetchStateAndError;
|
|
32
28
|
taskGroupDeleteStatus: FetchStateAndError;
|
|
@@ -38,12 +34,11 @@ export interface TaskListSelectorView extends SelectorView {
|
|
|
38
34
|
userGroupList: UserGroupListSelectorView;
|
|
39
35
|
userList: UserListSelectorView;
|
|
40
36
|
}
|
|
41
|
-
export declare const getTaskListGroupedByAssignees: ({ taskListState, taskState, userState, userRoleState, addressState, tagState,
|
|
37
|
+
export declare const getTaskListGroupedByAssignees: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }: {
|
|
42
38
|
addressState: AddressState;
|
|
43
39
|
tagState: TagState;
|
|
44
40
|
taskListState: TaskListState;
|
|
45
41
|
taskState: TaskState;
|
|
46
|
-
userGroupsState: UserGroupsState;
|
|
47
42
|
userRoleState: UserRoleState;
|
|
48
43
|
userState: UserState;
|
|
49
44
|
}) => {
|
|
@@ -52,12 +47,11 @@ export declare const getTaskListGroupedByAssignees: ({ taskListState, taskState,
|
|
|
52
47
|
isDefault: boolean;
|
|
53
48
|
tasks: TaskWithUserDetails[];
|
|
54
49
|
}[];
|
|
55
|
-
export declare const getTaskListGroupedByPriority: ({ taskListState, taskState, userState, userRoleState, addressState, tagState,
|
|
50
|
+
export declare const getTaskListGroupedByPriority: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }: {
|
|
56
51
|
addressState: AddressState;
|
|
57
52
|
tagState: TagState;
|
|
58
53
|
taskListState: TaskListState;
|
|
59
54
|
taskState: TaskState;
|
|
60
|
-
userGroupsState: UserGroupsState;
|
|
61
55
|
userRoleState: UserRoleState;
|
|
62
56
|
userState: UserState;
|
|
63
57
|
}) => {
|