Skip to content

Commit 430b5dc

Browse files
committed
wrapping long tags on agent details page
1 parent 568e631 commit 430b5dc

File tree

1 file changed

+13
-3
lines changed
  • x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components

1 file changed

+13
-3
lines changed

x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/tags.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@
88
import { EuiToolTip } from '@elastic/eui';
99
import { take } from 'lodash';
1010
import React from 'react';
11+
import styled from 'styled-components';
1112

1213
import { truncateTag, MAX_TAG_DISPLAY_LENGTH } from '../utils';
1314

15+
const Wrapped = styled.div`
16+
.wrappedText {
17+
white-space: pre-wrap;
18+
}
19+
`;
20+
1421
interface Props {
1522
tags: string[];
1623
}
@@ -22,13 +29,16 @@ export const Tags: React.FunctionComponent<Props> = ({ tags }) => {
2229
return (
2330
<>
2431
{tags.length > MAX_TAGS_TO_DISPLAY ? (
25-
<>
26-
<EuiToolTip content={<span data-test-subj="agentTagsTooltip">{tags.join(', ')}</span>}>
32+
<Wrapped>
33+
<EuiToolTip
34+
anchorClassName={'wrappedText'}
35+
content={<span data-test-subj="agentTagsTooltip">{tags.join(', ')}</span>}
36+
>
2737
<span data-test-subj="agentTags">
2838
{take(tags, 3).map(truncateTag).join(', ')} + {tags.length - MAX_TAGS_TO_DISPLAY} more
2939
</span>
3040
</EuiToolTip>
31-
</>
41+
</Wrapped>
3242
) : (
3343
<span data-test-subj="agentTags">
3444
{tags.map((tag, index) => (

0 commit comments

Comments
 (0)