Skip to content

Commit

Permalink
Preserve whitespace on display of rule queries
Browse files Browse the repository at this point in the history
This is useful for all rules, but particularly for EQL rules, where
sequences will be multiline.
  • Loading branch information
rylnd committed Oct 13, 2020
1 parent 0587cf0 commit 14bf12c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const EuiBadgeWrap = (styled(EuiBadge)`
}
` as unknown) as typeof EuiBadge;

const Query = styled.div`
white-space: pre-wrap;
`;

export const buildQueryBarDescription = ({
field,
filters,
Expand Down Expand Up @@ -92,8 +96,8 @@ export const buildQueryBarDescription = ({
items = [
...items,
{
title: <>{queryLabel ?? i18n.QUERY_LABEL} </>,
description: <>{query} </>,
title: <>{queryLabel ?? i18n.QUERY_LABEL}</>,
description: <Query>{query}</Query>,
},
];
}
Expand Down

0 comments on commit 14bf12c

Please sign in to comment.