-
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
[Global Search] Fix convertTagNameToId to use lowercase values #196819
[Global Search] Fix convertTagNameToId to use lowercase values #196819
Conversation
Pinging @elastic/appex-sharedux (Team:SharedUX) |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Page load bundle
History
|
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! Tested locally and works as expected 👍
Starting backport for target branches: 8.x |
…ic#196819) ## Summary This PR fixes a bug which caused mixed case tags to not be found in global search. Fixes: elastic#196168 The `allTags` argument contains tags with names in the original case they were created but the `tagName` argument passed in [search_bar.tsx:180](https://github.com/elastic/kibana/blob/main/x-pack/plugins/global_search_bar/public/components/search_bar.tsx#L180) is lowercase. Since you can't have tags with the same name but different casing, converting them to lowercase is safe. I've also added lowercase conversion to `tagName` argument in case this function gets called somewhere else and the input is not lowercase. (cherry picked from commit b495c37)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…196819) (#197193) # Backport This will backport the following commits from `main` to `8.x`: - [[Global Search] Fix convertTagNameToId to use lowercase values (#196819)](#196819) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Krzysztof Kowalczyk","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-22T09:40:42Z","message":"[Global Search] Fix convertTagNameToId to use lowercase values (#196819)\n\n## Summary\r\n\r\nThis PR fixes a bug which caused mixed case tags to not be found in\r\nglobal search.\r\nFixes: #196168\r\n\r\nThe `allTags` argument contains tags with names in the original case\r\nthey were created but the `tagName` argument passed in\r\n[search_bar.tsx:180](https://github.com/elastic/kibana/blob/main/x-pack/plugins/global_search_bar/public/components/search_bar.tsx#L180)\r\nis lowercase. Since you can't have tags with the same name but different\r\ncasing, converting them to lowercase is safe.\r\n\r\nI've also added lowercase conversion to `tagName` argument in case this\r\nfunction gets called somewhere else and the input is not lowercase.","sha":"b495c371fd946f39341a557599033647f81cdbf3","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Feature:Navigational Search","Team:SharedUX","backport:prev-minor"],"title":"[Global Search] Fix convertTagNameToId to use lowercase values","number":196819,"url":"https://github.com/elastic/kibana/pull/196819","mergeCommit":{"message":"[Global Search] Fix convertTagNameToId to use lowercase values (#196819)\n\n## Summary\r\n\r\nThis PR fixes a bug which caused mixed case tags to not be found in\r\nglobal search.\r\nFixes: #196168\r\n\r\nThe `allTags` argument contains tags with names in the original case\r\nthey were created but the `tagName` argument passed in\r\n[search_bar.tsx:180](https://github.com/elastic/kibana/blob/main/x-pack/plugins/global_search_bar/public/components/search_bar.tsx#L180)\r\nis lowercase. Since you can't have tags with the same name but different\r\ncasing, converting them to lowercase is safe.\r\n\r\nI've also added lowercase conversion to `tagName` argument in case this\r\nfunction gets called somewhere else and the input is not lowercase.","sha":"b495c371fd946f39341a557599033647f81cdbf3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196819","number":196819,"mergeCommit":{"message":"[Global Search] Fix convertTagNameToId to use lowercase values (#196819)\n\n## Summary\r\n\r\nThis PR fixes a bug which caused mixed case tags to not be found in\r\nglobal search.\r\nFixes: #196168\r\n\r\nThe `allTags` argument contains tags with names in the original case\r\nthey were created but the `tagName` argument passed in\r\n[search_bar.tsx:180](https://github.com/elastic/kibana/blob/main/x-pack/plugins/global_search_bar/public/components/search_bar.tsx#L180)\r\nis lowercase. Since you can't have tags with the same name but different\r\ncasing, converting them to lowercase is safe.\r\n\r\nI've also added lowercase conversion to `tagName` argument in case this\r\nfunction gets called somewhere else and the input is not lowercase.","sha":"b495c371fd946f39341a557599033647f81cdbf3"}}]}] BACKPORT--> Co-authored-by: Krzysztof Kowalczyk <[email protected]>
Summary
This PR fixes a bug which caused mixed case tags to not be found in global search.
Fixes: #196168
The
allTags
argument contains tags with names in the original case they were created but thetagName
argument passed in search_bar.tsx:180 is lowercase. Since you can't have tags with the same name but different casing, converting them to lowercase is safe.I've also added lowercase conversion to
tagName
argument in case this function gets called somewhere else and the input is not lowercase.