-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cases] [104932] Remove newline characters from summary field and add tests #113571
[Cases] [104932] Remove newline characters from summary field and add tests #113571
Conversation
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Pinging @elastic/security-threat-hunting-cases (Team:Threat Hunting:Cases) |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
const trimAndRemoveNewlines = (str: string) => | ||
str | ||
.split(/[\n\r]/gm) | ||
.filter((item) => !isEmpty(item.trim())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if we swap the two operations we can get away with the second trim
call.
.map((item) => item.trim())
.filter((item) => !isEmpty(item))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, @jamster10 I'd add Christos' suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorted 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @jamster10 |
… tests (elastic#113571) * [104932] Remove newline characters from summary field and add tests * PR fix Co-authored-by: Kristof-Pierre Cummings <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
… tests (elastic#113571) * [104932] Remove newline characters from summary field and add tests * PR fix Co-authored-by: Kristof-Pierre Cummings <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
… tests (#113571) (#113669) * [104932] Remove newline characters from summary field and add tests * PR fix Co-authored-by: Kristof-Pierre Cummings <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kristof C <[email protected]> Co-authored-by: Kristof-Pierre Cummings <[email protected]>
… tests (#113571) (#113668) * [104932] Remove newline characters from summary field and add tests * PR fix Co-authored-by: Kristof-Pierre Cummings <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kristof C <[email protected]> Co-authored-by: Kristof-Pierre Cummings <[email protected]>
Issue: #104932
Summary
Prevent summary field from having newline characters and extraneous spaces by trimming and removing said characters.
Description with multlines
Jira ticket summary created from multiline rule description ({{context.rule.description}})
Release notes
Reformatting Jira summary field to be one line