mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
* add beta badge to overview header * update test * updates snapshot
This commit is contained in:
parent
ee463870ec
commit
58df103f38
5 changed files with 55 additions and 18 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
exports[`rendering renders correctly 1`] = `
|
||||
<Component
|
||||
badgeLabel="Beta"
|
||||
badgeTooltip="My test tooltip."
|
||||
subtitle="My Test Subtitle"
|
||||
title="My Test Title"
|
||||
>
|
||||
|
|
|
@ -13,7 +13,12 @@ import { HeaderPage } from './index';
|
|||
describe('rendering', () => {
|
||||
test('renders correctly', () => {
|
||||
const wrapper = shallow(
|
||||
<HeaderPage subtitle="My Test Subtitle" title="My Test Title">
|
||||
<HeaderPage
|
||||
badgeLabel="Beta"
|
||||
badgeTooltip="My test tooltip."
|
||||
subtitle="My Test Subtitle"
|
||||
title="My Test Title"
|
||||
>
|
||||
<p>{'My test supplement.'}</p>
|
||||
</HeaderPage>
|
||||
);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { EuiFlexGroup, EuiFlexItem, EuiText, EuiTitle } from '@elastic/eui';
|
||||
import { EuiBetaBadge, EuiFlexGroup, EuiFlexItem, EuiText, EuiTitle } from '@elastic/eui';
|
||||
import React from 'react';
|
||||
import { pure } from 'recompose';
|
||||
import styled from 'styled-components';
|
||||
|
@ -18,25 +18,41 @@ const Header = styled.header`
|
|||
`;
|
||||
|
||||
export interface HeaderPageProps {
|
||||
badgeLabel?: string;
|
||||
badgeTooltip?: string;
|
||||
children?: React.ReactNode;
|
||||
subtitle?: string | React.ReactNode;
|
||||
title: string | React.ReactNode;
|
||||
}
|
||||
|
||||
export const HeaderPage = pure<HeaderPageProps>(({ children, subtitle, title }) => (
|
||||
<Header>
|
||||
<EuiFlexGroup alignItems="center">
|
||||
<EuiFlexItem>
|
||||
<EuiTitle size="l">
|
||||
<h1 data-test-subj="page_headline_title">{title}</h1>
|
||||
</EuiTitle>
|
||||
export const HeaderPage = pure<HeaderPageProps>(
|
||||
({ badgeLabel, badgeTooltip, children, subtitle, title }) => (
|
||||
<Header>
|
||||
<EuiFlexGroup alignItems="center">
|
||||
<EuiFlexItem>
|
||||
<EuiTitle size="l">
|
||||
<h1 data-test-subj="page_headline_title">
|
||||
{title}
|
||||
{badgeLabel && (
|
||||
<>
|
||||
{' '}
|
||||
<EuiBetaBadge
|
||||
label={badgeLabel}
|
||||
tooltipContent={badgeTooltip}
|
||||
tooltipPosition="bottom"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</h1>
|
||||
</EuiTitle>
|
||||
|
||||
<EuiText color="subdued" size="s">
|
||||
{subtitle}
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
<EuiText color="subdued" size="s">
|
||||
{subtitle}
|
||||
</EuiText>
|
||||
</EuiFlexItem>
|
||||
|
||||
{children && <EuiFlexItem grow={false}>{children}</EuiFlexItem>}
|
||||
</EuiFlexGroup>
|
||||
</Header>
|
||||
));
|
||||
{children && <EuiFlexItem grow={false}>{children}</EuiFlexItem>}
|
||||
</EuiFlexGroup>
|
||||
</Header>
|
||||
)
|
||||
);
|
||||
|
|
|
@ -31,7 +31,12 @@ export const OverviewComponent = pure(() => {
|
|||
|
||||
return (
|
||||
<>
|
||||
<HeaderPage subtitle={i18n.PAGE_SUBTITLE} title={i18n.PAGE_TITLE} />
|
||||
<HeaderPage
|
||||
badgeLabel={i18n.PAGE_BADGE_LABEL}
|
||||
badgeTooltip={i18n.PAGE_BADGE_TOOLTIP}
|
||||
subtitle={i18n.PAGE_SUBTITLE}
|
||||
title={i18n.PAGE_TITLE}
|
||||
/>
|
||||
|
||||
<WithSource sourceId="default">
|
||||
{({ indicesExist }) =>
|
||||
|
|
|
@ -14,6 +14,15 @@ export const PAGE_SUBTITLE = i18n.translate('xpack.siem.overview.pageSubtitle',
|
|||
defaultMessage: 'Security Information & Event Management with the Elastic Stack',
|
||||
});
|
||||
|
||||
export const PAGE_BADGE_LABEL = i18n.translate('xpack.siem.overview.pageBadgeLabel', {
|
||||
defaultMessage: 'Beta',
|
||||
});
|
||||
|
||||
export const PAGE_BADGE_TOOLTIP = i18n.translate('xpack.siem.overview.pageBadgeTooltip', {
|
||||
defaultMessage:
|
||||
'SIEM is still in beta. Please help us improve by reporting issues or bugs in the Kibana repo.',
|
||||
});
|
||||
|
||||
export const EMPTY_TITLE = i18n.translate('xpack.siem.overview.emptyTitle', {
|
||||
defaultMessage: 'It looks like you don’t have any indices relevant to the SIEM application',
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue