@northern.tech/store 0.10.0 → 0.12.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 (89) hide show
  1. package/dist/actions.cjs +2 -1
  2. package/dist/actions.cjs.map +1 -1
  3. package/dist/actions.js +3 -3
  4. package/dist/appSlice/thunks.cjs +5 -2
  5. package/dist/appSlice/thunks.cjs.map +1 -1
  6. package/dist/appSlice/thunks.js +9 -9
  7. package/dist/{chunk-YYA5MPLL.js → chunk-4HSH7RH3.js} +3 -3
  8. package/dist/{chunk-2S4DM4MI.js → chunk-5ZCZTTYX.js} +2 -2
  9. package/dist/{chunk-DIBKFSC7.js → chunk-C5NXNZ7F.js} +20 -9
  10. package/dist/chunk-C5NXNZ7F.js.map +1 -0
  11. package/dist/{chunk-SE22RKCE.js → chunk-MH5WPYQI.js} +2 -2
  12. package/dist/chunk-MH5WPYQI.js.map +1 -0
  13. package/dist/{chunk-2KT4PX3H.js → chunk-OGUVURJ5.js} +4 -4
  14. package/dist/{chunk-J5KNRQFA.js → chunk-TKIOEF3B.js} +5 -5
  15. package/dist/{chunk-CKF76YO4.js → chunk-WCBHYLUK.js} +3 -2
  16. package/dist/chunk-WCBHYLUK.js.map +1 -0
  17. package/dist/{chunk-VANBSJS5.js → chunk-ZNAJKEP2.js} +1 -1
  18. package/dist/chunk-ZNAJKEP2.js.map +1 -0
  19. package/dist/{chunk-ZK2CPOZO.js → chunk-ZRMB4U7Z.js} +4 -4
  20. package/dist/commonSelectors.cjs +1 -1
  21. package/dist/commonSelectors.cjs.map +1 -1
  22. package/dist/commonSelectors.js +2 -2
  23. package/dist/deploymentsSlice/thunks.cjs +5 -2
  24. package/dist/deploymentsSlice/thunks.cjs.map +1 -1
  25. package/dist/deploymentsSlice/thunks.js +9 -9
  26. package/dist/devicesSlice/selectors.cjs +1 -1
  27. package/dist/devicesSlice/selectors.cjs.map +1 -1
  28. package/dist/devicesSlice/selectors.js +1 -1
  29. package/dist/devicesSlice/thunks.cjs +5 -2
  30. package/dist/devicesSlice/thunks.cjs.map +1 -1
  31. package/dist/devicesSlice/thunks.js +9 -9
  32. package/dist/monitorSlice/thunks.cjs +3 -2
  33. package/dist/monitorSlice/thunks.cjs.map +1 -1
  34. package/dist/monitorSlice/thunks.js +7 -7
  35. package/dist/onboardingSlice/index.cjs.map +1 -1
  36. package/dist/onboardingSlice/index.d.cts +1 -1
  37. package/dist/onboardingSlice/index.d.ts +1 -1
  38. package/dist/onboardingSlice/index.js +1 -1
  39. package/dist/onboardingSlice/mocks.cjs.map +1 -1
  40. package/dist/onboardingSlice/mocks.js +1 -1
  41. package/dist/onboardingSlice/thunks.cjs +15 -3
  42. package/dist/onboardingSlice/thunks.cjs.map +1 -1
  43. package/dist/onboardingSlice/thunks.js +9 -9
  44. package/dist/organizationSlice/thunks.cjs +7 -4
  45. package/dist/organizationSlice/thunks.cjs.map +1 -1
  46. package/dist/organizationSlice/thunks.js +9 -9
  47. package/dist/releasesSlice/thunks.cjs +3 -2
  48. package/dist/releasesSlice/thunks.cjs.map +1 -1
  49. package/dist/releasesSlice/thunks.js +7 -7
  50. package/dist/selectors.cjs +1 -1
  51. package/dist/selectors.cjs.map +1 -1
  52. package/dist/selectors.js +2 -2
  53. package/dist/sockethook.cjs +1 -1
  54. package/dist/sockethook.cjs.map +1 -1
  55. package/dist/sockethook.js +1 -1
  56. package/dist/sockethook.js.map +1 -1
  57. package/dist/store.cjs +2 -1
  58. package/dist/store.cjs.map +1 -1
  59. package/dist/store.js +4 -4
  60. package/dist/storehooks.cjs +18 -6
  61. package/dist/storehooks.cjs.map +1 -1
  62. package/dist/storehooks.js +9 -9
  63. package/dist/thunks.cjs +15 -3
  64. package/dist/thunks.cjs.map +1 -1
  65. package/dist/thunks.js +9 -9
  66. package/dist/useDeploymentDevice.cjs +5 -2
  67. package/dist/useDeploymentDevice.cjs.map +1 -1
  68. package/dist/useDeploymentDevice.js +9 -9
  69. package/dist/usersSlice/index.cjs +2 -1
  70. package/dist/usersSlice/index.cjs.map +1 -1
  71. package/dist/usersSlice/index.d.cts +2 -1
  72. package/dist/usersSlice/index.d.ts +2 -1
  73. package/dist/usersSlice/index.js +1 -1
  74. package/dist/usersSlice/mocks.cjs +2 -1
  75. package/dist/usersSlice/mocks.cjs.map +1 -1
  76. package/dist/usersSlice/mocks.js +1 -1
  77. package/dist/usersSlice/thunks.cjs +5 -2
  78. package/dist/usersSlice/thunks.cjs.map +1 -1
  79. package/dist/usersSlice/thunks.js +9 -9
  80. package/package.json +4 -4
  81. package/dist/chunk-CKF76YO4.js.map +0 -1
  82. package/dist/chunk-DIBKFSC7.js.map +0 -1
  83. package/dist/chunk-SE22RKCE.js.map +0 -1
  84. package/dist/chunk-VANBSJS5.js.map +0 -1
  85. /package/dist/{chunk-YYA5MPLL.js.map → chunk-4HSH7RH3.js.map} +0 -0
  86. /package/dist/{chunk-2S4DM4MI.js.map → chunk-5ZCZTTYX.js.map} +0 -0
  87. /package/dist/{chunk-2KT4PX3H.js.map → chunk-OGUVURJ5.js.map} +0 -0
  88. /package/dist/{chunk-J5KNRQFA.js.map → chunk-TKIOEF3B.js.map} +0 -0
  89. /package/dist/{chunk-ZK2CPOZO.js.map → chunk-ZRMB4U7Z.js.map} +0 -0
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  getDeviceById
3
- } from "./chunk-DIBKFSC7.js";
4
- import "./chunk-ZK2CPOZO.js";
5
- import "./chunk-J5KNRQFA.js";
3
+ } from "./chunk-C5NXNZ7F.js";
4
+ import "./chunk-ZRMB4U7Z.js";
5
+ import "./chunk-TKIOEF3B.js";
6
6
  import {
7
7
  useAppDispatch
8
- } from "./chunk-2KT4PX3H.js";
8
+ } from "./chunk-OGUVURJ5.js";
9
9
  import "./chunk-Y3DJIMEN.js";
10
10
  import "./chunk-5M6EUVNO.js";
11
- import "./chunk-YYA5MPLL.js";
11
+ import "./chunk-4HSH7RH3.js";
12
12
  import "./chunk-TRKA7XYU.js";
13
- import "./chunk-CKF76YO4.js";
13
+ import "./chunk-WCBHYLUK.js";
14
14
  import "./chunk-QOFVCPRW.js";
15
15
  import "./chunk-HLX5L3IM.js";
16
- import "./chunk-VANBSJS5.js";
16
+ import "./chunk-ZNAJKEP2.js";
17
17
  import "./chunk-REZWSU22.js";
18
18
  import "./chunk-OFGCC3GM.js";
19
19
  import "./chunk-C2LGE3P6.js";
20
20
  import "./chunk-FDSMCFV5.js";
21
21
  import "./chunk-53W2NRSL.js";
22
22
  import "./chunk-NMAXZ3ZY.js";
23
- import "./chunk-2S4DM4MI.js";
23
+ import "./chunk-5ZCZTTYX.js";
24
24
  import "./chunk-GGBE6KJV.js";
25
25
  import "./chunk-7QKCBSFU.js";
26
26
  import "./chunk-3NOV7X4M.js";
@@ -29,7 +29,7 @@ import "./chunk-JIS4PA3R.js";
29
29
  import "./chunk-WR6RQKF5.js";
30
30
  import {
31
31
  getDevicesById
32
- } from "./chunk-SE22RKCE.js";
32
+ } from "./chunk-MH5WPYQI.js";
33
33
  import "./chunk-BYUPW7RA.js";
34
34
  import "./chunk-GX2TWNLC.js";
35
35
  import "./chunk-WWED74SG.js";
@@ -74,7 +74,8 @@ var initialState = {
74
74
  },
75
75
  userSettings: {
76
76
  columnSelection: [],
77
- onboarding: {}
77
+ onboarding: {},
78
+ firstLoginTimestamp: null
78
79
  },
79
80
  userSettingsInitialized: false
80
81
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/usersSlice/index.ts","../../src/constants.ts","../../src/usersSlice/constants.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 mode?: 'light' | 'dark';\n onboarding: Partial<{\n address: string;\n approach: 'physical' | 'virtual';\n complete: boolean;\n demoArtifactPort: number;\n deviceType: string[] | string;\n progress: string;\n showTips: null | boolean;\n showTipsDialog: boolean;\n }>;\n tooltips?: object;\n trackingConsentGiven?: boolean;\n};\ntype UserSliceState = {\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};\nexport const initialState: UserSliceState = {\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 },\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<UserSliceState['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","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n","'use strict';\n\n// Copyright 2015 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 { uiPermissionsById } from '../constants';\n\nexport type UiPermission = {\n explanations: object;\n permissionLevel: number;\n permissionSets: Record<string, string>;\n title: string;\n value: string;\n verbs: string[];\n};\n\ntype ExcessiveAccessConfig = {\n selector: string;\n warning: string;\n};\n\ntype EndpointDefinition = {\n path: RegExp;\n types: string[];\n uiPermissions: UiPermission[];\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport type PermissionsArea = {\n endpoints: EndpointDefinition[];\n excessiveAccessConfig?: ExcessiveAccessConfig;\n explanation: string;\n filter?: (object) => string[];\n key: string;\n placeholder?: string;\n scope?: string;\n title: string;\n uiPermissions: UiPermission[];\n};\n\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n} as const;\nexport type ReadState = keyof typeof READ_STATES;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,qBAA4B;;;ACD5B,uBA8CO;;;ACUA,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AACV;;;AFpDO,IAAM,YAAY;AA4ElB,IAAM,eAA+B;AAAA,EAC1C,gBAAgB;AAAA,EAChB,MAAM,CAAC;AAAA,EACP,aAAa;AAAA,EACb,gBAAgB;AAAA;AAAA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AK,EAAE,IAAI,EAAE,GAAG,MAAM,SAAS,KAAK,EAAE,GAAG,UAAU;AAAA,IACpE;AAAA,IACA,kBAAkB,CAAC,OAAO,WAA8D;AACtF,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"]}
1
+ {"version":3,"sources":["../../src/usersSlice/index.ts","../../src/constants.ts","../../src/usersSlice/constants.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 tooltips?: object;\n trackingConsentGiven?: boolean;\n};\ntype UserSliceState = {\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};\nexport const initialState: UserSliceState = {\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 },\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<UserSliceState['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","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n","'use strict';\n\n// Copyright 2015 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 { uiPermissionsById } from '../constants';\n\nexport type UiPermission = {\n explanations: object;\n permissionLevel: number;\n permissionSets: Record<string, string>;\n title: string;\n value: string;\n verbs: string[];\n};\n\ntype ExcessiveAccessConfig = {\n selector: string;\n warning: string;\n};\n\ntype EndpointDefinition = {\n path: RegExp;\n types: string[];\n uiPermissions: UiPermission[];\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport type PermissionsArea = {\n endpoints: EndpointDefinition[];\n excessiveAccessConfig?: ExcessiveAccessConfig;\n explanation: string;\n filter?: (object) => string[];\n key: string;\n placeholder?: string;\n scope?: string;\n title: string;\n uiPermissions: UiPermission[];\n};\n\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n} as const;\nexport type ReadState = keyof typeof READ_STATES;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,qBAA4B;;;ACD5B,uBA8CO;;;ACUA,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AACV;;;AFpDO,IAAM,YAAY;AA6ElB,IAAM,eAA+B;AAAA,EAC1C,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,SAAS;AAAA,EACX;AAAA,EACA,oBAAoB;AAAA,IAClB,GAAG;AAAA,EACL;AAAA,EACA,WAAW;AAAA,IACT,GAAG;AAAA,EACL;AAAA,EACA,kBAAkB;AAAA,E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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"]}
@@ -50,10 +50,11 @@ type UserSettings = {
50
50
  [x: string]: any;
51
51
  columnSelection: Column[];
52
52
  feedbackCollectedAt?: string;
53
+ firstLoginTimestamp: null | string;
53
54
  mode?: 'light' | 'dark';
54
55
  onboarding: Partial<{
55
56
  address: string;
56
- approach: 'physical' | 'virtual';
57
+ approach: 'physical' | 'virtual' | 'mcu' | null;
57
58
  complete: boolean;
58
59
  demoArtifactPort: number;
59
60
  deviceType: string[] | string;
@@ -50,10 +50,11 @@ type UserSettings = {
50
50
  [x: string]: any;
51
51
  columnSelection: Column[];
52
52
  feedbackCollectedAt?: string;
53
+ firstLoginTimestamp: null | string;
53
54
  mode?: 'light' | 'dark';
54
55
  onboarding: Partial<{
55
56
  address: string;
56
- approach: 'physical' | 'virtual';
57
+ approach: 'physical' | 'virtual' | 'mcu' | null;
57
58
  complete: boolean;
58
59
  demoArtifactPort: number;
59
60
  deviceType: string[] | string;
@@ -4,7 +4,7 @@ import {
4
4
  sliceName,
5
5
  usersSlice,
6
6
  usersSlice_default
7
- } from "../chunk-CKF76YO4.js";
7
+ } from "../chunk-WCBHYLUK.js";
8
8
  import "../chunk-WWED74SG.js";
9
9
  import "../chunk-2DYA3X77.js";
10
10
  import "../chunk-FAJ3I2UQ.js";
@@ -70,7 +70,8 @@ var initialState = {
70
70
  },
71
71
  userSettings: {
72
72
  columnSelection: [],
73
- onboarding: {}
73
+ onboarding: {},
74
+ firstLoginTimestamp: null
74
75
  },
75
76
  userSettingsInitialized: false
76
77
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/usersSlice/mocks.ts","../../src/constants.ts","../../src/usersSlice/constants.ts","../../src/usersSlice/index.ts"],"sourcesContent":["// Copyright 2025 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 { emptyRole, emptyUiPermissions, rolesById, rolesByName, twoFAStates, uiPermissionsById } from '../constants';\nimport { initialState } from './index';\n\nconst userId = 'a30a780b-b843-5344-80e3-0fd95a4f6fc3';\n\nexport const mockState = {\n ...initialState,\n byId: {\n a1: { email: 'a@b.com', id: 'a1', created_ts: '2019-01-01T10:30:00.000Z', roles: [rolesByName.admin], verified: true },\n [userId]: { email: 'a2@b.com', id: userId, created_ts: '2019-01-01T12:30:00.000Z', roles: [rolesByName.admin], tfa_status: twoFAStates.enabled }\n },\n currentUser: 'a1',\n globalSettings: { '2fa': 'enabled', id_attribute: undefined, previousFilters: [] },\n rolesById: {\n ...rolesById,\n test: {\n ...emptyRole,\n name: 'test',\n description: 'test description',\n editable: true,\n uiPermissions: {\n ...emptyUiPermissions,\n groups: { testGroup: [uiPermissionsById.read.value] },\n releases: { bar: [uiPermissionsById.read.value] }\n }\n }\n },\n settingsInitialized: true,\n userSettingsInitialized: true,\n userSettings: { '2fa': 'disabled', previousFilters: [], columnSelection: [], onboarding: { something: 'here' }, tooltips: {} }\n};\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n","'use strict';\n\n// Copyright 2015 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 { uiPermissionsById } from '../constants';\n\nexport type UiPermission = {\n explanations: object;\n permissionLevel: number;\n permissionSets: Record<string, string>;\n title: string;\n value: string;\n verbs: string[];\n};\n\ntype ExcessiveAccessConfig = {\n selector: string;\n warning: string;\n};\n\ntype EndpointDefinition = {\n path: RegExp;\n types: string[];\n uiPermissions: UiPermission[];\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport type PermissionsArea = {\n endpoints: EndpointDefinition[];\n excessiveAccessConfig?: ExcessiveAccessConfig;\n explanation: string;\n filter?: (object) => string[];\n key: string;\n placeholder?: string;\n scope?: string;\n title: string;\n uiPermissions: UiPermission[];\n};\n\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n} as const;\nexport type ReadState = keyof typeof READ_STATES;\n","// 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 mode?: 'light' | 'dark';\n onboarding: Partial<{\n address: string;\n approach: 'physical' | 'virtual';\n complete: boolean;\n demoArtifactPort: number;\n deviceType: string[] | string;\n progress: string;\n showTips: null | boolean;\n showTipsDialog: boolean;\n }>;\n tooltips?: object;\n trackingConsentGiven?: boolean;\n};\ntype UserSliceState = {\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};\nexport const initialState: UserSliceState = {\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 },\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<UserSliceState['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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcA,uBA8CO;;;ACUA,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AACV;;;AC3DA,qBAA4B;AAOrB,IAAM,YAAY;AA4ElB,IAAM,eAA+B;AAAA,EAC1C,gBAAgB;AAAA,EAChB,MAAM,CAA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AkB,KAAK,KAAK,EAAE;AAAA,MAClD;AAAA,IACF;AAAA,EACF;AAAA,EACA,qBAAqB;AAAA,EACrB,yBAAyB;AAAA,EACzB,cAAc,EAAE,OAAO,YAAY,iBAAiB,CAAC,GAAG,iBAAiB,CAAC,GAAG,YAAY,EAAE,WAAW,OAAO,GAAG,UAAU,CAAC,EAAE;AAC/H;","names":["rolesById"]}
1
+ {"version":3,"sources":["../../src/usersSlice/mocks.ts","../../src/constants.ts","../../src/usersSlice/constants.ts","../../src/usersSlice/index.ts"],"sourcesContent":["// Copyright 2025 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 { emptyRole, emptyUiPermissions, rolesById, rolesByName, twoFAStates, uiPermissionsById } from '../constants';\nimport { initialState } from './index';\n\nconst userId = 'a30a780b-b843-5344-80e3-0fd95a4f6fc3';\n\nexport const mockState = {\n ...initialState,\n byId: {\n a1: { email: 'a@b.com', id: 'a1', created_ts: '2019-01-01T10:30:00.000Z', roles: [rolesByName.admin], verified: true },\n [userId]: { email: 'a2@b.com', id: userId, created_ts: '2019-01-01T12:30:00.000Z', roles: [rolesByName.admin], tfa_status: twoFAStates.enabled }\n },\n currentUser: 'a1',\n globalSettings: { '2fa': 'enabled', id_attribute: undefined, previousFilters: [] },\n rolesById: {\n ...rolesById,\n test: {\n ...emptyRole,\n name: 'test',\n description: 'test description',\n editable: true,\n uiPermissions: {\n ...emptyUiPermissions,\n groups: { testGroup: [uiPermissionsById.read.value] },\n releases: { bar: [uiPermissionsById.read.value] }\n }\n }\n },\n settingsInitialized: true,\n userSettingsInitialized: true,\n userSettings: { '2fa': 'disabled', previousFilters: [], columnSelection: [], onboarding: { something: 'here' }, tooltips: {} }\n};\n","// Copyright 2024 Northern.tech AS\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//@ts-nocheck\nimport {\n ALL_DEVICES,\n ALL_DEVICE_STATES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n PermissionTypes,\n SORTING_OPTIONS,\n alertChannels,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n limitDefault,\n maxSessionAge,\n monitorApiUrlv1,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n} from '@northern.tech/utils/constants';\nimport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n} from '@northern.tech/utils/constants';\n\nexport {\n alertChannels,\n ALL_DEVICE_STATES,\n ALL_DEVICES,\n ALL_RELEASES,\n APPLICATION_JSON_CONTENT_TYPE,\n APPLICATION_JWT_CONTENT_TYPE,\n ATTRIBUTE_SCOPES,\n apiRoot,\n apiUrl,\n auditLogsApiUrl,\n defaultPermissionSets,\n deploymentsApiUrl,\n deploymentsApiUrlV2,\n DEVICE_FILTERING_OPTIONS,\n DEVICE_ISSUE_OPTIONS,\n DEVICE_LIST_DEFAULTS,\n DEVICE_STATES,\n deviceAuthV2,\n deviceConfig,\n deviceConnect,\n emptyRole,\n emptyUiPermissions,\n headerNames,\n inventoryApiUrl,\n inventoryApiUrlV2,\n iotManagerBaseURL,\n monitorApiUrlv1,\n limitDefault,\n maxSessionAge,\n PermissionTypes,\n reportingApiUrl,\n rolesById,\n rolesByName,\n scopedPermissionAreas,\n serviceProviderRolesById,\n SORTING_OPTIONS,\n ssoIdpApiUrlv1,\n tenantadmApiUrlv1,\n tenantadmApiUrlv2,\n twoFAStates,\n uiPermissionsByArea,\n uiPermissionsById,\n useradmApiUrl,\n useradmApiUrlv1,\n useradmApiUrlv2\n};\n\nexport type {\n AnyPermission,\n AuditLogPermission,\n DeploymentPermission,\n DeviceIssueOptionKey,\n GroupsPermission,\n PermissionObject,\n PermissionSet,\n PermissionSetId,\n ReleasesPermission,\n Role,\n ScopedPermissionsByAreaKey,\n SortOptions,\n UiPermissionsByAreaKey,\n UiPermissionsByIdKey,\n UiPermissionsDefinition,\n UserManagementPermission\n};\n\nexport * from './appSlice/constants';\nexport * from './commonConstants';\nexport * from './deploymentsSlice/constants';\nexport * from './devicesSlice/constants';\nexport * from './monitorSlice/constants';\nexport * from './onboardingSlice/constants';\nexport * from './organizationSlice/constants';\nexport * from './releasesSlice/constants';\nexport * from './usersSlice/constants';\n","'use strict';\n\n// Copyright 2015 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 { uiPermissionsById } from '../constants';\n\nexport type UiPermission = {\n explanations: object;\n permissionLevel: number;\n permissionSets: Record<string, string>;\n title: string;\n value: string;\n verbs: string[];\n};\n\ntype ExcessiveAccessConfig = {\n selector: string;\n warning: string;\n};\n\ntype EndpointDefinition = {\n path: RegExp;\n types: string[];\n uiPermissions: UiPermission[];\n};\n\n/**\n * _uiPermissions_ represent the possible permissions/ rights that can be given for the area\n * _endpoints_ represent the possible endpoints this definition might be affecting in the UI and what\n * functionality might be affected\n *\n */\nexport type PermissionsArea = {\n endpoints: EndpointDefinition[];\n excessiveAccessConfig?: ExcessiveAccessConfig;\n explanation: string;\n filter?: (object) => string[];\n key: string;\n placeholder?: string;\n scope?: string;\n title: string;\n uiPermissions: UiPermission[];\n};\n\nexport const itemUiPermissionsReducer = (accu, { item, uiPermissions }) => (item ? { ...accu, [item]: uiPermissions } : accu);\n\nconst checkSinglePermission = (permission, requiredPermission) =>\n requiredPermission === permission || uiPermissionsById[permission].permissionLevel > uiPermissionsById[requiredPermission].permissionLevel;\n\nexport const checkPermissionsObject = (permissions, requiredPermission, scopedAccess, superAccess) =>\n permissions[superAccess]?.some(permission => checkSinglePermission(permission, requiredPermission)) ||\n permissions[scopedAccess]?.some(permission => checkSinglePermission(permission, requiredPermission));\n\nexport const USER_LOGOUT = 'USER_LOGOUT';\n\nexport const OWN_USER_ID = 'me';\n\nexport const settingsKeys = { initialized: 'settings-initialized' };\n\nexport const READ_STATES = {\n read: 'read',\n seen: 'seen',\n unread: 'unread'\n} as const;\nexport type ReadState = keyof typeof READ_STATES;\n","// 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 tooltips?: object;\n trackingConsentGiven?: boolean;\n};\ntype UserSliceState = {\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};\nexport const initialState: UserSliceState = {\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 },\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<UserSliceState['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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACcA,uBA8CO;;;ACUA,IAAM,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AACV;;;AC3DA,qBAA4B;AAOrB,IAAM,YAAY;AA6ElB,IAAM,eAA+B;AAAA,EAC1C,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,SAAS;AAAA,EACX;AAAA,EACA,oBAAoB;AAAA,IAClB,GAAG;AAAA,EACL;AAAA,EACA,WAAW;AAAA,IACT,GAAG;AAAA,EACL;AAAA,EACA,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,UAAU;AAAA,IACR,MAAM;AAAA;AAAA,IAEN;AAAA,EACF;AAAA,EACA,cAAc;AAAA,IACZ,iBAAiB,CAAC;AAAA,IAClB,YAAY,CAAC;AAAA,IACb,qBAAqB;AAAA,EACvB;AAAA,EACA,yBAAyB;AAC3B;AAEO,IAAM,iBAAa,4BAAY;AAAA,EACpC,MAAM;AAAA,EACN;AAAA,EACA,UAAU;AAAA,IACR,gBAAgB,CAAC,OAAO,WAAyC;AAC/D,YAAM,SAAS,OAAO;AAAA,IACxB;AAAA,IACA,sBAAsB,CAAC,OAAO,WAAuC;AACnE,YAAM,iBAAiB,OAAO;AAAA,IAChC;AAAA,IACA,kBAAkB,CAAC,OAAO,WAAgD;AACxE,YAAM,OAAO,OAAO;AAAA,IACtB;AAAA,IACA,wBAAwB,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A,aAAa;AAAA,EACb,gBAAgB,EAAE,OAAO,WAAW,cAAc,QAAW,iBAAiB,CAAC,EAAE;AAAA,EACjF,WAAW;AAAA,IACT,GAAG;AAAA,IACH,MAAM;AAAA,MACJ,GAAG;AAAA,MACH,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,MACV,eAAe;AAAA,QACb,GAAG;AAAA,QACH,QAAQ,EAAE,WAAW,CAAC,mCAAkB,KAAK,KAAK,EAAE;AAAA,QACpD,UAAU,EAAE,KAAK,CAAC,mCAAkB,KAAK,KAAK,EAAE;AAAA,MAClD;AAAA,IACF;AAAA,EACF;AAAA,EACA,qBAAqB;AAAA,EACrB,yBAAyB;AAAA,EACzB,cAAc,EAAE,OAAO,YAAY,iBAAiB,CAAC,GAAG,iBAAiB,CAAC,GAAG,YAAY,EAAE,WAAW,OAAO,GAAG,UAAU,CAAC,EAAE;AAC/H;","names":["rolesById"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  initialState
3
- } from "../chunk-CKF76YO4.js";
3
+ } from "../chunk-WCBHYLUK.js";
4
4
  import {
5
5
  emptyRole,
6
6
  emptyUiPermissions,
@@ -71,6 +71,7 @@ __export(thunks_exports, {
71
71
  module.exports = __toCommonJS(thunks_exports);
72
72
  var import_helpers10 = require("@northern.tech/utils/helpers");
73
73
  var import_retrytimer = require("@northern.tech/utils/retrytimer");
74
+ var import_dayjs = __toESM(require("dayjs"), 1);
74
75
  var import_md5 = __toESM(require("md5"), 1);
75
76
  var import_universal_cookie3 = __toESM(require("universal-cookie"), 1);
76
77
 
@@ -825,7 +826,8 @@ var initialState = {
825
826
  },
826
827
  userSettings: {
827
828
  columnSelection: [],
828
- onboarding: {}
829
+ onboarding: {},
830
+ firstLoginTimestamp: null
829
831
  },
830
832
  userSettingsInitialized: false
831
833
  };
@@ -1938,7 +1940,7 @@ var getCombinedLimit = (0, import_toolkit11.createSelector)(
1938
1940
  );
1939
1941
  var getLimitMaxed = (0, import_toolkit11.createSelector)(
1940
1942
  [getAcceptedDevices, getCombinedLimit],
1941
- ({ total: acceptedDevices = 0 }, combinedLimit) => combinedLimit <= acceptedDevices
1943
+ ({ total: acceptedDevices = 0 }, combinedLimit) => !!combinedLimit && combinedLimit <= acceptedDevices
1942
1944
  );
1943
1945
  var getGroupsByIdWithoutUngrouped = (0, import_toolkit11.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
1944
1946
  var getGroupData = (0, import_toolkit11.createSelector)([getGroupsByIdWithoutUngrouped], (groups) => {
@@ -4505,6 +4507,7 @@ var saveUserSettings = createAppAsyncThunk(
4505
4507
  const updatedSettings = {
4506
4508
  ...userSettings,
4507
4509
  ...settings,
4510
+ firstLoginTimestamp: userSettings.firstLoginTimestamp ?? (0, import_dayjs.default)().format(),
4508
4511
  onboarding: {
4509
4512
  ...onboardingState,
4510
4513
  ...settings.onboarding