From 69d6cd8e4b1b151b9ec08a71232571a4ca554db1 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 4 Dec 2024 10:27:09 -0500 Subject: [PATCH] ListPairs Usability - don't auto-pair on empty filters. Disable the button and make it clear in the message it has to do with empty filters. --- .../Collections/PairedListCollectionCreator.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/client/src/components/Collections/PairedListCollectionCreator.vue b/client/src/components/Collections/PairedListCollectionCreator.vue index ba46d2139934..2f214b759e4a 100644 --- a/client/src/components/Collections/PairedListCollectionCreator.vue +++ b/client/src/components/Collections/PairedListCollectionCreator.vue @@ -93,6 +93,10 @@ const hasFilter = computed(() => forwardFilter.value || reverseFilter.value); const strategy = ref(autoPairLCS); const duplicatePairNames = ref([]); +const canAutoPair = computed(() => { + return forwardFilter.value && reverseFilter.value; +}); + const forwardElements = computed(() => { return filterElements(workingElements.value, forwardFilter.value); }); @@ -117,7 +121,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"); @@ -1141,6 +1149,7 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {