From 50fb505b46937b2ab6bfc74971d018ca2bcfe317 Mon Sep 17 00:00:00 2001 From: AndiMajore <andi.majore@googlemail.com> Date: Thu, 29 Jul 2021 17:01:21 +0200 Subject: [PATCH] query filter fixed --- .../network-legend/network-legend.component.html | 8 ++++---- src/app/components/query-tile/query-tile.component.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/components/network-legend/network-legend.component.html b/src/app/components/network-legend/network-legend.component.html index 51ce68e0..8bc8d9fc 100644 --- a/src/app/components/network-legend/network-legend.component.html +++ b/src/app/components/network-legend/network-legend.component.html @@ -11,7 +11,7 @@ <th> <img [src]="nodeGroup.value.image" class="legend-icon"/> </th> - <td> {{ nodeGroup.value.groupName }}</td> + <td class="group-name"> {{ 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"> {{ 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> {{ edgeGroup.value.groupName }}</td> + <td class="group-name"> {{ edgeGroup.value.groupName }}</td> </ng-container> </tr> </ng-container> diff --git a/src/app/components/query-tile/query-tile.component.ts b/src/app/components/query-tile/query-tile.component.ts index c0ec32c6..3dfb6525 100644 --- a/src/app/components/query-tile/query-tile.component.ts +++ b/src/app/components/query-tile/query-tile.component.ts @@ -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; } -- GitLab