Skip to content
Snippets Groups Projects
Commit 50fb505b authored by AndiMajore's avatar AndiMajore
Browse files

query filter fixed

parent 0ff27b04
No related merge requests found
......@@ -11,7 +11,7 @@
<th>
<img [src]="nodeGroup.value.image" class="legend-icon"/>
</th>
<td>&nbsp;{{ nodeGroup.value.groupName }}</td>
<td class="group-name">&nbsp;{{ nodeGroup.value.groupName }}</td>
</ng-container>
<ng-container *ngIf="!nodeGroup.value.image" [ngSwitch]="nodeGroup.value.shape">
......@@ -51,11 +51,11 @@
<span class="node circle" [style.background-color]=nodeGroup.value.color.background>
...
</span>
</th>
</th>
<th *ngSwitchDefault>
<span class="node {{ nodeGroup.value.shape }}" [style.background-color]=nodeGroup.value.color.background>
</span>
</th>
</th>
<td class="group-name">&nbsp;{{ nodeGroup.value.groupName }}</td>
</ng-container>
</ng-container>
......@@ -70,7 +70,7 @@
<hr *ngIf="!edgeGroup.value.dashes" class="edge" [style.background-color]=edgeGroup.value.color>
<hr *ngIf="edgeGroup.value.dashes" class="edge dashes" [style.color]=edgeGroup.value.color>
</th>
<td>&nbsp;{{ edgeGroup.value.groupName }}</td>
<td class="group-name">&nbsp;{{ edgeGroup.value.groupName }}</td>
</ng-container>
</tr>
</ng-container>
......
......@@ -24,7 +24,7 @@ export class QueryTileComponent {
querySearch = (term: string, item: Wrapper) => {
term = term.toLowerCase();
const data = JSON.parse(JSON.stringify(item.data));
const data = {...item.data}
// add possible missing attributes to not throw errors
if (data.ensg === undefined) {data.ensg = []};
if (data.groupName === undefined) {data.groupName = ''};
......@@ -34,9 +34,9 @@ export class QueryTileComponent {
if (data.uniprotAc === undefined) {data.uniprotAc = ''};
if (data.drugId === undefined) {data.drugId = ''};
return data.symbol.toLowerCase().indexOf(term) > -1 || data.uniprotAc.toLowerCase().indexOf(term) > -1 ||
data.label.toLowerCase().indexOf(term) > -1 || this.listStartsWith(data.ensg, term) || data.id.toLowerCase().indexOf(term) > -1
|| data.proteinName.toLowerCase().indexOf(term) > -1 || data.type.toLowerCase().indexOf(term) > -1 ||
return data.symbol.toLowerCase().indexOf(term) > -1 || data.uniprotAc.toLowerCase().indexOf(term) > -1 ||
data.label.toLowerCase().indexOf(term) > -1 || this.listStartsWith(data.ensg, term) || data.id.toLowerCase().indexOf(term) > -1
|| data.proteinName.toLowerCase().indexOf(term) > -1 || data.type.toLowerCase().indexOf(term) > -1 ||
data.groupName.toLowerCase().indexOf(term) > -1 || data.drugId.toLowerCase().indexOf(term) > -1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment