From a236e0be0026caeada9c40c16b188c5db7be3b3f Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Tue, 17 Oct 2023 10:00:14 -0500 Subject: [PATCH] search all tags for unquoted (non-name tag) query --- client/src/utils/filtering.ts | 2 +- lib/galaxy/model/index_filter_util.py | 8 +++++++- lib/galaxy_test/selenium/test_workflow_management.py | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/src/utils/filtering.ts b/client/src/utils/filtering.ts index c3cd711f4ada..e717313e8fbb 100644 --- a/client/src/utils/filtering.ts +++ b/client/src/utils/filtering.ts @@ -553,7 +553,7 @@ export default class Filtering { ) { const { converter } = this.validFilters[filterName]?.handler as HandlerReturn; if (converter) { - if (converter == toBool && filterValue == "any") { + if ((converter == toBool && filterValue == "any") || /^(['"]).*\1$/.test(filterValue as string)) { return filterValue; } else if (!backendFormatted && ([expandNameTag, toDate] as Converter[]).includes(converter)) { return toLower(filterValue) as T; diff --git a/lib/galaxy/model/index_filter_util.py b/lib/galaxy/model/index_filter_util.py index 76a5ee6256f9..fc7693b9da09 100644 --- a/lib/galaxy/model/index_filter_util.py +++ b/lib/galaxy/model/index_filter_util.py @@ -52,7 +52,13 @@ def tag_filter(assocation_model_class, term_text, quoted: bool = False): ) else: if not quoted: - return assocation_model_class.user_tname.ilike(f"%{term_text}%") + return or_( + assocation_model_class.user_tname.ilike(f"%{term_text}%"), + and_( + assocation_model_class.user_tname.ilike("name"), + assocation_model_class.user_value.ilike(f"%{term_text}%"), + ), + ) else: return assocation_model_class.user_tname == term_text diff --git a/lib/galaxy_test/selenium/test_workflow_management.py b/lib/galaxy_test/selenium/test_workflow_management.py index e3f2304f6a46..235eff452d83 100644 --- a/lib/galaxy_test/selenium/test_workflow_management.py +++ b/lib/galaxy_test/selenium/test_workflow_management.py @@ -207,10 +207,10 @@ def test_index_advanced_search(self): self.components.workflows.advanced_search_toggle.wait_for_and_click() # search by 2 tags, one of which is not present self.components.workflows.advanced_search_tag_input.wait_for_and_click() - self.tagging_add(["mytag", "DNEtag"]) + self.tagging_add(["'mytag'", "'DNEtag'"]) self.components.workflows.advanced_search_submit.wait_for_and_click() curr_value = self.workflow_index_get_current_filter() - assert curr_value == "tag:mytag tag:DNEtag", curr_value + assert curr_value == "tag:'mytag' tag:'DNEtag'", curr_value self._assert_showing_n_workflows(0) @selenium_test