-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[App Search] Crawler Landing Page #100822
Merged
byronhulcher
merged 13 commits into
elastic:master
from
byronhulcher:crawler-landing-page
Jun 2, 2021
Merged
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6f06f95
New CrawlerLanding component
byronhulcher 801e282
New CrawlerRouter component
byronhulcher 253ec4d
Adding CrawlerRouter to EngineRouter
byronhulcher 8943432
Using internal route for Crawler link in EngineNav
byronhulcher f56586e
Rename crawler landing background
byronhulcher 0f3730b
Fix CrawlerLanding css
byronhulcher 5f5ef18
Fix crawler documentation link
byronhulcher 0af45d9
Add Crawler title to breadcrumbs
byronhulcher b7d82d9
Reduce png filesize
byronhulcher 47c3823
Improve CrawlerLanding copy
byronhulcher d201144
Merge remote-tracking branch 'origin/master' into crawler-landing-page
byronhulcher e6f4a38
Merge branch 'master' into crawler-landing-page
kibanamachine 4f57dbe
Update x-pack/plugins/enterprise_search/public/applications/app_searc…
byronhulcher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+36 KB
...public/applications/app_search/components/crawler/assets/bg_crawler_landing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
.../enterprise_search/public/applications/app_search/components/crawler/crawler_landing.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.crawler-landing { | ||
&__panel { | ||
overflow: hidden; | ||
background-image: url('./assets/bg_crawler_landing.png'); | ||
background-size: 45%; | ||
background-repeat: no-repeat; | ||
background-position: right -2rem; | ||
|
||
> div { | ||
max-width: 50rem; | ||
} | ||
} | ||
} | ||
cee-chen marked this conversation as resolved.
Show resolved
Hide resolved
|
41 changes: 41 additions & 0 deletions
41
...erprise_search/public/applications/app_search/components/crawler/crawler_landing.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* 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__'; | ||
import { mockEngineValues } from '../../__mocks__'; | ||
|
||
import React from 'react'; | ||
|
||
import { shallow, ShallowWrapper } from 'enzyme'; | ||
|
||
import { CrawlerLanding } from './crawler_landing'; | ||
|
||
describe('CrawlerLanding', () => { | ||
let wrapper: ShallowWrapper; | ||
|
||
beforeEach(() => { | ||
setMockValues({ ...mockEngineValues }); | ||
wrapper = shallow(<CrawlerLanding />); | ||
}); | ||
|
||
afterEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('contains an external documentation link', () => { | ||
const externalDocumentationLink = wrapper.find('[data-test-subj="CrawlerDocumentationLink"]'); | ||
|
||
expect(externalDocumentationLink.prop('href')).toBe( | ||
'https://www.elastic.co/guide/en/app-search/current/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'); | ||
}); | ||
}); |
86 changes: 86 additions & 0 deletions
86
...s/enterprise_search/public/applications/app_search/components/crawler/crawler_landing.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* 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, | ||
EuiPageHeader, | ||
EuiPanel, | ||
EuiSpacer, | ||
EuiText, | ||
EuiTitle, | ||
} from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
import { getAppSearchUrl } from '../../../shared/enterprise_search_url'; | ||
import { ENGINE_CRAWLER_PATH } from '../../routes'; | ||
import { generateEnginePath } from '../engine'; | ||
|
||
import './crawler_landing.scss'; | ||
import { CRAWLER_TITLE } from '.'; | ||
|
||
export const CrawlerLanding: React.FC = () => ( | ||
<div data-test-subj="CrawlerLanding" className="crawler-landing"> | ||
<EuiPageHeader pageTitle={CRAWLER_TITLE} /> | ||
<EuiSpacer /> | ||
<EuiPanel grow paddingSize="l" className="crawler-landing__panel"> | ||
<div> | ||
<EuiTitle size="s"> | ||
<h1> | ||
cee-chen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.title', { | ||
defaultMessage: 'Setup the Web Crawler', | ||
})} | ||
byronhulcher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</h1> | ||
</EuiTitle> | ||
byronhulcher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<EuiSpacer /> | ||
<EuiText> | ||
<p> | ||
{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.", | ||
} | ||
)}{' '} | ||
<EuiLink | ||
external | ||
target="_blank" | ||
cee-chen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
href="https://www.elastic.co/guide/en/app-search/current/web-crawler.html" | ||
cee-chen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
data-test-subj="CrawlerDocumentationLink" | ||
> | ||
{i18n.translate( | ||
'xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.documentationLinkLabel', | ||
{ | ||
defaultMessage: 'Learn more about the web crawler', | ||
cee-chen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
)} | ||
</EuiLink> | ||
</p> | ||
</EuiText> | ||
<EuiSpacer /> | ||
<EuiButton | ||
iconType="popout" | ||
fill | ||
color="primary" | ||
href={getAppSearchUrl(generateEnginePath(ENGINE_CRAWLER_PATH))} | ||
target="_blank" | ||
data-test-subj="CrawlerStandaloneLink" | ||
> | ||
{i18n.translate( | ||
'xpack.enterpriseSearch.appSearch.engine.crawler.landingPage.standaloneLinkLabel', | ||
{ | ||
defaultMessage: 'Configure the web crawler', | ||
} | ||
)} | ||
</EuiButton> | ||
<EuiSpacer size="xl" /> | ||
</div> | ||
</EuiPanel> | ||
</div> | ||
); |
34 changes: 34 additions & 0 deletions
34
...terprise_search/public/applications/app_search/components/crawler/crawler_router.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* 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__'; | ||
|
||
import { mockEngineValues } from '../../__mocks__'; | ||
|
||
import React from 'react'; | ||
import { Switch } from 'react-router-dom'; | ||
|
||
import { shallow } from 'enzyme'; | ||
|
||
import { CrawlerLanding } from './crawler_landing'; | ||
import { CrawlerRouter } from './crawler_router'; | ||
|
||
describe('CrawlerRouter', () => { | ||
beforeEach(() => { | ||
setMockValues({ ...mockEngineValues }); | ||
}); | ||
|
||
afterEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('renders a landing page', () => { | ||
const wrapper = shallow(<CrawlerRouter />); | ||
|
||
expect(wrapper.find(Switch)).toHaveLength(1); | ||
expect(wrapper.find(CrawlerLanding)).toHaveLength(1); | ||
}); | ||
}); |
26 changes: 26 additions & 0 deletions
26
...ns/enterprise_search/public/applications/app_search/components/crawler/crawler_router.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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 { Route, Switch } from 'react-router-dom'; | ||
|
||
import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome'; | ||
|
||
import { getEngineBreadcrumbs } from '../engine'; | ||
|
||
import { CrawlerLanding } from './crawler_landing'; | ||
|
||
export const CrawlerRouter: React.FC = () => { | ||
byronhulcher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return ( | ||
<Switch> | ||
<Route> | ||
<SetPageChrome trail={getEngineBreadcrumbs()} /> | ||
cee-chen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<CrawlerLanding /> | ||
</Route> | ||
</Switch> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
*/ | ||
|
||
export { CRAWLER_TITLE } from './constants'; | ||
export { CrawlerRouter } from './crawler_router'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the copy in the navigation link as well - are we good with that? I'm fine either way, maybe would just double check with @daveyholler