Skip to content

Commit

Permalink
ListPairs Usability - don't auto-pair on empty filters.
Browse files Browse the repository at this point in the history
Disable the button and make it clear in the message it has to do with empty filters.
  • Loading branch information
jmchilton committed Dec 5, 2024
1 parent 0f84879 commit 69d6cd8
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ const hasFilter = computed(() => forwardFilter.value || reverseFilter.value);
const strategy = ref(autoPairLCS);
const duplicatePairNames = ref<string[]>([]);
const canAutoPair = computed(() => {
return forwardFilter.value && reverseFilter.value;
});
const forwardElements = computed<HDASummary[]>(() => {
return filterElements(workingElements.value, forwardFilter.value);
});
Expand All @@ -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");
Expand Down Expand Up @@ -1141,6 +1149,7 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
</BButton>
<BButton
class="autopair-link"
:disabled="!canAutoPair"
size="sm"
:title="autoPairButton.text"
:variant="autoPairButton.variant"
Expand Down

0 comments on commit 69d6cd8

Please sign in to comment.