2017-12-19 13:53:46 +01:00
import { Component , Input } from '@angular/core' ;
2019-07-23 14:23:12 +02:00
import { EnvProperties } from '../../../utils/properties/env-properties' ;
import { ClaimDBContext , ClaimDBProject , ClaimDBResult } from "../claimHelper.class" ;
2017-12-19 13:53:46 +01:00
//Usage Example "<claim-entity [entity]="" [type]="" > </claim-entity>"
//externalUrl
@Component ( {
selector : 'claim-entity' ,
template : `
2021-02-10 11:24:52 +01:00
< div * ngIf = "type == 'publication' || type == 'dataset' || type == 'software' || type == 'other'"
[ title ] = "(type == 'publication'?'Publication':(type == 'dataset'?'research data':(type == 'other'?'other research product':'software')))" >
2022-05-16 13:07:15 +02:00
< div * ngIf = "source" class = "uk-text-meta title uk-margin-small-bottom" > { { type == 'publication' ? 'publication' : ( type == 'dataset' ? 'research data' : ( type == 'other' ? 'other' : 'software' ) ) } } < / div >
2021-02-10 11:24:52 +01:00
< span * ngIf = "!source" class = "title" > Link to { { type == 'publication' ? 'publication' : ( type == 'dataset' ? 'research data' : ( type == 'other' ? 'other' : 'software' ) ) } } : < / span >
2020-04-28 13:07:28 +02:00
< publication - title [ entity ] = " entity " param = "id"
path = "/search/result" [ externalPortalUrl ] = externalPortalUrl > < / p u b l i c a t i o n - t i t l e >
2019-07-23 14:23:12 +02:00
< / div >
2021-02-10 11:24:52 +01:00
2019-07-23 14:23:12 +02:00
< div * ngIf = "type == 'project' " title = "Project" >
2022-05-16 13:07:15 +02:00
< span class = "uk-text-meta title" > Link to project : < / span >
2021-02-10 11:24:52 +01:00
2019-07-23 14:23:12 +02:00
< project - title [ project ] = " entity " [ searchLink ] = properties.searchLinkToProject
[ externalPortalUrl ] = externalPortalUrl > < / p r o j e c t - t i t l e >
< / div >
< div * ngIf = "type == 'context' " title = "Concept" >
2022-05-16 13:07:15 +02:00
< span class = "uk-text-meta title" > Link to community : < / span > { { entity . title } }
2019-07-23 14:23:12 +02:00
< / div >
2017-12-19 13:53:46 +01:00
`
} )
export class ClaimEntityFormatter {
2019-07-23 14:23:12 +02:00
@Input ( ) entity : ClaimDBResult | ClaimDBContext | ClaimDBProject ;
2017-12-19 13:53:46 +01:00
@Input ( ) type : string ;
2018-02-05 14:14:59 +01:00
@Input ( ) properties : EnvProperties ;
2019-07-23 14:23:12 +02:00
@Input ( ) externalPortalUrl : string = null ;
2021-02-10 11:24:52 +01:00
@Input ( ) source : boolean = true ;
2017-12-19 13:53:46 +01:00
2019-07-23 14:23:12 +02:00
constructor ( ) {
}
2017-12-19 13:53:46 +01:00
ngOnInit() {
}
}
2019-07-23 14:23:12 +02:00