@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.
- package/README.md +9 -10
- package/dist/@types/mui.d.ts +1 -1
- package/dist/_chunks/ApplicationFooter.js +49 -49
- package/dist/_chunks/ApplicationFooter.js.map +1 -1
- package/dist/_chunks/Breadcrumbs.js +23 -22
- package/dist/_chunks/Breadcrumbs.js.map +1 -1
- package/dist/_chunks/CrudPage.js +211 -210
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/GeoFilter.js.map +1 -1
- package/dist/_chunks/Notifications.js +67 -66
- package/dist/_chunks/Notifications.js.map +1 -1
- package/dist/_chunks/OutageList.js +30 -30
- package/dist/_chunks/OutageList.js.map +1 -1
- package/dist/_chunks/OutageUtil.js +2 -2
- package/dist/_chunks/OutageUtil.js.map +1 -1
- package/dist/_chunks/QueryClientProvider.js +1 -1
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +406 -117
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Reflect.js +642 -0
- package/dist/_chunks/Reflect.js.map +1 -0
- package/dist/_chunks/Table.js +572 -574
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +5 -5
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +1 -1
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +109 -107
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/UserManagerUtil.js +7 -15
- package/dist/_chunks/UserManagerUtil.js.map +1 -1
- package/dist/_chunks/_baseAssignValue.js.map +1 -1
- package/dist/_chunks/_baseFlatten.js +8 -8
- package/dist/_chunks/_baseFlatten.js.map +1 -1
- package/dist/_chunks/_baseUnset.js +299 -22
- package/dist/_chunks/_baseUnset.js.map +1 -1
- package/dist/_chunks/_cacheHas.js.map +1 -1
- package/dist/_chunks/_setToString.js.map +1 -1
- package/dist/_chunks/decorate.js +9 -0
- package/dist/_chunks/decorateParam.js +8 -0
- package/dist/_chunks/format.js.map +1 -1
- package/dist/_chunks/isArrayLike.js.map +1 -1
- package/dist/_chunks/isObject.js.map +1 -1
- package/dist/_chunks/isSymbol.js.map +1 -1
- package/dist/_chunks/middleware.js +1 -1
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/omit.js +39 -40
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +13 -17
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/tableStore.js +40 -54
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/toDate.js.map +1 -1
- package/dist/_chunks/useColumnsMenu.js +2 -2
- package/dist/_chunks/useColumnsMenu.js.map +1 -1
- package/dist/_chunks/useMutation.js +31 -30
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +5 -5
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -1
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +2 -2
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/TableEventBus/TableEventBus.d.ts +1 -1
- package/dist/classes/TableEventBus/index.js.map +1 -1
- package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
- package/dist/classes/containers/UiClientCommonContainer/UiClientCommonContainer.d.ts +5 -0
- package/dist/classes/containers/UiClientCommonContainer/index.d.ts +1 -0
- package/dist/classes/containers/UiClientCommonContainer/index.js +17 -0
- package/dist/classes/containers/UiClientCommonContainer/index.js.map +1 -0
- package/dist/classes/filters/BooleanFilter.d.ts +1 -1
- package/dist/classes/filters/DateFilter.d.ts +2 -2
- package/dist/classes/filters/GeoFilter.d.ts +2 -2
- package/dist/classes/filters/MultiSelectFilter.d.ts +2 -2
- package/dist/classes/filters/NumberRangeFilter.d.ts +1 -1
- package/dist/classes/filters/TextFilter.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +5 -3
- package/dist/classes/services/AuthenticationService/index.js +34 -661
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/AuthorizationService/AuthorizationService.d.ts +4 -4
- package/dist/classes/services/AuthorizationService/index.js +12 -10
- package/dist/classes/services/AuthorizationService/index.js.map +1 -1
- package/dist/classes/services/BackendVersionService/BackendVersionService.d.ts +0 -3
- package/dist/classes/services/BackendVersionService/index.js +5 -8
- package/dist/classes/services/BackendVersionService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/BreadcrumbService.d.ts +1 -3
- package/dist/classes/services/BreadcrumbService/index.js +19 -21
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/EmotionCacheService/EmotionCacheService.d.ts +4 -4
- package/dist/classes/services/EmotionCacheService/index.js +17 -14
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/classes/services/FeatureFlagsService/FeatureFlagsService.d.ts +0 -3
- package/dist/classes/services/FeatureFlagsService/index.js +5 -8
- package/dist/classes/services/FeatureFlagsService/index.js.map +1 -1
- package/dist/classes/services/I18nService/I18nService.d.ts +3 -3
- package/dist/classes/services/I18nService/index.js +25 -29
- package/dist/classes/services/I18nService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/InactivityService.d.ts +6 -3
- package/dist/classes/services/InactivityService/index.js +42 -36
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/LogService/LogService.d.ts +7 -4
- package/dist/classes/services/LogService/index.js +39 -32
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/NavigationHistoryService/NavigationHistoryService.d.ts +0 -3
- package/dist/classes/services/NavigationHistoryService/index.js +5 -8
- package/dist/classes/services/NavigationHistoryService/index.js.map +1 -1
- package/dist/classes/services/NotificationService/NotificationService.d.ts +4 -4
- package/dist/classes/services/NotificationService/index.js +21 -21
- package/dist/classes/services/NotificationService/index.js.map +1 -1
- package/dist/classes/services/PageEventBusService/PageEventBusService.d.ts +4 -3
- package/dist/classes/services/PageEventBusService/index.js +18 -15
- package/dist/classes/services/PageEventBusService/index.js.map +1 -1
- package/dist/classes/services/QueryClientService/QueryClientService.d.ts +6 -7
- package/dist/classes/services/QueryClientService/index.js +1 -2
- package/dist/classes/services/RouterService/RouterService.d.ts +6 -9
- package/dist/classes/services/RouterService/index.js +8 -12
- package/dist/classes/services/RouterService/index.js.map +1 -1
- package/dist/classes/services/UserSettingsService/UserSettingsService.d.ts +0 -3
- package/dist/classes/services/UserSettingsService/index.js +5 -8
- package/dist/classes/services/UserSettingsService/index.js.map +1 -1
- package/dist/components/app/App/App.d.ts +5 -1
- package/dist/components/app/App/index.js +31 -37
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/AppRouterProvider/AppRouterProvider.d.ts +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +50 -49
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +42 -41
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/AuthenticationWrapper.d.ts +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +68 -67
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
- package/dist/components/app/AuthorizationWrapper/index.js +33 -32
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/RouterRoot.d.ts +1 -1
- package/dist/components/app/RouterRoot/index.js +62 -61
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/index.js +38 -37
- package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
- package/dist/components/filters/BooleanFilterField/BooleanFilterField.d.ts +1 -1
- package/dist/components/filters/BooleanFilterField/index.js +5 -5
- package/dist/components/filters/BooleanFilterField/index.js.map +1 -1
- package/dist/components/filters/DateFilterField/DateFilterField.d.ts +1 -1
- package/dist/components/filters/DateFilterField/index.js +3 -3
- package/dist/components/filters/DateFilterField/index.js.map +1 -1
- package/dist/components/filters/GeoFilterField/GeoFilterField.d.ts +1 -1
- package/dist/components/filters/GeoFilterField/index.js +4 -4
- package/dist/components/filters/GeoFilterField/index.js.map +1 -1
- package/dist/components/filters/MultiSelectFilterField/MultiSelectFilterField.d.ts +1 -1
- package/dist/components/filters/MultiSelectFilterField/index.js +4 -4
- package/dist/components/filters/MultiSelectFilterField/index.js.map +1 -1
- package/dist/components/filters/NumberRangeFilterField/NumberRangeFilterField.d.ts +1 -1
- package/dist/components/filters/NumberRangeFilterField/index.js +3 -3
- package/dist/components/filters/NumberRangeFilterField/index.js.map +1 -1
- package/dist/components/filters/TextFilterField/TextFilterField.d.ts +1 -1
- package/dist/components/filters/TextFilterField/index.js +3 -3
- package/dist/components/filters/TextFilterField/index.js.map +1 -1
- package/dist/components/ui/ApplicationBar/ApplicationBar.d.ts +1 -1
- package/dist/components/ui/ApplicationBar/ApplicationBarActions.d.ts +1 -1
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsFeedbackItem.d.ts +1 -1
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsInfotem.d.ts +1 -1
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsNotificationsItem.d.ts +1 -1
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsOrganizationSwitcherItem.d.ts +1 -1
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsOutagesItem.d.ts +1 -1
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsUserItem.d.ts +1 -1
- package/dist/components/ui/ApplicationBar/ApplicationBarNavigationMenu.d.ts +1 -1
- package/dist/components/ui/ApplicationBar/UserOrganizationAdminMenuItem.d.ts +1 -1
- package/dist/components/ui/ApplicationBar/UserOwnOrganizationMenuItem.d.ts +1 -1
- package/dist/components/ui/ApplicationBar/index.js +242 -241
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/ApplicationFooter/ApplicationFooter.d.ts +1 -1
- package/dist/components/ui/ApplicationFooter/ApplicationFooterLink.d.ts +1 -1
- package/dist/components/ui/ApplicationFooter/ApplicationFooterLinkSection.d.ts +1 -1
- package/dist/components/ui/ApplicationFooter/index.js +1 -2
- package/dist/components/ui/Breadcrumbs/Breadcrumb.d.ts +1 -1
- package/dist/components/ui/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/components/ui/Breadcrumbs/index.js +1 -2
- package/dist/components/ui/ConsentDialog/index.js +11 -6
- package/dist/components/ui/ConsentDialog/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/GenericErrorMessage.d.ts +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +51 -50
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
- package/dist/components/ui/LicensesDialog/index.js +66 -69
- package/dist/components/ui/LicensesDialog/index.js.map +1 -1
- package/dist/components/ui/MyPermissionsDialog/index.js +26 -25
- package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -1
- package/dist/components/ui/NavLink/NavLink.d.ts +1 -1
- package/dist/components/ui/NavLink/index.js +6 -6
- package/dist/components/ui/NavLink/index.js.map +1 -1
- package/dist/components/ui/Notifications/NotificationItem.d.ts +2 -2
- package/dist/components/ui/Notifications/NotificationsDrawer.d.ts +1 -1
- package/dist/components/ui/Notifications/index.js +1 -2
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +69 -76
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/OutageList/OutageItem.d.ts +1 -1
- package/dist/components/ui/OutageList/OutageList.d.ts +1 -1
- package/dist/components/ui/OutageList/OutageSection.d.ts +1 -1
- package/dist/components/ui/OutageList/index.js +1 -2
- package/dist/components/ui/OutagesDialog/index.js.map +1 -1
- package/dist/components/ui/PageContainer/PageContainer.d.ts +1 -1
- package/dist/components/ui/PageContainer/index.js +57 -52
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/ResponseHandler/ResponseHandler.d.ts +1 -1
- package/dist/components/ui/ResponseHandler/index.js.map +1 -1
- package/dist/components/ui/Sidebar/SidebarItem.d.ts +2 -2
- package/dist/components/ui/Sidebar/SidebarMenu.d.ts +1 -1
- package/dist/components/ui/Sidebar/SidebarMenuItem.d.ts +2 -2
- package/dist/components/ui/Sidebar/index.js +45 -45
- package/dist/components/ui/Sidebar/index.js.map +1 -1
- package/dist/components/ui/SortableList/SortableList.d.ts +1 -1
- package/dist/components/ui/SortableList/SortableListItem.d.ts +1 -1
- package/dist/components/ui/SortableList/SortableListItemDragHandle.d.ts +1 -1
- package/dist/components/ui/SortableList/SortableOverlay.d.ts +1 -1
- package/dist/components/ui/SortableList/context/SortableListItemContextProvider.d.ts +1 -1
- package/dist/components/ui/Table/Table.d.ts +2 -2
- package/dist/components/ui/Table/TableActionsCell.d.ts +2 -2
- package/dist/components/ui/Table/TableCaption.d.ts +1 -1
- package/dist/components/ui/Table/TableCell.d.ts +2 -2
- package/dist/components/ui/Table/TableCellAsyncContent.d.ts +1 -1
- package/dist/components/ui/Table/TableCheckboxCell.d.ts +2 -2
- package/dist/components/ui/Table/TableCheckboxHeader.d.ts +2 -2
- package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +1 -1
- package/dist/components/ui/Table/TableFilter.d.ts +3 -3
- package/dist/components/ui/Table/TableFiltersSidebarItem.d.ts +2 -2
- package/dist/components/ui/Table/TableHeader.d.ts +1 -1
- package/dist/components/ui/Table/TableHeaderCell.d.ts +2 -2
- package/dist/components/ui/Table/TableHeaderFilter.d.ts +3 -3
- package/dist/components/ui/Table/TableMenu.d.ts +1 -1
- package/dist/components/ui/Table/TableReadableIndexCell.d.ts +2 -2
- package/dist/components/ui/Table/TableSidebarMenu.d.ts +1 -1
- package/dist/components/ui/Table/index.js +1 -2
- package/dist/components/ui/UserFeedbackDialog/index.js +65 -64
- package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -1
- package/dist/components/ui/UserInactivityConfirmation/UserInactivityConfirmation.d.ts +1 -1
- package/dist/components/ui/UserInactivityConfirmation/index.js +26 -25
- package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -1
- package/dist/constants/config.constants.d.ts +5 -0
- package/dist/constants/config.constants.js +6 -0
- package/dist/constants/config.constants.js.map +1 -0
- package/dist/constants/{query.js → query.constants.js} +2 -2
- package/dist/constants/query.constants.js.map +1 -0
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContext.d.ts +6 -2
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +3 -3
- package/dist/context/uiClientCommonConfigContext/index.js +28 -12
- package/dist/context/uiClientCommonConfigContext/index.js.map +1 -1
- package/dist/context/uiClientCommonConfigContext/useUiClientCommonConfigContext.d.ts +2 -1
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +17 -16
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/useIdentifierIssuerOwnOrganizationQuery.d.ts +1 -1
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +18 -17
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerQuery/useIdentifierIssuerQuery.d.ts +1 -1
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +11 -10
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +22 -21
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/useOrganizationAdminPoliciesQuery.d.ts +1 -1
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +8 -7
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationsQuery/index.js +17 -16
- package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationsQuery/useOrganizationsQuery.d.ts +1 -1
- package/dist/dataHooks/useUsersQuery/index.js +18 -17
- package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
- package/dist/dataHooks/useUsersQuery/useUsersQuery.d.ts +1 -1
- package/dist/hoc/withPermissions/index.js +12 -11
- package/dist/hoc/withPermissions/index.js.map +1 -1
- package/dist/hoc/withPermissions/withPermissions.d.ts +1 -1
- package/dist/hooks/useColumnsMenu/index.js +1 -2
- package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +2 -2
- package/dist/hooks/useConfig/index.d.ts +1 -0
- package/dist/hooks/useConfig/index.js +7 -0
- package/dist/hooks/useConfig/index.js.map +1 -0
- package/dist/hooks/useConfig/useConfig.d.ts +2 -0
- package/dist/hooks/useCreateMutation/index.js +25 -24
- package/dist/hooks/useCreateMutation/index.js.map +1 -1
- package/dist/hooks/useCreateMutation/useCreateMutation.d.ts +1 -1
- package/dist/hooks/useDeleteMutation/index.js +24 -23
- package/dist/hooks/useDeleteMutation/index.js.map +1 -1
- package/dist/hooks/useDeleteMutation/useDeleteMutation.d.ts +1 -1
- package/dist/hooks/useEditMutation/index.js +33 -32
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useEditMutation/useEditMutation.d.ts +1 -1
- package/dist/hooks/useInitializeTableStore/index.js.map +1 -1
- package/dist/hooks/useInitializeTableStore/useInitializeTableStore.d.ts +1 -1
- package/dist/hooks/useItemQuery/index.js +36 -35
- package/dist/hooks/useItemQuery/index.js.map +1 -1
- package/dist/hooks/useItemQuery/useItemQuery.d.ts +1 -1
- package/dist/hooks/useQueryMemo/index.js +1 -2
- package/dist/hooks/useUpdateBreadcrumb/index.js +10 -9
- package/dist/hooks/useUpdateBreadcrumb/index.js.map +1 -1
- package/dist/hooks/useUpdateDocumentTitle/index.js +4 -3
- package/dist/hooks/useUpdateDocumentTitle/index.js.map +1 -1
- package/dist/models/{admin.js → admin.models.js} +2 -2
- package/dist/models/admin.models.js.map +1 -0
- package/dist/models/api.models.d.ts +16 -0
- package/dist/models/api.models.js +6 -0
- package/dist/models/api.models.js.map +1 -0
- package/dist/models/{dataHooks.d.ts → data-hooks.models.d.ts} +1 -1
- package/dist/models/{table.d.ts → table.models.d.ts} +2 -2
- package/dist/models/{table.js → table.models.js} +2 -2
- package/dist/models/table.models.js.map +1 -0
- package/dist/pages/AcceptInvitationPage/AcceptInvitationPage.d.ts +1 -1
- package/dist/pages/AcceptInvitationPage/index.js +40 -39
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
- package/dist/pages/AdminPage/AdminPage.d.ts +1 -1
- package/dist/pages/AdminPage/index.js +39 -38
- package/dist/pages/AdminPage/index.js.map +1 -1
- package/dist/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.d.ts +2 -2
- package/dist/pages/ChooseIdentityProviderPage/index.js +38 -37
- package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -1
- package/dist/pages/CrudPage/CrudPage.d.ts +7 -7
- package/dist/pages/CrudPage/CrudPageDeleteDialog.d.ts +1 -1
- package/dist/pages/CrudPage/CrudPageEditDialog.d.ts +2 -2
- package/dist/pages/CrudPage/index.js +1 -2
- package/dist/pages/ErrorPage/ErrorPage.d.ts +1 -1
- package/dist/pages/ErrorPage/index.js.map +1 -1
- package/dist/pages/IdentifierIssuersAdminPage/IdentifierIssuersAdminPage.d.ts +1 -1
- package/dist/pages/IdentifierIssuersAdminPage/index.js +41 -40
- package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/OrganizationAdminPoliciesAdminPage.d.ts +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +58 -57
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationContactsAdminPage/OrganizationContactsAdminPage.d.ts +1 -1
- package/dist/pages/OrganizationContactsAdminPage/index.js +49 -48
- package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationSitesAdminPage/OrganizationSitesAdminPage.d.ts +1 -1
- package/dist/pages/OrganizationSitesAdminPage/index.js +44 -43
- package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationsAdminPage/OrganizationsAdminPage.d.ts +1 -1
- package/dist/pages/OrganizationsAdminPage/index.js +57 -56
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/OutagesAdminPage.d.ts +1 -1
- package/dist/pages/OutagesAdminPage/index.js +63 -62
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/PostLoginPage/PostLoginPage.d.ts +1 -1
- package/dist/pages/PostLoginPage/index.js +14 -13
- package/dist/pages/PostLoginPage/index.js.map +1 -1
- package/dist/pages/PostLogoutPage/PostLogoutPage.d.ts +1 -1
- package/dist/pages/PostLogoutPage/index.js +19 -18
- package/dist/pages/PostLogoutPage/index.js.map +1 -1
- package/dist/pages/RouterErrorPage/RouterErrorPage.d.ts +1 -1
- package/dist/pages/RouterErrorPage/index.js.map +1 -1
- package/dist/pages/UserInvitationsAdminPage/UserInvitationsAdminPage.d.ts +1 -1
- package/dist/pages/UserInvitationsAdminPage/index.js +1 -2
- package/dist/pages/UsersAdminPage/UsersAdminPage.d.ts +2 -2
- package/dist/pages/UsersAdminPage/index.js +110 -109
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/routes/adminRoutes.d.ts +1 -1
- package/dist/routes/index.js +1 -1
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/routes.d.ts +1 -1
- package/dist/setup/setup.js.map +1 -1
- package/dist/stores/oidcStore/index.js.map +1 -1
- package/dist/stores/outagesStore/index.js.map +1 -1
- package/dist/stores/outagesStore/outagesStore.d.ts +1 -1
- package/dist/stores/tableStore/TableStoreContextProvider.d.ts +1 -1
- package/dist/stores/tableStore/index.js +1 -2
- package/dist/stores/tableStore/tableStore.d.ts +2 -2
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/AxiosUtil/index.js.map +1 -1
- package/dist/utils/DataHookUtil/DataHookUtil.d.ts +1 -1
- package/dist/utils/DataHookUtil/index.js.map +1 -1
- package/dist/utils/LoadableUtil/LoadableUtil.d.ts +1 -1
- package/dist/utils/LoadableUtil/index.js.map +1 -1
- package/dist/utils/MenuDataUtil/MenuDataUtil.d.ts +1 -1
- package/dist/utils/MenuDataUtil/index.js.map +1 -1
- package/dist/utils/NotificationUtil/index.js.map +1 -1
- package/dist/utils/OutageUtil/OutageUtil.d.ts +1 -1
- package/dist/utils/OutageUtil/index.js +1 -2
- package/dist/utils/StandardConfigUtil/StandardConfigUtil.d.ts +1 -1
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/dist/utils/TableUtil/TableUtil.d.ts +4 -4
- package/dist/utils/TableUtil/index.js +1 -2
- package/dist/utils/TimeUtil/index.js.map +1 -1
- package/dist/utils/UserManagerUtil/index.js +1 -2
- package/dist/utils/UserUtil/index.js.map +1 -1
- package/package.json +93 -87
- package/dist/_chunks/_baseGet.js +0 -280
- package/dist/_chunks/_baseGet.js.map +0 -1
- package/dist/_chunks/_baseIteratee.js +0 -274
- package/dist/_chunks/_baseIteratee.js.map +0 -1
- package/dist/_chunks/last.js +0 -13
- package/dist/_chunks/last.js.map +0 -1
- package/dist/_chunks/uniq.js +0 -44
- package/dist/_chunks/uniq.js.map +0 -1
- package/dist/classes/services/ApiService/ApiService.d.ts +0 -19
- package/dist/classes/services/ApiService/index.d.ts +0 -1
- package/dist/classes/services/ApiService/index.js +0 -21
- package/dist/classes/services/ApiService/index.js.map +0 -1
- package/dist/classes/services/ConfigService/ConfigService.d.ts +0 -9
- package/dist/classes/services/ConfigService/index.d.ts +0 -1
- package/dist/classes/services/ConfigService/index.js +0 -21
- package/dist/classes/services/ConfigService/index.js.map +0 -1
- package/dist/constants/query.js.map +0 -1
- package/dist/models/admin.js.map +0 -1
- package/dist/models/api.d.ts +0 -9
- package/dist/models/table.js.map +0 -1
- package/dist/models/theme.js +0 -0
- /package/dist/constants/{query.d.ts → query.constants.d.ts} +0 -0
- /package/dist/models/{admin.d.ts → admin.models.d.ts} +0 -0
- /package/dist/models/{auth.d.ts → auth.models.d.ts} +0 -0
- /package/dist/models/{api.js → auth.models.js} +0 -0
- /package/dist/models/{config.d.ts → config.models.d.ts} +0 -0
- /package/dist/models/{auth.js → config.models.js} +0 -0
- /package/dist/models/{config.js → data-hooks.models.js} +0 -0
- /package/dist/models/{data.d.ts → data.models.d.ts} +0 -0
- /package/dist/models/{data.js → data.models.js} +0 -0
- /package/dist/models/{filter.d.ts → filter.models.d.ts} +0 -0
- /package/dist/models/{dataHooks.js → filter.models.js} +0 -0
- /package/dist/models/{notification.d.ts → notification.models.d.ts} +0 -0
- /package/dist/models/{filter.js → notification.models.js} +0 -0
- /package/dist/models/{outage.d.ts → outage.models.d.ts} +0 -0
- /package/dist/models/{notification.js → outage.models.js} +0 -0
- /package/dist/models/{reactRouter.d.ts → react-router.models.d.ts} +0 -0
- /package/dist/models/{outage.js → react-router.models.js} +0 -0
- /package/dist/models/{theme.d.ts → theme.models.d.ts} +0 -0
- /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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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 {
|
|
12
|
-
import { useCallback as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import A from "@
|
|
21
|
-
import
|
|
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
|
|
24
|
-
let { t:
|
|
25
|
-
let
|
|
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) =>
|
|
28
|
+
e.roles.forEach((e) => t.add(e));
|
|
28
29
|
});
|
|
29
|
-
let
|
|
30
|
+
let n = Array.from(t).map((e) => ({
|
|
30
31
|
label: e,
|
|
31
32
|
value: e
|
|
32
33
|
}));
|
|
33
|
-
|
|
34
|
+
z(n);
|
|
34
35
|
let i;
|
|
35
|
-
i =
|
|
36
|
+
i = d.resolve(r).doesUserHavePermission([{
|
|
36
37
|
command_name: l.RetrieveInviteUserConstraintsCommand,
|
|
37
38
|
permission_type: u.EXECUTE
|
|
38
|
-
}]) &&
|
|
39
|
+
}]) && L?.data ? L.data.roles.map((e) => ({
|
|
39
40
|
label: e,
|
|
40
41
|
value: e
|
|
41
|
-
})) :
|
|
42
|
-
let a =
|
|
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
|
-
}))),
|
|
48
|
-
}, [
|
|
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, []),
|
|
53
|
-
description:
|
|
54
|
-
email:
|
|
55
|
-
is_active:
|
|
56
|
-
key:
|
|
57
|
-
name:
|
|
58
|
-
roles:
|
|
59
|
-
}), []),
|
|
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:
|
|
62
|
+
definition: O.TEXTFIELD,
|
|
62
63
|
disabled: !0,
|
|
63
|
-
label:
|
|
64
|
+
label: P`Key`,
|
|
64
65
|
name: "key"
|
|
65
66
|
},
|
|
66
67
|
{
|
|
67
|
-
definition:
|
|
68
|
-
label:
|
|
68
|
+
definition: O.TEXTFIELD,
|
|
69
|
+
label: P`Email`,
|
|
69
70
|
name: "email"
|
|
70
71
|
},
|
|
71
72
|
{
|
|
72
|
-
definition:
|
|
73
|
-
label:
|
|
73
|
+
definition: O.TEXTFIELD,
|
|
74
|
+
label: P`Name`,
|
|
74
75
|
name: "name"
|
|
75
76
|
},
|
|
76
77
|
{
|
|
77
|
-
definition:
|
|
78
|
-
label:
|
|
79
|
-
loading:
|
|
78
|
+
definition: O.AUTOCOMPLETE,
|
|
79
|
+
label: P`Roles`,
|
|
80
|
+
loading: L.isLoading,
|
|
80
81
|
multiple: !0,
|
|
81
82
|
name: "roles",
|
|
82
|
-
options:
|
|
83
|
+
options: B
|
|
83
84
|
},
|
|
84
85
|
{
|
|
85
|
-
definition:
|
|
86
|
-
label:
|
|
86
|
+
definition: O.BOOLEAN,
|
|
87
|
+
label: P`Is active`,
|
|
87
88
|
name: "is_active"
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
|
-
definition:
|
|
91
|
-
label:
|
|
91
|
+
definition: O.TEXTFIELD,
|
|
92
|
+
label: P`Description`,
|
|
92
93
|
name: "description"
|
|
93
94
|
}
|
|
94
95
|
], [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
]),
|
|
96
|
+
P,
|
|
97
|
+
B,
|
|
98
|
+
L.isLoading
|
|
99
|
+
]), $ = p(() => [
|
|
99
100
|
e.createOptionsColumn({
|
|
100
101
|
id: "organization_id",
|
|
101
|
-
name:
|
|
102
|
-
options:
|
|
102
|
+
name: P`Organization`,
|
|
103
|
+
options: I.options
|
|
103
104
|
}),
|
|
104
105
|
e.createTextColumn({
|
|
105
106
|
id: "key",
|
|
106
|
-
name:
|
|
107
|
+
name: P`Key`
|
|
107
108
|
}),
|
|
108
109
|
e.createTextColumn({
|
|
109
110
|
id: "email",
|
|
110
|
-
name:
|
|
111
|
+
name: P`E-Mail`
|
|
111
112
|
}),
|
|
112
113
|
e.createTextColumn({
|
|
113
114
|
advancedSort: !0,
|
|
114
115
|
id: "name",
|
|
115
|
-
name:
|
|
116
|
+
name: P`Name`
|
|
116
117
|
}),
|
|
117
118
|
e.createTextColumn({
|
|
118
119
|
id: "description",
|
|
119
|
-
name:
|
|
120
|
+
name: P`Description`
|
|
120
121
|
}),
|
|
121
122
|
e.createOptionsColumn({
|
|
122
123
|
id: "roles",
|
|
123
|
-
name:
|
|
124
|
-
options:
|
|
124
|
+
name: P`Roles`,
|
|
125
|
+
options: R
|
|
125
126
|
}),
|
|
126
127
|
e.createBooleanColumn({
|
|
127
128
|
id: "is_active",
|
|
128
|
-
name:
|
|
129
|
+
name: P`Is active`
|
|
129
130
|
})
|
|
130
131
|
], [
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
]),
|
|
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
|
-
}), []),
|
|
143
|
+
}), []), te = p(() => [{
|
|
143
144
|
command_name: l.UpdateUserCommand,
|
|
144
145
|
permission_type: u.EXECUTE
|
|
145
|
-
}], []),
|
|
146
|
+
}], []), ne = p(() => [{
|
|
146
147
|
command_name: l.UserCrudCommand,
|
|
147
148
|
permission_type: u.DELETE
|
|
148
|
-
}], []),
|
|
149
|
-
let e =
|
|
149
|
+
}], []), re = f(async () => {
|
|
150
|
+
let e = H.current?.email ?? H.current?.key, r = d.resolve(i).showNotification({
|
|
150
151
|
isLoading: !0,
|
|
151
|
-
message:
|
|
152
|
+
message: P("Anonymizing user: {{userName}}", { userName: e }),
|
|
152
153
|
severity: "info"
|
|
153
154
|
});
|
|
154
155
|
try {
|
|
155
|
-
await
|
|
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
|
-
|
|
158
|
+
d.resolve(i).fulfillNotification(r, P("Error anonymizing user: {{userName}}", { userName: e }), "error");
|
|
158
159
|
}
|
|
159
|
-
}, [
|
|
160
|
-
let
|
|
161
|
-
return
|
|
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
|
-
}]) &&
|
|
165
|
+
}]) && t.push(/* @__PURE__ */ v(x, {
|
|
165
166
|
onClick: () => {
|
|
166
|
-
|
|
167
|
+
H.current = e.row, F.current.open();
|
|
167
168
|
},
|
|
168
|
-
children: [/* @__PURE__ */ y
|
|
169
|
-
}, "custom-action-1")),
|
|
170
|
-
}, [
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
-
canEditItem:
|
|
173
|
-
createItemDialogTitle:
|
|
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:
|
|
177
|
-
extraActionsFactory:
|
|
178
|
-
extraDeleteOnePermissions:
|
|
179
|
-
extraUpdateOnePermissions:
|
|
180
|
-
fetchAll:
|
|
181
|
-
formFieldDefinitions:
|
|
182
|
-
getName:
|
|
183
|
-
getOptimisticUpdateIntermediateItem:
|
|
184
|
-
itemName:
|
|
185
|
-
loadables:
|
|
186
|
-
onRowsChange:
|
|
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:
|
|
189
|
-
subPages:
|
|
190
|
-
tableColumns:
|
|
191
|
-
testIdAttributes:
|
|
192
|
-
title:
|
|
193
|
-
updateOne:
|
|
194
|
-
}), /* @__PURE__ */
|
|
195
|
-
body:
|
|
196
|
-
cancelLabel:
|
|
197
|
-
confirmLabel:
|
|
198
|
-
onConfirm:
|
|
199
|
-
ref:
|
|
200
|
-
title:
|
|
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 {
|
|
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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,CAC5G,CAAC,KACC,EAAU,KACR,kBAAC,GAAD;GAGE,eAAe;IAEb,AADA,EAAgB,UAAU,EAAO,KACjC,EAA6B,QAAQ,KAAK;GAC5C;GANF,UAAA,CAQE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAe,UAAU,QAAU,CAAA,EACvB,CAAA,GACd,kBAAC,GAAD,EAAA,UACG,CAAC,iBACU,CAAA,CACN;EAbH,GAAA,iBAaG,CACZ,GAGK;CACT,GAAG,CAAC,CAAC,CAAC;CAEN,OACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;EACe;EACb,uBAAuB,CAAC;EACxB,oBAAoB;EACpB,sBAAsB;EACX;EACU;EACM;EACA;EACjB;EACY;EACb;EAC4B;EACrC,UAAU,CAAC;EACA;EACG;EACd,sBAAsB,EAAiB;EAC/B;EACE;EACI;EACd,kBAAkB,EAAW,iBAAiB,gBAAgB;EAC9D,OAAO,CAAC;EACG;CACZ,CAAA,GACD,kBAAC,GAAD;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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8DA,IAAaM,KAAkB,EAC7B,kBACyB;CACzB,IAAM,EAAE,SAAMC,EAAe,GACvBC,IAA+BC,EAA+B,IAAI,GAClEC,IAA2BC,EAA4B,GACvDC,IAA6BC,EAA8B,GAC3D,CAACC,GAAkBC,KAAuBC,EAA+B,CAAC,CAAC,GAC3E,CAACC,GAAiBC,KAAsBF,EAA+B,CAAC,CAAC,GACzEG,IAAkBV,EAA4B,IAAI,GAElDW,IAAYC,EAAS,CACzBX,GACAE,CACF,CAAC,GAEKU,IAAYtB,EAAc,QAAQwB,CAAoB,CAAC,CAAC,KAAK,OAE7DC,IAAeC,GAAa,MAA0B;EAG1D,IAAMC,oBAAQ,IAAI,IAAY;EAC9B,EAAM,SAAS,MAAS;GACtB,EAAK,MAAM,SAAS,MAASA,EAAM,IAAIC,CAAI,CAAC;EAC9C,CAAC;EACD,IAAMC,IAAoB,MAAM,KAAKF,CAAK,CA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sBtC,GAAa,MAA+C;EACtF,IAAMuC,IAA4B,CAAC;EAwBnC,OAtBIjE,EAAc,QAAQwB,CAAoB,CAAC,CAAC,uBAAuB,CACrE;GAAE,cAAcO,EAAoB;GAAsB,iBAAiBC,EAAuB;EAAQ,CAC5G,CAAC,KACCiC,EAAU,KACR,kBAACC,GAAD;GAGE,eAAe;IAEb,AADA,EAAgB,UAAUC,EAAO,KACjC3D,EAA6B,QAAQ,KAAK;GAC5C;GANF,UAAA,CAQE,kBAAC4D,GAAD,EAAA,UACE,kBAAC/D,GAAD,EAAe,UAAU,QAAU,CAAA,EACvB,CAAA,GACd,kBAACgE,GAAD,EAAA,UACG,CAAC,iBACU,CAAA,CACN;EAbH,GAAA,iBAaG,CACZ,GAGKJ;CACT,GAAG,CAACb,CAAC,CAAC;CAEN,OACE,kBAAAnD,GAAA,EAAA,UAAA,CACE,kBAACE,GAAD;EACe;EACb,uBAAuB,CAAC;EACxB,oBAAoB;EACpB,sBAAsB;EACX;EACU;EACM;EACA;EACjB;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/
|
|
3
|
+
import { MyNonIndexRouteObject } from '../models/react-router.models';
|
|
4
4
|
type CreateAdminRoutesOptions<TExtraPermission = never> = {
|
|
5
5
|
usersComponent?: ComponentType;
|
|
6
6
|
usersRouteChildren?: MyNonIndexRouteObject<CommonDbApiPermission | TExtraPermission>[];
|
package/dist/routes/index.js
CHANGED
|
@@ -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";
|
package/dist/routes/index.js.map
CHANGED
|
@@ -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;IAC9B,qBAAqB,CACnB;KAAE,cAAc,EAAoB;KAAyB,iBAAiB,EAAuB;IAAK,CAC5G;IACA,qBAAqB;IACrB,UAAU,CAAC;IACX,OAAO,CAAC;GACV;GACA,OAAO;GACP,MAAM;EACR,GACA;GACE,UAAU,CACR;IACE,WAAW;IACX,cAAc,kBAAC,GAAD,CAAkB,CAAA;IAChC,QAAQ;KACN,qBAAqB,CACnB;MAAE,cAAc,EAAoB;MAAiB,iBAAiB,EAAuB;KAAK,CACpG;KACA,qBAAqB;KACrB,OAAO,CAAC;IACV;IACA,OAAO;IACP,MAAM;GACR,GACA;IACE,WAAW;IACX,cAAc,kBAAC,GAAD,CAAkB,CAAA;IAChC,QAAQ;KACN,qBAAqB,CACn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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;IAC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
import { CommonDbApiPermission } from '@gen-epix/api-commondb';
|
|
2
|
-
import { MyIndexRouteObject, MyNonIndexRouteObject } from '../models/
|
|
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>>;
|
package/dist/setup/setup.js.map
CHANGED
|
@@ -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,
|
|
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,
|
|
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,
|
|
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(
|
|
7
|
+
export declare const TableStoreContextProvider: <TData, TDataContext = null>(props: TableStoreContextProviderProps<TData, TDataContext>) => import('react').JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
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;
|