From 072b209c84594ba119310f93ca50647e6cb464d5 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 4 Dec 2024 11:05:55 -0500 Subject: [PATCH] ListPairs Usability - disable the clear filter button if nothing to clear. --- .../Collections/PairedListCollectionCreator.vue | 5 +++++ lib/galaxy/selenium/navigates_galaxy.py | 12 +++++++++--- lib/galaxy_test/selenium/test_collection_builders.py | 1 - 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/client/src/components/Collections/PairedListCollectionCreator.vue b/client/src/components/Collections/PairedListCollectionCreator.vue index c34f11a6a670..8fe179718645 100644 --- a/client/src/components/Collections/PairedListCollectionCreator.vue +++ b/client/src/components/Collections/PairedListCollectionCreator.vue @@ -91,6 +91,10 @@ const hasFilter = computed(() => forwardFilter.value || reverseFilter.value); const strategy = ref(autoPairLCS); const duplicatePairNames = ref([]); +const canClearFilters = computed(() => { + return forwardFilter.value || reverseFilter.value; +}); + const canAutoPair = computed(() => { return forwardFilter.value && reverseFilter.value; }); @@ -1140,6 +1144,7 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) { diff --git a/lib/galaxy/selenium/navigates_galaxy.py b/lib/galaxy/selenium/navigates_galaxy.py index 141d6e1c28ec..0f0063a5d1df 100644 --- a/lib/galaxy/selenium/navigates_galaxy.py +++ b/lib/galaxy/selenium/navigates_galaxy.py @@ -914,8 +914,7 @@ def upload_paired_list(self, test_paths, name="test", ext=None, genome=None, hid if not hide_source_items: self.collection_builder_hide_originals() - self.collection_builder_clear_filters() - # TODO: generalize and loop these clicks so we don't need the assert + self.ensure_collection_builder_filters_cleared() assert len(test_paths) == 2 self.collection_builder_click_paired_item("forward", 0) self.collection_builder_click_paired_item("reverse", 1) @@ -2053,8 +2052,15 @@ def collection_builder_hide_originals(self): def collection_builder_create(self): self.wait_for_and_click_selector("button.create-collection") + def ensure_collection_builder_filters_cleared(self): + clear_filters = self.components.collection_builders.clear_filters + element = clear_filters.wait_for_present() + if not element.has_class("disabled"): + self.collection_builder_clear_filters() + def collection_builder_clear_filters(self): - self.wait_for_and_click_selector("button.clear-filters-link") + clear_filters = self.components.collection_builders.clear_filters + clear_filters.wait_for_and_click() def collection_builder_click_paired_item(self, forward_or_reverse, item): assert forward_or_reverse in ["forward", "reverse"] diff --git a/lib/galaxy_test/selenium/test_collection_builders.py b/lib/galaxy_test/selenium/test_collection_builders.py index 24b47a825cf3..b6e8bb260956 100644 --- a/lib/galaxy_test/selenium/test_collection_builders.py +++ b/lib/galaxy_test/selenium/test_collection_builders.py @@ -39,7 +39,6 @@ def test_build_paired_list_simple(self): self.perform_upload(self.get_filename("2.tabular")) self._wait_for_and_select([1, 2]) self._collection_dropdown("build list of pairs") - self.collection_builder_clear_filters() self.collection_builder_click_paired_item("forward", 0) self.collection_builder_click_paired_item("reverse", 1) self.collection_builder_set_name("my awesome paired list")