[Connect]: 1. resultLanding.service.ts: Enermaps details as string. 2. resultLanding.component.html: In enermaps details, show "words" starting with "http://" or "https://" as links.

This commit is contained in:
Konstantina Galouni 2021-08-23 17:55:30 +03:00
parent 18dd1379ad
commit d7c7a18f51
2 changed files with 8 additions and 2 deletions

View File

@ -438,7 +438,13 @@
<ng-container *ngFor="let detail of enermapsDetails">
<li *ngIf="detail[0] && detail[1]">
<span class="uk-text-muted">{{detail[0]}}: </span>
<span>{{detail[1]}}</span>
<span>
<ng-container *ngFor="let word of detail[1].split(' ')">
<ng-container *ngIf="!word.startsWith('http://') && !word.startsWith('https://')">{{word}} </ng-container>
<a *ngIf="word.startsWith('http://') || word.startsWith('https://')"
target="_blank" [href]="word">{{word}} </a>
</ng-container>
</span>
</li>
</ng-container>
</ul>

View File

@ -501,7 +501,7 @@ export class ResultLandingService {
let keys = metadata ? Object.keys(metadata) : null;
for(let key of keys) {
if(key != "shared_id" && key && metadata[key]) {
entries.push([key, metadata[key]]);
entries.push([key+"", metadata[key]+""]);
}
}
return entries;