From 9bd854968fd1f64317fc9ff2a2ddf5977d8ae318 Mon Sep 17 00:00:00 2001 From: Krzysztof Date: Fri, 18 Oct 2024 10:59:22 +0200 Subject: [PATCH 1/2] Fix converTagNameToId to use lowercase values --- x-pack/plugins/saved_objects_tagging/public/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/saved_objects_tagging/public/utils.ts b/x-pack/plugins/saved_objects_tagging/public/utils.ts index 38ae79f3ca033..fc8ec8ebd3029 100644 --- a/x-pack/plugins/saved_objects_tagging/public/utils.ts +++ b/x-pack/plugins/saved_objects_tagging/public/utils.ts @@ -45,7 +45,7 @@ export const getTagsFromReferences = (references: SavedObjectReference[], allTag }; export const convertTagNameToId = (tagName: string, allTags: Tag[]): string | undefined => { - const found = allTags.find((tag) => tag.name === tagName); + const found = allTags.find((tag) => tag.name.toLowerCase() === tagName.toLowerCase()); return found?.id; }; From 2dd8ecf2ddf88d6779c0121c590f6344d11a3e0f Mon Sep 17 00:00:00 2001 From: Krzysztof Date: Fri, 18 Oct 2024 11:29:21 +0200 Subject: [PATCH 2/2] Remove redundant lowercase --- .../plugins/global_search_bar/public/components/search_bar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx index efc564089fb43..de9bb85f7a8a3 100644 --- a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx +++ b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx @@ -177,7 +177,7 @@ export const SearchBar: FC = (opts) => { let tagIds: string[] | undefined; if (taggingApi && rawParams.filters.tags) { tagIds = rawParams.filters.tags.map( - (tagName) => taggingApi.ui.getTagIdFromName(tagName.toLowerCase()) ?? UNKNOWN_TAG_ID + (tagName) => taggingApi.ui.getTagIdFromName(tagName) ?? UNKNOWN_TAG_ID ); } else { tagIds = undefined;