Skip to content
Snippets Groups Projects
Commit 81bfb81e authored by AndiMajore's avatar AndiMajore
Browse files

Merge branch 'master' of gitlab.lrz.de:netex/frontend

parents 22be8fcf 88bd684a
No related branches found
No related tags found
No related merge requests found
<div class="content">
<ng-select [items]="queryItems" bindLabel="id" bindValue="data" [virtualScroll]="true" class="custom"
placeholder="Search..." [hideSelected]="true" [searchFn]="querySearch" (change)="select($event)" pTooltip="Find proteins in the network." tooltipPosition="top">
<ng-select [items]="queryItems" bindLabel="label" bindValue="data" [virtualScroll]="true" class="custom"
placeholder="Search..." [hideSelected]="true" [searchFn]="querySearch" (change)="select($event)" pTooltip="Find nodes in the network." tooltipPosition="top">
<ng-template ng-option-tmp let-item="item">
<b *ngIf="item.data.netexId && item.data.netexId.startsWith('p')"> {{item.data.name}}</b>
<span><small *ngIf="item.data.netexId && item.data.netexId.startsWith('p')">Protein</small> | </span>
<span *ngIf="item.data.netexId && item.data.netexId.startsWith('p')"><small>AC: <b>{{item.data.uniprotAc}}</b></small> </span>
<p>{{item.data.label}}</p>
</ng-template>
</ng-select>
</div>
......@@ -15,7 +15,13 @@ export class QueryTileComponent {
querySearch(term: string, item: Wrapper) {
term = term.toLowerCase();
const data = item.data as Node;
return data.symbol.toLowerCase().indexOf(term) > -1 || data.uniprotAc.toLowerCase().indexOf(term) > -1;
if (data.netexId === undefined) {
return data.label.toLowerCase().indexOf(term) > -1 || data.id.toLowerCase().indexOf(term) > -1
} else {
data.ensg = data.ensg.map(x => x.toLowerCase())
return data.symbol.toLowerCase().indexOf(term) > -1 || data.uniprotAc.toLowerCase().indexOf(term) > -1 ||
data.label.toLowerCase().indexOf(term) > -1 || data.ensg.includes(term) || data.id.toLowerCase().indexOf(term) > -1 ;
}
}
select(item) {
......
......@@ -440,34 +440,33 @@
<i class="fas fa-angle-left" aria-hidden="true"></i>
</span>
</a>
</header>
<div *ngIf="collapseSelection" class="seed-selection" [ngClass]="{'text-normal':smallStyle}">
<div class="card-content overflow">
<table class="table selection-table" *ngIf="analysis.getCount() > 0">
<thead>
<tr>
<td>Label</td>
<td>Actions</td>
</tr>
</thead>
<tbody>
<tr *ngFor="let p of analysis.getSelection()">
<td><p class="is-capitalized">{{p.data.label}}</p></td>
<td>
<button (click)="analysis.removeItems([p])"
class="button is-small is-danger is-outlined has-tooltip"
tooltipPosition="top" pTooltip="Remove from selection.">
<i class="fa fa-trash"></i>
</button>
</td>
</tr>
</tbody>
</table>
<i *ngIf="analysis.getCount() === 0">
Double-click on a protein to select it for the analysis.
</i>
</div>
</a>
</header>
<div *ngIf="collapseSelection" class="seed-selection" [ngClass]="{'text-normal':smallStyle}">
<!-- <div class="card-content overflow">
<table class="table selection-table" *ngIf="analysis.getCount() > 0">
<thead>
<tr>
<td>Label</td>
<td>Actions</td>
</tr>
</thead>
<tbody>
<tr *ngFor="let p of analysis.getSelection()">
<td><p class="is-capitalized">{{p.data.label}}</p></td>
<td>
<button (click)="analysis.removeItems([p])" class="button is-small is-danger is-outlined has-tooltip"
tooltipPosition="top" pTooltip="Remove from selection.">
<i class="fa fa-trash"></i>
</button>
</td>
</tr>
</tbody>
</table>
<i *ngIf="analysis.getCount() === 0">
Double-click on a protein to select it for the analysis.
</i>
</div>
<footer class="card-footer" *ngIf="selectedAnalysisToken">
<a (click)="analysis.addSeeds(currentViewNodes)"
......@@ -511,10 +510,10 @@
<span>
Tissue proteins
</span>
</a>
</footer>
</a>
</footer> -->
<footer class="card-footer">
<!-- <footer class="card-footer">
<a (click)="analysis.invertSelection(currentViewNodes)" class="card-footer-item text-primary"
tooltipPosition="top" pTooltip="Invert the current selection.">
<span class="icon">
......@@ -533,7 +532,7 @@
Reset
</span>
</a>
</footer>
</footer> -->
</div>
</div>
......
......@@ -157,9 +157,10 @@ export class AnalysisService {
public invertSelection(nodes) {
const newSelection = [];
nodes.forEach((node) => {
if (!this.inSelection(node)) {
newSelection.push(node);
nodes.forEach((node: Node) => {
const wrapper = getWrapperFromNode(node);
if (!this.inSelection(wrapper)) {
newSelection.push(wrapper);
}
});
this.selectedItems.clear();
......
......@@ -191,7 +191,6 @@ a:hover {
}
.p-tooltip-text, .p-tooltip-arrow {
background: var(--drgstn-tooltip) !important;
border-radius: 2px !important;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment