Skip to content

Commit

Permalink
Add quick search to Browser and Interpretation
Browse files Browse the repository at this point in the history
  • Loading branch information
imedina committed Jan 14, 2019
1 parent 00b9c97 commit 76ffb33
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
34 changes: 33 additions & 1 deletion src/conf/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,33 @@ const filterMenu = {
},
skipSubsections: [], // controls which subsections are disabled and should not be displayed
sections: [ // sections and subsections, structure and order is respected
// {
// title: "Clinical Interpretation",
// collapsed: false,
// subsections: [
// {
// id: "sample",
// title: "Sample and File Filters",
// showApproximateCount: true,
// showSelectSamples: true,
// inheritanceModes: [
// {key: "none", text: "Select..."},
// {key: "autoDominant", text: "Autosomal Dominant"},
// {key: "autoRecessive", text: "Autosomal Recessive"},
// {key: "xLinked", text: "X linked"},
// {key: "yLinked", text: "Y linked"}
// ],
// tooltip: "Filter by sample genotypes"
// }
// ]
// },
{
title: "Study and Cohorts",
collapsed: false,
subsections: [
{
id: "sample",
title: "Samples",
title: "Sample and File Filters",
showApproximateCount: true,
showSelectSamples: true,
inheritanceModes: [
Expand Down Expand Up @@ -214,6 +234,18 @@ const filterMenu = {
]
};

// Prepare Browser and Interpretation filter menu
// let browserFilterMenu = Object.assign(filterMenu);
// let browserFilterMenuSections = filterMenu.sections.slice(0);
// browserFilterMenuSections.splice(0, 1);
// browserFilterMenu.sections = browserFilterMenuSections;
// debugger
//
// let interpretationFilterMenu = Object.assign(filterMenu);
// let interpretationFilterMenuSections = filterMenu.sections.slice(0);
// interpretationFilterMenuSections.splice(1, 1);
// interpretationFilterMenu.sections = interpretationFilterMenuSections;

const tools = {
browser: {
title: "Variant Browser",
Expand Down
28 changes: 27 additions & 1 deletion src/iva-app.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
<input type="text" class="form-control" id="searchTextBox"
placeholder="{{config.search.placeholder}}" on-keyup="buildQuery" style="width: 180px;">
<a style="cursor: pointer">
<span class="fa fa-search" aria-hidden="true" on-click="buildQuery"></span>
<span class="fa fa-search" aria-hidden="true" on-click="onQuickSearch"></span>
</a>
</div>
</form>
Expand Down Expand Up @@ -276,6 +276,7 @@
<div class="content" id="interpretation">
<opencga-variant-interpretation opencga-session="{{opencgaSession}}"
cellbase-client="{{cellbaseClient}}"
query="{{interpretationSearchQuery}}"
active="{{config.tools.interpretation.active}}"
population-frequencies="{{config.populationFrequencies}}"
protein-substitution-scores="{{config.proteinSubstitutionScores}}"
Expand Down Expand Up @@ -1092,6 +1093,31 @@
}
}

onQuickSearch(e) {
let gene = PolymerUtils.getValue("searchTextBox");
if (UtilsNew.isNotUndefinedOrNull(this.tool)) {
let _query = {
xref: gene
};
switch (this.tool) {
case "#browser":
window.location.hash = "browser/" + this.opencgaSession.project.alias + "/" + this.opencgaSession.study.alias;
this.browserSearchQuery = _query;
break;
case "#interpretation":
window.location.hash = "interpretation/" + this.opencgaSession.project.alias + "/" + this.opencgaSession.study.alias;
this.interpretationSearchQuery = _query;
break;
default:
this.tool = "#browser";
window.location.hash = "browser/" + this.opencgaSession.project.alias + "/" + this.opencgaSession.study.alias;
this.browserSearchQuery = _query;
break;
}
}
// debugger
}

quickSearch(e) {
debugger
this.tool = "#browser";
Expand Down

0 comments on commit 76ffb33

Please sign in to comment.