diff --git a/landingPages/dataProvider/dataProvider.component.ts b/landingPages/dataProvider/dataProvider.component.ts index 0642d46c..5ebcc7d6 100644 --- a/landingPages/dataProvider/dataProvider.component.ts +++ b/landingPages/dataProvider/dataProvider.component.ts @@ -156,8 +156,6 @@ export class DataProviderComponent { 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); } }); } diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 09d0495a..790113ee 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -143,8 +143,6 @@ export class OrganizationComponent { 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); } }); } diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 76664c58..eeef9fe3 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -156,8 +156,6 @@ export class ProjectComponent { 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); } }); } diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 36310c9b..107450e1 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -124,8 +124,6 @@ export class ResultLandingComponent { 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); } }); } diff --git a/utils/indexInfo.service.ts b/utils/indexInfo.service.ts index 80f8ff75..dc653951 100644 --- a/utils/indexInfo.service.ts +++ b/utils/indexInfo.service.ts @@ -2,7 +2,7 @@ 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"; +import {catchError, map} from "rxjs/operators"; @Injectable({ @@ -13,11 +13,9 @@ export class IndexInfoService { constructor(private http: HttpClient) { } - // 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): Observable { - let url = properties.indexInfoAPI + "claim_load_date"; - return this.http.get(url).pipe(catchError(err => {return of(null)})); + let url = properties.indexInfoAPI; + return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url).pipe(map(res => res['claim_load_date'])).pipe(catchError(err => {return of(null)})); } }