@zeniai/client-epic-state 5.0.85-betaJK1 → 5.0.85-betaJK2
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createSelector } from '@reduxjs/toolkit';
|
|
2
|
-
import { getCompanyByCompanyId } from '../../entity/company/companySelector';
|
|
2
|
+
import { getCompanyByCompanyId, getCompanyByCompanyIds, } from '../../entity/company/companySelector';
|
|
3
3
|
import { getTagsByIds } from '../../entity/tag/tagSelector';
|
|
4
4
|
import { getTaskById } from '../../entity/task/taskSelector';
|
|
5
5
|
import { getUserByUserId, getUsersByUserIds, } from '../../entity/user/userSelector';
|
|
6
|
-
export const getCompanyTaskManagerView = createSelector((state) => state.companyTaskManagerViewState, (state) => state.companyState, (state) => state.userState, (state) => state.taskState, (state) => state.tagState, (companyTaskManagerViewState, companyState, userState, taskState, tagState) => {
|
|
6
|
+
export const getCompanyTaskManagerView = createSelector((state) => state.companyTaskManagerViewState, (state) => state.companyState, (state) => state.userState, (state) => state.taskState, (state) => state.tagState, (state) => state.companyViewState, (companyTaskManagerViewState, companyState, userState, taskState, tagState, companyViewState) => {
|
|
7
7
|
const { taskIds, uiState, fetchState, error, totalTaskCount, metrics, metricsFetchState, } = companyTaskManagerViewState;
|
|
8
8
|
const tasksList = [];
|
|
9
9
|
taskIds.forEach((taskId) => {
|
|
@@ -26,7 +26,16 @@ export const getCompanyTaskManagerView = createSelector((state) => state.company
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
+
const allCompanyIds = [
|
|
30
|
+
...new Set([
|
|
31
|
+
...companyViewState.managementView.companyIds,
|
|
32
|
+
...companyViewState.portfolioView.companyIds,
|
|
33
|
+
]),
|
|
34
|
+
];
|
|
35
|
+
const companies = getCompanyByCompanyIds(companyState, allCompanyIds).map((c) => c.company);
|
|
36
|
+
const users = Object.values(userState.userByUserId);
|
|
29
37
|
return {
|
|
38
|
+
companies,
|
|
30
39
|
metrics,
|
|
31
40
|
metricsFetchState,
|
|
32
41
|
tasksList,
|
|
@@ -34,5 +43,6 @@ export const getCompanyTaskManagerView = createSelector((state) => state.company
|
|
|
34
43
|
fetchState,
|
|
35
44
|
error,
|
|
36
45
|
totalTaskCount,
|
|
46
|
+
users,
|
|
37
47
|
};
|
|
38
48
|
});
|
|
@@ -14,10 +14,12 @@ export interface TaskWithCompanyDetail {
|
|
|
14
14
|
task: Task;
|
|
15
15
|
}
|
|
16
16
|
export interface CompanyTaskManagerSelectorView extends SelectorView {
|
|
17
|
+
companies: Company[];
|
|
17
18
|
metrics: TaskManagerMetrics;
|
|
18
19
|
metricsFetchState: FetchState;
|
|
19
20
|
tasksList: TaskWithCompanyDetail[];
|
|
20
21
|
totalTaskCount: number;
|
|
21
22
|
uiState: CompanyTaskManagerViewUIState;
|
|
23
|
+
users: User[];
|
|
22
24
|
}
|
|
23
25
|
export declare const getCompanyTaskManagerView: (state: RootState) => CompanyTaskManagerSelectorView;
|
|
@@ -6,7 +6,7 @@ const companySelector_1 = require("../../entity/company/companySelector");
|
|
|
6
6
|
const tagSelector_1 = require("../../entity/tag/tagSelector");
|
|
7
7
|
const taskSelector_1 = require("../../entity/task/taskSelector");
|
|
8
8
|
const userSelector_1 = require("../../entity/user/userSelector");
|
|
9
|
-
exports.getCompanyTaskManagerView = (0, toolkit_1.createSelector)((state) => state.companyTaskManagerViewState, (state) => state.companyState, (state) => state.userState, (state) => state.taskState, (state) => state.tagState, (companyTaskManagerViewState, companyState, userState, taskState, tagState) => {
|
|
9
|
+
exports.getCompanyTaskManagerView = (0, toolkit_1.createSelector)((state) => state.companyTaskManagerViewState, (state) => state.companyState, (state) => state.userState, (state) => state.taskState, (state) => state.tagState, (state) => state.companyViewState, (companyTaskManagerViewState, companyState, userState, taskState, tagState, companyViewState) => {
|
|
10
10
|
const { taskIds, uiState, fetchState, error, totalTaskCount, metrics, metricsFetchState, } = companyTaskManagerViewState;
|
|
11
11
|
const tasksList = [];
|
|
12
12
|
taskIds.forEach((taskId) => {
|
|
@@ -29,7 +29,16 @@ exports.getCompanyTaskManagerView = (0, toolkit_1.createSelector)((state) => sta
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
+
const allCompanyIds = [
|
|
33
|
+
...new Set([
|
|
34
|
+
...companyViewState.managementView.companyIds,
|
|
35
|
+
...companyViewState.portfolioView.companyIds,
|
|
36
|
+
]),
|
|
37
|
+
];
|
|
38
|
+
const companies = (0, companySelector_1.getCompanyByCompanyIds)(companyState, allCompanyIds).map((c) => c.company);
|
|
39
|
+
const users = Object.values(userState.userByUserId);
|
|
32
40
|
return {
|
|
41
|
+
companies,
|
|
33
42
|
metrics,
|
|
34
43
|
metricsFetchState,
|
|
35
44
|
tasksList,
|
|
@@ -37,5 +46,6 @@ exports.getCompanyTaskManagerView = (0, toolkit_1.createSelector)((state) => sta
|
|
|
37
46
|
fetchState,
|
|
38
47
|
error,
|
|
39
48
|
totalTaskCount,
|
|
49
|
+
users,
|
|
40
50
|
};
|
|
41
51
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.0.85-
|
|
3
|
+
"version": "5.0.85-betaJK2",
|
|
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",
|