diff --git a/orcid/my-orcid-links/myOrcidLinks.component.ts b/orcid/my-orcid-links/myOrcidLinks.component.ts
index 387cc2c9..2f41910e 100644
--- a/orcid/my-orcid-links/myOrcidLinks.component.ts
+++ b/orcid/my-orcid-links/myOrcidLinks.component.ts
@@ -15,6 +15,7 @@ import {ResultPreview} from "../../utils/result-preview/result-preview";
import {Meta, Title} from "@angular/platform-browser";
import {UserManagementService} from "../../services/user-management.service";
import {PiwikService} from "../../utils/piwik/piwik.service";
+import {IndexInfoService} from "../../utils/indexInfo.service";
declare var UIkit: any;
@@ -30,7 +31,7 @@ declare var UIkit: any;
My ORCID links
-
Discover research results related to you
@@ -43,7 +44,8 @@ declare var UIkit: any;
but the green icon is missing?
No worries! It will appear, as soon as we synchronize again with ORCID data.
- Latest synchronization was on {{lastOrcidUpdateDate | date}}.
+
Read more
@@ -116,6 +118,7 @@ export class MyOrcidLinksComponent {
pagingLimit = 0;
properties:EnvProperties;
+ public lastOrcidUpdateDate: string = "";
@Input() public communityId: string = null;
@@ -147,6 +150,7 @@ export class MyOrcidLinksComponent {
constructor (private route: ActivatedRoute, private router: Router,
private _piwikService:PiwikService,
private _orcidService: OrcidService,
+ private indexInfoService: IndexInfoService,
private _searchResearchResultsService: SearchResearchResultsService,
private userManagementService: UserManagementService,
private _meta: Meta, private _title: Title
@@ -163,6 +167,13 @@ export class MyOrcidLinksComponent {
// + "&response_type=code&scope=/authenticate /activities/update /person/update /read-limited"
+ "&response_type=code&scope=/activities/update /read-limited"
+ "&redirect_uri="+location.origin+"/orcid?source=openaire";
+
+ this.indexInfoService.getLastOrcidUpdateDate(properties).subscribe(
+ date => {
+ this.lastOrcidUpdateDate = date;
+ },
+ error => { console.error("Error in fetching last orcid update date ",error); }
+ )
}
}
diff --git a/utils/indexInfo.service.ts b/utils/indexInfo.service.ts
index e4c7bfce..0835e04f 100644
--- a/utils/indexInfo.service.ts
+++ b/utils/indexInfo.service.ts
@@ -21,6 +21,10 @@ export class IndexInfoService {
let url = properties.indexInfoAPI;
return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url).pipe(map(res => res['stats_update_date'])).pipe(catchError(err => {return of(null)}));
}
+ getLastOrcidUpdateDate(properties: EnvProperties): Observable {
+ let url = properties.indexInfoAPI;
+ return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url).pipe(map(res => res['orcid_update_date'])).pipe(catchError(err => {return of(null)}));
+ }
}