[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:
parent
641c76f169
commit
8a6a516bee
|
@ -15,6 +15,7 @@ import {ResultPreview} from "../../utils/result-preview/result-preview";
|
||||||
import {Meta, Title} from "@angular/platform-browser";
|
import {Meta, Title} from "@angular/platform-browser";
|
||||||
import {UserManagementService} from "../../services/user-management.service";
|
import {UserManagementService} from "../../services/user-management.service";
|
||||||
import {PiwikService} from "../../utils/piwik/piwik.service";
|
import {PiwikService} from "../../utils/piwik/piwik.service";
|
||||||
|
import {IndexInfoService} from "../../utils/indexInfo.service";
|
||||||
|
|
||||||
declare var UIkit: any;
|
declare var UIkit: any;
|
||||||
|
|
||||||
|
@ -30,7 +31,7 @@ declare var UIkit: any;
|
||||||
My ORCID links
|
My ORCID links
|
||||||
</div>
|
</div>
|
||||||
<span *ngIf="authorNameParam" class="uk-width-1-1 uk-width-expand@m">
|
<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">
|
[routerLink]="properties.searchLinkToAdvancedResults" routerLinkActive="router-link-active">
|
||||||
Discover research results related to you
|
Discover research results related to you
|
||||||
</a>
|
</a>
|
||||||
|
@ -43,7 +44,8 @@ declare var UIkit: any;
|
||||||
but the <span class="orcid-color">green icon</span> is missing?
|
but the <span class="orcid-color">green icon</span> is missing?
|
||||||
<br>
|
<br>
|
||||||
No worries! It will appear, as soon as we synchronize again with ORCID data.
|
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">
|
target="_blank" class="uk-display-inline-block">
|
||||||
Read more <span class="custom-external custom-icon space"></span>
|
Read more <span class="custom-external custom-icon space"></span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -116,6 +118,7 @@ export class MyOrcidLinksComponent {
|
||||||
pagingLimit = 0;
|
pagingLimit = 0;
|
||||||
|
|
||||||
properties:EnvProperties;
|
properties:EnvProperties;
|
||||||
|
public lastOrcidUpdateDate: string = "";
|
||||||
|
|
||||||
@Input() public communityId: string = null;
|
@Input() public communityId: string = null;
|
||||||
|
|
||||||
|
@ -147,6 +150,7 @@ export class MyOrcidLinksComponent {
|
||||||
constructor (private route: ActivatedRoute, private router: Router,
|
constructor (private route: ActivatedRoute, private router: Router,
|
||||||
private _piwikService:PiwikService,
|
private _piwikService:PiwikService,
|
||||||
private _orcidService: OrcidService,
|
private _orcidService: OrcidService,
|
||||||
|
private indexInfoService: IndexInfoService,
|
||||||
private _searchResearchResultsService: SearchResearchResultsService,
|
private _searchResearchResultsService: SearchResearchResultsService,
|
||||||
private userManagementService: UserManagementService,
|
private userManagementService: UserManagementService,
|
||||||
private _meta: Meta, private _title: Title
|
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=/authenticate /activities/update /person/update /read-limited"
|
||||||
+ "&response_type=code&scope=/activities/update /read-limited"
|
+ "&response_type=code&scope=/activities/update /read-limited"
|
||||||
+ "&redirect_uri="+location.origin+"/orcid?source=openaire";
|
+ "&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); }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,10 @@ export class IndexInfoService {
|
||||||
let url = properties.indexInfoAPI;
|
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)}));
|
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)}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue