@zeniai/client-epic-state 4.19.100 → 4.20.0-beta0RR
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.
Potentially problematic release.
This version of @zeniai/client-epic-state might be problematic. Click here for more details.
- package/lib/commonStateTypes/coaBalance/coaBalanceType.d.ts +2 -0
- package/lib/commonStateTypes/coaBalance/coaBalanceType.js +6 -0
- package/lib/commonStateTypes/currencyHelper.d.ts +3 -0
- package/lib/commonStateTypes/currencyHelper.js +6 -1
- package/lib/commonStateTypes/reduceFetchState.d.ts +9 -0
- package/lib/commonStateTypes/reduceFetchState.js +26 -0
- package/lib/entity/account/accountPayload.d.ts +2 -0
- package/lib/entity/account/accountPayload.js +2 -0
- package/lib/entity/account/accountState.d.ts +2 -0
- package/lib/entity/customer/customerState.d.ts +0 -2
- package/lib/entity/customer/customerState.js +0 -5
- package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
- package/lib/entity/depositAccount/depositAccount.js +8 -1
- package/lib/entity/reimbursement/reimbursementPayload.d.ts +2 -0
- package/lib/entity/reimbursement/reimbursementPayload.js +7 -0
- package/lib/entity/reimbursement/reimbursementState.d.ts +2 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/task/taskPayload.d.ts +2 -0
- package/lib/entity/task/taskPayload.js +2 -0
- package/lib/entity/task/taskState.d.ts +2 -0
- package/lib/entity/userGroups/userGroupsPayload.d.ts +7 -0
- package/lib/entity/userGroups/userGroupsPayload.js +10 -0
- package/lib/entity/userGroups/userGroupsReducer.d.ts +8 -0
- package/lib/entity/userGroups/userGroupsReducer.js +29 -0
- package/lib/entity/userGroups/userGroupsSelector.d.ts +4 -0
- package/lib/entity/userGroups/userGroupsSelector.js +12 -0
- package/lib/entity/userGroups/userGroupsState.d.ts +9 -0
- package/lib/entity/userGroups/userGroupsState.js +2 -0
- package/lib/epic.d.ts +12 -1
- package/lib/epic.js +12 -1
- package/lib/esm/commonStateTypes/coaBalance/coaBalanceType.js +5 -0
- package/lib/esm/commonStateTypes/currencyHelper.js +5 -0
- package/lib/esm/commonStateTypes/reduceFetchState.js +25 -0
- package/lib/esm/entity/account/accountPayload.js +2 -0
- package/lib/esm/entity/customer/customerState.js +1 -4
- package/lib/esm/entity/depositAccount/depositAccount.js +8 -1
- package/lib/esm/entity/reimbursement/reimbursementPayload.js +7 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/entity/task/taskPayload.js +2 -0
- package/lib/esm/entity/userGroups/userGroupsPayload.js +7 -0
- package/lib/esm/entity/userGroups/userGroupsReducer.js +25 -0
- package/lib/esm/entity/userGroups/userGroupsSelector.js +8 -0
- package/lib/esm/entity/userGroups/userGroupsState.js +1 -0
- package/lib/esm/epic.js +12 -1
- package/lib/esm/index.js +18 -10
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/arAgingView/arAgingReport/arAgingReducer.js +1 -1
- package/lib/esm/view/arAgingView/arAgingReport/arAgingSelector.js +1 -1
- package/lib/esm/view/companyView/types/cockpitTypes.js +1 -0
- package/lib/esm/view/expenseAutomationView/bulkUploadTiming.js +10 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +29 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +49 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +40 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +47 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +61 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +33 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +56 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +77 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +79 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +24 -0
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +189 -1
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +433 -2
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +23 -1
- package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +244 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +44 -0
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/esm/view/financeStatement/financeStatementReducer.js +11 -8
- package/lib/esm/view/financeStatement/financeStatementSelector.js +24 -9
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +322 -0
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +9 -0
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +6 -1
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
- package/lib/esm/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
- package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +201 -0
- package/lib/esm/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +9 -7
- package/lib/esm/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
- package/lib/esm/view/taskManager/taskListView/taskList.js +1 -0
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +9 -3
- package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +2 -16
- package/lib/esm/view/userGroupListView/userGroupListViewReducer.js +65 -0
- package/lib/esm/view/userGroupListView/userGroupListViewSelector.js +16 -0
- package/lib/esm/view/userGroupListView/userGroupListViewState.js +1 -0
- package/lib/esm/view/userListView/fetchUserListByTypeEpic.js +11 -0
- package/lib/esm/zeniAPI.js +0 -2
- package/lib/index.d.ts +19 -12
- package/lib/index.js +81 -23
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +2 -2
- package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +5 -5
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
- package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
- package/lib/view/companyView/types/cockpitTypes.js +1 -0
- package/lib/view/expenseAutomationView/bulkUploadTiming.d.ts +10 -0
- package/lib/view/expenseAutomationView/bulkUploadTiming.js +13 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +18 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +33 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +53 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +44 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +51 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +65 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +8 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +37 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +9 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +61 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +14 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +81 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +25 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +85 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +28 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +118 -0
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +201 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +76 -3
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +434 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +24 -2
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +69 -1
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
- package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +243 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +142 -0
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +54 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/view/financeStatement/financeStatementReducer.js +11 -8
- package/lib/view/financeStatement/financeStatementSelector.d.ts +2 -0
- package/lib/view/financeStatement/financeStatementSelector.js +24 -9
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +13 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +326 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.d.ts +111 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +13 -0
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.d.ts +4 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +7 -2
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +2 -29
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +4 -0
- package/lib/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +7 -5
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.d.ts +6 -0
- package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +204 -0
- package/lib/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +8 -6
- package/lib/view/taskManager/taskDetailView/epics/initializeTaskToLocalStoreEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -0
- package/lib/view/taskManager/taskDetailView/taskDetail.d.ts +1 -0
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +1 -0
- package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +1 -0
- package/lib/view/taskManager/taskListView/taskList.d.ts +1 -1
- package/lib/view/taskManager/taskListView/taskList.js +1 -0
- package/lib/view/taskManager/taskListView/taskListSelector.d.ts +2 -0
- package/lib/view/taskManager/taskListView/taskListSelector.js +9 -3
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +1 -15
- package/lib/view/userGroupListView/userGroupListViewReducer.d.ts +23 -0
- package/lib/view/userGroupListView/userGroupListViewReducer.js +69 -0
- package/lib/view/userGroupListView/userGroupListViewSelector.d.ts +7 -0
- package/lib/view/userGroupListView/userGroupListViewSelector.js +20 -0
- package/lib/view/userGroupListView/userGroupListViewState.d.ts +8 -0
- package/lib/view/userGroupListView/userGroupListViewState.js +2 -0
- package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +3 -1
- package/lib/view/userListView/fetchUserListByTypeEpic.js +11 -0
- package/lib/view/userListView/userListViewPayload.d.ts +2 -0
- package/lib/zeniAPI.js +0 -2
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@ import { NestedClassID } from '../../commonStateTypes/classesView/nestedClassID'
|
|
|
2
2
|
import { AccountViewMode, ID } from '../../commonStateTypes/common';
|
|
3
3
|
import { ZeniAPIStatus, ZeniReportData } from '../../responsePayload';
|
|
4
4
|
import { ProfitAndLossClassesViewPayload } from './profitAndLossClassesViewPayload';
|
|
5
|
-
import { ProfitAndLossClassesViewState } from './profitAndLossClassesViewState';
|
|
5
|
+
import { ClassViewLayout, ProfitAndLossClassesViewState } from './profitAndLossClassesViewState';
|
|
6
6
|
export declare const initialState: ProfitAndLossClassesViewState;
|
|
7
7
|
export declare const fetchProfitAndLossClassesView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
|
|
8
8
|
cacheOverride: boolean;
|
|
@@ -30,6 +30,8 @@ export declare const fetchProfitAndLossClassesView: import("@reduxjs/toolkit").A
|
|
|
30
30
|
};
|
|
31
31
|
}, "profitAndLossClassesView/updateProfitAndLossClassesViewUIState">, updateAccountViewMode: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
32
32
|
viewMode: AccountViewMode;
|
|
33
|
-
}, "profitAndLossClassesView/updateAccountViewMode">,
|
|
33
|
+
}, "profitAndLossClassesView/updateAccountViewMode">, updateClassViewLayout: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
34
|
+
classViewLayout: ClassViewLayout;
|
|
35
|
+
}, "profitAndLossClassesView/updateClassViewLayout">, resetProfitAndLossClassesNodeCollapseState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"profitAndLossClassesView/resetProfitAndLossClassesNodeCollapseState">, clearProfitAndLossClassesView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"profitAndLossClassesView/clearProfitAndLossClassesView">;
|
|
34
36
|
declare const _default: import("redux").Reducer<ProfitAndLossClassesViewState>;
|
|
35
37
|
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.clearProfitAndLossClassesView = exports.resetProfitAndLossClassesNodeCollapseState = exports.updateAccountViewMode = exports.updateProfitAndLossClassesViewUIState = exports.updateClassesToFilterOut = exports.updateProfitAndLossForTimeframeClassesViewFailure = exports.updateProfitAndLossForTimeframeClassesView = exports.fetchProfitAndLossForTimeframeClassesView = exports.fetchProfitAndLossClassesView = exports.initialState = void 0;
|
|
4
|
+
exports.clearProfitAndLossClassesView = exports.resetProfitAndLossClassesNodeCollapseState = exports.updateClassViewLayout = exports.updateAccountViewMode = exports.updateProfitAndLossClassesViewUIState = exports.updateClassesToFilterOut = exports.updateProfitAndLossForTimeframeClassesViewFailure = exports.updateProfitAndLossForTimeframeClassesView = exports.fetchProfitAndLossForTimeframeClassesView = exports.fetchProfitAndLossClassesView = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const viewAndReportPayloadv2_1 = require("../../commonPayloadTypes/v2/viewAndReportPayloadv2");
|
|
7
7
|
const getNestedClassIDHierarchyForReport_1 = require("../../commonStateTypes/classesView/getNestedClassIDHierarchyForReport");
|
|
@@ -27,6 +27,7 @@ exports.initialState = {
|
|
|
27
27
|
nodeCollapseState: {},
|
|
28
28
|
scrollPosition: undefined,
|
|
29
29
|
accountViewMode: 'account_group',
|
|
30
|
+
classViewLayout: 'vertical',
|
|
30
31
|
classesToFilterOut: [],
|
|
31
32
|
},
|
|
32
33
|
firstMonthOfFY: 1,
|
|
@@ -98,6 +99,9 @@ const profitAndLossClassesView = (0, toolkit_1.createSlice)({
|
|
|
98
99
|
updateAccountViewMode(draft, action) {
|
|
99
100
|
draft.uiState.accountViewMode = action.payload.viewMode;
|
|
100
101
|
},
|
|
102
|
+
updateClassViewLayout(draft, action) {
|
|
103
|
+
draft.uiState.classViewLayout = action.payload.classViewLayout;
|
|
104
|
+
},
|
|
101
105
|
resetProfitAndLossClassesNodeCollapseState(draft) {
|
|
102
106
|
draft.uiState.nodeCollapseState = {};
|
|
103
107
|
},
|
|
@@ -106,10 +110,11 @@ const profitAndLossClassesView = (0, toolkit_1.createSlice)({
|
|
|
106
110
|
},
|
|
107
111
|
},
|
|
108
112
|
});
|
|
109
|
-
_a = profitAndLossClassesView.actions, exports.fetchProfitAndLossClassesView = _a.fetchProfitAndLossClassesView, exports.fetchProfitAndLossForTimeframeClassesView = _a.fetchProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesView = _a.updateProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesViewFailure = _a.updateProfitAndLossForTimeframeClassesViewFailure, exports.updateClassesToFilterOut = _a.updateClassesToFilterOut, exports.updateProfitAndLossClassesViewUIState = _a.updateProfitAndLossClassesViewUIState, exports.updateAccountViewMode = _a.updateAccountViewMode, exports.resetProfitAndLossClassesNodeCollapseState = _a.resetProfitAndLossClassesNodeCollapseState, exports.clearProfitAndLossClassesView = _a.clearProfitAndLossClassesView;
|
|
113
|
+
_a = profitAndLossClassesView.actions, exports.fetchProfitAndLossClassesView = _a.fetchProfitAndLossClassesView, exports.fetchProfitAndLossForTimeframeClassesView = _a.fetchProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesView = _a.updateProfitAndLossForTimeframeClassesView, exports.updateProfitAndLossForTimeframeClassesViewFailure = _a.updateProfitAndLossForTimeframeClassesViewFailure, exports.updateClassesToFilterOut = _a.updateClassesToFilterOut, exports.updateProfitAndLossClassesViewUIState = _a.updateProfitAndLossClassesViewUIState, exports.updateAccountViewMode = _a.updateAccountViewMode, exports.updateClassViewLayout = _a.updateClassViewLayout, exports.resetProfitAndLossClassesNodeCollapseState = _a.resetProfitAndLossClassesNodeCollapseState, exports.clearProfitAndLossClassesView = _a.clearProfitAndLossClassesView;
|
|
110
114
|
exports.default = profitAndLossClassesView.reducer;
|
|
111
115
|
const doUpdatedProfitAndLossClassesView = (draft, timeframe, pandLReport) => {
|
|
112
116
|
const report = (0, viewAndReportPayloadv2_1.mapReportPayloadV2ToReportV2)(pandLReport.report);
|
|
117
|
+
draft.currency = report.currency;
|
|
113
118
|
draft.dataAvailable = report.dataAvailable;
|
|
114
119
|
draft.firstMonthOfFY = report.firstMonthOfFY;
|
|
115
120
|
draft.bookCloseDate = report.bookCloseDate;
|
|
@@ -4,6 +4,7 @@ exports.getProfitAndLossClassesView = exports.profitAndLossIdsInOrder = void 0;
|
|
|
4
4
|
const getDifferenceOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getDifferenceOfBalancesGroupedByPeriod");
|
|
5
5
|
const getSumOfBalancesGroupedByPeriod_1 = require("../../commonStateTypes/coaBalance/classBalances/getSumOfBalancesGroupedByPeriod");
|
|
6
6
|
const coaBalance_1 = require("../../commonStateTypes/coaBalance/coaBalance");
|
|
7
|
+
const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
7
8
|
const sectionClassesViewSelector_1 = require("../../entity/sectionClassesViewV2/sectionClassesViewSelector");
|
|
8
9
|
const profitAndLossClassesViewSelectorTypes_1 = require("./profitAndLossClassesViewSelectorTypes");
|
|
9
10
|
exports.profitAndLossIdsInOrder = [
|
|
@@ -18,7 +19,7 @@ exports.profitAndLossIdsInOrder = [
|
|
|
18
19
|
'netIncome',
|
|
19
20
|
];
|
|
20
21
|
const getProfitAndLossClassesView = (filter, accountState, classState, sectionsState, profitAndLossClassesViewState) => {
|
|
21
|
-
const fetchState =
|
|
22
|
+
const fetchState = (0, reduceFetchState_1.reduceFetchStateParallelTimeframes)([
|
|
22
23
|
profitAndLossClassesViewState.fetchState.month,
|
|
23
24
|
profitAndLossClassesViewState.fetchState.quarter,
|
|
24
25
|
profitAndLossClassesViewState.fetchState.year,
|
|
@@ -68,31 +69,3 @@ const getProfitAndLossClassesView = (filter, accountState, classState, sectionsS
|
|
|
68
69
|
};
|
|
69
70
|
};
|
|
70
71
|
exports.getProfitAndLossClassesView = getProfitAndLossClassesView;
|
|
71
|
-
function reduceFetchState(fetchStateList) {
|
|
72
|
-
const isAnyProgress = fetchStateList.reduce((prevValue, currentValue) => {
|
|
73
|
-
return prevValue === true || currentValue.fetchState === 'In-Progress';
|
|
74
|
-
}, false);
|
|
75
|
-
const isAllCompleted = fetchStateList.reduce((prevValue, currentValue) => {
|
|
76
|
-
return prevValue === true && currentValue.fetchState === 'Completed';
|
|
77
|
-
}, true);
|
|
78
|
-
const isAnyError = fetchStateList.reduce((prevValue, currentValue) => {
|
|
79
|
-
return prevValue === true || currentValue.fetchState === 'Error';
|
|
80
|
-
}, false);
|
|
81
|
-
const error = fetchStateList.reduce((prevValue, currentValue) => {
|
|
82
|
-
return prevValue ?? currentValue.error;
|
|
83
|
-
}, undefined);
|
|
84
|
-
let fetchState = 'Not-Started';
|
|
85
|
-
if (isAnyProgress) {
|
|
86
|
-
fetchState = 'In-Progress';
|
|
87
|
-
}
|
|
88
|
-
else if (isAllCompleted) {
|
|
89
|
-
fetchState = 'Completed';
|
|
90
|
-
}
|
|
91
|
-
else if (isAnyError) {
|
|
92
|
-
fetchState = 'Error';
|
|
93
|
-
}
|
|
94
|
-
return {
|
|
95
|
-
fetchState,
|
|
96
|
-
error,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { Currency } from '../../commonStateTypes/amount';
|
|
1
2
|
import { NestedClassHierarchyForReport, NestedClassID } from '../../commonStateTypes/classesView/nestedClassID';
|
|
2
3
|
import { AccountViewMode, FetchStateAndError, ID } from '../../commonStateTypes/common';
|
|
3
4
|
import { Report } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
|
+
export type ClassViewLayout = 'vertical' | 'horizontal';
|
|
4
6
|
export interface ProfitAndLossClassesViewUIState {
|
|
5
7
|
accountViewMode: AccountViewMode;
|
|
6
8
|
classesToFilterOut: NestedClassID[];
|
|
9
|
+
classViewLayout: ClassViewLayout;
|
|
7
10
|
nodeCollapseState: Record<ID, boolean>;
|
|
8
11
|
scrollPosition: {
|
|
9
12
|
scrollTop: number;
|
|
@@ -18,4 +21,5 @@ export interface ProfitAndLossClassesViewState extends Report {
|
|
|
18
21
|
year: FetchStateAndError;
|
|
19
22
|
};
|
|
20
23
|
uiState: ProfitAndLossClassesViewUIState;
|
|
24
|
+
currency?: Currency;
|
|
21
25
|
}
|
|
@@ -27,11 +27,13 @@ const fetchProfitAndLossForTimeframeClassesViewEpic = (actions$, _, zeniAPI) =>
|
|
|
27
27
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
28
28
|
if (response.data != null && (0, responsePayload_1.isSuccessResponse)(response)) {
|
|
29
29
|
const actions = [];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, '
|
|
33
|
-
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, '
|
|
34
|
-
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, '
|
|
30
|
+
const report = response.data.report;
|
|
31
|
+
const currency = report.currency;
|
|
32
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'cogs', 'profit_and_loss_by_classes', report.cogs, report.classes, report.accounts, currency));
|
|
33
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'expenses', 'profit_and_loss_by_classes', report.expenses, report.classes, report.accounts, currency));
|
|
34
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'income', 'profit_and_loss_by_classes', report.income, report.classes, report.accounts, currency));
|
|
35
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'otherExpenses', 'profit_and_loss_by_classes', report.other_expenses, report.classes, report.accounts, currency));
|
|
36
|
+
actions.push((0, sectionClassesViewReducer_1.updateSectionClassesView)(action.payload.timeframe, 'otherIncome', 'profit_and_loss_by_classes', report.other_income, report.classes, report.accounts, currency));
|
|
35
37
|
actions.push((0, profitAndLossClassesViewReducer_1.updateProfitAndLossForTimeframeClassesView)({
|
|
36
38
|
timeframe: action.payload.timeframe,
|
|
37
39
|
report: response.data,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ProfitAndLossByClassHorizontalReport } from './profitAndLossClassesByClassHorizontalSelectorTypes';
|
|
2
|
+
/**
|
|
3
|
+
* Populates `sectionHeaderBalancesSlice`, and per-account `accountReportData`, so the
|
|
4
|
+
* web layer only maps selector output to tree nodes.
|
|
5
|
+
*/
|
|
6
|
+
export declare function enrichProfitAndLossByClassHorizontalReport(report: ProfitAndLossByClassHorizontalReport): void;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enrichProfitAndLossByClassHorizontalReport = enrichProfitAndLossByClassHorizontalReport;
|
|
4
|
+
const currencyHelper_1 = require("../../commonStateTypes/currencyHelper");
|
|
5
|
+
const profitAndLossClassesByClassHorizontalSelectorTypes_1 = require("./profitAndLossClassesByClassHorizontalSelectorTypes");
|
|
6
|
+
/**
|
|
7
|
+
* Populates `sectionHeaderBalancesSlice`, and per-account `accountReportData`, so the
|
|
8
|
+
* web layer only maps selector output to tree nodes.
|
|
9
|
+
*/
|
|
10
|
+
function enrichProfitAndLossByClassHorizontalReport(report) {
|
|
11
|
+
if (report.fetchState !== 'Completed' || report.selectedPeriod == null) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
for (const section of Object.values(report.sections)) {
|
|
15
|
+
if (section != null) {
|
|
16
|
+
enrichHorizontalSection(report, section);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
for (const calc of Object.values(report.calculatedSections)) {
|
|
20
|
+
if (calc != null) {
|
|
21
|
+
enrichHorizontalCalculatedSection(report, calc);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function enrichHorizontalSection(report, section) {
|
|
26
|
+
const classAmounts = report.classColumns.map((col) => {
|
|
27
|
+
const total = section.classTotals.find((ct) => ct.classId === col.classId);
|
|
28
|
+
return total?.balance.amount ?? 0;
|
|
29
|
+
});
|
|
30
|
+
section.sectionHeaderBalancesSlice = buildHorizontalClassColumnBalancesSlice(report, classAmounts, section.sectionTotal.amount);
|
|
31
|
+
const childrenRowIndicesByParent = buildHorizontalAccountChildIndicesByParent(section.accounts);
|
|
32
|
+
const childrenRecord = {};
|
|
33
|
+
childrenRowIndicesByParent.forEach((childIndices, parentIndex) => {
|
|
34
|
+
childrenRecord[parentIndex] = childIndices;
|
|
35
|
+
});
|
|
36
|
+
section.treeLayout = {
|
|
37
|
+
rootAccountRowIndices: section.accounts
|
|
38
|
+
.map((_, i) => findHorizontalAccountParentIndex(section.accounts, i) === -1 ? i : -1)
|
|
39
|
+
.filter((i) => i >= 0),
|
|
40
|
+
childrenRowIndicesByParent: childrenRecord,
|
|
41
|
+
};
|
|
42
|
+
for (let i = 0; i < section.accounts.length; i++) {
|
|
43
|
+
const row = section.accounts[i];
|
|
44
|
+
const classRowAmounts = report.classColumns.map((col) => {
|
|
45
|
+
const cb = row.classBalances.find((b) => b.classId === col.classId);
|
|
46
|
+
return cb?.balance.amount ?? 0;
|
|
47
|
+
});
|
|
48
|
+
row.accountReportData = {
|
|
49
|
+
accountId: row.accountId,
|
|
50
|
+
accountName: row.accountName,
|
|
51
|
+
accountType: row.accountType,
|
|
52
|
+
depth: row.depth,
|
|
53
|
+
balancesInTimeframe: buildHorizontalClassColumnBalancesSlice(report, classRowAmounts, row.rowTotal.amount),
|
|
54
|
+
horizontalTreeView: buildHorizontalTreeView(section.accounts, i),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function enrichHorizontalCalculatedSection(report, calcSection) {
|
|
59
|
+
const classAmounts = report.classColumns.map((col) => {
|
|
60
|
+
const total = calcSection.classTotals.find((ct) => ct.classId === col.classId);
|
|
61
|
+
return total?.balance.amount ?? 0;
|
|
62
|
+
});
|
|
63
|
+
calcSection.sectionHeaderBalancesSlice =
|
|
64
|
+
buildHorizontalClassColumnBalancesSlice(report, classAmounts, calcSection.sectionTotal.amount);
|
|
65
|
+
}
|
|
66
|
+
function buildHorizontalClassColumnBalancesSlice(report, classAmounts, totalAmount) {
|
|
67
|
+
const fallback = currencyHelper_1.defaultCustomerCurrency;
|
|
68
|
+
const firstHeader = report.headerBalances[0];
|
|
69
|
+
const currencyCode = firstHeader?.balance.currencyCode ?? fallback.currencyCode;
|
|
70
|
+
const currencySymbol = firstHeader?.balance.currencySymbol ?? fallback.currencySymbol;
|
|
71
|
+
const timeframe = firstHeader?.balanceTimeFrame ?? 'month';
|
|
72
|
+
const emptySlice = {
|
|
73
|
+
balances: [],
|
|
74
|
+
additionalBalances: [],
|
|
75
|
+
filter: {
|
|
76
|
+
firstMonthOfFY: report.firstMonthOfFY,
|
|
77
|
+
timeframe,
|
|
78
|
+
balancesRange: { numberOfPeriods: 0, orderBy: 'ascending_date' },
|
|
79
|
+
additionalBalances: [],
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
if (report.selectedPeriod == null) {
|
|
83
|
+
return emptySlice;
|
|
84
|
+
}
|
|
85
|
+
const { startDate, endDate } = report.selectedPeriod;
|
|
86
|
+
const balances = report.classColumns.map((col, i) => ({
|
|
87
|
+
balance: {
|
|
88
|
+
amount: classAmounts[i] ?? 0,
|
|
89
|
+
currencyCode,
|
|
90
|
+
currencySymbol,
|
|
91
|
+
},
|
|
92
|
+
balanceTimeFrame: timeframe,
|
|
93
|
+
startDate,
|
|
94
|
+
endDate,
|
|
95
|
+
type: 'default',
|
|
96
|
+
id: col.classId,
|
|
97
|
+
label: col.className,
|
|
98
|
+
}));
|
|
99
|
+
balances.push({
|
|
100
|
+
balance: {
|
|
101
|
+
amount: totalAmount,
|
|
102
|
+
currencyCode,
|
|
103
|
+
currencySymbol,
|
|
104
|
+
},
|
|
105
|
+
balanceTimeFrame: timeframe,
|
|
106
|
+
startDate,
|
|
107
|
+
endDate,
|
|
108
|
+
type: 'default',
|
|
109
|
+
id: profitAndLossClassesByClassHorizontalSelectorTypes_1.HORIZONTAL_CLASS_TOTAL_BALANCE_ID,
|
|
110
|
+
label: 'Total',
|
|
111
|
+
});
|
|
112
|
+
return {
|
|
113
|
+
balances,
|
|
114
|
+
additionalBalances: [],
|
|
115
|
+
filter: {
|
|
116
|
+
firstMonthOfFY: report.firstMonthOfFY,
|
|
117
|
+
timeframe,
|
|
118
|
+
balancesRange: {
|
|
119
|
+
numberOfPeriods: balances.length,
|
|
120
|
+
orderBy: 'ascending_date',
|
|
121
|
+
},
|
|
122
|
+
additionalBalances: [],
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function findHorizontalAccountParentIndex(dfsOrderedAccountRows, childRowIndex) {
|
|
127
|
+
const childDepth = dfsOrderedAccountRows[childRowIndex].depth;
|
|
128
|
+
if (childDepth <= 2) {
|
|
129
|
+
return -1;
|
|
130
|
+
}
|
|
131
|
+
for (let earlierRowIndex = childRowIndex - 1; earlierRowIndex >= 0; earlierRowIndex--) {
|
|
132
|
+
const earlierDepth = dfsOrderedAccountRows[earlierRowIndex].depth;
|
|
133
|
+
if (earlierDepth < childDepth) {
|
|
134
|
+
if (earlierDepth === childDepth - 1) {
|
|
135
|
+
return earlierRowIndex;
|
|
136
|
+
}
|
|
137
|
+
return -1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return -1;
|
|
141
|
+
}
|
|
142
|
+
function getHorizontalAccountSiblingIndices(dfsOrderedAccountRows, rowIndex) {
|
|
143
|
+
const parentRowIndex = findHorizontalAccountParentIndex(dfsOrderedAccountRows, rowIndex);
|
|
144
|
+
const rowDepth = dfsOrderedAccountRows[rowIndex].depth;
|
|
145
|
+
const siblings = [];
|
|
146
|
+
for (let i = 0; i < dfsOrderedAccountRows.length; i++) {
|
|
147
|
+
if (dfsOrderedAccountRows[i].depth === rowDepth &&
|
|
148
|
+
findHorizontalAccountParentIndex(dfsOrderedAccountRows, i) ===
|
|
149
|
+
parentRowIndex) {
|
|
150
|
+
siblings.push(i);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return siblings;
|
|
154
|
+
}
|
|
155
|
+
function horizontalAccountHasChildRows(dfsOrderedAccountRows, parentRowIndex) {
|
|
156
|
+
return dfsOrderedAccountRows.some((_, rowIndex) => findHorizontalAccountParentIndex(dfsOrderedAccountRows, rowIndex) ===
|
|
157
|
+
parentRowIndex);
|
|
158
|
+
}
|
|
159
|
+
function buildHorizontalSubAccountAncestorMetadata(dfsOrderedAccountRows, currentRowIndex) {
|
|
160
|
+
const ancestorRowIndicesRootToLeaf = [];
|
|
161
|
+
let walkRowIndex = currentRowIndex;
|
|
162
|
+
while (walkRowIndex >= 0) {
|
|
163
|
+
ancestorRowIndicesRootToLeaf.unshift(walkRowIndex);
|
|
164
|
+
walkRowIndex = findHorizontalAccountParentIndex(dfsOrderedAccountRows, walkRowIndex);
|
|
165
|
+
}
|
|
166
|
+
return ancestorRowIndicesRootToLeaf.map((rowIndex) => {
|
|
167
|
+
const siblingIndices = getHorizontalAccountSiblingIndices(dfsOrderedAccountRows, rowIndex);
|
|
168
|
+
return {
|
|
169
|
+
depth: dfsOrderedAccountRows[rowIndex].depth - 2,
|
|
170
|
+
hasSibling: siblingIndices.length > 1,
|
|
171
|
+
hasChildren: horizontalAccountHasChildRows(dfsOrderedAccountRows, rowIndex),
|
|
172
|
+
isLastNode: rowIndex === siblingIndices[siblingIndices.length - 1],
|
|
173
|
+
name: dfsOrderedAccountRows[rowIndex].accountName,
|
|
174
|
+
};
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function buildHorizontalAccountChildIndicesByParent(dfsOrderedAccountRows) {
|
|
178
|
+
const childIndicesByParentRowIndex = new Map();
|
|
179
|
+
for (let rowIndex = 0; rowIndex < dfsOrderedAccountRows.length; rowIndex++) {
|
|
180
|
+
const parentRowIndex = findHorizontalAccountParentIndex(dfsOrderedAccountRows, rowIndex);
|
|
181
|
+
if (parentRowIndex >= 0) {
|
|
182
|
+
let childRowIndices = childIndicesByParentRowIndex.get(parentRowIndex);
|
|
183
|
+
if (childRowIndices === undefined) {
|
|
184
|
+
childRowIndices = [];
|
|
185
|
+
childIndicesByParentRowIndex.set(parentRowIndex, childRowIndices);
|
|
186
|
+
}
|
|
187
|
+
childRowIndices.push(rowIndex);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return childIndicesByParentRowIndex;
|
|
191
|
+
}
|
|
192
|
+
function buildHorizontalTreeView(dfsOrderedAccountRows, currentRowIndex) {
|
|
193
|
+
const treeDepth = Math.max(0, dfsOrderedAccountRows[currentRowIndex].depth - 2);
|
|
194
|
+
const siblingIndices = getHorizontalAccountSiblingIndices(dfsOrderedAccountRows, currentRowIndex);
|
|
195
|
+
const hasChildren = horizontalAccountHasChildRows(dfsOrderedAccountRows, currentRowIndex);
|
|
196
|
+
return {
|
|
197
|
+
subAccountAncestorMetadata: buildHorizontalSubAccountAncestorMetadata(dfsOrderedAccountRows, currentRowIndex),
|
|
198
|
+
treeDepth,
|
|
199
|
+
hasChildren,
|
|
200
|
+
hasSiblings: siblingIndices.length > 1,
|
|
201
|
+
isLeaf: !hasChildren,
|
|
202
|
+
isLastNode: currentRowIndex === siblingIndices[siblingIndices.length - 1],
|
|
203
|
+
};
|
|
204
|
+
}
|
|
@@ -11,9 +11,13 @@ const opExReducer_1 = require("../opEx/opExReducer");
|
|
|
11
11
|
const revenueReducer_1 = require("../revenue/revenueReducer");
|
|
12
12
|
const reportUIOptionsReducer_1 = require("./reportUIOptionsReducer");
|
|
13
13
|
const updateReportUIOptionCOABalancesRangeEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(reportUIOptionsReducer_1.updateReportUIOptionCOABalancesRange.match), (0, operators_1.switchMap)((action) => {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
14
|
+
const selectedRange = action.payload.selectedCOABalancesRange;
|
|
15
|
+
const thisPeriod = selectedRange.thisPeriod;
|
|
16
|
+
const orderBy = selectedRange.orderBy;
|
|
17
|
+
const numberOfPeriodsFromSelection = selectedRange.numberOfPeriods;
|
|
18
|
+
const highlightedNoOfPeriods = state$.value.reportUIOptionsState.isCompareModeOn === true
|
|
19
|
+
? numberOfPeriodsFromSelection
|
|
20
|
+
: 1;
|
|
17
21
|
const highlightedCOABalancesRange = action.payload.highlightedCOABalancesRange == null && thisPeriod != null
|
|
18
22
|
? {
|
|
19
23
|
numberOfPeriods: highlightedNoOfPeriods,
|
|
@@ -65,9 +69,7 @@ const updateReportUIOptionCOABalancesRangeEpic = (actions$, state$) => actions$.
|
|
|
65
69
|
thisPeriod: action.payload.highlightedCOABalancesRange != null
|
|
66
70
|
? action.payload.highlightedCOABalancesRange.thisPeriod
|
|
67
71
|
: thisPeriod,
|
|
68
|
-
numberOfPeriods:
|
|
69
|
-
? 4
|
|
70
|
-
: financeStatementReducer_1.initialFinanceStatementState.maxNumOfPeriodsToHighlight,
|
|
72
|
+
numberOfPeriods: numberOfPeriodsFromSelection,
|
|
71
73
|
orderBy,
|
|
72
74
|
}));
|
|
73
75
|
}));
|
|
@@ -31,6 +31,7 @@ const initializeTaskToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
31
31
|
savedRecurringEndDate: task.recurringEndDate,
|
|
32
32
|
recurringStartDate: task.recurringStartDate,
|
|
33
33
|
timeSpent: task.timeSpent,
|
|
34
|
+
isPrivate: task.isPrivate,
|
|
34
35
|
};
|
|
35
36
|
const actions = [
|
|
36
37
|
(0, taskDetailReducer_1.saveTaskUpdatesToLocalStore)({ taskDetailLocalData, taskId }),
|
|
@@ -98,5 +98,6 @@ const prepareTaskPayload = (state, taskId, taskGroupId) => {
|
|
|
98
98
|
sync_token: syncToken,
|
|
99
99
|
task_group_ids: taskGroupId != null ? [taskGroupId] : [],
|
|
100
100
|
time_spent: (0, formatMinutesToFromHHMM_1.convertHHMMStrToMinutes)(localData.timeSpent),
|
|
101
|
+
is_private: localData.isPrivate ?? false,
|
|
101
102
|
};
|
|
102
103
|
};
|
|
@@ -79,6 +79,7 @@ const toTaskPayload = (state, task) => {
|
|
|
79
79
|
name: task.name,
|
|
80
80
|
assignees: task.assignees,
|
|
81
81
|
description: task.description,
|
|
82
|
+
group_assignees: task.groupAssignees,
|
|
82
83
|
due_date: task.dueDate != null ? task.dueDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT) : null,
|
|
83
84
|
priority: task.priority.code,
|
|
84
85
|
status: task.status.code,
|
|
@@ -45,7 +45,7 @@ export interface TaskListUIState extends SpendManagementUIState {
|
|
|
45
45
|
searchText: string;
|
|
46
46
|
sortKey: TaskListViewSortKey;
|
|
47
47
|
}
|
|
48
|
-
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" | "visibility";
|
|
49
49
|
export declare type TaskListViewSortKey = ReturnType<typeof toTaskListSortKeyType>;
|
|
50
50
|
export declare const TASK_LIST_FILTER_CATEGORIES: TaskListFilterCategoryOption[];
|
|
51
51
|
interface TaskListFilterCategoryOption {
|
|
@@ -32,6 +32,7 @@ const ALL_TASK_LIST_SORT_KEYS = [
|
|
|
32
32
|
'status',
|
|
33
33
|
'priority',
|
|
34
34
|
'timeSpent',
|
|
35
|
+
'visibility',
|
|
35
36
|
];
|
|
36
37
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
37
38
|
const toTaskListSortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_TASK_LIST_SORT_KEYS);
|
|
@@ -8,6 +8,7 @@ import { UserState } from '../../../entity/user/userState';
|
|
|
8
8
|
import { UserRoleState } from '../../../entity/userRole/userRoleState';
|
|
9
9
|
import { RootState } from '../../../reducer';
|
|
10
10
|
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
11
|
+
import { UserGroupListSelectorView } from '../../userGroupListView/userGroupListViewSelector';
|
|
11
12
|
import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
12
13
|
import { TaskListFilters, TaskListLocalData, TaskListState, TaskListUIState } from './taskList';
|
|
13
14
|
export interface TaskWithUserDetails extends Task {
|
|
@@ -30,6 +31,7 @@ export interface TaskListSelectorView extends SelectorView {
|
|
|
30
31
|
taskGroupUpdateStatus: FetchStateAndError;
|
|
31
32
|
uiState: TaskListUIState;
|
|
32
33
|
updateTasksFetchState: FetchStateAndError;
|
|
34
|
+
userGroupList: UserGroupListSelectorView;
|
|
33
35
|
userList: UserListSelectorView;
|
|
34
36
|
}
|
|
35
37
|
export declare const getTaskListGroupedByAssignees: ({ taskListState, taskState, userState, userRoleState, addressState, tagState, }: {
|
|
@@ -17,13 +17,18 @@ const taskGroupTemplateSelector_1 = require("../../../entity/taskGroupTemplate/t
|
|
|
17
17
|
const userSelector_1 = require("../../../entity/user/userSelector");
|
|
18
18
|
const userAndRole_1 = require("../../companyView/types/userAndRole");
|
|
19
19
|
const spendManagementFilterHelpers_1 = require("../../spendManagement/spendManagementFilterHelpers");
|
|
20
|
+
const userGroupListViewSelector_1 = require("../../userGroupListView/userGroupListViewSelector");
|
|
20
21
|
const userListViewSelector_1 = require("../../userListView/userListViewSelector");
|
|
21
22
|
const taskDetailSelector_1 = require("../taskDetailView/taskDetailSelector");
|
|
22
23
|
const taskList_1 = require("./taskList");
|
|
23
24
|
const taskListReducer_1 = require("./taskListReducer");
|
|
24
25
|
const isDefaultFilters = (taskListState) => {
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
if (taskListState.uiState.searchText !== taskListReducer_1.initialState.uiState.searchText) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const hasNoActiveFilters = taskListState.filters.categories == null ||
|
|
30
|
+
taskListState.filters.categories.length === 0;
|
|
31
|
+
return (hasNoActiveFilters || (0, isEqual_1.default)(taskListState.filters, taskListReducer_1.initialState.filters));
|
|
27
32
|
};
|
|
28
33
|
const sortTasksList = (tagState, tasksList, sortKey, sortOrder) => {
|
|
29
34
|
const tasksInOrder = (0, orderBy_1.default)(tasksList, (task) => {
|
|
@@ -316,7 +321,7 @@ const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRo
|
|
|
316
321
|
tagState,
|
|
317
322
|
});
|
|
318
323
|
};
|
|
319
|
-
exports.getAllTasks = (0, toolkit_1.createSelector)((state) => state.taskListState, (state) => state.taskState, (state) => state.userState, (state) => state.userRoleState, (state) => state.userListViewState, (state) => state.addressState, (state) => state.taskGroupState, (state) => state.taskGroupViewState, (state) => state.tagViewState, (state) => state.tagState, (state) => state.taskGroupTemplateState, (state) => state.taskGroupTemplateViewState, (_state, isTaskTemplatesEnabled) => isTaskTemplatesEnabled, (taskListState, taskState, userState, userRoleState, userListViewState, addressState, taskGroupState, taskGroupViewState, tagViewState, tagState, taskGroupTemplateState, taskGroupTemplateViewState, isTaskTemplatesEnabled) => {
|
|
324
|
+
exports.getAllTasks = (0, toolkit_1.createSelector)((state) => state.taskListState, (state) => state.taskState, (state) => state.userState, (state) => state.userRoleState, (state) => state.userListViewState, (state) => state.addressState, (state) => state.taskGroupState, (state) => state.taskGroupViewState, (state) => state.tagViewState, (state) => state.tagState, (state) => state.taskGroupTemplateState, (state) => state.taskGroupTemplateViewState, (state) => state.userGroupsState, (state) => state.userGroupListViewState, (_state, isTaskTemplatesEnabled) => isTaskTemplatesEnabled, (taskListState, taskState, userState, userRoleState, userListViewState, addressState, taskGroupState, taskGroupViewState, tagViewState, tagState, taskGroupTemplateState, taskGroupTemplateViewState, userGroupsState, userGroupListViewState, isTaskTemplatesEnabled) => {
|
|
320
325
|
const { localData } = taskListState;
|
|
321
326
|
const taskGroupsWithTasksList = getTaskGroupsWithTaskList({
|
|
322
327
|
taskListState,
|
|
@@ -344,6 +349,7 @@ exports.getAllTasks = (0, toolkit_1.createSelector)((state) => state.taskListSta
|
|
|
344
349
|
taskGroupTemplates,
|
|
345
350
|
fetchState: fetchState,
|
|
346
351
|
userList: (0, userListViewSelector_1.getUserList)(userState, userRoleState, userListViewState, 'taskManagerCandidate'),
|
|
352
|
+
userGroupList: (0, userGroupListViewSelector_1.getUserGroupList)(userGroupsState, userGroupListViewState, 'taskManagerCandidate'),
|
|
347
353
|
error: error,
|
|
348
354
|
version: 0,
|
|
349
355
|
taskGroupsWithTasksList,
|
|
@@ -10,4 +10,4 @@ import { resendOtpCardHolder, sendOtpCardHolderFailure, sendOtpCardHolderSuccess
|
|
|
10
10
|
import { resendOtpSpendManagementSetUp, sendOtpFailureSpendManagementSetUp, sendOtpSuccessSpendManagementSetUp } from '../spendManagement/commonSetup/setupViewReducer';
|
|
11
11
|
import { resendOtp, sendOtpFailure, sendOtpSuccess } from './twoFactorAuthenticationReducer';
|
|
12
12
|
export type ActionType = ReturnType<typeof resendOtp> | ReturnType<typeof sendOtpSuccess> | ReturnType<typeof sendOtpFailure> | ReturnType<typeof resendOtpSpendManagementSetUp> | ReturnType<typeof sendOtpSuccessSpendManagementSetUp> | ReturnType<typeof sendOtpFailureSpendManagementSetUp> | ReturnType<typeof resendOtpVendorView> | ReturnType<typeof sendOtpVendorViewSuccess> | ReturnType<typeof sendOtpVendorViewFailure> | ReturnType<typeof resendOnboardingOfficerOtp> | ReturnType<typeof sendOnboardingOfficerOtpSuccess> | ReturnType<typeof sendOnboardingOfficerOtpFailure> | ReturnType<typeof resendOtpCardUserOnboarding> | ReturnType<typeof sendOtpCardUserOnboardingSuccess> | ReturnType<typeof sendOtpCardUserOnboardingFailure> | ReturnType<typeof resendOtpMyProfile> | ReturnType<typeof resendOtpCardHolder> | ReturnType<typeof sendOtpCardHolderSuccess> | ReturnType<typeof sendOtpCardHolderFailure> | ReturnType<typeof sendOtpMyProfileFailure> | ReturnType<typeof sendOtpMyProfileSuccess>;
|
|
13
|
-
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>,
|
|
13
|
+
export declare const resendOtpEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -11,20 +11,11 @@ const cardUserOnboardingReducer_1 = require("../spendManagement/chargeCards/card
|
|
|
11
11
|
const chargeCardDetailReducer_1 = require("../spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer");
|
|
12
12
|
const setupViewReducer_1 = require("../spendManagement/commonSetup/setupViewReducer");
|
|
13
13
|
const twoFactorAuthenticationReducer_1 = require("./twoFactorAuthenticationReducer");
|
|
14
|
-
const resendOtpEpic = (actions$,
|
|
14
|
+
const resendOtpEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(twoFactorAuthenticationReducer_1.resendOtp.match), (0, operators_1.mergeMap)((action) => {
|
|
15
15
|
const resendOtpActions = [];
|
|
16
16
|
const { otpChallenge, twoFASource, entityId } = action.payload;
|
|
17
|
-
const chargeCard = twoFASource === 'ChargeCardHolder' && entityId != null
|
|
18
|
-
? state$.value.chargeCardState.chargeCardByID[entityId]
|
|
19
|
-
: null;
|
|
20
17
|
const payload = {
|
|
21
18
|
otp_challenge: otpChallenge,
|
|
22
|
-
...(chargeCard != null
|
|
23
|
-
? {
|
|
24
|
-
provider_card_id: chargeCard.cardProviderID,
|
|
25
|
-
is_for_charge_cards: true,
|
|
26
|
-
}
|
|
27
|
-
: {}),
|
|
28
19
|
};
|
|
29
20
|
switch (twoFASource) {
|
|
30
21
|
case 'SpendManagementSetup':
|
|
@@ -42,11 +33,6 @@ const resendOtpEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators
|
|
|
42
33
|
case 'CardUserOnboarding':
|
|
43
34
|
resendOtpActions.push((0, cardUserOnboardingReducer_1.resendOtpCardUserOnboarding)());
|
|
44
35
|
break;
|
|
45
|
-
case 'ChargeCardHolder':
|
|
46
|
-
if (entityId != null) {
|
|
47
|
-
resendOtpActions.push((0, chargeCardDetailReducer_1.resendOtpCardHolder)({ chargeCardId: entityId }));
|
|
48
|
-
}
|
|
49
|
-
break;
|
|
50
36
|
}
|
|
51
37
|
const resendOtp$ = zeniAPI
|
|
52
38
|
.putAndGetJSON(`${zeniAPI.apiEndPoints.authMicroServiceBaseUrl}/1.0/otp/resend`, payload)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { UserGroupPayload } from '../../entity/userGroups/userGroupsPayload';
|
|
3
|
+
import { ZeniAPIStatus } from '../../responsePayload';
|
|
4
|
+
import { UserGroupListType, UserGroupListViewState } from './userGroupListViewState';
|
|
5
|
+
export declare const initialState: UserGroupListViewState;
|
|
6
|
+
export declare const fetchUserGroupListByType: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userGroupType: "taskManagerCandidate", cacheOverride?: any], {
|
|
7
|
+
userGroupType: "taskManagerCandidate";
|
|
8
|
+
cacheOverride: any;
|
|
9
|
+
}, "userGroupListView/fetchUserGroupListByType", never, never>, updateUserGroupIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
|
+
userGroupsPayload: UserGroupPayload[];
|
|
11
|
+
userGroupType: UserGroupListType;
|
|
12
|
+
}, "userGroupListView/updateUserGroupIds">, addUserGroupId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
13
|
+
id: ID;
|
|
14
|
+
userGroupType: UserGroupListType;
|
|
15
|
+
}, "userGroupListView/addUserGroupId">, removeUserGroupId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
16
|
+
id: ID;
|
|
17
|
+
userGroupType: UserGroupListType;
|
|
18
|
+
}, "userGroupListView/removeUserGroupId">, updateUserGroupListFetchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
19
|
+
status: ZeniAPIStatus;
|
|
20
|
+
userGroupType: UserGroupListType;
|
|
21
|
+
}, "userGroupListView/updateUserGroupListFetchFailure">, clearUserGroupListView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"userGroupListView/clearUserGroupListView">;
|
|
22
|
+
declare const _default: import("redux").Reducer<UserGroupListViewState>;
|
|
23
|
+
export default _default;
|