Skip to content

Commit 652459f

Browse files
hextrazaSebastian Benjaminbbimber
authored
Lower allowableValues threshold to display multiSelect (#256)
* Lower allowableValues threshold to display multiSelect * Add IMPACT test --------- Co-authored-by: Sebastian Benjamin <sebastiancbenjamin@gmail.com> Co-authored-by: bbimber <bbimber@gmail.com>
1 parent f8ecbb8 commit 652459f

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

jbrowse/src/client/JBrowse/VariantSearch/components/FilterForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ const FilterForm = (props: FilterFormProps ) => {
276276
))}
277277
</Select>
278278
</FormControlMinWidth>
279-
) : fieldTypeInfo.find(obj => obj.name === filter.field)?.allowableValues?.length > 10 ? (
279+
) : fieldTypeInfo.find(obj => obj.name === filter.field)?.allowableValues?.length > 1 ? (
280280
<FormControlMinWidth sx={ highlightedInputs[index]?.value ? highlightedSx : null } >
281281
<AsyncSelect
282282
id={`value-select-${index}`}
@@ -288,6 +288,7 @@ const FilterForm = (props: FilterFormProps ) => {
288288
menuShouldBlockScroll={true}
289289
styles={{menuPortal: base => ({...base, zIndex: 9999})}}
290290
isMulti={fieldTypeInfo.find(obj => obj.name === filter.field)?.isMultiValued}
291+
defaultOptions={fieldTypeInfo.find(obj => obj.name === filter.field)?.allowableValues?.length < 20}
291292
loadOptions={(inputValue, callback) => {
292293
const fieldInfo = fieldTypeInfo.find(obj => obj.name === filter.field);
293294

jbrowse/src/org/labkey/jbrowse/JBrowseController.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import htsjdk.variant.variantcontext.Genotype;
2121
import htsjdk.variant.variantcontext.VariantContext;
2222
import htsjdk.variant.vcf.VCFFileReader;
23-
import htsjdk.variant.vcf.VCFHeaderLineType;
2423
import org.apache.commons.lang3.StringUtils;
2524
import org.apache.logging.log4j.Logger;
2625
import org.jetbrains.annotations.NotNull;

jbrowse/test/src/org/labkey/test/tests/external/labModules/JBrowseTest.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,8 +1713,8 @@ private void testLuceneSearchUI(String sessionId)
17131713
waitForElement(Locator.tagWithText("li", "Impact on Protein Coding")).click();
17141714
waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click();
17151715
waitForElement(Locator.tagWithText("li", "equals")).click();
1716-
waitForElement(Locator.tagWithId("div", "value-select-0")).click();
1717-
waitForElement(Locator.tagWithText("li", "HIGH")).click();
1716+
waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("HI");
1717+
waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys(Keys.ENTER);
17181718
waitAndClick(Locator.tagWithClass("button", "filter-form-select-button"));
17191719
waitForElementToDisappear(Locator.tagWithText("span", "4"));
17201720
clearFilterDialog("IMPACT equals HIGH");
@@ -1798,5 +1798,20 @@ private void testLuceneSearchUI(String sessionId)
17981798
waitAndClick(Locator.tagWithClass("button", "filter-form-select-button"));
17991799
waitForElement(Locator.tagWithText("span", "914"));
18001800
clearFilterDialog("IMPACT is not empty");
1801+
1802+
// IMPACT HIGH+MODERATE
1803+
waitAndClick(Locator.tagWithText("button", "Search"));
1804+
waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "field-label")).click();
1805+
waitForElement(Locator.tagWithText("li", "Impact on Protein Coding")).click();
1806+
waitForElement(Locator.tagWithAttribute("div", "aria-labelledby", "operator-label")).click();
1807+
waitForElement(Locator.tagWithText("li", "equals")).click();
1808+
waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("HI");
1809+
waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys(Keys.ENTER);
1810+
waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys("MO");
1811+
waitForElement(Locator.tagWithId("input", "value-select-0")).sendKeys(Keys.ENTER);
1812+
waitAndClick(Locator.tagWithClass("button", "filter-form-select-button"));
1813+
waitForElement(Locator.tagWithText("span", "0.029"));
1814+
1815+
clearFilterDialog("IMPACT equals HIGH,MODERATE");
18011816
}
18021817
}

0 commit comments

Comments
 (0)