@zeniai/client-epic-state 4.19.88-beta2ND → 4.19.88-betaJK1
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/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/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/index.js +2 -3
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/financeStatement/financeStatementSelector.js +0 -5
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +1 -5
- package/lib/esm/view/taskManager/taskListView/taskListSelector.js +3 -1
- package/lib/esm/view/userGroupListView/userGroupListViewReducer.js +69 -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/index.d.ts +3 -5
- package/lib/index.js +25 -28
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/view/financeStatement/financeStatementSelector.d.ts +0 -2
- package/lib/view/financeStatement/financeStatementSelector.js +0 -5
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.d.ts +2 -4
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +2 -6
- package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +0 -2
- package/lib/view/taskManager/taskListView/taskListSelector.js +3 -1
- package/lib/view/userGroupListView/userGroupListViewReducer.d.ts +23 -0
- package/lib/view/userGroupListView/userGroupListViewReducer.js +73 -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/package.json +1 -1
- package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -281
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +0 -13
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -285
- package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.d.ts +0 -57
- /package/lib/{view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js → entity/userGroups/userGroupsState.js} +0 -0
- /package/lib/esm/{view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js → entity/userGroups/userGroupsState.js} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapUserGroupPayloadToUserGroup = mapUserGroupPayloadToUserGroup;
|
|
4
|
+
function mapUserGroupPayloadToUserGroup(payload) {
|
|
5
|
+
return {
|
|
6
|
+
userGroupId: payload.user_group_id,
|
|
7
|
+
name: payload.name,
|
|
8
|
+
userIds: payload.user_ids ?? [],
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UserGroupPayload } from './userGroupsPayload';
|
|
2
|
+
import { UserGroupsState } from './userGroupsState';
|
|
3
|
+
export declare const initialState: UserGroupsState;
|
|
4
|
+
export declare const updateAllUserGroups: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
5
|
+
userGroups: UserGroupPayload[];
|
|
6
|
+
}, "userGroups/updateAllUserGroups">, removeUserGroup: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "userGroups/removeUserGroup">, clearAllUserGroups: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"userGroups/clearAllUserGroups">;
|
|
7
|
+
declare const _default: import("redux").Reducer<UserGroupsState>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearAllUserGroups = exports.removeUserGroup = exports.updateAllUserGroups = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
const userGroupsPayload_1 = require("./userGroupsPayload");
|
|
7
|
+
exports.initialState = {
|
|
8
|
+
userGroupByUserGroupId: {},
|
|
9
|
+
};
|
|
10
|
+
const userGroups = (0, toolkit_1.createSlice)({
|
|
11
|
+
name: 'userGroups',
|
|
12
|
+
initialState: exports.initialState,
|
|
13
|
+
reducers: {
|
|
14
|
+
updateAllUserGroups(draft, action) {
|
|
15
|
+
action.payload.userGroups.forEach((payload) => {
|
|
16
|
+
const userGroup = (0, userGroupsPayload_1.mapUserGroupPayloadToUserGroup)(payload);
|
|
17
|
+
draft.userGroupByUserGroupId[userGroup.userGroupId] = userGroup;
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
removeUserGroup(draft, action) {
|
|
21
|
+
delete draft.userGroupByUserGroupId[action.payload];
|
|
22
|
+
},
|
|
23
|
+
clearAllUserGroups(draft) {
|
|
24
|
+
Object.assign(draft, exports.initialState);
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
_a = userGroups.actions, exports.updateAllUserGroups = _a.updateAllUserGroups, exports.removeUserGroup = _a.removeUserGroup, exports.clearAllUserGroups = _a.clearAllUserGroups;
|
|
29
|
+
exports.default = userGroups.reducer;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ID } from '../../commonStateTypes/common';
|
|
2
|
+
import { UserGroup, UserGroupsState } from './userGroupsState';
|
|
3
|
+
export declare function getUserGroupsByUserGroupIds(userGroupsState: UserGroupsState, userGroupIds: ID[]): UserGroup[];
|
|
4
|
+
export declare function getUserGroupByUserGroupId(userGroupsState: UserGroupsState, userGroupId: ID): UserGroup | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUserGroupsByUserGroupIds = getUserGroupsByUserGroupIds;
|
|
4
|
+
exports.getUserGroupByUserGroupId = getUserGroupByUserGroupId;
|
|
5
|
+
function getUserGroupsByUserGroupIds(userGroupsState, userGroupIds) {
|
|
6
|
+
return userGroupIds
|
|
7
|
+
.map((id) => getUserGroupByUserGroupId(userGroupsState, id))
|
|
8
|
+
.filter((value) => value != null);
|
|
9
|
+
}
|
|
10
|
+
function getUserGroupByUserGroupId(userGroupsState, userGroupId) {
|
|
11
|
+
return userGroupsState.userGroupByUserGroupId[userGroupId] ?? undefined;
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
import { mapUserGroupPayloadToUserGroup, } from './userGroupsPayload';
|
|
3
|
+
export const initialState = {
|
|
4
|
+
userGroupByUserGroupId: {},
|
|
5
|
+
};
|
|
6
|
+
const userGroups = createSlice({
|
|
7
|
+
name: 'userGroups',
|
|
8
|
+
initialState,
|
|
9
|
+
reducers: {
|
|
10
|
+
updateAllUserGroups(draft, action) {
|
|
11
|
+
action.payload.userGroups.forEach((payload) => {
|
|
12
|
+
const userGroup = mapUserGroupPayloadToUserGroup(payload);
|
|
13
|
+
draft.userGroupByUserGroupId[userGroup.userGroupId] = userGroup;
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
removeUserGroup(draft, action) {
|
|
17
|
+
delete draft.userGroupByUserGroupId[action.payload];
|
|
18
|
+
},
|
|
19
|
+
clearAllUserGroups(draft) {
|
|
20
|
+
Object.assign(draft, initialState);
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export const { updateAllUserGroups, removeUserGroup, clearAllUserGroups } = userGroups.actions;
|
|
25
|
+
export default userGroups.reducer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function getUserGroupsByUserGroupIds(userGroupsState, userGroupIds) {
|
|
2
|
+
return userGroupIds
|
|
3
|
+
.map((id) => getUserGroupByUserGroupId(userGroupsState, id))
|
|
4
|
+
.filter((value) => value != null);
|
|
5
|
+
}
|
|
6
|
+
export function getUserGroupByUserGroupId(userGroupsState, userGroupId) {
|
|
7
|
+
return userGroupsState.userGroupByUserGroupId[userGroupId] ?? undefined;
|
|
8
|
+
}
|
package/lib/esm/index.js
CHANGED
|
@@ -217,8 +217,7 @@ import { changeZeniPersonRoles, deletePerson, fetchAllPeopleRequiredViews, fetch
|
|
|
217
217
|
import { getPeople, getPeopleLocalData } from './view/people/peopleSelector';
|
|
218
218
|
import { fetchProfitAndLoss, fetchProfitAndLossForTimeframe, resetProfitAndLossNodeCollapseState, updateProfitAndLossUIState, } from './view/profitAndLoss/profitAndLossReducer';
|
|
219
219
|
import { getPandLReportFetchState, getProfitAndLossReport, } from './view/profitAndLoss/profitAndLossSelector';
|
|
220
|
-
import { fetchProfitAndLossClassesView, resetProfitAndLossClassesNodeCollapseState, updateAccountViewMode as updateProfitAndLossAccountViewMode, updateClassesToFilterOut as updateProfitAndLossClassesToFilterOut,
|
|
221
|
-
import { getProfitAndLossClassesHorizontalView } from './view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector';
|
|
220
|
+
import { fetchProfitAndLossClassesView, resetProfitAndLossClassesNodeCollapseState, updateAccountViewMode as updateProfitAndLossAccountViewMode, updateClassesToFilterOut as updateProfitAndLossClassesToFilterOut, updateProfitAndLossClassesViewUIState, } from './view/profitAndLossClassesView/profitAndLossClassesViewReducer';
|
|
222
221
|
import { getProfitAndLossClassesView } from './view/profitAndLossClassesView/profitAndLossClassesViewSelector';
|
|
223
222
|
import { isPandLReportViewCalculatedSectionID, isPandLReportViewSectionID, } from './view/profitAndLossClassesView/profitAndLossClassesViewSelectorTypes';
|
|
224
223
|
import { fetchEntityRecommendationsByTransactionId, fetchRecommendationByEntityId, fetchRecommendationByEntityName, } from './view/recommendation/recommendationReducer';
|
|
@@ -452,7 +451,7 @@ export { fetchDashboard, getDashboard, updateTreasuryVideoClosed, };
|
|
|
452
451
|
export { updateDashboardLayout };
|
|
453
452
|
export { getPandLWithForecast, } from './view/profitAndLoss/pAndLWithForecast/pAndLWithForecastSelector';
|
|
454
453
|
export { fetchProfitAndLoss, resetProfitAndLossNodeCollapseState, updateProfitAndLossUIState, getProfitAndLossReport, getPandLReportFetchState, fetchProfitAndLossForTimeframe, };
|
|
455
|
-
export { fetchProfitAndLossClassesView, updateProfitAndLossClassesToFilterOut, resetProfitAndLossClassesNodeCollapseState, updateProfitAndLossClassesViewUIState, updateProfitAndLossAccountViewMode,
|
|
454
|
+
export { fetchProfitAndLossClassesView, updateProfitAndLossClassesToFilterOut, resetProfitAndLossClassesNodeCollapseState, updateProfitAndLossClassesViewUIState, updateProfitAndLossAccountViewMode, getProfitAndLossClassesView, isPandLReportViewCalculatedSectionID, isPandLReportViewSectionID, };
|
|
456
455
|
export { getAccountingProviderAttachment };
|
|
457
456
|
export { fetchUserListByType, getUserList };
|
|
458
457
|
export { fetchAllPeopleRequiredViews, fetchPeoplePage, fetchPeople, deletePerson, resendInvite, changeZeniPersonRoles, invitePeople, inviteZeniPeople, updatePeopleUIState, peopleSaveUpdates, resetUpdateErrorMessage, peopleSaveDataInLocalStore, peopleClearDataInLocalStore, getPeople, getPeopleLocalData, initializeEditPerson, };
|
package/lib/esm/reducer.js
CHANGED
|
@@ -58,6 +58,7 @@ import toastNotification, { initialState as initialToastNotificationState, } fro
|
|
|
58
58
|
import transaction, { initialState as initialTransactionState, } from './entity/transaction/transactionReducer';
|
|
59
59
|
import transactionActivityLog, { initialState as initialTransactionActivityLogState, } from './entity/transactionActivityLog/transactionActivityLogReducer';
|
|
60
60
|
import user, { initialState as initialUserState, } from './entity/user/userReducer';
|
|
61
|
+
import userGroups, { initialState as initialUserGroupsState, } from './entity/userGroups/userGroupsReducer';
|
|
61
62
|
import userRole, { initialState as initialUserRoleState, } from './entity/userRole/userRoleReducer';
|
|
62
63
|
import vendor, { initialState as initialVendorState, } from './entity/vendor/vendorReducer';
|
|
63
64
|
import vendorExpense, { initialState as initialVendorExpenseState, } from './entity/vendorExpense/vendorExpenseReducer';
|
|
@@ -198,6 +199,7 @@ import trend, { initialTrendState } from './view/trend/trendReducer';
|
|
|
198
199
|
import trendWithTransactions, { initialTrendWithTransactionsState, } from './view/trendWithTransactions/trendWithTransactionsReducer';
|
|
199
200
|
import twoFactorAuthentication, { initialState as initialTwoFactorAuthenticationState, } from './view/twoFactorAuthentication/twoFactorAuthenticationReducer';
|
|
200
201
|
import userFinancialAccountState, { initialState as initialUserFinancialAccountState, } from './view/userFinancialAccount/userFinancialAccountReducer';
|
|
202
|
+
import userGroupListView, { initialState as initialUserGroupListViewState, } from './view/userGroupListView/userGroupListViewReducer';
|
|
201
203
|
import userListView, { initialState as initialUserListViewState, } from './view/userListView/userListViewReducer';
|
|
202
204
|
import userRoleConfig, { initialState as initialUserRoleConfigState, } from './view/userRoleConfigView/userRoleConfigReducer';
|
|
203
205
|
import vendor1099TypeList, { initialState as initialVendor1099TypeListState, } from './view/vendor1099TypeList/vendor1099TypeListReducer';
|
|
@@ -270,6 +272,7 @@ const initialEntitiesState = {
|
|
|
270
272
|
toastNotificationState: initialToastNotificationState,
|
|
271
273
|
transactionActivityLogState: initialTransactionActivityLogState,
|
|
272
274
|
transactionState: initialTransactionState,
|
|
275
|
+
userGroupsState: initialUserGroupsState,
|
|
273
276
|
userRoleState: initialUserRoleState,
|
|
274
277
|
userState: initialUserState,
|
|
275
278
|
vendorExpenseState: initialVendorExpenseState,
|
|
@@ -408,6 +411,7 @@ const initialViewsState = {
|
|
|
408
411
|
trendWithTransactionsState: initialTrendWithTransactionsState,
|
|
409
412
|
twoFactorAuthenticationState: initialTwoFactorAuthenticationState,
|
|
410
413
|
userFinancialAccountState: initialUserFinancialAccountState,
|
|
414
|
+
userGroupListViewState: initialUserGroupListViewState,
|
|
411
415
|
userListViewState: initialUserListViewState,
|
|
412
416
|
userRoleConfigState: initialUserRoleConfigState,
|
|
413
417
|
vendorFirstReviewViewState: initialVendorFirstReviewViewState,
|
|
@@ -492,6 +496,7 @@ const entityReducers = {
|
|
|
492
496
|
toastNotificationState: toastNotification,
|
|
493
497
|
transactionActivityLogState: transactionActivityLog,
|
|
494
498
|
transactionState: transaction,
|
|
499
|
+
userGroupsState: userGroups,
|
|
495
500
|
userRoleState: userRole,
|
|
496
501
|
userState: user,
|
|
497
502
|
vendorExpenseState: vendorExpense,
|
|
@@ -630,6 +635,7 @@ const viewReducers = {
|
|
|
630
635
|
trendWithTransactionsState: trendWithTransactions,
|
|
631
636
|
twoFactorAuthenticationState: twoFactorAuthentication,
|
|
632
637
|
userFinancialAccountState: userFinancialAccountState,
|
|
638
|
+
userGroupListViewState: userGroupListView,
|
|
633
639
|
userListViewState: userListView,
|
|
634
640
|
userRoleConfigState: userRoleConfig,
|
|
635
641
|
vendorFirstReviewViewState: vendorFirstReviewView,
|
|
@@ -8,7 +8,6 @@ import { extractThisPeriod } from '../../commonStateTypes/viewAndReport/thisPeri
|
|
|
8
8
|
import { getBalanceSheet } from '../balanceSheet/balanceSheetSelector';
|
|
9
9
|
import { getCashFlow } from '../cashFlow/cashFlowSelector';
|
|
10
10
|
import { getProfitAndLossReport, } from '../profitAndLoss/profitAndLossSelector';
|
|
11
|
-
import { getProfitAndLossClassesHorizontalView } from '../profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector';
|
|
12
11
|
import { getProfitAndLossClassesView } from '../profitAndLossClassesView/profitAndLossClassesViewSelector';
|
|
13
12
|
function getDateRangeForFinanceReports(profitAndLossState, balanceSheetState, cashFlowState) {
|
|
14
13
|
const datesSorted = [
|
|
@@ -61,9 +60,6 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
|
|
|
61
60
|
const profitAndLossReport = getProfitAndLossReport(filter, undefined, accountState, accountGroupState, sectionAccountsViewState, profitAndLossState, forecastState);
|
|
62
61
|
const classFilter = newBalancesFilterClassesView(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, profitAndLossClassesViewState.uiState.classesToFilterOut);
|
|
63
62
|
const profitAndLossByClassReport = getProfitAndLossClassesView(classFilter, accountState, classState, sectionsState, profitAndLossClassesViewState);
|
|
64
|
-
const profitAndLossByClassHorizontalReport = profitAndLossClassesViewState.uiState.classViewLayout === 'horizontal'
|
|
65
|
-
? getProfitAndLossClassesHorizontalView(classFilter, accountState, classState, sectionsState, profitAndLossClassesViewState, thisPeriod)
|
|
66
|
-
: getProfitAndLossClassesHorizontalView(classFilter, accountState, classState, sectionsState, profitAndLossClassesViewState, undefined);
|
|
67
63
|
const balanceSheetReport = getBalanceSheet(filter, accountState, accountGroupState, sectionAccountsViewState, balanceSheetState);
|
|
68
64
|
const cashFlowReport = getCashFlow(filter, accountState, accountGroupState, sectionAccountsViewState, cashFlowState);
|
|
69
65
|
const allReports = [
|
|
@@ -111,7 +107,6 @@ export const getFinanceStatement = createSelector((state) => state.accountState,
|
|
|
111
107
|
dataAvailable,
|
|
112
108
|
profitAndLossReport,
|
|
113
109
|
profitAndLossByClassReport,
|
|
114
|
-
profitAndLossByClassHorizontalReport,
|
|
115
110
|
balanceSheetReport,
|
|
116
111
|
cashFlowReport,
|
|
117
112
|
filter,
|
|
@@ -23,7 +23,6 @@ export const initialState = {
|
|
|
23
23
|
nodeCollapseState: {},
|
|
24
24
|
scrollPosition: undefined,
|
|
25
25
|
accountViewMode: 'account_group',
|
|
26
|
-
classViewLayout: 'vertical',
|
|
27
26
|
classesToFilterOut: [],
|
|
28
27
|
},
|
|
29
28
|
firstMonthOfFY: 1,
|
|
@@ -95,9 +94,6 @@ const profitAndLossClassesView = createSlice({
|
|
|
95
94
|
updateAccountViewMode(draft, action) {
|
|
96
95
|
draft.uiState.accountViewMode = action.payload.viewMode;
|
|
97
96
|
},
|
|
98
|
-
updateClassViewLayout(draft, action) {
|
|
99
|
-
draft.uiState.classViewLayout = action.payload.classViewLayout;
|
|
100
|
-
},
|
|
101
97
|
resetProfitAndLossClassesNodeCollapseState(draft) {
|
|
102
98
|
draft.uiState.nodeCollapseState = {};
|
|
103
99
|
},
|
|
@@ -106,7 +102,7 @@ const profitAndLossClassesView = createSlice({
|
|
|
106
102
|
},
|
|
107
103
|
},
|
|
108
104
|
});
|
|
109
|
-
export const { fetchProfitAndLossClassesView, fetchProfitAndLossForTimeframeClassesView, updateProfitAndLossForTimeframeClassesView, updateProfitAndLossForTimeframeClassesViewFailure, updateClassesToFilterOut, updateProfitAndLossClassesViewUIState, updateAccountViewMode,
|
|
105
|
+
export const { fetchProfitAndLossClassesView, fetchProfitAndLossForTimeframeClassesView, updateProfitAndLossForTimeframeClassesView, updateProfitAndLossForTimeframeClassesViewFailure, updateClassesToFilterOut, updateProfitAndLossClassesViewUIState, updateAccountViewMode, resetProfitAndLossClassesNodeCollapseState, clearProfitAndLossClassesView, } = profitAndLossClassesView.actions;
|
|
110
106
|
export default profitAndLossClassesView.reducer;
|
|
111
107
|
const doUpdatedProfitAndLossClassesView = (draft, timeframe, pandLReport) => {
|
|
112
108
|
const report = mapReportPayloadV2ToReportV2(pandLReport.report);
|
|
@@ -11,6 +11,7 @@ import { getTaskGroupTemplateByIds } from '../../../entity/taskGroupTemplate/tas
|
|
|
11
11
|
import { getUserName, getUsersByUserIds, } from '../../../entity/user/userSelector';
|
|
12
12
|
import { getUserAndUserRole, } from '../../companyView/types/userAndRole';
|
|
13
13
|
import { applyAdvancedFiltersOnList } from '../../spendManagement/spendManagementFilterHelpers';
|
|
14
|
+
import { getUserGroupList } from '../../userGroupListView/userGroupListViewSelector';
|
|
14
15
|
import { getUserList, } from '../../userListView/userListViewSelector';
|
|
15
16
|
import { allTaskPriority, allTaskStatus, } from '../taskDetailView/taskDetailSelector';
|
|
16
17
|
import { DUE_DATE_GROUP_KEYS, } from './taskList';
|
|
@@ -308,7 +309,7 @@ const getTaskGroupsWithTaskList = ({ taskListState, taskState, userState, userRo
|
|
|
308
309
|
tagState,
|
|
309
310
|
});
|
|
310
311
|
};
|
|
311
|
-
export const getAllTasks = 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) => {
|
|
312
|
+
export const getAllTasks = 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) => {
|
|
312
313
|
const { localData } = taskListState;
|
|
313
314
|
const taskGroupsWithTasksList = getTaskGroupsWithTaskList({
|
|
314
315
|
taskListState,
|
|
@@ -336,6 +337,7 @@ export const getAllTasks = createSelector((state) => state.taskListState, (state
|
|
|
336
337
|
taskGroupTemplates,
|
|
337
338
|
fetchState: fetchState,
|
|
338
339
|
userList: getUserList(userState, userRoleState, userListViewState, 'taskManagerCandidate'),
|
|
340
|
+
userGroupList: getUserGroupList(userGroupsState, userGroupListViewState, 'taskManagerCandidate'),
|
|
339
341
|
error: error,
|
|
340
342
|
version: 0,
|
|
341
343
|
taskGroupsWithTasksList,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
+
const initialUserGroupList = {
|
|
3
|
+
ids: [],
|
|
4
|
+
fetchState: 'Not-Started',
|
|
5
|
+
error: undefined,
|
|
6
|
+
hasValidState() {
|
|
7
|
+
return this.fetchState == 'Completed';
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export const initialState = {
|
|
11
|
+
userGroupListByType: {
|
|
12
|
+
taskManagerCandidate: initialUserGroupList,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const userGroupListView = createSlice({
|
|
16
|
+
name: 'userGroupListView',
|
|
17
|
+
initialState,
|
|
18
|
+
reducers: {
|
|
19
|
+
fetchUserGroupListByType: {
|
|
20
|
+
reducer(draft, action) {
|
|
21
|
+
const { userGroupType, cacheOverride } = action.payload;
|
|
22
|
+
if (cacheOverride === true ||
|
|
23
|
+
(cacheOverride === false &&
|
|
24
|
+
draft.userGroupListByType[userGroupType].hasValidState() === false)) {
|
|
25
|
+
draft.userGroupListByType[userGroupType].fetchState = 'In-Progress';
|
|
26
|
+
draft.userGroupListByType[userGroupType].error = undefined;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
prepare(userGroupType, cacheOverride = false) {
|
|
30
|
+
return {
|
|
31
|
+
payload: {
|
|
32
|
+
userGroupType,
|
|
33
|
+
cacheOverride,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
updateUserGroupIds(draft, action) {
|
|
39
|
+
const { userGroupType, userGroupsPayload } = action.payload;
|
|
40
|
+
draft.userGroupListByType[userGroupType].fetchState = 'Completed';
|
|
41
|
+
draft.userGroupListByType[userGroupType].error = undefined;
|
|
42
|
+
draft.userGroupListByType[userGroupType].ids = userGroupsPayload.map((userGroup) => userGroup.user_group_id);
|
|
43
|
+
},
|
|
44
|
+
addUserGroupId(draft, action) {
|
|
45
|
+
const { userGroupType, id } = action.payload;
|
|
46
|
+
const index = draft.userGroupListByType[userGroupType].ids.indexOf(id);
|
|
47
|
+
if (index < 0) {
|
|
48
|
+
draft.userGroupListByType[userGroupType].ids.push(id);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
removeUserGroupId(draft, action) {
|
|
52
|
+
const { userGroupType, id } = action.payload;
|
|
53
|
+
const index = draft.userGroupListByType[userGroupType].ids.indexOf(id);
|
|
54
|
+
if (index > -1) {
|
|
55
|
+
draft.userGroupListByType[userGroupType].ids.splice(index, 1);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
updateUserGroupListFetchFailure(draft, action) {
|
|
59
|
+
const { userGroupType, status } = action.payload;
|
|
60
|
+
draft.userGroupListByType[userGroupType].fetchState = 'Error';
|
|
61
|
+
draft.userGroupListByType[userGroupType].error = status;
|
|
62
|
+
},
|
|
63
|
+
clearUserGroupListView(draft) {
|
|
64
|
+
Object.assign(draft, initialState);
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
export const { fetchUserGroupListByType, updateUserGroupIds, addUserGroupId, removeUserGroupId, updateUserGroupListFetchFailure, clearUserGroupListView, } = userGroupListView.actions;
|
|
69
|
+
export default userGroupListView.reducer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getUserGroupByUserGroupId } from '../../entity/userGroups/userGroupsSelector';
|
|
2
|
+
export const getUserGroupList = (userGroupsState, userGroupListViewState, userGroupType) => {
|
|
3
|
+
const listState = userGroupListViewState.userGroupListByType[userGroupType];
|
|
4
|
+
return {
|
|
5
|
+
userGroups: getUserGroupListByIds(userGroupsState, userGroupListViewState, userGroupType),
|
|
6
|
+
fetchState: listState?.fetchState,
|
|
7
|
+
error: listState?.error,
|
|
8
|
+
version: 0,
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
function getUserGroupListByIds(userGroupsState, userGroupListViewState, type) {
|
|
12
|
+
const userGroupIds = userGroupListViewState.userGroupListByType[type].ids;
|
|
13
|
+
return userGroupIds
|
|
14
|
+
.map((id) => getUserGroupByUserGroupId(userGroupsState, id))
|
|
15
|
+
.filter((value) => value != null);
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,9 +3,11 @@ import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
|
3
3
|
import { updateAddresses } from '../../entity/address/addressReducer';
|
|
4
4
|
import { getCurrentTenant, isZeniDomainTenant, } from '../../entity/tenant/tenantSelector';
|
|
5
5
|
import { updateAllUsers } from '../../entity/user/userReducer';
|
|
6
|
+
import { updateAllUserGroups } from '../../entity/userGroups/userGroupsReducer';
|
|
6
7
|
import { updateUserRoles } from '../../entity/userRole/userRoleReducer';
|
|
7
8
|
import { createZeniAPIStatus, isSuccessResponse } from '../../responsePayload';
|
|
8
9
|
import { updateChargeCardCount, updateDebitCardCount, } from '../spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer';
|
|
10
|
+
import { updateUserGroupIds } from '../userGroupListView/userGroupListViewReducer';
|
|
9
11
|
import { fetchUserListByType, updateUserIds, updateUserListFetchFailure, } from './userListViewReducer';
|
|
10
12
|
export const fetchUserListByTypeEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchUserListByType.match), mergeMap((action) => {
|
|
11
13
|
const { userType, cacheOverride } = action.payload;
|
|
@@ -29,6 +31,15 @@ export const fetchUserListByTypeEpic = (actions$, state$, zeniAPI) => actions$.p
|
|
|
29
31
|
usersPayload: response.data?.users ?? [],
|
|
30
32
|
}),
|
|
31
33
|
];
|
|
34
|
+
if (response.data?.user_groups != null) {
|
|
35
|
+
userListAction.push(updateAllUserGroups({ userGroups: response.data.user_groups }));
|
|
36
|
+
if (userType === 'taskManagerCandidate') {
|
|
37
|
+
userListAction.push(updateUserGroupIds({
|
|
38
|
+
userGroupType: userType,
|
|
39
|
+
userGroupsPayload: response.data.user_groups,
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
32
43
|
if (userType === 'cardHolderCandidate') {
|
|
33
44
|
userListAction.push(updateChargeCardCount(response.data?.cards_count_by_user_id ?? []));
|
|
34
45
|
userListAction.push(updateDebitCardCount(response.data?.debit_cards_count_by_deposit_account_id ?? {}));
|
package/lib/index.d.ts
CHANGED
|
@@ -346,12 +346,10 @@ import { PeopleViewSortKey } from './view/people/peopleTypes';
|
|
|
346
346
|
import { fetchProfitAndLoss, fetchProfitAndLossForTimeframe, resetProfitAndLossNodeCollapseState, updateProfitAndLossUIState } from './view/profitAndLoss/profitAndLossReducer';
|
|
347
347
|
import { ProfitAndLossReport, getPandLReportFetchState, getProfitAndLossReport } from './view/profitAndLoss/profitAndLossSelector';
|
|
348
348
|
import { ProfitAndLossState, ProfitAndLossUIState } from './view/profitAndLoss/profitAndLossState';
|
|
349
|
-
import { fetchProfitAndLossClassesView, resetProfitAndLossClassesNodeCollapseState, updateAccountViewMode as updateProfitAndLossAccountViewMode, updateClassesToFilterOut as updateProfitAndLossClassesToFilterOut,
|
|
350
|
-
import { getProfitAndLossClassesHorizontalView } from './view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector';
|
|
351
|
-
import { ClassColumnDefinition, HorizontalAccountRow, HorizontalCalculatedSection, HorizontalClassBalance, HorizontalSectionReport, ProfitAndLossByClassHorizontalReport } from './view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes';
|
|
349
|
+
import { fetchProfitAndLossClassesView, resetProfitAndLossClassesNodeCollapseState, updateAccountViewMode as updateProfitAndLossAccountViewMode, updateClassesToFilterOut as updateProfitAndLossClassesToFilterOut, updateProfitAndLossClassesViewUIState } from './view/profitAndLossClassesView/profitAndLossClassesViewReducer';
|
|
352
350
|
import { getProfitAndLossClassesView } from './view/profitAndLossClassesView/profitAndLossClassesViewSelector';
|
|
353
351
|
import { PandLReportViewCalculatedSectionID, PandLReportViewSectionID, ProfitAndLossClassesViewReport, isPandLReportViewCalculatedSectionID, isPandLReportViewSectionID } from './view/profitAndLossClassesView/profitAndLossClassesViewSelectorTypes';
|
|
354
|
-
import {
|
|
352
|
+
import { ProfitAndLossClassesViewUIState } from './view/profitAndLossClassesView/profitAndLossClassesViewState';
|
|
355
353
|
import { fetchEntityRecommendationsByTransactionId, fetchRecommendationByEntityId, fetchRecommendationByEntityName } from './view/recommendation/recommendationReducer';
|
|
356
354
|
import { clearReferrals, fetchReferrals, fetchRewardsPlan, resendReferralInvite, saveReferralFormDataInLocalStore, sendReferralInvite, updateReferViewed, updateReferralListSortUiState } from './view/referralView/referralReducer';
|
|
357
355
|
import { ReferralListSelectorView, RewardsPlanCardReport, getInviteFormView, getReferralListView, getRewardsPlanCard } from './view/referralView/referralSelector';
|
|
@@ -666,7 +664,7 @@ export { fetchDashboard, getDashboard, DashboardReport, updateTreasuryVideoClose
|
|
|
666
664
|
export { updateDashboardLayout };
|
|
667
665
|
export { PandLWithForecastView, getPandLWithForecast, } from './view/profitAndLoss/pAndLWithForecast/pAndLWithForecastSelector';
|
|
668
666
|
export { fetchProfitAndLoss, resetProfitAndLossNodeCollapseState, updateProfitAndLossUIState, ProfitAndLossState, ProfitAndLossUIState, getProfitAndLossReport, ProfitAndLossReport, getPandLReportFetchState, fetchProfitAndLossForTimeframe, };
|
|
669
|
-
export { fetchProfitAndLossClassesView, updateProfitAndLossClassesToFilterOut, resetProfitAndLossClassesNodeCollapseState, updateProfitAndLossClassesViewUIState, updateProfitAndLossAccountViewMode,
|
|
667
|
+
export { fetchProfitAndLossClassesView, updateProfitAndLossClassesToFilterOut, resetProfitAndLossClassesNodeCollapseState, updateProfitAndLossClassesViewUIState, updateProfitAndLossAccountViewMode, ProfitAndLossClassesViewUIState, ProfitAndLossClassesViewReport, getProfitAndLossClassesView, PandLReportViewSectionID, PandLReportViewCalculatedSectionID, isPandLReportViewCalculatedSectionID, isPandLReportViewSectionID, };
|
|
670
668
|
export { AccountingProviderAttachmentSelector, getAccountingProviderAttachment };
|
|
671
669
|
export { fetchUserListByType, getUserList, UserListSelectorView };
|
|
672
670
|
export { fetchAllPeopleRequiredViews, fetchPeoplePage, fetchPeople, deletePerson, resendInvite, changeZeniPersonRoles, invitePeople, inviteZeniPeople, updatePeopleUIState, peopleSaveUpdates, resetUpdateErrorMessage, peopleSaveDataInLocalStore, peopleClearDataInLocalStore, PeopleSelectorView, PeopleLocalDataView, Person, getPeople, getPeopleLocalData, PeopleState, PersonUpdateType, PeoplePageMode, ZeniPersonUserRoleType, PeopleUIState, PeopleLocalData, initializeEditPerson, };
|