Skip to content

Commit

Permalink
Adding CrawlerRouter to EngineRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
byronhulcher committed May 27, 2021
1 parent 41feb55 commit c65fb51
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
*/

export { CRAWLER_TITLE } from './constants';
export { CrawlerRouter } from './crawler_router';
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { shallow } from 'enzyme';
import { Loading } from '../../../shared/loading';
import { AnalyticsRouter } from '../analytics';
import { ApiLogs } from '../api_logs';
import { CrawlerRouter } from '../crawler';
import { CurationsRouter } from '../curations';
import { Documents, DocumentDetail } from '../documents';
import { EngineOverview } from '../engine_overview';
Expand Down Expand Up @@ -168,4 +169,11 @@ describe('EngineRouter', () => {

expect(wrapper.find(SourceEngines)).toHaveLength(1);
});

it('renders a crawler view', () => {
setMockValues({ ...values, myRole: { canViewEngineCrawler: true } });
const wrapper = shallow(<EngineRouter />);

expect(wrapper.find(CrawlerRouter)).toHaveLength(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
ENGINE_DOCUMENTS_PATH,
ENGINE_DOCUMENT_DETAIL_PATH,
ENGINE_SCHEMA_PATH,
// ENGINE_CRAWLER_PATH,
ENGINE_CRAWLER_PATH,
META_ENGINE_SOURCE_ENGINES_PATH,
ENGINE_RELEVANCE_TUNING_PATH,
ENGINE_SYNONYMS_PATH,
Expand All @@ -34,6 +34,7 @@ import {
} from '../../routes';
import { AnalyticsRouter } from '../analytics';
import { ApiLogs } from '../api_logs';
import { CrawlerRouter } from '../crawler';
import { CurationsRouter } from '../curations';
import { DocumentDetail, Documents } from '../documents';
import { EngineOverview } from '../engine_overview';
Expand All @@ -52,7 +53,7 @@ export const EngineRouter: React.FC = () => {
canViewEngineAnalytics,
canViewEngineDocuments,
canViewEngineSchema,
// canViewEngineCrawler,
canViewEngineCrawler,
canViewMetaEngineSourceEngines,
canManageEngineRelevanceTuning,
canManageEngineSynonyms,
Expand Down Expand Up @@ -143,6 +144,11 @@ export const EngineRouter: React.FC = () => {
<SourceEngines />
</Route>
)}
{canViewEngineCrawler && (
<Route path={ENGINE_CRAWLER_PATH}>
<CrawlerRouter />
</Route>
)}
<Route>
<SetPageChrome trail={getEngineBreadcrumbs()} />
<EngineOverview />
Expand Down

0 comments on commit c65fb51

Please sign in to comment.