Skip to content
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

Fixing leading or trailing whitespace in exception entries #138904

Conversation

WafaaNasr
Copy link
Contributor

@WafaaNasr WafaaNasr commented Aug 16, 2022

Addresses #83645

  • The UX team approved the UI approach
  • Add param_contains_space utility to check if parameter contains any kind of spaces with adding tests
  • Handled the warning in the following components field_value_match, field_value_match_any and field_value_wildcard
  • Added the new warning text translations
  • While working on this ticket, I noticed that there is a room for refactoring on the builder side as there are some methods can be moved to a common place "for ex, hook"=> will discuss this point with the team.
  • While testing this component, I found very minor bug, happens when the user enters an invalid date then change the
    Field, the value doesn't get cleared out=> will create a bug for it

Summary

In Exception screen, showing a helper text message to warn the users when they enter a value(s) contain spaces

Checklist

Testing only two operators is and matches

Screen.Recording.2022-08-16.at.14.43.26.mov

Showing Info Icon in the Exception Viewer

Screen.Recording.2022-08-26.at.18.19.16.mov

@WafaaNasr WafaaNasr added release_note:fix Team:Security Solution Platform Security Solution Platform Team ci:cloud-deploy Create or update a Cloud deployment labels Aug 16, 2022
@WafaaNasr WafaaNasr requested a review from a team as a code owner August 16, 2022 12:28
@WafaaNasr WafaaNasr added the WIP Work in progress label Aug 16, 2022
@WafaaNasr
Copy link
Contributor Author

@elasticmachine merge upstream

2 similar comments
@WafaaNasr
Copy link
Contributor Author

@elasticmachine merge upstream

@WafaaNasr
Copy link
Contributor Author

@elasticmachine merge upstream

@WafaaNasr WafaaNasr added Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. and removed WIP Work in progress labels Aug 18, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@WafaaNasr WafaaNasr force-pushed the fix/83645-leading-or-trailing-whitespace-exception branch from 1b74390 to 6a907f3 Compare August 18, 2022 12:49
@WafaaNasr WafaaNasr requested a review from a team August 18, 2022 13:31
@nastasha-solomon
Copy link
Contributor

@elastic/security-docs the following UI text has been added to this PR and needs review:
Warning: there is whitespace that isn't being displayed

This will PR will likely be merged in 8.5 or later. @WafaaNasr will confirm the release it's scheduled for :)

@WafaaNasr
Copy link
Contributor Author

@elastic/security-docs the following UI text has been added to this PR and needs review: Warning: there is whitespace that isn't being displayed

This will PR will likely be merged in 8.5 or later. @WafaaNasr will confirm the release it's scheduled for :)

It should be for the 8.5 release :)

@WafaaNasr
Copy link
Contributor Author

@elasticmachine merge upstream

1 similar comment
@WafaaNasr
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@nkhristinin nkhristinin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on cloud, LGTM!

@WafaaNasr WafaaNasr self-assigned this Aug 23, 2022
@nastasha-solomon
Copy link
Contributor

nastasha-solomon commented Aug 24, 2022

@WafaaNasr here are some revisions for your consideration:

  • Option 1: Warning: This value has leading or trailing whitespace.
  • Option 2: Warning: Whitespace is included at the start or end of this value.
  • Option 3: Warning: Extra spaces are present at the start or end of this value.

One thing to note: I think this warning message is appropriate for the exception editor, but I don't think it works for the exceptions list-- especially if multiple values are specified for a field. For the exceptions list, something like the following would be more appropriate:

  • Option 1: Warning: Whitespace is included at the start or end of a value.
  • Option 2: Warning: Extra spaces are present at the start or end of a value.

@joepeeples I could actually use your thoughts on this. Here's some background for the warning:

With this message, we're aiming to inform users that a value they’ve entered or selected has one or more empty spaces (whitespaces) at the front/end of it. A major reason we’re sharing this information is because an EUI component visually cuts off extra spaces before/after the value once you enter it. This means the extra spaces will remain present in the exception query after you save it, you just won’t be able to see them when building the exception or viewing it (after you’ve saved it).

A couple of other things to note:

  • We’re not looking to push users towards any additional actions, such as removing the extra spaces. The aim here is really just to inform.
  • This message (or messages) will be displayed on the exception editor and the exception list on the Exceptions tab.

Exception editor
The last two values are highlighted because they contain white spaces. Note that the warning message first displays after the second value is entered. It displays again (or persists?) when the third value is entered.

exception-editor

Exceptions viewer
Comments are in the screenshot below.
exceptions-viewer

@WafaaNasr
Copy link
Contributor Author

@elasticmachine merge upstream

@WafaaNasr
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

kibana-ci commented Aug 29, 2022

💔 Build Failed

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lists 306 307 +1
securitySolution 3017 3020 +3
total +4

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/securitysolution-autocomplete 35 38 +3

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lists 147.4KB 148.1KB +806.0B
securitySolution 5.7MB 5.7MB +1.0KB
total +1.8KB
Unknown metric groups

API count

id before after diff
@kbn/securitysolution-autocomplete 50 53 +3

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @WafaaNasr

@WafaaNasr
Copy link
Contributor Author

@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:cloud-deploy Create or update a Cloud deployment release_note:fix Team:Security Solution Platform Security Solution Platform Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants