Skip to content

Commit

Permalink
[7.x] [Security_Solution][Resolver]Add beta badge to Resolver panel (#…
Browse files Browse the repository at this point in the history
…71183) (#71561)

* [Security_Solution][Resolver]Add beta badge to Resolver panel (#71183)
  • Loading branch information
bkimmel authored Jul 14, 2020
1 parent 2d3b157 commit aa555d5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export const RelatedEventDetail = memo(function RelatedEventDetail({

return (
<>
<StyledBreadcrumbs truncate={false} breadcrumbs={crumbs} />
<StyledBreadcrumbs breadcrumbs={crumbs} />
<EuiSpacer size="l" />
<EuiText size="s">
<BoldCode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { i18n } from '@kbn/i18n';
import { EuiBreadcrumbs, EuiBreadcrumb, EuiCode } from '@elastic/eui';
import { EuiBreadcrumbs, EuiCode, EuiBetaBadge } from '@elastic/eui';
import styled from 'styled-components';
import React, { memo } from 'react';
import { useResolverTheme } from '../assets';
Expand All @@ -19,6 +19,10 @@ export const BoldCode = styled(EuiCode)`
}
`;

const BetaHeader = styled(`header`)`
margin-bottom: 1em;
`;

/**
* The two query parameters we read/write on to control which view the table presents:
*/
Expand All @@ -40,26 +44,46 @@ const ThemedBreadcrumbs = styled(EuiBreadcrumbs)<{ background: string; text: str
}
`;

const betaBadgeLabel = i18n.translate(
'xpack.securitySolution.enpdoint.resolver.panelutils.betaBadgeLabel',
{
defaultMessage: 'BETA',
}
);

/**
* A component to keep time representations in blocks so they don't wrap
* and look bad.
*/
export const StyledTime = memo(styled('time')`
display: inline-block;
text-align: start;
`);

type Breadcrumbs = Parameters<typeof EuiBreadcrumbs>[0]['breadcrumbs'];
/**
* Breadcrumb menu with adjustments per direction from UX team
*/
export const StyledBreadcrumbs = memo(function StyledBreadcrumbs({
breadcrumbs,
truncate,
}: {
breadcrumbs: EuiBreadcrumb[];
truncate?: boolean;
breadcrumbs: Breadcrumbs;
}) {
const {
colorMap: { resolverBreadcrumbBackground, resolverEdgeText },
} = useResolverTheme();
return (
<ThemedBreadcrumbs
background={resolverBreadcrumbBackground}
text={resolverEdgeText}
breadcrumbs={breadcrumbs}
truncate={truncate}
/>
<>
<BetaHeader>
<EuiBetaBadge label={betaBadgeLabel} />
</BetaHeader>
<ThemedBreadcrumbs
background={resolverBreadcrumbBackground}
text={resolverEdgeText}
breadcrumbs={breadcrumbs}
truncate={false}
/>
</>
);
});

Expand Down

0 comments on commit aa555d5

Please sign in to comment.