Skip to content

Commit

Permalink
Fix Data does not wrap on resolution change for indicator rule under …
Browse files Browse the repository at this point in the history
…alert details
  • Loading branch information
machadoum committed Dec 20, 2021
1 parent 2d2d702 commit 54af0cc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const getDescription = ({
linkValue={linkValue}
timelineId={timelineId}
values={values}
applyWidthAndPadding={false}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,26 @@ export interface ThreatSummaryDescription {
}

const EnrichmentFieldFeedName = styled.span`
margin-left: ${({ theme }) => theme.eui.paddingSizes.xs};
white-space: nowrap;
font-style: italic;
`;

export const StyledEuiFlexGroup = styled(EuiFlexGroup)`
.hoverActions-active {
.timelines__hoverActionButton,
.securitySolution__hoverActionButton {
opacity: 1;
}
}
&:hover {
.timelines__hoverActionButton,
.securitySolution__hoverActionButton {
opacity: 1;
}
}
`;

const EnrichmentDescription: React.FC<ThreatSummaryDescription> = ({
browserField,
data,
Expand All @@ -54,9 +69,9 @@ const EnrichmentDescription: React.FC<ThreatSummaryDescription> = ({
if (!data || !value) return null;
const key = `alert-details-value-formatted-field-value-${timelineId}-${eventId}-${data.field}-${value}-${index}-${feedName}`;
return (
<EuiFlexGroup key={key} direction="row" gutterSize="none" alignItems="center">
<StyledEuiFlexGroup key={key} direction="row" gutterSize="xs" alignItems="center">
<EuiFlexItem grow={false}>
<div className="eui-textBreakAll">
<div>
<FormattedFieldValue
contextId={timelineId}
eventId={key}
Expand All @@ -66,9 +81,11 @@ const EnrichmentDescription: React.FC<ThreatSummaryDescription> = ({
isDraggable={isDraggable}
isObjectArray={data.isObjectArray}
value={value}
truncate={false}
/>
{feedName && (
<EnrichmentFieldFeedName>
{' '}
{i18n.FEED_NAME_PREPOSITION} {feedName}
</EnrichmentFieldFeedName>
)}
Expand All @@ -83,10 +100,11 @@ const EnrichmentDescription: React.FC<ThreatSummaryDescription> = ({
fieldFromBrowserField={browserField}
timelineId={timelineId}
values={[value]}
applyWidthAndPadding={false}
/>
)}
</EuiFlexItem>
</EuiFlexGroup>
</StyledEuiFlexGroup>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const EnrichedDataRow: React.FC<{ field: string | undefined; value: React
<EuiFlexItem style={{ flexShrink: 0 }} grow={false}>
<EnrichmentFieldTitle title={field} />
</EuiFlexItem>
<EuiFlexItem>{value}</EuiFlexItem>
<EuiFlexItem className="eui-textBreakWord">{value}</EuiFlexItem>
</StyledEuiFlexGroup>
);

Expand Down

0 comments on commit 54af0cc

Please sign in to comment.