[Library | Trunk]: Change landing-header base on new mocks. Add indexInfoService on result landing.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58723 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
0fff8485a9
commit
95a3ae82e8
|
@ -6,11 +6,7 @@ import {AlertModal} from "../../../utils/modal/alert";
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'landing-header',
|
selector: 'landing-header',
|
||||||
template: `
|
template: `
|
||||||
<div class="title-section">
|
<div class="title-section uk-margin-bottom">
|
||||||
<span *ngIf="underCuration" title="{{buildCurationTooltip()}}"
|
|
||||||
uk-tooltip="pos:bottom-right; delay:10; cls: under-curation-tooltip"
|
|
||||||
class="under-curation uk-position-top-right uk-margin-small-right uk-margin-small-top">
|
|
||||||
</span>
|
|
||||||
<div class="uk-text-small">
|
<div class="uk-text-small">
|
||||||
<span *ngIf="entityType" class="uk-text-capitalize">
|
<span *ngIf="entityType" class="uk-text-capitalize">
|
||||||
{{entityType}}
|
{{entityType}}
|
||||||
|
@ -47,12 +43,17 @@ import {AlertModal} from "../../../utils/modal/alert";
|
||||||
<span *ngIf="embargoEndDate">
|
<span *ngIf="embargoEndDate">
|
||||||
. Embargo end date: {{embargoEndDate | date: 'dd MMM yyyy'}}
|
. Embargo end date: {{embargoEndDate | date: 'dd MMM yyyy'}}
|
||||||
</span>
|
</span>
|
||||||
|
<span *ngIf="underCuration">
|
||||||
|
. <span title="{{buildCurationTooltip()}}"
|
||||||
|
uk-tooltip="pos:bottom-right; delay:10; cls: under-curation-tooltip"
|
||||||
|
class="under-curation">Under curation</span>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<showTitle [titleName]="title" classNames="uk-margin-remove-bottom"></showTitle>
|
<showTitle [titleName]="title" classNames="uk-margin-remove-bottom"></showTitle>
|
||||||
<div *ngIf="subTitle">
|
<div *ngIf="subTitle">
|
||||||
<span [innerHTML]="subTitle"></span>
|
<span class="uk-text-muted" [innerHTML]="subTitle"></span>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="authors" class="uk-margin-small-bottom uk-margin-small-top">
|
<div *ngIf="authors" class="uk-margin-top">
|
||||||
<showAuthors [authorsLimit]="authorLimit" [modal]="modal" [showAll]="showAllAuthors" [authors]="authors" [small]="false"></showAuthors>
|
<showAuthors [authorsLimit]="authorLimit" [modal]="modal" [showAll]="showAllAuthors" [authors]="authors" [small]="false"></showAuthors>
|
||||||
</div>
|
</div>
|
||||||
</div>`
|
</div>`
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {ActivatedRoute} from '@angular/router';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'showTitle',
|
selector: 'showTitle',
|
||||||
template: `
|
template: `
|
||||||
<h1 [ngClass]="classNames" class="uk-h2">
|
<h1 [ngClass]="classNames">
|
||||||
<div *ngIf="title != undefined" class="landingTitle">
|
<div *ngIf="title != undefined" class="landingTitle">
|
||||||
<span *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
|
<span *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
|
||||||
class="custom-external">
|
class="custom-external">
|
||||||
|
|
|
@ -11,13 +11,14 @@
|
||||||
class="loading-gif uk-align-center"></span></div>
|
class="loading-gif uk-align-center"></span></div>
|
||||||
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
|
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
|
||||||
[texts]="pageContents['top']"></helper>
|
[texts]="pageContents['top']"></helper>
|
||||||
<div *ngIf="resultLandingInfo != null" class="uk-grid">
|
<div *ngIf="resultLandingInfo != null" class="uk-grid uk-margin-remove">
|
||||||
<div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom">
|
<div class="uk-width-2-3@m uk-width-1-1@s uk-padding uk-padding-remove-left uk-padding-remove-vertical uk-margin-bottom">
|
||||||
<!-- schema.org-->
|
<!-- schema.org-->
|
||||||
<schema2jsonld *ngIf="resultLandingInfo.record" [data]=resultLandingInfo.record
|
<schema2jsonld *ngIf="resultLandingInfo.record" [data]=resultLandingInfo.record
|
||||||
[URL]="properties.baseLink+linkToLandingPage+id"></schema2jsonld>
|
[URL]="properties.baseLink+linkToLandingPage+id"></schema2jsonld>
|
||||||
<landing-header [properties]="properties" [title]="resultLandingInfo.title"
|
<landing-header [properties]="properties" [title]="resultLandingInfo.title"
|
||||||
[subTitle]="resultLandingInfo.subtitle"
|
[subTitle]="resultLandingInfo.subtitle"
|
||||||
|
[authors]="resultLandingInfo.authors" [authorLimit]="10" [showAllAuthors]="false"
|
||||||
[underCuration]="resultLandingInfo.underCurationMessage"
|
[underCuration]="resultLandingInfo.underCurationMessage"
|
||||||
[entityType]="getTypeName()" [types]="resultLandingInfo.types"
|
[entityType]="getTypeName()" [types]="resultLandingInfo.types"
|
||||||
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
|
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
|
||||||
|
@ -27,9 +28,6 @@
|
||||||
<a (click)="openDeletedByInference()">View all {{resultLandingInfo.deletedByInferenceIds.length}}
|
<a (click)="openDeletedByInference()">View all {{resultLandingInfo.deletedByInferenceIds.length}}
|
||||||
versions</a>
|
versions</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-margin-small-bottom uk-margin-small-top">
|
|
||||||
<showAuthors [authors]="resultLandingInfo.authors" [small]="false"></showAuthors>
|
|
||||||
</div>
|
|
||||||
<!-- Labels -->
|
<!-- Labels -->
|
||||||
<div class="uk-margin-bottom">
|
<div class="uk-margin-bottom">
|
||||||
<span *ngIf="resultLandingInfo.accessMode
|
<span *ngIf="resultLandingInfo.accessMode
|
||||||
|
@ -52,7 +50,7 @@
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<ul class="uk-list">
|
<ul class="uk-list basic-info">
|
||||||
<!--Published Date, Journal and Publisher-->
|
<!--Published Date, Journal and Publisher-->
|
||||||
<showPublisher [publisher]="resultLandingInfo.publisher"
|
<showPublisher [publisher]="resultLandingInfo.publisher"
|
||||||
[publishDate]="resultLandingInfo.dateofacceptance"
|
[publishDate]="resultLandingInfo.dateofacceptance"
|
||||||
|
@ -74,6 +72,7 @@
|
||||||
[properties]="properties"></showIdentifiers>
|
[properties]="properties"></showIdentifiers>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<!-- Tabs -->
|
||||||
<!-- Description -->
|
<!-- Description -->
|
||||||
<div *ngIf="resultLandingInfo.description" class="uk-margin-bottom">
|
<div *ngIf="resultLandingInfo.description" class="uk-margin-bottom">
|
||||||
<div class="uk-text-justify uk-text-small uk-height-max-medium uk-overflow-auto">
|
<div class="uk-text-justify uk-text-small uk-height-max-medium uk-overflow-auto">
|
||||||
|
@ -204,7 +203,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>-->
|
</ul>-->
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-3@m uk-width-1-1@s">
|
<div class="uk-width-1-3@m uk-width-1-1@s uk-padding-remove">
|
||||||
<div class="uk-card uk-card-default uk-padding-small">
|
<div class="uk-card uk-card-default uk-padding-small">
|
||||||
<div *ngIf="isRouteAvailable('participate/direct-claim')">
|
<div *ngIf="isRouteAvailable('participate/direct-claim')">
|
||||||
<div class="uk-margin-auto uk-width-3-4">
|
<div class="uk-margin-auto uk-width-3-4">
|
||||||
|
|
|
@ -14,6 +14,7 @@ import {HelperService} from '../../utils/helper/helper.service';
|
||||||
import {Location} from "@angular/common";
|
import {Location} from "@angular/common";
|
||||||
import {MetricsService} from "../../services/metrics.service";
|
import {MetricsService} from "../../services/metrics.service";
|
||||||
import {Organization, RelationResult, ResultPreview} from "../../utils/result-preview/result-preview";
|
import {Organization, RelationResult, ResultPreview} from "../../utils/result-preview/result-preview";
|
||||||
|
import {IndexInfoService} from "../../utils/indexInfo.service";
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -104,16 +105,21 @@ export class ResultLandingComponent {
|
||||||
private seoService: SEOService,
|
private seoService: SEOService,
|
||||||
private metricsService: MetricsService,
|
private metricsService: MetricsService,
|
||||||
private cdr: ChangeDetectorRef,
|
private cdr: ChangeDetectorRef,
|
||||||
private _location: Location) {
|
private _location: Location,
|
||||||
|
private indexInfoService: IndexInfoService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.route.data
|
this.route.data
|
||||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||||
this.properties = data.envSpecific;
|
this.properties = data.envSpecific;
|
||||||
if(this.properties.lastIndexUpdate) {
|
this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
|
||||||
|
if(lastIndexUpdate) {
|
||||||
|
this.indexUpdateDate = new Date(lastIndexUpdate);
|
||||||
|
} else if(this.properties.lastIndexUpdate) {
|
||||||
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
|
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
//this.getDivContents();
|
//this.getDivContents();
|
||||||
this.getPageContents();
|
this.getPageContents();
|
||||||
this.doiURL = this.properties.doiURL;
|
this.doiURL = this.properties.doiURL;
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {HttpClient} from '@angular/common/http';
|
import {HttpClient} from '@angular/common/http';
|
||||||
import {EnvProperties} from './properties/env-properties';
|
import {EnvProperties} from './properties/env-properties';
|
||||||
|
import {Observable, of} from "rxjs";
|
||||||
|
import {catchError} from "rxjs/operators";
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({
|
||||||
|
providedIn: "root"
|
||||||
|
})
|
||||||
export class IndexInfoService {
|
export class IndexInfoService {
|
||||||
|
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient) {
|
||||||
|
@ -11,10 +15,9 @@ export class IndexInfoService {
|
||||||
|
|
||||||
// http://beta.services.openaire.eu/openaire/info/lastLoadDate
|
// http://beta.services.openaire.eu/openaire/info/lastLoadDate
|
||||||
// the date when the mining results currently in the public index have been generated: http://beta.services.openaire.eu/openaire/info/lastMiningDate
|
// the date when the mining results currently in the public index have been generated: http://beta.services.openaire.eu/openaire/info/lastMiningDate
|
||||||
getLastIndexDate(properties: EnvProperties): any {
|
getLastIndexDate(properties: EnvProperties): Observable<any> {
|
||||||
|
let url = properties.indexInfoAPI + "claim_load_date";
|
||||||
let url = properties.indexInfoAPI + "/claim_load_date";
|
return this.http.get(url).pipe(catchError(err => {return of(null)}));
|
||||||
return this.http.get(url);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue