Skip to content

Commit

Permalink
Merge pull request #19248 from jmchilton/list_pairs_usability
Browse files Browse the repository at this point in the history
[24.2] Various list of pairs builder usability fixes.
  • Loading branch information
jmchilton authored Dec 9, 2024
2 parents ef968a7 + 3b47ca5 commit 0a11a41
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
27 changes: 23 additions & 4 deletions client/src/components/Collections/PairedListCollectionCreator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ const hasFilter = computed(() => forwardFilter.value || reverseFilter.value);
const strategy = ref(autoPairLCS);
const duplicatePairNames = ref<string[]>([]);
const canClearFilters = computed(() => {
return forwardFilter.value || reverseFilter.value;
});
const canAutoPair = computed(() => {
return forwardFilter.value && reverseFilter.value && pairableElements.value.length > 0;
});
const forwardElements = computed<HDASummary[]>(() => {
return filterElements(workingElements.value, forwardFilter.value);
});
Expand All @@ -117,7 +125,11 @@ const autoPairButton = computed(() => {
let variant;
let icon;
let text;
if (!firstAutoPairDone.value && pairableElements.value.length > 0) {
if (!canAutoPair.value) {
variant = "secondary";
icon = faLink;
text = localize("Specify simple filters to divide datasets into forward and reverse reads for pairing.");
} else if (!firstAutoPairDone.value && pairableElements.value.length > 0) {
variant = "primary";
icon = faExclamationCircle;
text = localize("Click to auto-pair datasets based on the current filters");
Expand Down Expand Up @@ -235,8 +247,11 @@ function initialFiltersSet() {
illumina++;
}
});
if (illumina > dot12s && illumina > Rs) {
// if we cannot filter don't set an initial filter and hide all the data
if (illumina == 0 && dot12s == 0 && Rs == 0) {
forwardFilter.value = "";
reverseFilter.value = "";
} else if (illumina > dot12s && illumina > Rs) {
changeFilters("illumina");
} else if (dot12s > illumina && dot12s > Rs) {
changeFilters("dot12s");
Expand Down Expand Up @@ -1135,6 +1150,7 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
<BButtonGroup vertical>
<BButton
class="clear-filters-link"
:disabled="!canClearFilters"
size="sm"
:variant="hasFilter ? 'danger' : 'secondary'"
@click="clickClearFilters">
Expand All @@ -1143,6 +1159,7 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
</BButton>
<BButton
class="autopair-link"
:disabled="!canAutoPair"
size="sm"
:title="autoPairButton.text"
:variant="autoPairButton.variant"
Expand Down Expand Up @@ -1311,6 +1328,8 @@ $fa-font-path: "../../../node_modules/@fortawesome/fontawesome-free/webfonts/";
@import "~@fortawesome/fontawesome-free/scss/solid";
@import "~@fortawesome/fontawesome-free/scss/fontawesome";
@import "~@fortawesome/fontawesome-free/scss/brands";
@import "~bootstrap/scss/_functions.scss";
@import "theme/blue.scss";
.paired-column {
text-align: center;
// mess with these two to make center more/scss priority
Expand Down Expand Up @@ -1357,7 +1376,7 @@ li.dataset.paired {
white-space: nowrap;
overflow: hidden;
border: 2px solid grey;
background: #aff1af;
background: $state-success-bg;
text-align: center;
span {
display: inline-block;
Expand Down
12 changes: 9 additions & 3 deletions lib/galaxy/selenium/navigates_galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -2052,8 +2051,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 "disabled" not in element.get_attribute("class").split(" "):
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"]
Expand Down
3 changes: 1 addition & 2 deletions lib/galaxy_test/selenium/test_collection_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -61,7 +60,7 @@ def test_build_paired_list_show_original(self):
self._wait_for_and_select([1, 2])
self._collection_dropdown("build list of pairs")
collection_builders = self.components.collection_builders
collection_builders.clear_filters.wait_for_and_click()
self.ensure_collection_builder_filters_cleared()
forward_column = collection_builders.forward_datasets.wait_for_visible()
first_datset_forward = forward_column.find_elements(self.by.CSS_SELECTOR, "li")[0]
first_datset_forward.click()
Expand Down

0 comments on commit 0a11a41

Please sign in to comment.