diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AppContainer/AppContainer.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AppContainer/AppContainer.tsx index 306abec4791..6240871902b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AppContainer/AppContainer.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AppContainer/AppContainer.tsx @@ -19,6 +19,7 @@ import { Redirect, Route, Switch } from 'react-router-dom'; import { ROUTES } from '../../constants/constants'; import { useApplicationStore } from '../../hooks/useApplicationStore'; import { useDomainStore } from '../../hooks/useDomainStore'; +import PageNotFound from '../../pages/PageNotFound/PageNotFound'; import SignUpPage from '../../pages/SignUp/SignUpPage'; import applicationRoutesClass from '../../utils/ApplicationRoutesClassBase'; import Appbar from '../AppBar/Appbar'; @@ -46,6 +47,8 @@ const AppContainer = () => { {!isEmpty(currentUser) && } + {/* Do not move this route as we don't want to render the sidebar and header in 404 page */} + import('../../pages/PageNotFound/PageNotFound')) -); const AppRouter = () => { const location = useLocation(); @@ -70,12 +64,7 @@ const AppRouter = () => { return () => targetNode.removeEventListener('click', handleClickEvent); }, [handleClickEvent]); - return ( - - {isAuthenticated ? : } - - - ); + return isAuthenticated ? : ; }; export default AppRouter; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/AuthenticatedAppRouter.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/AuthenticatedAppRouter.tsx index 9d463d06fcc..b7b02f68bce 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/AuthenticatedAppRouter.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/AuthenticatedAppRouter.tsx @@ -224,10 +224,6 @@ const AddQueryPage = withSuspenseFallback( React.lazy(() => import('../../pages/AddQueryPage/AddQueryPage.component')) ); -const PageNotFound = withSuspenseFallback( - React.lazy(() => import('../../pages/PageNotFound/PageNotFound')) -); - const IncidentManagerPage = withSuspenseFallback( React.lazy(() => import('../../pages/IncidentManager/IncidentManagerPage')) ); @@ -508,7 +504,7 @@ const AuthenticatedAppRouter: FunctionComponent = () => { ]}> - + ); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/UnAuthenticatedAppRouter.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/UnAuthenticatedAppRouter.tsx index e80c6db01d0..b5aff0d81cf 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/UnAuthenticatedAppRouter.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AppRouter/UnAuthenticatedAppRouter.tsx @@ -16,6 +16,7 @@ import { Redirect, Route, Switch } from 'react-router-dom'; import { ROUTES } from '../../constants/constants'; import { AuthProvider } from '../../generated/configuration/authenticationConfiguration'; import { useApplicationStore } from '../../hooks/useApplicationStore'; +import PageNotFound from '../../pages/PageNotFound/PageNotFound'; import SamlCallback from '../../pages/SamlCallback'; import AccountActivationConfirmation from '../../pages/SignUp/account-activation-confirmation.component'; import { isProtectedRoute } from '../../utils/AuthProvider.util'; @@ -83,6 +84,9 @@ export const UnAuthenticatedAppRouter = () => { )} + {/* keep this route before any conditional JSX.Element rendering */} + + {isBasicAuthProvider && ( <> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Auth/AppAuthenticators/OidcAuthenticator.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Auth/AppAuthenticators/OidcAuthenticator.tsx index 879f354ed53..bb1d7436c92 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Auth/AppAuthenticators/OidcAuthenticator.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Auth/AppAuthenticators/OidcAuthenticator.tsx @@ -26,7 +26,6 @@ import { Redirect, Route, Switch, useHistory } from 'react-router-dom'; import { ROUTES } from '../../../constants/constants'; import { useApplicationStore } from '../../../hooks/useApplicationStore'; import SignInPage from '../../../pages/LoginPage/SignInPage'; -import PageNotFound from '../../../pages/PageNotFound/PageNotFound'; import { showErrorToast } from '../../../utils/ToastUtils'; import Loader from '../../common/Loader/Loader'; import { @@ -121,7 +120,6 @@ const OidcAuthenticator = forwardRef( )} - {!isSigningIn ? ( ) : null}