Skip to content

Commit

Permalink
search all tags for unquoted (non-name tag) query
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Oct 17, 2023
1 parent fab8b6c commit a236e0b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/src/utils/filtering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ export default class Filtering<T> {
) {
const { converter } = this.validFilters[filterName]?.handler as HandlerReturn<T>;
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<T>[]).includes(converter)) {
return toLower(filterValue) as T;
Expand Down
8 changes: 7 additions & 1 deletion lib/galaxy/model/index_filter_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy_test/selenium/test_workflow_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a236e0b

Please sign in to comment.