@northern.tech/store 0.12.0 → 0.14.0
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/dist/actions.cjs +21 -16
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.d.cts +7 -22
- package/dist/actions.d.ts +7 -22
- package/dist/actions.js +8 -8
- package/dist/appSlice/index.cjs +1 -0
- package/dist/appSlice/index.cjs.map +1 -1
- package/dist/appSlice/index.d.cts +1 -1
- package/dist/appSlice/index.d.ts +1 -1
- package/dist/appSlice/index.js +1 -1
- package/dist/appSlice/mocks.cjs +1 -0
- package/dist/appSlice/mocks.cjs.map +1 -1
- package/dist/appSlice/mocks.js +1 -1
- package/dist/appSlice/selectors.d.cts +34 -528
- package/dist/appSlice/selectors.d.ts +34 -528
- package/dist/appSlice/thunks.cjs +46 -41
- package/dist/appSlice/thunks.cjs.map +1 -1
- package/dist/appSlice/thunks.d.cts +5 -3
- package/dist/appSlice/thunks.d.ts +5 -3
- package/dist/appSlice/thunks.js +15 -15
- package/dist/{chunk-C5NXNZ7F.js → chunk-2SAH2AN2.js} +23 -30
- package/dist/chunk-2SAH2AN2.js.map +1 -0
- package/dist/{chunk-QOFVCPRW.js → chunk-5PUF4LA5.js} +1 -1
- package/dist/chunk-5PUF4LA5.js.map +1 -0
- package/dist/{chunk-ZRMB4U7Z.js → chunk-5XUPXMYV.js} +4 -4
- package/dist/{chunk-ZNAJKEP2.js → chunk-CQXDAXQF.js} +1 -1
- package/dist/chunk-CQXDAXQF.js.map +1 -0
- package/dist/{chunk-OFGCC3GM.js → chunk-IUGHRJV2.js} +2 -1
- package/dist/chunk-IUGHRJV2.js.map +1 -0
- package/dist/{chunk-WCBHYLUK.js → chunk-KJ4BPXMB.js} +1 -1
- package/dist/chunk-KJ4BPXMB.js.map +1 -0
- package/dist/{chunk-OGUVURJ5.js → chunk-KVZEKHVC.js} +12 -12
- package/dist/{chunk-5ZCZTTYX.js → chunk-LX4YRTYY.js} +5 -5
- package/dist/{chunk-C2LGE3P6.js → chunk-OLKM53RL.js} +1 -1
- package/dist/chunk-OLKM53RL.js.map +1 -0
- package/dist/{chunk-4HSH7RH3.js → chunk-PIFXECFW.js} +10 -10
- package/dist/{chunk-HLX5L3IM.js → chunk-PVCHKW35.js} +1 -1
- package/dist/chunk-PVCHKW35.js.map +1 -0
- package/dist/{chunk-REZWSU22.js → chunk-VODRLEDP.js} +21 -17
- package/dist/chunk-VODRLEDP.js.map +1 -0
- package/dist/{chunk-MH5WPYQI.js → chunk-X7NEALMI.js} +16 -9
- package/dist/chunk-X7NEALMI.js.map +1 -0
- package/dist/{chunk-TKIOEF3B.js → chunk-ZWLCUOQN.js} +6 -6
- package/dist/commonSelectors.cjs +15 -8
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.d.cts +178 -3523
- package/dist/commonSelectors.d.ts +178 -3523
- package/dist/commonSelectors.js +3 -3
- package/dist/deploymentsSlice/index.cjs.map +1 -1
- package/dist/deploymentsSlice/index.d.cts +1 -1
- package/dist/deploymentsSlice/index.d.ts +1 -1
- package/dist/deploymentsSlice/index.js +1 -1
- package/dist/deploymentsSlice/mocks.cjs.map +1 -1
- package/dist/deploymentsSlice/mocks.js +1 -1
- package/dist/deploymentsSlice/selectors.d.cts +16 -138
- package/dist/deploymentsSlice/selectors.d.ts +16 -138
- package/dist/deploymentsSlice/thunks.cjs +46 -41
- package/dist/deploymentsSlice/thunks.cjs.map +1 -1
- package/dist/deploymentsSlice/thunks.d.cts +4 -2
- package/dist/deploymentsSlice/thunks.d.ts +4 -2
- package/dist/deploymentsSlice/thunks.js +15 -15
- package/dist/devicesSlice/index.cjs +20 -16
- package/dist/devicesSlice/index.cjs.map +1 -1
- package/dist/devicesSlice/index.d.cts +11 -20
- package/dist/devicesSlice/index.d.ts +11 -20
- package/dist/devicesSlice/index.js +1 -1
- package/dist/devicesSlice/mocks.cjs +24 -22
- package/dist/devicesSlice/mocks.cjs.map +1 -1
- package/dist/devicesSlice/mocks.d.cts +20 -12
- package/dist/devicesSlice/mocks.d.ts +20 -12
- package/dist/devicesSlice/mocks.js +5 -7
- package/dist/devicesSlice/mocks.js.map +1 -1
- package/dist/devicesSlice/selectors.cjs +15 -8
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +207 -1730
- package/dist/devicesSlice/selectors.d.ts +207 -1730
- package/dist/devicesSlice/selectors.js +1 -1
- package/dist/devicesSlice/thunks.cjs +46 -43
- package/dist/devicesSlice/thunks.cjs.map +1 -1
- package/dist/devicesSlice/thunks.d.cts +12 -46
- package/dist/devicesSlice/thunks.d.ts +12 -46
- package/dist/devicesSlice/thunks.js +15 -17
- package/dist/monitorSlice/index.cjs.map +1 -1
- package/dist/monitorSlice/index.d.cts +1 -1
- package/dist/monitorSlice/index.d.ts +1 -1
- package/dist/monitorSlice/index.js +1 -1
- package/dist/monitorSlice/mocks.cjs.map +1 -1
- package/dist/monitorSlice/mocks.js +1 -1
- package/dist/monitorSlice/thunks.cjs +36 -24
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.d.cts +3 -2
- package/dist/monitorSlice/thunks.d.ts +3 -2
- package/dist/monitorSlice/thunks.js +13 -13
- package/dist/onboardingSlice/index.cjs.map +1 -1
- package/dist/onboardingSlice/index.d.cts +1 -1
- package/dist/onboardingSlice/index.d.ts +1 -1
- package/dist/onboardingSlice/index.js +1 -1
- package/dist/onboardingSlice/mocks.cjs.map +1 -1
- package/dist/onboardingSlice/mocks.js +1 -1
- package/dist/onboardingSlice/thunks.cjs +46 -41
- package/dist/onboardingSlice/thunks.cjs.map +1 -1
- package/dist/onboardingSlice/thunks.d.cts +7 -15
- package/dist/onboardingSlice/thunks.d.ts +7 -15
- package/dist/onboardingSlice/thunks.js +15 -15
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/index.d.cts +41 -31
- package/dist/organizationSlice/index.d.ts +41 -31
- package/dist/organizationSlice/index.js +1 -1
- package/dist/organizationSlice/mocks.cjs.map +1 -1
- package/dist/organizationSlice/mocks.js +1 -1
- package/dist/organizationSlice/selectors.d.cts +42 -659
- package/dist/organizationSlice/selectors.d.ts +42 -659
- package/dist/organizationSlice/thunks.cjs +46 -41
- package/dist/organizationSlice/thunks.cjs.map +1 -1
- package/dist/organizationSlice/thunks.d.cts +4 -1
- package/dist/organizationSlice/thunks.d.ts +4 -1
- package/dist/organizationSlice/thunks.js +15 -15
- package/dist/organizationSlice/types.cjs.map +1 -1
- package/dist/organizationSlice/types.d.cts +2 -12
- package/dist/organizationSlice/types.d.ts +2 -12
- package/dist/releasesSlice/mocks.d.cts +7 -1
- package/dist/releasesSlice/mocks.d.ts +7 -1
- package/dist/releasesSlice/selectors.d.cts +155 -930
- package/dist/releasesSlice/selectors.d.ts +155 -930
- package/dist/releasesSlice/thunks.cjs +36 -24
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.d.cts +4 -2
- package/dist/releasesSlice/thunks.d.ts +4 -2
- package/dist/releasesSlice/thunks.js +13 -13
- package/dist/selectors.cjs +15 -8
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts +6 -3
- package/dist/selectors.d.ts +6 -3
- package/dist/selectors.js +17 -17
- package/dist/store.cjs +21 -16
- package/dist/store.cjs.map +1 -1
- package/dist/store.d.cts +40 -658
- package/dist/store.d.ts +40 -658
- package/dist/store.js +9 -9
- package/dist/storehooks.cjs +47 -41
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.js +16 -15
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +46 -43
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.d.cts +7 -5
- package/dist/thunks.d.ts +7 -5
- package/dist/thunks.js +15 -17
- package/dist/useDeploymentDevice.cjs +46 -41
- package/dist/useDeploymentDevice.cjs.map +1 -1
- package/dist/useDeploymentDevice.js +15 -15
- package/dist/usersSlice/index.cjs.map +1 -1
- package/dist/usersSlice/index.d.cts +46 -46
- package/dist/usersSlice/index.d.ts +46 -46
- package/dist/usersSlice/index.js +1 -1
- package/dist/usersSlice/mocks.cjs.map +1 -1
- package/dist/usersSlice/mocks.js +1 -1
- package/dist/usersSlice/selectors.d.cts +75 -1436
- package/dist/usersSlice/selectors.d.ts +75 -1436
- package/dist/usersSlice/thunks.cjs +46 -41
- package/dist/usersSlice/thunks.cjs.map +1 -1
- package/dist/usersSlice/thunks.d.cts +3 -1
- package/dist/usersSlice/thunks.d.ts +3 -1
- package/dist/usersSlice/thunks.js +15 -15
- package/package.json +7 -7
- package/dist/chunk-C2LGE3P6.js.map +0 -1
- package/dist/chunk-C5NXNZ7F.js.map +0 -1
- package/dist/chunk-HLX5L3IM.js.map +0 -1
- package/dist/chunk-MH5WPYQI.js.map +0 -1
- package/dist/chunk-OFGCC3GM.js.map +0 -1
- package/dist/chunk-QOFVCPRW.js.map +0 -1
- package/dist/chunk-REZWSU22.js.map +0 -1
- package/dist/chunk-WCBHYLUK.js.map +0 -1
- package/dist/chunk-ZNAJKEP2.js.map +0 -1
- /package/dist/{chunk-ZRMB4U7Z.js.map → chunk-5XUPXMYV.js.map} +0 -0
- /package/dist/{chunk-OGUVURJ5.js.map → chunk-KVZEKHVC.js.map} +0 -0
- /package/dist/{chunk-5ZCZTTYX.js.map → chunk-LX4YRTYY.js.map} +0 -0
- /package/dist/{chunk-4HSH7RH3.js.map → chunk-PIFXECFW.js.map} +0 -0
- /package/dist/{chunk-TKIOEF3B.js.map → chunk-ZWLCUOQN.js.map} +0 -0
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ReadState } from '../usersSlice/constants.js';
|
|
3
|
-
import { User, UserSession, CustomColumn, GlobalSettings, UserSettings } from '../usersSlice/index.js';
|
|
1
|
+
import { UserSliceType } from '../usersSlice/index.js';
|
|
4
2
|
import { ReleaseSliceType } from '../releasesSlice/index.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
3
|
+
import { OrganizationSliceType } from '../organizationSlice/index.js';
|
|
4
|
+
import { OnboardingSliceType } from '../onboardingSlice/index.js';
|
|
5
|
+
import { MonitorSliceType } from '../monitorSlice/index.js';
|
|
8
6
|
import { DeviceSliceType } from '../devicesSlice/index.js';
|
|
9
|
-
import {
|
|
7
|
+
import { AppSliceType } from '../appSlice/index.js';
|
|
10
8
|
import * as reselect from 'reselect';
|
|
11
|
-
import { Deployment, DeploymentByStatus, SelectionState,
|
|
9
|
+
import { Deployment, DeploymentByStatus, SelectionState, DeploymentsSliceType } from './index.js';
|
|
12
10
|
import { RootState } from '../store.js';
|
|
13
11
|
import 'redux';
|
|
14
12
|
import '@reduxjs/toolkit';
|
|
15
13
|
import 'immer';
|
|
16
14
|
import '@northern.tech/types/MenderTypes';
|
|
15
|
+
import '@northern.tech/utils/constants';
|
|
17
16
|
import '../commonConstants.js';
|
|
18
17
|
import 'react/jsx-runtime';
|
|
18
|
+
import '../usersSlice/constants.js';
|
|
19
|
+
import '../organizationSlice/types.js';
|
|
19
20
|
import '../appSlice/constants.js';
|
|
20
21
|
import '@mui/material/OverridableComponent';
|
|
21
22
|
import '@mui/material';
|
|
22
23
|
import '../organizationSlice/constants.js';
|
|
24
|
+
import '../monitorSlice/constants.js';
|
|
23
25
|
import '../devicesSlice/constants.js';
|
|
24
26
|
import 'redux-thunk';
|
|
25
27
|
|
|
@@ -71,138 +73,14 @@ declare const getMappedDeploymentSelection: ((state: any, deploymentsState: any)
|
|
|
71
73
|
};
|
|
72
74
|
declare const DEPLOYMENT_CUTOFF = 3;
|
|
73
75
|
declare const getRecentDeployments: ((state: {
|
|
74
|
-
app:
|
|
75
|
-
cancelSource: any;
|
|
76
|
-
commit: string;
|
|
77
|
-
demoArtifactLink: string;
|
|
78
|
-
docsVersion: string;
|
|
79
|
-
features: Record<string, boolean>;
|
|
80
|
-
feedbackProbability: number;
|
|
81
|
-
firstLoginAfterSignup: boolean;
|
|
82
|
-
hostAddress: string | null;
|
|
83
|
-
hostedAnnouncement: string;
|
|
84
|
-
newThreshold: string;
|
|
85
|
-
offlineThreshold: string;
|
|
86
|
-
recaptchaSiteKey: string;
|
|
87
|
-
searchState: SearchState;
|
|
88
|
-
sentry: SentryConfig;
|
|
89
|
-
snackbar: SnackbarContent;
|
|
90
|
-
stripeAPIKey: string;
|
|
91
|
-
trackerCode: string;
|
|
92
|
-
uploadsById: Record<string, Upload>;
|
|
93
|
-
versionInformation: {
|
|
94
|
-
[key: string]: string | {
|
|
95
|
-
releaseDate: string;
|
|
96
|
-
repos: Record<string, string>;
|
|
97
|
-
} | undefined;
|
|
98
|
-
backend?: string;
|
|
99
|
-
GUI?: string;
|
|
100
|
-
latestRelease?: {
|
|
101
|
-
releaseDate: string;
|
|
102
|
-
repos: Record<string, string>;
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
yesterday?: string;
|
|
106
|
-
};
|
|
76
|
+
app: AppSliceType;
|
|
107
77
|
devices: DeviceSliceType;
|
|
108
|
-
deployments:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
deploymentDeviceLimit: number;
|
|
113
|
-
selectedDeviceIds: string[];
|
|
114
|
-
selectionState: SelectionState;
|
|
115
|
-
};
|
|
116
|
-
monitor: {
|
|
117
|
-
alerts: {
|
|
118
|
-
alertList: {
|
|
119
|
-
page: number;
|
|
120
|
-
perPage: number;
|
|
121
|
-
total: number;
|
|
122
|
-
};
|
|
123
|
-
byDeviceId: {
|
|
124
|
-
alerts?: Record<string, _northern_tech_types_types_gen.Alert & {
|
|
125
|
-
fullName?: string;
|
|
126
|
-
}>;
|
|
127
|
-
latest?: Record<string, _northern_tech_types_types_gen.Alert & {
|
|
128
|
-
fullName?: string;
|
|
129
|
-
}>;
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
issueCounts: {
|
|
133
|
-
byType: {
|
|
134
|
-
issues: {
|
|
135
|
-
filtered: number;
|
|
136
|
-
total: number;
|
|
137
|
-
};
|
|
138
|
-
offline: {
|
|
139
|
-
filtered: number;
|
|
140
|
-
total: number;
|
|
141
|
-
};
|
|
142
|
-
failedLastUpdate: {
|
|
143
|
-
filtered: number;
|
|
144
|
-
total: number;
|
|
145
|
-
};
|
|
146
|
-
monitoring: {
|
|
147
|
-
filtered: number;
|
|
148
|
-
total: number;
|
|
149
|
-
};
|
|
150
|
-
authRequests: {
|
|
151
|
-
filtered: number;
|
|
152
|
-
total: number;
|
|
153
|
-
};
|
|
154
|
-
gatewayDevices: {
|
|
155
|
-
filtered: number;
|
|
156
|
-
total: number;
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
};
|
|
160
|
-
settings: {
|
|
161
|
-
global: {
|
|
162
|
-
channels: {
|
|
163
|
-
email: {
|
|
164
|
-
enabled: boolean;
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
onboarding: {
|
|
171
|
-
address?: string;
|
|
172
|
-
approach: OnboardingApproach | null;
|
|
173
|
-
complete: boolean;
|
|
174
|
-
demoArtifactPort: number;
|
|
175
|
-
deviceConnection?: string;
|
|
176
|
-
deviceType: string[] | string | null;
|
|
177
|
-
progress: string | null;
|
|
178
|
-
showTips: boolean | null;
|
|
179
|
-
showTipsDialog: boolean;
|
|
180
|
-
};
|
|
181
|
-
organization: OrganizationState;
|
|
78
|
+
deployments: DeploymentsSliceType;
|
|
79
|
+
monitor: MonitorSliceType;
|
|
80
|
+
onboarding: OnboardingSliceType;
|
|
81
|
+
organization: OrganizationSliceType;
|
|
182
82
|
releases: ReleaseSliceType;
|
|
183
|
-
users:
|
|
184
|
-
activationCode?: string;
|
|
185
|
-
byId: Record<string, User>;
|
|
186
|
-
currentSession?: UserSession | object;
|
|
187
|
-
currentUser: string | null;
|
|
188
|
-
customColumns: CustomColumn[];
|
|
189
|
-
globalSettings: GlobalSettings;
|
|
190
|
-
permissionSetsById: Record<string, _northern_tech_utils_constants.PermissionSet>;
|
|
191
|
-
qrCode: string | null;
|
|
192
|
-
rolesById: Record<string, _northern_tech_utils_constants.Role>;
|
|
193
|
-
rolesInitialized: boolean;
|
|
194
|
-
settingsInitialized: boolean;
|
|
195
|
-
showConnectDeviceDialog: boolean;
|
|
196
|
-
showFeedbackDialog: boolean;
|
|
197
|
-
showStartupNotification: boolean;
|
|
198
|
-
tooltips: {
|
|
199
|
-
byId: Record<string, {
|
|
200
|
-
readState: ReadState;
|
|
201
|
-
}>;
|
|
202
|
-
};
|
|
203
|
-
userSettings: UserSettings;
|
|
204
|
-
userSettingsInitialized: boolean;
|
|
205
|
-
};
|
|
83
|
+
users: UserSliceType;
|
|
206
84
|
}) => {
|
|
207
85
|
total: number;
|
|
208
86
|
}) & {
|
|
@@ -921,6 +921,7 @@ var initialState2 = {
|
|
|
921
921
|
hasDeviceConnect: false,
|
|
922
922
|
hasFeedbackEnabled: false,
|
|
923
923
|
hasMonitor: false,
|
|
924
|
+
hasMCUEnabled: false,
|
|
924
925
|
hasReporting: false,
|
|
925
926
|
isHosted: true,
|
|
926
927
|
isEnterprise: false
|
|
@@ -1043,12 +1044,10 @@ var initialState3 = {
|
|
|
1043
1044
|
// }
|
|
1044
1045
|
},
|
|
1045
1046
|
byStatus: {
|
|
1046
|
-
[import_constants5.DEVICE_STATES.accepted]: { deviceIds: [], total: 0 },
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
[import_constants5.DEVICE_STATES.
|
|
1050
|
-
[import_constants5.DEVICE_STATES.preauth]: { deviceIds: [], total: 0 },
|
|
1051
|
-
[import_constants5.DEVICE_STATES.rejected]: { deviceIds: [], total: 0 }
|
|
1047
|
+
[import_constants5.DEVICE_STATES.accepted]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } },
|
|
1048
|
+
[import_constants5.DEVICE_STATES.pending]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } },
|
|
1049
|
+
[import_constants5.DEVICE_STATES.preauth]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } },
|
|
1050
|
+
[import_constants5.DEVICE_STATES.rejected]: { deviceIds: [], counts: { standard: 0, micro: 0, system: 0, total: 0 } }
|
|
1052
1051
|
},
|
|
1053
1052
|
deviceList: {
|
|
1054
1053
|
deviceIds: [],
|
|
@@ -1178,21 +1177,19 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
|
|
|
1178
1177
|
}
|
|
1179
1178
|
state.filters = action.payload.filter((filter) => filter.key && filter.operator && filter.scope && typeof filter.value !== "undefined");
|
|
1180
1179
|
},
|
|
1181
|
-
setInactiveDevices: (state, action) => {
|
|
1182
|
-
const { activeDeviceTotal, inactiveDeviceTotal } = action.payload;
|
|
1183
|
-
state.byStatus.active.total = activeDeviceTotal;
|
|
1184
|
-
state.byStatus.inactive.total = inactiveDeviceTotal;
|
|
1185
|
-
},
|
|
1186
1180
|
setDeviceReports: (state, action) => {
|
|
1187
1181
|
state.reports = action.payload;
|
|
1188
1182
|
},
|
|
1189
1183
|
setDevicesByStatus: (state, action) => {
|
|
1190
|
-
const {
|
|
1191
|
-
|
|
1184
|
+
const { status, total, deviceIds } = action.payload;
|
|
1185
|
+
if (total) {
|
|
1186
|
+
state.byStatus[status].deviceIds = deviceIds;
|
|
1187
|
+
state.byStatus[status].counts.total = total;
|
|
1188
|
+
}
|
|
1192
1189
|
},
|
|
1193
1190
|
setDevicesCountByStatus: (state, action) => {
|
|
1194
|
-
const {
|
|
1195
|
-
state.byStatus[status].
|
|
1191
|
+
const { countsPerTier, status } = action.payload;
|
|
1192
|
+
state.byStatus[status].counts = { ...countsPerTier, total: Object.values(countsPerTier).reduce((accu, tieredCount) => accu += tieredCount, 0) };
|
|
1196
1193
|
},
|
|
1197
1194
|
setDeviceLimits: (state, action) => {
|
|
1198
1195
|
state.limits = action.payload;
|
|
@@ -1209,7 +1206,15 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
|
|
|
1209
1206
|
const hasMultipleAuthSets = authId && device.auth_sets ? device.auth_sets.filter((authset) => authset.id !== authId).length > 0 : false;
|
|
1210
1207
|
if (!hasMultipleAuthSets && Object.values(import_constants5.DEVICE_STATES).includes(device.status)) {
|
|
1211
1208
|
const deviceIds = state.byStatus[device.status].deviceIds.filter((id) => id !== deviceId);
|
|
1212
|
-
|
|
1209
|
+
const deviceTier = device.attributes.tier || "standard";
|
|
1210
|
+
state.byStatus[device.status] = {
|
|
1211
|
+
deviceIds,
|
|
1212
|
+
counts: {
|
|
1213
|
+
...state.byStatus[device.status].counts,
|
|
1214
|
+
[deviceTier]: Math.max(0, state.byStatus[device.status].counts[deviceTier] - 1),
|
|
1215
|
+
total: Math.max(0, state.byStatus[device.status].counts.total - 1)
|
|
1216
|
+
}
|
|
1217
|
+
};
|
|
1213
1218
|
}
|
|
1214
1219
|
}
|
|
1215
1220
|
}
|
|
@@ -1876,15 +1881,22 @@ var getDeviceIdentityAttributes = (0, import_toolkit11.createSelector)(
|
|
|
1876
1881
|
);
|
|
1877
1882
|
var getDeviceCountsByStatus = (0, import_toolkit11.createSelector)(
|
|
1878
1883
|
[getDevicesByStatus],
|
|
1879
|
-
(byStatus) => Object.values(import_constants5.DEVICE_STATES).reduce(
|
|
1880
|
-
accu
|
|
1881
|
-
|
|
1882
|
-
|
|
1884
|
+
(byStatus) => Object.values(import_constants5.DEVICE_STATES).reduce(
|
|
1885
|
+
(accu, deviceState) => {
|
|
1886
|
+
const { counts } = byStatus[deviceState];
|
|
1887
|
+
const { total, ...tieredCounts } = counts;
|
|
1888
|
+
const count = Object.values(tieredCounts).reduce((accu2, countPerTier) => accu2 + countPerTier, 0);
|
|
1889
|
+
accu[deviceState] = count;
|
|
1890
|
+
accu.total = accu.total + count;
|
|
1891
|
+
return accu;
|
|
1892
|
+
},
|
|
1893
|
+
{ total: 0 }
|
|
1894
|
+
)
|
|
1883
1895
|
);
|
|
1884
1896
|
var getDeviceById = (0, import_toolkit11.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => devicesById[deviceId] ?? {});
|
|
1885
1897
|
var getSelectedGroupInfo = (0, import_toolkit11.createSelector)(
|
|
1886
|
-
[
|
|
1887
|
-
({
|
|
1898
|
+
[getDeviceCountsByStatus, getGroupsById, getSelectedGroup],
|
|
1899
|
+
({ accepted: acceptedDeviceTotal }, groupsById, selectedGroup) => {
|
|
1888
1900
|
let groupCount = acceptedDeviceTotal;
|
|
1889
1901
|
let groupFilters = [];
|
|
1890
1902
|
if (selectedGroup && groupsById[selectedGroup]) {
|
|
@@ -1900,8 +1912,8 @@ var getCombinedLimit = (0, import_toolkit11.createSelector)(
|
|
|
1900
1912
|
// limit might be -1 for unlimited devices
|
|
1901
1913
|
);
|
|
1902
1914
|
var getLimitMaxed = (0, import_toolkit11.createSelector)(
|
|
1903
|
-
[
|
|
1904
|
-
({
|
|
1915
|
+
[getDeviceCountsByStatus, getCombinedLimit],
|
|
1916
|
+
({ accepted: acceptedDevices }, combinedLimit) => !!combinedLimit && combinedLimit <= acceptedDevices
|
|
1905
1917
|
);
|
|
1906
1918
|
var getGroupsByIdWithoutUngrouped = (0, import_toolkit11.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
|
|
1907
1919
|
var getGroupData = (0, import_toolkit11.createSelector)([getGroupsByIdWithoutUngrouped], (groups) => {
|
|
@@ -2960,21 +2972,13 @@ var getDeviceInfo = createAppAsyncThunk(`${sliceName3}/getDeviceInfo`, (deviceId
|
|
|
2960
2972
|
}
|
|
2961
2973
|
return Promise.all(tasks);
|
|
2962
2974
|
});
|
|
2963
|
-
var getDeviceCount = createAppAsyncThunk(
|
|
2964
|
-
`${sliceName3}/getDeviceCount`,
|
|
2965
|
-
(status, { dispatch, getState }) => general_api_default.post(getSearchEndpoint(getState()), {
|
|
2966
|
-
page: 1,
|
|
2967
|
-
per_page: 1,
|
|
2968
|
-
filters: mapFiltersToTerms([{ key: "status", value: status, operator: import_constants5.DEVICE_FILTERING_OPTIONS.$eq.key, scope: "identity" }]),
|
|
2969
|
-
attributes: defaultAttributes
|
|
2970
|
-
}).then((response) => {
|
|
2971
|
-
const count = Number(response.headers[import_constants5.headerNames.total]);
|
|
2972
|
-
return dispatch(actions3.setDevicesCountByStatus({ count, status }));
|
|
2973
|
-
})
|
|
2974
|
-
);
|
|
2975
2975
|
var getAllDeviceCounts = createAppAsyncThunk(
|
|
2976
2976
|
`${sliceName3}/getAllDeviceCounts`,
|
|
2977
|
-
(_, { dispatch }) =>
|
|
2977
|
+
(_, { dispatch }) => general_api_default.get(`${import_constants5.inventoryApiUrlV2}/statistics`).then(({ data }) => {
|
|
2978
|
+
const { devices_by_status } = data;
|
|
2979
|
+
Object.entries(devices_by_status).map(([status, countsPerTier]) => dispatch(actions3.setDevicesCountByStatus({ countsPerTier, status })));
|
|
2980
|
+
return;
|
|
2981
|
+
})
|
|
2978
2982
|
);
|
|
2979
2983
|
var getDeviceLimits2 = createAppAsyncThunk(
|
|
2980
2984
|
`${sliceName3}/getDeviceLimit`,
|
|
@@ -3046,7 +3050,7 @@ var getDevicesByStatus2 = createAppAsyncThunk(
|
|
|
3046
3050
|
const state2 = getState();
|
|
3047
3051
|
const deviceAccu = reduceReceivedDevices(response.data, [], state2, status);
|
|
3048
3052
|
let total = !applicableFilters.length ? Number(response.headers[import_constants5.headerNames.total]) : 0;
|
|
3049
|
-
if (status && state2.devices.byStatus[status].total === deviceAccu.ids.length) {
|
|
3053
|
+
if (status && state2.devices.byStatus[status].counts.total === deviceAccu.ids.length) {
|
|
3050
3054
|
total = deviceAccu.ids.length;
|
|
3051
3055
|
}
|
|
3052
3056
|
const tasks = [dispatch(actions3.receivedDevices(deviceAccu.devicesById))];
|
|
@@ -3153,8 +3157,8 @@ var updateReportData = createAppAsyncThunk(`${sliceName3}/updateReportData`, (re
|
|
|
3153
3157
|
const { group = "" } = report;
|
|
3154
3158
|
const devicesById = getDevicesById(getState());
|
|
3155
3159
|
const groups = getGroupsById(getState());
|
|
3156
|
-
const
|
|
3157
|
-
const totalDeviceCount = groups[group] ? groups[group].total :
|
|
3160
|
+
const { accepted: acceptedDevicesCount } = getDeviceCountsByStatus(getState());
|
|
3161
|
+
const totalDeviceCount = groups[group] ? groups[group].total : acceptedDevicesCount;
|
|
3158
3162
|
const reportsData = getDeviceReports(getState());
|
|
3159
3163
|
const newReports = [...reportsData];
|
|
3160
3164
|
newReports[reportIndex] = initializeDistributionData(report, groups, devicesById, totalDeviceCount);
|
|
@@ -3172,6 +3176,7 @@ var getReportDataWithoutBackendSupport = createAppAsyncThunk(
|
|
|
3172
3176
|
const effectiveAttribute = software ? software : attribute;
|
|
3173
3177
|
const devicesById = getDevicesById(getState());
|
|
3174
3178
|
const acceptedDevices = getAcceptedDevices(getState());
|
|
3179
|
+
const { accepted: acceptedDevicesCount } = getDeviceCountsByStatus(getState());
|
|
3175
3180
|
const groups = getGroupsById(getState());
|
|
3176
3181
|
const { deviceIds = [], filters = [], total = 0 } = groups[group] || {};
|
|
3177
3182
|
let groupDevicesRequest = Promise.resolve({
|
|
@@ -3179,7 +3184,7 @@ var getReportDataWithoutBackendSupport = createAppAsyncThunk(
|
|
|
3179
3184
|
});
|
|
3180
3185
|
if (group && (!(deviceIds.length && total) || deviceIds.length !== total || !deviceIds.every((id) => !!devicesById[id]))) {
|
|
3181
3186
|
groupDevicesRequest = filters.length ? dispatch(getAllDynamicGroupDevices({ group, attribute: effectiveAttribute })).unwrap() : dispatch(getAllGroupDevices({ group, attribute: effectiveAttribute })).unwrap();
|
|
3182
|
-
} else if (!group && (acceptedDevices.deviceIds.length !==
|
|
3187
|
+
} else if (!group && (acceptedDevices.deviceIds.length !== acceptedDevicesCount || !acceptedDevices.deviceIds.every((id) => !!devicesById[id]))) {
|
|
3183
3188
|
groupDevicesRequest = dispatch(getAllDevicesByStatus({ status: import_constants5.DEVICE_STATES.accepted, attribute: effectiveAttribute })).unwrap();
|
|
3184
3189
|
}
|
|
3185
3190
|
return groupDevicesRequest.then(() => dispatch(updateReportData(reportIndex)));
|