-
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.
Browse files
Browse the repository at this point in the history
* Add basic API Logs view * Update engine router + nav link Co-authored-by: Constance <[email protected]>
- Loading branch information
1 parent
303bda3
commit 9e78254
Showing
7 changed files
with
98 additions
and
5 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...ns/enterprise_search/public/applications/app_search/components/api_logs/api_logs.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,32 @@ | ||
/* | ||
* 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 { EuiPageHeader } from '@elastic/eui'; | ||
|
||
import { LogRetentionCallout, LogRetentionTooltip } from '../log_retention'; | ||
|
||
import { ApiLogs } from './'; | ||
|
||
describe('ApiLogs', () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('renders', () => { | ||
const wrapper = shallow(<ApiLogs engineBreadcrumb={['some engine']} />); | ||
|
||
expect(wrapper.find(EuiPageHeader).prop('pageTitle')).toEqual('API Logs'); | ||
// TODO: Check for ApiLogsTable + NewApiEventsPrompt when those get added | ||
|
||
expect(wrapper.find(LogRetentionCallout).prop('type')).toEqual('api'); | ||
expect(wrapper.find(LogRetentionTooltip).prop('type')).toEqual('api'); | ||
}); | ||
}); |
47 changes: 47 additions & 0 deletions
47
...plugins/enterprise_search/public/applications/app_search/components/api_logs/api_logs.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,47 @@ | ||
/* | ||
* 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 { EuiPageHeader, EuiTitle, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
|
||
import { FlashMessages } from '../../../shared/flash_messages'; | ||
import { SetAppSearchChrome as SetPageChrome } from '../../../shared/kibana_chrome'; | ||
import { BreadcrumbTrail } from '../../../shared/kibana_chrome/generate_breadcrumbs'; | ||
|
||
import { LogRetentionCallout, LogRetentionTooltip, LogRetentionOptions } from '../log_retention'; | ||
|
||
import { API_LOGS_TITLE, RECENT_API_EVENTS } from './constants'; | ||
|
||
interface Props { | ||
engineBreadcrumb: BreadcrumbTrail; | ||
} | ||
export const ApiLogs: React.FC<Props> = ({ engineBreadcrumb }) => { | ||
return ( | ||
<> | ||
<SetPageChrome trail={[...engineBreadcrumb, API_LOGS_TITLE]} /> | ||
<EuiPageHeader pageTitle={API_LOGS_TITLE} /> | ||
|
||
<FlashMessages /> | ||
<LogRetentionCallout type={LogRetentionOptions.API} /> | ||
|
||
<EuiFlexGroup gutterSize="m" alignItems="center" responsive={false} wrap> | ||
<EuiFlexItem grow={false}> | ||
<EuiTitle size="s"> | ||
<h2>{RECENT_API_EVENTS}</h2> | ||
</EuiTitle> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<LogRetentionTooltip type={LogRetentionOptions.API} /> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}>{/* TODO: NewApiEventsPrompt */}</EuiFlexItem> | ||
</EuiFlexGroup> | ||
|
||
{/* TODO: ApiLogsTable */} | ||
</> | ||
); | ||
}; |
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 { API_LOGS_TITLE } from './constants'; | ||
export { ApiLogs } from './api_logs'; |
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