Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove CrawlerLanding page #109712

Merged
merged 2 commits into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,23 @@
*/

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

import { shallow, ShallowWrapper } from 'enzyme';

import { rerender } from '../../../test_helpers';

import { CrawlerLanding } from './crawler_landing';
import { CrawlerOverview } from './crawler_overview';
import { CrawlerRouter } from './crawler_router';
import { CrawlerSingleDomain } from './crawler_single_domain';

describe('CrawlerRouter', () => {
let wrapper: ShallowWrapper;
const OLD_ENV = process.env;

beforeEach(() => {
jest.clearAllMocks();
wrapper = shallow(<CrawlerRouter />);
});

afterEach(() => {
process.env = OLD_ENV;
});

it('renders a landing page by default', () => {
expect(wrapper.find(Switch)).toHaveLength(1);
expect(wrapper.find(CrawlerLanding)).toHaveLength(1);
});

it('renders a crawler overview in dev', () => {
process.env.NODE_ENV = 'development';
rerender(wrapper);

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

it('renders a crawler single domain view', () => {
expect(wrapper.find(CrawlerOverview)).toHaveLength(1);
expect(wrapper.find(CrawlerSingleDomain)).toHaveLength(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ import { Route, Switch } from 'react-router-dom';

import { ENGINE_CRAWLER_DOMAIN_PATH, ENGINE_CRAWLER_PATH } from '../../routes';

import { CrawlerLanding } from './crawler_landing';
import { CrawlerOverview } from './crawler_overview';
import { CrawlerSingleDomain } from './crawler_single_domain';

export const CrawlerRouter: React.FC = () => {
return (
<Switch>
<Route exact path={ENGINE_CRAWLER_PATH}>
{process.env.NODE_ENV === 'development' ? <CrawlerOverview /> : <CrawlerLanding />}
<CrawlerOverview />
</Route>
<Route exact path={ENGINE_CRAWLER_DOMAIN_PATH}>
<CrawlerSingleDomain />
Expand Down
4 changes: 0 additions & 4 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -8135,10 +8135,6 @@
"xpack.enterpriseSearch.appSearch.engine.apiLogs.timeTableHeading": "時間",
"xpack.enterpriseSearch.appSearch.engine.apiLogs.title": "API ログ",
"xpack.enterpriseSearch.appSearch.engine.apiLogs.userAgentTitle": "ユーザーエージェント",
"xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.description": "Webサイトのコンテンツに簡単にインデックスします。開始するには、ドメイン名を入力し、任意のエントリポイントとクロールルールを指定します。その他の手順は自動的に行われます。",
"xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.documentationLinkLabel": "Webクローラーの詳細を参照してください。",
"xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.standaloneLinkLabel": "Webクローラーを構成",
"xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.title": "Webクローラーを設定",
"xpack.enterpriseSearch.appSearch.engine.crawler.title": "Webクローラー",
"xpack.enterpriseSearch.appSearch.engine.curations.activeQueryLabel": "アクティブなクエリ",
"xpack.enterpriseSearch.appSearch.engine.curations.addQueryButtonLabel": "クエリを追加",
Expand Down
4 changes: 0 additions & 4 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -8387,10 +8387,6 @@
"xpack.enterpriseSearch.appSearch.engine.apiLogs.timeTableHeading": "时间",
"xpack.enterpriseSearch.appSearch.engine.apiLogs.title": "API 日志",
"xpack.enterpriseSearch.appSearch.engine.apiLogs.userAgentTitle": "用户代理",
"xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.description": "轻松索引您的网站内容。要开始,请输入您的域名,提供可选入口点和爬网规则,然后我们将处理剩下的事情。",
"xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.documentationLinkLabel": "详细了解网络爬虫。",
"xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.standaloneLinkLabel": "配置网络爬虫",
"xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.title": "设置网络爬虫",
"xpack.enterpriseSearch.appSearch.engine.crawler.title": "网络爬虫",
"xpack.enterpriseSearch.appSearch.engine.curations.activeQueryLabel": "活动查询",
"xpack.enterpriseSearch.appSearch.engine.curations.addQueryButtonLabel": "添加查询",
Expand Down