forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[App Search] Convert Search UI view to new page template + minor UI p…
…olish (elastic#102813) * Convert Search UI view to use new page template + update tests TODO * [UX polish] Add empty state to Search UI view - On a totally new engine, all pages except this one* had an empty state, so per Davey's recommendations I whipped up a new empty state for this page * Overview has a custom 'empty' state, analytics does not have an empty state * Update router * Fix bad merge conflict resolution * [Polish] Copy feedback proposed by Davey - see elastic@cbc3706
- Loading branch information
1 parent
3f3bd5f
commit d2398c9
Showing
5 changed files
with
143 additions
and
73 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
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
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