Skip to content
Snippets Groups Projects
Commit 289263c6 authored by AndiMajore's avatar AndiMajore
Browse files

added modular linkout line to info panel

parent bd0ecc54
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,6 @@
</p>
<p
*ngIf="wrapper.data.uniprot"
[ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }"
......@@ -137,6 +136,13 @@
<span class="is-capitalized"> MONDO:{{ wrapper.data.disorderId }}</span>
</a>
</p>
<p *ngIf="showLinks()"
[ngClass]="{ 'text-normal': drugstoneConfig.smallStyle }">
<b><span>Links:</span></b>
<span *ngFor="let target of linkoutMap | keyvalue " >
<a *ngIf="showLinkout(target.key)" [href]="getLinkoutURL(target.key)" target="_blank"> {{target.value}}</a>
</span>
</p>
<p
*ngIf="
drugstoneConfig.currentConfig().nodeGroups[
......@@ -163,6 +169,7 @@
].groupName
}}</span
>
</p>
<app-toggle
......
......@@ -3,6 +3,7 @@ import {DrugstoneConfigService} from 'src/app/services/drugstone-config/drugston
import {Wrapper} from '../../interfaces';
import {AnalysisService} from '../../services/analysis/analysis.service';
import {NetworkHandlerService} from '../../services/network-handler/network-handler.service';
import {validateComponent} from 'codelyzer/walkerFactory/walkerFn';
@Component({
......@@ -14,6 +15,8 @@ export class InfoTileComponent implements OnInit {
@Input() public wrapper: Wrapper;
@Input() public expressions: any;
public linkoutMap = {iid: 'IID'};
constructor(public drugstoneConfig: DrugstoneConfigService, public analysis: AnalysisService, public networkHandler: NetworkHandlerService) {
}
......@@ -22,7 +25,7 @@ export class InfoTileComponent implements OnInit {
}
public getExpressionScore() {
return this.expressions[this.wrapper.id]
return this.expressions[this.wrapper.id];
}
public beautify(url: string): string {
......@@ -46,4 +49,36 @@ export class InfoTileComponent implements OnInit {
}
return out;
}
showLinks() {
const idSpace = this.drugstoneConfig.currentConfig().identifier;
const iidActive = (['symbol', 'uniprot', 'entrez'].includes(idSpace) && this.wrapper.data[idSpace] != null) || this.wrapper.data.uniprot != null;
return iidActive;
}
showLinkout(target) {
const idSpace = this.drugstoneConfig.currentConfig().identifier;
switch (target) {
case 'iid':
return (['symbol', 'uniprot', 'entrez'].includes(idSpace) && this.wrapper.data[idSpace] != null) || this.wrapper.data.uniprot != null;
}
return false;
}
getIIDQuery() {
const idSpace = this.drugstoneConfig.currentConfig().identifier;
if (['symbol', 'uniprot', 'entrez'].includes(idSpace) && this.wrapper.data[idSpace] != null) {
return this.wrapper.data[idSpace][0];
}
return this.wrapper.data.uniprot[0];
}
getLinkoutURL(target) {
// const idSpace = this.drugstoneConfig.currentConfig().identifier;
switch (target) {
case 'iid':
return 'http://iid.ophid.utoronto.ca/SearchPPIs/protein/' + this.getIIDQuery();
}
return '';
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment