2020-03-16 14:09:46 +01:00
import { Component , Input } from "@angular/core" ;
import { EnvProperties } from "../../../utils/properties/env-properties" ;
import { Author } from "../../../utils/result-preview/result-preview" ;
import { AlertModal } from "../../../utils/modal/alert" ;
2023-01-23 15:19:00 +01:00
import { OpenaireEntities } from "src/app/openaireLibrary/utils/properties/searchFields" ;
2020-03-16 14:09:46 +01:00
@Component ( {
2023-01-25 10:53:32 +01:00
selector : 'landing-header' ,
template : `
< div class = "title-section" [ class.uk - margin - small - bottom ] = " ! isSticky " [ ngClass ] = " titleClass " >
< div class = "uk-margin-small-bottom" >
< showTitle [ titleName ] = " title " classNames = "uk-margin-remove-bottom" > < / showTitle >
< div * ngIf = "subTitle" >
< span class = "uk-text-meta uk-text-small" [ innerHTML ] = " subTitle " > < / span >
< / div >
< / div >
2023-01-24 14:32:58 +01:00
< div class = "uk-margin-bottom uk-text-xsmall uk-text-emphasis uk-flex uk-flex-middle uk-flex-wrap" >
2023-01-23 15:19:00 +01:00
<!-- oa -- >
2023-01-25 10:53:32 +01:00
< ng - container
2023-02-13 14:51:15 +01:00
* ngIf = "(openAccessMandatePublications != undefined && openAccessMandatePublications) || (openAccessMandateDatasets != undefined && openAccessMandateDatasets)" >
< span class = "uk-margin-xsmall-right open-access" >
< icon name = "open_access" [ flex ] = " true " [ ratio ] = " 0.8 " > < / icon >
2023-01-23 15:19:00 +01:00
< / span >
2023-01-25 10:53:32 +01:00
< span class = "uk-text-bolder"
* ngIf = "openAccessMandatePublications != undefined && openAccessMandatePublications && openAccessMandateDatasets != undefined && openAccessMandateDatasets" >
2023-01-23 15:19:00 +01:00
Open Access Mandate for { { openaireEntities . PUBLICATIONS } } and { { openaireEntities . DATASETS } }
< / span >
2023-01-25 10:53:32 +01:00
< span class = "uk-text-bolder"
* ngIf = "openAccessMandatePublications != undefined && openAccessMandatePublications && (openAccessMandateDatasets == undefined || !openAccessMandateDatasets)" >
2023-01-23 15:19:00 +01:00
Open Access Mandate for { { openaireEntities . PUBLICATIONS } }
< / span >
2023-01-25 10:53:32 +01:00
< span class = "uk-text-bolder"
* ngIf = "openAccessMandateDatasets != undefined && openAccessMandateDatasets && (openAccessMandatePublications == undefined || !openAccessMandatePublications)" >
2023-01-23 15:19:00 +01:00
Open Access Mandate for { { openaireEntities . DATASETS } }
< / span >
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
< / n g - c o n t a i n e r >
<!-- types -- >
2023-01-09 17:35:28 +01:00
< span * ngIf = "entityType" class = "uk-margin-xsmall-right" >
2023-01-25 10:53:32 +01:00
< icon * ngIf = "entityType.toLowerCase() == 'publication'" name = "description" type = "outlined"
2023-02-13 14:51:15 +01:00
[ flex ] = "true" [ ratio ] = "0.8" > < / icon >
2023-01-25 10:53:32 +01:00
< icon * ngIf = "entityType.toLowerCase() == 'research data'" name = "database" type = "outlined"
2023-02-13 14:51:15 +01:00
[ flex ] = "true" [ ratio ] = "0.8" > < / icon >
2023-01-25 10:53:32 +01:00
< icon * ngIf = "entityType.toLowerCase() == 'research software'" name = "integration_instructions"
2023-02-13 14:51:15 +01:00
type = "outlined" [ flex ] = "true" [ ratio ] = "0.8" > < / icon >
2023-01-25 10:53:32 +01:00
< icon * ngIf = "entityType.toLowerCase() == 'other research product'" name = "apps" type = "outlined"
2023-02-13 14:51:15 +01:00
[ flex ] = "true" [ ratio ] = "0.8" > < / icon >
2023-01-25 10:53:32 +01:00
< icon * ngIf = "entityType.toLowerCase() == 'project'" name = "assignment_turned_in" type = "outlined"
2023-02-13 14:51:15 +01:00
[ flex ] = "true" [ ratio ] = "0.8" > < / icon >
2023-01-25 10:53:32 +01:00
< icon * ngIf = "entityType.toLowerCase() == 'data source'" name = "note_add" type = "outlined"
2023-02-13 14:51:15 +01:00
[ flex ] = "true" [ ratio ] = "0.8" > < / icon >
2023-01-25 10:53:32 +01:00
< icon * ngIf = "entityType.toLowerCase() == 'organization'" name = "corporate_fare" type = "outlined"
2023-02-13 14:51:15 +01:00
[ flex ] = "true" [ ratio ] = "0.8" > < / icon >
2023-01-09 17:35:28 +01:00
< / span >
2022-12-20 14:27:18 +01:00
< span * ngIf = "entityType" class = "uk-text-capitalize uk-text-bolder" style = "text-decoration: underline;" >
2023-01-24 14:32:58 +01:00
{ { entityType } }
< / span >
2023-01-09 17:35:28 +01:00
< span * ngIf = "entityType && types && removeUnknown(types, true).length > 0" >
2023-02-13 14:51:15 +01:00
< icon name = "keyboard_double_arrow_right" [ flex ] = " true " [ ratio ] = " 0.8 " > < / icon >
2023-01-09 17:35:28 +01:00
< / span >
2022-12-20 14:27:18 +01:00
< span * ngIf = "types && removeUnknown(types, true).length > 0" class = "uk-text-italic" >
2023-01-09 17:35:28 +01:00
{ { removeUnknown ( types , true ) . join ( ' , ' ) } }
2022-12-20 14:27:18 +01:00
< / span >
2023-01-23 15:19:00 +01:00
<!-- dates -- >
< ng - container * ngIf = "startDate && !endDate" >
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
< span class = "uk-margin-xsmall-right" > From < / span >
< span > { { startDate | date : 'dd MMM yyyy' } } < / span >
< / n g - c o n t a i n e r >
< ng - container * ngIf = "!startDate && endDate" >
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
< span class = "uk-margin-xsmall-right" > Until < / span >
< span > { { endDate | date : 'dd MMM yyyy' } } < / span >
< / n g - c o n t a i n e r >
< ng - container * ngIf = "startDate && endDate" >
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
< ng - container * ngIf = "startDate" >
2023-01-25 10:53:32 +01:00
< span > { { startDate | date : 'dd MMM yyyy' } } < / span >
2023-01-23 15:19:00 +01:00
< span class = "uk-margin-xsmall-left" > ( Started ) < / span >
2023-01-25 10:53:32 +01:00
< / n g - c o n t a i n e r >
< span * ngIf = "startDate && endDate" class = "uk-margin-xsmall-left uk-margin-xsmall-right" > - < / span >
< ng - container * ngIf = "endDate" >
< span > { { endDate | date : 'dd MMM yyyy' } } < / span >
2023-01-23 15:19:00 +01:00
< span class = "uk-margin-xsmall-left" > { { currentDate >= endDate ? '(Ended)' : '(Ending)' } } < / span >
< / n g - c o n t a i n e r >
< / n g - c o n t a i n e r >
< ng - container * ngIf = "status && status != ''" >
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
< span > { { status } } < / span >
< / n g - c o n t a i n e r >
< ng - container * ngIf = "date" >
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
< span > { { date | date : 'dd MMM yyyy' : 'UTC' } } < / span >
< / n g - c o n t a i n e r >
< ng - container * ngIf = "embargoEndDate" >
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
< span > Embargo end date : { { embargoEndDate | date : 'dd MMM yyyy' } } < / span >
< / n g - c o n t a i n e r >
2023-01-25 10:53:32 +01:00
< span * ngIf = "underCuration" >
2020-05-19 17:33:47 +02:00
. < span title = "{{buildCurationTooltip()}}"
2023-01-25 10:53:32 +01:00
uk - tooltip = "pos:bottom-right; delay:10;"
class = "uk-text-primary" > Under curation < / span >
2020-05-19 17:33:47 +02:00
< / span >
2023-01-09 17:35:28 +01:00
<!-- languages -- >
< ng - container * ngIf = "languages && removeUnknown(languages).length > 0" >
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
< ng - container * ngFor = "let language of removeUnknown(languages)" >
< span > { { language } } < / span >
< / n g - c o n t a i n e r >
< / n g - c o n t a i n e r >
<!-- programming languages -- >
< ng - container * ngIf = "programmingLanguages && programmingLanguages.length > 0" >
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
< ng - container * ngFor = "let programmingLanguage of programmingLanguages" >
< span > { { programmingLanguage } } < / span >
< / n g - c o n t a i n e r >
< / n g - c o n t a i n e r >
<!-- published info -- >
2023-01-23 15:19:00 +01:00
< showPublisher [ publisher ] = " publisher " [ journal ] = " journal " [ properties ] = " properties " > < / showPublisher >
<!-- data provider labels -- >
< ng - container * ngIf = "compatibility && !(compatibility.info == 'not available' && type == 'service')" >
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
2023-02-13 14:51:15 +01:00
< span title = "Compatibility" >
2023-01-23 15:19:00 +01:00
< a * ngIf = "compatibility.id"
2023-01-25 10:53:32 +01:00
[ queryParams ] = "{datasourceId: compatibility.id}" routerLinkActive = "router-link-active"
[ routerLink ] = "properties.searchLinkToDataProvider.split('?')[0]" >
2023-01-23 15:19:00 +01:00
{ { compatibility . info } }
< ng - container * ngIf = "compatibility.name" > { { compatibility . name } } < / n g - c o n t a i n e r >
< / a >
< span * ngIf = "!compatibility.id" >
2023-01-25 10:53:32 +01:00
< ng - container
* ngIf = "compatibility.info.toLowerCase() != 'not yet registered'" > { { compatibility . info } } < / n g - c o n t a i n e r >
2023-01-23 15:19:00 +01:00
< ng - container * ngIf = "compatibility.info.toLowerCase() == 'not yet registered'" >
{ { compatibility . info } } < span * ngIf = "properties.adminToolsPortalType == 'eosc'" > in OpenAIRE < / span >
< / n g - c o n t a i n e r >
< / span >
< span * ngIf = "compatibility.name && !compatibility.id" >
{ { compatibility . name } }
< / span >
< / span >
< / n g - c o n t a i n e r >
2023-01-25 10:53:32 +01:00
< ng - container
* ngIf = "aggregationStatus && aggregationStatus.fulltexts && aggregationStatus.fulltexts > 0" >
2023-01-23 15:19:00 +01:00
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
< span > OpenAIRE Text Mining < / span >
< / n g - c o n t a i n e r >
< ng - container * ngIf = "thematic" >
< span class = "uk-margin-xsmall-left uk-margin-xsmall-right" > & # x2022 ; < / span >
< span > Thematic < / span >
< / n g - c o n t a i n e r >
2022-12-20 14:27:18 +01:00
< / div >
2023-01-25 10:53:32 +01:00
< div * ngIf = "authors" >
< showAuthors [ authorsLimit ] = " authorLimit " [ modal ] = " modal " [ showAll ] = " showAllAuthors " [ authors ] = " authors "
[ isSticky ] = "isSticky" > < / showAuthors >
< / div >
< / div >
`
2020-03-16 14:09:46 +01:00
} )
export class LandingHeaderComponent {
2023-01-25 10:53:32 +01:00
@Input ( ) entityType : string ;
@Input ( ) properties : EnvProperties ;
@Input ( ) types : string [ ] ;
@Input ( ) startDate : number ; // project landing
@Input ( ) endDate : number ; // project landing
2023-01-23 15:19:00 +01:00
@Input ( ) currentDate : number ; // project landing
2023-01-25 10:53:32 +01:00
@Input ( ) status : string ; // project landing
2023-01-23 15:19:00 +01:00
@Input ( ) openAccessMandatePublications : boolean // project landing
@Input ( ) openAccessMandateDatasets : boolean // project landing
2023-01-25 10:53:32 +01:00
@Input ( ) date : Date ;
@Input ( ) embargoEndDate : Date ;
@Input ( ) title : string ;
@Input ( ) subTitle : string ;
@Input ( ) authors : Author [ ] ;
@Input ( ) authorLimit : number = 7 ;
@Input ( ) showAllAuthors : boolean = true ;
@Input ( ) underCuration : boolean = false ;
@Input ( ) modal : AlertModal ;
@Input ( ) titleClass : string = null ;
@Input ( ) isTitleH1 : boolean = true ;
@Input ( ) isSticky : boolean = false ;
2023-01-09 17:35:28 +01:00
@Input ( ) publisher ; // showPublisher component
@Input ( ) journal ; // showPublisher component
@Input ( ) languages ;
@Input ( ) programmingLanguages ;
2023-01-23 15:19:00 +01:00
@Input ( ) compatibility ; // data provider landing
@Input ( ) aggregationStatus ; // data provider landing
@Input ( ) thematic : boolean ; // data provider landing
@Input ( ) type ; // data provider landing
public openaireEntities = OpenaireEntities ;
2023-01-09 17:35:28 +01:00
2023-01-25 10:53:32 +01:00
public removeUnknown ( array : string [ ] , type : boolean = false ) : string [ ] {
if ( type ) {
return this . removeDuplicates ( array ) . filter ( value = > value . toLowerCase ( ) !== 'unknown' ) ;
} else {
return array . filter ( value = > value . toLowerCase ( ) !== 'unknown' ) ;
}
}
public removeDuplicates ( array : string [ ] ) : string [ ] {
return array . filter ( value = > value . toLowerCase ( ) !== this . entityType ) ;
}
public buildCurationTooltip ( ) : string {
let tooltipContent : string = "<div class='uk-padding-small'>" ;
tooltipContent += "<h5>Record in preview</h5>" ;
tooltipContent += "<p>Bibliographic record accepted by the system, but not yet processed by <br> OpenAIRE tools for information quality improvement and de-duplication</p>" ;
tooltipContent += "</div>" ;
return tooltipContent ;
}
2020-03-16 14:09:46 +01:00
}