Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
anis
anis-client
Commits
8cfa466c
Commit
8cfa466c
authored
Oct 10, 2019
by
Tifenn Guillas
Browse files
Fix bug display external link in datatable
parent
3b71a463
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/app/search/components/result/datatable.component.html
View file @
8cfa466c
...
...
@@ -52,28 +52,36 @@
<td
*ngFor=
"let attribute of searchMeta.attributes_selected"
class=
"align-middle"
>
<div
*ngIf=
"datum[attribute.label]"
[ngSwitch]=
"getAttributeRenderer(attribute.name)"
>
<div
*ngSwitchCase=
"'img'"
>
<app-img
[src]=
"getAttributeUriAction(attribute.name, datum[attribute.label])"
>
<app-img
[src]=
"getAttributeUriAction(attribute.name, datum[attribute.label])"
>
</app-img>
</div>
<div
*ngSwitchCase=
"'thumbnail'"
>
<app-thumbnail
[attributeName]=
"attribute.name"
<app-thumbnail
[attributeName]=
"attribute.name"
[src]=
"getAttributeUriAction(attribute.name, datum[attribute.label])"
>
</app-thumbnail>
</div>
<div
*ngSwitchCase=
"'link'"
>
<app-link
[href]=
"getAttributeUriAction(attribute.name, datum[attribute.label])"
[data]=
"datum[attribute.name]"
></app-link>
<app-link
[href]=
"getAttributeUriAction(attribute.name, datum[attribute.label])"
>
</app-link>
</div>
<div
*ngSwitchCase=
"'btn'"
>
<app-btn
[href]=
"getAttributeUriAction(attribute.name, datum[attribute.label])"
[data]=
"datum[attribute.name]"
></app-btn>
<app-btn
[href]=
"getAttributeUriAction(attribute.name, datum[attribute.label])"
>
</app-btn>
</div>
<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>
</div>
<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>
</div>
<div
*ngSwitchCase=
"'download'"
>
...
...
@@ -82,7 +90,8 @@
</app-download>
</div>
<div
*ngSwitchCase=
"'json'"
class=
"text-center"
>
<app-json-renderer
[attributeName]=
"attribute.name"
<app-json-renderer
[attributeName]=
"attribute.name"
[json]=
"datum[attribute.label]"
>
</app-json-renderer>
</div>
...
...
src/app/search/components/result/renderer/btn.component.html
View file @
8cfa466c
<a
[href]=
"href"
target=
"_blank"
class=
"btn btn-outline-primary btn-sm"
>
{{
data
}}
{{
href
}}
</a>
\ No newline at end of file
src/app/search/components/result/renderer/btn.component.ts
View file @
8cfa466c
...
...
@@ -7,5 +7,4 @@ import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
})
export
class
BtnComponent
{
@
Input
()
href
:
string
;
@
Input
()
data
:
string
|
number
;
}
src/app/search/components/result/renderer/link.component.html
View file @
8cfa466c
<a
[href]=
"href"
target=
"_blank"
>
{{
data
}}
{{
href
}}
</a>
\ No newline at end of file
src/app/search/components/result/renderer/link.component.ts
View file @
8cfa466c
...
...
@@ -5,7 +5,6 @@ import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
templateUrl
:
'
link.component.html
'
,
changeDetection
:
ChangeDetectionStrategy
.
OnPush
})
export
class
LinkComponent
{
export
class
LinkComponent
{
@
Input
()
href
:
string
;
@
Input
()
data
:
string
|
number
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment