[Trunk | Library]:

1. indexInfo.service.ts: Added method "getLastOrcidUpdateDate()" to get all dates and parse "orcid_update_date".
2. myOrcidLinks.component.ts: Call on constructor "indexInfoService.getLastOrcidUpdateDate" and show latest data synchronization with orcid on top of the page. 


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@61028 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2021-05-19 13:07:43 +00:00
parent 641c76f169
commit 8a6a516bee
2 changed files with 17 additions and 2 deletions

View File

@ -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
</div>
<span *ngIf="authorNameParam" class="uk-width-1-1 uk-width-expand@m">
<a class="uk-button-text uk-align-right@m" [queryParams]="authorNameParam"
<a class="uk-button-text uk-align-left uk-align-right@m" [queryParams]="authorNameParam"
[routerLink]="properties.searchLinkToAdvancedResults" routerLinkActive="router-link-active">
Discover research results related to you
</a>
@ -43,7 +44,8 @@ declare var UIkit: any;
but the <span class="orcid-color">green icon</span> is missing?
<br>
No worries! It will appear, as soon as we synchronize again with ORCID data.
<a href="https://www.openaire.eu/openaire-explore-integration-with-the-orcid-search-and-link-wizard"
<span *ngIf="lastOrcidUpdateDate">Latest synchronization was on {{lastOrcidUpdateDate | date}}. </span>
<a href="https://www.openaire.eu/openaire-explore-integration-with-the-orcid-search-and-link-wizard"
target="_blank" class="uk-display-inline-block">
Read more <span class="custom-external custom-icon space"></span>
</a>
@ -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); }
)
}
}

View File

@ -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<any> {
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)}));
}
}