diff --git a/x-pack/plugins/cloud_security_posture/public/application/app.tsx b/x-pack/plugins/cloud_security_posture/public/application/app.tsx index 3fdab253d4600b..9f0ae6a25f7c76 100755 --- a/x-pack/plugins/cloud_security_posture/public/application/app.tsx +++ b/x-pack/plugins/cloud_security_posture/public/application/app.tsx @@ -4,15 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - import React from 'react'; import { I18nProvider } from '@kbn/i18n-react'; import { Router, Redirect, Switch, Route } from 'react-router-dom'; import { QueryClient, QueryClientProvider } from 'react-query'; import { routes } from './routes'; - +import { UnknownRoute } from '../components/unknown_route'; +import { CSP_DASHBOARD_PATH } from '../common/constants'; import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; - import type { AppMountParameters, CoreStart } from '../../../../../src/core/public'; import type { CspStart } from '../types'; @@ -24,22 +23,22 @@ interface CspAppDeps { params: AppMountParameters; } -export const CspApp = ({ core, deps, params }: CspAppDeps) => { - return ( - - - - - - {routes.map((route) => ( - - ))} - } /> -
not found
} /> -
-
-
-
-
- ); -}; +export const CspApp = ({ core, deps, params }: CspAppDeps) => ( + + + + + + {routes.map((route) => ( + + ))} + + + + + + + +); + +const RedirectToDashboard = () => ; diff --git a/x-pack/plugins/cloud_security_posture/public/components/unknown_route.tsx b/x-pack/plugins/cloud_security_posture/public/components/unknown_route.tsx new file mode 100644 index 00000000000000..83740c522cc4ee --- /dev/null +++ b/x-pack/plugins/cloud_security_posture/public/components/unknown_route.tsx @@ -0,0 +1,26 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { EuiEmptyPrompt } from '@elastic/eui'; +import { CspPageTemplate } from './page_template'; + +export const UnknownRoute = React.memo(() => ( + + + +

+ } + /> +
+));