@gen-epix/ui-client-common 4.1.0 → 4.3.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/dist/_chunks/Breadcrumbs.js +1 -1
- package/dist/_chunks/CrudPage.js +183 -183
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/QueryClientProvider.js +1 -1
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +3 -3
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +622 -603
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +97 -97
- package/dist/_chunks/{chunk-BV7QT456.js → chunk-OB3PAWPO.js} +4 -4
- package/dist/_chunks/chunk-OB3PAWPO.js.map +1 -0
- package/dist/_chunks/middleware.js +1 -1
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/query.js +13 -11
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react-oidc-context.js +1 -1
- package/dist/_chunks/react-oidc-context.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/useColumnsMenu.js +2 -2
- package/dist/_chunks/useColumnsMenu.js.map +1 -1
- package/dist/_chunks/useMutation.js +2 -2
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +7 -7
- 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 +23 -23
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/RouterService/RouterService.d.ts +15 -6
- package/dist/classes/services/RouterService/index.js +28 -8
- package/dist/classes/services/RouterService/index.js.map +1 -1
- package/dist/components/app/App/index.js +40 -39
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/AppRouterProvider/AppRouterProvider.d.ts +1 -0
- package/dist/components/app/ApplicationBootstrapWithAuthentication/ApplicationBootstrapWithAuthentication.d.ts +2 -0
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.d.ts +1 -0
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +81 -0
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -0
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/ApplicationBootstrapWithoutAuthorization.d.ts +2 -0
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.d.ts +1 -0
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +63 -0
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -0
- package/dist/components/app/AuthorizationWrapper/index.js +1 -1
- package/dist/components/app/RouterRoot/index.js +2 -2
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/ui/ApplicationBar/index.js +164 -148
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +1 -1
- package/dist/components/ui/NavLink/index.js +1 -1
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +31 -31
- package/dist/components/ui/UserFeedbackDialog/index.js +35 -35
- package/dist/pages/AcceptInvitationPage/index.js +1 -1
- package/dist/pages/AdminPage/index.js +1 -1
- package/dist/pages/OrganizationContactsAdminPage/index.js +1 -1
- package/dist/pages/OrganizationSitesAdminPage/index.js +1 -1
- package/dist/pages/RouterErrorPage/index.js +1 -1
- package/package.json +77 -72
- package/dist/_chunks/chunk-BV7QT456.js.map +0 -1
- package/dist/_chunks/index.esm.js +0 -1284
- package/dist/_chunks/index.esm.js.map +0 -1
- package/dist/components/app/ApplicationBootstrap/ApplicationBootstrap.d.ts +0 -2
- package/dist/components/app/ApplicationBootstrap/index.d.ts +0 -1
- package/dist/components/app/ApplicationBootstrap/index.js +0 -135
- package/dist/components/app/ApplicationBootstrap/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/app/ApplicationBootstrap/ApplicationBootstrap.tsx"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type {\n PropsWithChildren,\n ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useStore } from 'zustand';\nimport {\n Box,\n Button,\n} from '@mui/material';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport type { ConfirmationRefMethods } from '@gen-epix/ui-core-components/components/Confirmation';\nimport { Confirmation } from '@gen-epix/ui-core-components/components/Confirmation';\nimport { Spinner } from '@gen-epix/ui-core-components/components/Spinner';\n\nimport { useQueryMemo } from '../../../hooks/useQueryMemo';\nimport { outagesStore } from '../../../stores/outagesStore';\nimport { OutageUtil } from '../../../utils/OutageUtil';\nimport { FeatureFlagsService } from '../../../classes/services/FeatureFlagsService';\nimport { I18nService } from '../../../classes/services/I18nService';\nimport { QueryClientService } from '../../../classes/services/QueryClientService';\nimport { OutageList } from '../../ui/OutageList';\nimport { PageContainer } from '../../ui/PageContainer';\nimport { ResponseHandler } from '../../ui/ResponseHandler';\nimport { COMMON_QUERY_KEY } from '../../../constants/query';\nimport { ApiService } from '../../../classes/services/ApiService';\n\n\nexport const ApplicationBootstrap = ({ children }: PropsWithChildren): ReactNode => {\n const { t } = useTranslation();\n\n const setCategorizedOutages = useStore(outagesStore, (state) => state.setCategorizedOutages);\n const [shouldContinue, setShouldContinue] = useState(false);\n const [buttonsEnabled, setButtonsEnabled] = useState(false);\n const confirmationRef = useRef<ConfirmationRefMethods>(null);\n const newLanguageCodeRef = useRef<string>(null);\n const [isLanguageChanging, setIsLanguageChanging] = useState(false);\n\n useEffect(() => {\n const i18nService = I18nService.getInstance();\n const callback = (code: string) => {\n newLanguageCodeRef.current = code;\n confirmationRef.current?.open();\n };\n i18nService.addEventListener('onUserLanguageChange', callback);\n return () => {\n i18nService.removeEventListener('onUserLanguageChange', callback);\n };\n }, []);\n\n const outagesQuery = useQueryMemo({\n gcTime: Infinity,\n queryFn: async ({ signal }) => (await ApiService.getInstance().systemApi.retrieveOutages({ signal })).data,\n queryKey: QueryClientService.getInstance().getGenericKey(COMMON_QUERY_KEY.OUTAGES),\n refetchInterval: 5 * 60 * 1000,\n staleTime: Infinity,\n });\n\n const outagesLoadables = useArray([outagesQuery]);\n\n const categorizedOutages = useMemo(() => {\n return OutageUtil.getCategorizedOutages(outagesQuery.data ?? []);\n }, [outagesQuery.data]);\n\n const onRetryButtonClick = useCallback(() => {\n WindowService.getInstance().window.location.reload();\n }, []);\n\n const onContinuButtonClick = useCallback(() => {\n setShouldContinue(true);\n }, []);\n\n const onLanguageChangeConfirm = useCallback(async () => {\n if (newLanguageCodeRef.current) {\n setIsLanguageChanging(true);\n await I18nService.getInstance().switchLanguageConfig(newLanguageCodeRef.current);\n WindowService.getInstance().window.location.reload();\n }\n }, []);\n\n useEffect(() => {\n if (categorizedOutages) {\n setCategorizedOutages(categorizedOutages);\n }\n\n const timeout = WindowService.getInstance().window.setTimeout(() => {\n setButtonsEnabled(true);\n }, 5000);\n\n return () => {\n WindowService.getInstance().window.clearTimeout(timeout);\n };\n }, [categorizedOutages, setCategorizedOutages]);\n\n const shouldShowChildren = shouldContinue || (!outagesQuery.isLoading && !outagesQuery.error && categorizedOutages.activeOutages?.length === 0);\n const shouldShowOutagePage = !shouldContinue && !outagesQuery.isLoading && !outagesQuery.error && categorizedOutages.activeOutages?.length > 0;\n\n const featureFlagsQuery = useQueryMemo({\n enabled: shouldShowChildren,\n gcTime: Infinity,\n queryFn: async ({ signal }) => (await ApiService.getInstance().systemApi.retrieveFeatureFlags({ signal })).data,\n queryKey: QueryClientService.getInstance().getGenericKey(COMMON_QUERY_KEY.FEATURE_FLAGS),\n staleTime: Infinity,\n });\n\n const featureFlagsLoadables = useArray([featureFlagsQuery]);\n\n useEffect(() => {\n if (featureFlagsQuery.data) {\n FeatureFlagsService.getInstance().featureFlags = featureFlagsQuery.data.feature_flags;\n }\n }, [featureFlagsQuery.data]);\n\n if (featureFlagsQuery.error) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('FeatureFlagsErrorPage')}\n title={t`Error`}\n >\n <ResponseHandler\n loadables={featureFlagsLoadables}\n loadingMessage={t`Loading`}\n >\n {children}\n </ResponseHandler>\n </PageContainer>\n );\n }\n\n if (isLanguageChanging) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('LanguageChangingPage')}\n title={t`Changing language`}\n >\n <Spinner\n inline\n label={t`Changing language...`}\n />\n </PageContainer>\n );\n }\n\n\n if (shouldShowChildren) {\n return (\n <ResponseHandler\n loadables={featureFlagsLoadables}\n loadingMessage={t`Loading`}\n >\n {children}\n <Confirmation\n body={t`Changing language will reload the application. Do you want to continue?`}\n cancelLabel={t`Cancel`}\n confirmLabel={t`Change language`}\n maxWidth={'xs'}\n onConfirm={onLanguageChangeConfirm}\n ref={confirmationRef}\n title={t`Are you sure?`}\n />\n </ResponseHandler>\n );\n }\n\n if (shouldShowOutagePage) {\n return (\n <PageContainer\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('OutagePage')}\n title={t`Outages`}\n >\n <OutageList\n activeOutages={categorizedOutages.activeOutages}\n soonActiveOutages={categorizedOutages.soonActiveOutages}\n visibleOutages={categorizedOutages.visibleOutages}\n />\n <Box\n sx={{\n display: 'flex',\n gap: 1,\n justifyContent: 'flex-end',\n }}\n >\n <Button\n disabled={!buttonsEnabled}\n onClick={onContinuButtonClick}\n variant={'outlined'}\n >\n {t`Continue anyway`}\n </Button>\n <Button\n disabled={!buttonsEnabled}\n onClick={onRetryButtonClick}\n variant={'contained'}\n >\n {t`Retry`}\n </Button>\n </Box>\n </PageContainer>\n );\n }\n\n return (\n <PageContainer\n ignorePageEvent\n singleAction\n testIdAttributes={TestIdUtil.createAttributes('OutagesLoadingPage')}\n title={t`Outages`}\n >\n <ResponseHandler\n loadables={outagesLoadables}\n loadingMessage={t`Loading`}\n >\n {children}\n </ResponseHandler>\n </PageContainer>\n );\n\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqCA,IAAa,KAAwB,EAAE,kBAA6C;CAClF,IAAM,EAAE,SAAM,EAAe,GAEvB,IAAwB,EAAS,IAAe,MAAU,EAAM,qBAAqB,GACrF,CAAC,GAAgB,KAAqB,EAAS,EAAK,GACpD,CAAC,GAAgB,KAAqB,EAAS,EAAK,GACpD,IAAkB,EAA+B,IAAI,GACrD,IAAqB,EAAe,IAAI,GACxC,CAAC,GAAoB,KAAyB,EAAS,EAAK;CAElE,QAAgB;EACd,IAAM,IAAc,EAAY,YAAY,GACtC,KAAY,MAAiB;GAEjC,AADA,EAAmB,UAAU,GAC7B,EAAgB,SAAS,KAAK;EAChC;EAEA,OADA,EAAY,iBAAiB,wBAAwB,CAAQ,SAChD;GACX,EAAY,oBAAoB,wBAAwB,CAAQ;EAClE;CACF,GAAG,CAAC,CAAC;CAEL,IAAM,IAAe,EAAa;EAChC,QAAQ;EACR,SAAS,OAAO,EAAE,iBAAc,MAAM,EAAW,YAAY,CAAC,CAAC,UAAU,gBAAgB,EAAE,UAAO,CAAC,EAAA,CAAG;EACtG,UAAU,EAAmB,YAAY,CAAC,CAAC,cAAc,EAAiB,OAAO;EACjF,iBAAiB;EACjB,WAAW;CACb,CAAC,GAEK,IAAmB,EAAS,CAAC,CAAY,CAAC,GAE1C,IAAqB,QAClB,EAAW,sBAAsB,EAAa,QAAQ,CAAC,CAAC,GAC9D,CAAC,EAAa,IAAI,CAAC,GAEhB,IAAqB,QAAkB;EAC3C,EAAc,YAAY,CAAC,CAAC,OAAO,SAAS,OAAO;CACrD,GAAG,CAAC,CAAC,GAEC,IAAuB,QAAkB;EAC7C,EAAkB,EAAI;CACxB,GA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