From c72676f32ab57e637d371f2678cfb6906de061d2 Mon Sep 17 00:00:00 2001 From: Jason Stoltzfus Date: Mon, 23 Aug 2021 22:27:59 -0400 Subject: [PATCH] Remove CrawlerLanding page (#109712) * Remove CrawlerLanding page The CrawlerLanding page was being shown in non-development versions. Now that we are at 7.15, CrawlerOverview should be shown all of the time instead. * Remove translations from ja-JP and zh-CN Co-authored-by: Byron Hulcher --- .../components/crawler/crawler_landing.scss | 13 --- .../crawler/crawler_landing.test.tsx | 40 --------- .../components/crawler/crawler_landing.tsx | 81 ------------------- .../crawler/crawler_router.test.tsx | 22 +---- .../components/crawler/crawler_router.tsx | 3 +- .../translations/translations/ja-JP.json | 4 - .../translations/translations/zh-CN.json | 4 - 7 files changed, 2 insertions(+), 165 deletions(-) delete mode 100644 x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.scss delete mode 100644 x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.test.tsx delete mode 100644 x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.tsx diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.scss b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.scss deleted file mode 100644 index 3ace4064008b6..0000000000000 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.scss +++ /dev/null @@ -1,13 +0,0 @@ -.crawlerLanding { - &__panel { - overflow: hidden; - background-image: url('./assets/bg_crawler_landing.png'); - background-size: 45%; - background-repeat: no-repeat; - background-position: right -2rem; - } - - &__wrapper { - max-width: 50rem; - } -} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.test.tsx deleted file mode 100644 index 9e0379aa1ce27..0000000000000 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.test.tsx +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { setMockValues } from '../../../__mocks__/kea_logic'; -import { mockEngineValues } from '../../__mocks__'; - -import React from 'react'; - -import { shallow, ShallowWrapper } from 'enzyme'; - -import { docLinks } from '../../../shared/doc_links'; - -import { CrawlerLanding } from './crawler_landing'; - -describe('CrawlerLanding', () => { - let wrapper: ShallowWrapper; - - beforeEach(() => { - jest.clearAllMocks(); - setMockValues({ ...mockEngineValues }); - wrapper = shallow(); - }); - - it('contains an external documentation link', () => { - const externalDocumentationLink = wrapper.find('[data-test-subj="CrawlerDocumentationLink"]'); - - expect(externalDocumentationLink.prop('href')).toBe( - `${docLinks.appSearchBase}/web-crawler.html` - ); - }); - - it('contains a link to standalone App Search', () => { - const externalDocumentationLink = wrapper.find('[data-test-subj="CrawlerStandaloneLink"]'); - - expect(externalDocumentationLink.prop('href')).toBe('/as#/engines/some-engine/crawler'); - }); -}); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.tsx deleted file mode 100644 index 2afb36a40fe0f..0000000000000 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.tsx +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; - -import { EuiButton, EuiLink, EuiPanel, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; - -import { getAppSearchUrl } from '../../../shared/enterprise_search_url'; -import { DOCS_PREFIX, ENGINE_CRAWLER_PATH } from '../../routes'; -import { generateEnginePath, getEngineBreadcrumbs } from '../engine'; -import { AppSearchPageTemplate } from '../layout'; - -import './crawler_landing.scss'; -import { CRAWLER_TITLE } from '.'; - -export const CrawlerLanding: React.FC = () => ( - - -
- -

- {i18n.translate('xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.title', { - defaultMessage: 'Set up the Web Crawler', - })} -

-
- - -

- {i18n.translate( - 'xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.description', - { - defaultMessage: - "Easily index your website's content. To get started, enter your domain name, provide optional entry points and crawl rules, and we will handle the rest.", - } - )}{' '} - - {i18n.translate( - 'xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.documentationLinkLabel', - { - defaultMessage: 'Learn more about the web crawler.', - } - )} - -

-
- - - {i18n.translate( - 'xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.standaloneLinkLabel', - { - defaultMessage: 'Configure the web crawler', - } - )} - - -
-
-
-); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.test.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.test.tsx index 3fa0153861319..20c377b67d191 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.test.tsx @@ -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(); }); - 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); }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.tsx index 3919740b0c6cb..436dcc4d3ea23 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/crawler/crawler_router.tsx @@ -10,7 +10,6 @@ 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'; @@ -18,7 +17,7 @@ export const CrawlerRouter: React.FC = () => { return ( - {process.env.NODE_ENV === 'development' ? : } + diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index c4256e049f298..1a3475caf6f85 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -8374,10 +8374,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": "クエリを追加", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 78e93e7b07db8..93f3202ae8755 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -8474,10 +8474,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": "添加查询",