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';
|
2024-05-09 15:44:54 +02:00
|
|
|
import {ClaimDBContext, ClaimDBOrganization, ClaimDBProject, ClaimDBResult} from "../claimHelper.class";
|
2022-07-05 15:41:11 +02:00
|
|
|
import {OpenaireEntities} from "../../../utils/properties/searchFields";
|
|
|
|
import {StringUtils} from "../../../utils/string-utils.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'"
|
2022-07-05 15:41:11 +02:00
|
|
|
[attr.uk-tooptip]="getEntityName(type)">
|
|
|
|
<div *ngIf="source" class="uk-text-small">
|
|
|
|
{{getEntityName(type)}}
|
|
|
|
</div>
|
2024-03-28 12:07:11 +01:00
|
|
|
<div>
|
|
|
|
<span *ngIf="!source" class="uk-text-meta uk-text-small uk-margin-small-right uk-text-nowrap">Link to:</span>
|
2022-07-05 15:41:11 +02:00
|
|
|
<publication-title [entity]="entity" param="id"
|
2024-01-24 11:14:40 +01:00
|
|
|
path="/search/result" [externalPortalUrl]=externalPortalUrl [linkAvailable]="linkAvailable"></publication-title>
|
2022-07-05 15:41:11 +02:00
|
|
|
</div>
|
2019-07-23 14:23:12 +02:00
|
|
|
</div>
|
2024-03-28 12:07:11 +01:00
|
|
|
<div *ngIf="type == 'project'" [attr.uk-tooptip]="getEntityName(type)">
|
|
|
|
<span class="uk-text-meta uk-text-small uk-margin-small-right uk-text-nowrap">Link to:</span>
|
2019-07-23 14:23:12 +02:00
|
|
|
<project-title [project]="entity" [searchLink]=properties.searchLinkToProject
|
|
|
|
[externalPortalUrl]=externalPortalUrl></project-title>
|
|
|
|
</div>
|
2024-05-09 15:44:54 +02:00
|
|
|
<div *ngIf="type == 'organization'" [attr.uk-tooptip]="getEntityName(type)">
|
|
|
|
<span class="uk-text-meta uk-text-small uk-margin-small-right uk-text-nowrap">Link to:</span>
|
|
|
|
<organization-title [organization]="entity"></organization-title>
|
|
|
|
</div>
|
2024-03-28 12:07:11 +01:00
|
|
|
<div *ngIf="type == 'context'">
|
|
|
|
<span class="uk-text-meta uk-text-small uk-margin-small-right uk-text-nowrap">Link to:</span>
|
|
|
|
<h6 class="uk-h6 uk-margin-remove">
|
|
|
|
<span class="uk-text-truncate" uk-tooltip="Concept">{{entity.title}}</span>
|
|
|
|
</h6>
|
2019-07-23 14:23:12 +02:00
|
|
|
</div>
|
2017-12-19 13:53:46 +01:00
|
|
|
`
|
|
|
|
})
|
|
|
|
|
|
|
|
export class ClaimEntityFormatter {
|
2024-05-09 15:44:54 +02:00
|
|
|
@Input() entity: ClaimDBResult | ClaimDBContext | ClaimDBProject | ClaimDBOrganization;
|
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;
|
2024-01-24 11:14:40 +01:00
|
|
|
@Input() linkAvailable: boolean = true;
|
2022-07-05 15:41:11 +02:00
|
|
|
public openAIREEntities = OpenaireEntities;
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2019-07-23 14:23:12 +02:00
|
|
|
constructor() {
|
|
|
|
}
|
2022-07-05 15:41:11 +02:00
|
|
|
|
|
|
|
public getEntityName(entityType:string) {
|
|
|
|
return StringUtils.getEntityName(entityType);
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2022-07-05 15:41:11 +02:00
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2019-07-23 14:23:12 +02:00
|
|
|
|