@northern.tech/store 0.46.5 → 0.48.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.d.cts +6 -6
- package/dist/actions.d.ts +6 -6
- package/dist/api/general-api.cjs +2 -2
- package/dist/api/general-api.cjs.map +1 -1
- package/dist/api/general-api.js +1 -1
- package/dist/api/general-api.js.map +1 -1
- package/dist/appSlice/constants.cjs +3 -4
- package/dist/appSlice/constants.cjs.map +1 -1
- package/dist/appSlice/constants.d.cts +1 -1
- package/dist/appSlice/constants.d.ts +1 -1
- package/dist/appSlice/constants.js +1 -2
- package/dist/appSlice/constants.js.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.d.cts +1 -1
- package/dist/appSlice/mocks.d.ts +1 -1
- package/dist/appSlice/selectors.cjs.map +1 -1
- package/dist/appSlice/selectors.d.cts +2 -130
- package/dist/appSlice/selectors.d.ts +2 -130
- package/dist/appSlice/selectors.js.map +1 -1
- package/dist/appSlice/thunks.d.cts +2 -2
- package/dist/appSlice/thunks.d.ts +2 -2
- package/dist/auth.cjs +3 -3
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +2 -1
- package/dist/auth.js.map +1 -1
- package/dist/commonConstants.cjs +4 -3
- package/dist/commonConstants.d.cts +2 -2
- package/dist/commonConstants.d.ts +2 -2
- package/dist/commonConstants.js +1 -1
- package/dist/commonSelectors.cjs +1 -1
- package/dist/commonSelectors.d.cts +80 -373
- package/dist/commonSelectors.d.ts +80 -373
- package/dist/commonSelectors.js +1 -1
- package/dist/constants-3gsHyxWr.d.ts +109 -0
- package/dist/{constants-B3NH1IQi.d.ts → constants-DOnQ-UzD.d.cts} +2 -3
- package/dist/{constants-B3NH1IQi.d.cts → constants-DOnQ-UzD.d.ts} +2 -3
- package/dist/{constants-MVizYy89.cjs → constants-DsOnY5o5.cjs} +1 -279
- package/dist/constants-DsOnY5o5.cjs.map +1 -0
- package/dist/constants-hMMMdt0R.d.cts +109 -0
- package/dist/{constants-nKSWZ8oD.d.ts → constants-tC3RR_Oo.d.cts} +2 -3
- package/dist/{constants-nKSWZ8oD.d.cts → constants-tC3RR_Oo.d.ts} +2 -3
- package/dist/{constants-D5hACLhF.js → constants-yul-O5hD.js} +3 -269
- package/dist/constants-yul-O5hD.js.map +1 -0
- package/dist/constants.cjs +6 -6
- package/dist/constants.d.cts +4 -4
- package/dist/constants.d.ts +4 -4
- package/dist/constants.js +2 -2
- package/dist/deploymentsSlice/constants.cjs +1 -1
- package/dist/deploymentsSlice/constants.js +1 -1
- package/dist/deploymentsSlice/index.cjs +1 -1
- package/dist/deploymentsSlice/index.js +1 -1
- package/dist/deploymentsSlice/selectors.cjs +1 -1
- package/dist/deploymentsSlice/selectors.cjs.map +1 -1
- package/dist/deploymentsSlice/selectors.d.cts +2 -97
- package/dist/deploymentsSlice/selectors.d.ts +2 -97
- package/dist/deploymentsSlice/selectors.js +1 -1
- package/dist/deploymentsSlice/selectors.js.map +1 -1
- package/dist/deploymentsSlice/thunks.d.cts +13 -13
- package/dist/deploymentsSlice/thunks.d.ts +13 -13
- package/dist/devicesSlice/constants.cjs +1 -1
- package/dist/devicesSlice/constants.d.cts +1 -1
- package/dist/devicesSlice/constants.d.ts +1 -1
- package/dist/devicesSlice/constants.js +1 -1
- package/dist/devicesSlice/index.d.cts +1 -1
- package/dist/devicesSlice/index.d.ts +1 -1
- package/dist/devicesSlice/index.js +1 -1
- package/dist/devicesSlice/mocks.js +1 -1
- package/dist/devicesSlice/selectors.cjs +1 -1
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.d.cts +2 -887
- package/dist/devicesSlice/selectors.d.ts +2 -887
- package/dist/devicesSlice/selectors.js +1 -1
- package/dist/devicesSlice/selectors.js.map +1 -1
- package/dist/devicesSlice/thunks.d.cts +4 -4
- package/dist/devicesSlice/thunks.d.ts +4 -4
- package/dist/{index-fGVC5s1C.d.cts → index-B9jUHGsM.d.cts} +2 -2
- package/dist/{index-xxqlerg5.d.ts → index-BMi8ZqpV.d.ts} +2 -2
- package/dist/{index-BKU1G9-x.d.cts → index-BoZjwQHk.d.cts} +2 -2
- package/dist/{index-BfmRpbiJ.d.cts → index-C-6WkMAo.d.cts} +2 -2
- package/dist/{index-CRqnH_go.d.ts → index-CD39K38q.d.ts} +2 -2
- package/dist/{index-KxRmyFLr.d.cts → index-D8O1HJ8Q.d.cts} +2 -2
- package/dist/{index-BMsafOyJ.d.ts → index-DXfbW2gi.d.ts} +2 -2
- package/dist/{index-HjOSTTGF.d.cts → index-Dd_guNwA.d.cts} +2 -2
- package/dist/{index-CqhXqGLt.d.cts → index-DlTiYWBe.d.cts} +2 -2
- package/dist/{index-BVNS-Aut.d.ts → index-I82Wu-Ah.d.ts} +2 -2
- package/dist/{index--SKVGToc.d.ts → index-KQNyWRoG.d.ts} +2 -2
- package/dist/{index-D9GJhX1I.d.ts → index-uhmZ9qaP.d.ts} +2 -2
- package/dist/locationutils.cjs +1 -1
- package/dist/locationutils.d.cts +2 -2
- package/dist/locationutils.d.ts +2 -2
- package/dist/locationutils.js +1 -1
- package/dist/mockState.cjs +24 -0
- package/dist/mockState.cjs.map +1 -0
- package/dist/mockState.d.cts +7 -0
- package/dist/mockState.d.ts +7 -0
- package/dist/mockState.js +23 -0
- package/dist/mockState.js.map +1 -0
- package/dist/monitorSlice/constants.d.cts +1 -1
- package/dist/monitorSlice/constants.d.ts +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.d.cts +1 -1
- package/dist/monitorSlice/mocks.d.ts +1 -1
- package/dist/monitorSlice/mocks.js +1 -1
- package/dist/monitorSlice/selectors.cjs.map +1 -1
- package/dist/monitorSlice/selectors.d.cts +2 -10
- package/dist/monitorSlice/selectors.d.ts +2 -10
- package/dist/monitorSlice/selectors.js.map +1 -1
- package/dist/monitorSlice/thunks.cjs +2 -3
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.d.cts +4 -4
- package/dist/monitorSlice/thunks.d.ts +4 -4
- package/dist/monitorSlice/thunks.js +3 -2
- package/dist/monitorSlice/thunks.js.map +1 -1
- package/dist/onboardingSlice/selectors.cjs.map +1 -1
- package/dist/onboardingSlice/selectors.d.cts +2 -6
- package/dist/onboardingSlice/selectors.d.ts +2 -6
- package/dist/onboardingSlice/selectors.js.map +1 -1
- package/dist/onboardingSlice/thunks.d.cts +3 -3
- package/dist/onboardingSlice/thunks.d.ts +3 -3
- package/dist/organizationSlice/constants.cjs +1 -1
- package/dist/organizationSlice/constants.js +1 -1
- package/dist/organizationSlice/index.cjs +1 -1
- package/dist/organizationSlice/index.d.cts +1 -1
- package/dist/organizationSlice/index.d.ts +1 -1
- package/dist/organizationSlice/index.js +1 -1
- package/dist/organizationSlice/mocks.d.cts +3 -3
- package/dist/organizationSlice/mocks.d.ts +3 -3
- package/dist/organizationSlice/mocks.js +1 -1
- package/dist/organizationSlice/selectors.cjs +1 -1
- package/dist/organizationSlice/selectors.cjs.map +1 -1
- package/dist/organizationSlice/selectors.d.cts +2 -472
- package/dist/organizationSlice/selectors.d.ts +2 -472
- package/dist/organizationSlice/selectors.js +1 -1
- package/dist/organizationSlice/selectors.js.map +1 -1
- package/dist/organizationSlice/thunks.d.cts +25 -21
- package/dist/organizationSlice/thunks.d.ts +25 -21
- package/dist/organizationSlice/types.d.cts +1 -1
- package/dist/organizationSlice/types.d.ts +1 -1
- package/dist/releasesSlice/constants.cjs +0 -2
- package/dist/releasesSlice/constants.cjs.map +1 -1
- package/dist/releasesSlice/constants.d.cts +2 -2
- package/dist/releasesSlice/constants.d.ts +2 -2
- package/dist/releasesSlice/constants.js +1 -2
- package/dist/releasesSlice/constants.js.map +1 -1
- package/dist/releasesSlice/index.d.cts +1 -1
- package/dist/releasesSlice/index.d.ts +1 -1
- package/dist/releasesSlice/index.js +1 -1
- package/dist/releasesSlice/mocks.js +1 -1
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.d.cts +2 -795
- package/dist/releasesSlice/selectors.d.ts +2 -795
- package/dist/releasesSlice/selectors.js.map +1 -1
- package/dist/releasesSlice/thunks.cjs +18 -18
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.d.cts +4 -4
- package/dist/releasesSlice/thunks.d.ts +4 -4
- package/dist/releasesSlice/thunks.js +3 -2
- package/dist/releasesSlice/thunks.js.map +1 -1
- package/dist/selectors-CH-yXu-7.d.cts +84 -0
- package/dist/selectors-CQYkG1VI.d.cts +9 -0
- package/dist/selectors-CR0q7rXC.d.cts +593 -0
- package/dist/selectors-CdCZGn7e.d.cts +99 -0
- package/dist/selectors-CdllyZyW.d.cts +363 -0
- package/dist/selectors-CftbLtXH.d.cts +14 -0
- package/dist/selectors-D2j3_Mnp.d.ts +363 -0
- package/dist/selectors-D78O3T1o.d.ts +99 -0
- package/dist/selectors-D9t4It2i.d.ts +84 -0
- package/dist/selectors-D_UFk4Uz.d.ts +14 -0
- package/dist/selectors-DuHGqmMJ.d.cts +712 -0
- package/dist/selectors-SvKXGJM5.d.ts +712 -0
- package/dist/selectors-eYLuQW4M.d.ts +593 -0
- package/dist/selectors-elCimAHX.d.ts +9 -0
- package/dist/selectors-qClZ9EXM.d.ts +374 -0
- package/dist/selectors-rto0SO4z.d.cts +374 -0
- package/dist/selectors.d.cts +9 -9
- package/dist/selectors.d.ts +9 -9
- package/dist/sockethook.cjs +4 -4
- package/dist/sockethook.cjs.map +1 -1
- package/dist/sockethook.js +2 -1
- package/dist/sockethook.js.map +1 -1
- package/dist/{store-DLp6ajT8.d.ts → store-BQcycBPp.d.ts} +15 -34
- package/dist/{store-Dw8Uo_Df.d.cts → store-CrLzRDCx.d.cts} +14 -33
- package/dist/store.cjs +2 -4
- package/dist/store.cjs.map +1 -1
- package/dist/store.d.cts +2 -2
- package/dist/store.d.ts +2 -2
- package/dist/store.js +2 -4
- package/dist/store.js.map +1 -1
- package/dist/thunks.cjs +39 -43
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.js +19 -22
- package/dist/thunks.js.map +1 -1
- package/dist/{types-DY0J79yF.d.ts → types-DB1IOQX8.d.ts} +3 -3
- package/dist/{types-B67YW1jV.d.cts → types-DtTmD7Yn.d.cts} +3 -3
- package/dist/usersSlice/constants.cjs +1 -1
- package/dist/usersSlice/constants.js +1 -1
- package/dist/usersSlice/index.cjs +1 -1
- package/dist/usersSlice/index.d.cts +1 -1
- package/dist/usersSlice/index.d.ts +1 -1
- package/dist/usersSlice/index.js +1 -1
- package/dist/usersSlice/mocks.d.cts +1 -1
- package/dist/usersSlice/mocks.d.ts +1 -1
- package/dist/usersSlice/mocks.js +1 -1
- package/dist/usersSlice/selectors.cjs +3 -3
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.d.cts +2 -466
- package/dist/usersSlice/selectors.d.ts +2 -466
- package/dist/usersSlice/selectors.js +2 -2
- package/dist/usersSlice/selectors.js.map +1 -1
- package/dist/usersSlice/thunks.d.cts +88 -88
- package/dist/usersSlice/thunks.d.ts +88 -88
- package/dist/utils.cjs +5 -8
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +4 -6
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/constants-BJuY-ODE.d.ts +0 -124
- package/dist/constants-C2O55iZu.d.cts +0 -124
- package/dist/constants-D5hACLhF.js.map +0 -1
- package/dist/constants-MVizYy89.cjs.map +0 -1
- package/dist/storehooks.cjs +0 -249
- package/dist/storehooks.cjs.map +0 -1
- package/dist/storehooks.d.cts +0 -49
- package/dist/storehooks.d.ts +0 -49
- package/dist/storehooks.js +0 -241
- package/dist/storehooks.js.map +0 -1
package/dist/storehooks.js
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { locations } from "./appSlice/constants.js";
|
|
2
|
-
import { Pt as TIMEOUTS, Vt as timeUnits, _t as DEPLOYMENT_STATES, u as DEVICE_STATES } from "./constants-D5hACLhF.js";
|
|
3
|
-
import actions_default from "./actions.js";
|
|
4
|
-
import { getSessionInfo } from "./auth.js";
|
|
5
|
-
import { getFeatures } from "./appSlice/selectors.js";
|
|
6
|
-
import { getDevicesByStatus, getSortedFilteringAttributes } from "./devicesSlice/selectors.js";
|
|
7
|
-
import { getIsServiceProvider } from "./organizationSlice/selectors.js";
|
|
8
|
-
import { stringToBoolean } from "./utils.js";
|
|
9
|
-
import { getGlobalSettings, getOfflineThresholdSettings, getUserSettings } from "./usersSlice/selectors.js";
|
|
10
|
-
import { getOnboardingState, getUserCapabilities } from "./commonSelectors.js";
|
|
11
|
-
import { createAppAsyncThunk, useAppDispatch, useAppSelector } from "./store.js";
|
|
12
|
-
import { getReleases } from "./releasesSlice/thunks.js";
|
|
13
|
-
import { getAllDeviceCounts, getDeploymentsByStatus, getDeviceAttributes, getDeviceById, getDeviceLimits, getDevicesByStatus as getDevicesByStatus$1, getDynamicGroups, getGlobalSettings as getGlobalSettings$1, getGroups, getIntegrations, getOnboardingState as getOnboardingState$1, getRoles, getUserOrganization, getUserSettings as getUserSettings$1, saveGlobalSettings, saveUserSettings } from "./thunks.js";
|
|
14
|
-
import { extractErrorMessage } from "@northern.tech/utils/helpers";
|
|
15
|
-
import Cookies from "universal-cookie";
|
|
16
|
-
import dayjs from "dayjs";
|
|
17
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
18
|
-
import durationDayJs from "dayjs/plugin/duration.js";
|
|
19
|
-
//#region src/storehooks.ts
|
|
20
|
-
const cookies = new Cookies();
|
|
21
|
-
dayjs.extend(durationDayJs);
|
|
22
|
-
const { setDeviceListState, setFirstLoginAfterSignup, setTooltipsState, setShowStartupNotification } = actions_default;
|
|
23
|
-
const hostedDomains = Object.values(locations).map(({ location }) => location);
|
|
24
|
-
const isPreviewDeployment = (hostname) => /^[^.]+-pr-\d+\./.test(hostname);
|
|
25
|
-
const isHostedHostname = (hostname) => !isPreviewDeployment(hostname) && hostedDomains.some((domain) => hostname === domain || hostname.endsWith(`.${domain}`));
|
|
26
|
-
const featureFlags = [
|
|
27
|
-
"hasAiEnabled",
|
|
28
|
-
"hasAuditlogs",
|
|
29
|
-
"hasMultitenancy",
|
|
30
|
-
"hasDeltaProgress",
|
|
31
|
-
"hasDeviceConfig",
|
|
32
|
-
"hasDeviceConnect",
|
|
33
|
-
"hasDeviceFlags",
|
|
34
|
-
"hasFeedbackEnabled",
|
|
35
|
-
"hasManifestsEnabled",
|
|
36
|
-
"hasMonitor",
|
|
37
|
-
"hasMCUEnabled",
|
|
38
|
-
"hasNewSearch",
|
|
39
|
-
"isEnterprise"
|
|
40
|
-
];
|
|
41
|
-
const environmentDatas = [
|
|
42
|
-
"commit",
|
|
43
|
-
"feedbackProbability",
|
|
44
|
-
"hostAddress",
|
|
45
|
-
"hostedAnnouncement",
|
|
46
|
-
"recaptchaSiteKey",
|
|
47
|
-
"sentry",
|
|
48
|
-
"stripeAPIKey",
|
|
49
|
-
"trackerCode"
|
|
50
|
-
];
|
|
51
|
-
const parseEnvironmentInfo = createAppAsyncThunk(`app/parseEnvironmentInfo`, (_, { dispatch, getState }) => {
|
|
52
|
-
const state = getState();
|
|
53
|
-
let onboardingComplete = getOnboardingState(state).complete || !!JSON.parse(window.localStorage.getItem("onboardingComplete") ?? "false");
|
|
54
|
-
let demoArtifactPort = 85;
|
|
55
|
-
let environmentData = {};
|
|
56
|
-
let environmentFeatures = {};
|
|
57
|
-
let versionInfo = {};
|
|
58
|
-
const mender_environment = window.mender_environment;
|
|
59
|
-
if (mender_environment) {
|
|
60
|
-
const { features = {}, demoArtifactPort: port, disableOnboarding, version } = mender_environment;
|
|
61
|
-
demoArtifactPort = Number(port) || demoArtifactPort;
|
|
62
|
-
const appState = state.app;
|
|
63
|
-
environmentData = environmentDatas.reduce((accu, flag) => ({
|
|
64
|
-
...accu,
|
|
65
|
-
[flag]: mender_environment[flag] || appState[flag]
|
|
66
|
-
}), {});
|
|
67
|
-
environmentFeatures = {
|
|
68
|
-
...featureFlags.reduce((accu, flag) => ({
|
|
69
|
-
...accu,
|
|
70
|
-
[flag]: stringToBoolean(features[flag])
|
|
71
|
-
}), {}),
|
|
72
|
-
isHosted: stringToBoolean(features.isHosted) || isHostedHostname(window.location.hostname)
|
|
73
|
-
};
|
|
74
|
-
onboardingComplete = !environmentFeatures.isHosted || stringToBoolean(disableOnboarding) || onboardingComplete;
|
|
75
|
-
versionInfo = {
|
|
76
|
-
docsVersion: isNaN(parseInt(version.charAt(0))) ? "" : version.split(".").slice(0, 2).join("."),
|
|
77
|
-
version
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
return Promise.all([
|
|
81
|
-
dispatch(actions_default.successfullyLoggedIn(getSessionInfo())),
|
|
82
|
-
dispatch(actions_default.setOnboardingComplete(onboardingComplete)),
|
|
83
|
-
dispatch(actions_default.setDemoArtifactPort(demoArtifactPort)),
|
|
84
|
-
dispatch(actions_default.setFeatures(environmentFeatures)),
|
|
85
|
-
dispatch(actions_default.setVersionInformation(versionInfo)),
|
|
86
|
-
dispatch(actions_default.setEnvironmentData(environmentData))
|
|
87
|
-
]);
|
|
88
|
-
});
|
|
89
|
-
const probeOrganizationCapabilities = createAppAsyncThunk(`app/probeOrganizationCapabilities`, (_, { dispatch, getState }) => dispatch(getUserOrganization()).unwrap().then(() => {
|
|
90
|
-
if (!getFeatures(getState()).isHosted) dispatch(actions_default.setFeatures({
|
|
91
|
-
hasMultitenancy: true,
|
|
92
|
-
isEnterprise: true
|
|
93
|
-
}));
|
|
94
|
-
}).catch(() => {
|
|
95
|
-
if (!getFeatures(getState()).isHosted) dispatch(actions_default.setFeatures({
|
|
96
|
-
hasMultitenancy: false,
|
|
97
|
-
isEnterprise: false
|
|
98
|
-
}));
|
|
99
|
-
}));
|
|
100
|
-
const maybeAddOnboardingTasks = ({ devicesByStatus, dispatch, onboardingState, tasks }) => {
|
|
101
|
-
if (!onboardingState.showTips || onboardingState.complete) return tasks;
|
|
102
|
-
return devicesByStatus[DEVICE_STATES.accepted].deviceIds.reduce((accu, id) => {
|
|
103
|
-
accu.push(dispatch(getDeviceById(id)));
|
|
104
|
-
return accu;
|
|
105
|
-
}, tasks);
|
|
106
|
-
};
|
|
107
|
-
const useAppInit = (userId) => {
|
|
108
|
-
const dispatch = useAppDispatch();
|
|
109
|
-
const [coreInitDone, setCoreInitDone] = useState(false);
|
|
110
|
-
const { hasMultitenancy } = useAppSelector(getFeatures);
|
|
111
|
-
const devicesByStatus = useAppSelector(getDevicesByStatus);
|
|
112
|
-
const onboardingState = useAppSelector(getOnboardingState);
|
|
113
|
-
const { columnSelection = [], trackingConsentGiven: hasTrackingEnabled, tooltips = {} } = useAppSelector(getUserSettings);
|
|
114
|
-
const { canManageUsers } = useAppSelector(getUserCapabilities);
|
|
115
|
-
const { interval, intervalUnit } = useAppSelector(getOfflineThresholdSettings);
|
|
116
|
-
const { id_attribute } = useAppSelector(getGlobalSettings);
|
|
117
|
-
const { identityAttributes } = useAppSelector(getSortedFilteringAttributes);
|
|
118
|
-
const isServiceProvider = useAppSelector(getIsServiceProvider);
|
|
119
|
-
const coreInitRunning = useRef(false);
|
|
120
|
-
const fullInitRunning = useRef(false);
|
|
121
|
-
const retrieveCoreData = useCallback(() => Promise.all([
|
|
122
|
-
dispatch(parseEnvironmentInfo()).unwrap().then(() => dispatch(probeOrganizationCapabilities()).unwrap()),
|
|
123
|
-
dispatch(getUserSettings$1()).unwrap(),
|
|
124
|
-
dispatch(getGlobalSettings$1()).unwrap(),
|
|
125
|
-
Promise.resolve(dispatch(setFirstLoginAfterSignup(stringToBoolean(cookies.get("firstLoginAfterSignup")))))
|
|
126
|
-
]), [dispatch]);
|
|
127
|
-
const retrieveAppData = useCallback(() => {
|
|
128
|
-
if (isServiceProvider) return Promise.resolve(dispatch(getRoles()));
|
|
129
|
-
const tasks = [
|
|
130
|
-
dispatch(getDeviceAttributes()),
|
|
131
|
-
dispatch(getDeploymentsByStatus({
|
|
132
|
-
status: DEPLOYMENT_STATES.finished,
|
|
133
|
-
shouldSelect: false
|
|
134
|
-
})),
|
|
135
|
-
dispatch(getDeploymentsByStatus({ status: DEPLOYMENT_STATES.inprogress })),
|
|
136
|
-
dispatch(getDevicesByStatus$1({ status: DEVICE_STATES.accepted })),
|
|
137
|
-
dispatch(getDevicesByStatus$1({ status: DEVICE_STATES.pending })),
|
|
138
|
-
dispatch(getDevicesByStatus$1({ status: DEVICE_STATES.preauth })),
|
|
139
|
-
dispatch(getDevicesByStatus$1({ status: DEVICE_STATES.rejected })),
|
|
140
|
-
dispatch(getDynamicGroups()),
|
|
141
|
-
dispatch(getGroups()),
|
|
142
|
-
dispatch(getIntegrations()),
|
|
143
|
-
dispatch(getReleases()),
|
|
144
|
-
dispatch(getAllDeviceCounts()).unwrap()
|
|
145
|
-
];
|
|
146
|
-
if (hasMultitenancy) {
|
|
147
|
-
tasks.push(dispatch(getDeviceLimits()));
|
|
148
|
-
tasks.push(dispatch(getRoles()));
|
|
149
|
-
} else tasks.push(Promise.resolve(dispatch(actions_default.setDeviceLimits({
|
|
150
|
-
micro: 0,
|
|
151
|
-
standard: -1,
|
|
152
|
-
system: 0,
|
|
153
|
-
test: -1
|
|
154
|
-
}))));
|
|
155
|
-
return Promise.all(tasks);
|
|
156
|
-
}, [
|
|
157
|
-
dispatch,
|
|
158
|
-
hasMultitenancy,
|
|
159
|
-
isServiceProvider
|
|
160
|
-
]);
|
|
161
|
-
const interpretAppData = useCallback(() => {
|
|
162
|
-
const settings = {};
|
|
163
|
-
if (cookies.get("_ga") && typeof hasTrackingEnabled === "undefined") settings.trackingConsentGiven = true;
|
|
164
|
-
let tasks = [
|
|
165
|
-
Promise.resolve(dispatch(setDeviceListState({ selectedAttributes: columnSelection.map((column) => ({
|
|
166
|
-
attribute: column.key,
|
|
167
|
-
scope: column.scope
|
|
168
|
-
})) }))),
|
|
169
|
-
Promise.resolve(dispatch(setTooltipsState(tooltips))),
|
|
170
|
-
dispatch(saveUserSettings(settings)).unwrap()
|
|
171
|
-
];
|
|
172
|
-
tasks = maybeAddOnboardingTasks({
|
|
173
|
-
devicesByStatus,
|
|
174
|
-
dispatch,
|
|
175
|
-
tasks,
|
|
176
|
-
onboardingState
|
|
177
|
-
});
|
|
178
|
-
if (canManageUsers && intervalUnit && intervalUnit !== timeUnits.days) {
|
|
179
|
-
const days = dayjs.duration(interval, intervalUnit).asDays();
|
|
180
|
-
if (days < 1) tasks.push(Promise.resolve(setTimeout(() => dispatch(setShowStartupNotification(true)), TIMEOUTS.fiveSeconds)));
|
|
181
|
-
else {
|
|
182
|
-
const roundedDays = Math.max(1, Math.round(days));
|
|
183
|
-
tasks.push(dispatch(saveGlobalSettings({ offlineThreshold: {
|
|
184
|
-
interval: roundedDays,
|
|
185
|
-
intervalUnit: timeUnits.days
|
|
186
|
-
} })));
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
const identityOptions = identityAttributes.filter((attribute) => ![
|
|
190
|
-
"id",
|
|
191
|
-
"Device ID",
|
|
192
|
-
"status"
|
|
193
|
-
].includes(attribute));
|
|
194
|
-
if (!id_attribute && identityOptions.length) tasks.push(dispatch(saveGlobalSettings({ id_attribute: {
|
|
195
|
-
attribute: identityOptions[0],
|
|
196
|
-
scope: "identity"
|
|
197
|
-
} })));
|
|
198
|
-
else if (typeof id_attribute === "string") {
|
|
199
|
-
let attribute = id_attribute;
|
|
200
|
-
if (attribute === "Device ID") attribute = "id";
|
|
201
|
-
tasks.push(dispatch(saveGlobalSettings({ id_attribute: {
|
|
202
|
-
attribute,
|
|
203
|
-
scope: "identity"
|
|
204
|
-
} })));
|
|
205
|
-
}
|
|
206
|
-
tasks.push(Promise.resolve(dispatch(actions_default.setAppInitDone())));
|
|
207
|
-
return Promise.all(tasks);
|
|
208
|
-
}, [
|
|
209
|
-
columnSelection,
|
|
210
|
-
dispatch,
|
|
211
|
-
identityAttributes,
|
|
212
|
-
hasTrackingEnabled,
|
|
213
|
-
canManageUsers,
|
|
214
|
-
devicesByStatus,
|
|
215
|
-
id_attribute,
|
|
216
|
-
interval,
|
|
217
|
-
intervalUnit,
|
|
218
|
-
onboardingState,
|
|
219
|
-
tooltips
|
|
220
|
-
]);
|
|
221
|
-
const initializeAppData = useCallback(() => retrieveAppData().then(interpretAppData).catch((err) => console.log(extractErrorMessage(err))).then(() => dispatch(getOnboardingState$1())), [
|
|
222
|
-
dispatch,
|
|
223
|
-
retrieveAppData,
|
|
224
|
-
interpretAppData
|
|
225
|
-
]);
|
|
226
|
-
useEffect(() => {
|
|
227
|
-
if (!userId || coreInitRunning.current) return;
|
|
228
|
-
coreInitRunning.current = true;
|
|
229
|
-
retrieveCoreData().then(() => setCoreInitDone(true));
|
|
230
|
-
}, [userId, retrieveCoreData]);
|
|
231
|
-
useEffect(() => {
|
|
232
|
-
if (fullInitRunning.current || !coreInitDone) return;
|
|
233
|
-
fullInitRunning.current = true;
|
|
234
|
-
initializeAppData();
|
|
235
|
-
}, [initializeAppData, coreInitDone]);
|
|
236
|
-
return { coreInitDone };
|
|
237
|
-
};
|
|
238
|
-
//#endregion
|
|
239
|
-
export { parseEnvironmentInfo, probeOrganizationCapabilities, useAppInit };
|
|
240
|
-
|
|
241
|
-
//# sourceMappingURL=storehooks.js.map
|
package/dist/storehooks.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storehooks.js","names":["storeActions","getOnboardingStateSelector","getDevicesByStatusSelector","getUserSettingsSelector","getGlobalSettingsSelector","getUserSettings","getGlobalSettings","getDevicesByStatus","actions","getOnboardingState"],"sources":["../src/storehooks.ts"],"sourcesContent":["// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { extractErrorMessage } from '@northern.tech/utils/helpers';\nimport dayjs from 'dayjs';\nimport durationDayJs from 'dayjs/plugin/duration.js';\nimport Cookies from 'universal-cookie';\n\nimport storeActions from './actions';\nimport actions from './actions';\nimport { getSessionInfo } from './auth';\nimport { DEPLOYMENT_STATES, DEVICE_STATES, TIMEOUTS, locations, timeUnits } from './constants';\nimport type { DeviceSliceType } from './devicesSlice';\nimport {\n getDevicesByStatus as getDevicesByStatusSelector,\n getFeatures,\n getGlobalSettings as getGlobalSettingsSelector,\n getIsServiceProvider,\n getOfflineThresholdSettings,\n getOnboardingState as getOnboardingStateSelector,\n getSortedFilteringAttributes,\n getUserCapabilities,\n getUserSettings as getUserSettingsSelector\n} from './selectors';\nimport { createAppAsyncThunk, useAppDispatch, useAppSelector } from './store';\nimport type { AppDispatch } from './store';\nimport {\n getAllDeviceCounts,\n getDeploymentsByStatus,\n getDeviceAttributes,\n getDeviceById,\n getDeviceLimits,\n getDevicesByStatus,\n getDynamicGroups,\n getGlobalSettings,\n getGroups,\n getIntegrations,\n getOnboardingState,\n getReleases,\n getRoles,\n getUserOrganization,\n getUserSettings,\n saveGlobalSettings,\n saveUserSettings\n} from './thunks';\nimport type { UserSettings, UserSliceType } from './usersSlice';\nimport { stringToBoolean } from './utils';\n\nconst cookies = new Cookies();\ndayjs.extend(durationDayJs);\n\nconst { setDeviceListState, setFirstLoginAfterSignup, setTooltipsState, setShowStartupNotification } = storeActions;\n\n// a host is hosted when it is one of the known hosted domains or a subdomain of one (e.g. staging.hosted.mender.io),\n// except for per-PR preview deployments whose leading label looks like <component>-pr-<number> (e.g. os-pr-2012.staging.hosted.mender.io)\nconst hostedDomains = Object.values(locations).map(({ location }) => location);\nconst isPreviewDeployment = (hostname: string) => /^[^.]+-pr-\\d+\\./.test(hostname);\nconst isHostedHostname = (hostname: string) =>\n !isPreviewDeployment(hostname) && hostedDomains.some(domain => hostname === domain || hostname.endsWith(`.${domain}`));\n\nconst featureFlags = [\n 'hasAiEnabled',\n 'hasAuditlogs',\n 'hasMultitenancy',\n 'hasDeltaProgress',\n 'hasDeviceConfig',\n 'hasDeviceConnect',\n 'hasDeviceFlags',\n 'hasFeedbackEnabled',\n 'hasManifestsEnabled',\n 'hasMonitor',\n 'hasMCUEnabled',\n 'hasNewSearch',\n 'isEnterprise'\n] as const;\n\nconst environmentDatas = [\n 'commit',\n 'feedbackProbability',\n 'hostAddress',\n 'hostedAnnouncement',\n 'recaptchaSiteKey',\n 'sentry',\n 'stripeAPIKey',\n 'trackerCode'\n] as const;\n\ntype VersionInfo = {\n docsVersion?: string;\n version?: string;\n};\n\ntype FeatureFlagsState = Record<string, boolean>;\n\nexport const parseEnvironmentInfo = createAppAsyncThunk(`app/parseEnvironmentInfo`, (_, { dispatch, getState }) => {\n const state = getState();\n let onboardingComplete = getOnboardingStateSelector(state).complete || !!JSON.parse(window.localStorage.getItem('onboardingComplete') ?? 'false');\n let demoArtifactPort = 85;\n let environmentData: Record<string, unknown> = {};\n let environmentFeatures: FeatureFlagsState = {};\n let versionInfo: VersionInfo = {};\n const mender_environment = window.mender_environment;\n if (mender_environment) {\n const { features = {}, demoArtifactPort: port, disableOnboarding, version } = mender_environment;\n demoArtifactPort = Number(port) || demoArtifactPort;\n const appState = state.app;\n environmentData = environmentDatas.reduce((accu, flag) => ({ ...accu, [flag]: mender_environment[flag] || appState[flag as keyof typeof appState] }), {});\n environmentFeatures = {\n ...featureFlags.reduce<FeatureFlagsState>((accu, flag) => ({ ...accu, [flag]: stringToBoolean(features[flag]) }), {}),\n isHosted: stringToBoolean(features.isHosted) || isHostedHostname(window.location.hostname)\n };\n onboardingComplete = !environmentFeatures.isHosted || stringToBoolean(disableOnboarding) || onboardingComplete;\n versionInfo = {\n docsVersion: isNaN(parseInt(version.charAt(0))) ? '' : version.split('.').slice(0, 2).join('.'),\n version\n };\n }\n return Promise.all([\n dispatch(storeActions.successfullyLoggedIn(getSessionInfo())),\n dispatch(storeActions.setOnboardingComplete(onboardingComplete)),\n dispatch(storeActions.setDemoArtifactPort(demoArtifactPort)),\n dispatch(storeActions.setFeatures(environmentFeatures)),\n dispatch(storeActions.setVersionInformation(versionInfo)),\n dispatch(storeActions.setEnvironmentData(environmentData))\n ]);\n});\n\n// probes the organization endpoint to classify the deployment: reaching it means the deployment is multitenant,\n// which - when not hosted - identifies an on-prem enterprise installation, while an unreachable endpoint identifies\n// a single-tenant OS installation. hosted deployments keep their plan-derived enterprise status (getIsEnterprise).\n// must run after parseEnvironmentInfo so the final isHosted value is available in the store.\nexport const probeOrganizationCapabilities = createAppAsyncThunk(`app/probeOrganizationCapabilities`, (_, { dispatch, getState }) =>\n dispatch(getUserOrganization())\n .unwrap()\n .then(() => {\n if (!getFeatures(getState()).isHosted) {\n dispatch(storeActions.setFeatures({ hasMultitenancy: true, isEnterprise: true }));\n }\n })\n .catch(() => {\n if (!getFeatures(getState()).isHosted) {\n dispatch(storeActions.setFeatures({ hasMultitenancy: false, isEnterprise: false }));\n }\n })\n);\n\ntype OnboardingState = {\n complete?: boolean;\n showTips?: boolean | null;\n};\n\ntype MaybeAddOnboardingTasksParams = {\n devicesByStatus: DeviceSliceType['byStatus'];\n dispatch: AppDispatch;\n onboardingState: OnboardingState;\n tasks: Promise<unknown>[];\n};\n\nconst maybeAddOnboardingTasks = ({ devicesByStatus, dispatch, onboardingState, tasks }: MaybeAddOnboardingTasksParams): Promise<unknown>[] => {\n if (!onboardingState.showTips || onboardingState.complete) {\n return tasks;\n }\n // try to retrieve full device details for onboarding devices to ensure ips etc. are available\n // we only load the first few/ 20 devices, as it is possible the onboarding is left dangling\n // and a lot of devices are present and we don't want to flood the backend for this\n return devicesByStatus[DEVICE_STATES.accepted].deviceIds.reduce<Promise<unknown>[]>((accu, id) => {\n accu.push(dispatch(getDeviceById(id)));\n return accu;\n }, tasks);\n};\n\nexport const useAppInit = (userId: string | undefined): { coreInitDone: boolean } => {\n const dispatch = useAppDispatch();\n const [coreInitDone, setCoreInitDone] = useState(false);\n const { hasMultitenancy } = useAppSelector(getFeatures);\n const devicesByStatus = useAppSelector(getDevicesByStatusSelector);\n const onboardingState = useAppSelector(getOnboardingStateSelector);\n const { columnSelection = [], trackingConsentGiven: hasTrackingEnabled, tooltips = {} } = useAppSelector(getUserSettingsSelector);\n const { canManageUsers } = useAppSelector(getUserCapabilities);\n const { interval, intervalUnit } = useAppSelector(getOfflineThresholdSettings);\n const { id_attribute } = useAppSelector(getGlobalSettingsSelector);\n const { identityAttributes } = useAppSelector(getSortedFilteringAttributes);\n const isServiceProvider = useAppSelector(getIsServiceProvider);\n const coreInitRunning = useRef(false);\n const fullInitRunning = useRef(false);\n\n const retrieveCoreData = useCallback(\n (): Promise<unknown[]> =>\n Promise.all([\n // parse the environment first so isHosted is set before the organization probe classifies the deployment type\n dispatch(parseEnvironmentInfo())\n .unwrap()\n .then(() => dispatch(probeOrganizationCapabilities()).unwrap()),\n dispatch(getUserSettings()).unwrap(),\n dispatch(getGlobalSettings()).unwrap(),\n Promise.resolve(dispatch(setFirstLoginAfterSignup(stringToBoolean(cookies.get('firstLoginAfterSignup')))))\n ]),\n [dispatch]\n );\n\n const retrieveAppData = useCallback((): Promise<unknown[] | unknown> => {\n if (isServiceProvider) {\n return Promise.resolve(dispatch(getRoles()));\n }\n const tasks: Promise<unknown>[] = [\n dispatch(getDeviceAttributes()),\n dispatch(getDeploymentsByStatus({ status: DEPLOYMENT_STATES.finished, shouldSelect: false })),\n dispatch(getDeploymentsByStatus({ status: DEPLOYMENT_STATES.inprogress })),\n dispatch(getDevicesByStatus({ status: DEVICE_STATES.accepted })),\n dispatch(getDevicesByStatus({ status: DEVICE_STATES.pending })),\n dispatch(getDevicesByStatus({ status: DEVICE_STATES.preauth })),\n dispatch(getDevicesByStatus({ status: DEVICE_STATES.rejected })),\n dispatch(getDynamicGroups()),\n dispatch(getGroups()),\n dispatch(getIntegrations()),\n dispatch(getReleases()),\n dispatch(getAllDeviceCounts()).unwrap()\n ];\n if (hasMultitenancy) {\n tasks.push(dispatch(getDeviceLimits()));\n tasks.push(dispatch(getRoles()));\n } else {\n // OS users have unlimited standard and test devices\n tasks.push(Promise.resolve(dispatch(actions.setDeviceLimits({ micro: 0, standard: -1, system: 0, test: -1 }))));\n }\n return Promise.all(tasks);\n }, [dispatch, hasMultitenancy, isServiceProvider]);\n\n const interpretAppData = useCallback((): Promise<unknown[]> => {\n const settings: Partial<UserSettings> = {};\n if (cookies.get('_ga') && typeof hasTrackingEnabled === 'undefined') {\n settings.trackingConsentGiven = true;\n }\n let tasks: Promise<unknown>[] = [\n Promise.resolve(dispatch(setDeviceListState({ selectedAttributes: columnSelection.map(column => ({ attribute: column.key, scope: column.scope })) }))),\n Promise.resolve(dispatch(setTooltipsState(tooltips as UserSliceType['tooltips']['byId']))), // tooltips read state is primarily trusted from the redux store, except on app init - here user settings are the reference\n dispatch(saveUserSettings(settings)).unwrap()\n ];\n // checks if user id is set and if cookie for helptips exists for that user\n tasks = maybeAddOnboardingTasks({ devicesByStatus, dispatch, tasks, onboardingState });\n\n if (canManageUsers && intervalUnit && intervalUnit !== timeUnits.days) {\n const duration = dayjs.duration(interval, intervalUnit as keyof typeof timeUnits);\n const days = duration.asDays();\n if (days < 1) {\n tasks.push(Promise.resolve(setTimeout(() => dispatch(setShowStartupNotification(true)), TIMEOUTS.fiveSeconds)));\n } else {\n const roundedDays = Math.max(1, Math.round(days));\n tasks.push(dispatch(saveGlobalSettings({ offlineThreshold: { interval: roundedDays, intervalUnit: timeUnits.days } })));\n }\n }\n\n // the following is used as a migration and initialization of the stored identity attribute\n // changing the default device attribute to the first non-deviceId attribute, unless a stored\n // id attribute setting exists\n const identityOptions = identityAttributes.filter(attribute => !['id', 'Device ID', 'status'].includes(attribute));\n if (!id_attribute && identityOptions.length) {\n tasks.push(dispatch(saveGlobalSettings({ id_attribute: { attribute: identityOptions[0], scope: 'identity' } })));\n } else if (typeof id_attribute === 'string') {\n // Legacy migration path: id_attribute used to be a plain string\n let attribute: string = id_attribute;\n if (attribute === 'Device ID') {\n attribute = 'id';\n }\n tasks.push(dispatch(saveGlobalSettings({ id_attribute: { attribute, scope: 'identity' } })));\n }\n tasks.push(Promise.resolve(dispatch(storeActions.setAppInitDone())));\n return Promise.all(tasks);\n }, [\n columnSelection,\n dispatch,\n identityAttributes,\n hasTrackingEnabled,\n canManageUsers,\n devicesByStatus,\n id_attribute,\n interval,\n intervalUnit,\n onboardingState,\n tooltips\n ]);\n\n const initializeAppData = useCallback(\n (): Promise<unknown> =>\n retrieveAppData()\n .then(interpretAppData)\n // this is allowed to fail if no user information are available\n .catch(err => console.log(extractErrorMessage(err)))\n .then(() => dispatch(getOnboardingState())),\n [dispatch, retrieveAppData, interpretAppData]\n );\n\n useEffect(() => {\n if (!userId || coreInitRunning.current) {\n return;\n }\n coreInitRunning.current = true;\n retrieveCoreData().then(() => setCoreInitDone(true));\n }, [userId, retrieveCoreData]);\n\n useEffect(() => {\n if (fullInitRunning.current || !coreInitDone) {\n return;\n }\n fullInitRunning.current = true;\n initializeAppData();\n }, [initializeAppData, coreInitDone]);\n\n return { coreInitDone };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4DA,MAAM,UAAU,IAAI,QAAQ;AAC5B,MAAM,OAAO,aAAa;AAE1B,MAAM,EAAE,oBAAoB,0BAA0B,kBAAkB,+BAA+BA;AAIvG,MAAM,gBAAgB,OAAO,OAAO,SAAS,CAAC,CAAC,KAAK,EAAE,eAAe,QAAQ;AAC7E,MAAM,uBAAuB,aAAqB,kBAAkB,KAAK,QAAQ;AACjF,MAAM,oBAAoB,aACxB,CAAC,oB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