Skip to content

Commit

Permalink
Update routers
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Jun 22, 2021
1 parent c4a0695 commit 271ed98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,18 @@ export const EngineRouter: React.FC = () => {
<Documents />
</Route>
)}
{canViewEngineSchema && (
<Route path={ENGINE_SCHEMA_PATH}>
<SchemaRouter />
</Route>
)}
{/* TODO: Remove layout once page template migration is over */}
<Layout navigation={<AppSearchNav />}>
{canViewEngineAnalytics && (
<Route path={ENGINE_ANALYTICS_PATH}>
<AnalyticsRouter />
</Route>
)}
{canViewEngineSchema && (
<Route path={ENGINE_SCHEMA_PATH}>
<SchemaRouter />
</Route>
)}
{canManageEngineCurations && (
<Route path={ENGINE_CURATIONS_PATH}>
<CurationsRouter />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,21 @@ import { Route, Switch } from 'react-router-dom';

import { useValues } from 'kea';

import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome';
import { ENGINE_REINDEX_JOB_PATH } from '../../routes';
import { EngineLogic, getEngineBreadcrumbs } from '../engine';
import { EngineLogic } from '../engine';

import { SCHEMA_TITLE } from './constants';
import { ReindexJob } from './reindex_job';
import { Schema, MetaEngineSchema } from './views';

export const SchemaRouter: React.FC = () => {
const { isMetaEngine } = useValues(EngineLogic);
const schemaBreadcrumb = getEngineBreadcrumbs([SCHEMA_TITLE]);

return (
<Switch>
<Route path={ENGINE_REINDEX_JOB_PATH}>
<ReindexJob schemaBreadcrumb={schemaBreadcrumb} />
</Route>
<Route>
<SetPageChrome trail={schemaBreadcrumb} />
{isMetaEngine ? <MetaEngineSchema /> : <Schema />}
<ReindexJob />
</Route>
<Route>{isMetaEngine ? <MetaEngineSchema /> : <Schema />}</Route>
</Switch>
);
};

0 comments on commit 271ed98

Please sign in to comment.