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

[8.x] Allow empty spaces un Gsub processor (#197815) #199293

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

Closes [elastic#191920](elastic#191920)

## Summary
In the pattern field of the GSUB processor, we were validating that the
field is not empty. But for this case we must allow spaces as values. To
fix this, I've added a second parameter `trimString` to the `emptyField`
validator. If the parameter is set to true by default so the behavior of
the validator doesn't change in all the fields that already use it. But
when the parameter is set to false, as in this case, the entry value
string is not trimmed, so it only validate to false if the field is
actually empty. I also added some unit tests to make sure that this new
condition doesn't break the validator.

https://github.com/user-attachments/assets/049f7424-00c6-4bb2-ab89-2ce158ac4c4e

#### Notes
In the video it can be seen that a banner flashes when saving. It is a
bug that already happened before this one. I've opened [an
issue](elastic#197810) to address it.

(cherry picked from commit 2f7f8e3)
@kibanamachine kibanamachine force-pushed the backport/8.x/pr-197815 branch from 3e04de0 to da56aca Compare November 7, 2024 11:49
@kibanamachine kibanamachine merged commit 37e030a into elastic:8.x Nov 7, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants