@zeniai/client-epic-state 5.0.42 → 5.0.43-betaRD1
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/recommendationBase.d.ts +1 -1
- package/lib/entity/chargeCardRepayment/chargeCardRepayment.d.ts +1 -1
- package/lib/entity/creditAgent/creditAgentPayload.d.ts +41 -0
- package/lib/entity/creditAgent/creditAgentPayload.js +40 -0
- package/lib/entity/creditAgent/creditAgentReducer.d.ts +9 -0
- package/lib/entity/creditAgent/creditAgentReducer.js +37 -0
- package/lib/entity/creditAgent/creditAgentSelector.d.ts +3 -0
- package/lib/entity/creditAgent/creditAgentSelector.js +10 -0
- package/lib/entity/creditAgent/creditAgentState.d.ts +39 -0
- package/lib/entity/creditAgent/creditAgentState.js +17 -0
- package/lib/entity/project/projectPayload.d.ts +7 -0
- package/lib/entity/project/projectPayload.js +15 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/entity/task/taskPayload.d.ts +1 -0
- package/lib/entity/task/taskPayload.js +5 -0
- package/lib/entity/task/taskState.d.ts +5 -0
- package/lib/entity/task/taskState.js +6 -1
- package/lib/entity/tenant/clearAllEpic.d.ts +6 -3
- package/lib/entity/tenant/clearAllEpic.js +8 -2
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.d.ts +2 -0
- package/lib/entity/transaction/payloadTypes/transactionLinePayload.js +9 -0
- package/lib/entity/transaction/stateTypes/transactionLine.d.ts +2 -0
- package/lib/epic.d.ts +8 -1
- package/lib/epic.js +8 -1
- package/lib/esm/entity/creditAgent/creditAgentPayload.js +36 -0
- package/lib/esm/entity/creditAgent/creditAgentReducer.js +33 -0
- package/lib/esm/entity/creditAgent/creditAgentSelector.js +6 -0
- package/lib/esm/entity/creditAgent/creditAgentState.js +13 -0
- package/lib/esm/entity/project/projectPayload.js +12 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/esm/entity/task/taskPayload.js +6 -1
- package/lib/esm/entity/task/taskState.js +3 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +8 -2
- package/lib/esm/entity/transaction/payloadTypes/transactionLinePayload.js +9 -0
- package/lib/esm/epic.js +8 -1
- package/lib/esm/index.js +18 -10
- package/lib/esm/reducer.js +12 -3
- package/lib/esm/view/common/recurringViewHelper.js +17 -0
- package/lib/esm/view/creditAgentView/buildCreditReportCsv.js +44 -0
- package/lib/esm/view/creditAgentView/creditAgentViewPayload.js +2 -0
- package/lib/esm/view/creditAgentView/creditAgentViewReducer.js +183 -0
- package/lib/esm/view/creditAgentView/creditAgentViewSelector.js +85 -0
- package/lib/esm/view/creditAgentView/creditAgentViewState.js +20 -0
- package/lib/esm/view/creditAgentView/epics/fetchCardProfilesEpic.js +20 -0
- package/lib/esm/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +13 -0
- package/lib/esm/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +19 -0
- package/lib/esm/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +58 -0
- package/lib/esm/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +39 -0
- package/lib/esm/view/creditAgentView/epics/updateCardProfileEpic.js +62 -0
- package/lib/esm/view/projectList/fetchProjectListEpic.js +38 -0
- package/lib/esm/view/projectList/projectListPayload.js +1 -0
- package/lib/esm/view/projectList/projectListReducer.js +39 -0
- package/lib/esm/view/projectList/projectListSelector.js +9 -0
- package/lib/esm/view/projectList/projectListState.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +2 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +5 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetail.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +5 -0
- package/lib/esm/view/transactionDetail/epics/saveTransactionHelper.js +1 -0
- package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +6 -0
- package/lib/esm/view/transactionDetail/epics/updateTransactionDetailEpic.js +3 -0
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +14 -2
- package/lib/index.d.ts +24 -14
- package/lib/index.js +81 -46
- package/lib/reducer.d.ts +12 -3
- package/lib/reducer.js +12 -3
- package/lib/view/common/recurringViewHelper.d.ts +3 -2
- package/lib/view/common/recurringViewHelper.js +18 -1
- package/lib/view/creditAgentView/buildCreditReportCsv.d.ts +17 -0
- package/lib/view/creditAgentView/buildCreditReportCsv.js +47 -0
- package/lib/view/creditAgentView/creditAgentViewPayload.d.ts +9 -0
- package/lib/view/creditAgentView/creditAgentViewPayload.js +7 -0
- package/lib/view/creditAgentView/creditAgentViewReducer.d.ts +41 -0
- package/lib/view/creditAgentView/creditAgentViewReducer.js +187 -0
- package/lib/view/creditAgentView/creditAgentViewSelector.d.ts +20 -0
- package/lib/view/creditAgentView/creditAgentViewSelector.js +93 -0
- package/lib/view/creditAgentView/creditAgentViewState.d.ts +34 -0
- package/lib/view/creditAgentView/creditAgentViewState.js +22 -0
- package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.d.ts +15 -0
- package/lib/view/creditAgentView/epics/fetchCardProfilesEpic.js +24 -0
- package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.d.ts +11 -0
- package/lib/view/creditAgentView/epics/fetchCreditAgentAccessEpic.js +17 -0
- package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.d.ts +15 -0
- package/lib/view/creditAgentView/epics/fetchCreditAgentMacroEpic.js +23 -0
- package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.d.ts +29 -0
- package/lib/view/creditAgentView/epics/saveCreditAgentMacroEpic.js +62 -0
- package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.d.ts +30 -0
- package/lib/view/creditAgentView/epics/scheduleTenantCreditScoreCronEpic.js +43 -0
- package/lib/view/creditAgentView/epics/updateCardProfileEpic.d.ts +37 -0
- package/lib/view/creditAgentView/epics/updateCardProfileEpic.js +66 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/projectList/fetchProjectListEpic.d.ts +8 -0
- package/lib/view/projectList/fetchProjectListEpic.js +42 -0
- package/lib/view/projectList/projectListPayload.d.ts +7 -0
- package/lib/view/projectList/projectListPayload.js +2 -0
- package/lib/view/projectList/projectListReducer.d.ts +9 -0
- package/lib/view/projectList/projectListReducer.js +43 -0
- package/lib/view/projectList/projectListSelector.d.ts +8 -0
- package/lib/view/projectList/projectListSelector.js +13 -0
- package/lib/view/projectList/projectListState.d.ts +4 -0
- package/lib/view/projectList/projectListState.js +2 -0
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +2 -0
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +5 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +3 -1
- package/lib/view/taskManager/taskDetailView/taskDetail.js +1 -0
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +1 -0
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +5 -0
- package/lib/view/transactionDetail/epics/saveTransactionHelper.js +1 -0
- package/lib/view/transactionDetail/epics/transactionDetailEpic.d.ts +2 -1
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +6 -0
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +3 -0
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +3 -0
- package/lib/view/transactionDetail/transactionDetailSelector.js +13 -1
- package/lib/view/transactionDetail/transactionDetailState.d.ts +2 -0
- package/lib/view/transactionDetail/transactionDetailTypes.d.ts +2 -0
- package/package.json +1 -1
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchProjectListEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const projectReducer_1 = require("../../entity/project/projectReducer");
|
|
7
|
+
const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
|
|
8
|
+
const responsePayload_1 = require("../../responsePayload");
|
|
9
|
+
const projectListReducer_1 = require("./projectListReducer");
|
|
10
|
+
const buildProjectListQuery = (isIncludeDeleted) => {
|
|
11
|
+
const query = {
|
|
12
|
+
is_deleted: isIncludeDeleted,
|
|
13
|
+
sort_by: 'project_name',
|
|
14
|
+
sort_order: 'asc',
|
|
15
|
+
is_full: true,
|
|
16
|
+
};
|
|
17
|
+
return `?query=${encodeURIComponent(JSON.stringify(query))}`;
|
|
18
|
+
};
|
|
19
|
+
const fetchProjectListEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(projectListReducer_1.fetchProjectList.match), (0, operators_1.withLatestFrom)(state$), (0, operators_1.switchMap)(([action, state]) => {
|
|
20
|
+
if (!(0, tenantSelector_1.getIsAccountingProjectsEnabled)(state)) {
|
|
21
|
+
return (0, rxjs_1.of)((0, projectListReducer_1.updateProjectList)({
|
|
22
|
+
status: (0, responsePayload_1.createZeniAPIStatus)('Success', ''),
|
|
23
|
+
data: { projects: [] },
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
const { isIncludeDeleted } = action.payload;
|
|
27
|
+
const queryParams = buildProjectListQuery(isIncludeDeleted);
|
|
28
|
+
return zeniAPI
|
|
29
|
+
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/projects${queryParams}`)
|
|
30
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
31
|
+
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
32
|
+
return (0, rxjs_1.of)((0, projectReducer_1.updateProjects)(response.data?.projects ?? []), (0, projectListReducer_1.updateProjectList)(response));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return (0, rxjs_1.of)((0, projectListReducer_1.updateProjectListFailure)(response.status));
|
|
36
|
+
}
|
|
37
|
+
}), (0, operators_1.catchError)((error) => {
|
|
38
|
+
return (0, rxjs_1.of)((0, projectListReducer_1.updateProjectListFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Projects REST API call errored out' +
|
|
39
|
+
JSON.stringify(error))));
|
|
40
|
+
}));
|
|
41
|
+
}));
|
|
42
|
+
exports.fetchProjectListEpic = fetchProjectListEpic;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProjectMetadataPayload } from '../../entity/project/projectPayload';
|
|
2
|
+
import { ZeniAPIResponse } from '../../responsePayload';
|
|
3
|
+
interface ProjectListPayloadData {
|
|
4
|
+
projects: ProjectMetadataPayload[];
|
|
5
|
+
}
|
|
6
|
+
export type ProjectListResponse = ZeniAPIResponse<ProjectListPayloadData>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
2
|
+
import { ProjectListResponse } from './projectListPayload';
|
|
3
|
+
import { ProjectListState } from './projectListState';
|
|
4
|
+
export declare const initialState: ProjectListState;
|
|
5
|
+
export declare const fetchProjectList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isIncludeDeleted?: boolean | undefined], {
|
|
6
|
+
isIncludeDeleted: boolean;
|
|
7
|
+
}, "projectList/fetchProjectList", never, never>, updateProjectList: import("@reduxjs/toolkit").ActionCreatorWithPayload<ProjectListResponse, "projectList/updateProjectList">, updateProjectListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "projectList/updateProjectListFailure">, clearProjectList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"projectList/clearProjectList">;
|
|
8
|
+
declare const _default: import("redux").Reducer<ProjectListState>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearProjectList = exports.updateProjectListFailure = exports.updateProjectList = exports.fetchProjectList = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.initialState = {
|
|
7
|
+
fetchState: 'Not-Started',
|
|
8
|
+
error: undefined,
|
|
9
|
+
projectIds: [],
|
|
10
|
+
hasValidState() {
|
|
11
|
+
return this.fetchState == 'Completed';
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
const projectList = (0, toolkit_1.createSlice)({
|
|
15
|
+
name: 'projectList',
|
|
16
|
+
initialState: exports.initialState,
|
|
17
|
+
reducers: {
|
|
18
|
+
fetchProjectList: {
|
|
19
|
+
reducer(draft) {
|
|
20
|
+
draft.fetchState = 'In-Progress';
|
|
21
|
+
draft.error = undefined;
|
|
22
|
+
},
|
|
23
|
+
prepare(isIncludeDeleted) {
|
|
24
|
+
return { payload: { isIncludeDeleted: isIncludeDeleted ?? false } };
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
updateProjectList(draft, action) {
|
|
28
|
+
draft.projectIds =
|
|
29
|
+
action.payload.data?.projects.map((project) => project.zeni_project_id) ?? [];
|
|
30
|
+
draft.fetchState = 'Completed';
|
|
31
|
+
draft.error = undefined;
|
|
32
|
+
},
|
|
33
|
+
updateProjectListFailure(draft, action) {
|
|
34
|
+
draft.fetchState = 'Error';
|
|
35
|
+
draft.error = action.payload;
|
|
36
|
+
},
|
|
37
|
+
clearProjectList(draft) {
|
|
38
|
+
Object.assign(draft, exports.initialState);
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
_a = projectList.actions, exports.fetchProjectList = _a.fetchProjectList, exports.updateProjectList = _a.updateProjectList, exports.updateProjectListFailure = _a.updateProjectListFailure, exports.clearProjectList = _a.clearProjectList;
|
|
43
|
+
exports.default = projectList.reducer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
|
+
import { ProjectState } from '../../entity/project/projectReducer';
|
|
3
|
+
import { Project } from '../../entity/project/projectState';
|
|
4
|
+
import { ProjectListState } from './projectListState';
|
|
5
|
+
export interface ProjectListSelectorView extends SelectorView {
|
|
6
|
+
projects: Project[];
|
|
7
|
+
}
|
|
8
|
+
export declare const getProjectList: (projectState: ProjectState, projectListState: ProjectListState) => ProjectListSelectorView;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProjectList = void 0;
|
|
4
|
+
const projectSelector_1 = require("../../entity/project/projectSelector");
|
|
5
|
+
const getProjectList = (projectState, projectListState) => {
|
|
6
|
+
return {
|
|
7
|
+
projects: (0, projectSelector_1.getProjectsByIds)(projectState, projectListState.projectIds),
|
|
8
|
+
fetchState: projectListState.fetchState,
|
|
9
|
+
error: projectListState.error,
|
|
10
|
+
version: 0,
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
exports.getProjectList = getProjectList;
|
|
@@ -18,12 +18,14 @@ const initializeTaskToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
18
18
|
description: task.description,
|
|
19
19
|
status: task.status.code,
|
|
20
20
|
assignee: task.assignees,
|
|
21
|
+
groupAssignees: task.groupAssignees,
|
|
21
22
|
dueDate: task.dueDate,
|
|
22
23
|
priority: task.priority.code,
|
|
23
24
|
tagIds: task.tagIds,
|
|
24
25
|
fileIds: task.fileIds,
|
|
25
26
|
type: task.type,
|
|
26
27
|
recurringFrequency: task.recurringFrequency,
|
|
28
|
+
recurringDaysOfWeek: task.recurringDaysOfWeek,
|
|
27
29
|
recurringEndDateLocalData: {
|
|
28
30
|
recurringDatePickerOptionsType: 'date', // by default, date would be selected
|
|
29
31
|
recurringEndDate: task.recurringEndDate,
|
|
@@ -95,9 +95,14 @@ const prepareTaskPayload = (state, taskId, taskGroupId) => {
|
|
|
95
95
|
recurring_start_date: localData.type.code === 'recurring'
|
|
96
96
|
? (localData.recurringStartDate?.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) ?? null)
|
|
97
97
|
: null,
|
|
98
|
+
recurring_days_of_week: localData.type.code === 'recurring' &&
|
|
99
|
+
localData.recurringFrequency === 'semi_weekly'
|
|
100
|
+
? (localData.recurringDaysOfWeek ?? [])
|
|
101
|
+
: [],
|
|
98
102
|
sync_token: syncToken,
|
|
99
103
|
task_group_ids: taskGroupId != null ? [taskGroupId] : [],
|
|
100
104
|
time_spent: (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(localData.timeSpent),
|
|
105
|
+
group_assignees: localData.groupAssignees,
|
|
101
106
|
...(taskId == null ? { is_private: localData.isPrivate ?? false } : {}),
|
|
102
107
|
};
|
|
103
108
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
2
|
-
import { PriorityCodeType, TaskStatusCodeType, TaskType } from '../../../entity/task/taskState';
|
|
2
|
+
import { DayOfWeek, PriorityCodeType, TaskStatusCodeType, TaskType } from '../../../entity/task/taskState';
|
|
3
3
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
4
4
|
import { RecurringDatePickerOptions, RecurringFrequencyType } from '../../common/recurringViewHelper';
|
|
5
5
|
import { CommonHistoryView } from '../../spendManagement/commonHistoryView/commonHistory';
|
|
@@ -21,6 +21,7 @@ export interface EditTaskLocalData {
|
|
|
21
21
|
assignee: ID[];
|
|
22
22
|
description: string;
|
|
23
23
|
fileIds: ID[];
|
|
24
|
+
groupAssignees: ID[];
|
|
24
25
|
name: string;
|
|
25
26
|
priority: PriorityCodeType;
|
|
26
27
|
recurringEndDateLocalData: {
|
|
@@ -34,6 +35,7 @@ export interface EditTaskLocalData {
|
|
|
34
35
|
type: TaskType;
|
|
35
36
|
dueDate?: ZeniDate;
|
|
36
37
|
isPrivate?: boolean;
|
|
38
|
+
recurringDaysOfWeek?: DayOfWeek[];
|
|
37
39
|
recurringFrequency?: RecurringFrequencyType;
|
|
38
40
|
recurringStartDate?: ZeniDate;
|
|
39
41
|
savedRecurringEndDate?: ZeniDate;
|
|
@@ -23,6 +23,7 @@ export interface TaskDetailSelectorView extends SelectorView {
|
|
|
23
23
|
isDeleted?: boolean;
|
|
24
24
|
recurringSourceTaskId?: ID;
|
|
25
25
|
snoozedUntil?: ZeniDate | null;
|
|
26
|
+
taskGroupId?: ID;
|
|
26
27
|
}
|
|
27
28
|
export declare const getTaskDetail: (state: RootState, taskId?: ID) => TaskDetailSelectorView;
|
|
28
29
|
export declare const allTaskStatus: TaskStatus[];
|
|
@@ -32,6 +32,7 @@ const getTaskDetail = (state, taskId) => {
|
|
|
32
32
|
let isDeleted = undefined;
|
|
33
33
|
let recurringSourceTaskId = undefined;
|
|
34
34
|
let snoozedUntil = undefined;
|
|
35
|
+
let taskGroupId = undefined;
|
|
35
36
|
if (taskId != null && sourceTaskDetail != null) {
|
|
36
37
|
const taskEntity = (0, taskSelector_1.getTaskById)(taskState, taskId);
|
|
37
38
|
const fileIdsInEntity = taskEntity?.fileIds ?? [];
|
|
@@ -41,6 +42,7 @@ const getTaskDetail = (state, taskId) => {
|
|
|
41
42
|
isDeleted = taskEntity.isDeleted;
|
|
42
43
|
recurringSourceTaskId = taskEntity.recurringSourceTaskId;
|
|
43
44
|
snoozedUntil = taskEntity.snoozedUntil;
|
|
45
|
+
taskGroupId = taskEntity.taskGroupIds[0];
|
|
44
46
|
}
|
|
45
47
|
if (fileIdsInEntity.length > 0) {
|
|
46
48
|
fetchStatus = (0, reduceFetchState_1.reduceFetchState)([
|
|
@@ -93,6 +95,7 @@ const getTaskDetail = (state, taskId) => {
|
|
|
93
95
|
recurringSourceTaskId,
|
|
94
96
|
showTaskDetailFormFooter,
|
|
95
97
|
snoozedUntil,
|
|
98
|
+
taskGroupId,
|
|
96
99
|
};
|
|
97
100
|
};
|
|
98
101
|
exports.getTaskDetail = getTaskDetail;
|
|
@@ -147,11 +150,13 @@ const showFormFooter = (taskDetailLocalData, taskDetailInStore) => {
|
|
|
147
150
|
taskDetailLocalData.status !== taskDetailInStore.status.code ||
|
|
148
151
|
!(0, isEqual_1.default)(taskDetailInStore.tagIds, taskDetailLocalData.tagIds) ||
|
|
149
152
|
!(0, isEqual_1.default)(taskDetailLocalData.assignee, taskDetailInStore?.assignees ?? []) ||
|
|
153
|
+
!(0, isEqual_1.default)(taskDetailLocalData.groupAssignees, taskDetailInStore?.groupAssignees ?? []) ||
|
|
150
154
|
!(0, isEqual_1.default)(taskDetailLocalData.fileIds, taskDetailInStore.fileIds ?? []) ||
|
|
151
155
|
!(0, isEqual_1.default)(taskDetailLocalData.dueDate, taskDetailInStore.dueDate) ||
|
|
152
156
|
!(0, isEqual_1.default)(taskDetailLocalData.type, taskDetailInStore.type) ||
|
|
153
157
|
!(0, isEqual_1.default)(taskDetailLocalData.savedRecurringEndDate, taskDetailInStore.recurringEndDate) ||
|
|
154
158
|
!(0, isEqual_1.default)(taskDetailLocalData.recurringFrequency, taskDetailInStore.recurringFrequency) ||
|
|
159
|
+
!(0, isEqual_1.default)(taskDetailLocalData.recurringDaysOfWeek, taskDetailInStore.recurringDaysOfWeek) ||
|
|
155
160
|
!(0, isEqual_1.default)(taskDetailLocalData.recurringStartDate, taskDetailInStore.recurringStartDate) ||
|
|
156
161
|
!(0, isEqual_1.default)(taskDetailLocalData.timeSpent, taskDetailInStore.timeSpent)) {
|
|
157
162
|
return true;
|
|
@@ -54,6 +54,7 @@ const toTransactionUpdatesFromTransactionDetailLocalData = (transactionDetailLoc
|
|
|
54
54
|
lineDescription: lineItem.lineDescription,
|
|
55
55
|
class: lineItem.class,
|
|
56
56
|
account: lineItem.account,
|
|
57
|
+
project: lineItem.project,
|
|
57
58
|
recommendation: (0, transactionHelper_1.convertCOTRecommendationsToRegular)(lineItem.recommendationsWithCOT),
|
|
58
59
|
};
|
|
59
60
|
if (line.type === 'journal_entry_transaction_line' ||
|
|
@@ -8,7 +8,8 @@ import { fetchAccountList } from '../../accountList/accountListReducer';
|
|
|
8
8
|
import { fetchClassList } from '../../classList/classListReducer';
|
|
9
9
|
import { updateTransactionVendorLocalData } from '../../commonVendorView/transactionVendorView/transactionVendorViewReducer';
|
|
10
10
|
import { fetchOwnerList } from '../../ownerList/ownerListReducer';
|
|
11
|
+
import { fetchProjectList } from '../../projectList/projectListReducer';
|
|
11
12
|
import { updateSortUiState } from '../../vendorList/vendorListReducer';
|
|
12
13
|
import { fetchTransactionDetail, initializeTransactionDetailLocalData, removeTransactionDetail, updateTransactionDetailFetchState } from '../transactionDetailReducer';
|
|
13
|
-
export type ActionType = ReturnType<typeof fetchTransactionDetail> | ReturnType<typeof updateTransaction> | ReturnType<typeof updateTransactionDetailFetchState> | ReturnType<typeof initializeTransactionDetailLocalData> | ReturnType<typeof removeTransaction> | ReturnType<typeof removeTransactionDetail> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof updateSortUiState> | ReturnType<typeof updateVendors> | ReturnType<typeof updateTransactionVendorLocalData> | ReturnType<typeof fetchOwnerList>;
|
|
14
|
+
export type ActionType = ReturnType<typeof fetchTransactionDetail> | ReturnType<typeof updateTransaction> | ReturnType<typeof updateTransactionDetailFetchState> | ReturnType<typeof initializeTransactionDetailLocalData> | ReturnType<typeof removeTransaction> | ReturnType<typeof removeTransactionDetail> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchProjectList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof updateSortUiState> | ReturnType<typeof updateVendors> | ReturnType<typeof updateTransactionVendorLocalData> | ReturnType<typeof fetchOwnerList>;
|
|
14
15
|
export declare const fetchTransactionDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -20,6 +20,7 @@ const classListReducer_1 = require("../../classList/classListReducer");
|
|
|
20
20
|
const transactionVendorLocalDataHelper_1 = require("../../commonVendorView/transactionVendorView/transactionVendorLocalDataHelper");
|
|
21
21
|
const transactionVendorViewReducer_1 = require("../../commonVendorView/transactionVendorView/transactionVendorViewReducer");
|
|
22
22
|
const ownerListReducer_1 = require("../../ownerList/ownerListReducer");
|
|
23
|
+
const projectListReducer_1 = require("../../projectList/projectListReducer");
|
|
23
24
|
const transactionDetailReducer_1 = require("../transactionDetailReducer");
|
|
24
25
|
const transactionDetailState_1 = require("../transactionDetailState");
|
|
25
26
|
const fetchTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionDetailReducer_1.fetchTransactionDetail.match), (0, operators_1.mergeMap)((action) => {
|
|
@@ -45,6 +46,11 @@ const fetchTransactionDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe(
|
|
|
45
46
|
classList.fetchState !== 'In-Progress') {
|
|
46
47
|
transactionActions.push((0, classListReducer_1.fetchClassList)());
|
|
47
48
|
}
|
|
49
|
+
const projectList = state$.value.projectListState;
|
|
50
|
+
if (projectList.hasValidState() === false &&
|
|
51
|
+
projectList.fetchState !== 'In-Progress') {
|
|
52
|
+
transactionActions.push((0, projectListReducer_1.fetchProjectList)());
|
|
53
|
+
}
|
|
48
54
|
transactionActions.push((0, transactionDetailReducer_1.updateTransactionDetailFetchState)(transactionId, 'In-Progress'));
|
|
49
55
|
const query = { transaction_type: transactionId.type };
|
|
50
56
|
const getTransactionDetail$ = zeniAPI
|
|
@@ -188,6 +188,9 @@ const toTransactionUpdatePayload = (updates, detail, cotTransactionTracking, ven
|
|
|
188
188
|
if (lineUpdates.account != null) {
|
|
189
189
|
lineTobeUpdated.account = lineUpdates.account;
|
|
190
190
|
}
|
|
191
|
+
if (lineUpdates.project != null) {
|
|
192
|
+
lineTobeUpdated.project = lineUpdates.project;
|
|
193
|
+
}
|
|
191
194
|
if (lineUpdates.customer != null) {
|
|
192
195
|
lineTobeUpdated.customer = lineUpdates.customer;
|
|
193
196
|
}
|
|
@@ -9,6 +9,7 @@ import { RootState } from '../../reducer';
|
|
|
9
9
|
import { ZeniDate } from '../../zeniDayJS';
|
|
10
10
|
import { AccountListSelectorView } from '../accountList/accountListSelector';
|
|
11
11
|
import { ClassListSelectorView } from '../classList/classListSelector';
|
|
12
|
+
import { ProjectListSelectorView } from '../projectList/projectListSelector';
|
|
12
13
|
import { TransactionDetailLocalData } from './transactionDetailTypes';
|
|
13
14
|
export interface TransactionDetailReport extends SelectorView {
|
|
14
15
|
accountList: AccountListSelectorView;
|
|
@@ -18,7 +19,9 @@ export interface TransactionDetailReport extends SelectorView {
|
|
|
18
19
|
classList: ClassListSelectorView;
|
|
19
20
|
deleteStatusByAttachmentName: Record<string, FetchStateAndError>;
|
|
20
21
|
isAccountingClassesEnabled: boolean;
|
|
22
|
+
isAccountingProjectsEnabled: boolean;
|
|
21
23
|
linkedTransactions: SupportedTransactionWithCOT[];
|
|
24
|
+
projectList: ProjectListSelectorView;
|
|
22
25
|
transactionDetailLocalData: TransactionDetailLocalData;
|
|
23
26
|
transactionDetailUpdateStatus: FetchStateAndError;
|
|
24
27
|
isUpdateNotAllowed?: boolean;
|
|
@@ -15,9 +15,10 @@ const vendorSelector_1 = require("../../entity/vendor/vendorSelector");
|
|
|
15
15
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
16
16
|
const accountListSelector_1 = require("../accountList/accountListSelector");
|
|
17
17
|
const classListSelector_1 = require("../classList/classListSelector");
|
|
18
|
+
const projectListSelector_1 = require("../projectList/projectListSelector");
|
|
18
19
|
const transactionDetailState_1 = require("./transactionDetailState");
|
|
19
20
|
const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = true) => {
|
|
20
|
-
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, } = state;
|
|
21
|
+
const { transactionDetailState, transactionState, vendorState, vendorListState, accountState, classState, classListState, accountListState, projectState, projectListState, } = state;
|
|
21
22
|
const detailKey = (0, transactionDetailState_1.getTransactionDetailKey)(transactionId);
|
|
22
23
|
const transactionDetail = (0, get_1.default)(transactionDetailState.transactionDetailById, detailKey);
|
|
23
24
|
let fetchState = {
|
|
@@ -63,6 +64,15 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
63
64
|
const classList = isAccountingClassesEnabled
|
|
64
65
|
? (0, classListSelector_1.getClassList)(classState, classListState)
|
|
65
66
|
: { classes: [], nestedClassHierarchy: [], fetchState: 'Completed', error: undefined, version: 0 };
|
|
67
|
+
const isAccountingProjectsEnabled = (0, tenantSelector_1.getIsAccountingProjectsEnabled)(state);
|
|
68
|
+
const projectList = isAccountingProjectsEnabled
|
|
69
|
+
? (0, projectListSelector_1.getProjectList)(projectState, projectListState)
|
|
70
|
+
: {
|
|
71
|
+
projects: [],
|
|
72
|
+
fetchState: 'Completed',
|
|
73
|
+
error: undefined,
|
|
74
|
+
version: 0,
|
|
75
|
+
};
|
|
66
76
|
const accountsHierarchyList = (0, accountListSelector_1.getNestedAccountListHierarchy)(accountListState, 'accountList');
|
|
67
77
|
const classHierarchyList = isAccountingClassesEnabled
|
|
68
78
|
? (0, classListSelector_1.getNestedClassListHierarchy)(classListState)
|
|
@@ -85,6 +95,8 @@ const getTransactionDetail = (state, transactionId, fetchLinkedTransactions = tr
|
|
|
85
95
|
accountsHierarchyList,
|
|
86
96
|
classList: classList,
|
|
87
97
|
isAccountingClassesEnabled,
|
|
98
|
+
isAccountingProjectsEnabled,
|
|
99
|
+
projectList,
|
|
88
100
|
isUpdateNotAllowed: transactionDetail?.isUpdateNotAllowed,
|
|
89
101
|
transactionDetailLocalData: transactionDetail?.transactionDetailLocalData ??
|
|
90
102
|
transactionDetailState_1.initialSupportedTransactionDetail.transactionDetailLocalData,
|
|
@@ -4,6 +4,7 @@ import { AccountBase } from '../../entity/account/accountState';
|
|
|
4
4
|
import { ClassBase } from '../../entity/class/classState';
|
|
5
5
|
import { CustomerBase } from '../../entity/customer/customerState';
|
|
6
6
|
import { EntityType } from '../../entity/genericEntity/entity';
|
|
7
|
+
import { Project } from '../../entity/project/projectState';
|
|
7
8
|
import { Transaction, TransactionID } from '../../entity/transaction/stateTypes/transaction';
|
|
8
9
|
import { VendorBase } from '../../entity/vendor/vendorState';
|
|
9
10
|
import { EntityRecommendationKey } from '../recommendation/recommendationState';
|
|
@@ -52,6 +53,7 @@ export interface TransactionLineUpdates {
|
|
|
52
53
|
class?: ClassBase;
|
|
53
54
|
customer?: CustomerBase;
|
|
54
55
|
lineDescription?: string;
|
|
56
|
+
project?: Project;
|
|
55
57
|
recommendation?: Recommendation[];
|
|
56
58
|
vendor?: VendorBase;
|
|
57
59
|
}
|
|
@@ -4,6 +4,7 @@ import { AccountBase, RecommendedAccountBase } from '../../entity/account/accoun
|
|
|
4
4
|
import { ClassBase, RecommendedClassBase } from '../../entity/class/classState';
|
|
5
5
|
import { CustomerBase } from '../../entity/customer/customerState';
|
|
6
6
|
import { Entity } from '../../entity/genericEntity/entity';
|
|
7
|
+
import { Project } from '../../entity/project/projectState';
|
|
7
8
|
import { TransactionID } from '../../entity/transaction/stateTypes/transaction';
|
|
8
9
|
import { BillableStatus, PlatformLineDetailType, ProductOrService, TransactionLineBase } from '../../entity/transaction/stateTypes/transactionLine';
|
|
9
10
|
import { TransactionCategory, TransactionType } from '../../entity/transaction/stateTypes/transactionType';
|
|
@@ -29,6 +30,7 @@ export interface TransactionDetailLineItemData extends TransactionLineBase {
|
|
|
29
30
|
linkedTransactions?: TransactionID[];
|
|
30
31
|
postingType?: TransactionCategory;
|
|
31
32
|
postingTypeName?: string;
|
|
33
|
+
project?: Project;
|
|
32
34
|
recommendationsWithCOT?: RecommendationWithCOT[];
|
|
33
35
|
recommendedAccount?: RecommendedAccountBase;
|
|
34
36
|
recommendedClass?: RecommendedClassBase;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.43-betaRD1",
|
|
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",
|