@northern.tech/store 0.3.1 → 0.3.3
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 +20 -17
- package/dist/actions.cjs.map +1 -1
- package/dist/actions.js +8 -8
- package/dist/api/general-api.js +2 -2
- package/dist/api/types/Tenant.ts +17 -12
- package/dist/api/users-api.js +2 -2
- package/dist/appSlice/constants.cjs +18 -10
- package/dist/appSlice/constants.cjs.map +1 -1
- package/dist/appSlice/constants.d.cts +41 -84
- package/dist/appSlice/constants.d.ts +41 -84
- package/dist/appSlice/constants.js +1 -1
- package/dist/appSlice/index.js +2 -2
- package/dist/appSlice/thunks.cjs +140 -96
- package/dist/appSlice/thunks.cjs.map +1 -1
- package/dist/appSlice/thunks.js +19 -19
- package/dist/auth.js +2 -2
- package/dist/{chunk-Q6M5TTDQ.js → chunk-2CYOM4BK.js} +1 -1
- package/dist/chunk-2CYOM4BK.js.map +1 -0
- package/dist/{chunk-APHL4JZP.js → chunk-2JHFUQ6B.js} +141 -102
- package/dist/chunk-2JHFUQ6B.js.map +1 -0
- package/dist/{chunk-YETZPQFR.js → chunk-4XJMRVFI.js} +12 -11
- package/dist/chunk-4XJMRVFI.js.map +1 -0
- package/dist/{chunk-RX55KAKX.js → chunk-7JKWI5FK.js} +2 -2
- package/dist/{chunk-A6CT6GTI.js → chunk-C5NEDBJI.js} +17 -11
- package/dist/chunk-C5NEDBJI.js.map +1 -0
- package/dist/{chunk-NNADGHSL.js → chunk-DAPAXWA5.js} +8 -8
- package/dist/{chunk-ANB5BM5J.js → chunk-DCK2DBOA.js} +27 -20
- package/dist/chunk-DCK2DBOA.js.map +1 -0
- package/dist/{chunk-E5LEU5PF.js → chunk-HPBE6KYY.js} +2 -2
- package/dist/{chunk-2RJIDREZ.js → chunk-LEMVXAYP.js} +25 -16
- package/dist/chunk-LEMVXAYP.js.map +1 -0
- package/dist/{chunk-NI4SZOCF.js → chunk-LGNOTPUG.js} +9 -9
- package/dist/{chunk-MDC7Y3EX.js → chunk-LTKOV26W.js} +22 -20
- package/dist/chunk-LTKOV26W.js.map +1 -0
- package/dist/{chunk-YTQUNAZP.js → chunk-QRGTG4YB.js} +2 -2
- package/dist/{chunk-XTRPX7JZ.js → chunk-TI2RL5P2.js} +2 -2
- package/dist/chunk-TI2RL5P2.js.map +1 -0
- package/dist/{chunk-YGBFDXXA.js → chunk-TUACATJA.js} +2 -2
- package/dist/{chunk-25AKG5HH.js → chunk-UWMYZNUB.js} +19 -11
- package/dist/chunk-UWMYZNUB.js.map +1 -0
- package/dist/{chunk-UEP36GCI.js → chunk-VMNMD6KF.js} +2 -2
- package/dist/{chunk-KAQJH2YL.js → chunk-WXL7PVI5.js} +12 -4
- package/dist/chunk-WXL7PVI5.js.map +1 -0
- package/dist/{chunk-VOCOFE4I.js → chunk-X7IEZBM4.js} +2 -2
- package/dist/{chunk-XXHONFSQ.js → chunk-YDS36ALB.js} +3 -3
- package/dist/{chunk-XXHONFSQ.js.map → chunk-YDS36ALB.js.map} +1 -1
- package/dist/commonSelectors.cjs +40 -18
- package/dist/commonSelectors.cjs.map +1 -1
- package/dist/commonSelectors.d.cts +54 -46
- package/dist/commonSelectors.d.ts +54 -46
- package/dist/commonSelectors.js +9 -9
- package/dist/constants.cjs +35 -19
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +3 -3
- package/dist/constants.d.ts +3 -3
- package/dist/constants.js +6 -2
- package/dist/deploymentdevicehook.cjs +146 -101
- package/dist/deploymentdevicehook.cjs.map +1 -1
- package/dist/deploymentdevicehook.d.cts +1 -1
- package/dist/deploymentdevicehook.d.ts +1 -1
- package/dist/deploymentdevicehook.js +24 -22
- package/dist/deploymentdevicehook.js.map +1 -1
- package/dist/deploymentsSlice/constants.cjs +8 -8
- package/dist/deploymentsSlice/constants.cjs.map +1 -1
- package/dist/deploymentsSlice/constants.js +2 -2
- package/dist/deploymentsSlice/index.cjs +8 -8
- package/dist/deploymentsSlice/index.cjs.map +1 -1
- package/dist/deploymentsSlice/index.js +3 -3
- package/dist/deploymentsSlice/selectors.cjs +8 -8
- package/dist/deploymentsSlice/selectors.cjs.map +1 -1
- package/dist/deploymentsSlice/selectors.js +3 -3
- package/dist/deploymentsSlice/thunks.cjs +140 -96
- package/dist/deploymentsSlice/thunks.cjs.map +1 -1
- package/dist/deploymentsSlice/thunks.js +19 -19
- package/dist/devicesSlice/constants.cjs +11 -8
- package/dist/devicesSlice/constants.cjs.map +1 -1
- package/dist/devicesSlice/constants.d.cts +2 -1
- package/dist/devicesSlice/constants.d.ts +2 -1
- package/dist/devicesSlice/constants.js +4 -2
- package/dist/devicesSlice/index.cjs +8 -8
- package/dist/devicesSlice/index.cjs.map +1 -1
- package/dist/devicesSlice/index.js +3 -3
- package/dist/devicesSlice/selectors.cjs +9 -9
- package/dist/devicesSlice/selectors.cjs.map +1 -1
- package/dist/devicesSlice/selectors.js +3 -3
- package/dist/devicesSlice/thunks.cjs +142 -96
- package/dist/devicesSlice/thunks.cjs.map +1 -1
- package/dist/devicesSlice/thunks.d.cts +12 -2
- package/dist/devicesSlice/thunks.d.ts +12 -2
- package/dist/devicesSlice/thunks.js +21 -19
- package/dist/flag-eu-5477R2P4.svg +130 -0
- package/dist/flag-us-HNQAF66I.svg +63 -0
- package/dist/monitorSlice/constants.cjs +8 -8
- package/dist/monitorSlice/constants.cjs.map +1 -1
- package/dist/monitorSlice/constants.js +2 -2
- package/dist/monitorSlice/index.cjs +8 -8
- package/dist/monitorSlice/index.cjs.map +1 -1
- package/dist/monitorSlice/index.js +3 -3
- package/dist/monitorSlice/thunks.cjs +59 -37
- package/dist/monitorSlice/thunks.cjs.map +1 -1
- package/dist/monitorSlice/thunks.js +17 -17
- package/dist/onboardingSlice/thunks.cjs +149 -102
- package/dist/onboardingSlice/thunks.cjs.map +1 -1
- package/dist/onboardingSlice/thunks.d.cts +1 -32
- package/dist/onboardingSlice/thunks.d.ts +1 -32
- package/dist/onboardingSlice/thunks.js +19 -19
- package/dist/organizationSlice/constants.cjs +22 -17
- package/dist/organizationSlice/constants.cjs.map +1 -1
- package/dist/organizationSlice/constants.d.cts +33 -1
- package/dist/organizationSlice/constants.d.ts +33 -1
- package/dist/organizationSlice/constants.js +4 -2
- package/dist/organizationSlice/index.cjs +18 -15
- package/dist/organizationSlice/index.cjs.map +1 -1
- package/dist/organizationSlice/index.d.cts +26 -1012
- package/dist/organizationSlice/index.d.ts +26 -1012
- package/dist/organizationSlice/index.js +3 -3
- package/dist/organizationSlice/selectors.cjs.map +1 -1
- package/dist/organizationSlice/selectors.d.cts +9 -1
- package/dist/organizationSlice/selectors.d.ts +9 -1
- package/dist/organizationSlice/selectors.js +3 -3
- package/dist/organizationSlice/thunks.cjs +1608 -1540
- package/dist/organizationSlice/thunks.cjs.map +1 -1
- package/dist/organizationSlice/thunks.d.cts +61 -36
- package/dist/organizationSlice/thunks.d.ts +61 -36
- package/dist/organizationSlice/thunks.js +19 -19
- package/dist/organizationSlice/types.cjs +19 -0
- package/dist/organizationSlice/types.cjs.map +1 -0
- package/dist/organizationSlice/types.d.cts +114 -0
- package/dist/organizationSlice/types.d.ts +114 -0
- package/dist/organizationSlice/types.js +1 -0
- package/dist/organizationSlice/types.js.map +1 -0
- package/dist/releasesSlice/index.js +2 -2
- package/dist/releasesSlice/selectors.cjs +11 -0
- package/dist/releasesSlice/selectors.cjs.map +1 -1
- package/dist/releasesSlice/selectors.js +4 -4
- package/dist/releasesSlice/thunks.cjs +73 -49
- package/dist/releasesSlice/thunks.cjs.map +1 -1
- package/dist/releasesSlice/thunks.d.cts +1 -4
- package/dist/releasesSlice/thunks.d.ts +1 -4
- package/dist/releasesSlice/thunks.js +17 -17
- package/dist/selectors.cjs +46 -18
- package/dist/selectors.cjs.map +1 -1
- package/dist/selectors.d.cts +9 -1
- package/dist/selectors.d.ts +9 -1
- package/dist/selectors.js +36 -30
- package/dist/store.cjs +36 -23
- package/dist/store.cjs.map +1 -1
- package/dist/store.d.cts +12 -231
- package/dist/store.d.ts +12 -231
- package/dist/store.js +13 -11
- package/dist/storehooks.cjs +222 -141
- package/dist/storehooks.cjs.map +1 -1
- package/dist/storehooks.js +36 -24
- package/dist/storehooks.js.map +1 -1
- package/dist/thunks.cjs +199 -126
- package/dist/thunks.cjs.map +1 -1
- package/dist/thunks.d.cts +5 -1
- package/dist/thunks.d.ts +5 -1
- package/dist/thunks.js +21 -19
- package/dist/usersSlice/constants.cjs +10 -10
- package/dist/usersSlice/constants.cjs.map +1 -1
- package/dist/usersSlice/constants.js +2 -2
- package/dist/usersSlice/index.cjs +10 -10
- package/dist/usersSlice/index.cjs.map +1 -1
- package/dist/usersSlice/index.js +3 -3
- package/dist/usersSlice/selectors.cjs +35 -13
- package/dist/usersSlice/selectors.cjs.map +1 -1
- package/dist/usersSlice/selectors.d.cts +44 -1
- package/dist/usersSlice/selectors.d.ts +44 -1
- package/dist/usersSlice/selectors.js +12 -6
- package/dist/usersSlice/thunks.cjs +138 -96
- package/dist/usersSlice/thunks.cjs.map +1 -1
- package/dist/usersSlice/thunks.d.cts +10 -9
- package/dist/usersSlice/thunks.d.ts +10 -9
- package/dist/usersSlice/thunks.js +19 -19
- package/dist/utils.cjs +17 -16
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +3 -3
- package/package.json +7 -7
- package/dist/chunk-25AKG5HH.js.map +0 -1
- package/dist/chunk-2RJIDREZ.js.map +0 -1
- package/dist/chunk-A6CT6GTI.js.map +0 -1
- package/dist/chunk-ANB5BM5J.js.map +0 -1
- package/dist/chunk-APHL4JZP.js.map +0 -1
- package/dist/chunk-KAQJH2YL.js.map +0 -1
- package/dist/chunk-MDC7Y3EX.js.map +0 -1
- package/dist/chunk-Q6M5TTDQ.js.map +0 -1
- package/dist/chunk-XTRPX7JZ.js.map +0 -1
- package/dist/chunk-YETZPQFR.js.map +0 -1
- /package/dist/{chunk-RX55KAKX.js.map → chunk-7JKWI5FK.js.map} +0 -0
- /package/dist/{chunk-NNADGHSL.js.map → chunk-DAPAXWA5.js.map} +0 -0
- /package/dist/{chunk-E5LEU5PF.js.map → chunk-HPBE6KYY.js.map} +0 -0
- /package/dist/{chunk-NI4SZOCF.js.map → chunk-LGNOTPUG.js.map} +0 -0
- /package/dist/{chunk-YTQUNAZP.js.map → chunk-QRGTG4YB.js.map} +0 -0
- /package/dist/{chunk-YGBFDXXA.js.map → chunk-TUACATJA.js.map} +0 -0
- /package/dist/{chunk-UEP36GCI.js.map → chunk-VMNMD6KF.js.map} +0 -0
- /package/dist/{chunk-VOCOFE4I.js.map → chunk-X7IEZBM4.js.map} +0 -0
|
@@ -68,6 +68,7 @@ __export(thunks_exports, {
|
|
|
68
68
|
verifyEmailStart: () => verifyEmailStart
|
|
69
69
|
});
|
|
70
70
|
module.exports = __toCommonJS(thunks_exports);
|
|
71
|
+
var import_helptips = require("@northern.tech/common-ui/helptips");
|
|
71
72
|
|
|
72
73
|
// src/appSlice/constants.ts
|
|
73
74
|
var import_icons_material = require("@mui/icons-material");
|
|
@@ -97,28 +98,28 @@ var PLANS = {
|
|
|
97
98
|
id: "os",
|
|
98
99
|
name: "Basic",
|
|
99
100
|
offer: true,
|
|
100
|
-
price: "$32/month",
|
|
101
|
+
price: "$32 / month",
|
|
101
102
|
deviceCount: startingDeviceCount.os,
|
|
102
|
-
offerprice: "$23/month for first 50 devices",
|
|
103
|
+
offerprice: "$23 / month for first 50 devices",
|
|
103
104
|
price2: "for first 6 months;\n$29/month thereafter",
|
|
104
|
-
features: ["
|
|
105
|
+
features: ["Access to core features of Mender", "Basic support"]
|
|
105
106
|
},
|
|
106
107
|
professional: {
|
|
107
108
|
id: "professional",
|
|
108
109
|
name: "Professional",
|
|
109
110
|
offer: true,
|
|
110
|
-
price: "$269/month",
|
|
111
|
+
price: "$269 / month",
|
|
111
112
|
deviceCount: startingDeviceCount.professional,
|
|
112
|
-
offerprice: "$200/month for first 50 devices",
|
|
113
|
+
offerprice: "$200 / month for first 50 devices",
|
|
113
114
|
price2: "for first 6 months;\n$249/month thereafter",
|
|
114
|
-
features: ["
|
|
115
|
+
features: ["Advanced OTA features", "Higher priority support"]
|
|
115
116
|
},
|
|
116
117
|
enterprise: {
|
|
117
118
|
id: "enterprise",
|
|
118
119
|
name: "Enterprise",
|
|
119
120
|
price: "Custom pricing",
|
|
120
|
-
deviceCount: "
|
|
121
|
-
features: ["
|
|
121
|
+
deviceCount: "Unlimited devices",
|
|
122
|
+
features: ["All Mender features", "Advanced security features", "SLA-backed support"]
|
|
122
123
|
}
|
|
123
124
|
};
|
|
124
125
|
var ADDONS = {
|
|
@@ -589,6 +590,7 @@ var DEVICE_STATES = {
|
|
|
589
590
|
rejected: "rejected"
|
|
590
591
|
};
|
|
591
592
|
var geoAttributes = ["geo-lat", "geo-lon"].map((attribute) => ({ attribute, scope: "inventory" }));
|
|
593
|
+
var REPORT_CHART_SIZE_LIMIT = 6;
|
|
592
594
|
|
|
593
595
|
// src/monitorSlice/constants.ts
|
|
594
596
|
var alertChannels = { email: "email" };
|
|
@@ -670,13 +672,16 @@ var SSO_TYPES = {
|
|
|
670
672
|
configDetails: [{ key: "startURL", label: "Start Url", getValue: getOidcStartUrl }]
|
|
671
673
|
}
|
|
672
674
|
};
|
|
673
|
-
var
|
|
674
|
-
{ title: "Artifact", queryParameter: "object_type", value: "artifact" },
|
|
675
|
-
{ title: "Deployment", queryParameter: "object_deployment_name", value: "deployment" },
|
|
676
|
-
{ title: "Device", queryParameter: "object_id", value: "device" },
|
|
677
|
-
{ title: "
|
|
678
|
-
|
|
679
|
-
|
|
675
|
+
var auditlogTypes = {
|
|
676
|
+
artifact: { title: "Artifact", queryParameter: "object_type", value: "artifact" },
|
|
677
|
+
deployment: { title: "Deployment", queryParameter: "object_deployment_name", value: "deployment" },
|
|
678
|
+
device: { title: "Device", queryParameter: "object_id", value: "device" },
|
|
679
|
+
user_access_token: { title: "Personal Access Token", queryParameter: "user_access_token", value: "user_access_token" },
|
|
680
|
+
user: { title: "User", queryParameter: "object_id", value: "user" },
|
|
681
|
+
tenant: { title: "Tenant", queryParameter: "object_id", value: "tenant" }
|
|
682
|
+
};
|
|
683
|
+
var AUDIT_LOGS_TYPES = [auditlogTypes.artifact, auditlogTypes.deployment, auditlogTypes.device, auditlogTypes.user_access_token, auditlogTypes.user];
|
|
684
|
+
var SP_AUDIT_LOGS_TYPES = [auditlogTypes.user, auditlogTypes.tenant];
|
|
680
685
|
var emptyWebhook = {
|
|
681
686
|
description: "",
|
|
682
687
|
enabled: true,
|
|
@@ -809,7 +814,7 @@ var uiPermissionsByArea = {
|
|
|
809
814
|
explanation: "Granting access to the audit log will allow tracing changes to devices, releases and user accounts, as well as providing information about deployments.",
|
|
810
815
|
key: "auditlog",
|
|
811
816
|
uiPermissions: [uiPermissionsById.read],
|
|
812
|
-
title: "System
|
|
817
|
+
title: "System Audit Log"
|
|
813
818
|
},
|
|
814
819
|
deployments: {
|
|
815
820
|
endpoints: [
|
|
@@ -960,7 +965,7 @@ var serviceProviderRolesById = {
|
|
|
960
965
|
},
|
|
961
966
|
readOnly: {
|
|
962
967
|
name: "Read access",
|
|
963
|
-
value: staticRolesByName.
|
|
968
|
+
value: staticRolesByName.readOnly,
|
|
964
969
|
description: "This role can see all linked organizations but cannot make any changes",
|
|
965
970
|
permissions: [],
|
|
966
971
|
uiPermissions: {
|
|
@@ -2179,7 +2184,7 @@ var getGroups = (0, import_toolkit11.createSelector)([getGroupsById], (groupsByI
|
|
|
2179
2184
|
(accu, [groupname, group]) => {
|
|
2180
2185
|
const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;
|
|
2181
2186
|
const groupItem = { ...group, groupId: name, name: groupname };
|
|
2182
|
-
if (group.filters
|
|
2187
|
+
if (group.filters?.length > 0) {
|
|
2183
2188
|
if (groupname !== UNGROUPED_GROUP.id) {
|
|
2184
2189
|
accu.dynamic.push(groupItem);
|
|
2185
2190
|
} else {
|
|
@@ -2252,14 +2257,15 @@ var getAuditLogEntry = (0, import_toolkit12.createSelector)([getAuditLog, getAud
|
|
|
2252
2257
|
// src/utils.ts
|
|
2253
2258
|
var import_helpers4 = require("@northern.tech/utils/helpers");
|
|
2254
2259
|
var filterProcessors = {
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2260
|
+
[DEVICE_FILTERING_OPTIONS.$gt.key]: (val) => Number(val) || val,
|
|
2261
|
+
[DEVICE_FILTERING_OPTIONS.$gte.key]: (val) => Number(val) || val,
|
|
2262
|
+
[DEVICE_FILTERING_OPTIONS.$lt.key]: (val) => Number(val) || val,
|
|
2263
|
+
[DEVICE_FILTERING_OPTIONS.$lte.key]: (val) => Number(val) || val,
|
|
2264
|
+
[DEVICE_FILTERING_OPTIONS.$ltne.key]: (val) => Number(val) || val,
|
|
2265
|
+
[DEVICE_FILTERING_OPTIONS.$in.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
|
|
2266
|
+
[DEVICE_FILTERING_OPTIONS.$nin.key]: (val) => ("" + val).split(",").map((i) => i.trim()),
|
|
2267
|
+
[DEVICE_FILTERING_OPTIONS.$exists.key]: import_helpers4.yes,
|
|
2268
|
+
[DEVICE_FILTERING_OPTIONS.$nexists.key]: () => false
|
|
2263
2269
|
};
|
|
2264
2270
|
var filterAliases = {
|
|
2265
2271
|
$nexists: { alias: DEVICE_FILTERING_OPTIONS.$exists.key, value: false }
|
|
@@ -2383,8 +2389,13 @@ var getTooltipsById = (state) => state.users.tooltips.byId;
|
|
|
2383
2389
|
var getGlobalSettings = (state) => state.users.globalSettings;
|
|
2384
2390
|
var getCurrentUserId = (state) => state.users.currentUser;
|
|
2385
2391
|
var getUsersById = (state) => state.users.byId;
|
|
2392
|
+
var getUsersList = (0, import_toolkit14.createSelector)([getUsersById], (usersById) => Object.values(usersById));
|
|
2386
2393
|
var getCurrentUser = (0, import_toolkit14.createSelector)([getUsersById, getCurrentUserId], (usersById, userId) => usersById[userId] ?? {});
|
|
2387
2394
|
var getUserSettings = (state) => state.users.userSettings;
|
|
2395
|
+
var getSelectedDeviceAttribute = (0, import_toolkit14.createSelector)(
|
|
2396
|
+
[getUserSettings],
|
|
2397
|
+
({ columnSelection }) => columnSelection.map((attribute) => ({ attribute: attribute.key, scope: attribute.scope }))
|
|
2398
|
+
);
|
|
2388
2399
|
var getIsDarkMode = (0, import_toolkit14.createSelector)([getUserSettings], ({ mode }) => isDarkMode(mode));
|
|
2389
2400
|
var getShowHelptips = (0, import_toolkit14.createSelector)(
|
|
2390
2401
|
[getTooltipsById],
|
|
@@ -2409,7 +2420,7 @@ var getOfflineThresholdSettings = (0, import_toolkit14.createSelector)([getGloba
|
|
|
2409
2420
|
interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,
|
|
2410
2421
|
intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName
|
|
2411
2422
|
}));
|
|
2412
|
-
var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([
|
|
2423
|
+
var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([value, role]) => ({ value, ...role })));
|
|
2413
2424
|
|
|
2414
2425
|
// src/commonSelectors.ts
|
|
2415
2426
|
var getIsEnterprise = (0, import_toolkit15.createSelector)(
|
|
@@ -2470,12 +2481,18 @@ var getUserCapabilities = (0, import_toolkit15.createSelector)([getUserRoles, ge
|
|
|
2470
2481
|
});
|
|
2471
2482
|
var getTenantCapabilities = (0, import_toolkit15.createSelector)(
|
|
2472
2483
|
[getFeatures, getOrganization, getIsEnterprise],
|
|
2473
|
-
({
|
|
2484
|
+
({
|
|
2485
|
+
hasAuditlogs: isAuditlogEnabled,
|
|
2486
|
+
hasDeviceConfig: isDeviceConfigEnabled,
|
|
2487
|
+
hasDeviceConnect: isDeviceConnectEnabled,
|
|
2488
|
+
hasMonitor: isMonitorEnabled,
|
|
2489
|
+
isHosted
|
|
2490
|
+
}, { addons = [], plan = PLANS.os.id }, isEnterprise) => {
|
|
2474
2491
|
const canDelta = isEnterprise || plan === PLANS.professional.id;
|
|
2475
2492
|
const hasAuditlogs = isAuditlogEnabled && isEnterprise;
|
|
2476
|
-
const hasDeviceConfig =
|
|
2477
|
-
const hasDeviceConnect =
|
|
2478
|
-
const hasMonitor = isMonitorEnabled && addons.some((addon) => addon.name ===
|
|
2493
|
+
const hasDeviceConfig = addons.some((addon) => addon.name === ADDONS.configure.id && addon.enabled) || isDeviceConfigEnabled && !isHosted;
|
|
2494
|
+
const hasDeviceConnect = addons.some((addon) => addon.name === ADDONS.troubleshoot.id && addon.enabled) || isDeviceConnectEnabled && !isHosted;
|
|
2495
|
+
const hasMonitor = isMonitorEnabled && addons.some((addon) => addon.name === ADDONS.monitor.id && addon.enabled);
|
|
2479
2496
|
return {
|
|
2480
2497
|
canDelta,
|
|
2481
2498
|
canRetry: canDelta,
|
|
@@ -2605,7 +2622,7 @@ var getAuditlogDevice = (0, import_toolkit15.createSelector)([getAuditLogEntry,
|
|
|
2605
2622
|
var getRelevantRoles = (0, import_toolkit15.createSelector)([getOrganization, getRolesList], ({ service_provider }, roles) => {
|
|
2606
2623
|
if (service_provider) {
|
|
2607
2624
|
return roles.reduce((accu, role) => {
|
|
2608
|
-
if (rolesById[role.
|
|
2625
|
+
if (rolesById[role.value]) {
|
|
2609
2626
|
return accu;
|
|
2610
2627
|
}
|
|
2611
2628
|
accu.push(role);
|
|
@@ -2613,20 +2630,19 @@ var getRelevantRoles = (0, import_toolkit15.createSelector)([getOrganization, ge
|
|
|
2613
2630
|
}, Object.values(serviceProviderRolesById));
|
|
2614
2631
|
}
|
|
2615
2632
|
return Object.keys(rolesById).reverse().reduce((accu, key) => {
|
|
2616
|
-
const index = accu.findIndex(({
|
|
2633
|
+
const index = accu.findIndex(({ value }) => value === key);
|
|
2617
2634
|
accu = [accu[index], ...accu.filter((item, itemIndex) => index !== itemIndex)];
|
|
2618
2635
|
return accu;
|
|
2619
2636
|
}, roles);
|
|
2620
2637
|
});
|
|
2621
2638
|
|
|
2622
2639
|
// src/store.ts
|
|
2640
|
+
var import_react_redux = require("react-redux");
|
|
2623
2641
|
var import_helpers6 = require("@northern.tech/utils/helpers");
|
|
2624
2642
|
var import_toolkit16 = require("@reduxjs/toolkit");
|
|
2625
2643
|
var { setSnackbar, uploadProgress } = actions_default;
|
|
2626
2644
|
var keys = ["sessionDeploymentChecker", settingsKeys.initialized];
|
|
2627
|
-
var resetEnvironment = () =>
|
|
2628
|
-
keys.map((key) => window.sessionStorage.removeItem(key));
|
|
2629
|
-
};
|
|
2645
|
+
var resetEnvironment = () => keys.forEach((key) => window.sessionStorage.removeItem(key));
|
|
2630
2646
|
resetEnvironment();
|
|
2631
2647
|
var commonErrorFallback = "Please check your connection.";
|
|
2632
2648
|
var commonErrorHandler = (err, errorContext, dispatch, fallback, mightBeAuthRelated = false) => {
|
|
@@ -2652,6 +2668,14 @@ var sessionReducer = (state, action) => {
|
|
|
2652
2668
|
}
|
|
2653
2669
|
return rootReducer(state, action);
|
|
2654
2670
|
};
|
|
2671
|
+
var rejectionLoggerMiddleware = () => (next) => (action) => {
|
|
2672
|
+
if (action.type.endsWith("/rejected")) {
|
|
2673
|
+
const { error } = action;
|
|
2674
|
+
console.error("Rejection in action:", action);
|
|
2675
|
+
console.error(error.stack);
|
|
2676
|
+
}
|
|
2677
|
+
return next(action);
|
|
2678
|
+
};
|
|
2655
2679
|
var getConfiguredStore = (options = {}) => {
|
|
2656
2680
|
const { preloadedState = {}, ...config } = options;
|
|
2657
2681
|
return (0, import_toolkit16.configureStore)({
|
|
@@ -2667,7 +2691,7 @@ var getConfiguredStore = (options = {}) => {
|
|
|
2667
2691
|
ignoredActionPaths: ["uploads", "snackbar", /payload\..*$/],
|
|
2668
2692
|
ignoredPaths: ["app.uploadsById", "app.snackbar", "organization.externalDeviceIntegrations"]
|
|
2669
2693
|
}
|
|
2670
|
-
})
|
|
2694
|
+
}).concat(rejectionLoggerMiddleware)
|
|
2671
2695
|
});
|
|
2672
2696
|
};
|
|
2673
2697
|
var store = getConfiguredStore({
|
|
@@ -2784,6 +2808,7 @@ var setSearchState = (0, import_toolkit17.createAsyncThunk)(`${sliceName}/setSea
|
|
|
2784
2808
|
|
|
2785
2809
|
// src/deploymentsSlice/thunks.ts
|
|
2786
2810
|
var import_helpers8 = require("@northern.tech/utils/helpers");
|
|
2811
|
+
var import_tracking = __toESM(require("@northern.tech/utils/tracking"), 1);
|
|
2787
2812
|
var import_toolkit18 = require("@reduxjs/toolkit");
|
|
2788
2813
|
var import_validator = require("validator");
|
|
2789
2814
|
var { receivedDevice, setSnackbar: setSnackbar2 } = actions_default;
|
|
@@ -2840,6 +2865,26 @@ var getDeploymentsByStatus2 = (0, import_toolkit18.createAsyncThunk)(`${sliceNam
|
|
|
2840
2865
|
return Promise.all(tasks);
|
|
2841
2866
|
});
|
|
2842
2867
|
});
|
|
2868
|
+
var isWithinFirstMonth = (expirationDate) => {
|
|
2869
|
+
if (!expirationDate) {
|
|
2870
|
+
return false;
|
|
2871
|
+
}
|
|
2872
|
+
const endOfFirstMonth = new Date(expirationDate);
|
|
2873
|
+
endOfFirstMonth.setMonth(endOfFirstMonth.getMonth() - 11);
|
|
2874
|
+
return endOfFirstMonth > /* @__PURE__ */ new Date();
|
|
2875
|
+
};
|
|
2876
|
+
var trackDeploymentCreation = (totalDeploymentCount, hasDeployments, trial_expiration) => {
|
|
2877
|
+
import_tracking.default.event({ category: "deployments", action: "create" });
|
|
2878
|
+
if (!totalDeploymentCount) {
|
|
2879
|
+
if (!hasDeployments) {
|
|
2880
|
+
import_tracking.default.event({ category: "deployments", action: "create_initial_deployment" });
|
|
2881
|
+
if (isWithinFirstMonth(trial_expiration)) {
|
|
2882
|
+
import_tracking.default.event({ category: "deployments", action: "create_initial_deployment_first_month" });
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
import_tracking.default.event({ category: "deployments", action: "create_initial_deployment_user" });
|
|
2886
|
+
}
|
|
2887
|
+
};
|
|
2843
2888
|
var MAX_PREVIOUS_PHASES_COUNT = 5;
|
|
2844
2889
|
var createDeployment = (0, import_toolkit18.createAsyncThunk)(`${sliceName2}/createDeployment`, ({ newDeployment, hasNewRetryDefault = false }, { dispatch, getState }) => {
|
|
2845
2890
|
let request;
|
|
@@ -2850,6 +2895,9 @@ var createDeployment = (0, import_toolkit18.createAsyncThunk)(`${sliceName2}/cre
|
|
|
2850
2895
|
} else {
|
|
2851
2896
|
request = general_api_default.post(`${deploymentsApiUrl}/deployments`, newDeployment);
|
|
2852
2897
|
}
|
|
2898
|
+
const totalDeploymentCount = Object.values(getDeploymentsByStatus(getState())).reduce((accu, item) => accu + item.total, 0);
|
|
2899
|
+
const { hasDeployments } = getGlobalSettings(getState());
|
|
2900
|
+
const { trial_expiration } = getOrganization(getState());
|
|
2853
2901
|
return request.catch((err) => commonErrorHandler(err, "Error creating deployment.", dispatch)).then((data) => {
|
|
2854
2902
|
const lastslashindex = data.headers.location.lastIndexOf("/");
|
|
2855
2903
|
const deploymentId = data.headers.location.substring(lastslashindex + 1);
|
|
@@ -2864,6 +2912,7 @@ var createDeployment = (0, import_toolkit18.createAsyncThunk)(`${sliceName2}/cre
|
|
|
2864
2912
|
dispatch(getSingleDeployment(deploymentId)),
|
|
2865
2913
|
dispatch(setSnackbar2("Deployment created successfully", TIMEOUTS.fiveSeconds))
|
|
2866
2914
|
];
|
|
2915
|
+
trackDeploymentCreation(totalDeploymentCount, hasDeployments, trial_expiration);
|
|
2867
2916
|
const { canManageUsers } = getUserCapabilities(getState());
|
|
2868
2917
|
if (canManageUsers) {
|
|
2869
2918
|
const { phases, retries } = newDeployment;
|
|
@@ -3538,7 +3587,7 @@ var getDevicesByStatus2 = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/
|
|
|
3538
3587
|
page = defaultPage2,
|
|
3539
3588
|
perPage = defaultPerPage2,
|
|
3540
3589
|
sortOptions = [],
|
|
3541
|
-
selectedAttributes =
|
|
3590
|
+
selectedAttributes = getSelectedDeviceAttribute(getState())
|
|
3542
3591
|
} = options;
|
|
3543
3592
|
const state = getState();
|
|
3544
3593
|
const { applicableFilters, filterTerms } = convertDeviceListStateToFilters({
|
|
@@ -3651,7 +3700,6 @@ var getReportingLimits = (0, import_toolkit19.createAsyncThunk)(
|
|
|
3651
3700
|
})
|
|
3652
3701
|
);
|
|
3653
3702
|
var ensureVersionString = (software, fallback) => software.length && software !== "artifact_name" ? software.endsWith(".version") ? software : `${software}.version` : fallback;
|
|
3654
|
-
var REPORT_CHART_SIZE_LIMIT = 6;
|
|
3655
3703
|
var getSingleReportData = (reportConfig, groups) => {
|
|
3656
3704
|
const { attribute, group, software = "" } = reportConfig;
|
|
3657
3705
|
const filters = [{ key: "status", scope: "identity", operator: DEVICE_FILTERING_OPTIONS.$eq.key, value: "accepted" }];
|
|
@@ -3731,9 +3779,17 @@ var getDeviceConnect = (0, import_toolkit19.createAsyncThunk)(
|
|
|
3731
3779
|
({ data }) => Promise.all([dispatch(actions3.receivedDevice({ connect_status: data.status, connect_updated_ts: data.updated_ts, id })), Promise.resolve(data)])
|
|
3732
3780
|
)
|
|
3733
3781
|
);
|
|
3782
|
+
var updateTypeMap = { deploymentUpdate: "check-update", inventoryUpdate: "send-inventory" };
|
|
3783
|
+
var triggerDeviceUpdate = (0, import_toolkit19.createAsyncThunk)(
|
|
3784
|
+
`${sliceName3}/triggerDeviceUpdate`,
|
|
3785
|
+
({ id, type }, { dispatch }) => general_api_default.post(`${deviceConnect}/devices/${id}/${updateTypeMap[type] ?? updateTypeMap.deploymentUpdate}`).then(
|
|
3786
|
+
() => new Promise((resolve) => setTimeout(() => resolve(dispatch(getDeviceById2(id))), TIMEOUTS.threeSeconds))
|
|
3787
|
+
)
|
|
3788
|
+
);
|
|
3734
3789
|
var getSessionDetails = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/getSessionDetails`, ({ sessionId, deviceId, userId, startDate, endDate }) => {
|
|
3735
|
-
const
|
|
3736
|
-
const
|
|
3790
|
+
const { start: startUnix, end: endUnix } = (0, import_helpers9.dateRangeToUnix)(startDate, endDate);
|
|
3791
|
+
const createdAfter = startDate ? `&created_after=${startUnix}` : "";
|
|
3792
|
+
const createdBefore = endDate ? `&created_before=${endUnix}` : "";
|
|
3737
3793
|
const objectSearch = `&object_id=${deviceId}`;
|
|
3738
3794
|
return general_api_default.get(`${auditLogsApiUrl}/logs?per_page=500${createdAfter}${createdBefore}&actor_id=${userId}${objectSearch}`).then(
|
|
3739
3795
|
({ data: auditLogEntries }) => {
|
|
@@ -3832,12 +3888,12 @@ var deleteAuthset = (0, import_toolkit19.createAsyncThunk)(
|
|
|
3832
3888
|
);
|
|
3833
3889
|
var preauthDevice = (0, import_toolkit19.createAsyncThunk)(
|
|
3834
3890
|
`${sliceName3}/preauthDevice`,
|
|
3835
|
-
(authset, { dispatch }) => general_api_default.post(`${deviceAuthV2}/devices`, authset).catch((err) => {
|
|
3891
|
+
(authset, { dispatch, rejectWithValue }) => general_api_default.post(`${deviceAuthV2}/devices`, authset).then(() => Promise.resolve(dispatch(setSnackbar3("Device was successfully added to the preauthorization list", TIMEOUTS.fiveSeconds)))).catch((err) => {
|
|
3836
3892
|
if (err.response.status === 409) {
|
|
3837
|
-
return
|
|
3893
|
+
return rejectWithValue("A device with a matching identity data set already exists");
|
|
3838
3894
|
}
|
|
3839
3895
|
return commonErrorHandler(err, "The device could not be added:", dispatch);
|
|
3840
|
-
})
|
|
3896
|
+
})
|
|
3841
3897
|
);
|
|
3842
3898
|
var decommissionDevice = (0, import_toolkit19.createAsyncThunk)(
|
|
3843
3899
|
`${sliceName3}/decommissionDevice`,
|
|
@@ -4083,7 +4139,7 @@ var handleLoginError = (err, { token2fa: has2FA, password }, rejectWithValue) =>
|
|
|
4083
4139
|
}
|
|
4084
4140
|
const twoFAError = is2FABackend ? " and verification code" : "";
|
|
4085
4141
|
const errorMessage = `There was a problem logging in. Please check your email${twoFAError ? "," : " and"} password${twoFAError}. If you still have problems, contact an administrator.`;
|
|
4086
|
-
return Promise.reject(dispatch(setSnackbar4((0, import_helpers10.preformatWithRequestID)(err.response, errorMessage),
|
|
4142
|
+
return Promise.reject(dispatch(setSnackbar4({ message: (0, import_helpers10.preformatWithRequestID)(err.response, errorMessage), action: "Copy to clipboard" })));
|
|
4087
4143
|
};
|
|
4088
4144
|
var loginUser = (0, import_toolkit21.createAsyncThunk)(
|
|
4089
4145
|
`${sliceName8}/loginUser`,
|
|
@@ -4107,19 +4163,16 @@ var loginUser = (0, import_toolkit21.createAsyncThunk)(
|
|
|
4107
4163
|
const expiresAt = stayLoggedIn ? void 0 : now.toISOString();
|
|
4108
4164
|
setSessionInfo({ token, expiresAt });
|
|
4109
4165
|
cookies3.remove("JWT", { path: "/" });
|
|
4110
|
-
return (
|
|
4111
|
-
|
|
4112
|
-
Promise.
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
window.
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
return Promise.resolve(dispatch(actions8.successfullyLoggedIn({ expiresAt, token })));
|
|
4121
|
-
})
|
|
4122
|
-
);
|
|
4166
|
+
return dispatch(getUser(OWN_USER_ID)).unwrap().catch((e) => {
|
|
4167
|
+
cleanUp();
|
|
4168
|
+
return Promise.reject(dispatch(setSnackbar4((0, import_helpers10.extractErrorMessage)(e))));
|
|
4169
|
+
}).then(() => {
|
|
4170
|
+
window.sessionStorage.removeItem("pendings-redirect");
|
|
4171
|
+
if (window.location.pathname !== "/ui/") {
|
|
4172
|
+
window.location.replace("/ui/");
|
|
4173
|
+
}
|
|
4174
|
+
return Promise.resolve(dispatch(actions8.successfullyLoggedIn({ expiresAt, token })));
|
|
4175
|
+
});
|
|
4123
4176
|
})
|
|
4124
4177
|
);
|
|
4125
4178
|
var logoutUser = (0, import_toolkit21.createAsyncThunk)(`${sliceName8}/logoutUser`, (_, { dispatch, getState }) => {
|
|
@@ -4137,6 +4190,7 @@ var switchUserOrganization = (0, import_toolkit21.createAsyncThunk)(`${sliceName
|
|
|
4137
4190
|
return Promise.reject();
|
|
4138
4191
|
}
|
|
4139
4192
|
return general_api_default.get(`${useradmApiUrlv1}/users/tenants/${tenantId}/token`).then(({ data: token }) => {
|
|
4193
|
+
window.sessionStorage.setItem("tenantChanged", "true");
|
|
4140
4194
|
setSessionInfo({ ...getSessionInfo(), token });
|
|
4141
4195
|
window.location.reload();
|
|
4142
4196
|
});
|
|
@@ -4177,11 +4231,18 @@ var verify2FA = (0, import_toolkit21.createAsyncThunk)(
|
|
|
4177
4231
|
);
|
|
4178
4232
|
var getUserList = (0, import_toolkit21.createAsyncThunk)(
|
|
4179
4233
|
`${sliceName8}/getUserList`,
|
|
4180
|
-
(_, { dispatch }) => general_api_default.get(`${useradmApiUrlv1}/users`).then((res) => {
|
|
4181
|
-
const
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4234
|
+
(_, { dispatch, getState }) => general_api_default.get(`${useradmApiUrlv1}/users`).then((res) => {
|
|
4235
|
+
const currentUsersById = getUsersById(getState());
|
|
4236
|
+
const users = res.data.reduce(
|
|
4237
|
+
(accu, item) => {
|
|
4238
|
+
accu[item.id] = {
|
|
4239
|
+
...accu[item.id],
|
|
4240
|
+
...item
|
|
4241
|
+
};
|
|
4242
|
+
return accu;
|
|
4243
|
+
},
|
|
4244
|
+
{ ...currentUsersById }
|
|
4245
|
+
);
|
|
4185
4246
|
return dispatch(actions8.receivedUserList(users));
|
|
4186
4247
|
}).catch((err) => commonErrorHandler(err, `Users couldn't be loaded.`, dispatch, commonErrorFallback))
|
|
4187
4248
|
);
|
|
@@ -4190,9 +4251,7 @@ var getUser = (0, import_toolkit21.createAsyncThunk)(
|
|
|
4190
4251
|
(id, { dispatch, rejectWithValue }) => general_api_default.get(`${useradmApiUrlv1}/users/${id}`).then(
|
|
4191
4252
|
({ data: user }) => Promise.all([
|
|
4192
4253
|
dispatch(actions8.receivedUser(user)),
|
|
4193
|
-
// @ts-ignore
|
|
4194
4254
|
dispatch(setHideAnnouncement({ shouldHide: false, userId: user.id })),
|
|
4195
|
-
// @ts-ignore
|
|
4196
4255
|
dispatch(updateUserColumnSettings({ currentUserId: user.id })),
|
|
4197
4256
|
user
|
|
4198
4257
|
])
|
|
@@ -4239,10 +4298,7 @@ var createUser = (0, import_toolkit21.createAsyncThunk)(
|
|
|
4239
4298
|
);
|
|
4240
4299
|
var removeUser = (0, import_toolkit21.createAsyncThunk)(
|
|
4241
4300
|
`${sliceName8}/removeUser`,
|
|
4242
|
-
(userId, { dispatch }) => (
|
|
4243
|
-
// @ts-ignore
|
|
4244
|
-
general_api_default.delete(`${useradmApiUrlv1}/users/${userId}`).then(() => Promise.all([dispatch(actions8.removedUser(userId)), dispatch(getUserList()), dispatch(setSnackbar4(userActions.remove.successMessage))])).catch((err) => userActionErrorHandler(err, "remove", dispatch))
|
|
4245
|
-
)
|
|
4301
|
+
(userId, { dispatch }) => general_api_default.delete(`${useradmApiUrlv1}/users/${userId}`).then(() => Promise.all([dispatch(actions8.removedUser(userId)), dispatch(getUserList()), dispatch(setSnackbar4(userActions.remove.successMessage))])).catch((err) => userActionErrorHandler(err, "remove", dispatch))
|
|
4246
4302
|
);
|
|
4247
4303
|
var editUser = (0, import_toolkit21.createAsyncThunk)(
|
|
4248
4304
|
`${sliceName8}/editUser`,
|
|
@@ -4263,7 +4319,7 @@ var enableUser2fa = (0, import_toolkit21.createAsyncThunk)(
|
|
|
4263
4319
|
);
|
|
4264
4320
|
var disableUser2fa = (0, import_toolkit21.createAsyncThunk)(
|
|
4265
4321
|
`${sliceName8}/disableUser2fa`,
|
|
4266
|
-
(userId = OWN_USER_ID, { dispatch }) => general_api_default.post(`${useradmApiUrlv1}/users/${userId}/2fa/disable`).catch((err) => commonErrorHandler(err, `There was an error disabling Two Factor authentication for the user.`, dispatch)).then(() => Promise.
|
|
4322
|
+
(userId = OWN_USER_ID, { dispatch }) => general_api_default.post(`${useradmApiUrlv1}/users/${userId}/2fa/disable`).catch((err) => commonErrorHandler(err, `There was an error disabling Two Factor authentication for the user.`, dispatch)).then(() => Promise.all([dispatch(getUser(userId)), dispatch(actions8.receivedQrCode(null))]))
|
|
4267
4323
|
);
|
|
4268
4324
|
var mapHttpPermission = (permission) => Object.entries(uiPermissionsByArea).reduce(
|
|
4269
4325
|
(accu, [area, definition]) => {
|
|
@@ -4416,7 +4472,6 @@ var getPermissionSets = (0, import_toolkit21.createAsyncThunk)(
|
|
|
4416
4472
|
accu[permissionSet.name] = permissionSetObject;
|
|
4417
4473
|
return accu;
|
|
4418
4474
|
},
|
|
4419
|
-
// @ts-ignore
|
|
4420
4475
|
{ ...getState().users.permissionSetsById }
|
|
4421
4476
|
);
|
|
4422
4477
|
return Promise.all([dispatch(actions8.receivedPermissionSets(permissionSets)), permissionSets]);
|
|
@@ -4509,7 +4564,6 @@ var transformRoleDataToRole = (roleData, roleState = {}) => {
|
|
|
4509
4564
|
role: {
|
|
4510
4565
|
...emptyRole,
|
|
4511
4566
|
name,
|
|
4512
|
-
// @ts-ignore
|
|
4513
4567
|
description: description ? description : roleState.description,
|
|
4514
4568
|
uiPermissions: {
|
|
4515
4569
|
...emptyUiPermissions,
|
|
@@ -4552,10 +4606,7 @@ var editRole = (0, import_toolkit21.createAsyncThunk)(`${sliceName8}/editRole`,
|
|
|
4552
4606
|
});
|
|
4553
4607
|
var removeRole = (0, import_toolkit21.createAsyncThunk)(
|
|
4554
4608
|
`${sliceName8}/removeRole`,
|
|
4555
|
-
(roleId, { dispatch }) => (
|
|
4556
|
-
// @ts-ignore
|
|
4557
|
-
general_api_default.delete(`${useradmApiUrlv2}/roles/${roleId}`).then(() => Promise.all([dispatch(actions8.removedRole(roleId)), dispatch(getRoles()), dispatch(setSnackbar4(roleActions.remove.successMessage))])).catch((err) => roleActionErrorHandler(err, "remove", dispatch))
|
|
4558
|
-
)
|
|
4609
|
+
(roleId, { dispatch }) => general_api_default.delete(`${useradmApiUrlv2}/roles/${roleId}`).then(() => Promise.all([dispatch(actions8.removedRole(roleId)), dispatch(getRoles()), dispatch(setSnackbar4(roleActions.remove.successMessage))])).catch((err) => roleActionErrorHandler(err, "remove", dispatch))
|
|
4559
4610
|
);
|
|
4560
4611
|
var getGlobalSettings2 = (0, import_toolkit21.createAsyncThunk)(
|
|
4561
4612
|
`${sliceName8}/getGlobalSettings`,
|
|
@@ -4566,7 +4617,6 @@ var getGlobalSettings2 = (0, import_toolkit21.createAsyncThunk)(
|
|
|
4566
4617
|
);
|
|
4567
4618
|
var saveGlobalSettings = (0, import_toolkit21.createAsyncThunk)(
|
|
4568
4619
|
`${sliceName8}/saveGlobalSettings`,
|
|
4569
|
-
// @ts-ignore
|
|
4570
4620
|
({ beOptimistic = false, notify = false, ...settings }, { dispatch, getState }) => {
|
|
4571
4621
|
if (!window.sessionStorage.getItem(settingsKeys.initialized) && !beOptimistic) {
|
|
4572
4622
|
return;
|
|
@@ -4612,11 +4662,9 @@ var saveUserSettings = (0, import_toolkit21.createAsyncThunk)(`${sliceName8}/sav
|
|
|
4612
4662
|
const tooltipState = getTooltipsState(getState());
|
|
4613
4663
|
const updatedSettings = {
|
|
4614
4664
|
...userSettings,
|
|
4615
|
-
// @ts-ignore
|
|
4616
4665
|
...settings,
|
|
4617
4666
|
onboarding: {
|
|
4618
4667
|
...onboardingState,
|
|
4619
|
-
// @ts-ignore
|
|
4620
4668
|
...settings.onboarding
|
|
4621
4669
|
},
|
|
4622
4670
|
tooltips: tooltipState
|
|
@@ -4660,10 +4708,7 @@ var generateToken = (0, import_toolkit21.createAsyncThunk)(
|
|
|
4660
4708
|
);
|
|
4661
4709
|
var revokeToken = (0, import_toolkit21.createAsyncThunk)(
|
|
4662
4710
|
`${sliceName8}/revokeToken`,
|
|
4663
|
-
(token, { dispatch }) => (
|
|
4664
|
-
// @ts-ignore
|
|
4665
|
-
general_api_default.delete(`${useradmApiUrlv1}/settings/tokens/${token.id}`).then(() => Promise.resolve(dispatch(getTokens())))
|
|
4666
|
-
)
|
|
4711
|
+
(token, { dispatch }) => general_api_default.delete(`${useradmApiUrlv1}/settings/tokens/${token.id}`).then(() => Promise.resolve(dispatch(getTokens())))
|
|
4667
4712
|
);
|
|
4668
4713
|
var setTooltipReadState = (0, import_toolkit21.createAsyncThunk)(`${sliceName8}/setTooltipReadState`, ({ persist, ...remainder }, { dispatch }) => {
|
|
4669
4714
|
let tasks = [dispatch(actions8.setTooltipState(remainder))];
|
|
@@ -4672,23 +4717,20 @@ var setTooltipReadState = (0, import_toolkit21.createAsyncThunk)(`${sliceName8}/
|
|
|
4672
4717
|
}
|
|
4673
4718
|
return Promise.all(tasks);
|
|
4674
4719
|
});
|
|
4675
|
-
var setAllTooltipsReadState = (0, import_toolkit21.createAsyncThunk)(`${sliceName8}/toggleHelptips`, (
|
|
4676
|
-
const updatedTips =
|
|
4720
|
+
var setAllTooltipsReadState = (0, import_toolkit21.createAsyncThunk)(`${sliceName8}/toggleHelptips`, (readState = READ_STATES.read, { dispatch }) => {
|
|
4721
|
+
const updatedTips = Object.keys(import_helptips.HELPTOOLTIPS).reduce((accu, id) => ({ ...accu, [id]: { readState } }), {});
|
|
4677
4722
|
return Promise.resolve(dispatch(actions8.setTooltipsState(updatedTips))).then(() => dispatch(saveUserSettings()));
|
|
4678
4723
|
});
|
|
4679
4724
|
var submitFeedback = (0, import_toolkit21.createAsyncThunk)(
|
|
4680
4725
|
`${sliceName8}/submitFeedback`,
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
setTimeout(() => dispatch(actions8.setShowFeedbackDialog(false)), TIMEOUTS.threeSeconds);
|
|
4690
|
-
});
|
|
4691
|
-
}
|
|
4726
|
+
({ satisfaction, feedback, ...meta }, { dispatch }) => general_api_default.post(`${tenantadmApiUrlv2}/contact/support`, {
|
|
4727
|
+
subject: "feedback submission",
|
|
4728
|
+
body: JSON.stringify({ feedback, satisfaction, meta })
|
|
4729
|
+
}).then(() => {
|
|
4730
|
+
const today = /* @__PURE__ */ new Date();
|
|
4731
|
+
dispatch(saveUserSettings({ feedbackCollectedAt: today.toISOString().split("T")[0] }));
|
|
4732
|
+
setTimeout(() => dispatch(actions8.setShowFeedbackDialog(false)), TIMEOUTS.threeSeconds);
|
|
4733
|
+
})
|
|
4692
4734
|
);
|
|
4693
4735
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4694
4736
|
0 && (module.exports = {
|