@zeniai/client-epic-state 5.0.36-betaRR05 → 5.0.37
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/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.d.ts +0 -1
- package/lib/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +1 -2
- package/lib/entity/file/fileState.d.ts +4 -4
- package/lib/entity/file/fileState.js +0 -4
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -4
- package/lib/entity/task/taskPayload.d.ts +0 -4
- package/lib/entity/task/taskPayload.js +0 -10
- package/lib/entity/task/taskState.d.ts +0 -8
- package/lib/entity/task/taskState.js +1 -6
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -5
- package/lib/entity/tenant/clearAllEpic.js +0 -6
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +1 -59
- package/lib/entity/tenant/tenantReducer.js +4 -139
- package/lib/entity/tenant/tenantState.d.ts +0 -7
- package/lib/entity/transaction/stateTypes/attachment.d.ts +2 -2
- package/lib/epic.d.ts +1 -9
- package/lib/epic.js +1 -12
- package/lib/esm/commonStateTypes/fiscalYearHelpers/formatZeniDateFY.js +0 -1
- package/lib/esm/entity/file/fileState.js +0 -4
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -4
- package/lib/esm/entity/task/taskPayload.js +1 -11
- package/lib/esm/entity/task/taskState.js +0 -3
- package/lib/esm/entity/tenant/clearAllEpic.js +0 -6
- package/lib/esm/entity/tenant/tenantReducer.js +2 -135
- package/lib/esm/epic.js +1 -12
- package/lib/esm/index.js +9 -18
- package/lib/esm/init.js +16 -71
- package/lib/esm/reducer.js +0 -9
- package/lib/esm/view/common/recurringViewHelper.js +0 -17
- 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/epics/initializeTaskToLocalStoreEpic.js +0 -3
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -6
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +0 -5
- package/lib/esm/view/taskManager/taskDetailView/taskDetailReducer.js +7 -60
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +0 -17
- 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 +4 -13
- package/lib/esm/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +2 -3
- package/lib/esm/view/taskManager/taskListView/taskList.js +0 -7
- package/lib/esm/view/taskManager/taskListView/taskListReducer.js +12 -106
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +39 -48
- package/lib/index.d.ts +9 -21
- package/lib/index.js +30 -70
- package/lib/init.d.ts +3 -5
- package/lib/init.js +16 -71
- package/lib/reducer.d.ts +0 -9
- package/lib/reducer.js +0 -9
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/common/recurringViewHelper.d.ts +2 -3
- package/lib/view/common/recurringViewHelper.js +1 -18
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.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/epics/initializeTaskToLocalStoreEpic.js +0 -3
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +0 -6
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +1 -5
- package/lib/view/taskManager/taskDetailView/taskDetail.js +0 -5
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +1 -10
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +8 -61
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +0 -6
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +0 -17
- 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 +4 -13
- package/lib/view/taskManager/taskListView/epics/updateTaskFromListViewEpic.js +2 -3
- 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 +6 -9
- package/lib/view/taskManager/taskListView/taskListReducer.js +13 -107
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +3 -9
- package/lib/view/taskManager/taskListView/taskListSelector.js +39 -48
- package/package.json +1 -1
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +0 -19
- package/lib/entity/tenant/epic/deleteConnectionEpic.js +0 -29
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +0 -19
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.js +0 -31
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +0 -19
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.js +0 -33
- package/lib/esm/entity/tenant/epic/deleteConnectionEpic.js +0 -25
- package/lib/esm/entity/tenant/epic/saveAPIKeyConnectionEpic.js +0 -27
- package/lib/esm/entity/tenant/epic/saveOAuthConnectionEpic.js +0 -29
- package/lib/esm/view/featureNotificationView/epics/fetchRegisteredInterestsEpic.js +0 -23
- package/lib/esm/view/featureNotificationView/epics/notifyMeForFeatureEpic.js +0 -25
- package/lib/esm/view/featureNotificationView/featureNotificationViewPayload.js +0 -11
- package/lib/esm/view/featureNotificationView/featureNotificationViewReducer.js +0 -106
- package/lib/esm/view/featureNotificationView/featureNotificationViewSelector.js +0 -4
- package/lib/esm/view/featureNotificationView/featureNotificationViewState.js +0 -1
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponses.js +0 -1
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesPayload.js +0 -12
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +0 -64
- package/lib/esm/view/taskManager/cannedResponsesView/cannedResponsesSelector.js +0 -3
- package/lib/esm/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +0 -17
- package/lib/esm/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +0 -21
- package/lib/esm/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +0 -29
- package/lib/esm/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -66
- package/lib/esm/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -57
- package/lib/esm/view/zeniOAuthView/epics/approveOAuthConsentEpic.js +0 -65
- package/lib/esm/view/zeniOAuthView/zeniOAuthParamsParser.js +0 -41
- package/lib/esm/view/zeniOAuthView/zeniOAuthReducer.js +0 -49
- package/lib/esm/view/zeniOAuthView/zeniOAuthSelector.js +0 -3
- package/lib/esm/view/zeniOAuthView/zeniOAuthState.js +0 -1
- package/lib/view/featureNotificationView/epics/fetchRegisteredInterestsEpic.d.ts +0 -16
- package/lib/view/featureNotificationView/epics/fetchRegisteredInterestsEpic.js +0 -27
- package/lib/view/featureNotificationView/epics/notifyMeForFeatureEpic.d.ts +0 -14
- package/lib/view/featureNotificationView/epics/notifyMeForFeatureEpic.js +0 -29
- package/lib/view/featureNotificationView/featureNotificationViewPayload.d.ts +0 -23
- package/lib/view/featureNotificationView/featureNotificationViewPayload.js +0 -15
- package/lib/view/featureNotificationView/featureNotificationViewReducer.d.ts +0 -19
- package/lib/view/featureNotificationView/featureNotificationViewReducer.js +0 -110
- package/lib/view/featureNotificationView/featureNotificationViewSelector.d.ts +0 -6
- package/lib/view/featureNotificationView/featureNotificationViewSelector.js +0 -11
- package/lib/view/featureNotificationView/featureNotificationViewState.d.ts +0 -26
- package/lib/view/featureNotificationView/featureNotificationViewState.js +0 -2
- package/lib/view/taskManager/cannedResponsesView/cannedResponses.d.ts +0 -19
- package/lib/view/taskManager/cannedResponsesView/cannedResponses.js +0 -2
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesPayload.d.ts +0 -21
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesPayload.js +0 -15
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.d.ts +0 -30
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesReducer.js +0 -68
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesSelector.d.ts +0 -3
- package/lib/view/taskManager/cannedResponsesView/cannedResponsesSelector.js +0 -6
- package/lib/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.d.ts +0 -7
- package/lib/view/taskManager/cannedResponsesView/epics/deleteCannedResponseEpic.js +0 -21
- package/lib/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.d.ts +0 -7
- package/lib/view/taskManager/cannedResponsesView/epics/fetchCannedResponsesEpic.js +0 -25
- package/lib/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.d.ts +0 -7
- package/lib/view/taskManager/cannedResponsesView/epics/saveCannedResponseEpic.js +0 -33
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/snoozeTaskEpic.js +0 -70
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.d.ts +0 -9
- package/lib/view/taskManager/taskDetailView/epics/unsnoozeTaskEpic.js +0 -61
- package/lib/view/zeniOAuthView/epics/approveOAuthConsentEpic.d.ts +0 -27
- package/lib/view/zeniOAuthView/epics/approveOAuthConsentEpic.js +0 -69
- package/lib/view/zeniOAuthView/zeniOAuthParamsParser.d.ts +0 -16
- package/lib/view/zeniOAuthView/zeniOAuthParamsParser.js +0 -44
- package/lib/view/zeniOAuthView/zeniOAuthReducer.d.ts +0 -29
- package/lib/view/zeniOAuthView/zeniOAuthReducer.js +0 -53
- package/lib/view/zeniOAuthView/zeniOAuthSelector.d.ts +0 -5
- package/lib/view/zeniOAuthView/zeniOAuthSelector.js +0 -9
- package/lib/view/zeniOAuthView/zeniOAuthState.d.ts +0 -4
- package/lib/view/zeniOAuthView/zeniOAuthState.js +0 -2
|
@@ -12,19 +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
|
-
|
|
18
|
-
|
|
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 ?? [],
|
|
27
|
-
}), (0, tagReducer_1.updateTags)(allTasks.map((task) => task.tags).flat()));
|
|
15
|
+
return (0, rxjs_1.of)((0, taskReducer_1.updateTasks)(response.data.tasks), (0, taskListReducer_1.updateTaskList)({
|
|
16
|
+
data: response.data.tasks,
|
|
17
|
+
updateType: 'replace',
|
|
18
|
+
}), (0, tagReducer_1.updateTags)(response.data.tasks.map((task) => task.tags).flat()));
|
|
28
19
|
}
|
|
29
20
|
else {
|
|
30
21
|
return (0, rxjs_1.of)((0, taskListReducer_1.updateTaskListFetchStatus)({
|
|
@@ -11,10 +11,9 @@ const updateTaskFromListViewEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
11
11
|
const state = state$.value;
|
|
12
12
|
const { task, updates } = action.payload;
|
|
13
13
|
const taskId = task.id;
|
|
14
|
-
|
|
15
|
-
const { snoozed_until: _snoozedUntil, ...taskData } = (0, bulkUpdateTaskListEpic_1.getTaskPayload)(state, taskId, updates);
|
|
14
|
+
const taskData = (0, bulkUpdateTaskListEpic_1.getTaskPayload)(state, taskId, updates);
|
|
16
15
|
return zeniAPI
|
|
17
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}`, taskData)
|
|
16
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}`, { ...taskData })
|
|
18
17
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
18
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
20
19
|
return (0, rxjs_1.from)([
|
|
@@ -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 {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
1
|
+
import { FetchState, ID, UpdateType } from '../../../commonStateTypes/common';
|
|
2
2
|
import { TaskPayload } from '../../../entity/task/taskPayload';
|
|
3
3
|
import { Task } from '../../../entity/task/taskState';
|
|
4
4
|
import { TaskGroupPayload } from '../../../entity/taskGroup/taskGroupPayload';
|
|
@@ -11,10 +11,8 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
11
11
|
isTaskTemplatesEnabled: boolean;
|
|
12
12
|
}, "taskList/fetchTaskListPage", never, never>, fetchTaskList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskList/fetchTaskList">, updateTaskList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
13
|
data: TaskPayload[];
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
snoozed?: TaskPayload[];
|
|
17
|
-
}, "taskList/updateTaskList">, updateTaskListTab: import("@reduxjs/toolkit").ActionCreatorWithPayload<"deleted" | "live" | "archived" | "snoozed", "taskList/updateTaskListTab">, updateTaskListFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
14
|
+
updateType: UpdateType;
|
|
15
|
+
}, "taskList/updateTaskList">, updateTaskListFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
16
|
fetchState: FetchState;
|
|
19
17
|
error?: ZeniAPIStatus;
|
|
20
18
|
}, "taskList/updateTaskListFetchStatus">, updateTaskListSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -25,13 +23,12 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
25
23
|
filters: TaskListFilters;
|
|
26
24
|
}, "taskList/updateTaskFilters">, updateTaskListOnNewGroupCreationSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
27
25
|
newTaskGroup: TaskGroupPayload;
|
|
28
|
-
}, "taskList/updateTaskListOnNewGroupCreationSuccess">, bulkUpdateTaskList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskIds: string[], groupId: string
|
|
26
|
+
}, "taskList/updateTaskListOnNewGroupCreationSuccess">, bulkUpdateTaskList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskIds: string[], groupId: string, updates: Partial<Task>], {
|
|
29
27
|
taskIds: string[];
|
|
30
28
|
updates: Partial<Task>;
|
|
31
|
-
groupId: string
|
|
29
|
+
groupId: string;
|
|
32
30
|
}, "taskList/bulkUpdateTaskList", never, never>, updateTasksListOnBulkUpdateTasksSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
33
31
|
groupId: ID | null;
|
|
34
|
-
removeFromList: boolean;
|
|
35
32
|
taskIds: ID[];
|
|
36
33
|
}, "taskList/updateTasksListOnBulkUpdateTasksSuccess">, updateTasksListOnBulkUpdateTasksFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
37
34
|
error: ZeniAPIStatus;
|
|
@@ -58,6 +55,6 @@ export declare const fetchTaskListPage: import("@reduxjs/toolkit").ActionCreator
|
|
|
58
55
|
error: ZeniAPIStatus;
|
|
59
56
|
}, "taskList/updateTasksListOnUpdateTaskFailure">, updateTaskListOnCreateTaskFromTemplateSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
60
57
|
tasks: TaskPayload[];
|
|
61
|
-
}, "taskList/updateTaskListOnCreateTaskFromTemplateSuccess">,
|
|
58
|
+
}, "taskList/updateTaskListOnCreateTaskFromTemplateSuccess">, clearTaskList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"taskList/clearTaskList">;
|
|
62
59
|
declare const _default: import("redux").Reducer<TaskListState>;
|
|
63
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) => {
|
|
@@ -315,7 +283,6 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
315
283
|
newTaskGroupName: '',
|
|
316
284
|
selectedTaskIds: [],
|
|
317
285
|
};
|
|
318
|
-
syncTopLevelToActiveTab(draft);
|
|
319
286
|
},
|
|
320
287
|
updateTasksListOnBulkUpdateTasksFailure(draft, action) {
|
|
321
288
|
draft.updateTasksFetchState.fetchState = 'Error';
|
|
@@ -335,7 +302,6 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
335
302
|
}
|
|
336
303
|
delete draft.taskIdsByGroupsIds[taskGroupId];
|
|
337
304
|
delete draft.localData.existingTaskGroupNamesByGroupId[taskGroupId];
|
|
338
|
-
syncTopLevelToActiveTab(draft);
|
|
339
305
|
},
|
|
340
306
|
updateTaskListOnNewTaskCreationSuccess(draft, action) {
|
|
341
307
|
const { task, taskGroupId, currentTaskState } = action.payload;
|
|
@@ -370,7 +336,6 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
370
336
|
doUpdateTaskList(draft, task, taskGroupId);
|
|
371
337
|
}
|
|
372
338
|
});
|
|
373
|
-
syncTopLevelToActiveTab(draft);
|
|
374
339
|
},
|
|
375
340
|
updateTaskListOnTaskGroupNameUpdate(draft, action) {
|
|
376
341
|
const { taskGroupName, taskGroupId } = action.payload;
|
|
@@ -434,7 +399,6 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
434
399
|
};
|
|
435
400
|
}
|
|
436
401
|
}
|
|
437
|
-
syncTopLevelToActiveTab(draft);
|
|
438
402
|
},
|
|
439
403
|
updateTasksListOnUpdateTaskSuccess(draft) {
|
|
440
404
|
draft.updateTasksFetchState.fetchState = 'Completed';
|
|
@@ -444,15 +408,12 @@ const taskList = (0, toolkit_1.createSlice)({
|
|
|
444
408
|
draft.updateTasksFetchState.fetchState = 'Error';
|
|
445
409
|
draft.updateTasksFetchState.error = action.payload.error;
|
|
446
410
|
},
|
|
447
|
-
removeTaskFromList(draft, action) {
|
|
448
|
-
removeTaskIds(draft, [action.payload]);
|
|
449
|
-
},
|
|
450
411
|
clearTaskList(draft) {
|
|
451
412
|
Object.assign(draft, exports.initialState);
|
|
452
413
|
},
|
|
453
414
|
},
|
|
454
415
|
});
|
|
455
|
-
_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;
|
|
456
417
|
exports.default = taskList.reducer;
|
|
457
418
|
/**
|
|
458
419
|
* helpers
|
|
@@ -531,61 +492,6 @@ const getTagsGroupKey = (tags) => {
|
|
|
531
492
|
tagIds.sort();
|
|
532
493
|
return tagIds.join(',');
|
|
533
494
|
};
|
|
534
|
-
const toTabData = (grouped) => ({
|
|
535
|
-
taskIds: grouped.taskIds,
|
|
536
|
-
taskIdsByAssignees: grouped.taskIdsByAssignees,
|
|
537
|
-
taskIdsByDueDate: grouped.taskIdsByDueDate,
|
|
538
|
-
taskIdsByGroupsIds: grouped.taskIdsByGroupIds,
|
|
539
|
-
taskIdsByPriority: grouped.taskIdsGroupedByPriority,
|
|
540
|
-
taskIdsByStatus: grouped.taskIdsGroupedByStatus,
|
|
541
|
-
taskIdsByTags: grouped.taskIdsByTags,
|
|
542
|
-
});
|
|
543
|
-
const syncTopLevelToActiveTab = (draft) => {
|
|
544
|
-
const tabData = draft.byTab[draft.currentTab];
|
|
545
|
-
tabData.taskIds = draft.taskIds;
|
|
546
|
-
tabData.taskIdsByGroupsIds = draft.taskIdsByGroupsIds;
|
|
547
|
-
tabData.taskIdsByPriority = draft.taskIdsByPriority;
|
|
548
|
-
tabData.taskIdsByStatus = draft.taskIdsByStatus;
|
|
549
|
-
tabData.taskIdsByAssignees = draft.taskIdsByAssignees;
|
|
550
|
-
tabData.taskIdsByDueDate = draft.taskIdsByDueDate;
|
|
551
|
-
tabData.taskIdsByTags = draft.taskIdsByTags;
|
|
552
|
-
};
|
|
553
|
-
const copyTabDataToTopLevel = (draft, tabData) => {
|
|
554
|
-
draft.taskIds = tabData.taskIds;
|
|
555
|
-
draft.taskIdsByGroupsIds = tabData.taskIdsByGroupsIds;
|
|
556
|
-
draft.taskIdsByPriority = tabData.taskIdsByPriority;
|
|
557
|
-
draft.taskIdsByStatus = tabData.taskIdsByStatus;
|
|
558
|
-
draft.taskIdsByAssignees = tabData.taskIdsByAssignees;
|
|
559
|
-
draft.taskIdsByDueDate = tabData.taskIdsByDueDate;
|
|
560
|
-
draft.taskIdsByTags = tabData.taskIdsByTags;
|
|
561
|
-
};
|
|
562
|
-
const removeIdsFromTabData = (tabData, taskIds) => {
|
|
563
|
-
const removedSet = new Set(taskIds);
|
|
564
|
-
const isRemoved = (id) => removedSet.has(id);
|
|
565
|
-
tabData.taskIds = tabData.taskIds.filter((id) => !isRemoved(id));
|
|
566
|
-
Object.keys(tabData.taskIdsByGroupsIds).forEach((gId) => {
|
|
567
|
-
tabData.taskIdsByGroupsIds[gId] = tabData.taskIdsByGroupsIds[gId].filter((id) => !isRemoved(id));
|
|
568
|
-
});
|
|
569
|
-
Object.keys(tabData.taskIdsByPriority).forEach((key) => {
|
|
570
|
-
tabData.taskIdsByPriority[key] = tabData.taskIdsByPriority[key].filter((id) => !isRemoved(id));
|
|
571
|
-
});
|
|
572
|
-
Object.keys(tabData.taskIdsByStatus).forEach((key) => {
|
|
573
|
-
tabData.taskIdsByStatus[key] = tabData.taskIdsByStatus[key].filter((id) => !isRemoved(id));
|
|
574
|
-
});
|
|
575
|
-
Object.keys(tabData.taskIdsByDueDate).forEach((key) => {
|
|
576
|
-
tabData.taskIdsByDueDate[key] = tabData.taskIdsByDueDate[key].filter((id) => !isRemoved(id));
|
|
577
|
-
});
|
|
578
|
-
Object.keys(tabData.taskIdsByAssignees).forEach((key) => {
|
|
579
|
-
tabData.taskIdsByAssignees[key] = tabData.taskIdsByAssignees[key].filter((id) => !isRemoved(id));
|
|
580
|
-
});
|
|
581
|
-
Object.keys(tabData.taskIdsByTags).forEach((key) => {
|
|
582
|
-
tabData.taskIdsByTags[key] = tabData.taskIdsByTags[key].filter((id) => !isRemoved(id));
|
|
583
|
-
});
|
|
584
|
-
};
|
|
585
|
-
const removeTaskIds = (draft, taskIds) => {
|
|
586
|
-
removeIdsFromTabData(draft, taskIds);
|
|
587
|
-
removeIdsFromTabData(draft.byTab[draft.currentTab], taskIds);
|
|
588
|
-
};
|
|
589
495
|
const getGroupedTaskIds = (tasks) => {
|
|
590
496
|
const taskIds = [];
|
|
591
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
|
}) => {
|