-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into kibana-page-template-as-10
- Loading branch information
Showing
12 changed files
with
264 additions
and
106 deletions.
There are no files selected for viewing
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
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
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
27 changes: 27 additions & 0 deletions
27
...earch/public/applications/app_search/components/search_ui/components/empty_state.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,27 @@ | ||
/* | ||
* 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 { shallow } from 'enzyme'; | ||
|
||
import { EuiEmptyPrompt, EuiButton } from '@elastic/eui'; | ||
|
||
import { EmptyState } from './empty_state'; | ||
|
||
describe('EmptyState', () => { | ||
it('renders', () => { | ||
const wrapper = shallow(<EmptyState />) | ||
.find(EuiEmptyPrompt) | ||
.dive(); | ||
|
||
expect(wrapper.find('h2').text()).toEqual('Add documents to generate a Search UI'); | ||
expect(wrapper.find(EuiButton).prop('href')).toEqual( | ||
expect.stringContaining('/reference-ui-guide.html') | ||
); | ||
}); | ||
}); |
46 changes: 46 additions & 0 deletions
46
...ise_search/public/applications/app_search/components/search_ui/components/empty_state.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,46 @@ | ||
/* | ||
* 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, EuiEmptyPrompt } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
|
||
import { DOCS_PREFIX } from '../../../routes'; | ||
|
||
export const EmptyState: React.FC = () => ( | ||
<EuiEmptyPrompt | ||
iconType="search" | ||
title={ | ||
<h2> | ||
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.searchUI.empty.title', { | ||
defaultMessage: 'Add documents to generate a Search UI', | ||
})} | ||
</h2> | ||
} | ||
body={ | ||
<p> | ||
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.searchUI.empty.description', { | ||
defaultMessage: | ||
'A schema will be automatically created for you after you index some documents.', | ||
})} | ||
</p> | ||
} | ||
actions={ | ||
<EuiButton | ||
size="s" | ||
target="_blank" | ||
iconType="popout" | ||
href={`${DOCS_PREFIX}/reference-ui-guide.html`} | ||
> | ||
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.searchUI.empty.buttonLabel', { | ||
defaultMessage: 'Read the Search UI guide', | ||
})} | ||
</EuiButton> | ||
} | ||
/> | ||
); |
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
Oops, something went wrong.