@northern.tech/store 0.15.0 → 0.17.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.
Files changed (95) hide show
  1. package/dist/actions.cjs +3 -1
  2. package/dist/actions.cjs.map +1 -1
  3. package/dist/actions.js +5 -5
  4. package/dist/appSlice/index.cjs +1 -0
  5. package/dist/appSlice/index.cjs.map +1 -1
  6. package/dist/appSlice/index.js +1 -1
  7. package/dist/appSlice/mocks.cjs +1 -0
  8. package/dist/appSlice/mocks.cjs.map +1 -1
  9. package/dist/appSlice/mocks.js +1 -1
  10. package/dist/appSlice/thunks.cjs +14 -1
  11. package/dist/appSlice/thunks.cjs.map +1 -1
  12. package/dist/appSlice/thunks.js +13 -13
  13. package/dist/{chunk-O3DM73SJ.js → chunk-6WJI4MOP.js} +2 -1
  14. package/dist/chunk-6WJI4MOP.js.map +1 -0
  15. package/dist/{chunk-LROF3FA4.js → chunk-76GD35G3.js} +22 -22
  16. package/dist/{chunk-ZNSCXTKF.js → chunk-E2UO6BJ3.js} +10 -10
  17. package/dist/{chunk-KE7R7GYG.js → chunk-GL634FKF.js} +9 -9
  18. package/dist/{chunk-2IGDYPTR.js → chunk-JDSAICR3.js} +8 -8
  19. package/dist/{chunk-X7NEALMI.js → chunk-O7DR57RN.js} +13 -1
  20. package/dist/{chunk-X7NEALMI.js.map → chunk-O7DR57RN.js.map} +1 -1
  21. package/dist/{chunk-OEFIAB26.js → chunk-QHGAJE7K.js} +8 -8
  22. package/dist/{chunk-3YJY7KQW.js → chunk-QL6FN2JC.js} +4 -2
  23. package/dist/{chunk-3YJY7KQW.js.map → chunk-QL6FN2JC.js.map} +1 -1
  24. package/dist/{chunk-BTE6UIGL.js → chunk-QXS7I6BE.js} +7 -7
  25. package/dist/{chunk-KJ4BPXMB.js → chunk-YR65C62H.js} +3 -2
  26. package/dist/chunk-YR65C62H.js.map +1 -0
  27. package/dist/commonSelectors.cjs +11 -0
  28. package/dist/commonSelectors.cjs.map +1 -1
  29. package/dist/commonSelectors.js +4 -4
  30. package/dist/deploymentsSlice/thunks.cjs +14 -1
  31. package/dist/deploymentsSlice/thunks.cjs.map +1 -1
  32. package/dist/deploymentsSlice/thunks.js +13 -13
  33. package/dist/devicesSlice/selectors.cjs +13 -0
  34. package/dist/devicesSlice/selectors.cjs.map +1 -1
  35. package/dist/devicesSlice/selectors.d.cts +62 -1
  36. package/dist/devicesSlice/selectors.d.ts +62 -1
  37. package/dist/devicesSlice/selectors.js +3 -1
  38. package/dist/devicesSlice/thunks.cjs +14 -1
  39. package/dist/devicesSlice/thunks.cjs.map +1 -1
  40. package/dist/devicesSlice/thunks.js +13 -13
  41. package/dist/monitorSlice/thunks.cjs +14 -1
  42. package/dist/monitorSlice/thunks.cjs.map +1 -1
  43. package/dist/monitorSlice/thunks.js +11 -11
  44. package/dist/onboardingSlice/thunks.cjs +14 -1
  45. package/dist/onboardingSlice/thunks.cjs.map +1 -1
  46. package/dist/onboardingSlice/thunks.js +13 -13
  47. package/dist/organizationSlice/thunks.cjs +14 -1
  48. package/dist/organizationSlice/thunks.cjs.map +1 -1
  49. package/dist/organizationSlice/thunks.js +13 -13
  50. package/dist/releasesSlice/thunks.cjs +14 -1
  51. package/dist/releasesSlice/thunks.cjs.map +1 -1
  52. package/dist/releasesSlice/thunks.js +11 -11
  53. package/dist/selectors.cjs +16 -0
  54. package/dist/selectors.cjs.map +1 -1
  55. package/dist/selectors.d.cts +2 -2
  56. package/dist/selectors.d.ts +2 -2
  57. package/dist/selectors.js +17 -13
  58. package/dist/store.cjs +3 -1
  59. package/dist/store.cjs.map +1 -1
  60. package/dist/store.js +6 -6
  61. package/dist/storehooks.cjs +15 -1
  62. package/dist/storehooks.cjs.map +1 -1
  63. package/dist/storehooks.js +15 -14
  64. package/dist/storehooks.js.map +1 -1
  65. package/dist/thunks.cjs +14 -1
  66. package/dist/thunks.cjs.map +1 -1
  67. package/dist/thunks.js +14 -14
  68. package/dist/useDeploymentDevice.cjs +14 -1
  69. package/dist/useDeploymentDevice.cjs.map +1 -1
  70. package/dist/useDeploymentDevice.js +15 -15
  71. package/dist/usersSlice/index.cjs +2 -1
  72. package/dist/usersSlice/index.cjs.map +1 -1
  73. package/dist/usersSlice/index.d.cts +1 -0
  74. package/dist/usersSlice/index.d.ts +1 -0
  75. package/dist/usersSlice/index.js +1 -1
  76. package/dist/usersSlice/mocks.cjs +2 -1
  77. package/dist/usersSlice/mocks.cjs.map +1 -1
  78. package/dist/usersSlice/mocks.js +1 -1
  79. package/dist/usersSlice/selectors.cjs +3 -0
  80. package/dist/usersSlice/selectors.cjs.map +1 -1
  81. package/dist/usersSlice/selectors.d.cts +2 -1
  82. package/dist/usersSlice/selectors.d.ts +2 -1
  83. package/dist/usersSlice/selectors.js +3 -1
  84. package/dist/usersSlice/thunks.cjs +14 -1
  85. package/dist/usersSlice/thunks.cjs.map +1 -1
  86. package/dist/usersSlice/thunks.js +13 -13
  87. package/package.json +2 -1
  88. package/dist/chunk-KJ4BPXMB.js.map +0 -1
  89. package/dist/chunk-O3DM73SJ.js.map +0 -1
  90. /package/dist/{chunk-LROF3FA4.js.map → chunk-76GD35G3.js.map} +0 -0
  91. /package/dist/{chunk-ZNSCXTKF.js.map → chunk-E2UO6BJ3.js.map} +0 -0
  92. /package/dist/{chunk-KE7R7GYG.js.map → chunk-GL634FKF.js.map} +0 -0
  93. /package/dist/{chunk-2IGDYPTR.js.map → chunk-JDSAICR3.js.map} +0 -0
  94. /package/dist/{chunk-OEFIAB26.js.map → chunk-QHGAJE7K.js.map} +0 -0
  95. /package/dist/{chunk-BTE6UIGL.js.map → chunk-QXS7I6BE.js.map} +0 -0
@@ -3,33 +3,33 @@ import {
3
3
  setFirstLoginAfterSignup,
4
4
  setOfflineThreshold,
5
5
  setSearchState
6
- } from "../chunk-LROF3FA4.js";
7
- import "../chunk-BTE6UIGL.js";
8
- import "../chunk-OEFIAB26.js";
9
- import "../chunk-ZNSCXTKF.js";
6
+ } from "../chunk-76GD35G3.js";
10
7
  import "../chunk-Y3DJIMEN.js";
8
+ import "../chunk-QXS7I6BE.js";
9
+ import "../chunk-QHGAJE7K.js";
11
10
  import "../chunk-5M6EUVNO.js";
12
- import "../chunk-KE7R7GYG.js";
13
- import "../chunk-TRKA7XYU.js";
14
- import "../chunk-KJ4BPXMB.js";
11
+ import "../chunk-E2UO6BJ3.js";
12
+ import "../chunk-GL634FKF.js";
13
+ import "../chunk-YR65C62H.js";
15
14
  import "../chunk-VCEFZTWS.js";
16
- import "../chunk-PVCHKW35.js";
15
+ import "../chunk-TRKA7XYU.js";
17
16
  import "../chunk-CQXDAXQF.js";
18
17
  import "../chunk-VODRLEDP.js";
19
- import "../chunk-O3DM73SJ.js";
18
+ import "../chunk-PVCHKW35.js";
20
19
  import "../chunk-OLKM53RL.js";
20
+ import "../chunk-6WJI4MOP.js";
21
21
  import "../chunk-FDSMCFV5.js";
22
22
  import "../chunk-53W2NRSL.js";
23
23
  import "../chunk-NMAXZ3ZY.js";
24
- import "../chunk-2IGDYPTR.js";
24
+ import "../chunk-JDSAICR3.js";
25
25
  import "../chunk-GEQ2QQEE.js";
26
- import "../chunk-3YJY7KQW.js";
26
+ import "../chunk-QL6FN2JC.js";
27
27
  import "../chunk-3NOV7X4M.js";
28
28
  import "../chunk-YO22XLHI.js";
29
29
  import "../chunk-JIS4PA3R.js";
30
- import "../chunk-WR6RQKF5.js";
31
- import "../chunk-X7NEALMI.js";
30
+ import "../chunk-O7DR57RN.js";
32
31
  import "../chunk-4BHM6WVX.js";
32
+ import "../chunk-WR6RQKF5.js";
33
33
  import "../chunk-U5TPV5X5.js";
34
34
  import "../chunk-WWED74SG.js";
35
35
  import "../chunk-2DYA3X77.js";
@@ -34,6 +34,7 @@ var initialState = {
34
34
  hasFeedbackEnabled: false,
35
35
  hasMonitor: false,
36
36
  hasMCUEnabled: false,
37
+ hasOldTheme: false,
37
38
  hasReporting: false,
38
39
  isHosted: true,
39
40
  isEnterprise: false
@@ -154,4 +155,4 @@ export {
154
155
  actions,
155
156
  appSlice_default
156
157
  };
157
- //# sourceMappingURL=chunk-O3DM73SJ.js.map
158
+ //# sourceMappingURL=chunk-6WJI4MOP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/appSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type { SnackbarProps } from '@mui/material';\n\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { SortOptions } from '../constants';\nimport { SORTING_OPTIONS } from '../constants';\n\nexport const sliceName = 'app';\n\nconst getYesterday = () => {\n const today = new Date();\n today.setDate(today.getDate() - 1);\n return today.toISOString();\n};\n\nexport type Repository = {\n name: string;\n version: string;\n};\n\nexport type VersionRelease = Partial<{ [versionInfo: string]: VersionRelease }> & {\n release?: string;\n release_date?: string;\n repos?: Repository[];\n supported_until?: string;\n};\n\nexport type SaasVersion = {\n date: string;\n tag: string;\n};\n\nexport type ReleaseData = {\n lts: string[];\n releases: {\n [version: string]: VersionRelease;\n };\n saas: SaasVersion[];\n};\nexport type TagData = { name: string }[];\n\nexport interface SnackbarContent extends Pick<SnackbarProps, 'action' | 'autoHideDuration' | 'message' | 'open'> {\n preventClickToCopy?: boolean;\n}\n\nexport interface SearchState {\n deviceIds: string[];\n isSearching: boolean;\n page?: number;\n perPage?: number;\n searchTerm: string;\n searchTotal: number;\n sort: SortOptions;\n}\n\nexport interface Upload {\n cancelSource: any;\n inprogress?: boolean;\n name?: string;\n progress: number;\n size?: number;\n}\n\ntype UILatestRelease = {\n releaseDate: string;\n repos: Record<string, string>;\n};\n\ntype VersionInformation = {\n [key: string]: string | UILatestRelease | undefined;\n backend?: string;\n GUI?: string;\n latestRelease?: UILatestRelease;\n};\n\nexport type SentryConfig = {\n isReduxEnabled?: string; // no parsing done here as this has to be accessed outside of the store\n location: string;\n replaysSessionSampleRate?: number;\n tracesSampleRate?: number;\n};\n\nexport type AppSliceType = {\n appInitDone: boolean;\n cancelSource: any;\n commit: string;\n demoArtifactLink: string;\n docsVersion: string;\n features: Record<string, boolean>;\n feedbackProbability: number;\n firstLoginAfterSignup: boolean;\n hostAddress: string | null;\n hostedAnnouncement: string;\n newThreshold: string;\n offlineThreshold: string;\n recaptchaSiteKey: string;\n searchState: SearchState;\n sentry: SentryConfig;\n snackbar: SnackbarContent;\n stripeAPIKey: string;\n trackerCode: string;\n uploadsById: Record<string, Upload>;\n versionInformation: VersionInformation;\n yesterday?: string;\n};\n\nexport const initialState: AppSliceType = {\n appInitDone: false,\n cancelSource: undefined,\n commit: '',\n demoArtifactLink: 'https://dgsbl4vditpls.cloudfront.net/mender-demo-artifact.mender',\n hostAddress: null,\n snackbar: {\n action: undefined,\n autoHideDuration: undefined,\n message: '',\n open: false,\n preventClickToCopy: false\n },\n // return boolean rather than organization details\n features: {\n hasAiEnabled: false,\n hasAuditlogs: false,\n hasDeltaProgress: false,\n hasMultitenancy: false,\n hasDeviceConfig: false,\n hasDeviceConnect: false,\n hasFeedbackEnabled: false,\n hasMonitor: false,\n hasMCUEnabled: false,\n hasOldTheme: false,\n hasReporting: false,\n isHosted: true,\n isEnterprise: false\n },\n feedbackProbability: 0.3,\n firstLoginAfterSignup: false,\n hostedAnnouncement: '',\n docsVersion: '',\n recaptchaSiteKey: '',\n searchState: {\n deviceIds: [],\n searchTerm: '',\n searchTotal: 0,\n isSearching: false,\n sort: {\n direction: SORTING_OPTIONS.desc\n // key: null,\n // scope: null\n }\n },\n sentry: {\n location: '',\n replaysSessionSampleRate: 0.1,\n tracesSampleRate: 1.0\n },\n stripeAPIKey: '',\n trackerCode: '',\n uploadsById: {\n // id: { progress: 0, cancelSource: undefined }\n },\n newThreshold: getYesterday(),\n offlineThreshold: getYesterday(),\n versionInformation: {\n Integration: '',\n 'Mender-Client': '',\n 'Mender-Artifact': '',\n 'Meta-Mender': ''\n },\n yesterday: undefined\n};\n\nexport const appSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n setFeatures: (state, action: PayloadAction<Record<string, boolean>>) => {\n state.features = {\n ...state.features,\n ...action.payload\n };\n },\n setSnackbar: (state, { payload }: PayloadAction<SnackbarContent | string>) => {\n if (typeof payload === 'string' || payload instanceof String) {\n state.snackbar = {\n ...initialState.snackbar,\n message: payload,\n open: !!payload\n };\n return;\n }\n const { message, autoHideDuration, action, preventClickToCopy = false } = payload;\n state.snackbar = {\n message,\n autoHideDuration,\n action,\n preventClickToCopy,\n open: !!message\n };\n },\n setFirstLoginAfterSignup: (state, action: PayloadAction<boolean>) => {\n state.firstLoginAfterSignup = action.payload;\n },\n setAnnouncement: (state, action: PayloadAction<string>) => {\n state.hostedAnnouncement = action.payload;\n },\n setSearchState: (state, action) => {\n state.searchState = {\n ...state.searchState,\n ...action.payload\n };\n },\n setOfflineThreshold: (state, action: PayloadAction<string>) => {\n state.offlineThreshold = action.payload;\n },\n initUpload: (state, action: PayloadAction<{ id: string; upload: Upload }>) => {\n const { id, upload } = action.payload;\n state.uploadsById[id] = upload;\n },\n uploadProgress: (state, action: PayloadAction<{ id: string; progress: number }>) => {\n const { id, progress } = action.payload;\n state.uploadsById[id] = {\n ...state.uploadsById[id],\n progress\n };\n },\n cleanUpUpload: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: current, ...remainder } = state.uploadsById;\n state.uploadsById = remainder;\n },\n setVersionInformation: (state, action: PayloadAction<VersionInformation>) => {\n state.versionInformation = {\n ...state.versionInformation,\n ...action.payload\n };\n },\n setEnvironmentData: (state, action) => ({ ...state, ...action.payload }),\n setAppInitDone: state => {\n state.appInitDone = true;\n }\n }\n});\n\nexport const actions = appSlice.actions;\nexport default appSlice.reducer;\n"],"mappings":";;;;;AAgBA,SAAS,mBAAmB;AAKrB,IAAM,YAAY;AAEzB,IAAM,eAAe,MAAM;AACzB,QAAM,QAAQ,oBAAI,KAAK;AACvB,QAAM,QAAQ,MAAM,QAAQ,IAAI,CAAC;AACjC,SAAO,MAAM,YAAY;AAC3B;AA6FO,IAAM,eAA6B;AAAA,EACxC,aAAa;AAAA,EACb,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,kBAAkB;AAAA,IAClB,SAAS;AAAA,IACT,MAAM;AAAA,IACN,oBAAoB;AAAA,EACtB;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,cAAc;AAAA,IACd,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,aAAa;AAAA,IACb,cAAc;AAAA,IACd,UAAU;AAAA,IACV,cAAc;AAAA,EAChB;AAAA,EACA,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,IACX,WAAW,CAAC;AAAA,IACZ,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,aAAa;AAAA,IACb,MAAM;AAAA,MACJ,WAAW,gBAAgB;AAAA;AAAA;AAAA,IAG7B;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,0BAA0B;AAAA,IAC1B,kBAAkB;AAAA,EACpB;AAAA,EACA,cAAc;AAAA,EACd,aAAa;AAAA,EACb,aAAa;AAAA;AAAA,EAEb;AAAA,EACA,cAAc,aAAa;AAAA,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AC,OAAO,WAA4D;AAClF,YAAM,EAAE,IAAI,SAAS,IAAI,OAAO;AAChC,YAAM,YAAY,EAAE,IAAI;AAAA,QACtB,GAAG,MAAM,YAAY,EAAE;AAAA,QACvB;AAAA,MACF;AAAA,IACF;AAAA,IACA,eAAe,CAAC,OAAO,WAAkC;AAEvD,YAAM,EAAE,CAAC,OAAO,OAAO,GAAG,SAAS,GAAG,UAAU,IAAI,MAAM;AAC1D,YAAM,cAAc;AAAA,IACtB;AAAA,IACA,uBAAuB,CAAC,OAAO,WAA8C;AAC3E,YAAM,qBAAqB;AAAA,QACzB,GAAG,MAAM;AAAA,QACT,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,oBAAoB,CAAC,OAAO,YAAY,EAAE,GAAG,OAAO,GAAG,OAAO,QAAQ;AAAA,IACtE,gBAAgB,WAAS;AACvB,YAAM,cAAc;AAAA,IACtB;AAAA,EACF;AACF,CAAC;AAEM,IAAM,UAAU,SAAS;AAChC,IAAO,mBAAQ,SAAS;","names":[]}
@@ -1,25 +1,25 @@
1
+ import {
2
+ users_api_default
3
+ } from "./chunk-Y3DJIMEN.js";
1
4
  import {
2
5
  getDeviceMonitorConfig,
3
6
  getLatestDeviceAlerts
4
- } from "./chunk-OEFIAB26.js";
7
+ } from "./chunk-QHGAJE7K.js";
8
+ import {
9
+ general_api_default
10
+ } from "./chunk-5M6EUVNO.js";
5
11
  import {
6
12
  commonErrorFallback,
7
13
  commonErrorHandler,
8
14
  createAppAsyncThunk
9
- } from "./chunk-ZNSCXTKF.js";
10
- import {
11
- users_api_default
12
- } from "./chunk-Y3DJIMEN.js";
13
- import {
14
- general_api_default
15
- } from "./chunk-5M6EUVNO.js";
15
+ } from "./chunk-E2UO6BJ3.js";
16
16
  import {
17
17
  actions_default
18
- } from "./chunk-KE7R7GYG.js";
18
+ } from "./chunk-GL634FKF.js";
19
19
  import {
20
20
  actions as actions6,
21
21
  sliceName as sliceName6
22
- } from "./chunk-KJ4BPXMB.js";
22
+ } from "./chunk-YR65C62H.js";
23
23
  import {
24
24
  actions as actions5,
25
25
  sliceName as sliceName5
@@ -32,14 +32,14 @@ import {
32
32
  actions as actions3,
33
33
  sliceName as sliceName3
34
34
  } from "./chunk-VODRLEDP.js";
35
- import {
36
- actions,
37
- sliceName
38
- } from "./chunk-O3DM73SJ.js";
39
35
  import {
40
36
  actions as actions2,
41
37
  sliceName as sliceName2
42
38
  } from "./chunk-OLKM53RL.js";
39
+ import {
40
+ actions,
41
+ sliceName
42
+ } from "./chunk-6WJI4MOP.js";
43
43
  import {
44
44
  cleanUp,
45
45
  getSessionInfo,
@@ -52,7 +52,7 @@ import {
52
52
  getSearchEndpoint,
53
53
  getTenantCapabilities,
54
54
  getUserCapabilities
55
- } from "./chunk-2IGDYPTR.js";
55
+ } from "./chunk-JDSAICR3.js";
56
56
  import {
57
57
  getCurrentSession,
58
58
  getCurrentUser,
@@ -64,17 +64,13 @@ import {
64
64
  getTooltipsState,
65
65
  getUserSettings,
66
66
  getUsersById
67
- } from "./chunk-3YJY7KQW.js";
67
+ } from "./chunk-QL6FN2JC.js";
68
68
  import {
69
69
  getAuditlogState,
70
70
  getDeviceTwinIntegrations,
71
71
  getOrganization,
72
72
  getTenantsList
73
73
  } from "./chunk-3NOV7X4M.js";
74
- import {
75
- getDeploymentsById,
76
- getDeploymentsByStatus
77
- } from "./chunk-WR6RQKF5.js";
78
74
  import {
79
75
  getAcceptedDevices,
80
76
  getDeviceById,
@@ -85,11 +81,15 @@ import {
85
81
  getDevicesById,
86
82
  getGroupsById,
87
83
  getSelectedGroup
88
- } from "./chunk-X7NEALMI.js";
84
+ } from "./chunk-O7DR57RN.js";
89
85
  import {
90
86
  getFeatures,
91
87
  getSearchState
92
88
  } from "./chunk-4BHM6WVX.js";
89
+ import {
90
+ getDeploymentsById,
91
+ getDeploymentsByStatus
92
+ } from "./chunk-WR6RQKF5.js";
93
93
  import {
94
94
  convertDeviceListStateToFilters,
95
95
  extractErrorMessage,
@@ -2771,4 +2771,4 @@ export {
2771
2771
  setAllTooltipsReadState,
2772
2772
  submitUserFeedback
2773
2773
  };
2774
- //# sourceMappingURL=chunk-LROF3FA4.js.map
2774
+ //# sourceMappingURL=chunk-76GD35G3.js.map
@@ -1,20 +1,17 @@
1
1
  import {
2
2
  actions_default
3
- } from "./chunk-KE7R7GYG.js";
4
- import {
5
- releasesSlice_default
6
- } from "./chunk-TRKA7XYU.js";
3
+ } from "./chunk-GL634FKF.js";
7
4
  import {
8
5
  actions as actions2,
9
6
  usersSlice_default
10
- } from "./chunk-KJ4BPXMB.js";
7
+ } from "./chunk-YR65C62H.js";
11
8
  import {
12
9
  actions,
13
10
  organizationSlice_default
14
11
  } from "./chunk-VCEFZTWS.js";
15
12
  import {
16
- monitorSlice_default
17
- } from "./chunk-PVCHKW35.js";
13
+ releasesSlice_default
14
+ } from "./chunk-TRKA7XYU.js";
18
15
  import {
19
16
  onboardingSlice_default
20
17
  } from "./chunk-CQXDAXQF.js";
@@ -22,11 +19,14 @@ import {
22
19
  devicesSlice_default
23
20
  } from "./chunk-VODRLEDP.js";
24
21
  import {
25
- appSlice_default
26
- } from "./chunk-O3DM73SJ.js";
22
+ monitorSlice_default
23
+ } from "./chunk-PVCHKW35.js";
27
24
  import {
28
25
  deploymentsSlice_default
29
26
  } from "./chunk-OLKM53RL.js";
27
+ import {
28
+ appSlice_default
29
+ } from "./chunk-6WJI4MOP.js";
30
30
  import {
31
31
  getToken
32
32
  } from "./chunk-FDSMCFV5.js";
@@ -139,4 +139,4 @@ export {
139
139
  useAppDispatch,
140
140
  createAppAsyncThunk
141
141
  };
142
- //# sourceMappingURL=chunk-ZNSCXTKF.js.map
142
+ //# sourceMappingURL=chunk-E2UO6BJ3.js.map
@@ -1,15 +1,12 @@
1
- import {
2
- actions as actions7
3
- } from "./chunk-TRKA7XYU.js";
4
1
  import {
5
2
  actions as actions8
6
- } from "./chunk-KJ4BPXMB.js";
3
+ } from "./chunk-YR65C62H.js";
7
4
  import {
8
5
  actions as actions6
9
6
  } from "./chunk-VCEFZTWS.js";
10
7
  import {
11
- actions as actions4
12
- } from "./chunk-PVCHKW35.js";
8
+ actions as actions7
9
+ } from "./chunk-TRKA7XYU.js";
13
10
  import {
14
11
  actions as actions5
15
12
  } from "./chunk-CQXDAXQF.js";
@@ -17,11 +14,14 @@ import {
17
14
  actions as actions3
18
15
  } from "./chunk-VODRLEDP.js";
19
16
  import {
20
- actions
21
- } from "./chunk-O3DM73SJ.js";
17
+ actions as actions4
18
+ } from "./chunk-PVCHKW35.js";
22
19
  import {
23
20
  actions as actions2
24
21
  } from "./chunk-OLKM53RL.js";
22
+ import {
23
+ actions
24
+ } from "./chunk-6WJI4MOP.js";
25
25
 
26
26
  // src/actions.ts
27
27
  var actions_default = {
@@ -38,4 +38,4 @@ var actions_default = {
38
38
  export {
39
39
  actions_default
40
40
  };
41
- //# sourceMappingURL=chunk-KE7R7GYG.js.map
41
+ //# sourceMappingURL=chunk-GL634FKF.js.map
@@ -7,7 +7,7 @@ import {
7
7
  getRolesById,
8
8
  getRolesList,
9
9
  getUserSettings
10
- } from "./chunk-3YJY7KQW.js";
10
+ } from "./chunk-QL6FN2JC.js";
11
11
  import {
12
12
  getAuditLogEntry,
13
13
  getIsServiceProvider,
@@ -19,22 +19,22 @@ import {
19
19
  import {
20
20
  getOnboarding
21
21
  } from "./chunk-JIS4PA3R.js";
22
- import {
23
- getDeploymentsById,
24
- getDeploymentsSelectionState,
25
- getSelectedDeploymentDeviceIds
26
- } from "./chunk-WR6RQKF5.js";
27
22
  import {
28
23
  getDeviceById,
29
24
  getDevicesById,
30
25
  getFilteringAttributes,
31
26
  getGroupsById,
32
27
  getListedDevices
33
- } from "./chunk-X7NEALMI.js";
28
+ } from "./chunk-O7DR57RN.js";
34
29
  import {
35
30
  getFeatures,
36
31
  getSearchedDevices
37
32
  } from "./chunk-4BHM6WVX.js";
33
+ import {
34
+ getDeploymentsById,
35
+ getDeploymentsSelectionState,
36
+ getSelectedDeploymentDeviceIds
37
+ } from "./chunk-WR6RQKF5.js";
38
38
  import {
39
39
  listItemMapper,
40
40
  mapUserRolesToUiPermissions
@@ -289,4 +289,4 @@ export {
289
289
  getAuditlogDevice,
290
290
  getRelevantRoles
291
291
  };
292
- //# sourceMappingURL=chunk-2IGDYPTR.js.map
292
+ //# sourceMappingURL=chunk-JDSAICR3.js.map
@@ -106,6 +106,17 @@ var getAttributesList = createSelector(
106
106
  [getFilteringAttributes, getFilteringAttributesFromConfig],
107
107
  ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(duplicateFilter)
108
108
  );
109
+ var getDeviceLimitStats = createSelector(
110
+ [getDeviceLimits, getAcceptedDevices],
111
+ (limits, accepted) => {
112
+ const { counts } = accepted;
113
+ return Object.entries(limits).filter(([, limit]) => limit !== 0).map(([type, limit]) => ({
114
+ type,
115
+ limit,
116
+ total: counts[type] || 0
117
+ }));
118
+ }
119
+ );
109
120
  var getDeviceTypes = createSelector(
110
121
  [getAcceptedDevices, getDevicesById],
111
122
  ({ deviceIds = [] }, devicesById) => Object.keys(
@@ -145,6 +156,7 @@ export {
145
156
  getGroupData,
146
157
  getGroups,
147
158
  getAttributesList,
159
+ getDeviceLimitStats,
148
160
  getDeviceTypes
149
161
  };
150
- //# sourceMappingURL=chunk-X7NEALMI.js.map
162
+ //# sourceMappingURL=chunk-O7DR57RN.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/devicesSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 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 { duplicateFilter } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { DeviceFilter, DeviceGroup } from '.';\nimport type { DeviceAuthState } from '../constants';\nimport { DEVICE_STATES, UNGROUPED_GROUP } from '../constants';\nimport type { RootState } from '../store';\n\nexport const getAcceptedDevices = (state: RootState) => state.devices.byStatus.accepted;\nexport const getDevicesByStatus = (state: RootState) => state.devices.byStatus;\nexport const getDevicesById = (state: RootState) => state.devices.byId;\nexport const getDeviceReports = (state: RootState) => state.devices.reports;\nexport const getGroupsById = (state: RootState) => state.devices.groups.byId;\nexport const getSelectedGroup = (state: RootState) => state.devices.groups.selectedGroup;\n\nexport const getDeviceListState = (state: RootState) => state.devices.deviceList;\nexport const getListedDevices = (state: RootState) => state.devices.deviceList.deviceIds;\nexport const getFilteringAttributes = (state: RootState) => state.devices.filteringAttributes;\nexport const getDeviceFilters = (state: RootState) => state.devices.filters || [];\nconst getFilteringAttributesFromConfig = (state: RootState) => state.devices.filteringAttributesConfig.attributes;\nexport const getSortedFilteringAttributes = createSelector([getFilteringAttributes], filteringAttributes => ({\n ...filteringAttributes,\n identityAttributes: [...filteringAttributes.identityAttributes, 'id']\n}));\nexport const getDeviceLimits = (state: RootState) => state.devices.limits;\nconst getFilteringAttributesLimit = (state: RootState) => state.devices.filteringAttributesLimit;\n\nexport const getDeviceIdentityAttributes = createSelector(\n [getFilteringAttributes, getFilteringAttributesLimit],\n ({ identityAttributes }, filteringAttributesLimit) => {\n // limit the selection of the available attribute to AVAILABLE_ATTRIBUTE_LIMIT\n const attributes = identityAttributes.slice(0, filteringAttributesLimit);\n return attributes.reduce(\n (accu, value) => {\n accu.push({ value, label: value, scope: 'identity' });\n return accu;\n },\n [\n { value: 'name', label: 'Name', scope: 'tags' },\n { value: 'id', label: 'Device ID', scope: 'identity' }\n ]\n );\n }\n);\n\nexport const getDeviceCountsByStatus = createSelector([getDevicesByStatus], byStatus =>\n Object.values(DEVICE_STATES).reduce<Record<DeviceAuthState, number>>(\n (accu, deviceState) => {\n const { counts } = byStatus[deviceState];\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { total, ...tieredCounts } = counts;\n const count = Object.values(tieredCounts).reduce((accu, countPerTier) => accu + countPerTier, 0);\n accu[deviceState] = count;\n accu.total = accu.total + count;\n return accu;\n },\n { total: 0 }\n )\n);\n\nexport const getDeviceById = createSelector([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = '') => devicesById[deviceId] ?? {});\n\nexport const getSelectedGroupInfo = createSelector(\n [getDeviceCountsByStatus, getGroupsById, getSelectedGroup],\n ({ accepted: acceptedDeviceTotal }, groupsById, selectedGroup) => {\n let groupCount = acceptedDeviceTotal;\n let groupFilters: DeviceFilter[] = [];\n if (selectedGroup && groupsById[selectedGroup]) {\n groupCount = groupsById[selectedGroup].total || 0;\n groupFilters = groupsById[selectedGroup].filters || [];\n }\n return { groupCount, selectedGroup, groupFilters };\n }\n);\n\nexport const getCombinedLimit = createSelector(\n [getDeviceLimits],\n deviceLimits => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0) // limit might be -1 for unlimited devices\n);\n\nexport const getLimitMaxed = createSelector(\n [getDeviceCountsByStatus, getCombinedLimit],\n ({ accepted: acceptedDevices }, combinedLimit) => !!combinedLimit && combinedLimit <= acceptedDevices\n);\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const getGroupsByIdWithoutUngrouped = createSelector([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);\n\nexport const getGroupData = createSelector([getGroupsByIdWithoutUngrouped], groups => {\n const createdGroup = Object.keys(groups).length ? Object.keys(groups)[0] : undefined;\n const hasDynamicGroups = Object.values(groups).some(group => !!group.id);\n return { createdGroup, hasDynamicGroups, groups };\n});\n\ntype SelectorGroup = DeviceGroup & { groupId: string };\ntype SelectorGroups = { dynamic: SelectorGroup[]; static: SelectorGroup[]; ungrouped: SelectorGroup[] };\n\nexport const getGroups = createSelector([getGroupsById], groupsById => {\n const groupNames = Object.keys(groupsById).sort();\n const groupedGroups = Object.entries(groupsById)\n .sort((a, b) => a[0].localeCompare(b[0]))\n .reduce<SelectorGroups>(\n (accu, [groupname, group]) => {\n const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;\n const groupItem = { ...group, groupId: name, name: groupname };\n if ((group.filters ?? []).length > 0) {\n if (groupname !== UNGROUPED_GROUP.id) {\n accu.dynamic.push(groupItem);\n } else {\n accu.ungrouped.push(groupItem);\n }\n } else {\n accu.static.push(groupItem);\n }\n return accu;\n },\n { dynamic: [], static: [], ungrouped: [] }\n );\n return { groupNames, ...groupedGroups };\n});\nexport const getAttributesList = createSelector(\n [getFilteringAttributes, getFilteringAttributesFromConfig],\n ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) =>\n [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(duplicateFilter)\n);\n\nexport const getDeviceTypes = createSelector([getAcceptedDevices, getDevicesById], ({ deviceIds = [] }, devicesById) =>\n Object.keys(\n deviceIds.slice(0, 200).reduce((accu, item) => {\n const { device_type: deviceTypes = [] } = devicesById[item] ? devicesById[item].attributes : {};\n accu = deviceTypes.reduce((deviceTypeAccu, deviceType) => {\n if (deviceType.length > 1) {\n deviceTypeAccu[deviceType] = deviceTypeAccu[deviceType] ? deviceTypeAccu[deviceType] + 1 : 1;\n }\n return deviceTypeAccu;\n }, accu);\n return accu;\n }, {})\n )\n);\n"],"mappings":";;;;;;AAaA,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAOxB,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ,SAAS;AACxE,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ;AAC/D,IAAM,iBAAiB,CAAC,UAAqB,MAAM,QAAQ;AAC3D,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ;AAC7D,IAAM,gBAAgB,CAAC,UAAqB,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AAG,CAAC,EAAE,YAAY,CAAC,EAAE,GAAG,gBACtG,OAAO;AAAA,IACL,UAAU,MAAM,GAAG,GAAG,EAAE,OAAO,CAAC,MAAM,SAAS;AAC7C,YAAM,EAAE,aAAa,cAAc,CAAC,EAAE,IAAI,YAAY,IAAI,IAAI,YAAY,IAAI,EAAE,aAAa,CAAC;AAC9F,aAAO,YAAY,OAAO,CAAC,gBAAgB,eAAe;AACxD,YAAI,WAAW,SAAS,GAAG;AACzB,yBAAe,UAAU,IAAI,eAAe,UAAU,IAAI,eAAe,UAAU,IAAI,IAAI;AAAA,QAC7F;AACA,eAAO;AAAA,MACT,GAAG,IAAI;AACP,aAAO;AAAA,IACT,GAAG,CAAC,CAAC;AAAA,EACP;AACF;","names":["accu"]}
1
+ {"version":3,"sources":["../src/devicesSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 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 { duplicateFilter } from '@northern.tech/utils/helpers';\nimport { createSelector } from '@reduxjs/toolkit';\n\nimport type { DeviceFilter, DeviceGroup } from '.';\nimport type { DeviceAuthState } from '../constants';\nimport { DEVICE_STATES, UNGROUPED_GROUP } from '../constants';\nimport type { RootState } from '../store';\n\nexport const getAcceptedDevices = (state: RootState) => state.devices.byStatus.accepted;\nexport const getDevicesByStatus = (state: RootState) => state.devices.byStatus;\nexport const getDevicesById = (state: RootState) => state.devices.byId;\nexport const getDeviceReports = (state: RootState) => state.devices.reports;\nexport const getGroupsById = (state: RootState) => state.devices.groups.byId;\nexport const getSelectedGroup = (state: RootState) => state.devices.groups.selectedGroup;\n\nexport const getDeviceListState = (state: RootState) => state.devices.deviceList;\nexport const getListedDevices = (state: RootState) => state.devices.deviceList.deviceIds;\nexport const getFilteringAttributes = (state: RootState) => state.devices.filteringAttributes;\nexport const getDeviceFilters = (state: RootState) => state.devices.filters || [];\nconst getFilteringAttributesFromConfig = (state: RootState) => state.devices.filteringAttributesConfig.attributes;\nexport const getSortedFilteringAttributes = createSelector([getFilteringAttributes], filteringAttributes => ({\n ...filteringAttributes,\n identityAttributes: [...filteringAttributes.identityAttributes, 'id']\n}));\nexport const getDeviceLimits = (state: RootState) => state.devices.limits;\nconst getFilteringAttributesLimit = (state: RootState) => state.devices.filteringAttributesLimit;\n\nexport const getDeviceIdentityAttributes = createSelector(\n [getFilteringAttributes, getFilteringAttributesLimit],\n ({ identityAttributes }, filteringAttributesLimit) => {\n // limit the selection of the available attribute to AVAILABLE_ATTRIBUTE_LIMIT\n const attributes = identityAttributes.slice(0, filteringAttributesLimit);\n return attributes.reduce(\n (accu, value) => {\n accu.push({ value, label: value, scope: 'identity' });\n return accu;\n },\n [\n { value: 'name', label: 'Name', scope: 'tags' },\n { value: 'id', label: 'Device ID', scope: 'identity' }\n ]\n );\n }\n);\n\nexport const getDeviceCountsByStatus = createSelector([getDevicesByStatus], byStatus =>\n Object.values(DEVICE_STATES).reduce<Record<DeviceAuthState, number>>(\n (accu, deviceState) => {\n const { counts } = byStatus[deviceState];\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { total, ...tieredCounts } = counts;\n const count = Object.values(tieredCounts).reduce((accu, countPerTier) => accu + countPerTier, 0);\n accu[deviceState] = count;\n accu.total = accu.total + count;\n return accu;\n },\n { total: 0 }\n )\n);\n\nexport const getDeviceById = createSelector([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = '') => devicesById[deviceId] ?? {});\n\nexport const getSelectedGroupInfo = createSelector(\n [getDeviceCountsByStatus, getGroupsById, getSelectedGroup],\n ({ accepted: acceptedDeviceTotal }, groupsById, selectedGroup) => {\n let groupCount = acceptedDeviceTotal;\n let groupFilters: DeviceFilter[] = [];\n if (selectedGroup && groupsById[selectedGroup]) {\n groupCount = groupsById[selectedGroup].total || 0;\n groupFilters = groupsById[selectedGroup].filters || [];\n }\n return { groupCount, selectedGroup, groupFilters };\n }\n);\n\nexport const getCombinedLimit = createSelector(\n [getDeviceLimits],\n deviceLimits => Object.values(deviceLimits).reduce((accu, limit) => accu + Math.max(limit ?? 0, 0), 0) // limit might be -1 for unlimited devices\n);\n\nexport const getLimitMaxed = createSelector(\n [getDeviceCountsByStatus, getCombinedLimit],\n ({ accepted: acceptedDevices }, combinedLimit) => !!combinedLimit && combinedLimit <= acceptedDevices\n);\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const getGroupsByIdWithoutUngrouped = createSelector([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);\n\nexport const getGroupData = createSelector([getGroupsByIdWithoutUngrouped], groups => {\n const createdGroup = Object.keys(groups).length ? Object.keys(groups)[0] : undefined;\n const hasDynamicGroups = Object.values(groups).some(group => !!group.id);\n return { createdGroup, hasDynamicGroups, groups };\n});\n\ntype SelectorGroup = DeviceGroup & { groupId: string };\ntype SelectorGroups = { dynamic: SelectorGroup[]; static: SelectorGroup[]; ungrouped: SelectorGroup[] };\n\nexport const getGroups = createSelector([getGroupsById], groupsById => {\n const groupNames = Object.keys(groupsById).sort();\n const groupedGroups = Object.entries(groupsById)\n .sort((a, b) => a[0].localeCompare(b[0]))\n .reduce<SelectorGroups>(\n (accu, [groupname, group]) => {\n const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;\n const groupItem = { ...group, groupId: name, name: groupname };\n if ((group.filters ?? []).length > 0) {\n if (groupname !== UNGROUPED_GROUP.id) {\n accu.dynamic.push(groupItem);\n } else {\n accu.ungrouped.push(groupItem);\n }\n } else {\n accu.static.push(groupItem);\n }\n return accu;\n },\n { dynamic: [], static: [], ungrouped: [] }\n );\n return { groupNames, ...groupedGroups };\n});\nexport const getAttributesList = createSelector(\n [getFilteringAttributes, getFilteringAttributesFromConfig],\n ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) =>\n [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(duplicateFilter)\n);\nexport const getDeviceLimitStats = createSelector(\n [getDeviceLimits, getAcceptedDevices],\n (limits, accepted) => {\n const { counts } = accepted;\n return Object.entries(limits)\n .filter(([, limit]) => limit !== 0)\n .map(([type, limit]) => ({\n type,\n limit,\n total: counts[type] || 0\n }));\n }\n);\n\nexport const getDeviceTypes = createSelector([getAcceptedDevices, getDevicesById], ({ deviceIds = [] }, devicesById) =>\n Object.keys(\n deviceIds.slice(0, 200).reduce((accu, item) => {\n const { device_type: deviceTypes = [] } = devicesById[item] ? devicesById[item].attributes : {};\n accu = deviceTypes.reduce((deviceTypeAccu, deviceType) => {\n if (deviceType.length > 1) {\n deviceTypeAccu[deviceType] = deviceTypeAccu[deviceType] ? deviceTypeAccu[deviceType] + 1 : 1;\n }\n return deviceTypeAccu;\n }, accu);\n return accu;\n }, {})\n )\n);\n"],"mappings":";;;;;;AAaA,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAOxB,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ,SAAS;AACxE,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ;AAC/D,IAAM,iBAAiB,CAAC,UAAqB,MAAM,QAAQ;AAC3D,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ;AAC7D,IAAM,gBAAgB,CAAC,UAAqB,MAAM,QAAQ,OAAO;AACjE,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ,OAAO;AAEpE,IAAM,qBAAqB,CAAC,UAAqB,MAAM,QAAQ;AAC/D,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QAAQ,WAAW;AACxE,IAAM,yBAAyB,CAAC,UAAqB,MAAM,QAAQ;AACnE,IAAM,mBAAmB,CAAC,UAAqB,MAAM,QA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AA,EACV;AACJ;AAEO,IAAM,iBAAiB;AAAA,EAAe,CAAC,oBAAoB,cAAc;AAAA,EAAG,CAAC,EAAE,YAAY,CAAC,EAAE,GAAG,gBACtG,OAAO;AAAA,IACL,UAAU,MAAM,GAAG,GAAG,EAAE,OAAO,CAAC,MAAM,SAAS;AAC7C,YAAM,EAAE,aAAa,cAAc,CAAC,EAAE,IAAI,YAAY,IAAI,IAAI,YAAY,IAAI,EAAE,aAAa,CAAC;AAC9F,aAAO,YAAY,OAAO,CAAC,gBAAgB,eAAe;AACxD,YAAI,WAAW,SAAS,GAAG;AACzB,yBAAe,UAAU,IAAI,eAAe,UAAU,IAAI,eAAe,UAAU,IAAI,IAAI;AAAA,QAC7F;AACA,eAAO;AAAA,MACT,GAAG,IAAI;AACP,aAAO;AAAA,IACT,GAAG,CAAC,CAAC;AAAA,EACP;AACF;","names":["accu"]}
@@ -1,24 +1,24 @@
1
+ import {
2
+ general_api_default
3
+ } from "./chunk-5M6EUVNO.js";
1
4
  import {
2
5
  commonErrorFallback,
3
6
  commonErrorHandler,
4
7
  createAppAsyncThunk
5
- } from "./chunk-ZNSCXTKF.js";
6
- import {
7
- general_api_default
8
- } from "./chunk-5M6EUVNO.js";
8
+ } from "./chunk-E2UO6BJ3.js";
9
9
  import {
10
10
  actions_default
11
- } from "./chunk-KE7R7GYG.js";
11
+ } from "./chunk-GL634FKF.js";
12
12
  import {
13
13
  actions,
14
14
  sliceName
15
15
  } from "./chunk-PVCHKW35.js";
16
16
  import {
17
17
  getSearchEndpoint
18
- } from "./chunk-2IGDYPTR.js";
18
+ } from "./chunk-JDSAICR3.js";
19
19
  import {
20
20
  getDeviceFilters
21
- } from "./chunk-X7NEALMI.js";
21
+ } from "./chunk-O7DR57RN.js";
22
22
  import {
23
23
  convertDeviceListStateToFilters
24
24
  } from "./chunk-U5TPV5X5.js";
@@ -107,4 +107,4 @@ export {
107
107
  getDeviceMonitorConfig,
108
108
  changeNotificationSetting
109
109
  };
110
- //# sourceMappingURL=chunk-OEFIAB26.js.map
110
+ //# sourceMappingURL=chunk-QHGAJE7K.js.map
@@ -55,6 +55,7 @@ var getOfflineThresholdSettings = createSelector([getGlobalSettings], ({ offline
55
55
  var getRolesList = createSelector([getRolesById], (rolesById) => Object.entries(rolesById).map(([value, role]) => ({ value, ...role })));
56
56
  var getCurrentSession = (state) => state.users.currentSession;
57
57
  var getRolesInitialized = (state) => state.users.rolesInitialized;
58
+ var getSecurityAlertDismissedTimestamp = (state) => state.users.userSettings.securityAlertDismissedTimestamp;
58
59
 
59
60
  export {
60
61
  getRolesById,
@@ -75,6 +76,7 @@ export {
75
76
  getOfflineThresholdSettings,
76
77
  getRolesList,
77
78
  getCurrentSession,
78
- getRolesInitialized
79
+ getRolesInitialized,
80
+ getSecurityAlertDismissedTimestamp
79
81
  };
80
- //# sourceMappingURL=chunk-3YJY7KQW.js.map
82
+ //# sourceMappingURL=chunk-QL6FN2JC.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/usersSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 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 { createSelector } from '@reduxjs/toolkit';\n\nimport { DEVICE_ONLINE_CUTOFF, defaultIdAttribute } from '../constants';\nimport { twoFAStates } from '../constants';\nimport type { RootState } from '../store';\nimport { isDarkMode } from '../utils';\nimport { READ_STATES } from './constants';\nimport type { User } from './index';\n\nconst emptyObject = {} as User;\n\nexport const getRolesById = (state: RootState) => state.users.rolesById;\nexport const getTooltipsById = (state: RootState) => state.users.tooltips.byId;\nexport const getGlobalSettings = (state: RootState) => state.users.globalSettings;\nexport const getGlobalSettingsInitialized = (state: RootState) => state.users.settingsInitialized;\nexport const getUserSettingsInitialized = (state: RootState) => state.users.userSettingsInitialized;\nconst getCurrentUserId = (state: RootState) => state.users.currentUser;\nexport const getUsersById = (state: RootState) => state.users.byId;\n\nexport const getUsersList = createSelector([getUsersById], usersById => Object.values(usersById));\nexport const getCurrentUser = createSelector([getUsersById, getCurrentUserId], (usersById, userId) =>\n userId ? (usersById[userId] ?? emptyObject) : emptyObject\n);\nexport const getUserSettings = (state: RootState) => state.users.userSettings;\nexport const getSelectedDeviceAttribute = createSelector([getUserSettings], ({ columnSelection }) =>\n columnSelection.map(attribute => ({ attribute: attribute.key, scope: attribute.scope }))\n);\nexport const getIsDarkMode = createSelector([getUserSettings], ({ mode }) => isDarkMode(mode));\n\nexport const getReadAllHelptips = createSelector([getTooltipsById], tooltips =>\n Object.values(tooltips).every(({ readState }) => readState === READ_STATES.read)\n);\n\nexport const getTooltipsState = createSelector([getTooltipsById, getUserSettings], (byId, { tooltips = {} }) =>\n Object.entries(byId).reduce(\n (accu, [id, value]) => {\n accu[id] = { ...accu[id], ...value };\n return accu;\n },\n { ...tooltips }\n )\n);\n\nexport const getHas2FA = createSelector(\n [getCurrentUser],\n currentUser => currentUser.hasOwnProperty('tfa_status') && (currentUser as User).tfa_status === twoFAStates.enabled\n);\n\nexport const getIdAttribute = createSelector([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);\n\nexport const getOfflineThresholdSettings = createSelector([getGlobalSettings], ({ offlineThreshold }) => ({\n interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,\n intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName\n}));\n\nexport const getRolesList = createSelector([getRolesById], rolesById => Object.entries(rolesById).map(([value, role]) => ({ value, ...role })));\n\nexport const getCurrentSession = (state: RootState) => state.users.currentSession;\nexport const getRolesInitialized = (state: RootState) => state.users.rolesInitialized;\n"],"mappings":";;;;;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GAAG,GAAG,MAAM;AACnC,aAAO;AAAA,IACT;AAAA,IACA,EAAE,GAAG,SAAS;AAAA,EAChB;AACF;AAEO,IAAM,YAAY;AAAA,EACvB,CAAC,cAAc;AAAA,EACf,iBAAe,YAAY,eAAe,YAAY,KAAM,YAAqB,eAAe,YAAY;AAC9G;AAEO,IAAM,iBAAiB,eAAe,CAAC,iBAAiB,GAAG,CAAC,EAAE,eAAe,EAAE,GAAG,mBAAmB,EAAE,MAAM,YAAY;AAEzH,IAAM,8BAA8B,eAAe,CAAC,iBAAiB,GAAG,CAAC,EAAE,iBAAiB,OAAO;AAAA,EACxG,UAAU,kBAAkB,YAAY,qBAAqB;AAAA,EAC7D,cAAc,kBAAkB,gBAAgB,qBAAqB;AACvE,EAAE;AAEK,IAAM,eAAe,eAAe,CAAC,YAAY,GAAG,eAAa,OAAO,QAAQ,SAAS,EAAE,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,CAAC;AAEvI,IAAM,oBAAoB,CAAC,UAAqB,MAAM,MAAM;AAC5D,IAAM,sBAAsB,CAAC,UAAqB,MAAM,MAAM;","names":[]}
1
+ {"version":3,"sources":["../src/usersSlice/selectors.ts"],"sourcesContent":["// Copyright 2023 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 { createSelector } from '@reduxjs/toolkit';\n\nimport { DEVICE_ONLINE_CUTOFF, defaultIdAttribute } from '../constants';\nimport { twoFAStates } from '../constants';\nimport type { RootState } from '../store';\nimport { isDarkMode } from '../utils';\nimport { READ_STATES } from './constants';\nimport type { User } from './index';\n\nconst emptyObject = {} as User;\n\nexport const getRolesById = (state: RootState) => state.users.rolesById;\nexport const getTooltipsById = (state: RootState) => state.users.tooltips.byId;\nexport const getGlobalSettings = (state: RootState) => state.users.globalSettings;\nexport const getGlobalSettingsInitialized = (state: RootState) => state.users.settingsInitialized;\nexport const getUserSettingsInitialized = (state: RootState) => state.users.userSettingsInitialized;\nconst getCurrentUserId = (state: RootState) => state.users.currentUser;\nexport const getUsersById = (state: RootState) => state.users.byId;\n\nexport const getUsersList = createSelector([getUsersById], usersById => Object.values(usersById));\nexport const getCurrentUser = createSelector([getUsersById, getCurrentUserId], (usersById, userId) =>\n userId ? (usersById[userId] ?? emptyObject) : emptyObject\n);\nexport const getUserSettings = (state: RootState) => state.users.userSettings;\nexport const getSelectedDeviceAttribute = createSelector([getUserSettings], ({ columnSelection }) =>\n columnSelection.map(attribute => ({ attribute: attribute.key, scope: attribute.scope }))\n);\nexport const getIsDarkMode = createSelector([getUserSettings], ({ mode }) => isDarkMode(mode));\n\nexport const getReadAllHelptips = createSelector([getTooltipsById], tooltips =>\n Object.values(tooltips).every(({ readState }) => readState === READ_STATES.read)\n);\n\nexport const getTooltipsState = createSelector([getTooltipsById, getUserSettings], (byId, { tooltips = {} }) =>\n Object.entries(byId).reduce(\n (accu, [id, value]) => {\n accu[id] = { ...accu[id], ...value };\n return accu;\n },\n { ...tooltips }\n )\n);\n\nexport const getHas2FA = createSelector(\n [getCurrentUser],\n currentUser => currentUser.hasOwnProperty('tfa_status') && (currentUser as User).tfa_status === twoFAStates.enabled\n);\n\nexport const getIdAttribute = createSelector([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);\n\nexport const getOfflineThresholdSettings = createSelector([getGlobalSettings], ({ offlineThreshold }) => ({\n interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,\n intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName\n}));\n\nexport const getRolesList = createSelector([getRolesById], rolesById => Object.entries(rolesById).map(([value, role]) => ({ value, ...role })));\n\nexport const getCurrentSession = (state: RootState) => state.users.currentSession;\nexport const getRolesInitialized = (state: RootState) => state.users.rolesInitialized;\n\nexport const getSecurityAlertDismissedTimestamp = (state: RootState) => state.users.userSettings.securityAlertDismissedTimestamp;\n"],"mappings":";;;;;;;;;;;AAaA,SAAS,sBAAsB;AAS/B,IAAM,cAAc,CAAC;AAEd,IAAM,eAAe,CAAC,UAAqB,MAAM,MAAM;AACvD,IAAM,kBAAkB,CAAC,UAAqB,MAAM,MAAM,SAAS;AACnE,IAAM,oBAAoB,CAAC,UAAqB,MAAM,MAAM;AAC5D,IAAM,+BAA+B,CAAC,UAAqB,MAAM,MAAM;AACvE,IAAM,6BAA6B,CAAC,UAAqB,MAAM,MAAM;AAC5E,IAAM,mBAAmB,CAAC,UAAqB,MAAM,MAAM;AACpD,IAAM,eAAe,CAAC,UAAqB,MAAM,MAAM;AAEvD,IAAM,eAAe,eAAe,CAAC,YAAY,GAAG,eAAa,OAAO,OAAO,SAAS,CAAC;AACzF,IAAM,iBAAiB;AAAA,EAAe,CAAC,cAAc,gBAAgB;AAAA,EAAG,CAAC,WAAW,WACzF,SAAU,UAAU,MAAM,KAAK,cAAe;AAChD;AACO,IAAM,kBAAkB,CAAC,UAAqB,MAAM,MAAM;AAC1D,IAAM,6BAA6B;AAAA,EAAe,CAAC,eAAe;AAAA,EAAG,CAAC,EAAE,gBAAgB,MAC7F,gBAAgB,IAAI,gBAAc,EAAE,WAAW,UAAU,KAAK,OAAO,UAAU,MAAM,EAAE;AACzF;AACO,IAAM,gBAAgB,eAAe,CAAC,eAAe,GAAG,CAAC,EAAE,KAAK,MAAM,WAAW,IAAI,CAAC;AAEtF,IAAM,qBAAqB;AAAA,EAAe,CAAC,eAAe;AAAA,EAAG,cAClE,OAAO,OAAO,QAAQ,EAAE,MAAM,CAAC,EAAE,UAAU,MAAM,cAAc,YAAY,IAAI;AACjF;AAEO,IAAM,mBAAmB;AAAA,EAAe,CAAC,iBAAiB,eAAe;AAAA,EAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,MACxG,OAAO,QAAQ,IAAI,EAAE;AAAA,IACnB,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM;AACrB,WAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,GAAG,MAAM;AACnC,aAAO;AAAA,IACT;AAAA,IACA,EAAE,GAAG,SAAS;AAAA,EAChB;AACF;AAEO,IAAM,YAAY;AAAA,EACvB,CAAC,cAAc;AAAA,EACf,iBAAe,YAAY,eAAe,YAAY,KAAM,YAAqB,eAAe,YAAY;AAC9G;AAEO,IAAM,iBAAiB,eAAe,CAAC,iBAAiB,GAAG,CAAC,EAAE,eAAe,EAAE,GAAG,mBAAmB,EAAE,MAAM,YAAY;AAEzH,IAAM,8BAA8B,eAAe,CAAC,iBAAiB,GAAG,CAAC,EAAE,iBAAiB,OAAO;AAAA,EACxG,UAAU,kBAAkB,YAAY,qBAAqB;AAAA,EAC7D,cAAc,kBAAkB,gBAAgB,qBAAqB;AACvE,EAAE;AAEK,IAAM,eAAe,eAAe,CAAC,YAAY,GAAG,eAAa,OAAO,QAAQ,SAAS,EAAE,IAAI,CAAC,CAAC,OAAO,IAAI,OAAO,EAAE,OAAO,GAAG,KAAK,EAAE,CAAC;AAEvI,IAAM,oBAAoB,CAAC,UAAqB,MAAM,MAAM;AAC5D,IAAM,sBAAsB,CAAC,UAAqB,MAAM,MAAM;AAE9D,IAAM,qCAAqC,CAAC,UAAqB,MAAM,MAAM,aAAa;","names":[]}
@@ -1,14 +1,14 @@
1
+ import {
2
+ general_api_default
3
+ } from "./chunk-5M6EUVNO.js";
1
4
  import {
2
5
  commonErrorFallback,
3
6
  commonErrorHandler,
4
7
  createAppAsyncThunk
5
- } from "./chunk-ZNSCXTKF.js";
6
- import {
7
- general_api_default
8
- } from "./chunk-5M6EUVNO.js";
8
+ } from "./chunk-E2UO6BJ3.js";
9
9
  import {
10
10
  actions_default
11
- } from "./chunk-KE7R7GYG.js";
11
+ } from "./chunk-GL634FKF.js";
12
12
  import {
13
13
  actions,
14
14
  sliceName
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-53W2NRSL.js";
19
19
  import {
20
20
  getSearchEndpoint
21
- } from "./chunk-2IGDYPTR.js";
21
+ } from "./chunk-JDSAICR3.js";
22
22
  import {
23
23
  getReleasesById
24
24
  } from "./chunk-GEQ2QQEE.js";
@@ -442,4 +442,4 @@ export {
442
442
  getDeltaGenerationJobs,
443
443
  getDeltaGenerationJobDetails
444
444
  };
445
- //# sourceMappingURL=chunk-BTE6UIGL.js.map
445
+ //# sourceMappingURL=chunk-QXS7I6BE.js.map
@@ -41,7 +41,8 @@ var initialState = {
41
41
  userSettings: {
42
42
  columnSelection: [],
43
43
  onboarding: {},
44
- firstLoginTimestamp: null
44
+ firstLoginTimestamp: null,
45
+ securityAlertDismissedTimestamp: null
45
46
  },
46
47
  userSettingsInitialized: false
47
48
  };
@@ -144,4 +145,4 @@ export {
144
145
  actions,
145
146
  usersSlice_default
146
147
  };
147
- //# sourceMappingURL=chunk-KJ4BPXMB.js.map
148
+ //# sourceMappingURL=chunk-YR65C62H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/usersSlice/index.ts"],"sourcesContent":["// Copyright 2023 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 type { User as BackendUser, DeploymentPhase, TenantInfo, TenantsIdName } from '@northern.tech/types/MenderTypes';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nimport type { FilterOperator, PermissionSet, Role } from '../constants';\nimport { defaultPermissionSets, rolesById } from '../constants';\nimport type { ReadState } from './constants';\nimport { READ_STATES } from './constants';\n\nexport const sliceName = 'users';\nexport type User = BackendUser & TenantInfo & { tenants?: TenantsIdName };\nexport type UserSession = {\n expiresAt?: string;\n token: string;\n};\nexport type CustomColumn = {\n attribute: {\n name: string;\n scope: string;\n };\n size: number;\n};\n\ntype FilterOption = {\n key: string;\n operator: FilterOperator;\n scope: string;\n value: string;\n};\nexport type GlobalSettings = {\n [x: string]: any;\n id_attribute?: {\n attribute: string;\n scope: string;\n };\n previousFilters: FilterOption[];\n previousPhases: DeploymentPhase[][];\n retries: number;\n};\ntype Column = {\n id: string;\n key: string;\n name: string;\n scope: string;\n title: string;\n};\nexport type UserSettings = {\n [x: string]: any;\n columnSelection: Column[];\n feedbackCollectedAt?: string;\n firstLoginTimestamp: null | string;\n mode?: 'light' | 'dark';\n onboarding: Partial<{\n address: string;\n approach: 'physical' | 'virtual' | 'mcu' | null;\n complete: boolean;\n demoArtifactPort: number;\n deviceType: string[] | string;\n progress: string;\n showTips: null | boolean;\n showTipsDialog: boolean;\n }>;\n securityAlertDismissedTimestamp: null | string;\n tooltips?: object;\n trackingConsentGiven?: boolean;\n};\n\nexport type UserSliceType = {\n activationCode?: string;\n byId: Record<string, User>;\n currentSession?: UserSession | object;\n currentUser: string | null;\n customColumns: CustomColumn[];\n globalSettings: GlobalSettings;\n permissionSetsById: Record<string, PermissionSet>;\n qrCode: string | null;\n rolesById: Record<string, Role>;\n rolesInitialized: boolean;\n settingsInitialized: boolean;\n showConnectDeviceDialog: boolean;\n showFeedbackDialog: boolean;\n showStartupNotification: boolean;\n tooltips: {\n byId: Record<string, { readState: ReadState }>;\n };\n userSettings: UserSettings;\n userSettingsInitialized: boolean;\n};\n\nexport const initialState: UserSliceType = {\n activationCode: undefined,\n byId: {},\n currentUser: null,\n currentSession: {\n // { token: window.localStorage.getItem('JWT'), expiresAt: '2023-01-01T00:15:00.000Z' | undefined }, // expiresAt depending on the stay logged in setting\n },\n customColumns: [],\n qrCode: null,\n globalSettings: {\n id_attribute: undefined,\n previousFilters: [],\n previousPhases: [],\n retries: 0\n },\n permissionSetsById: {\n ...defaultPermissionSets\n },\n rolesById: {\n ...rolesById\n },\n rolesInitialized: false,\n settingsInitialized: false,\n showConnectDeviceDialog: false,\n showFeedbackDialog: false,\n showStartupNotification: false,\n tooltips: {\n byId: {\n // <id>: { readState: <read|unread> } // this object is getting enhanced by the tooltip texts in the app constants\n }\n },\n userSettings: {\n columnSelection: [],\n onboarding: {},\n firstLoginTimestamp: null,\n securityAlertDismissedTimestamp: null\n },\n userSettingsInitialized: false\n};\n\nexport const usersSlice = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n receivedQrCode: (state, action: PayloadAction<string | null>) => {\n state.qrCode = action.payload;\n },\n successfullyLoggedIn: (state, action: PayloadAction<UserSession>) => {\n state.currentSession = action.payload;\n },\n receivedUserList: (state, action: PayloadAction<Record<string, User>>) => {\n state.byId = action.payload;\n },\n receivedActivationCode: (state, action: PayloadAction<string>) => {\n state.activationCode = action.payload;\n },\n receivedUser: (state, action: PayloadAction<User>) => {\n state.byId[action.payload.id] = action.payload;\n state.currentUser = action.payload.id;\n },\n removedUser: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: removedUser, ...byId } = state.byId;\n state.byId = byId;\n state.currentUser = state.currentUser === action.payload ? null : state.currentUser;\n },\n updatedUser: (state, action: PayloadAction<Partial<User> & { id: string }>) => {\n state.byId[action.payload.id] = {\n ...state.byId[action.payload.id],\n ...action.payload\n };\n },\n receivedPermissionSets: (state, action: PayloadAction<Record<string, PermissionSet>>) => {\n state.permissionSetsById = action.payload;\n },\n receivedRoles: (state, action: PayloadAction<Record<string, Role>>) => {\n state.rolesById = action.payload;\n state.rolesInitialized = true;\n },\n finishedRoleInitialization: (state, action) => {\n state.rolesInitialized = action.payload;\n },\n createdRole: (state, action: PayloadAction<Role>) => {\n state.rolesById[action.payload.name] = {\n ...state.rolesById[action.payload.name],\n ...action.payload\n };\n },\n removedRole: (state, action: PayloadAction<string>) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { [action.payload]: toBeRemoved, ...rolesById } = state.rolesById;\n state.rolesById = rolesById;\n },\n setCustomColumns: (state, action: PayloadAction<CustomColumn[]>) => {\n state.customColumns = action.payload;\n },\n setGlobalSettings: (state, action: PayloadAction<GlobalSettings>) => {\n state.settingsInitialized = true;\n state.globalSettings = {\n ...state.globalSettings,\n ...action.payload\n };\n },\n setUserSettings: (state, action: PayloadAction<UserSettings>) => {\n state.userSettingsInitialized = true;\n state.userSettings = {\n ...state.userSettings,\n ...action.payload\n };\n },\n setTooltipState: (state, action: PayloadAction<{ id: string; readState: ReadState }>) => {\n const { id, readState = READ_STATES.read } = action.payload;\n state.tooltips.byId[id] = { ...state.tooltips.byId[id], readState };\n },\n setTooltipsState: (state, action: PayloadAction<UserSliceType['tooltips']['byId']>) => {\n state.tooltips.byId = {\n ...state.tooltips.byId,\n ...action.payload\n };\n },\n setShowFeedbackDialog: (state, action: PayloadAction<boolean>) => {\n state.showFeedbackDialog = action.payload;\n },\n setShowConnectingDialog: (state, action: PayloadAction<boolean>) => {\n state.showConnectDeviceDialog = action.payload;\n },\n setShowStartupNotification: (state, action: PayloadAction<boolean>) => {\n state.showStartupNotification = action.payload;\n }\n }\n});\n\nexport const actions = usersSlice.actions;\nexport default usersSlice.reducer;\n"],"mappings":";;;;;;;AAeA,SAAS,mBAAmB;AAOrB,IAAM,YAAY;AAgFlB,IAAM,eAA8B;AAAA,EACzC,gBAAgB;AAAA,EAChB,MAAM,CAAC;AAAA,EACP,aAAa;AAAA,EACb,gBAAgB;AAAA;AAAA,EAEhB;AAAA,EACA,eAAe,CAAC;AAAA,EAChB,QAAQ;AAAA,EACR,gBAAgB;AAAA,IACd,cAAc;AAAA,IACd,iBAAiB,CAAC;AAAA,IAClB,gBAAgB,CAAC;AAAA,IACjB,S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;AACrF,YAAM,SAAS,OAAO;AAAA,QACpB,GAAG,MAAM,SAAS;AAAA,QAClB,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AAAA,IACA,uBAAuB,CAAC,OAAO,WAAmC;AAChE,YAAM,qBAAqB,OAAO;AAAA,IACpC;AAAA,IACA,yBAAyB,CAAC,OAAO,WAAmC;AAClE,YAAM,0BAA0B,OAAO;AAAA,IACzC;AAAA,IACA,4BAA4B,CAAC,OAAO,WAAmC;AACrE,YAAM,0BAA0B,OAAO;AAAA,IACzC;AAAA,EACF;AACF,CAAC;AAEM,IAAM,UAAU,WAAW;AAClC,IAAO,qBAAQ,WAAW;","names":["rolesById"]}
@@ -848,6 +848,17 @@ var getAttributesList = (0, import_toolkit3.createSelector)(
848
848
  [getFilteringAttributes, getFilteringAttributesFromConfig],
849
849
  ({ identityAttributes = [], inventoryAttributes = [] }, { identity = [], inventory = [] }) => [...identityAttributes, ...inventoryAttributes, ...identity, ...inventory].filter(import_helpers2.duplicateFilter)
850
850
  );
851
+ var getDeviceLimitStats = (0, import_toolkit3.createSelector)(
852
+ [getDeviceLimits, getAcceptedDevices],
853
+ (limits, accepted) => {
854
+ const { counts } = accepted;
855
+ return Object.entries(limits).filter(([, limit]) => limit !== 0).map(([type, limit]) => ({
856
+ type,
857
+ limit,
858
+ total: counts[type] || 0
859
+ }));
860
+ }
861
+ );
851
862
  var getDeviceTypes = (0, import_toolkit3.createSelector)(
852
863
  [getAcceptedDevices, getDevicesById],
853
864
  ({ deviceIds = [] }, devicesById) => Object.keys(