Skip to content

Commit

Permalink
refactor(infra): redirect to logs explorer once accessing /stream route
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Antonio Ghiani committed Oct 8, 2024
1 parent 2d9d15b commit 1778b8e
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { SharePublicStart } from '@kbn/share-plugin/public/plugin';
import {
ObservabilityOnboardingLocatorParams,
OBSERVABILITY_ONBOARDING_LOCATOR,
AllDatasetsLocatorParams,
ALL_DATASETS_LOCATOR_ID,
} from '@kbn/deeplinks-observability';
import { dynamic } from '@kbn/shared-ux-utility';
import { isDevMode } from '@kbn/xstate-utils';
Expand Down Expand Up @@ -92,7 +94,21 @@ export const LogsPageContent: React.FunctionComponent = () => {
)}

<Routes>
{routes.stream && <Route path={routes.stream.path} component={StreamPage} />}
{routes.stream ? (
<Route path={routes.stream.path} component={StreamPage} />
) : (
<Route
path="/stream"
exact
render={() => {
share.url.locators
.get<AllDatasetsLocatorParams>(ALL_DATASETS_LOCATOR_ID)
?.navigate({});

return null;
}}
/>
)}
<Route path={routes.logsAnomalies.path} component={LogEntryRatePage} />
<Route path={routes.logsCategories.path} component={LogEntryCategoriesPage} />
<Route path={routes.settings.path} component={LogsSettingsPage} />
Expand All @@ -106,6 +122,7 @@ export const LogsPageContent: React.FunctionComponent = () => {
to={routes.stream?.path ?? routes.logsAnomalies.path}
exact
/>

<Route render={() => <NotFoundPage title={pageTitle} />} />
</Routes>
</>
Expand Down

0 comments on commit 1778b8e

Please sign in to comment.