forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor out components shared with Workplace Search #18
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
Merged
cee-chen
merged 3 commits into
feature/enterprise-search-plugin
from
shared-ws-components
Jun 17, 2020
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
x-pack/plugins/enterprise_search/public/applications/shared/get_username/index.ts
This file contains hidden or 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,7 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| export { getUserName } from './get_username'; |
7 changes: 7 additions & 0 deletions
7
x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/index.ts
This file contains hidden or 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,7 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| export { SetupGuide } from './setup_guide'; |
File renamed without changes.
44 changes: 44 additions & 0 deletions
44
x-pack/plugins/enterprise_search/public/applications/shared/setup_guide/setup_guide.test.tsx
This file contains hidden or 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,44 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| import React from 'react'; | ||
| import { shallow } from 'enzyme'; | ||
| import { EuiSteps, EuiIcon, EuiLink } from '@elastic/eui'; | ||
|
|
||
| import { mountWithContext } from '../../__mocks__'; | ||
|
|
||
| import { SetupGuide } from './'; | ||
|
|
||
| describe('SetupGuide', () => { | ||
| it('renders', () => { | ||
| const wrapper = shallow( | ||
| <SetupGuide productName="Enterprise Search" productEuiIcon="logoEnterpriseSearch"> | ||
| <p data-test-subj="test">Wow!</p> | ||
| </SetupGuide> | ||
| ); | ||
|
|
||
| expect(wrapper.find('h1').text()).toEqual('Enterprise Search'); | ||
| expect(wrapper.find(EuiIcon).prop('type')).toEqual('logoEnterpriseSearch'); | ||
| expect(wrapper.find('[data-test-subj="test"]').text()).toEqual('Wow!'); | ||
| expect(wrapper.find(EuiSteps)).toHaveLength(1); | ||
| }); | ||
|
|
||
| it('renders with optional auth links', () => { | ||
| const wrapper = mountWithContext( | ||
| <SetupGuide | ||
| productName="Foo" | ||
| productEuiIcon="Bar" | ||
| standardAuthLink="http://foo.com" | ||
| elasticsearchNativeAuthLink="http://bar.com" | ||
| > | ||
| Baz | ||
| </SetupGuide> | ||
| ); | ||
|
|
||
| expect(wrapper.find('EuiLink').first().prop('href')).toEqual('http://bar.com'); | ||
| expect(wrapper.find('EuiLink').last().prop('href')).toEqual('http://foo.com'); | ||
| }); | ||
| }); |
Oops, something went wrong.
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.
I'm hoping we can potentially lose these two per-product props if I get approval from @chriscressman for opening up a PR for pulling out
https://www.elastic.co/guide/en/app-search/current/security-and-users.html
and
https://www.elastic.co/guide/en/workplace-search/current/workplace-search-security.html
into its own section in the general https://www.elastic.co/guide/en/enterprise-search/current/index.html docs 🤞
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.
@constancecchen - I'm not sure if you'd still like to make this change, but if so, I welcome that PR. I'm tracking a larger, related docs project in https://github.com/elastic/enterprise-search-pubs/issues/630, but I don't expect to act on it for a while. More broadly, I favor moving shared concerns out of product-specific books and into the Enterprise Search book.
If you proceed, here are some considerations:
I wish moving docs wasn't so hard 😢