Commit 8cfa466c authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Fix bug display external link in datatable

parent 3b71a463
...@@ -52,28 +52,36 @@ ...@@ -52,28 +52,36 @@
<td *ngFor="let attribute of searchMeta.attributes_selected" class="align-middle"> <td *ngFor="let attribute of searchMeta.attributes_selected" class="align-middle">
<div *ngIf="datum[attribute.label]" [ngSwitch]="getAttributeRenderer(attribute.name)"> <div *ngIf="datum[attribute.label]" [ngSwitch]="getAttributeRenderer(attribute.name)">
<div *ngSwitchCase="'img'"> <div *ngSwitchCase="'img'">
<app-img [src]="getAttributeUriAction(attribute.name, datum[attribute.label])"> <app-img
[src]="getAttributeUriAction(attribute.name, datum[attribute.label])">
</app-img> </app-img>
</div> </div>
<div *ngSwitchCase="'thumbnail'"> <div *ngSwitchCase="'thumbnail'">
<app-thumbnail [attributeName]="attribute.name" <app-thumbnail
[attributeName]="attribute.name"
[src]="getAttributeUriAction(attribute.name, datum[attribute.label])"> [src]="getAttributeUriAction(attribute.name, datum[attribute.label])">
</app-thumbnail> </app-thumbnail>
</div> </div>
<div *ngSwitchCase="'link'"> <div *ngSwitchCase="'link'">
<app-link [href]="getAttributeUriAction(attribute.name, datum[attribute.label])" <app-link
[data]="datum[attribute.name]"></app-link> [href]="getAttributeUriAction(attribute.name, datum[attribute.label])">
</app-link>
</div> </div>
<div *ngSwitchCase="'btn'"> <div *ngSwitchCase="'btn'">
<app-btn [href]="getAttributeUriAction(attribute.name, datum[attribute.label])" <app-btn
[data]="datum[attribute.name]"></app-btn> [href]="getAttributeUriAction(attribute.name, datum[attribute.label])">
</app-btn>
</div> </div>
<div *ngSwitchCase="'detail-link'"> <div *ngSwitchCase="'detail-link'">
<app-detail-link [datasetName]="datasetName" [data]="datum[attribute.label]"> <app-detail-link
[datasetName]="datasetName"
[data]="datum[attribute.label]">
</app-detail-link> </app-detail-link>
</div> </div>
<div *ngSwitchCase="'detail-btn'"> <div *ngSwitchCase="'detail-btn'">
<app-detail-btn [datasetName]="datasetName" [data]="datum[attribute.label]"> <app-detail-btn
[datasetName]="datasetName"
[data]="datum[attribute.label]">
</app-detail-btn> </app-detail-btn>
</div> </div>
<div *ngSwitchCase="'download'"> <div *ngSwitchCase="'download'">
...@@ -82,7 +90,8 @@ ...@@ -82,7 +90,8 @@
</app-download> </app-download>
</div> </div>
<div *ngSwitchCase="'json'" class="text-center"> <div *ngSwitchCase="'json'" class="text-center">
<app-json-renderer [attributeName]="attribute.name" <app-json-renderer
[attributeName]="attribute.name"
[json]="datum[attribute.label]"> [json]="datum[attribute.label]">
</app-json-renderer> </app-json-renderer>
</div> </div>
......
<a [href]="href" target="_blank" class="btn btn-outline-primary btn-sm"> <a [href]="href" target="_blank" class="btn btn-outline-primary btn-sm">
{{ data }} {{ href }}
</a> </a>
\ No newline at end of file
...@@ -7,5 +7,4 @@ import { Component, Input, ChangeDetectionStrategy } from '@angular/core'; ...@@ -7,5 +7,4 @@ import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
}) })
export class BtnComponent { export class BtnComponent {
@Input() href: string; @Input() href: string;
@Input() data: string | number;
} }
<a [href]="href" target="_blank"> <a [href]="href" target="_blank">
{{ data }} {{ href }}
</a> </a>
\ No newline at end of file
...@@ -5,7 +5,6 @@ import { Component, Input, ChangeDetectionStrategy } from '@angular/core'; ...@@ -5,7 +5,6 @@ import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
templateUrl: 'link.component.html', templateUrl: 'link.component.html',
changeDetection: ChangeDetectionStrategy.OnPush changeDetection: ChangeDetectionStrategy.OnPush
}) })
export class LinkComponent { export class LinkComponent{
@Input() href: string; @Input() href: string;
@Input() data: string | number;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment