-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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 API Logs page to new page template + empty state…
… polish (#102820) (#102987) * Convert API Logs noItemsMessage to its own empty state prompt - Will be used by new page template * Convert API Logs view to new page template + use new empty state + add tests clarifying loading UX * Update router * Fix i18n ID Co-authored-by: Constance <constancecchen@users.noreply.github.com>
- Loading branch information
1 parent
cb684f5
commit c2357fa
Showing
8 changed files
with
124 additions
and
86 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
27 changes: 27 additions & 0 deletions
27
...search/public/applications/app_search/components/api_logs/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 './'; | ||
|
||
describe('EmptyState', () => { | ||
it('renders', () => { | ||
const wrapper = shallow(<EmptyState />) | ||
.find(EuiEmptyPrompt) | ||
.dive(); | ||
|
||
expect(wrapper.find('h2').text()).toEqual('Perform your first API call'); | ||
expect(wrapper.find(EuiButton).prop('href')).toEqual( | ||
expect.stringContaining('/api-reference.html') | ||
); | ||
}); | ||
}); |
45 changes: 45 additions & 0 deletions
45
...rise_search/public/applications/app_search/components/api_logs/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,45 @@ | ||
/* | ||
* 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="clock" | ||
title={ | ||
<h2> | ||
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.apiLogs.emptyTitle', { | ||
defaultMessage: 'Perform your first API call', | ||
})} | ||
</h2> | ||
} | ||
body={ | ||
<p> | ||
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.apiLogs.emptyDescription', { | ||
defaultMessage: "Check back after you've performed some API calls.", | ||
})} | ||
</p> | ||
} | ||
actions={ | ||
<EuiButton | ||
size="s" | ||
target="_blank" | ||
iconType="popout" | ||
href={`${DOCS_PREFIX}/api-reference.html`} | ||
> | ||
{i18n.translate('xpack.enterpriseSearch.appSearch.engine.apiLogs.empty.buttonLabel', { | ||
defaultMessage: 'View the API reference', | ||
})} | ||
</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