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 fb69fbf commit 5fcf040
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
* 2.0.
*/

import { setMockValues } from '../../../__mocks__/kea_logic';
import { mockEngineValues } from '../../__mocks__';

import React from 'react';
import { Switch } from 'react-router-dom';

Expand All @@ -22,7 +19,6 @@ describe('CrawlerRouter', () => {

beforeEach(() => {
jest.clearAllMocks();
setMockValues({ ...mockEngineValues });
});

afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@
import React from 'react';
import { Route, Switch } from 'react-router-dom';

import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome';

import { getEngineBreadcrumbs } from '../engine';

import { CRAWLER_TITLE } from './constants';
import { CrawlerLanding } from './crawler_landing';
import { CrawlerOverview } from './crawler_overview';

export const CrawlerRouter: React.FC = () => {
return (
<Switch>
<Route>
<SetPageChrome trail={getEngineBreadcrumbs([CRAWLER_TITLE])} />
{process.env.NODE_ENV === 'development' ? <CrawlerOverview /> : <CrawlerLanding />}
</Route>
</Switch>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ export const EngineRouter: React.FC = () => {
<Documents />
</Route>
)}
{canViewMetaEngineSourceEngines && (
<Route path={META_ENGINE_SOURCE_ENGINES_PATH}>
<SourceEngines />
</Route>
)}
{canViewEngineCrawler && (
<Route path={ENGINE_CRAWLER_PATH}>
<CrawlerRouter />
</Route>
)}
{/* TODO: Remove layout once page template migration is over */}
<Layout navigation={<AppSearchNav />}>
{canViewEngineAnalytics && (
Expand Down Expand Up @@ -146,16 +156,6 @@ export const EngineRouter: React.FC = () => {
<SearchUI />
</Route>
)}
{canViewMetaEngineSourceEngines && (
<Route path={META_ENGINE_SOURCE_ENGINES_PATH}>
<SourceEngines />
</Route>
)}
{canViewEngineCrawler && (
<Route path={ENGINE_CRAWLER_PATH}>
<CrawlerRouter />
</Route>
)}
</Layout>
</Switch>
);
Expand Down

0 comments on commit 5fcf040

Please sign in to comment.