[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:
k.triantafyllou 2020-05-19 15:33:47 +00:00
parent 0fff8485a9
commit 95a3ae82e8
5 changed files with 33 additions and 24 deletions

View File

@ -6,11 +6,7 @@ import {AlertModal} from "../../../utils/modal/alert";
@Component({
selector: 'landing-header',
template: `
<div class="title-section">
<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="title-section uk-margin-bottom">
<div class="uk-text-small">
<span *ngIf="entityType" class="uk-text-capitalize">
{{entityType}}
@ -47,12 +43,17 @@ import {AlertModal} from "../../../utils/modal/alert";
<span *ngIf="embargoEndDate">
. Embargo end date: {{embargoEndDate | date: 'dd MMM yyyy'}}
</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>
<showTitle [titleName]="title" classNames="uk-margin-remove-bottom"></showTitle>
<div *ngIf="subTitle">
<span [innerHTML]="subTitle"></span>
<span class="uk-text-muted" [innerHTML]="subTitle"></span>
</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>
</div>
</div>`

View File

@ -4,7 +4,7 @@ import {ActivatedRoute} from '@angular/router';
@Component({
selector: 'showTitle',
template: `
<h1 [ngClass]="classNames" class="uk-h2">
<h1 [ngClass]="classNames">
<div *ngIf="title != undefined" class="landingTitle">
<span *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
class="custom-external">

View File

@ -11,13 +11,14 @@
class="loading-gif uk-align-center"></span></div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
<div *ngIf="resultLandingInfo != null" class="uk-grid">
<div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom">
<div *ngIf="resultLandingInfo != null" class="uk-grid uk-margin-remove">
<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-->
<schema2jsonld *ngIf="resultLandingInfo.record" [data]=resultLandingInfo.record
[URL]="properties.baseLink+linkToLandingPage+id"></schema2jsonld>
<landing-header [properties]="properties" [title]="resultLandingInfo.title"
[subTitle]="resultLandingInfo.subtitle"
[authors]="resultLandingInfo.authors" [authorLimit]="10" [showAllAuthors]="false"
[underCuration]="resultLandingInfo.underCurationMessage"
[entityType]="getTypeName()" [types]="resultLandingInfo.types"
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
@ -27,9 +28,6 @@
<a (click)="openDeletedByInference()">View all {{resultLandingInfo.deletedByInferenceIds.length}}
versions</a>
</div>
<div class="uk-margin-small-bottom uk-margin-small-top">
<showAuthors [authors]="resultLandingInfo.authors" [small]="false"></showAuthors>
</div>
<!-- Labels -->
<div class="uk-margin-bottom">
<span *ngIf="resultLandingInfo.accessMode
@ -52,7 +50,7 @@
</ng-container>
</span>
</div>
<ul class="uk-list">
<ul class="uk-list basic-info">
<!--Published Date, Journal and Publisher-->
<showPublisher [publisher]="resultLandingInfo.publisher"
[publishDate]="resultLandingInfo.dateofacceptance"
@ -74,6 +72,7 @@
[properties]="properties"></showIdentifiers>
</li>
</ul>
<!-- Tabs -->
<!-- Description -->
<div *ngIf="resultLandingInfo.description" class="uk-margin-bottom">
<div class="uk-text-justify uk-text-small uk-height-max-medium uk-overflow-auto">
@ -204,7 +203,7 @@
</li>
</ul>-->
</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 *ngIf="isRouteAvailable('participate/direct-claim')">
<div class="uk-margin-auto uk-width-3-4">

View File

@ -14,6 +14,7 @@ import {HelperService} from '../../utils/helper/helper.service';
import {Location} from "@angular/common";
import {MetricsService} from "../../services/metrics.service";
import {Organization, RelationResult, ResultPreview} from "../../utils/result-preview/result-preview";
import {IndexInfoService} from "../../utils/indexInfo.service";
@Component({
@ -104,16 +105,21 @@ export class ResultLandingComponent {
private seoService: SEOService,
private metricsService: MetricsService,
private cdr: ChangeDetectorRef,
private _location: Location) {
private _location: Location,
private indexInfoService: IndexInfoService) {
}
ngOnInit() {
this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
if(this.properties.lastIndexUpdate) {
this.indexUpdateDate = new Date(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.getDivContents();
this.getPageContents();
this.doiURL = this.properties.doiURL;

View File

@ -1,9 +1,13 @@
import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {EnvProperties} from './properties/env-properties';
import {Observable, of} from "rxjs";
import {catchError} from "rxjs/operators";
@Injectable()
@Injectable({
providedIn: "root"
})
export class IndexInfoService {
constructor(private http: HttpClient) {
@ -11,10 +15,9 @@ export class IndexInfoService {
// 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
getLastIndexDate(properties: EnvProperties): any {
let url = properties.indexInfoAPI + "/claim_load_date";
return this.http.get(url);
getLastIndexDate(properties: EnvProperties): Observable<any> {
let url = properties.indexInfoAPI + "claim_load_date";
return this.http.get(url).pipe(catchError(err => {return of(null)}));
}
}