[Library | Trunk]: Result Landing add bioentities and references. Result-Preview fix a bug with before title section
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58745 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
0f7349ce6f
commit
22a9f9aad1
|
@ -18,7 +18,7 @@ declare var UIkit: any;
|
|||
</mat-select>
|
||||
<div *ngIf="selectedStyle!='0'">
|
||||
<div id="citation" class="box-content uk-margin-small-top uk-overflow-auto" [innerHTML]=citationText></div>
|
||||
<button class="clipboard_btn uk-button uk-button-small uk-button-secondary square-button uk-icon uk-float-right" data-clipboard-target="#citation" title="Copy to clipboard">
|
||||
<button class="clipboard_btn uk-button uk-button-small uk-button-secondary uk-margin-small-top uk-icon uk-float-right" data-clipboard-target="#citation" title="Copy to clipboard">
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="copy" ratio="1">
|
||||
<rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect>
|
||||
<polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline>
|
||||
|
|
|
@ -46,7 +46,10 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|
|||
</span>
|
||||
<span *ngIf=" journal['journal'] && (journal['issn'] || journal['eissn'] || journal['lissn'])"> (</span>
|
||||
<ng-container *ngIf="journal['issn']">
|
||||
<span class="uk-display-inline-block">issn: {{journal['issn']}}</span>
|
||||
<a target="_blank" class="uk-display-inline-block" [href]="properties.sherpaURL+journal['issn'] + properties.sherpaURLSuffix">
|
||||
<img src="assets/common-assets/common/SHERPA-RoMEO-short-logo.gif" width=16 height=16 alt="">
|
||||
issn: {{journal['issn']}}<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
<span *ngIf="journal['eissn'] || journal['lissn'] || !publisher">, </span>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="journal['eissn']">
|
||||
|
@ -57,26 +60,11 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|
|||
<span class="uk-display-inline-block">lissn: {{journal['lissn']}}</span>
|
||||
<span *ngIf="!publisher">, </span>
|
||||
</span>
|
||||
<span *ngIf="journal && (journal['issn'] ||journal['lissn'] || journal['eissn'] ) && !publisher">
|
||||
<a target="_blank"
|
||||
[href]="properties.sherpaURL+(journal['issn']?journal['issn']:(journal['eissn']?journal['eissn']:journal['lissn'] ))+properties.sherpaURLSuffix"
|
||||
uk-tooltip="title: View information on Sherpa/RoMEO ">
|
||||
<img src="assets/common-assets/common/SHERPA-RoMEO-short-logo.gif" width=16 height=16 alt="">
|
||||
Copyright policy<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</span>
|
||||
<span *ngIf=" journal['journal'] && (journal['issn'] || journal['eissn'] || journal['lissn'])">)</span>
|
||||
</span>
|
||||
</li>
|
||||
<li *ngIf="publisher">
|
||||
<span class="uk-text-muted">Publisher: </span> {{publisher}}
|
||||
<span *ngIf="journal && (journal['issn'] ||journal['lissn'] || journal['eissn'] )">
|
||||
(<a target="_blank"
|
||||
[href]="properties.sherpaURL+(journal['issn']?journal['issn']:(journal['eissn']?journal['eissn']:journal['lissn'] ))+properties.sherpaURLSuffix"
|
||||
uk-tooltip="title: View information on Sherpa/RoMEO ">
|
||||
<img src="assets/common-assets/common/SHERPA-RoMEO-short-logo.gif" width=16 height=16 alt="">
|
||||
Copyright policy<span class="custom-external custom-icon space"></span>
|
||||
</a>)</span>
|
||||
</li>
|
||||
`
|
||||
})
|
||||
|
|
|
@ -5,7 +5,7 @@ import {Component, Input} from '@angular/core';
|
|||
template: `
|
||||
<div *ngIf="classifiedSubjects && classifiedSubjects.size > 0" class="uk-text-small">
|
||||
<div class="uk-text-muted">
|
||||
Subjects by Vocabulary:
|
||||
Subjects
|
||||
</div>
|
||||
<div class="uk-margin-small-top">
|
||||
<div *ngFor="let key of getKeys(classifiedSubjects)" style="line-height: 20px">
|
||||
|
@ -17,9 +17,8 @@ import {Component, Input} from '@angular/core';
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="(subjects && subjects.length > 0) || (otherSubjects && otherSubjects.size > 0)" class="uk-text-small uk-margin-medium-top"
|
||||
<div *ngIf="(subjects && subjects.length > 0) || (otherSubjects && otherSubjects.size > 0)" class="uk-text-small uk-margin-small-top"
|
||||
[class.uk-margin-top]="classifiedSubjects && classifiedSubjects.size > 0">
|
||||
<div class="uk-text-muted">Subjects</div>
|
||||
<span *ngIf="subjects && subjects.length > 0">{{subjects.join(', ')}}</span>
|
||||
<span *ngIf="(subjects && subjects.length > 0) && (otherSubjects && otherSubjects.size > 0)">, </span>
|
||||
<span *ngIf="otherSubjects && otherSubjects.size > 0">
|
||||
|
|
|
@ -59,16 +59,7 @@
|
|||
{{resultLandingInfo.countries.join(", ")}}
|
||||
</li>
|
||||
</ul>
|
||||
<div class="uk-margin-medium-top">
|
||||
<div *ngIf="resultLandingInfo.references || resultLandingInfo.bioentities"
|
||||
class="uk-margin-top simple-buttons uk-flex uk-flex-middle">
|
||||
<div *ngIf="resultLandingInfo.references" (click)="openReferences()" class="clickable uk-margin-right">
|
||||
<span class="uk-text-bold">{{resultLandingInfo.references.length | number}}</span> References
|
||||
</div>
|
||||
<div *ngIf="resultLandingInfo.bioentities" (click)="openBioentities()" class="clickable">
|
||||
<span class="uk-text-bold">{{bioentitiesNum | number}}</span> Bioentities
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div *ngIf="resultLandingInfo.relatedResearchResults || resultLandingInfo.similarResearchResults ||
|
||||
resultLandingInfo.supplementaryResearchResults || resultLandingInfo.supplementedByResearchResults ||
|
||||
resultLandingInfo.organizations"
|
||||
|
@ -150,29 +141,29 @@
|
|||
</li>
|
||||
<!-- Metrics -->
|
||||
<li *ngIf="hasAltMetrics || hasMetrics" class="uk-margin-medium-top">
|
||||
<div uk-grid class="uk-child-width-1-3 uk-text-center uk-flex uk-flex-middle">
|
||||
<div>
|
||||
<metrics [pageViews]="pageViews" *ngIf="hasMetrics"
|
||||
<div uk-grid class="uk-child-width-1-3 uk-text-center uk-flex uk-flex-middle uk-flex-center uk-padding-remove-left">
|
||||
<div *ngIf="hasMetrics">
|
||||
<metrics [pageViews]="pageViews"
|
||||
[id]="id" [entityType]="'results'" [entity]="title"
|
||||
[viewsFrameUrl]="viewsFrameUrl" [downloadsFrameUrl]="downloadsFrameUrl"
|
||||
(metricsResults)="metricsResults($event)" [properties]=properties>
|
||||
</metrics>
|
||||
</div>
|
||||
<div>
|
||||
<div *ngIf="hasAltMetrics">
|
||||
<altmetrics *ngIf="hasAltMetrics" id="{{resultLandingInfo.identifiers.get('doi')[0]}}" type="doi">
|
||||
</altmetrics>
|
||||
</div>
|
||||
<div></div><!-- Open Citations-->
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="uk-padding-remove-left">
|
||||
<div class="uk-padding-remove-left uk-width-1-1 uk-margin-large-top">
|
||||
<div class="main-tabs-div">
|
||||
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)">
|
||||
<my-tab [tabTitle]="getTypeName() + ' Summary'" [tabId]="'summary'">
|
||||
<my-tabs>
|
||||
<my-tab *ngIf="hasPrimaryInfo || hasSecondaryInfo" [tabTitle]="getTypeName() + ' Summary'"
|
||||
[tabId]="'summary'">
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<div *ngIf="hasPrimaryInfo" class="uk-width-expand uk-padding">
|
||||
<!-- Description -->
|
||||
<div *ngIf="resultLandingInfo.description" class="uk-margin-medium-bottom">
|
||||
<div class="uk-text-justify uk-text-small uk-height-max-medium uk-overflow-auto">
|
||||
|
@ -210,10 +201,8 @@
|
|||
</showSubjects>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0 ||
|
||||
resultLandingInfo.contexts && resultLandingInfo.contexts.length >0 ||
|
||||
resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0"
|
||||
class="uk-width-1-3 right-column uk-padding-remove">
|
||||
<div *ngIf="hasSecondaryInfo"
|
||||
[class]="hasPrimaryInfo?'uk-width-1-3 right-column uk-padding-remove':'uk-padding-remove uk-width-expand'">
|
||||
<div *ngIf="resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0 ||
|
||||
resultLandingInfo.contexts && resultLandingInfo.contexts.length >0"
|
||||
class="uk-padding uk-padding-remove-bottom">
|
||||
|
@ -229,11 +218,15 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- Download From -->
|
||||
<div *ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0" class="uk-margin-medium-bottom">
|
||||
<div
|
||||
*ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0"
|
||||
class="uk-margin-medium-bottom">
|
||||
<div class="sideInfoTitle uk-margin-small-bottom uk-flex">
|
||||
<span class="uk-width-1-2">Download from</span>
|
||||
<span *ngIf="resultLandingInfo.deletedByInferenceIds" class="uk-width-1-2 uk-text-small uk-text-right">
|
||||
<a (click)="openDeletedByInference()">View all {{resultLandingInfo.deletedByInferenceIds.length}} versions</a>
|
||||
<span *ngIf="resultLandingInfo.deletedByInferenceIds"
|
||||
class="uk-width-1-2 uk-text-small uk-text-right">
|
||||
<a (click)="openDeletedByInference()">View all {{resultLandingInfo.deletedByInferenceIds.length}}
|
||||
versions</a>
|
||||
</span>
|
||||
</div>
|
||||
<availableOn [properties]="properties"
|
||||
|
@ -242,7 +235,79 @@
|
|||
</div>
|
||||
</div>
|
||||
</my-tab>
|
||||
<my-tab [tabTitle]="'references'" [tabId]="'references'" [tabNumber]="resultLandingInfo.references.length"></my-tab>
|
||||
<my-tab *ngIf="resultLandingInfo.references && resultLandingInfo.references.length > 0"
|
||||
[tabTitle]="'references'" [tabId]="'references'"
|
||||
[tabNumber]="resultLandingInfo.references.length">
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<div>
|
||||
<no-load-paging *ngIf="resultLandingInfo.references.length > 1.5*pageSize" [type]="'references'"
|
||||
(pageChange)="updateReferencesPage($event)"
|
||||
[page]="referencesPage" [pageSize]="1.5*pageSize"
|
||||
[totalResults]="resultLandingInfo.references.length">
|
||||
</no-load-paging>
|
||||
<div
|
||||
*ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*1.5*pageSize, referencesPage*1.5*pageSize)">
|
||||
<p *ngIf="item">
|
||||
{{item.name}}
|
||||
<ng-container *ngIf="item.ids && item.ids.length > 0">
|
||||
<span *ngFor="let id of item.ids">
|
||||
[<a *ngIf="id.type !== 'openaire'" href="{{getReferenceUrl(id)}}"
|
||||
target="_blank">{{getReferenceIdName(id)}}</a>
|
||||
<a *ngIf="id.type === 'openaire'" [routerLink]="'/search/result'"
|
||||
[queryParams]="{id: id.value}"
|
||||
target="_blank">OpenAIRE</a>]
|
||||
</span>
|
||||
</ng-container>
|
||||
</p>
|
||||
</div>
|
||||
<no-load-paging *ngIf="resultLandingInfo.references.length > 1.5*pageSize" [type]="'references'"
|
||||
(pageChange)="updateReferencesPage($event)"
|
||||
[page]="referencesPage" [pageSize]="1.5*pageSize"
|
||||
[totalResults]="resultLandingInfo.references.length">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-width-1-3 right-column uk-padding-remove"></div>
|
||||
</div>
|
||||
</my-tab>
|
||||
<my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0"
|
||||
[tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum">
|
||||
<div class="uk-grid uk-margin-remove">
|
||||
<div class="uk-width-expand uk-padding">
|
||||
<div>
|
||||
<no-load-paging *ngIf="bioentitiesNum > 2*pageSize" [type]="'bioentities'"
|
||||
(pageChange)="updateBioentitiesPage($event)"
|
||||
[page]="bioentitiesPage" [pageSize]="2*pageSize"
|
||||
[totalResults]="bioentitiesNum">
|
||||
</no-load-paging>
|
||||
<div class="uk-child-width-1-4@s uk-child-width-1-2 bioentities-buttons" uk-grid>
|
||||
<ng-container *ngFor="let key of getKeys(resultLandingInfo.bioentities) let i=index">
|
||||
<ng-container
|
||||
*ngFor="let keyIn of keysToArray(resultLandingInfo.bioentities.get(key)).slice((bioentitiesPage-1)*2*pageSize, bioentitiesPage*2*pageSize)">
|
||||
<div>
|
||||
<div [title]="key" *ngIf="keyIn && !resultLandingInfo.bioentities.get(key).get(keyIn)">
|
||||
{{keyIn}}
|
||||
</div>
|
||||
<a [href]="resultLandingInfo.bioentities.get(key).get(keyIn)" target="_blank"
|
||||
[title]="key" *ngIf="keyIn && resultLandingInfo.bioentities.get(key).get(keyIn)">
|
||||
{{keyIn}}
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</div>
|
||||
<no-load-paging *ngIf="bioentitiesNum > 2*pageSize" [type]="'bioentities'"
|
||||
(pageChange)="updateBioentitiesPage($event)"
|
||||
[page]="bioentitiesPage" [pageSize]="2*pageSize"
|
||||
[totalResults]="bioentitiesNum">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-width-1-3 right-column uk-padding-remove"></div>
|
||||
</div>
|
||||
</my-tab>
|
||||
</my-tabs>
|
||||
</div>
|
||||
<div class="uk-margin-small-top uk-flex">
|
||||
|
@ -308,80 +373,6 @@
|
|||
[resultType]="'other'" [type]="'other research products'"></deletedByInference>
|
||||
</div>
|
||||
</modal-alert>
|
||||
<!-- References -->
|
||||
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.references"
|
||||
classBody="uk-width-xxlarge uk-padding-remove-right" #referencesModal>
|
||||
<landing-header [properties]="properties" [title]="resultLandingInfo.title"
|
||||
[subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false"
|
||||
[modal]="referencesModal"
|
||||
[entityType]="getTypeName()" [authors]="resultLandingInfo.authors" [types]="resultLandingInfo.types"
|
||||
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
|
||||
</landing-header>
|
||||
<div class="uk-margin-medium-top uk-margin-medium-right">
|
||||
<no-load-paging *ngIf="resultLandingInfo.references.length > 1.5*pageSize" [type]="'references'"
|
||||
(pageChange)="updateReferencesPage($event)"
|
||||
[page]="referencesPage" [pageSize]="1.5*pageSize"
|
||||
[totalResults]="resultLandingInfo.references.length">
|
||||
</no-load-paging>
|
||||
<div
|
||||
*ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*1.5*pageSize, referencesPage*1.5*pageSize)">
|
||||
<p *ngIf="item">
|
||||
{{item.name}}
|
||||
<ng-container *ngIf="item.ids && item.ids.length > 0">
|
||||
<span *ngFor="let id of item.ids">
|
||||
[<a *ngIf="id.type !== 'openaire'" href="{{getReferenceUrl(id)}}"
|
||||
target="_blank">{{getReferenceIdName(id)}}</a>
|
||||
<a *ngIf="id.type === 'openaire'" [routerLink]="'/search/result'" [queryParams]="{id: id.value}"
|
||||
target="_blank">OpenAIRE</a>]
|
||||
</span>
|
||||
</ng-container>
|
||||
</p>
|
||||
</div>
|
||||
<no-load-paging *ngIf="resultLandingInfo.references.length > 1.5*pageSize" [type]="'references'"
|
||||
(pageChange)="updateReferencesPage($event)"
|
||||
[page]="referencesPage" [pageSize]="1.5*pageSize"
|
||||
[totalResults]="resultLandingInfo.references.length">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
</modal-alert>
|
||||
<!-- Bioentities -->
|
||||
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.bioentities"
|
||||
classBody="uk-width-xxlarge uk-padding-remove-right" #bioentitiesModal>
|
||||
<landing-header [properties]="properties" [title]="resultLandingInfo.title" [modal]="bioentitiesModal"
|
||||
[subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false"
|
||||
[entityType]="getTypeName()" [authors]="resultLandingInfo.authors" [types]="resultLandingInfo.types"
|
||||
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
|
||||
</landing-header>
|
||||
<div class="uk-margin-medium-top uk-margin-medium-right">
|
||||
<no-load-paging *ngIf="bioentitiesNum > 2*pageSize" [type]="'bioentities'"
|
||||
(pageChange)="updateBioentitiesPage($event)"
|
||||
[page]="bioentitiesPage" [pageSize]="2*pageSize"
|
||||
[totalResults]="bioentitiesNum">
|
||||
</no-load-paging>
|
||||
<div class="uk-child-width-1-4@s uk-child-width-1-2 bioentities-buttons" uk-grid>
|
||||
<ng-container *ngFor="let key of getKeys(resultLandingInfo.bioentities) let i=index">
|
||||
<ng-container
|
||||
*ngFor="let keyIn of keysToArray(resultLandingInfo.bioentities.get(key)).slice((bioentitiesPage-1)*2*pageSize, bioentitiesPage*2*pageSize)">
|
||||
<div>
|
||||
<div [title]="key" *ngIf="keyIn && !resultLandingInfo.bioentities.get(key).get(keyIn)">
|
||||
{{keyIn}}
|
||||
</div>
|
||||
<a [href]="resultLandingInfo.bioentities.get(key).get(keyIn)" target="_blank"
|
||||
[title]="key" *ngIf="keyIn && resultLandingInfo.bioentities.get(key).get(keyIn)">
|
||||
{{keyIn}}
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</div>
|
||||
<no-load-paging *ngIf="bioentitiesNum > 2*pageSize" [type]="'bioentities'"
|
||||
(pageChange)="updateBioentitiesPage($event)"
|
||||
[page]="bioentitiesPage" [pageSize]="2*pageSize"
|
||||
[totalResults]="bioentitiesNum">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
</modal-alert>
|
||||
<!-- Relation Results-->
|
||||
<modal-alert *ngIf="resultLandingInfo" classBody="uk-width-xxlarge uk-padding-remove-right" #relationModal>
|
||||
<landing-header [properties]="properties" [title]="resultLandingInfo.title" [modal]="relationModal"
|
||||
|
@ -436,7 +427,8 @@
|
|||
</div>
|
||||
</modal-alert>
|
||||
</div>
|
||||
<modal-alert #linkModal [classTitle]="'landing-modal-header uk-padding-small'" [classBody]="'uk-padding-remove landing-modal'">
|
||||
<modal-alert #linkModal [classTitle]="'landing-modal-header uk-padding-small'"
|
||||
[classBody]="'uk-padding-remove landing-modal'">
|
||||
<div class="uk-grid uk-child-width-1-3 uk-flex uk-flex-middle">
|
||||
<div class="uk-text-center">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'project'])"
|
||||
|
@ -484,7 +476,8 @@
|
|||
</a></div>
|
||||
</div>
|
||||
</modal-alert>
|
||||
<modal-alert #citeModal [classTitle]="'landing-modal-header uk-padding-small'" [classBody]="'uk-padding-remove landing-modal'">
|
||||
<modal-alert #citeModal [classTitle]="'landing-modal-header uk-padding-small'"
|
||||
[classBody]="'uk-padding-remove landing-modal'">
|
||||
<citeThis *ngIf="resultLandingInfo" [result]="resultLandingInfo" [id]="id" [type]="title.toLowerCase()"></citeThis>
|
||||
</modal-alert>
|
||||
|
||||
|
|
|
@ -31,8 +31,6 @@ export class ResultLandingComponent {
|
|||
@ViewChild('linkModal') linkModal;
|
||||
@ViewChild('citeModal') citeModal;
|
||||
@ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference;
|
||||
@ViewChild('referencesModal') referencesModal;
|
||||
@ViewChild('bioentitiesModal') bioentitiesModal;
|
||||
@ViewChild('relationModal') relationModal;
|
||||
@ViewChild('organizationModal') organizationModal;
|
||||
public deleteByInferenceOpened: boolean = false;
|
||||
|
@ -91,7 +89,7 @@ export class ResultLandingComponent {
|
|||
public feedbackFields: string [] = [
|
||||
'Title', 'Authors', 'Access rights',
|
||||
'Publisher information', 'Funding Information',
|
||||
'Persistent identifiers','Other'];
|
||||
'Persistent identifiers', 'Other'];
|
||||
|
||||
constructor(private _resultLaningService: ResultLandingService,
|
||||
private _piwikService: PiwikService,
|
||||
|
@ -113,9 +111,9 @@ export class ResultLandingComponent {
|
|||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
|
||||
if(lastIndexUpdate) {
|
||||
if (lastIndexUpdate) {
|
||||
this.indexUpdateDate = new Date(lastIndexUpdate);
|
||||
} else if(this.properties.lastIndexUpdate) {
|
||||
} else if (this.properties.lastIndexUpdate) {
|
||||
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
|
||||
}
|
||||
});
|
||||
|
@ -125,31 +123,31 @@ export class ResultLandingComponent {
|
|||
this.updateUrl(data.envSpecific.baseLink + this._router.url);
|
||||
this.sub = this.route.queryParams.subscribe(data => {
|
||||
this.resultLandingInfo = null;
|
||||
if(this.type == "publication") {
|
||||
if (this.type == "publication") {
|
||||
this.updateTitle("Publication");
|
||||
this.linkToLandingPage = this.properties.searchLinkToPublication;
|
||||
this.linkToSearchPage = this.properties.searchLinkToPublications;
|
||||
this.id = data['articleId'];
|
||||
this.title = "Publication";
|
||||
} else if(this.type == "dataset") {
|
||||
} else if (this.type == "dataset") {
|
||||
this.updateTitle("Dataset");
|
||||
this.linkToLandingPage = this.properties.searchLinkToDataset;
|
||||
this.linkToSearchPage = this.properties.searchLinkToDatasets;
|
||||
this.id = data['datasetId'];
|
||||
this.title = "Research Data";
|
||||
} else if(this.type == "software") {
|
||||
} else if (this.type == "software") {
|
||||
this.updateTitle("Software");
|
||||
this.linkToLandingPage = this.properties.searchLinkToSoftware;
|
||||
this.linkToSearchPage = this.properties.searchLinkToSoftwareLanding;
|
||||
this.id = data['softwareId'];
|
||||
this.title = "Software";
|
||||
} else if(this.type == "orp") {
|
||||
} else if (this.type == "orp") {
|
||||
this.updateTitle("Other Research Product");
|
||||
this.linkToLandingPage = this.properties.searchLinkToOrp;
|
||||
this.linkToSearchPage = this.properties.searchLinkToOrps;
|
||||
this.id = data['orpId'];
|
||||
this.title = "Other Research Product";
|
||||
}else if(this.type == "result"){
|
||||
} else if (this.type == "result") {
|
||||
this.id = data["id"];
|
||||
this.updateTitle("Research Result");
|
||||
this.linkToLandingPage = this.properties.searchLinkToOrp;
|
||||
|
@ -165,7 +163,12 @@ export class ResultLandingComponent {
|
|||
} else {
|
||||
this.showLoading = false;
|
||||
|
||||
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": this.type}});
|
||||
this._router.navigate(['/error'], {
|
||||
queryParams: {
|
||||
"page": this._location.path(true),
|
||||
"page_type": this.type
|
||||
}
|
||||
});
|
||||
/*
|
||||
this.warningMessage = "No valid ";
|
||||
if(this.type == "publication" || this.type == "software") {
|
||||
|
@ -240,7 +243,7 @@ export class ResultLandingComponent {
|
|||
this.resultLandingInfo.openCitations = data[1];
|
||||
},
|
||||
err => {
|
||||
this.handleError("Error getting open citation for "+this.type+" with id: " + this.id, err);
|
||||
this.handleError("Error getting open citation for " + this.type + " with id: " + this.id, err);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -257,7 +260,7 @@ export class ResultLandingComponent {
|
|||
this.getResultLandingInfo(provenanceActionVocabulary);
|
||||
}, err => {
|
||||
this.getResultLandingInfo(null);
|
||||
this.handleError("Error getting provenance action vocabulary for "+this.type+" with id: " + this.id, err);
|
||||
this.handleError("Error getting provenance action vocabulary for " + this.type + " with id: " + this.id, err);
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -267,7 +270,7 @@ export class ResultLandingComponent {
|
|||
this.infoSub = this._resultLaningService.getResultLandingInfo(this.id, this.type, provenanceActionVocabulary, this.properties).subscribe(
|
||||
data => {
|
||||
this.resultLandingInfo = data;
|
||||
if(this.type == "result"){ // no type was specified - update URL based this.resultLandingInfo.resultType
|
||||
if (this.type == "result") { // no type was specified - update URL based this.resultLandingInfo.resultType
|
||||
this.updateUrlWithType();
|
||||
}
|
||||
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.linkToLandingPage + this.resultLandingInfo.record["result"]["header"]["dri:objIdentifier"]);
|
||||
|
@ -315,17 +318,17 @@ export class ResultLandingComponent {
|
|||
}
|
||||
},
|
||||
err => {
|
||||
this.handleError("Error getting "+this.type+" for id: " + this.id, err);
|
||||
this.handleError("Error getting " + this.type + " for id: " + this.id, err);
|
||||
|
||||
if(err.status == 404) {
|
||||
if (err.status == 404) {
|
||||
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": this.type}});
|
||||
}
|
||||
|
||||
if(this.type == "publication" || this.type == "software") {
|
||||
this.errorMessage = 'No '+this.type+' found';
|
||||
} else if(this.type == "dataset") {
|
||||
if (this.type == "publication" || this.type == "software") {
|
||||
this.errorMessage = 'No ' + this.type + ' found';
|
||||
} else if (this.type == "dataset") {
|
||||
this.errorMessage += "No research data found";
|
||||
} else if(this.type == "orp") {
|
||||
} else if (this.type == "orp") {
|
||||
this.errorMessage += "No research product found";
|
||||
}
|
||||
this.showLoading = false;
|
||||
|
@ -340,8 +343,18 @@ export class ResultLandingComponent {
|
|||
this.pageViews = $event.pageViews;
|
||||
}
|
||||
|
||||
public get hasPrimaryInfo(): boolean {
|
||||
return !!this.resultLandingInfo && (!!this.resultLandingInfo.description || !!this.resultLandingInfo.identifiers || !!this.resultLandingInfo.subjects);
|
||||
}
|
||||
|
||||
public get hasSecondaryInfo(): boolean {
|
||||
return (this.resultLandingInfo.fundedByProjects && this.resultLandingInfo.fundedByProjects.length > 0) ||
|
||||
(this.resultLandingInfo.contexts && this.resultLandingInfo.contexts.length > 0) ||
|
||||
(this.resultLandingInfo.hostedBy_collectedFrom && this.resultLandingInfo.hostedBy_collectedFrom.length > 0);
|
||||
}
|
||||
|
||||
public get hasMetrics(): boolean {
|
||||
return !(this.totalViews && this.totalDownloads && this.pageViews) || this.totalViews > 0 || this.totalDownloads > 0||this.pageViews > 0;
|
||||
return !(this.totalViews && this.totalDownloads && this.pageViews) || this.totalViews > 0 || this.totalDownloads > 0 || this.pageViews > 0;
|
||||
}
|
||||
|
||||
public buildCurationTooltip(): string {
|
||||
|
@ -406,9 +419,9 @@ export class ResultLandingComponent {
|
|||
}
|
||||
|
||||
public accessClass(accessMode: string): string {
|
||||
if(accessMode.toLowerCase().indexOf('open') !== -1) {
|
||||
if (accessMode.toLowerCase().indexOf('open') !== -1) {
|
||||
return 'open';
|
||||
} else if(accessMode.toLowerCase() === 'not available') {
|
||||
} else if (accessMode.toLowerCase() === 'not available') {
|
||||
return 'unknown';
|
||||
} else {
|
||||
return 'closed';
|
||||
|
@ -432,13 +445,13 @@ export class ResultLandingComponent {
|
|||
}
|
||||
|
||||
private handleError(message: string, error) {
|
||||
if(this.type == "publication") {
|
||||
if (this.type == "publication") {
|
||||
console.error("Publication Landing Page: " + message, error);
|
||||
} else if(this.type == "dataset") {
|
||||
} else if (this.type == "dataset") {
|
||||
console.error("Research Data Landing Page: " + message, error);
|
||||
} else if(this.type == "software") {
|
||||
} else if (this.type == "software") {
|
||||
console.error("Software Landing Page: " + message, error);
|
||||
} else if(this.type == "orp") {
|
||||
} else if (this.type == "orp") {
|
||||
console.error("Other Research Product Landing Page: " + message, error);
|
||||
} else {
|
||||
console.error("Landing Page: " + message, error);
|
||||
|
@ -463,22 +476,6 @@ export class ResultLandingComponent {
|
|||
this.alertModalDeletedByInference.open();
|
||||
}
|
||||
|
||||
openReferences() {
|
||||
this.referencesModal.cancelButton = false;
|
||||
this.referencesModal.okButton = false;
|
||||
this.referencesModal.alertTitle = "References of";
|
||||
this.referencesPage = 1;
|
||||
this.referencesModal.open();
|
||||
}
|
||||
|
||||
openBioentities() {
|
||||
this.bioentitiesModal.cancelButton = false;
|
||||
this.bioentitiesModal.okButton = false;
|
||||
this.bioentitiesModal.alertTitle = "Bioentities of";
|
||||
this.bioentitiesPage = 1;
|
||||
this.bioentitiesModal.open();
|
||||
}
|
||||
|
||||
openRelationResults(title: string, relationResults: RelationResult[], relation: string = 'trust') {
|
||||
this.relationResults = relationResults;
|
||||
this.relation = relation;
|
||||
|
@ -506,20 +503,20 @@ export class ResultLandingComponent {
|
|||
return ResultPreview.organizationConvert(result, this.relation);
|
||||
}
|
||||
|
||||
updateUrlWithType(){
|
||||
updateUrlWithType() {
|
||||
this.type = this.resultLandingInfo.resultType;
|
||||
if(this.type == "publication") {
|
||||
if (this.type == "publication") {
|
||||
this._location.go("test");
|
||||
this.linkToLandingPage = this.properties.searchLinkToPublication;
|
||||
this.linkToSearchPage = this.properties.searchLinkToPublications;
|
||||
} else if(this.type == "dataset") {
|
||||
} else if (this.type == "dataset") {
|
||||
this.linkToLandingPage = this.properties.searchLinkToDataset;
|
||||
this.linkToSearchPage = this.properties.searchLinkToDatasets;
|
||||
} else if(this.type == "software") {
|
||||
} else if (this.type == "software") {
|
||||
this.linkToLandingPage = this.properties.searchLinkToSoftwareLanding;
|
||||
this.linkToSearchPage = this.properties.searchLinkToSoftware;
|
||||
} else if(this.type == "other") {
|
||||
this.type="orp";
|
||||
} else if (this.type == "other") {
|
||||
this.type = "orp";
|
||||
this.linkToLandingPage = this.properties.searchLinkToOrp;
|
||||
this.linkToSearchPage = this.properties.searchLinkToOrps;
|
||||
}
|
||||
|
@ -527,30 +524,30 @@ export class ResultLandingComponent {
|
|||
}
|
||||
|
||||
public getReferenceUrl(id: Id): string {
|
||||
if(id.type === "doi") {
|
||||
if (id.type === "doi") {
|
||||
return this.properties.doiURL + id.value;
|
||||
} else if(id.type === "pmc") {
|
||||
} else if (id.type === "pmc") {
|
||||
return this.properties.pmcURL + id.value;
|
||||
} else if(id.type === "pmid") {
|
||||
} else if (id.type === "pmid") {
|
||||
return this.properties.pmidURL + id.value;
|
||||
} else if(id.type === "handle") {
|
||||
} else if (id.type === "handle") {
|
||||
return this.properties.handleURL + id.value;
|
||||
} else {
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public getReferenceIdName(id: Id): string {
|
||||
if(id.type === "doi") {
|
||||
if (id.type === "doi") {
|
||||
return 'DOI'
|
||||
} else if(id.type === "pmc") {
|
||||
} else if (id.type === "pmc") {
|
||||
return 'Europe PMC'
|
||||
} else if(id.type === "pmid") {
|
||||
} else if (id.type === "pmid") {
|
||||
return 'PubMed';
|
||||
} else if(id.type === "handle") {
|
||||
} else if (id.type === "handle") {
|
||||
return 'Handle.NET';
|
||||
} else {
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -567,12 +564,4 @@ export class ResultLandingComponent {
|
|||
this.citeModal.alertTitle = "Cite this " + this.getTypeName() + " to";
|
||||
this.citeModal.open();
|
||||
}
|
||||
|
||||
public onSelectActiveTab(activeTabId) {
|
||||
if(this.activeTab != activeTabId) { // tab really changed
|
||||
if (activeTabId == 'summary') {
|
||||
this.activeTab = 'summary';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,16 +11,10 @@
|
|||
</span>
|
||||
<div class="uk-text-small">
|
||||
<span class="uk-text-capitalize">
|
||||
{{getTypeName(result.resultType)}}
|
||||
{{beforeTitle.join(' . ')}}
|
||||
</span>
|
||||
<span *ngIf="result.types &&
|
||||
removeUnknown(removeDuplicates(result.types)).length > 0">
|
||||
{{' . ' + removeUnknown(removeDuplicates(result.types)).join(' . ')}}
|
||||
</span>
|
||||
<span *ngIf="result.year">{{' . ' + result.year.toString()}}</span>
|
||||
<span *ngIf="result.startYear && result.endYear"> . {{result.startYear}} - {{result.endYear}}</span>
|
||||
<span *ngIf="result.embargoEndDate && result.embargoEndDate != ''">
|
||||
. Embargo End Date: {{result.embargoEndDate | date: 'dd MMM yyyy'}}
|
||||
<span *ngIf="beforeTitle.length > 0"> . </span> Embargo End Date: {{result.embargoEndDate | date: 'dd MMM yyyy'}}
|
||||
</span>
|
||||
</div>
|
||||
<!-- Title -->
|
||||
|
|
|
@ -17,6 +17,7 @@ export class ResultPreviewComponent implements OnInit{
|
|||
@Input() promoteWebsiteURL: boolean = false;
|
||||
public routerHelper: RouterHelper = new RouterHelper();
|
||||
public urlParam: string;
|
||||
public beforeTitle: string[] = [];
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.result.resultType === "publication") {
|
||||
|
@ -34,6 +35,24 @@ export class ResultPreviewComponent implements OnInit{
|
|||
} else if (this.result.resultType == "dataprovider") {
|
||||
this.urlParam = "datasourceId";
|
||||
}
|
||||
this.initBeforeTitle();
|
||||
}
|
||||
|
||||
public initBeforeTitle() {
|
||||
if(this.result.resultType) {
|
||||
this.beforeTitle.push(this.getTypeName(this.result.resultType));
|
||||
}
|
||||
if(this.result.types) {
|
||||
this.removeUnknown(this.removeDuplicates(this.result.types)).forEach(type => {
|
||||
this.beforeTitle.push(type);
|
||||
});
|
||||
}
|
||||
if(this.result.year) {
|
||||
this.beforeTitle.push(this.result.year.toString());
|
||||
}
|
||||
if(this.result.startYear && this.result.endYear) {
|
||||
this.beforeTitle.push(this.result.startYear.toString() + ' - ' + this.result.endYear.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public getTypeName(type: string): string {
|
||||
|
|
Loading…
Reference in New Issue