@gen-epix/ui-client-common 4.3.1 → 4.4.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 (419) hide show
  1. package/README.md +9 -10
  2. package/dist/@types/mui.d.ts +1 -1
  3. package/dist/_chunks/ApplicationFooter.js +49 -49
  4. package/dist/_chunks/ApplicationFooter.js.map +1 -1
  5. package/dist/_chunks/Breadcrumbs.js +23 -22
  6. package/dist/_chunks/Breadcrumbs.js.map +1 -1
  7. package/dist/_chunks/CrudPage.js +211 -210
  8. package/dist/_chunks/CrudPage.js.map +1 -1
  9. package/dist/_chunks/GeoFilter.js.map +1 -1
  10. package/dist/_chunks/Notifications.js +67 -66
  11. package/dist/_chunks/Notifications.js.map +1 -1
  12. package/dist/_chunks/OutageList.js +30 -30
  13. package/dist/_chunks/OutageList.js.map +1 -1
  14. package/dist/_chunks/OutageUtil.js +2 -2
  15. package/dist/_chunks/OutageUtil.js.map +1 -1
  16. package/dist/_chunks/QueryClientProvider.js +1 -1
  17. package/dist/_chunks/QueryClientProvider.js.map +1 -1
  18. package/dist/_chunks/QueryClientService.js +406 -117
  19. package/dist/_chunks/QueryClientService.js.map +1 -1
  20. package/dist/_chunks/Reflect.js +642 -0
  21. package/dist/_chunks/Reflect.js.map +1 -0
  22. package/dist/_chunks/Table.js +572 -574
  23. package/dist/_chunks/Table.js.map +1 -1
  24. package/dist/_chunks/TableUtil.js +5 -5
  25. package/dist/_chunks/TableUtil.js.map +1 -1
  26. package/dist/_chunks/TextFilter.js +1 -1
  27. package/dist/_chunks/TextFilter.js.map +1 -1
  28. package/dist/_chunks/UserInvitationsAdminPage.js +109 -107
  29. package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
  30. package/dist/_chunks/UserManagerUtil.js +7 -15
  31. package/dist/_chunks/UserManagerUtil.js.map +1 -1
  32. package/dist/_chunks/_baseAssignValue.js.map +1 -1
  33. package/dist/_chunks/_baseFlatten.js +8 -8
  34. package/dist/_chunks/_baseFlatten.js.map +1 -1
  35. package/dist/_chunks/_baseUnset.js +299 -22
  36. package/dist/_chunks/_baseUnset.js.map +1 -1
  37. package/dist/_chunks/_cacheHas.js.map +1 -1
  38. package/dist/_chunks/_setToString.js.map +1 -1
  39. package/dist/_chunks/decorate.js +9 -0
  40. package/dist/_chunks/decorateParam.js +8 -0
  41. package/dist/_chunks/format.js.map +1 -1
  42. package/dist/_chunks/isArrayLike.js.map +1 -1
  43. package/dist/_chunks/isObject.js.map +1 -1
  44. package/dist/_chunks/isSymbol.js.map +1 -1
  45. package/dist/_chunks/middleware.js +1 -1
  46. package/dist/_chunks/middleware.js.map +1 -1
  47. package/dist/_chunks/omit.js +39 -40
  48. package/dist/_chunks/omit.js.map +1 -1
  49. package/dist/_chunks/query.js +13 -17
  50. package/dist/_chunks/query.js.map +1 -1
  51. package/dist/_chunks/react.js +1 -1
  52. package/dist/_chunks/react.js.map +1 -1
  53. package/dist/_chunks/tableStore.js +40 -54
  54. package/dist/_chunks/tableStore.js.map +1 -1
  55. package/dist/_chunks/toDate.js.map +1 -1
  56. package/dist/_chunks/useColumnsMenu.js +2 -2
  57. package/dist/_chunks/useColumnsMenu.js.map +1 -1
  58. package/dist/_chunks/useMutation.js +31 -30
  59. package/dist/_chunks/useMutation.js.map +1 -1
  60. package/dist/_chunks/useQueryMemo.js +5 -5
  61. package/dist/_chunks/useQueryMemo.js.map +1 -1
  62. package/dist/_chunks/vanilla.js +1 -1
  63. package/dist/_chunks/vanilla.js.map +1 -1
  64. package/dist/_chunks/yup.js +2 -2
  65. package/dist/_chunks/yup.js.map +1 -1
  66. package/dist/classes/TableEventBus/TableEventBus.d.ts +1 -1
  67. package/dist/classes/TableEventBus/index.js.map +1 -1
  68. package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
  69. package/dist/classes/containers/UiClientCommonContainer/UiClientCommonContainer.d.ts +5 -0
  70. package/dist/classes/containers/UiClientCommonContainer/index.d.ts +1 -0
  71. package/dist/classes/containers/UiClientCommonContainer/index.js +17 -0
  72. package/dist/classes/containers/UiClientCommonContainer/index.js.map +1 -0
  73. package/dist/classes/filters/BooleanFilter.d.ts +1 -1
  74. package/dist/classes/filters/DateFilter.d.ts +2 -2
  75. package/dist/classes/filters/GeoFilter.d.ts +2 -2
  76. package/dist/classes/filters/MultiSelectFilter.d.ts +2 -2
  77. package/dist/classes/filters/NumberRangeFilter.d.ts +1 -1
  78. package/dist/classes/filters/TextFilter.d.ts +1 -1
  79. package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +5 -3
  80. package/dist/classes/services/AuthenticationService/index.js +34 -661
  81. package/dist/classes/services/AuthenticationService/index.js.map +1 -1
  82. package/dist/classes/services/AuthorizationService/AuthorizationService.d.ts +4 -4
  83. package/dist/classes/services/AuthorizationService/index.js +12 -10
  84. package/dist/classes/services/AuthorizationService/index.js.map +1 -1
  85. package/dist/classes/services/BackendVersionService/BackendVersionService.d.ts +0 -3
  86. package/dist/classes/services/BackendVersionService/index.js +5 -8
  87. package/dist/classes/services/BackendVersionService/index.js.map +1 -1
  88. package/dist/classes/services/BreadcrumbService/BreadcrumbService.d.ts +1 -3
  89. package/dist/classes/services/BreadcrumbService/index.js +19 -21
  90. package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
  91. package/dist/classes/services/EmotionCacheService/EmotionCacheService.d.ts +4 -4
  92. package/dist/classes/services/EmotionCacheService/index.js +17 -14
  93. package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
  94. package/dist/classes/services/FeatureFlagsService/FeatureFlagsService.d.ts +0 -3
  95. package/dist/classes/services/FeatureFlagsService/index.js +5 -8
  96. package/dist/classes/services/FeatureFlagsService/index.js.map +1 -1
  97. package/dist/classes/services/I18nService/I18nService.d.ts +3 -3
  98. package/dist/classes/services/I18nService/index.js +25 -29
  99. package/dist/classes/services/I18nService/index.js.map +1 -1
  100. package/dist/classes/services/InactivityService/InactivityService.d.ts +6 -3
  101. package/dist/classes/services/InactivityService/index.js +42 -36
  102. package/dist/classes/services/InactivityService/index.js.map +1 -1
  103. package/dist/classes/services/LogService/LogService.d.ts +7 -4
  104. package/dist/classes/services/LogService/index.js +39 -32
  105. package/dist/classes/services/LogService/index.js.map +1 -1
  106. package/dist/classes/services/NavigationHistoryService/NavigationHistoryService.d.ts +0 -3
  107. package/dist/classes/services/NavigationHistoryService/index.js +5 -8
  108. package/dist/classes/services/NavigationHistoryService/index.js.map +1 -1
  109. package/dist/classes/services/NotificationService/NotificationService.d.ts +4 -4
  110. package/dist/classes/services/NotificationService/index.js +21 -21
  111. package/dist/classes/services/NotificationService/index.js.map +1 -1
  112. package/dist/classes/services/PageEventBusService/PageEventBusService.d.ts +4 -3
  113. package/dist/classes/services/PageEventBusService/index.js +18 -15
  114. package/dist/classes/services/PageEventBusService/index.js.map +1 -1
  115. package/dist/classes/services/QueryClientService/QueryClientService.d.ts +6 -7
  116. package/dist/classes/services/QueryClientService/index.js +1 -2
  117. package/dist/classes/services/RouterService/RouterService.d.ts +6 -9
  118. package/dist/classes/services/RouterService/index.js +8 -12
  119. package/dist/classes/services/RouterService/index.js.map +1 -1
  120. package/dist/classes/services/UserSettingsService/UserSettingsService.d.ts +0 -3
  121. package/dist/classes/services/UserSettingsService/index.js +5 -8
  122. package/dist/classes/services/UserSettingsService/index.js.map +1 -1
  123. package/dist/components/app/App/App.d.ts +5 -1
  124. package/dist/components/app/App/index.js +31 -37
  125. package/dist/components/app/App/index.js.map +1 -1
  126. package/dist/components/app/AppRouterProvider/AppRouterProvider.d.ts +1 -1
  127. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +50 -49
  128. package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
  129. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +42 -41
  130. package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
  131. package/dist/components/app/AuthenticationWrapper/AuthenticationWrapper.d.ts +1 -1
  132. package/dist/components/app/AuthenticationWrapper/index.js +68 -67
  133. package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
  134. package/dist/components/app/AuthorizationWrapper/index.js +33 -32
  135. package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
  136. package/dist/components/app/RouterRoot/RouterRoot.d.ts +1 -1
  137. package/dist/components/app/RouterRoot/index.js +62 -61
  138. package/dist/components/app/RouterRoot/index.js.map +1 -1
  139. package/dist/components/epi/EpiContactDetailsDialog/index.js +38 -37
  140. package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
  141. package/dist/components/filters/BooleanFilterField/BooleanFilterField.d.ts +1 -1
  142. package/dist/components/filters/BooleanFilterField/index.js +5 -5
  143. package/dist/components/filters/BooleanFilterField/index.js.map +1 -1
  144. package/dist/components/filters/DateFilterField/DateFilterField.d.ts +1 -1
  145. package/dist/components/filters/DateFilterField/index.js +3 -3
  146. package/dist/components/filters/DateFilterField/index.js.map +1 -1
  147. package/dist/components/filters/GeoFilterField/GeoFilterField.d.ts +1 -1
  148. package/dist/components/filters/GeoFilterField/index.js +4 -4
  149. package/dist/components/filters/GeoFilterField/index.js.map +1 -1
  150. package/dist/components/filters/MultiSelectFilterField/MultiSelectFilterField.d.ts +1 -1
  151. package/dist/components/filters/MultiSelectFilterField/index.js +4 -4
  152. package/dist/components/filters/MultiSelectFilterField/index.js.map +1 -1
  153. package/dist/components/filters/NumberRangeFilterField/NumberRangeFilterField.d.ts +1 -1
  154. package/dist/components/filters/NumberRangeFilterField/index.js +3 -3
  155. package/dist/components/filters/NumberRangeFilterField/index.js.map +1 -1
  156. package/dist/components/filters/TextFilterField/TextFilterField.d.ts +1 -1
  157. package/dist/components/filters/TextFilterField/index.js +3 -3
  158. package/dist/components/filters/TextFilterField/index.js.map +1 -1
  159. package/dist/components/ui/ApplicationBar/ApplicationBar.d.ts +1 -1
  160. package/dist/components/ui/ApplicationBar/ApplicationBarActions.d.ts +1 -1
  161. package/dist/components/ui/ApplicationBar/ApplicationBarActionsFeedbackItem.d.ts +1 -1
  162. package/dist/components/ui/ApplicationBar/ApplicationBarActionsInfotem.d.ts +1 -1
  163. package/dist/components/ui/ApplicationBar/ApplicationBarActionsNotificationsItem.d.ts +1 -1
  164. package/dist/components/ui/ApplicationBar/ApplicationBarActionsOrganizationSwitcherItem.d.ts +1 -1
  165. package/dist/components/ui/ApplicationBar/ApplicationBarActionsOutagesItem.d.ts +1 -1
  166. package/dist/components/ui/ApplicationBar/ApplicationBarActionsUserItem.d.ts +1 -1
  167. package/dist/components/ui/ApplicationBar/ApplicationBarNavigationMenu.d.ts +1 -1
  168. package/dist/components/ui/ApplicationBar/UserOrganizationAdminMenuItem.d.ts +1 -1
  169. package/dist/components/ui/ApplicationBar/UserOwnOrganizationMenuItem.d.ts +1 -1
  170. package/dist/components/ui/ApplicationBar/index.js +242 -241
  171. package/dist/components/ui/ApplicationBar/index.js.map +1 -1
  172. package/dist/components/ui/ApplicationFooter/ApplicationFooter.d.ts +1 -1
  173. package/dist/components/ui/ApplicationFooter/ApplicationFooterLink.d.ts +1 -1
  174. package/dist/components/ui/ApplicationFooter/ApplicationFooterLinkSection.d.ts +1 -1
  175. package/dist/components/ui/ApplicationFooter/index.js +1 -2
  176. package/dist/components/ui/Breadcrumbs/Breadcrumb.d.ts +1 -1
  177. package/dist/components/ui/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  178. package/dist/components/ui/Breadcrumbs/index.js +1 -2
  179. package/dist/components/ui/ConsentDialog/index.js +11 -6
  180. package/dist/components/ui/ConsentDialog/index.js.map +1 -1
  181. package/dist/components/ui/GenericErrorMessage/GenericErrorMessage.d.ts +1 -1
  182. package/dist/components/ui/GenericErrorMessage/index.js +51 -50
  183. package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
  184. package/dist/components/ui/LicensesDialog/index.js +66 -69
  185. package/dist/components/ui/LicensesDialog/index.js.map +1 -1
  186. package/dist/components/ui/MyPermissionsDialog/index.js +26 -25
  187. package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -1
  188. package/dist/components/ui/NavLink/NavLink.d.ts +1 -1
  189. package/dist/components/ui/NavLink/index.js +6 -6
  190. package/dist/components/ui/NavLink/index.js.map +1 -1
  191. package/dist/components/ui/Notifications/NotificationItem.d.ts +2 -2
  192. package/dist/components/ui/Notifications/NotificationsDrawer.d.ts +1 -1
  193. package/dist/components/ui/Notifications/index.js +1 -2
  194. package/dist/components/ui/OrganizationSwitcherDialog/index.js +69 -76
  195. package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
  196. package/dist/components/ui/OutageList/OutageItem.d.ts +1 -1
  197. package/dist/components/ui/OutageList/OutageList.d.ts +1 -1
  198. package/dist/components/ui/OutageList/OutageSection.d.ts +1 -1
  199. package/dist/components/ui/OutageList/index.js +1 -2
  200. package/dist/components/ui/OutagesDialog/index.js.map +1 -1
  201. package/dist/components/ui/PageContainer/PageContainer.d.ts +1 -1
  202. package/dist/components/ui/PageContainer/index.js +57 -52
  203. package/dist/components/ui/PageContainer/index.js.map +1 -1
  204. package/dist/components/ui/ResponseHandler/ResponseHandler.d.ts +1 -1
  205. package/dist/components/ui/ResponseHandler/index.js.map +1 -1
  206. package/dist/components/ui/Sidebar/SidebarItem.d.ts +2 -2
  207. package/dist/components/ui/Sidebar/SidebarMenu.d.ts +1 -1
  208. package/dist/components/ui/Sidebar/SidebarMenuItem.d.ts +2 -2
  209. package/dist/components/ui/Sidebar/index.js +45 -45
  210. package/dist/components/ui/Sidebar/index.js.map +1 -1
  211. package/dist/components/ui/SortableList/SortableList.d.ts +1 -1
  212. package/dist/components/ui/SortableList/SortableListItem.d.ts +1 -1
  213. package/dist/components/ui/SortableList/SortableListItemDragHandle.d.ts +1 -1
  214. package/dist/components/ui/SortableList/SortableOverlay.d.ts +1 -1
  215. package/dist/components/ui/SortableList/context/SortableListItemContextProvider.d.ts +1 -1
  216. package/dist/components/ui/Table/Table.d.ts +2 -2
  217. package/dist/components/ui/Table/TableActionsCell.d.ts +2 -2
  218. package/dist/components/ui/Table/TableCaption.d.ts +1 -1
  219. package/dist/components/ui/Table/TableCell.d.ts +2 -2
  220. package/dist/components/ui/Table/TableCellAsyncContent.d.ts +1 -1
  221. package/dist/components/ui/Table/TableCheckboxCell.d.ts +2 -2
  222. package/dist/components/ui/Table/TableCheckboxHeader.d.ts +2 -2
  223. package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +1 -1
  224. package/dist/components/ui/Table/TableFilter.d.ts +3 -3
  225. package/dist/components/ui/Table/TableFiltersSidebarItem.d.ts +2 -2
  226. package/dist/components/ui/Table/TableHeader.d.ts +1 -1
  227. package/dist/components/ui/Table/TableHeaderCell.d.ts +2 -2
  228. package/dist/components/ui/Table/TableHeaderFilter.d.ts +3 -3
  229. package/dist/components/ui/Table/TableMenu.d.ts +1 -1
  230. package/dist/components/ui/Table/TableReadableIndexCell.d.ts +2 -2
  231. package/dist/components/ui/Table/TableSidebarMenu.d.ts +1 -1
  232. package/dist/components/ui/Table/index.js +1 -2
  233. package/dist/components/ui/UserFeedbackDialog/index.js +65 -64
  234. package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -1
  235. package/dist/components/ui/UserInactivityConfirmation/UserInactivityConfirmation.d.ts +1 -1
  236. package/dist/components/ui/UserInactivityConfirmation/index.js +26 -25
  237. package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -1
  238. package/dist/constants/config.constants.d.ts +5 -0
  239. package/dist/constants/config.constants.js +6 -0
  240. package/dist/constants/config.constants.js.map +1 -0
  241. package/dist/constants/{query.js → query.constants.js} +2 -2
  242. package/dist/constants/query.constants.js.map +1 -0
  243. package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContext.d.ts +6 -2
  244. package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +3 -3
  245. package/dist/context/uiClientCommonConfigContext/index.js +28 -12
  246. package/dist/context/uiClientCommonConfigContext/index.js.map +1 -1
  247. package/dist/context/uiClientCommonConfigContext/useUiClientCommonConfigContext.d.ts +2 -1
  248. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +17 -16
  249. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
  250. package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/useIdentifierIssuerOwnOrganizationQuery.d.ts +1 -1
  251. package/dist/dataHooks/useIdentifierIssuerQuery/index.js +18 -17
  252. package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
  253. package/dist/dataHooks/useIdentifierIssuerQuery/useIdentifierIssuerQuery.d.ts +1 -1
  254. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +11 -10
  255. package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
  256. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +22 -21
  257. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
  258. package/dist/dataHooks/useOrganizationAdminPoliciesQuery/useOrganizationAdminPoliciesQuery.d.ts +1 -1
  259. package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +8 -7
  260. package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js.map +1 -1
  261. package/dist/dataHooks/useOrganizationsQuery/index.js +17 -16
  262. package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
  263. package/dist/dataHooks/useOrganizationsQuery/useOrganizationsQuery.d.ts +1 -1
  264. package/dist/dataHooks/useUsersQuery/index.js +18 -17
  265. package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
  266. package/dist/dataHooks/useUsersQuery/useUsersQuery.d.ts +1 -1
  267. package/dist/hoc/withPermissions/index.js +12 -11
  268. package/dist/hoc/withPermissions/index.js.map +1 -1
  269. package/dist/hoc/withPermissions/withPermissions.d.ts +1 -1
  270. package/dist/hooks/useColumnsMenu/index.js +1 -2
  271. package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +2 -2
  272. package/dist/hooks/useConfig/index.d.ts +1 -0
  273. package/dist/hooks/useConfig/index.js +7 -0
  274. package/dist/hooks/useConfig/index.js.map +1 -0
  275. package/dist/hooks/useConfig/useConfig.d.ts +2 -0
  276. package/dist/hooks/useCreateMutation/index.js +25 -24
  277. package/dist/hooks/useCreateMutation/index.js.map +1 -1
  278. package/dist/hooks/useCreateMutation/useCreateMutation.d.ts +1 -1
  279. package/dist/hooks/useDeleteMutation/index.js +24 -23
  280. package/dist/hooks/useDeleteMutation/index.js.map +1 -1
  281. package/dist/hooks/useDeleteMutation/useDeleteMutation.d.ts +1 -1
  282. package/dist/hooks/useEditMutation/index.js +33 -32
  283. package/dist/hooks/useEditMutation/index.js.map +1 -1
  284. package/dist/hooks/useEditMutation/useEditMutation.d.ts +1 -1
  285. package/dist/hooks/useInitializeTableStore/index.js.map +1 -1
  286. package/dist/hooks/useInitializeTableStore/useInitializeTableStore.d.ts +1 -1
  287. package/dist/hooks/useItemQuery/index.js +36 -35
  288. package/dist/hooks/useItemQuery/index.js.map +1 -1
  289. package/dist/hooks/useItemQuery/useItemQuery.d.ts +1 -1
  290. package/dist/hooks/useQueryMemo/index.js +1 -2
  291. package/dist/hooks/useUpdateBreadcrumb/index.js +10 -9
  292. package/dist/hooks/useUpdateBreadcrumb/index.js.map +1 -1
  293. package/dist/hooks/useUpdateDocumentTitle/index.js +4 -3
  294. package/dist/hooks/useUpdateDocumentTitle/index.js.map +1 -1
  295. package/dist/models/{admin.js → admin.models.js} +2 -2
  296. package/dist/models/admin.models.js.map +1 -0
  297. package/dist/models/api.models.d.ts +16 -0
  298. package/dist/models/api.models.js +6 -0
  299. package/dist/models/api.models.js.map +1 -0
  300. package/dist/models/{dataHooks.d.ts → data-hooks.models.d.ts} +1 -1
  301. package/dist/models/{table.d.ts → table.models.d.ts} +2 -2
  302. package/dist/models/{table.js → table.models.js} +2 -2
  303. package/dist/models/table.models.js.map +1 -0
  304. package/dist/pages/AcceptInvitationPage/AcceptInvitationPage.d.ts +1 -1
  305. package/dist/pages/AcceptInvitationPage/index.js +40 -39
  306. package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
  307. package/dist/pages/AdminPage/AdminPage.d.ts +1 -1
  308. package/dist/pages/AdminPage/index.js +39 -38
  309. package/dist/pages/AdminPage/index.js.map +1 -1
  310. package/dist/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.d.ts +2 -2
  311. package/dist/pages/ChooseIdentityProviderPage/index.js +38 -37
  312. package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -1
  313. package/dist/pages/CrudPage/CrudPage.d.ts +7 -7
  314. package/dist/pages/CrudPage/CrudPageDeleteDialog.d.ts +1 -1
  315. package/dist/pages/CrudPage/CrudPageEditDialog.d.ts +2 -2
  316. package/dist/pages/CrudPage/index.js +1 -2
  317. package/dist/pages/ErrorPage/ErrorPage.d.ts +1 -1
  318. package/dist/pages/ErrorPage/index.js.map +1 -1
  319. package/dist/pages/IdentifierIssuersAdminPage/IdentifierIssuersAdminPage.d.ts +1 -1
  320. package/dist/pages/IdentifierIssuersAdminPage/index.js +41 -40
  321. package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
  322. package/dist/pages/OrganizationAdminPoliciesAdminPage/OrganizationAdminPoliciesAdminPage.d.ts +1 -1
  323. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +58 -57
  324. package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
  325. package/dist/pages/OrganizationContactsAdminPage/OrganizationContactsAdminPage.d.ts +1 -1
  326. package/dist/pages/OrganizationContactsAdminPage/index.js +49 -48
  327. package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
  328. package/dist/pages/OrganizationSitesAdminPage/OrganizationSitesAdminPage.d.ts +1 -1
  329. package/dist/pages/OrganizationSitesAdminPage/index.js +44 -43
  330. package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
  331. package/dist/pages/OrganizationsAdminPage/OrganizationsAdminPage.d.ts +1 -1
  332. package/dist/pages/OrganizationsAdminPage/index.js +57 -56
  333. package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
  334. package/dist/pages/OutagesAdminPage/OutagesAdminPage.d.ts +1 -1
  335. package/dist/pages/OutagesAdminPage/index.js +63 -62
  336. package/dist/pages/OutagesAdminPage/index.js.map +1 -1
  337. package/dist/pages/PostLoginPage/PostLoginPage.d.ts +1 -1
  338. package/dist/pages/PostLoginPage/index.js +14 -13
  339. package/dist/pages/PostLoginPage/index.js.map +1 -1
  340. package/dist/pages/PostLogoutPage/PostLogoutPage.d.ts +1 -1
  341. package/dist/pages/PostLogoutPage/index.js +19 -18
  342. package/dist/pages/PostLogoutPage/index.js.map +1 -1
  343. package/dist/pages/RouterErrorPage/RouterErrorPage.d.ts +1 -1
  344. package/dist/pages/RouterErrorPage/index.js.map +1 -1
  345. package/dist/pages/UserInvitationsAdminPage/UserInvitationsAdminPage.d.ts +1 -1
  346. package/dist/pages/UserInvitationsAdminPage/index.js +1 -2
  347. package/dist/pages/UsersAdminPage/UsersAdminPage.d.ts +2 -2
  348. package/dist/pages/UsersAdminPage/index.js +110 -109
  349. package/dist/pages/UsersAdminPage/index.js.map +1 -1
  350. package/dist/routes/adminRoutes.d.ts +1 -1
  351. package/dist/routes/index.js +1 -1
  352. package/dist/routes/index.js.map +1 -1
  353. package/dist/routes/routes.d.ts +1 -1
  354. package/dist/setup/setup.js.map +1 -1
  355. package/dist/stores/oidcStore/index.js.map +1 -1
  356. package/dist/stores/outagesStore/index.js.map +1 -1
  357. package/dist/stores/outagesStore/outagesStore.d.ts +1 -1
  358. package/dist/stores/tableStore/TableStoreContextProvider.d.ts +1 -1
  359. package/dist/stores/tableStore/index.js +1 -2
  360. package/dist/stores/tableStore/tableStore.d.ts +2 -2
  361. package/dist/theme/demoTheme/index.js.map +1 -1
  362. package/dist/utils/AxiosUtil/index.js.map +1 -1
  363. package/dist/utils/DataHookUtil/DataHookUtil.d.ts +1 -1
  364. package/dist/utils/DataHookUtil/index.js.map +1 -1
  365. package/dist/utils/LoadableUtil/LoadableUtil.d.ts +1 -1
  366. package/dist/utils/LoadableUtil/index.js.map +1 -1
  367. package/dist/utils/MenuDataUtil/MenuDataUtil.d.ts +1 -1
  368. package/dist/utils/MenuDataUtil/index.js.map +1 -1
  369. package/dist/utils/NotificationUtil/index.js.map +1 -1
  370. package/dist/utils/OutageUtil/OutageUtil.d.ts +1 -1
  371. package/dist/utils/OutageUtil/index.js +1 -2
  372. package/dist/utils/StandardConfigUtil/StandardConfigUtil.d.ts +1 -1
  373. package/dist/utils/StandardConfigUtil/index.js.map +1 -1
  374. package/dist/utils/TableUtil/TableUtil.d.ts +4 -4
  375. package/dist/utils/TableUtil/index.js +1 -2
  376. package/dist/utils/TimeUtil/index.js.map +1 -1
  377. package/dist/utils/UserManagerUtil/index.js +1 -2
  378. package/dist/utils/UserUtil/index.js.map +1 -1
  379. package/package.json +93 -87
  380. package/dist/_chunks/_baseGet.js +0 -280
  381. package/dist/_chunks/_baseGet.js.map +0 -1
  382. package/dist/_chunks/_baseIteratee.js +0 -274
  383. package/dist/_chunks/_baseIteratee.js.map +0 -1
  384. package/dist/_chunks/last.js +0 -13
  385. package/dist/_chunks/last.js.map +0 -1
  386. package/dist/_chunks/uniq.js +0 -44
  387. package/dist/_chunks/uniq.js.map +0 -1
  388. package/dist/classes/services/ApiService/ApiService.d.ts +0 -19
  389. package/dist/classes/services/ApiService/index.d.ts +0 -1
  390. package/dist/classes/services/ApiService/index.js +0 -21
  391. package/dist/classes/services/ApiService/index.js.map +0 -1
  392. package/dist/classes/services/ConfigService/ConfigService.d.ts +0 -9
  393. package/dist/classes/services/ConfigService/index.d.ts +0 -1
  394. package/dist/classes/services/ConfigService/index.js +0 -21
  395. package/dist/classes/services/ConfigService/index.js.map +0 -1
  396. package/dist/constants/query.js.map +0 -1
  397. package/dist/models/admin.js.map +0 -1
  398. package/dist/models/api.d.ts +0 -9
  399. package/dist/models/table.js.map +0 -1
  400. package/dist/models/theme.js +0 -0
  401. /package/dist/constants/{query.d.ts → query.constants.d.ts} +0 -0
  402. /package/dist/models/{admin.d.ts → admin.models.d.ts} +0 -0
  403. /package/dist/models/{auth.d.ts → auth.models.d.ts} +0 -0
  404. /package/dist/models/{api.js → auth.models.js} +0 -0
  405. /package/dist/models/{config.d.ts → config.models.d.ts} +0 -0
  406. /package/dist/models/{auth.js → config.models.js} +0 -0
  407. /package/dist/models/{config.js → data-hooks.models.js} +0 -0
  408. /package/dist/models/{data.d.ts → data.models.d.ts} +0 -0
  409. /package/dist/models/{data.js → data.models.js} +0 -0
  410. /package/dist/models/{filter.d.ts → filter.models.d.ts} +0 -0
  411. /package/dist/models/{dataHooks.js → filter.models.js} +0 -0
  412. /package/dist/models/{notification.d.ts → notification.models.d.ts} +0 -0
  413. /package/dist/models/{filter.js → notification.models.js} +0 -0
  414. /package/dist/models/{outage.d.ts → outage.models.d.ts} +0 -0
  415. /package/dist/models/{notification.js → outage.models.js} +0 -0
  416. /package/dist/models/{reactRouter.d.ts → react-router.models.d.ts} +0 -0
  417. /package/dist/models/{outage.js → react-router.models.js} +0 -0
  418. /package/dist/models/{theme.d.ts → theme.models.d.ts} +0 -0
  419. /package/dist/models/{reactRouter.js → theme.models.js} +0 -0
@@ -1,137 +1,138 @@
1
1
  import { t as e } from "../../_chunks/TableUtil.js";
2
- import { AuthorizationService as t } from "../../classes/services/AuthorizationService/index.js";
3
- import { ApiService as n } from "../../classes/services/ApiService/index.js";
4
- import { t as r } from "../../_chunks/QueryClientService.js";
2
+ import { t } from "../../_chunks/QueryClientService.js";
3
+ import { API_ORGANIZATION_TOKEN as n } from "../../models/api.models.js";
4
+ import { AuthorizationService as r } from "../../classes/services/AuthorizationService/index.js";
5
5
  import { NotificationService as i } from "../../classes/services/NotificationService/index.js";
6
6
  import { t as a } from "../../_chunks/CrudPage.js";
7
- import { COMMON_QUERY_KEY as o } from "../../constants/query.js";
7
+ import { COMMON_QUERY_KEY as o } from "../../constants/query.constants.js";
8
8
  import { useOrganizationOptionsQuery as s } from "../../dataHooks/useOrganizationsQuery/index.js";
9
9
  import { useInviteUserConstraintsQuery as c } from "../../dataHooks/useInviteUserConstraintsQuery/index.js";
10
10
  import { CommonDbCommandName as l, CommonDbPermissionType as u } from "@gen-epix/api-commondb";
11
- import { ListItemIcon as d, ListItemText as f, MenuItem as p } from "@mui/material";
12
- import { useCallback as m, useMemo as h, useRef as g, useState as _ } from "react";
13
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
14
- import { useTranslation as x } from "react-i18next";
15
- import { array as S, boolean as C, object as w, string as T } from "yup";
16
- import { TestIdUtil as E } from "@gen-epix/ui-core/utils/TestIdUtil";
17
- import { FORM_FIELD_DEFINITION_TYPE as D } from "@gen-epix/ui-core-form/models/form";
18
- import { SchemaUtil as O } from "@gen-epix/ui-core-form/utils/SchemaUtil";
19
- import { useArray as k } from "@gen-epix/ui-core/hooks/useArray";
20
- import A from "@mui/icons-material/PersonOff";
21
- import { Confirmation as j } from "@gen-epix/ui-core-components/components/Confirmation";
11
+ import { container as d } from "tsyringe";
12
+ import { useCallback as f, useMemo as p, useRef as m, useState as h } from "react";
13
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
14
+ import { ListItemIcon as y, ListItemText as b, MenuItem as x } from "@mui/material";
15
+ import { useTranslation as S } from "react-i18next";
16
+ import { array as C, boolean as w, object as T, string as E } from "yup";
17
+ import { TestIdUtil as D } from "@gen-epix/ui-core/utils/TestIdUtil";
18
+ import { FORM_FIELD_DEFINITION_TYPE as O } from "@gen-epix/ui-core-form/models/form.models";
19
+ import { SchemaUtil as k } from "@gen-epix/ui-core-form/utils/SchemaUtil";
20
+ import { useArray as A } from "@gen-epix/ui-core/hooks/useArray";
21
+ import j from "@mui/icons-material/PersonOff";
22
+ import { Confirmation as M } from "@gen-epix/ui-core-components/components/Confirmation";
22
23
  //#region src/pages/UsersAdminPage/UsersAdminPage.tsx
23
- var M = ({ subPages: M }) => {
24
- let { t: N } = x(), P = g(null), F = s(), I = c(), [L, R] = _([]), [z, B] = _([]), V = g(null), H = k([F, I]), U = t.getInstance().user.roles, W = m((e) => {
25
- let n = /* @__PURE__ */ new Set();
24
+ var N = ({ subPages: N }) => {
25
+ let { t: P } = S(), F = m(null), I = s(), L = c(), [R, z] = h([]), [B, V] = h([]), H = m(null), U = A([I, L]), W = d.resolve(r).user.roles, G = f((e) => {
26
+ let t = /* @__PURE__ */ new Set();
26
27
  e.forEach((e) => {
27
- e.roles.forEach((e) => n.add(e));
28
+ e.roles.forEach((e) => t.add(e));
28
29
  });
29
- let r = Array.from(n).map((e) => ({
30
+ let n = Array.from(t).map((e) => ({
30
31
  label: e,
31
32
  value: e
32
33
  }));
33
- R(r);
34
+ z(n);
34
35
  let i;
35
- i = t.getInstance().doesUserHavePermission([{
36
+ i = d.resolve(r).doesUserHavePermission([{
36
37
  command_name: l.RetrieveInviteUserConstraintsCommand,
37
38
  permission_type: u.EXECUTE
38
- }]) && I?.data ? I.data.roles.map((e) => ({
39
+ }]) && L?.data ? L.data.roles.map((e) => ({
39
40
  label: e,
40
41
  value: e
41
- })) : r;
42
- let a = U.filter((e) => !i.some((t) => t.value === e));
42
+ })) : n;
43
+ let a = W.filter((e) => !i.some((t) => t.value === e));
43
44
  i.push(...a.map((e) => ({
44
45
  disabled: !0,
45
46
  label: e,
46
47
  value: e
47
- }))), B(i);
48
- }, [I.data, U]), G = m(async (e) => (await n.getInstance().organizationApi.usersGetAll(null, null, { signal: e }))?.data, []), K = m(async (e, t) => (await n.getInstance().organizationApi.updateUser(t.id, {
48
+ }))), V(i);
49
+ }, [L.data, W]), K = f(async (e) => (await d.resolve(n).usersGetAll(null, null, { signal: e }))?.data, []), q = f(async (e, t) => (await d.resolve(n).updateUser(t.id, {
49
50
  is_active: e.is_active,
50
51
  organization_id: t.organization_id,
51
52
  roles: e.roles
52
- })).data, []), q = m(async (e) => await n.getInstance().organizationApi.usersDeleteOne(e.id), []), J = m((e) => e.email, []), Y = m((e) => t.getInstance().user.email !== e.email, []), X = h(() => w().shape({
53
- description: O.description,
54
- email: T().email().nullable(),
55
- is_active: C().required(),
56
- key: T().optional(),
57
- name: T().nullable(),
58
- roles: S().required().min(1)
59
- }), []), Z = h(() => [
53
+ })).data, []), J = f(async (e) => await d.resolve(n).usersDeleteOne(e.id), []), Y = f((e) => e.email, []), X = f((e) => d.resolve(r).user.email !== e.email, []), Z = p(() => T().shape({
54
+ description: k.description,
55
+ email: E().email().nullable(),
56
+ is_active: w().required(),
57
+ key: E().optional(),
58
+ name: E().nullable(),
59
+ roles: C().required().min(1)
60
+ }), []), Q = p(() => [
60
61
  {
61
- definition: D.TEXTFIELD,
62
+ definition: O.TEXTFIELD,
62
63
  disabled: !0,
63
- label: N`Key`,
64
+ label: P`Key`,
64
65
  name: "key"
65
66
  },
66
67
  {
67
- definition: D.TEXTFIELD,
68
- label: N`Email`,
68
+ definition: O.TEXTFIELD,
69
+ label: P`Email`,
69
70
  name: "email"
70
71
  },
71
72
  {
72
- definition: D.TEXTFIELD,
73
- label: N`Name`,
73
+ definition: O.TEXTFIELD,
74
+ label: P`Name`,
74
75
  name: "name"
75
76
  },
76
77
  {
77
- definition: D.AUTOCOMPLETE,
78
- label: N`Roles`,
79
- loading: I.isLoading,
78
+ definition: O.AUTOCOMPLETE,
79
+ label: P`Roles`,
80
+ loading: L.isLoading,
80
81
  multiple: !0,
81
82
  name: "roles",
82
- options: z
83
+ options: B
83
84
  },
84
85
  {
85
- definition: D.BOOLEAN,
86
- label: N`Is active`,
86
+ definition: O.BOOLEAN,
87
+ label: P`Is active`,
87
88
  name: "is_active"
88
89
  },
89
90
  {
90
- definition: D.TEXTFIELD,
91
- label: N`Description`,
91
+ definition: O.TEXTFIELD,
92
+ label: P`Description`,
92
93
  name: "description"
93
94
  }
94
95
  ], [
95
- N,
96
- z,
97
- I.isLoading
98
- ]), Q = h(() => [
96
+ P,
97
+ B,
98
+ L.isLoading
99
+ ]), $ = p(() => [
99
100
  e.createOptionsColumn({
100
101
  id: "organization_id",
101
- name: N`Organization`,
102
- options: F.options
102
+ name: P`Organization`,
103
+ options: I.options
103
104
  }),
104
105
  e.createTextColumn({
105
106
  id: "key",
106
- name: N`Key`
107
+ name: P`Key`
107
108
  }),
108
109
  e.createTextColumn({
109
110
  id: "email",
110
- name: N`E-Mail`
111
+ name: P`E-Mail`
111
112
  }),
112
113
  e.createTextColumn({
113
114
  advancedSort: !0,
114
115
  id: "name",
115
- name: N`Name`
116
+ name: P`Name`
116
117
  }),
117
118
  e.createTextColumn({
118
119
  id: "description",
119
- name: N`Description`
120
+ name: P`Description`
120
121
  }),
121
122
  e.createOptionsColumn({
122
123
  id: "roles",
123
- name: N`Roles`,
124
- options: L
124
+ name: P`Roles`,
125
+ options: R
125
126
  }),
126
127
  e.createBooleanColumn({
127
128
  id: "is_active",
128
- name: N`Is active`
129
+ name: P`Is active`
129
130
  })
130
131
  ], [
131
- F.options,
132
- L,
133
- N
134
- ]), $ = m((e, t) => ({
132
+ I.options,
133
+ R,
134
+ P
135
+ ]), ee = f((e, t) => ({
135
136
  email: t.email,
136
137
  id: t.id,
137
138
  is_active: t.is_active,
@@ -139,68 +140,68 @@ var M = ({ subPages: M }) => {
139
140
  name: t.name,
140
141
  organization_id: t.organization_id,
141
142
  ...e
142
- }), []), ee = h(() => [{
143
+ }), []), te = p(() => [{
143
144
  command_name: l.UpdateUserCommand,
144
145
  permission_type: u.EXECUTE
145
- }], []), te = h(() => [{
146
+ }], []), ne = p(() => [{
146
147
  command_name: l.UserCrudCommand,
147
148
  permission_type: u.DELETE
148
- }], []), ne = m(async () => {
149
- let e = V.current?.email ?? V.current?.key, t = i.getInstance().showNotification({
149
+ }], []), re = f(async () => {
150
+ let e = H.current?.email ?? H.current?.key, r = d.resolve(i).showNotification({
150
151
  isLoading: !0,
151
- message: N("Anonymizing user: {{userName}}", { userName: e }),
152
+ message: P("Anonymizing user: {{userName}}", { userName: e }),
152
153
  severity: "info"
153
154
  });
154
155
  try {
155
- await n.getInstance().organizationApi.anonymizeUser(V.current.id), await r.getInstance().invalidateQueryKeys(r.getInstance().getQueryKeyDependencies([o.USERS], !0)), i.getInstance().fulfillNotification(t, N("User anonymized successfully: {{userName}}", { userName: e }), "success");
156
+ await d.resolve(n).anonymizeUser(H.current.id), await d.resolve(t).invalidateQueryKeys(d.resolve(t).getQueryKeyDependencies([o.USERS], !0)), d.resolve(i).fulfillNotification(r, P("User anonymized successfully: {{userName}}", { userName: e }), "success");
156
157
  } catch {
157
- i.getInstance().fulfillNotification(t, N("Error anonymizing user: {{userName}}", { userName: e }), "error");
158
+ d.resolve(i).fulfillNotification(r, P("Error anonymizing user: {{userName}}", { userName: e }), "error");
158
159
  }
159
- }, [N]), re = m((e) => {
160
- let n = [];
161
- return t.getInstance().doesUserHavePermission([{
160
+ }, [P]), ie = f((e) => {
161
+ let t = [];
162
+ return d.resolve(r).doesUserHavePermission([{
162
163
  command_name: l.AnonymizeUserCommand,
163
164
  permission_type: u.EXECUTE
164
- }]) && n.push(/* @__PURE__ */ b(p, {
165
+ }]) && t.push(/* @__PURE__ */ v(x, {
165
166
  onClick: () => {
166
- V.current = e.row, P.current.open();
167
+ H.current = e.row, F.current.open();
167
168
  },
168
- children: [/* @__PURE__ */ y(d, { children: /* @__PURE__ */ y(A, { fontSize: "small" }) }), /* @__PURE__ */ y(f, { children: N`Anonymize user` })]
169
- }, "custom-action-1")), n;
170
- }, [N]);
171
- return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(a, {
172
- canEditItem: Y,
173
- createItemDialogTitle: N`Create new user`,
169
+ children: [/* @__PURE__ */ _(y, { children: /* @__PURE__ */ _(j, { fontSize: "small" }) }), /* @__PURE__ */ _(b, { children: P`Anonymize user` })]
170
+ }, "custom-action-1")), t;
171
+ }, [P]);
172
+ return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(a, {
173
+ canEditItem: X,
174
+ createItemDialogTitle: P`Create new user`,
174
175
  defaultSortByField: "name",
175
176
  defaultSortDirection: "asc",
176
- deleteOne: q,
177
- extraActionsFactory: re,
178
- extraDeleteOnePermissions: te,
179
- extraUpdateOnePermissions: ee,
180
- fetchAll: G,
181
- formFieldDefinitions: Z,
182
- getName: J,
183
- getOptimisticUpdateIntermediateItem: $,
184
- itemName: N`User`,
185
- loadables: H,
186
- onRowsChange: W,
177
+ deleteOne: J,
178
+ extraActionsFactory: ie,
179
+ extraDeleteOnePermissions: ne,
180
+ extraUpdateOnePermissions: te,
181
+ fetchAll: K,
182
+ formFieldDefinitions: Q,
183
+ getName: Y,
184
+ getOptimisticUpdateIntermediateItem: ee,
185
+ itemName: P`User`,
186
+ loadables: U,
187
+ onRowsChange: G,
187
188
  resourceQueryKeyBase: o.USERS,
188
- schema: X,
189
- subPages: M,
190
- tableColumns: Q,
191
- testIdAttributes: E.createAttributes("UsersAdminPage"),
192
- title: N`Users`,
193
- updateOne: K
194
- }), /* @__PURE__ */ y(j, {
195
- body: N`Click the anonymize button to anonymize the user`,
196
- cancelLabel: N`Cancel`,
197
- confirmLabel: N`Anonymize`,
198
- onConfirm: ne,
199
- ref: P,
200
- title: N`Are you sure you want to anonymize this user?`
189
+ schema: Z,
190
+ subPages: N,
191
+ tableColumns: $,
192
+ testIdAttributes: D.createAttributes("UsersAdminPage"),
193
+ title: P`Users`,
194
+ updateOne: q
195
+ }), /* @__PURE__ */ _(M, {
196
+ body: P`Click the anonymize button to anonymize the user`,
197
+ cancelLabel: P`Cancel`,
198
+ confirmLabel: P`Anonymize`,
199
+ onConfirm: re,
200
+ ref: F,
201
+ title: P`Are you sure you want to anonymize this user?`
201
202
  })] });
202
203
  };
203
204
  //#endregion
204
- export { M as UsersAdminPage };
205
+ export { N as UsersAdminPage };
205
206
 
206
207
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/pages/UsersAdminPage/UsersAdminPage.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport {\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n array,\n boolean,\n object,\n string,\n} from 'yup';\nimport type {\n CommonDbApiPermission,\n CommonDbUser,\n} from '@gen-epix/api-commondb';\nimport {\n CommonDbCommandName,\n CommonDbPermissionType,\n} from '@gen-epix/api-commondb';\nimport {\n ListItemIcon,\n ListItemText,\n MenuItem,\n} from '@mui/material';\nimport PersonOffIcon from '@mui/icons-material/PersonOff';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport type {\n FormFieldDefinition,\n OptionBase,\n} from '@gen-epix/ui-core-form/models/form';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form';\nimport { SchemaUtil } from '@gen-epix/ui-core-form/utils/SchemaUtil';\nimport type { ConfirmationRefMethods } from '@gen-epix/ui-core-components/components/Confirmation';\nimport { Confirmation } from '@gen-epix/ui-core-components/components/Confirmation';\n\nimport { useOrganizationOptionsQuery } from '../../dataHooks/useOrganizationsQuery';\nimport type {\n TableColumn,\n TableRowParams,\n} from '../../models/table';\nimport { TableUtil } from '../../utils/TableUtil';\nimport type { CrudPageProps } from '../CrudPage';\nimport { CrudPage } from '../CrudPage';\nimport { AuthorizationService } from '../../classes/services/AuthorizationService';\nimport { useInviteUserConstraintsQuery } from '../../dataHooks/useInviteUserConstraintsQuery';\nimport type { OmitWithMetaData } from '../../models/data';\nimport { COMMON_QUERY_KEY } from '../../constants/query';\nimport { ApiService } from '../../classes/services/ApiService';\nimport { NotificationService } from '../../classes/services/NotificationService';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\n\nexport type UsersAdminPageProps = {\n subPages?: CrudPageProps<OmitWithMetaData<CommonDbUser, 'organization_id' | 'organization'>, CommonDbUser>['subPages'];\n};\n\ntype FormFields = OmitWithMetaData<CommonDbUser, 'organization_id' | 'organization'>;\n\nexport const UsersAdminPage = ({\n subPages,\n}: UsersAdminPageProps) => {\n const { t } = useTranslation();\n const anonymizeUserConfirmationRef = useRef<ConfirmationRefMethods>(null);\n const organizationOptionsQuery = useOrganizationOptionsQuery();\n const inviteUserConstraintsQuery = useInviteUserConstraintsQuery();\n const [tableRoleOptions, setTableRoleOptions] = useState<OptionBase<string>[]>([]);\n const [formRoleOptions, setFormRoleOptions] = useState<OptionBase<string>[]>([]);\n const selectedUserRef = useRef<CommonDbUser | null>(null);\n\n const loadables = useArray([\n organizationOptionsQuery,\n inviteUserConstraintsQuery,\n ]);\n\n const userRoles = AuthorizationService.getInstance().user.roles;\n\n const onRowsChange = useCallback((items: CommonDbUser[]) => {\n // Because roles are a string array (instead of an enum or similar), we need to dynamically determine the options for the roles column in the table and in the form.\n // The options for the form are determined by the invite user constraints endpoint, but if the user doesn't have access to that endpoint, we fall back to using the roles that are currently in use by users in the system.\n const roles = new Set<string>();\n items.forEach((user) => {\n user.roles.forEach((role) => roles.add(role));\n });\n const _tableRoleOptions = Array.from(roles).map((role) => ({\n label: role,\n value: role,\n }));\n setTableRoleOptions(_tableRoleOptions);\n let _formRoleOptions: OptionBase<string>[];\n if (AuthorizationService.getInstance().doesUserHavePermission([\n { command_name: CommonDbCommandName.RetrieveInviteUserConstraintsCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ])) {\n _formRoleOptions = inviteUserConstraintsQuery?.data ? inviteUserConstraintsQuery.data.roles.map(role => ({\n label: role,\n value: role,\n })) : _tableRoleOptions;\n } else {\n _formRoleOptions = _tableRoleOptions;\n }\n // The users own roles may not be included in the options from the invite user constraints endpoint (if they don't have permission to view that endpoint),\n // so we need to add those to the options as well, but disable them since the user doesn't have permission to assign those roles to other users.\n const extraRolesFromUser = userRoles.filter(role => !_formRoleOptions.some(option => option.value === role));\n _formRoleOptions.push(...extraRolesFromUser.map(role => ({\n disabled: true,\n label: role,\n value: role,\n })));\n setFormRoleOptions(_formRoleOptions);\n }, [inviteUserConstraintsQuery.data, userRoles]);\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n const users = (await ApiService.getInstance().organizationApi.usersGetAll(null, null, { signal }))?.data;\n\n return users;\n }, []);\n\n const updateOne = useCallback(async (variables: FormFields, item: CommonDbUser) => {\n return (await ApiService.getInstance().organizationApi.updateUser(item.id, {\n is_active: variables.is_active,\n organization_id: item.organization_id,\n roles: variables.roles,\n })).data;\n }, []);\n\n const deleteOne = useCallback(async (item: CommonDbUser) => {\n return await ApiService.getInstance().organizationApi.usersDeleteOne(item.id);\n }, []);\n\n const getName = useCallback((item: FormFields) => {\n return item.email;\n }, []);\n\n const canEditItem = useCallback((item: CommonDbUser) => {\n return AuthorizationService.getInstance().user.email !== item.email;\n }, []);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n description: SchemaUtil.description,\n email: string().email().nullable(),\n is_active: boolean().required(),\n key: string().optional(),\n name: string().nullable(),\n roles: array().required().min(1),\n });\n }, []);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n disabled: true,\n label: t`Key`,\n name: 'key',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Email`,\n name: 'email',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Name`,\n name: 'name',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Roles`,\n loading: inviteUserConstraintsQuery.isLoading,\n multiple: true,\n name: 'roles',\n options: formRoleOptions,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Is active`,\n name: 'is_active',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Description`,\n name: 'description',\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [t, formRoleOptions, inviteUserConstraintsQuery.isLoading]);\n\n const tableColumns = useMemo((): TableColumn<CommonDbUser>[] => {\n return [\n TableUtil.createOptionsColumn<CommonDbUser>({ id: 'organization_id', name: t`Organization`, options: organizationOptionsQuery.options }),\n TableUtil.createTextColumn<CommonDbUser>({ id: 'key', name: t`Key` }),\n TableUtil.createTextColumn<CommonDbUser>({ id: 'email', name: t`E-Mail` }),\n TableUtil.createTextColumn<CommonDbUser>({ advancedSort: true, id: 'name', name: t`Name` }),\n TableUtil.createTextColumn<CommonDbUser>({ id: 'description', name: t`Description` }),\n TableUtil.createOptionsColumn<CommonDbUser>({ id: 'roles', name: t`Roles`, options: tableRoleOptions }),\n TableUtil.createBooleanColumn<CommonDbUser>({ id: 'is_active', name: t`Is active` }),\n ];\n }, [organizationOptionsQuery.options, tableRoleOptions, t]);\n\n const getOptimisticUpdateIntermediateItem = useCallback((variables: FormFields, previousItem: CommonDbUser): CommonDbUser => {\n return {\n email: previousItem.email,\n id: previousItem.id,\n is_active: previousItem.is_active,\n key: previousItem.email,\n name: previousItem.name,\n organization_id: previousItem.organization_id,\n ...variables,\n };\n }, []);\n\n const extraUpdateOnePermissions = useMemo<CommonDbApiPermission[]>(() => [\n { command_name: CommonDbCommandName.UpdateUserCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ], []);\n const extraDeleteOnePermissions = useMemo<CommonDbApiPermission[]>(() => [\n { command_name: CommonDbCommandName.UserCrudCommand, permission_type: CommonDbPermissionType.DELETE },\n ], []);\n\n const onAnonymizeUserConfirmationConfirm = useCallback(async () => {\n const userName = selectedUserRef.current?.email ?? selectedUserRef.current?.key;\n const notificationId = NotificationService.getInstance().showNotification({\n isLoading: true,\n message: t('Anonymizing user: {{userName}}', { userName }),\n severity: 'info',\n });\n try {\n // Anonymize the user\n await ApiService.getInstance().organizationApi.anonymizeUser(selectedUserRef.current.id);\n // Invalidate the users query key so that the users list is refreshed and the anonymized user is no longer visible in the list.\n await QueryClientService.getInstance().invalidateQueryKeys(\n QueryClientService.getInstance().getQueryKeyDependencies([COMMON_QUERY_KEY.USERS], true),\n );\n NotificationService.getInstance().fulfillNotification(notificationId, t('User anonymized successfully: {{userName}}', { userName }), 'success');\n } catch (_error) {\n NotificationService.getInstance().fulfillNotification(notificationId, t('Error anonymizing user: {{userName}}', { userName }), 'error');\n }\n }, [t]);\n\n const extraActionsFactory = useCallback((params: TableRowParams<CommonDbUser, null>) => {\n const menuItems: ReactElement[] = [];\n\n if (AuthorizationService.getInstance().doesUserHavePermission([\n { command_name: CommonDbCommandName.AnonymizeUserCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ])) {\n menuItems.push(\n <MenuItem\n key={'custom-action-1'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => {\n selectedUserRef.current = params.row;\n anonymizeUserConfirmationRef.current.open();\n }}\n >\n <ListItemIcon>\n <PersonOffIcon fontSize={'small'} />\n </ListItemIcon>\n <ListItemText>\n {t`Anonymize user`}\n </ListItemText>\n </MenuItem>,\n );\n }\n\n return menuItems;\n }, [t]);\n\n return (\n <>\n <CrudPage<FormFields, CommonDbUser>\n canEditItem={canEditItem}\n createItemDialogTitle={t`Create new user`}\n defaultSortByField={'name'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n extraActionsFactory={extraActionsFactory}\n extraDeleteOnePermissions={extraDeleteOnePermissions}\n extraUpdateOnePermissions={extraUpdateOnePermissions}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n getOptimisticUpdateIntermediateItem={getOptimisticUpdateIntermediateItem}\n itemName={t`User`}\n loadables={loadables}\n onRowsChange={onRowsChange}\n resourceQueryKeyBase={COMMON_QUERY_KEY.USERS}\n schema={schema}\n subPages={subPages}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('UsersAdminPage')}\n title={t`Users`}\n updateOne={updateOne}\n />\n <Confirmation\n body={t`Click the anonymize button to anonymize the user`}\n cancelLabel={t`Cancel`}\n confirmLabel={t`Anonymize`}\n onConfirm={onAnonymizeUserConfirmationConfirm}\n ref={anonymizeUserConfirmationRef}\n title={t`Are you sure you want to anonymize this user?`}\n />\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6DA,IAAa,KAAkB,EAC7B,kBACyB;CACzB,IAAM,EAAE,SAAM,EAAe,GACvB,IAA+B,EAA+B,IAAI,GAClE,IAA2B,EAA4B,GACvD,IAA6B,EAA8B,GAC3D,CAAC,GAAkB,KAAuB,EAA+B,CAAC,CAAC,GAC3E,CAAC,GAAiB,KAAsB,EAA+B,CAAC,CAAC,GACzE,IAAkB,EAA4B,IAAI,GAElD,IAAY,EAAS,CACzB,GACA,CACF,CAAC,GAEK,IAAY,EAAqB,YAAY,CAAC,CAAC,KAAK,OAEpD,IAAe,GAAa,MAA0B;EAG1D,IAAM,oBAAQ,IAAI,IAAY;EAC9B,EAAM,SAAS,MAAS;GACtB,EAAK,MAAM,SAAS,MAAS,EAAM,IAAI,CAAI,CAAC;EAC9C,CAAC;EACD,IAAM,IAAoB,MAAM,KAAK,CAAK,CAAC,CAAC,KAAK,OAAU;GACzD,OAAO;GACP,OAAO;EACT,EAAE;EACF,EAAoB,CAAiB;EACrC,IAAI;EACJ,AAQE,IARE,EAAqB,YAAY,CAAC,CAAC,uBAAuB,CAC5D;GAAE,cAAc,EAAoB;GAAsC,iBAAiB,EAAuB;EAAQ,CAC5H,CAAC,KACoB,GAA4B,OAAO,EAA2B,KAAK,MAAM,KAAI,OAAS;GACvG,OAAO;GACP,OAAO;EACT,EAAE,IAAI;EAMR,IAAM,IAAqB,EAAU,QAAO,MAAQ,CAAC,EAAiB,MAAK,MAAU,EAAO,UAAU,CAAI,CAAC;EAM3G,AALA,EAAiB,KAAK,GAAG,EAAmB,KAAI,OAAS;GACvD,UAAU;GACV,OAAO;GACP,OAAO;EACT,EAAE,CAAC,GACH,EAAmB,CAAgB;CACrC,GAAG,CAAC,EAA2B,MAAM,CA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AD;EACE,MAAM,CAAC;EACP,aAAa,CAAC;EACd,cAAc,CAAC;EACf,WAAW;EACX,KAAK;EACL,OAAO,CAAC;CACT,CAAA,CACD,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"index.js","names":["rootContainer","_Fragment","TableUtil","CrudPage","Fragment$1","PersonOffIcon","UsersAdminPage","useTranslation","anonymizeUserConfirmationRef","useRef","organizationOptionsQuery","useOrganizationOptionsQuery","inviteUserConstraintsQuery","useInviteUserConstraintsQuery","tableRoleOptions","setTableRoleOptions","useState","formRoleOptions","setFormRoleOptions","selectedUserRef","loadables","useArray","userRoles","container","AuthorizationService","onRowsChange","useCallback","roles","role","_tableRoleOptions","_formRoleOptions","CommonDbCommandName","CommonDbPermissionType","extraRolesFromUser","option","fetchAll","API_ORGANIZATION_TOKEN","updateOne","item","variables","deleteOne","getName","canEditItem","schema","useMemo","object","SchemaUtil","string","boolean","array","formFieldDefinitions","FORM_FIELD_DEFINITION_TYPE","t","tableColumns","getOptimisticUpdateIntermediateItem","previousItem","extraUpdateOnePermissions","extraDeleteOnePermissions","onAnonymizeUserConfirmationConfirm","userName","notificationId","NotificationService","QueryClientService","COMMON_QUERY_KEY","extraActionsFactory","menuItems","MenuItem","params","ListItemIcon","ListItemText","TestIdUtil","Confirmation"],"sources":["../../../src/pages/UsersAdminPage/UsersAdminPage.tsx"],"sourcesContent":["import { container as rootContainer } from 'tsyringe';\nimport type { ReactElement } from 'react';\nimport {\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n array,\n boolean,\n object,\n string,\n} from 'yup';\nimport type {\n CommonDbApiPermission,\n CommonDbUser,\n} from '@gen-epix/api-commondb';\nimport {\n CommonDbCommandName,\n CommonDbPermissionType,\n} from '@gen-epix/api-commondb';\nimport {\n ListItemIcon,\n ListItemText,\n MenuItem,\n} from '@mui/material';\nimport PersonOffIcon from '@mui/icons-material/PersonOff';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport type {\n FormFieldDefinition,\n OptionBase,\n} from '@gen-epix/ui-core-form/models/form.models';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form.models';\nimport { SchemaUtil } from '@gen-epix/ui-core-form/utils/SchemaUtil';\nimport type { ConfirmationRefMethods } from '@gen-epix/ui-core-components/components/Confirmation';\nimport { Confirmation } from '@gen-epix/ui-core-components/components/Confirmation';\n\nimport { API_ORGANIZATION_TOKEN } from '../../models/api.models';\nimport { useOrganizationOptionsQuery } from '../../dataHooks/useOrganizationsQuery';\nimport type {\n TableColumn,\n TableRowParams,\n} from '../../models/table.models';\nimport { TableUtil } from '../../utils/TableUtil';\nimport type { CrudPageProps } from '../CrudPage';\nimport { CrudPage } from '../CrudPage';\nimport { AuthorizationService } from '../../classes/services/AuthorizationService';\nimport { useInviteUserConstraintsQuery } from '../../dataHooks/useInviteUserConstraintsQuery';\nimport type { OmitWithMetaData } from '../../models/data.models';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\nimport { NotificationService } from '../../classes/services/NotificationService';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\n\nexport type UsersAdminPageProps = {\n subPages?: CrudPageProps<OmitWithMetaData<CommonDbUser, 'organization_id' | 'organization'>, CommonDbUser>['subPages'];\n};\n\ntype FormFields = OmitWithMetaData<CommonDbUser, 'organization_id' | 'organization'>;\n\nexport const UsersAdminPage = ({\n subPages,\n}: UsersAdminPageProps) => {\n const { t } = useTranslation();\n const anonymizeUserConfirmationRef = useRef<ConfirmationRefMethods>(null);\n const organizationOptionsQuery = useOrganizationOptionsQuery();\n const inviteUserConstraintsQuery = useInviteUserConstraintsQuery();\n const [tableRoleOptions, setTableRoleOptions] = useState<OptionBase<string>[]>([]);\n const [formRoleOptions, setFormRoleOptions] = useState<OptionBase<string>[]>([]);\n const selectedUserRef = useRef<CommonDbUser | null>(null);\n\n const loadables = useArray([\n organizationOptionsQuery,\n inviteUserConstraintsQuery,\n ]);\n\n const userRoles = rootContainer.resolve(AuthorizationService).user.roles;\n\n const onRowsChange = useCallback((items: CommonDbUser[]) => {\n // Because roles are a string array (instead of an enum or similar), we need to dynamically determine the options for the roles column in the table and in the form.\n // The options for the form are determined by the invite user constraints endpoint, but if the user doesn't have access to that endpoint, we fall back to using the roles that are currently in use by users in the system.\n const roles = new Set<string>();\n items.forEach((user) => {\n user.roles.forEach((role) => roles.add(role));\n });\n const _tableRoleOptions = Array.from(roles).map((role) => ({\n label: role,\n value: role,\n }));\n setTableRoleOptions(_tableRoleOptions);\n let _formRoleOptions: OptionBase<string>[];\n if (rootContainer.resolve(AuthorizationService).doesUserHavePermission([\n { command_name: CommonDbCommandName.RetrieveInviteUserConstraintsCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ])) {\n _formRoleOptions = inviteUserConstraintsQuery?.data ? inviteUserConstraintsQuery.data.roles.map(role => ({\n label: role,\n value: role,\n })) : _tableRoleOptions;\n } else {\n _formRoleOptions = _tableRoleOptions;\n }\n // The users own roles may not be included in the options from the invite user constraints endpoint (if they don't have permission to view that endpoint),\n // so we need to add those to the options as well, but disable them since the user doesn't have permission to assign those roles to other users.\n const extraRolesFromUser = userRoles.filter(role => !_formRoleOptions.some(option => option.value === role));\n _formRoleOptions.push(...extraRolesFromUser.map(role => ({\n disabled: true,\n label: role,\n value: role,\n })));\n setFormRoleOptions(_formRoleOptions);\n }, [inviteUserConstraintsQuery.data, userRoles]);\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n const users = (await rootContainer.resolve(API_ORGANIZATION_TOKEN).usersGetAll(null, null, { signal }))?.data;\n\n return users;\n }, []);\n\n const updateOne = useCallback(async (variables: FormFields, item: CommonDbUser) => {\n return (await rootContainer.resolve(API_ORGANIZATION_TOKEN).updateUser(item.id, {\n is_active: variables.is_active,\n organization_id: item.organization_id,\n roles: variables.roles,\n })).data;\n }, []);\n\n const deleteOne = useCallback(async (item: CommonDbUser) => {\n return await rootContainer.resolve(API_ORGANIZATION_TOKEN).usersDeleteOne(item.id);\n }, []);\n\n const getName = useCallback((item: FormFields) => {\n return item.email;\n }, []);\n\n const canEditItem = useCallback((item: CommonDbUser) => {\n return rootContainer.resolve(AuthorizationService).user.email !== item.email;\n }, []);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n description: SchemaUtil.description,\n email: string().email().nullable(),\n is_active: boolean().required(),\n key: string().optional(),\n name: string().nullable(),\n roles: array().required().min(1),\n });\n }, []);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n return [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n disabled: true,\n label: t`Key`,\n name: 'key',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Email`,\n name: 'email',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Name`,\n name: 'name',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Roles`,\n loading: inviteUserConstraintsQuery.isLoading,\n multiple: true,\n name: 'roles',\n options: formRoleOptions,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.BOOLEAN,\n label: t`Is active`,\n name: 'is_active',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Description`,\n name: 'description',\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const;\n }, [t, formRoleOptions, inviteUserConstraintsQuery.isLoading]);\n\n const tableColumns = useMemo((): TableColumn<CommonDbUser>[] => {\n return [\n TableUtil.createOptionsColumn<CommonDbUser>({ id: 'organization_id', name: t`Organization`, options: organizationOptionsQuery.options }),\n TableUtil.createTextColumn<CommonDbUser>({ id: 'key', name: t`Key` }),\n TableUtil.createTextColumn<CommonDbUser>({ id: 'email', name: t`E-Mail` }),\n TableUtil.createTextColumn<CommonDbUser>({ advancedSort: true, id: 'name', name: t`Name` }),\n TableUtil.createTextColumn<CommonDbUser>({ id: 'description', name: t`Description` }),\n TableUtil.createOptionsColumn<CommonDbUser>({ id: 'roles', name: t`Roles`, options: tableRoleOptions }),\n TableUtil.createBooleanColumn<CommonDbUser>({ id: 'is_active', name: t`Is active` }),\n ];\n }, [organizationOptionsQuery.options, tableRoleOptions, t]);\n\n const getOptimisticUpdateIntermediateItem = useCallback((variables: FormFields, previousItem: CommonDbUser): CommonDbUser => {\n return {\n email: previousItem.email,\n id: previousItem.id,\n is_active: previousItem.is_active,\n key: previousItem.email,\n name: previousItem.name,\n organization_id: previousItem.organization_id,\n ...variables,\n };\n }, []);\n\n const extraUpdateOnePermissions = useMemo<CommonDbApiPermission[]>(() => [\n { command_name: CommonDbCommandName.UpdateUserCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ], []);\n const extraDeleteOnePermissions = useMemo<CommonDbApiPermission[]>(() => [\n { command_name: CommonDbCommandName.UserCrudCommand, permission_type: CommonDbPermissionType.DELETE },\n ], []);\n\n const onAnonymizeUserConfirmationConfirm = useCallback(async () => {\n const userName = selectedUserRef.current?.email ?? selectedUserRef.current?.key;\n const notificationId = rootContainer.resolve(NotificationService).showNotification({\n isLoading: true,\n message: t('Anonymizing user: {{userName}}', { userName }),\n severity: 'info',\n });\n try {\n // Anonymize the user\n await rootContainer.resolve(API_ORGANIZATION_TOKEN).anonymizeUser(selectedUserRef.current.id);\n // Invalidate the users query key so that the users list is refreshed and the anonymized user is no longer visible in the list.\n await rootContainer.resolve(QueryClientService).invalidateQueryKeys(\n rootContainer.resolve(QueryClientService).getQueryKeyDependencies([COMMON_QUERY_KEY.USERS], true),\n );\n rootContainer.resolve(NotificationService).fulfillNotification(notificationId, t('User anonymized successfully: {{userName}}', { userName }), 'success');\n } catch (_error) {\n rootContainer.resolve(NotificationService).fulfillNotification(notificationId, t('Error anonymizing user: {{userName}}', { userName }), 'error');\n }\n }, [t]);\n\n const extraActionsFactory = useCallback((params: TableRowParams<CommonDbUser, null>) => {\n const menuItems: ReactElement[] = [];\n\n if (rootContainer.resolve(AuthorizationService).doesUserHavePermission([\n { command_name: CommonDbCommandName.AnonymizeUserCommand, permission_type: CommonDbPermissionType.EXECUTE },\n ])) {\n menuItems.push(\n <MenuItem\n key={'custom-action-1'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => {\n selectedUserRef.current = params.row;\n anonymizeUserConfirmationRef.current.open();\n }}\n >\n <ListItemIcon>\n <PersonOffIcon fontSize={'small'} />\n </ListItemIcon>\n <ListItemText>\n {t`Anonymize user`}\n </ListItemText>\n </MenuItem>,\n );\n }\n\n return menuItems;\n }, [t]);\n\n return (\n <>\n <CrudPage<FormFields, CommonDbUser>\n canEditItem={canEditItem}\n createItemDialogTitle={t`Create new user`}\n defaultSortByField={'name'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n extraActionsFactory={extraActionsFactory}\n extraDeleteOnePermissions={extraDeleteOnePermissions}\n extraUpdateOnePermissions={extraUpdateOnePermissions}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n getOptimisticUpdateIntermediateItem={getOptimisticUpdateIntermediateItem}\n itemName={t`User`}\n loadables={loadables}\n onRowsChange={onRowsChange}\n resourceQueryKeyBase={COMMON_QUERY_KEY.USERS}\n schema={schema}\n subPages={subPages}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('UsersAdminPage')}\n title={t`Users`}\n updateOne={updateOne}\n />\n <Confirmation\n body={t`Click the anonymize button to anonymize the user`}\n cancelLabel={t`Cancel`}\n confirmLabel={t`Anonymize`}\n onConfirm={onAnonymizeUserConfirmationConfirm}\n ref={anonymizeUserConfirmationRef}\n title={t`Are you sure you want to anonymize this user?`}\n />\n </>\n );\n};\n"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ACjB;EACY;EACb;EAC4B;EACrC,UAAU,CAAC;EACA;EACG;EACd,sBAAsB4D,EAAiB;EAC/B;EACE;EACI;EACd,kBAAkBO,EAAW,iBAAiB,gBAAgB;EAC9D,OAAO,CAAC;EACG;CACZ,CAAA,GACD,kBAACC,GAAD;EACE,MAAM,CAAC;EACP,aAAa,CAAC;EACd,cAAc,CAAC;EACf,WAAWb;EACX,KAAKlD;EACL,OAAO,CAAC;CACT,CAAA,CACD,EAAA,CAAA;AAEN"}
@@ -1,6 +1,6 @@
1
1
  import { CommonDbApiPermission } from '@gen-epix/api-commondb';
2
2
  import { ComponentType } from 'react';
3
- import { MyNonIndexRouteObject } from '../models/reactRouter';
3
+ import { MyNonIndexRouteObject } from '../models/react-router.models';
4
4
  type CreateAdminRoutesOptions<TExtraPermission = never> = {
5
5
  usersComponent?: ComponentType;
6
6
  usersRouteChildren?: MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>[];
@@ -1,4 +1,4 @@
1
- import { ADMIN_PAGE_CATEGORY as e } from "../models/admin.js";
1
+ import { ADMIN_PAGE_CATEGORY as e } from "../models/admin.models.js";
2
2
  import { IdentifierIssuersAdminPage as t } from "../pages/IdentifierIssuersAdminPage/index.js";
3
3
  import { OrganizationAdminPoliciesAdminPage as n } from "../pages/OrganizationAdminPoliciesAdminPage/index.js";
4
4
  import { OrganizationContactsAdminPage as r } from "../pages/OrganizationContactsAdminPage/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/routes/adminRoutes.tsx","../../src/routes/routes.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { CommonDbApiPermission } from '@gen-epix/api-commondb';\nimport {\n CommonDbCommandName,\n CommonDbPermissionType,\n} from '@gen-epix/api-commondb';\nimport { t } from 'i18next';\nimport type { ComponentType } from 'react';\n\nimport { ADMIN_PAGE_CATEGORY } from '../models/admin';\nimport type { MyNonIndexRouteObject } from '../models/reactRouter';\nimport { IdentifierIssuersAdminPage } from '../pages/IdentifierIssuersAdminPage';\nimport { OrganizationAdminPoliciesAdminPage } from '../pages/OrganizationAdminPoliciesAdminPage';\nimport { OrganizationContactsAdminPage } from '../pages/OrganizationContactsAdminPage';\nimport { OrganizationsAdminPage } from '../pages/OrganizationsAdminPage';\nimport { OrganizationSitesAdminPage } from '../pages/OrganizationSitesAdminPage';\nimport { OutagesAdminPage } from '../pages/OutagesAdminPage';\nimport { RouterErrorPage } from '../pages/RouterErrorPage';\nimport { UserInvitationsAdminPage } from '../pages/UserInvitationsAdminPage';\nimport { UsersAdminPage } from '../pages/UsersAdminPage';\n\ntype CreateAdminRoutesOptions<TExtraPermission = never> = {\n usersComponent?: ComponentType;\n usersRouteChildren?: MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>[];\n};\n\nexport const createAdminRoutes = <TExtraPermission = never>(\n options: CreateAdminRoutesOptions<TExtraPermission> = {},\n): MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>[] => [\n {\n children: [\n {\n Component: OrganizationsAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS,\n requiredPermissions: [\n { command_name: CommonDbCommandName.OrganizationCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n subTitle: t`Manage your organizations`,\n title: t`Organizations`,\n },\n index: true,\n path: '/management/organizations',\n },\n {\n children: [\n {\n Component: OrganizationSitesAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n requiredPermissions: [\n { command_name: CommonDbCommandName.SiteCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n title: t`Organization sites`,\n },\n index: true,\n path: '/management/organizations/:organizationId/sites',\n },\n {\n Component: OrganizationContactsAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n requiredPermissions: [\n { command_name: CommonDbCommandName.SiteCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n title: t`Site contacts`,\n },\n path: '/management/organizations/:organizationId/sites/:siteId/contacts',\n },\n ],\n errorElement: <RouterErrorPage />,\n handle: {\n requiredPermissions: [],\n requirePermissionForChildRoute: true,\n requiresUserProfile: true,\n title: t`Organization sites`,\n },\n path: '/management/organizations/:organizationId/sites',\n },\n ],\n errorElement: <RouterErrorPage />,\n handle: {\n requiredPermissions: [],\n requirePermissionForChildRoute: true,\n requiresUserProfile: true,\n title: t`Organizations`,\n },\n path: '/management/organizations',\n },\n {\n children: [\n {\n Component: options.usersComponent ?? UsersAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS,\n requiredPermissions: [\n { command_name: CommonDbCommandName.UserCrudCommand, permission_type: CommonDbPermissionType.READ },\n { command_name: CommonDbCommandName.OrganizationCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n subTitle: t`Manage users`,\n title: t`Users`,\n },\n index: true,\n path: '/management/users',\n },\n ...(options.usersRouteChildren ?? []),\n ],\n errorElement: <RouterErrorPage />,\n handle: {\n requiredPermissions: [],\n requirePermissionForChildRoute: true,\n requiresUserProfile: true,\n title: t`Users`,\n },\n path: '/management/users',\n },\n {\n Component: UserInvitationsAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS,\n requiredPermissions: [\n { command_name: CommonDbCommandName.UserInvitationCrudCommand, permission_type: CommonDbPermissionType.READ },\n { command_name: CommonDbCommandName.OrganizationCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n subTitle: t`Invite users to your organization`,\n title: t`User invitations`,\n },\n path: '/management/user-invitations',\n },\n {\n Component: OrganizationAdminPoliciesAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS,\n requiredPermissions: [\n { command_name: CommonDbCommandName.OrganizationAdminPolicyCrudCommand, permission_type: CommonDbPermissionType.READ },\n { command_name: CommonDbCommandName.UserCrudCommand, permission_type: CommonDbPermissionType.READ },\n { command_name: CommonDbCommandName.OrganizationCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n subTitle: t`Manage organization admin policies`,\n title: t`Organization admin policies`,\n },\n path: '/management/organization-admin-policies',\n },\n {\n Component: IdentifierIssuersAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS,\n requiredPermissions: [\n { command_name: CommonDbCommandName.IdentifierIssuerCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n subTitle: t`Manage identifier issuers`,\n title: t`Identifier issuers`,\n },\n path: '/management/identifier-issuers',\n },\n {\n Component: OutagesAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.SYSTEM,\n requiredPermissions: [],\n requiresUserProfile: true,\n subTitle: t`Manage outages`,\n title: t`Outages`,\n },\n path: '/management/outages',\n },\n];\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport HomeIcon from '@mui/icons-material/Home';\nimport type { CommonDbApiPermission } from '@gen-epix/api-commondb';\nimport { t } from 'i18next';\n\nimport { RouterRoot } from '../components/app/RouterRoot';\nimport type {\n MyIndexRouteObject,\n MyNonIndexRouteObject,\n} from '../models/reactRouter';\nimport { AcceptInvitationPage } from '../pages/AcceptInvitationPage';\nimport { AdminPage } from '../pages/AdminPage';\nimport { PostLoginPage } from '../pages/PostLoginPage';\nimport { PostLogoutPage } from '../pages/PostLogoutPage';\nimport { RouterErrorPage } from '../pages/RouterErrorPage';\n\nimport { createAdminRoutes } from './adminRoutes';\n\ntype CreateRoutesOptions<TExtraPermission = never> = {\n adminRoutes?: MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>[];\n rootChildren?: Array<\n MyIndexRouteObject<CommonDbApiPermission | TExtraPermission>\n | MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>\n >;\n};\n\nexport const createRoutes = <TExtraPermission = never>(\n options: CreateRoutesOptions<TExtraPermission> = {},\n): MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>[] => {\n const adminRoutes = options.adminRoutes ?? createAdminRoutes<TExtraPermission>();\n const rootChildren = options.rootChildren ?? [];\n\n return [\n {\n Component: PostLogoutPage,\n errorElement: <RouterErrorPage />,\n handle: {\n hidden: true,\n requiredPermissions: [],\n requiresUserProfile: false,\n title: t`Post Logout`,\n },\n path: '/post-logout',\n },\n {\n children: [\n {\n Component: AcceptInvitationPage,\n errorElement: <RouterErrorPage />,\n handle: {\n hidden: true,\n requiredPermissions: [],\n requiresUserProfile: false,\n title: t`Accept Invitation`,\n },\n path: '/accept-invitation/:token',\n },\n {\n Component: PostLoginPage,\n errorElement: <RouterErrorPage />,\n handle: {\n hidden: true,\n requiredPermissions: [],\n requiresUserProfile: false,\n title: t`Post Login`,\n },\n path: '/post-login',\n },\n ...rootChildren,\n {\n children: [\n {\n Component: () => <AdminPage />,\n errorElement: <RouterErrorPage />,\n handle: {\n disabled: false,\n requiredPermissions: [],\n requiresUserProfile: true,\n title: t`Management`,\n },\n index: true,\n path: '/management',\n },\n ...adminRoutes,\n ],\n errorElement: <RouterErrorPage />,\n handle: {\n disabled: false,\n requiredPermissions: [],\n requirePermissionForChildRoute: true,\n requiresUserProfile: true,\n title: t`Management`,\n },\n path: '/management',\n },\n ],\n Component: RouterRoot,\n errorElement: <RouterErrorPage />,\n handle: {\n icon: <HomeIcon />,\n requiredPermissions: [],\n requiresUserProfile: true,\n root: true,\n title: t`Home`,\n },\n path: '/',\n },\n ];\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,KACX,IAAsD,CAAC,MACe;CACtE;EACE,UAAU,CACR;GACE,WAAW;GACX,cAAc,kBAAC,GAAD,CAAkB,CAAA;GAChC,QAAQ;IACN,UAAU,EAAoB;IA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EAAQ,gBAAgB,CAAC;CAE9C,OAAO,CACL;EACE,WAAW;EACX,cAAc,kBAAC,GAAD,CAAkB,CAAA;EAChC,QAAQ;GACN,QAAQ;GACR,qBAAqB,CAAC;GACtB,qBAAqB;GACrB,OAAO,CAAC;EACV;EACA,MAAM;CACR,GACA;EACE,UAAU;GACR;IACE,WAAW;IACX,cAAc,kBAAC,GAAD,CAAkB,CAAA;IAChC,QAAQ;KACN,QAAQ;KACR,qBAAqB,CAAC;KACtB,qBAAqB;KACrB,OAAO,CAAC;IACV;IACA,MAAM;GACR;GACA;IACE,WAAW;IACX,cAAc,kBAAC,GAAD,CAAkB,CAAA;IAChC,QAAQ;KACN,QAAQ;KACR,qBAAqB,CAAC;KACtB,qBAAqB;KACrB,OAAO,CAAC;IACV;IACA,MAAM;GACR;GACA,GAAG;GACH;IACE,UAAU,CACR;KACE,iBAAiB,kBAAC,GAAD,CAAY,CAAA;KAC7B,cAAc,kBAAC,GAAD,CAAkB,CAAA;KAChC,QAAQ;MACN,UAAU;MACV,qBAAqB,CAAC;MACtB,qBAAqB;MACrB,OAAO,CAAC;KACV;KACA,OAAO;KACP,MAAM;IACR,GACA,GAAG,CACL;IACA,cAAc,kBAAC,GAAD,CAAkB,CAAA;IAChC,QAAQ;KACN,UAAU;KACV,qBAAqB,CAAC;KACtB,gCAAgC;KAChC,qBAAqB;KACrB,OAAO,CAAC;IACV;IACA,MAAM;GACR;EACF;EACA,WAAW;EACX,cAAc,kBAAC,GAAD,CAAkB,CAAA;EAChC,QAAQ;GACN,MAAM,kBAAC,GAAD,CAAW,CAAA;GACjB,qBAAqB,CAAC;GACtB,qBAAqB;GACrB,MAAM;GACN,OAAO,CAAC;EACV;EACA,MAAM;CACR,CACF;AACF"}
1
+ {"version":3,"file":"index.js","names":["UserInvitationsAdminPage","HomeIcon","createAdminRoutes","OrganizationsAdminPage","RouterErrorPage","ADMIN_PAGE_CATEGORY","CommonDbCommandName","CommonDbPermissionType","OrganizationSitesAdminPage","OrganizationContactsAdminPage","options","UsersAdminPage","OrganizationAdminPoliciesAdminPage","IdentifierIssuersAdminPage","OutagesAdminPage","createRoutes","adminRoutes","rootChildren","PostLogoutPage","AcceptInvitationPage","PostLoginPage","AdminPage","RouterRoot"],"sources":["../../src/routes/adminRoutes.tsx","../../src/routes/routes.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { CommonDbApiPermission } from '@gen-epix/api-commondb';\nimport {\n CommonDbCommandName,\n CommonDbPermissionType,\n} from '@gen-epix/api-commondb';\nimport { t } from 'i18next';\nimport type { ComponentType } from 'react';\n\nimport { ADMIN_PAGE_CATEGORY } from '../models/admin.models';\nimport type { MyNonIndexRouteObject } from '../models/react-router.models';\nimport { IdentifierIssuersAdminPage } from '../pages/IdentifierIssuersAdminPage';\nimport { OrganizationAdminPoliciesAdminPage } from '../pages/OrganizationAdminPoliciesAdminPage';\nimport { OrganizationContactsAdminPage } from '../pages/OrganizationContactsAdminPage';\nimport { OrganizationsAdminPage } from '../pages/OrganizationsAdminPage';\nimport { OrganizationSitesAdminPage } from '../pages/OrganizationSitesAdminPage';\nimport { OutagesAdminPage } from '../pages/OutagesAdminPage';\nimport { RouterErrorPage } from '../pages/RouterErrorPage';\nimport { UserInvitationsAdminPage } from '../pages/UserInvitationsAdminPage';\nimport { UsersAdminPage } from '../pages/UsersAdminPage';\n\ntype CreateAdminRoutesOptions<TExtraPermission = never> = {\n usersComponent?: ComponentType;\n usersRouteChildren?: MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>[];\n};\n\nexport const createAdminRoutes = <TExtraPermission = never>(\n options: CreateAdminRoutesOptions<TExtraPermission> = {},\n): MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>[] => [\n {\n children: [\n {\n Component: OrganizationsAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS,\n requiredPermissions: [\n { command_name: CommonDbCommandName.OrganizationCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n subTitle: t`Manage your organizations`,\n title: t`Organizations`,\n },\n index: true,\n path: '/management/organizations',\n },\n {\n children: [\n {\n Component: OrganizationSitesAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n requiredPermissions: [\n { command_name: CommonDbCommandName.SiteCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n title: t`Organization sites`,\n },\n index: true,\n path: '/management/organizations/:organizationId/sites',\n },\n {\n Component: OrganizationContactsAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n requiredPermissions: [\n { command_name: CommonDbCommandName.SiteCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n title: t`Site contacts`,\n },\n path: '/management/organizations/:organizationId/sites/:siteId/contacts',\n },\n ],\n errorElement: <RouterErrorPage />,\n handle: {\n requiredPermissions: [],\n requirePermissionForChildRoute: true,\n requiresUserProfile: true,\n title: t`Organization sites`,\n },\n path: '/management/organizations/:organizationId/sites',\n },\n ],\n errorElement: <RouterErrorPage />,\n handle: {\n requiredPermissions: [],\n requirePermissionForChildRoute: true,\n requiresUserProfile: true,\n title: t`Organizations`,\n },\n path: '/management/organizations',\n },\n {\n children: [\n {\n Component: options.usersComponent ?? UsersAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS,\n requiredPermissions: [\n { command_name: CommonDbCommandName.UserCrudCommand, permission_type: CommonDbPermissionType.READ },\n { command_name: CommonDbCommandName.OrganizationCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n subTitle: t`Manage users`,\n title: t`Users`,\n },\n index: true,\n path: '/management/users',\n },\n ...(options.usersRouteChildren ?? []),\n ],\n errorElement: <RouterErrorPage />,\n handle: {\n requiredPermissions: [],\n requirePermissionForChildRoute: true,\n requiresUserProfile: true,\n title: t`Users`,\n },\n path: '/management/users',\n },\n {\n Component: UserInvitationsAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS,\n requiredPermissions: [\n { command_name: CommonDbCommandName.UserInvitationCrudCommand, permission_type: CommonDbPermissionType.READ },\n { command_name: CommonDbCommandName.OrganizationCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n subTitle: t`Invite users to your organization`,\n title: t`User invitations`,\n },\n path: '/management/user-invitations',\n },\n {\n Component: OrganizationAdminPoliciesAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS,\n requiredPermissions: [\n { command_name: CommonDbCommandName.OrganizationAdminPolicyCrudCommand, permission_type: CommonDbPermissionType.READ },\n { command_name: CommonDbCommandName.UserCrudCommand, permission_type: CommonDbPermissionType.READ },\n { command_name: CommonDbCommandName.OrganizationCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n subTitle: t`Manage organization admin policies`,\n title: t`Organization admin policies`,\n },\n path: '/management/organization-admin-policies',\n },\n {\n Component: IdentifierIssuersAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.USERS_AND_ORGANIZATIONS,\n requiredPermissions: [\n { command_name: CommonDbCommandName.IdentifierIssuerCrudCommand, permission_type: CommonDbPermissionType.READ },\n ],\n requiresUserProfile: true,\n subTitle: t`Manage identifier issuers`,\n title: t`Identifier issuers`,\n },\n path: '/management/identifier-issuers',\n },\n {\n Component: OutagesAdminPage,\n errorElement: <RouterErrorPage />,\n handle: {\n category: ADMIN_PAGE_CATEGORY.SYSTEM,\n requiredPermissions: [],\n requiresUserProfile: true,\n subTitle: t`Manage outages`,\n title: t`Outages`,\n },\n path: '/management/outages',\n },\n];\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport HomeIcon from '@mui/icons-material/Home';\nimport type { CommonDbApiPermission } from '@gen-epix/api-commondb';\nimport { t } from 'i18next';\n\nimport { RouterRoot } from '../components/app/RouterRoot';\nimport type {\n MyIndexRouteObject,\n MyNonIndexRouteObject,\n} from '../models/react-router.models';\nimport { AcceptInvitationPage } from '../pages/AcceptInvitationPage';\nimport { AdminPage } from '../pages/AdminPage';\nimport { PostLoginPage } from '../pages/PostLoginPage';\nimport { PostLogoutPage } from '../pages/PostLogoutPage';\nimport { RouterErrorPage } from '../pages/RouterErrorPage';\n\nimport { createAdminRoutes } from './adminRoutes';\n\ntype CreateRoutesOptions<TExtraPermission = never> = {\n adminRoutes?: MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>[];\n rootChildren?: Array<\n MyIndexRouteObject<CommonDbApiPermission | TExtraPermission>\n | MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>\n >;\n};\n\nexport const createRoutes = <TExtraPermission = never>(\n options: CreateRoutesOptions<TExtraPermission> = {},\n): MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>[] => {\n const adminRoutes = options.adminRoutes ?? createAdminRoutes<TExtraPermission>();\n const rootChildren = options.rootChildren ?? [];\n\n return [\n {\n Component: PostLogoutPage,\n errorElement: <RouterErrorPage />,\n handle: {\n hidden: true,\n requiredPermissions: [],\n requiresUserProfile: false,\n title: t`Post Logout`,\n },\n path: '/post-logout',\n },\n {\n children: [\n {\n Component: AcceptInvitationPage,\n errorElement: <RouterErrorPage />,\n handle: {\n hidden: true,\n requiredPermissions: [],\n requiresUserProfile: false,\n title: t`Accept Invitation`,\n },\n path: '/accept-invitation/:token',\n },\n {\n Component: PostLoginPage,\n errorElement: <RouterErrorPage />,\n handle: {\n hidden: true,\n requiredPermissions: [],\n requiresUserProfile: false,\n title: t`Post Login`,\n },\n path: '/post-login',\n },\n ...rootChildren,\n {\n children: [\n {\n Component: () => <AdminPage />,\n errorElement: <RouterErrorPage />,\n handle: {\n disabled: false,\n requiredPermissions: [],\n requiresUserProfile: true,\n title: t`Management`,\n },\n index: true,\n path: '/management',\n },\n ...adminRoutes,\n ],\n errorElement: <RouterErrorPage />,\n handle: {\n disabled: false,\n requiredPermissions: [],\n requirePermissionForChildRoute: true,\n requiresUserProfile: true,\n title: t`Management`,\n },\n path: '/management',\n },\n ],\n Component: RouterRoot,\n errorElement: <RouterErrorPage />,\n handle: {\n icon: <HomeIcon />,\n requiredPermissions: [],\n requiresUserProfile: true,\n root: true,\n title: t`Home`,\n },\n path: '/',\n },\n ];\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,IAAaE,KACX,IAAsD,CAAC,MACe;CACtE;EACE,UAAU,CACR;GACE,WAAWC;GACX,cAAc,kBAACC,GAAD,CAAkB,CAAA;GAChC,QAAQ;IACN,UAAUC,EAAoB;IAC9B,qBAAqB,CACnB;KAAE,cAAcC,EAAoB;KAAyB,iBAAiBC,EAAuB;IAAK,CAC5G;IACA,qBAAqB;IACrB,UAAU,CAAC;IACX,OAAO,CAAC;GACV;GACA,OAAO;GACP,MAAM;EACR,GACA;GACE,UAAU,CACR;IACE,WAAWC;IACX,cAAc,kBAACJ,GAAD,CAAkB,CAAA;IAChC,QAAQ;KACN,qBAAqB,CACnB;MAAE,cAAcE,EAAoB;MAAiB,iBAAiBC,EAAuB;KAAK,CACpG;KACA,qBAAqB;KACrB,OAAO,CAAC;IACV;IACA,OAAO;IACP,MAAM;GACR,GACA;IACE,WAAWE;IACX,cAAc,kBAACL,GAAD,CAAkB,CAAA;IAChC,QAAQ;KACN,qBAAqB,CACnB;MAAE,cAAcE,EAAoB;MAAiB,iBAAiBC,EAAuB;KAAK,CACpG;KACA,qBAAqB;KACrB,OAAO,CAAC;IACV;IACA,MAAM;GACR,CACF;GACA,cAAc,kBAACH,GAAD,CAAkB,CAAA;GAChC,QAAQ;IACN,qBAAqB,CAAC;IACtB,gCAAgC;IAChC,qBAAqB;IACrB,OAAO,CAAC;GACV;GACA,MAAM;EACR,CACF;EACA,cAAc,kBAACA,GAAD,CAAkB,CAAA;EAChC,Q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KACP,MAAM;IACR,GACA,GAAGY,CACL;IACA,cAAc,kBAACZ,GAAD,CAAkB,CAAA;IAChC,QAAQ;KACN,UAAU;KACV,qBAAqB,CAAC;KACtB,gCAAgC;KAChC,qBAAqB;KACrB,OAAO,CAAC;IACV;IACA,MAAM;GACR;EACF;EACA,WAAWkB;EACX,cAAc,kBAAClB,GAAD,CAAkB,CAAA;EAChC,QAAQ;GACN,MAAM,kBAACH,GAAD,CAAW,CAAA;GACjB,qBAAqB,CAAC;GACtB,qBAAqB;GACrB,MAAM;GACN,OAAO,CAAC;EACV;EACA,MAAM;CACR,CACF;AACF"}
@@ -1,5 +1,5 @@
1
1
  import { CommonDbApiPermission } from '@gen-epix/api-commondb';
2
- import { MyIndexRouteObject, MyNonIndexRouteObject } from '../models/reactRouter';
2
+ import { MyIndexRouteObject, MyNonIndexRouteObject } from '../models/react-router.models';
3
3
  type CreateRoutesOptions<TExtraPermission = never> = {
4
4
  adminRoutes?: MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>[];
5
5
  rootChildren?: Array<MyIndexRouteObject<CommonDbApiPermission | TExtraPermission> | MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>>;
@@ -1 +1 @@
1
- {"version":3,"file":"setup.js","names":[],"sources":["../../src/setup/setup.ts"],"sourcesContent":["import { setupYup } from '@gen-epix/ui-core-form/setup/setup';\n\nexport const setupUi = () => {\n setupYup();\n};\n"],"mappings":";;AAEA,IAAa,UAAgB;CAC3B,EAAS;AACX"}
1
+ {"version":3,"file":"setup.js","names":["setupUi"],"sources":["../../src/setup/setup.ts"],"sourcesContent":["import { setupYup } from '@gen-epix/ui-core-form/setup/setup';\n\nexport const setupUi = () => {\n setupYup();\n};\n"],"mappings":";;AAEA,IAAaA,UAAgB;CAC3B,EAAS;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/stores/oidcStore/oidcStore.ts"],"sourcesContent":["import { createStore } from 'zustand';\nimport {\n createJSONStorage,\n persist,\n} from 'zustand/middleware';\nimport type { CommonDbIdentityProvider } from '@gen-epix/api-commondb';\n\n\nexport type OidcStore = OidcStoreActions & OidcStoreState;\n\nexport interface OidcStoreActions {\n setConfiguration: (configuration: CommonDbIdentityProvider) => void;\n}\n\nexport interface OidcStoreState {\n configuration: CommonDbIdentityProvider;\n}\n\nexport const createOidcStoreInitialState: () => OidcStoreState = () => ({\n configuration: undefined,\n});\n\nexport const oidcStore = createStore<OidcStore>()(\n persist(\n (set) => {\n return {\n ...createOidcStoreInitialState(),\n setConfiguration: (configuration: CommonDbIdentityProvider) => {\n set({ configuration });\n },\n };\n },\n {\n name: 'GENEPIX-OIDC-Configuration',\n partialize: (state) => ({\n configuration: state.configuration,\n }),\n storage: createJSONStorage(() => sessionStorage),\n version: 1,\n },\n ),\n);\n"],"mappings":";;;AAkBA,IAAa,WAA2D,EACtE,eAAe,KAAA,EACjB,IAEa,IAAY,EAAuB,CAAC,CAC/C,GACG,OACQ;CACL,GAAG,EAA4B;CAC/B,mBAAmB,MAA4C;EAC7D,EAAI,EAAE,iBAAc,CAAC;CACvB;AACF,IAEF;CACE,MAAM;CACN,aAAa,OAAW,EACtB,eAAe,EAAM,cACvB;CACA,SAAS,QAAwB,cAAc;CAC/C,SAAS;AACX,CACF,CACF"}
1
+ {"version":3,"file":"index.js","names":["createStore","persist","createJSONStorage","createOidcStoreInitialState","oidcStore","state"],"sources":["../../../src/stores/oidcStore/oidcStore.ts"],"sourcesContent":["import { createStore } from 'zustand';\nimport {\n createJSONStorage,\n persist,\n} from 'zustand/middleware';\nimport type { CommonDbIdentityProvider } from '@gen-epix/api-commondb';\n\n\nexport type OidcStore = OidcStoreActions & OidcStoreState;\n\nexport interface OidcStoreActions {\n setConfiguration: (configuration: CommonDbIdentityProvider) => void;\n}\n\nexport interface OidcStoreState {\n configuration: CommonDbIdentityProvider;\n}\n\nexport const createOidcStoreInitialState: () => OidcStoreState = () => ({\n configuration: undefined,\n});\n\nexport const oidcStore = createStore<OidcStore>()(\n persist(\n (set) => {\n return {\n ...createOidcStoreInitialState(),\n setConfiguration: (configuration: CommonDbIdentityProvider) => {\n set({ configuration });\n },\n };\n },\n {\n name: 'GENEPIX-OIDC-Configuration',\n partialize: (state) => ({\n configuration: state.configuration,\n }),\n storage: createJSONStorage(() => sessionStorage),\n version: 1,\n },\n ),\n);\n"],"mappings":";;;AAkBA,IAAaG,WAA2D,EACtE,eAAe,KAAA,EACjB,IAEaC,IAAYJ,EAAuB,CAAC,CAC/CC,GACG,OACQ;CACL,GAAGE,EAA4B;CAC/B,mBAAmB,MAA4C;EAC7D,EAAI,EAAE,iBAAc,CAAC;CACvB;AACF,IAEF;CACE,MAAM;CACN,aAAa,OAAW,EACtB,eAAeE,EAAM,cACvB;CACA,SAASH,QAAwB,cAAc;CAC/C,SAAS;AACX,CACF,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/stores/outagesStore/outagesStore.ts"],"sourcesContent":["import { createStore } from 'zustand';\nimport type { CommonDbOutage } from '@gen-epix/api-commondb';\n\nimport type { CategorizedOutages } from '../../models/outage';\n\nexport type OutagesStore = OutagesStoreActions & OutagesStoreState;\n\nexport interface OutagesStoreActions {\n setCategorizedOutages: (categorizedOutages: CategorizedOutages) => void;\n}\n\nexport interface OutagesStoreState {\n activeOutages: CommonDbOutage[];\n soonActiveOutages: CommonDbOutage[];\n visibleOutages: CommonDbOutage[];\n}\n\nconst createOutagesStoreDefaultState: () => OutagesStoreState = () => ({\n activeOutages: [],\n soonActiveOutages: [],\n visibleOutages: [],\n});\n\nexport const outagesStore = createStore<OutagesStore>()((set) => {\n return {\n ...createOutagesStoreDefaultState(),\n setCategorizedOutages: (categorizedOutages: CategorizedOutages) => {\n set(categorizedOutages);\n },\n };\n});\n"],"mappings":";;AAiBA,IAAM,WAAiE;CACrE,eAAe,CAAC;CAChB,mBAAmB,CAAC;CACpB,gBAAgB,CAAC;AACnB,IAEa,IAAe,EAA0B,CAAC,EAAE,OAChD;CACL,GAAG,EAA+B;CAClC,wBAAwB,MAA2C;EACjE,EAAI,CAAkB;CACxB;AACF,EACD"}
1
+ {"version":3,"file":"index.js","names":["createStore","createOutagesStoreDefaultState","outagesStore","categorizedOutages"],"sources":["../../../src/stores/outagesStore/outagesStore.ts"],"sourcesContent":["import { createStore } from 'zustand';\nimport type { CommonDbOutage } from '@gen-epix/api-commondb';\n\nimport type { CategorizedOutages } from '../../models/outage.models';\n\nexport type OutagesStore = OutagesStoreActions & OutagesStoreState;\n\nexport interface OutagesStoreActions {\n setCategorizedOutages: (categorizedOutages: CategorizedOutages) => void;\n}\n\nexport interface OutagesStoreState {\n activeOutages: CommonDbOutage[];\n soonActiveOutages: CommonDbOutage[];\n visibleOutages: CommonDbOutage[];\n}\n\nconst createOutagesStoreDefaultState: () => OutagesStoreState = () => ({\n activeOutages: [],\n soonActiveOutages: [],\n visibleOutages: [],\n});\n\nexport const outagesStore = createStore<OutagesStore>()((set) => {\n return {\n ...createOutagesStoreDefaultState(),\n setCategorizedOutages: (categorizedOutages: CategorizedOutages) => {\n set(categorizedOutages);\n },\n };\n});\n"],"mappings":";;AAiBA,IAAMC,WAAiE;CACrE,eAAe,CAAC;CAChB,mBAAmB,CAAC;CACpB,gBAAgB,CAAC;AACnB,IAEaC,IAAeF,EAA0B,CAAC,EAAE,OAChD;CACL,GAAGC,EAA+B;CAClC,wBAAwB,MAA2C;EACjE,EAAIE,CAAkB;CACxB;AACF,EACD"}
@@ -1,5 +1,5 @@
1
1
  import { CommonDbOutage } from '@gen-epix/api-commondb';
2
- import { CategorizedOutages } from '../../models/outage';
2
+ import { CategorizedOutages } from '../../models/outage.models';
3
3
  export type OutagesStore = OutagesStoreActions & OutagesStoreState;
4
4
  export interface OutagesStoreActions {
5
5
  setCategorizedOutages: (categorizedOutages: CategorizedOutages) => void;
@@ -4,4 +4,4 @@ import { TableStore } from './tableStore';
4
4
  export type TableStoreContextProviderProps<TData, TDataContext = null> = PropsWithChildren<{
5
5
  readonly store: StoreApi<TableStore<TData, TDataContext>>;
6
6
  }>;
7
- export declare const TableStoreContextProvider: <TData, TDataContext = null>(props: TableStoreContextProviderProps<TData, TDataContext>) => import("react").JSX.Element;
7
+ export declare const TableStoreContextProvider: <TData, TDataContext = null>(props: TableStoreContextProviderProps<TData, TDataContext>) => import('react').JSX.Element;
@@ -1,2 +1 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "../../_chunks/tableStore.js";
2
- export { a as TableStoreContext, r as TableStoreContextProvider, n as createTableStore, e as createTableStoreActions, i as createTableStoreInitialState, o as createTableStorePersistConfiguration, t as updateSearchParams, s as useTableStoreContext };
1
+ export { r as TableStoreContext, n as TableStoreContextProvider, i as createTableStore, a as createTableStoreActions, o as createTableStoreInitialState, s as createTableStorePersistConfiguration, c as updateSearchParams, t as useTableStoreContext } from "../../_chunks/tableStore.js";
@@ -1,8 +1,8 @@
1
1
  import { NavigateFunction } from 'react-router-dom';
2
2
  import { PersistOptions } from 'zustand/middleware';
3
3
  import { TableEvent, TableEventBus } from '../../classes/TableEventBus';
4
- import { FilterDimension, Filters, FilterValues } from '../../models/filter';
5
- import { TableColumn, TableColumnDimension, TableColumnVisualSettings, TableSortDirection } from '../../models/table';
4
+ import { FilterDimension, Filters, FilterValues } from '../../models/filter.models';
5
+ import { TableColumn, TableColumnDimension, TableColumnVisualSettings, TableSortDirection } from '../../models/table.models';
6
6
  export interface CreateTableStoreInitialStateKwArgs<TData, TDataContext = null> {
7
7
  defaultSortByField?: string;
8
8
  defaultSortDirection?: TableSortDirection;