2021-02-10 10:12:23 +01:00
|
|
|
import {Component, Input, ViewChild} from '@angular/core';
|
|
|
|
import {ActivatedRoute, Router} from '@angular/router';
|
|
|
|
import {Location} from '@angular/common';
|
|
|
|
import {ErrorCodes} from "../../utils/properties/errorCodes";
|
|
|
|
import {ErrorMessagesComponent} from "../../utils/errorMessages.component";
|
|
|
|
import {SearchUtilsClass} from "../../searchPages/searchUtils/searchUtils.class";
|
|
|
|
import {RouterHelper} from "../../utils/routerHelper.class";
|
|
|
|
import {EnvProperties} from "../../utils/properties/env-properties";
|
|
|
|
import {properties} from "../../../../environments/environment";
|
|
|
|
import {OrcidService} from "../orcid.service";
|
|
|
|
import {Identifier, StringUtils} from "../../utils/string-utils.class";
|
|
|
|
import {SearchResearchResultsService} from "../../services/searchResearchResults.service";
|
|
|
|
import {SearchResult} from "../../utils/entities/searchResult";
|
|
|
|
import {ResultPreview} from "../../utils/result-preview/result-preview";
|
2021-02-20 10:23:59 +01:00
|
|
|
import {Meta, Title} from "@angular/platform-browser";
|
[Trunk | Library]:
1. resultLanding.component.html & result-preview.component.html: Show orcid buttons in all environments (production too) | in <orcid-work> added "resultTitle" property.
2. myOrcidLinks.component.ts: Added "getPersonalDetails()" method and link to advanced research outcomes page, filtered by user's name (if personal details from ORCID fails, use name from AAI - getUserInfo).
3. searchMyOrcidResults.module.ts: Removed PagingModule and added NoLoadPaging.
4. searchMyOrcidResults.component.ts: Added method "totalPages()" to calculate pages in paging.
5. searchMyOrcidResults.component.html:
a. Added <no-load-paging> (instead of custom paging with <paging-no-load>).
b. In <orcid-work> added "resultTitle" property.
c. Fix widths of grid inside card for result preview and orcid buttons.
6. orcid-work.component.ts:
a. Added "resultTitle" @Input property, to show it in notifications, instead of pids.
b. Updated messages for errors and for multiple put-codes.
c. Use "danger" notifications instead of "warning" when an error occurs.
d. For search and my orcid links pages, in orcid buttons, use <icon> for icons | For landing page, updated icons in orcid buttons.
e. Added message "The action will affect your real ORCID iD." in tooltips, when environment == 'beta'.
f. Removed property "procedurePaused" and its usage replaced by "currentAction".
g. [Bug fix] For search pages, added "uk-align-right", in order orcid button not to take width for the whole line.
h. [Bug fix] In method "getOrcidWorks()" check "Session.isLoggedIn()" was missing.
7. orcid.component.ts: If personal details from ORCID fails, use name from AAI - getUserInfo.
8. orcid.module.ts: Added IconsModule and registered icons: add, remove, preview, refresh in IconsService.
9. searchResult.component.ts: Call "orcidService.getPutCodes()" in all environments (production too).
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60619 d315682c-612b-4755-9ff5-7f18f6832af3
2021-03-11 02:40:53 +01:00
|
|
|
import {UserManagementService} from "../../services/user-management.service";
|
2021-04-13 15:32:58 +02:00
|
|
|
import {PiwikService} from "../../utils/piwik/piwik.service";
|
2021-05-19 15:07:43 +02:00
|
|
|
import {IndexInfoService} from "../../utils/indexInfo.service";
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
import {OpenaireEntities} from "../../utils/properties/searchFields";
|
2021-02-10 10:12:23 +01:00
|
|
|
|
|
|
|
declare var UIkit: any;
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'my-orcid-links',
|
|
|
|
template: `
|
2021-04-16 10:31:05 +02:00
|
|
|
|
|
|
|
<div class="uk-container uk-container-large">
|
|
|
|
<div class="uk-margin-medium-bottom">
|
2021-04-12 12:02:56 +02:00
|
|
|
<div class="uk-margin-top">
|
2021-04-16 10:31:05 +02:00
|
|
|
<div class="uk-grid uk-flex uk-flex-middle">
|
|
|
|
<div class="uk-article-title custom-article-title uk-width-auto">
|
|
|
|
My ORCID links
|
2021-02-10 10:12:23 +01:00
|
|
|
</div>
|
2021-04-16 10:31:05 +02:00
|
|
|
<span *ngIf="authorNameParam" class="uk-width-1-1 uk-width-expand@m">
|
2024-01-29 16:57:44 +01:00
|
|
|
<a *ngIf="!properties.orcidDiscoverLinksPage" class="uk-button uk-button-text uk-align-left uk-align-right@m" [queryParams]="authorNameParam"
|
2021-04-16 10:31:05 +02:00
|
|
|
[routerLink]="properties.searchLinkToAdvancedResults" routerLinkActive="router-link-active">
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
Discover {{openaireEntities.RESULTS | lowercase}} related to you
|
2021-04-16 10:31:05 +02:00
|
|
|
</a>
|
2024-01-29 16:57:44 +01:00
|
|
|
<a *ngIf="properties.orcidDiscoverLinksPage" class="uk-button uk-button-text uk-align-left uk-align-right@m"
|
|
|
|
[routerLink]="properties.orcidDiscoverLinksPage" routerLinkActive="router-link-active">
|
|
|
|
Discover {{openaireEntities.RESULTS | lowercase}} related to you
|
|
|
|
</a>
|
2021-04-16 10:31:05 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="uk-margin-top">
|
|
|
|
<span>
|
2021-07-14 13:19:57 +02:00
|
|
|
Did you link a result with your ORCID <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="" loading="lazy">
|
2022-07-17 15:01:39 +02:00
|
|
|
but the <span class="text-orcid">green icon</span> is missing?
|
2021-04-16 10:31:05 +02:00
|
|
|
<br>
|
|
|
|
No worries! It will appear, as soon as we synchronize again with ORCID data.
|
2021-05-19 15:07:43 +02:00
|
|
|
<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"
|
2021-04-16 10:31:05 +02:00
|
|
|
target="_blank" class="uk-display-inline-block">
|
|
|
|
Read more <span class="custom-external custom-icon space"></span>
|
|
|
|
</a>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div *ngIf="showErrorMessage" class="uk-animation-fade uk-alert uk-alert-warning uk-margin-large-top" role="alert">
|
|
|
|
An Error Occurred
|
|
|
|
</div>
|
|
|
|
<div *ngIf="!showLoading && !orcidQuery && !requestGrant && !showErrorMessage"
|
2022-06-27 11:00:30 +02:00
|
|
|
class="uk-animation-fade uk-text-meta uk-text-large uk-text-center uk-margin-large-top">
|
2021-04-16 10:31:05 +02:00
|
|
|
No ORCID links found
|
|
|
|
</div>
|
|
|
|
<div *ngIf="requestGrant" class="uk-margin-large-top">
|
|
|
|
<div class="uk-text-center uk-padding-small">
|
|
|
|
<div>
|
|
|
|
This is a private page, only for users that have connected their ORCID iD with OpenAIRE.
|
|
|
|
Please grant OpenAIRE to access and update your ORCID works.
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="uk-margin-medium-top uk-align-center">
|
|
|
|
<button (click)="openGrantWindow()" type="submit"
|
|
|
|
class="uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left uk-button-primary">
|
|
|
|
<span>Grant OpenAIRE</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-02-10 10:12:23 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-04-16 10:31:05 +02:00
|
|
|
|
|
|
|
<div *ngIf="orcidQuery" class="tm-middle" id="tm-main">
|
|
|
|
<div uk-grid="" class="uk-grid uk-grid-stack">
|
|
|
|
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first uk-first-column">
|
|
|
|
<div class="uk-container uk-container-large">
|
|
|
|
<my-orcid-result [previewResults]="currentResults"
|
|
|
|
[status]="searchUtils.status"
|
|
|
|
[type]="resultType"
|
|
|
|
[properties]=properties
|
|
|
|
[currentPage]="currentPage"
|
|
|
|
[totalResults]="totalOrcidResults"
|
|
|
|
[resultsPerPage]="resultsPerPage"
|
|
|
|
(pageChange)="pageChanged($event)">
|
|
|
|
</my-orcid-result>
|
|
|
|
</div>
|
2021-02-10 10:12:23 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-07-17 15:01:39 +02:00
|
|
|
`
|
2021-02-10 10:12:23 +01:00
|
|
|
})
|
|
|
|
export class MyOrcidLinksComponent {
|
|
|
|
public resultType: string = "result";
|
|
|
|
|
|
|
|
private errorCodes: ErrorCodes;
|
|
|
|
private errorMessages: ErrorMessagesComponent;
|
2023-07-12 14:05:25 +02:00
|
|
|
|
2023-08-09 10:52:30 +02:00
|
|
|
public results:Map<number,{"work":{},results:ResultPreview[]}[]> = new Map();
|
|
|
|
public currentResults:{"work":{},results:ResultPreview[]}[] = [];
|
2021-02-10 10:12:23 +01:00
|
|
|
public totalResults:number = 0 ;
|
|
|
|
public baseUrl:string;
|
|
|
|
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
|
|
|
public subscriptions: any[] = [];
|
|
|
|
public _location:Location;
|
|
|
|
|
|
|
|
public disableForms: boolean = false;
|
|
|
|
public loadPaging: boolean = true;
|
|
|
|
public oldTotalResults: number = 0;
|
|
|
|
pagingLimit = 0;
|
|
|
|
|
2024-07-02 12:51:15 +02:00
|
|
|
properties:EnvProperties = properties;
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
public openaireEntities = OpenaireEntities;
|
2021-05-19 15:07:43 +02:00
|
|
|
public lastOrcidUpdateDate: string = "";
|
2021-02-10 10:12:23 +01:00
|
|
|
|
|
|
|
@Input() public communityId: string = null;
|
|
|
|
|
|
|
|
public routerHelper:RouterHelper = new RouterHelper();
|
|
|
|
parameters = {};
|
|
|
|
keyword = "";
|
|
|
|
|
|
|
|
identifiers: string[] = [];
|
|
|
|
works: any[] = [];
|
|
|
|
|
|
|
|
orcidQuery: string = "";
|
|
|
|
typeQuery: string = "";
|
|
|
|
|
|
|
|
public showLoading: boolean = true;
|
|
|
|
|
|
|
|
currentPage: number = 1;
|
|
|
|
totalOrcidResults: number;
|
|
|
|
resultsPerPage: number = 5;
|
|
|
|
|
|
|
|
public requestGrant: boolean = false;
|
|
|
|
public window: any;
|
|
|
|
private tokenUrl: string;
|
|
|
|
private clientId: string = "APP-A5M3KTX6NCN67L91";
|
|
|
|
|
[Trunk | Library]:
1. resultLanding.component.html & result-preview.component.html: Show orcid buttons in all environments (production too) | in <orcid-work> added "resultTitle" property.
2. myOrcidLinks.component.ts: Added "getPersonalDetails()" method and link to advanced research outcomes page, filtered by user's name (if personal details from ORCID fails, use name from AAI - getUserInfo).
3. searchMyOrcidResults.module.ts: Removed PagingModule and added NoLoadPaging.
4. searchMyOrcidResults.component.ts: Added method "totalPages()" to calculate pages in paging.
5. searchMyOrcidResults.component.html:
a. Added <no-load-paging> (instead of custom paging with <paging-no-load>).
b. In <orcid-work> added "resultTitle" property.
c. Fix widths of grid inside card for result preview and orcid buttons.
6. orcid-work.component.ts:
a. Added "resultTitle" @Input property, to show it in notifications, instead of pids.
b. Updated messages for errors and for multiple put-codes.
c. Use "danger" notifications instead of "warning" when an error occurs.
d. For search and my orcid links pages, in orcid buttons, use <icon> for icons | For landing page, updated icons in orcid buttons.
e. Added message "The action will affect your real ORCID iD." in tooltips, when environment == 'beta'.
f. Removed property "procedurePaused" and its usage replaced by "currentAction".
g. [Bug fix] For search pages, added "uk-align-right", in order orcid button not to take width for the whole line.
h. [Bug fix] In method "getOrcidWorks()" check "Session.isLoggedIn()" was missing.
7. orcid.component.ts: If personal details from ORCID fails, use name from AAI - getUserInfo.
8. orcid.module.ts: Added IconsModule and registered icons: add, remove, preview, refresh in IconsService.
9. searchResult.component.ts: Call "orcidService.getPutCodes()" in all environments (production too).
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60619 d315682c-612b-4755-9ff5-7f18f6832af3
2021-03-11 02:40:53 +01:00
|
|
|
public authorNameParam: any = null;
|
|
|
|
|
2021-02-10 10:12:23 +01:00
|
|
|
public showErrorMessage: boolean = false;
|
|
|
|
|
|
|
|
constructor (private route: ActivatedRoute, private router: Router,
|
2021-04-13 15:32:58 +02:00
|
|
|
private _piwikService:PiwikService,
|
2021-02-10 10:12:23 +01:00
|
|
|
private _orcidService: OrcidService,
|
2021-05-19 15:07:43 +02:00
|
|
|
private indexInfoService: IndexInfoService,
|
2021-02-20 10:23:59 +01:00
|
|
|
private _searchResearchResultsService: SearchResearchResultsService,
|
[Trunk | Library]:
1. resultLanding.component.html & result-preview.component.html: Show orcid buttons in all environments (production too) | in <orcid-work> added "resultTitle" property.
2. myOrcidLinks.component.ts: Added "getPersonalDetails()" method and link to advanced research outcomes page, filtered by user's name (if personal details from ORCID fails, use name from AAI - getUserInfo).
3. searchMyOrcidResults.module.ts: Removed PagingModule and added NoLoadPaging.
4. searchMyOrcidResults.component.ts: Added method "totalPages()" to calculate pages in paging.
5. searchMyOrcidResults.component.html:
a. Added <no-load-paging> (instead of custom paging with <paging-no-load>).
b. In <orcid-work> added "resultTitle" property.
c. Fix widths of grid inside card for result preview and orcid buttons.
6. orcid-work.component.ts:
a. Added "resultTitle" @Input property, to show it in notifications, instead of pids.
b. Updated messages for errors and for multiple put-codes.
c. Use "danger" notifications instead of "warning" when an error occurs.
d. For search and my orcid links pages, in orcid buttons, use <icon> for icons | For landing page, updated icons in orcid buttons.
e. Added message "The action will affect your real ORCID iD." in tooltips, when environment == 'beta'.
f. Removed property "procedurePaused" and its usage replaced by "currentAction".
g. [Bug fix] For search pages, added "uk-align-right", in order orcid button not to take width for the whole line.
h. [Bug fix] In method "getOrcidWorks()" check "Session.isLoggedIn()" was missing.
7. orcid.component.ts: If personal details from ORCID fails, use name from AAI - getUserInfo.
8. orcid.module.ts: Added IconsModule and registered icons: add, remove, preview, refresh in IconsService.
9. searchResult.component.ts: Call "orcidService.getPutCodes()" in all environments (production too).
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60619 d315682c-612b-4755-9ff5-7f18f6832af3
2021-03-11 02:40:53 +01:00
|
|
|
private userManagementService: UserManagementService,
|
2021-02-20 10:23:59 +01:00
|
|
|
private _meta: Meta, private _title: Title
|
2021-02-10 10:12:23 +01:00
|
|
|
) {
|
|
|
|
this.errorCodes = new ErrorCodes();
|
|
|
|
this.errorMessages = new ErrorMessagesComponent();
|
|
|
|
this.searchUtils.status = this.errorCodes.LOADING;
|
|
|
|
this.searchUtils.page =1;
|
|
|
|
|
|
|
|
if(typeof document !== 'undefined') {
|
2021-02-24 21:33:37 +01:00
|
|
|
this.tokenUrl = properties.orcidTokenURL
|
2023-09-18 11:23:33 +02:00
|
|
|
+ "client_id=" + properties.orcidClientId
|
2021-02-10 10:12:23 +01:00
|
|
|
// + "&response_type=code&scope=/activities/update"
|
|
|
|
// + "&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";
|
2021-05-19 15:07:43 +02:00
|
|
|
|
|
|
|
this.indexInfoService.getLastOrcidUpdateDate(properties).subscribe(
|
|
|
|
date => {
|
|
|
|
this.lastOrcidUpdateDate = date;
|
|
|
|
},
|
|
|
|
error => { console.error("Error in fetching last orcid update date ",error); }
|
|
|
|
)
|
2021-02-10 10:12:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public ngOnInit() {
|
2021-04-16 10:31:05 +02:00
|
|
|
this.baseUrl = this.properties.myOrcidLinksPage;
|
2021-02-10 10:12:23 +01:00
|
|
|
this.pagingLimit = this.properties.pagingLimit;
|
2021-02-20 10:23:59 +01:00
|
|
|
var description = "Openaire, ORCID linking, publication, research data, software, other research product";
|
|
|
|
this.updateTitle("My ORCID Links");
|
|
|
|
this.updateDescription(description);
|
|
|
|
this.updateUrl( properties.domain + properties.baseLink + this.route.url);
|
2023-07-12 14:05:25 +02:00
|
|
|
this.subscriptions.push(this._piwikService.trackView(this.properties, "My ORCID links").subscribe());
|
2021-02-10 10:12:23 +01:00
|
|
|
this.typeQuery = "&type=results";
|
|
|
|
this.getLocalWorks();
|
[Trunk | Library]:
1. resultLanding.component.html & result-preview.component.html: Show orcid buttons in all environments (production too) | in <orcid-work> added "resultTitle" property.
2. myOrcidLinks.component.ts: Added "getPersonalDetails()" method and link to advanced research outcomes page, filtered by user's name (if personal details from ORCID fails, use name from AAI - getUserInfo).
3. searchMyOrcidResults.module.ts: Removed PagingModule and added NoLoadPaging.
4. searchMyOrcidResults.component.ts: Added method "totalPages()" to calculate pages in paging.
5. searchMyOrcidResults.component.html:
a. Added <no-load-paging> (instead of custom paging with <paging-no-load>).
b. In <orcid-work> added "resultTitle" property.
c. Fix widths of grid inside card for result preview and orcid buttons.
6. orcid-work.component.ts:
a. Added "resultTitle" @Input property, to show it in notifications, instead of pids.
b. Updated messages for errors and for multiple put-codes.
c. Use "danger" notifications instead of "warning" when an error occurs.
d. For search and my orcid links pages, in orcid buttons, use <icon> for icons | For landing page, updated icons in orcid buttons.
e. Added message "The action will affect your real ORCID iD." in tooltips, when environment == 'beta'.
f. Removed property "procedurePaused" and its usage replaced by "currentAction".
g. [Bug fix] For search pages, added "uk-align-right", in order orcid button not to take width for the whole line.
h. [Bug fix] In method "getOrcidWorks()" check "Session.isLoggedIn()" was missing.
7. orcid.component.ts: If personal details from ORCID fails, use name from AAI - getUserInfo.
8. orcid.module.ts: Added IconsModule and registered icons: add, remove, preview, refresh in IconsService.
9. searchResult.component.ts: Call "orcidService.getPutCodes()" in all environments (production too).
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60619 d315682c-612b-4755-9ff5-7f18f6832af3
2021-03-11 02:40:53 +01:00
|
|
|
this.getPersonalDetails();
|
2021-02-10 10:12:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public ngOnDestroy() {
|
|
|
|
for(let sub of this.subscriptions){
|
|
|
|
sub.unsubscribe();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
[Trunk | Library]:
1. resultLanding.component.html & result-preview.component.html: Show orcid buttons in all environments (production too) | in <orcid-work> added "resultTitle" property.
2. myOrcidLinks.component.ts: Added "getPersonalDetails()" method and link to advanced research outcomes page, filtered by user's name (if personal details from ORCID fails, use name from AAI - getUserInfo).
3. searchMyOrcidResults.module.ts: Removed PagingModule and added NoLoadPaging.
4. searchMyOrcidResults.component.ts: Added method "totalPages()" to calculate pages in paging.
5. searchMyOrcidResults.component.html:
a. Added <no-load-paging> (instead of custom paging with <paging-no-load>).
b. In <orcid-work> added "resultTitle" property.
c. Fix widths of grid inside card for result preview and orcid buttons.
6. orcid-work.component.ts:
a. Added "resultTitle" @Input property, to show it in notifications, instead of pids.
b. Updated messages for errors and for multiple put-codes.
c. Use "danger" notifications instead of "warning" when an error occurs.
d. For search and my orcid links pages, in orcid buttons, use <icon> for icons | For landing page, updated icons in orcid buttons.
e. Added message "The action will affect your real ORCID iD." in tooltips, when environment == 'beta'.
f. Removed property "procedurePaused" and its usage replaced by "currentAction".
g. [Bug fix] For search pages, added "uk-align-right", in order orcid button not to take width for the whole line.
h. [Bug fix] In method "getOrcidWorks()" check "Session.isLoggedIn()" was missing.
7. orcid.component.ts: If personal details from ORCID fails, use name from AAI - getUserInfo.
8. orcid.module.ts: Added IconsModule and registered icons: add, remove, preview, refresh in IconsService.
9. searchResult.component.ts: Call "orcidService.getPutCodes()" in all environments (production too).
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60619 d315682c-612b-4755-9ff5-7f18f6832af3
2021-03-11 02:40:53 +01:00
|
|
|
private getPersonalDetails() {
|
|
|
|
//get author name
|
|
|
|
this.subscriptions.push(this._orcidService.getPersonalDetails().subscribe(
|
|
|
|
details => {
|
|
|
|
let author: string = "";
|
2024-01-29 16:57:44 +01:00
|
|
|
console.log(details)
|
[Trunk | Library]:
1. resultLanding.component.html & result-preview.component.html: Show orcid buttons in all environments (production too) | in <orcid-work> added "resultTitle" property.
2. myOrcidLinks.component.ts: Added "getPersonalDetails()" method and link to advanced research outcomes page, filtered by user's name (if personal details from ORCID fails, use name from AAI - getUserInfo).
3. searchMyOrcidResults.module.ts: Removed PagingModule and added NoLoadPaging.
4. searchMyOrcidResults.component.ts: Added method "totalPages()" to calculate pages in paging.
5. searchMyOrcidResults.component.html:
a. Added <no-load-paging> (instead of custom paging with <paging-no-load>).
b. In <orcid-work> added "resultTitle" property.
c. Fix widths of grid inside card for result preview and orcid buttons.
6. orcid-work.component.ts:
a. Added "resultTitle" @Input property, to show it in notifications, instead of pids.
b. Updated messages for errors and for multiple put-codes.
c. Use "danger" notifications instead of "warning" when an error occurs.
d. For search and my orcid links pages, in orcid buttons, use <icon> for icons | For landing page, updated icons in orcid buttons.
e. Added message "The action will affect your real ORCID iD." in tooltips, when environment == 'beta'.
f. Removed property "procedurePaused" and its usage replaced by "currentAction".
g. [Bug fix] For search pages, added "uk-align-right", in order orcid button not to take width for the whole line.
h. [Bug fix] In method "getOrcidWorks()" check "Session.isLoggedIn()" was missing.
7. orcid.component.ts: If personal details from ORCID fails, use name from AAI - getUserInfo.
8. orcid.module.ts: Added IconsModule and registered icons: add, remove, preview, refresh in IconsService.
9. searchResult.component.ts: Call "orcidService.getPutCodes()" in all environments (production too).
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60619 d315682c-612b-4755-9ff5-7f18f6832af3
2021-03-11 02:40:53 +01:00
|
|
|
if(details && details['name']) {
|
|
|
|
let name: string = details['name'];
|
|
|
|
if(name['given-names'] && name['given-names']['value']) {
|
|
|
|
author = name['given-names']['value'];
|
|
|
|
}
|
|
|
|
if(name['family-name'] && name['family-name']['value']) {
|
|
|
|
author += (author ? " " : "") + name['family-name']['value'];
|
|
|
|
}
|
|
|
|
this.authorNameParam = this.routerHelper.createQueryParams(['f0', 'fv0'], ['resultauthor', author]);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
error => {
|
|
|
|
console.error("Error getting personal details", error);
|
|
|
|
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
|
|
|
if (user) {
|
|
|
|
this.authorNameParam = this.routerHelper.createQueryParams(['f0', 'fv0'], ['resultauthor', user.fullname]);
|
|
|
|
}
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2021-02-10 10:12:23 +01:00
|
|
|
openGrantWindow() {
|
|
|
|
this.window = window.open(this.tokenUrl, '_blank',
|
|
|
|
'location=yes,height=700,width=540,left=500,top=100,scrollbars=yes,status=yes');
|
|
|
|
|
|
|
|
let self = this;
|
|
|
|
window.onmessage = function (ev) {
|
2022-06-20 14:56:29 +02:00
|
|
|
if (ev.isTrusted && ev.origin == location.origin && ev.data == 'success') {
|
|
|
|
self.requestGrant = false;
|
|
|
|
UIkit.notification({
|
|
|
|
message: 'Thank you for <strong>connecting your ORCID iD</strong> with OpenAIRE!',
|
|
|
|
status: 'success',
|
|
|
|
timeout: 6000,
|
|
|
|
pos: 'bottom-right'
|
|
|
|
});
|
|
|
|
self.getLocalWorks();
|
|
|
|
}
|
2021-02-10 10:12:23 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
getLocalWorks() {
|
|
|
|
this.showErrorMessage = false;
|
|
|
|
|
|
|
|
this.showLoading = true;
|
|
|
|
this.subscriptions.push(this._orcidService.getLocalWorks().subscribe(
|
|
|
|
(response: any[]) => {
|
|
|
|
|
|
|
|
this.works = response;//['results'];
|
2023-08-09 10:53:31 +02:00
|
|
|
/* this.works=[
|
2023-08-09 10:52:30 +02:00
|
|
|
{ "id" : "60391ad16c2043536ca44ea4", "pids" : [ "10.5281/zeno(do.4304132", "10.5281/zenodo.3974605" ], "putCode" : "89558576", "orcid" : "0000-0002-3880-0244", "creationDate" : "2021-02-26T15:59:13.098Z", "updateDate" : "2021-02-26T15:59:13.098Z", "dashboard" : "production_explore" },
|
|
|
|
{ "id" : "60391ceb7a767127ea9a4d06", "pids" : [ "10.5281/zenodo.4095044", "10.5281/zenodo.4095043" ], "putCode" : "89559422", "orcid" : "0000-0002-3880-0244", "creationDate" : "2021-02-26T16:08:11.930Z", "updateDate" : "2021-02-26T16:27:12.835Z", "dashboard" : "production_explore" },
|
|
|
|
{ "id" : "604244fb7a767127ea9a4d0b", "pids" : [ "10.5281/zenodo.3467103", "10.5281/zenodo.3467104", "10.1007/978-3-030-30760-8_5", "1822/62856" ], "putCode" : "90020579", "orcid" : "0000-0002-3880-0244", "creationDate" : "2021-03-05T14:49:31.972Z", "updateDate" : "2022-06-20T08:28:08.539Z", "dashboard" : "production_explore" },
|
|
|
|
{ "id" : "60744bb46c20432760765b9f", "pids" : [ "10.5281/zenodo.3701379", "10.5281/zenodo.3701380" ], "putCode" : "92074390", "orcid" : "0000-0002-3880-0244", "creationDate" : "2021-04-12T13:31:32.476Z", "updateDate" : "2021-04-12T13:31:32.476Z", "dashboard" : "production_explore" },
|
|
|
|
{ "id" : "6077f0047a767112e847f9f8", "pids" : [ "10.5281/zenodo.4559726" ], "putCode" : "92235922", "orcid" : "0000-0002-3880-0244", "creationDate" : "2021-04-15T07:49:24.078Z", "updateDate" : "2021-04-21T09:43:40.147Z", "dashboard" : "production_explore" },
|
|
|
|
{ "id" : "6079752b7a767112e847fa5b", "pids" : [ "10.5281/zenodo.4304047", "10.5281/zenodo.3980491" ], "putCode" : "92304809", "orcid" : "0000-0002-3880-0244", "creationDate" : "2021-04-16T11:29:47.905Z", "updateDate" : "2021-04-16T11:29:47.905Z", "dashboard" : "production_explore" },
|
|
|
|
{ "id" : "63186abb7a767129935f495b", "pids" : [ "10.5281/zenodo.1314672", "10.5281/zenodo.1412509", "10.5281/zenodo.1314671" ], "putCode" : "118582128", "orcid" : "0000-0002-3880-0244", "creationDate" : "2022-09-07T09:56:11.556Z", "updateDate" : "2022-09-07T09:56:11.556Z", "dashboard" : "production_explore" },
|
|
|
|
{ "id" : "63186ade6c204337f56d97ca", "pids" : [ "10.5281/zenodo.6634431", "10.5281/zenodo.6385204", "10.5281/zenodo.4559725" ], "putCode" : "118582151", "orcid" : "0000-0002-3880-0244", "creationDate" : "2022-09-07T09:56:46.231Z", "updateDate" : "2022-09-07T09:56:46.231Z", "dashboard" : "production_explore" },
|
|
|
|
{ "id" : "63186ae27a767129935f495c", "pids" : [ "10.5281/zenodo.5801283", "10.5281/zenodo.3516917", "10.5281/zenodo.6616871" ], "putCode" : "118582162", "orcid" : "0000-0002-3880-0244", "creationDate" : "2022-09-07T09:56:50.660Z", "updateDate" : "2022-09-07T09:56:50.660Z", "dashboard" : "production_explore" }
|
2023-08-09 10:53:31 +02:00
|
|
|
];*/
|
2023-08-09 10:52:30 +02:00
|
|
|
|
2021-02-10 10:12:23 +01:00
|
|
|
this.totalOrcidResults = this.works.length;//response['total'];
|
|
|
|
|
|
|
|
this.prepareOrcidQuery();
|
|
|
|
},
|
|
|
|
error => {
|
|
|
|
this.handleError(error, "Could not get locally stored user's ORCID works");
|
|
|
|
this.showLoading = false;
|
|
|
|
}
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
public prepareOrcidQuery() {
|
|
|
|
|
2023-08-09 10:52:30 +02:00
|
|
|
if(Array.from(this.results.keys()).length >= this.currentPage) {
|
2021-02-10 10:12:23 +01:00
|
|
|
this.currentResults = this.results[this.currentPage-1];
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.showLoading = true;
|
|
|
|
|
|
|
|
this.orcidQuery = "";
|
|
|
|
|
|
|
|
let from: number = (this.currentPage-1)*this.resultsPerPage;
|
|
|
|
if(from >= this.works.length) {
|
|
|
|
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
|
|
|
}
|
|
|
|
let to: number = this.currentPage*this.resultsPerPage;
|
|
|
|
|
|
|
|
if(to > this.works.length) {
|
|
|
|
to = this.works.length;
|
|
|
|
}
|
|
|
|
|
|
|
|
let works = this.works.slice(from, to);
|
|
|
|
|
|
|
|
for(let work of works) {
|
|
|
|
for(let pid of work['pids']) {
|
2021-04-26 11:42:41 +02:00
|
|
|
let identifier: Identifier = Identifier.getIdentifierFromString(pid, false);
|
2023-10-30 09:53:19 +01:00
|
|
|
this.orcidQuery += (this.orcidQuery ? " or " : "") + ('(pid="'+StringUtils.URIEncode(identifier.id)+'")');
|
2021-02-10 10:12:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
this.showLoading = false;
|
|
|
|
this._getResults(works);
|
|
|
|
}
|
|
|
|
|
|
|
|
public _getResults(works: any) {
|
|
|
|
this.searchUtils.status = this.errorCodes.LOADING;
|
|
|
|
this.disableForms = true;
|
|
|
|
this.currentResults = [];
|
|
|
|
this.searchUtils.totalResults = 0;
|
|
|
|
this.subscriptions.push(this._searchResearchResultsService.searchForMyOrcidLinks(this.resultType, this.orcidQuery, this.typeQuery, 1, 50)
|
|
|
|
.subscribe(
|
|
|
|
data => {
|
|
|
|
let totalResults = data[0];
|
|
|
|
let results = data[1];
|
|
|
|
|
|
|
|
this.resultsReturned(results, totalResults, works);
|
|
|
|
},
|
|
|
|
err => {
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
console.error("Error getting " + this.getEntityName(this.resultType, true));
|
2021-02-10 10:12:23 +01:00
|
|
|
this.showLoading = false;
|
|
|
|
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
|
|
|
this.disableForms = false;
|
|
|
|
}
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public resultsReturned(results: any, totalResults, works: any[]) {
|
|
|
|
this.searchUtils.totalResults = totalResults;
|
|
|
|
|
|
|
|
let resultsFound: Map<string[], number> = new Map<string[], number>();
|
|
|
|
|
|
|
|
for(let work of works) {
|
2023-08-09 10:52:30 +02:00
|
|
|
let relatedResults = [];
|
|
|
|
this.currentResults.push({"work": work, "results" : relatedResults})
|
2021-02-10 10:12:23 +01:00
|
|
|
results.forEach(result => {
|
|
|
|
let identifierValues: string[] = [].concat(...Array.from(result.identifiers.values()));
|
|
|
|
if(work['pids'].some(pid => identifierValues.includes(pid))) {
|
|
|
|
|
|
|
|
let index: number = resultsFound.get(identifierValues);
|
|
|
|
if(!index) {
|
2023-08-09 10:52:30 +02:00
|
|
|
relatedResults.push(this.getResultPreview(result));
|
|
|
|
index = relatedResults.length - 1;
|
|
|
|
relatedResults[index].orcidPutCodes = [];
|
|
|
|
relatedResults[index].orcidCreationDates = [];
|
|
|
|
relatedResults[index].orcidUpdateDates = [];
|
2021-02-10 10:12:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (work['putCode']) {
|
2023-08-09 10:52:30 +02:00
|
|
|
relatedResults[index].orcidPutCodes.push(work['putCode']);
|
2021-02-10 10:12:23 +01:00
|
|
|
}
|
|
|
|
if (work['creationDate']) {
|
2023-08-09 10:52:30 +02:00
|
|
|
relatedResults[index].orcidCreationDates.push(work['creationDate']);
|
2021-02-10 10:12:23 +01:00
|
|
|
}
|
|
|
|
if (work['updateDate']) {
|
2023-08-09 10:52:30 +02:00
|
|
|
relatedResults[index].orcidUpdateDates.push(work['updateDate']);
|
2021-02-10 10:12:23 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
this.results[this.currentPage-1] = this.currentResults;
|
|
|
|
|
|
|
|
this.searchUtils.status = this.errorCodes.DONE;
|
|
|
|
if (this.searchUtils.totalResults == 0) {
|
|
|
|
this.searchUtils.status = this.errorCodes.NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.disableForms = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public getResultPreview(result: SearchResult): ResultPreview {
|
|
|
|
return ResultPreview.searchResultConvert(result, (result.entityType)?result.entityType:this.resultType);
|
|
|
|
}
|
|
|
|
|
[Monitor Dashboard & Library | new-theme]: Renaming entity types using OpenaireEntities.
Files updated: develop.component.ts, methodology.component.ts, claimEntitiesSelection.component.ts, directLinking.component.ts, linkingGeneric.component.html, linkingGeneric.component.ts, approved.component.ts, searchDataprovidersToDeposit.component.ts, errorPage.component.ts, dataProvider.component.html, dataProvider.component.ts, dataProvider.service.ts, relatedDatasourcesTab.component.ts, project.component.ts, myOrcidLinks.component.ts, searchMyOrcidResults.component.html, searchMyOrcidResults.component.ts, searchAll.component.html, searchAll.component.ts, advancedSearchForm.component.html, advancedSearchForm.component.ts, searchDataProviders.component.ts, searchResearchResults.service.ts, numbers.component.ts, other-portals.component.html, other-portals.component.ts, fetchDataproviders.class.ts, fetchResearchResults.class.ts, searchFields.ts, result-preview.component.ts
2022-05-09 12:13:44 +02:00
|
|
|
public getEntityName(entityType: string, plural: boolean): string {
|
2022-06-03 12:01:55 +02:00
|
|
|
return StringUtils.getEntityName(entityType, plural);
|
2021-02-10 10:12:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public pageChanged($event) {
|
|
|
|
this.currentPage = $event.value;
|
|
|
|
this.prepareOrcidQuery();
|
|
|
|
}
|
|
|
|
|
|
|
|
handleError(error, errorMsg: string) {
|
|
|
|
if(error && (error.status == "401" || error.status == "403")) {
|
|
|
|
this.requestGrant = true;
|
|
|
|
} else {
|
|
|
|
this.showErrorMessage = true;
|
|
|
|
}
|
|
|
|
this.showLoading = false;
|
|
|
|
}
|
2021-02-20 10:23:59 +01:00
|
|
|
|
|
|
|
private updateTitle(title: string) {
|
|
|
|
this._title.setTitle(title);
|
|
|
|
this._meta.updateTag({content: title}, "property='og:title'");
|
|
|
|
}
|
|
|
|
|
|
|
|
private updateDescription(description: string) {
|
|
|
|
this._meta.updateTag({content: description}, "name='description'");
|
|
|
|
this._meta.updateTag({content: description}, "property='og:description'");
|
|
|
|
}
|
|
|
|
|
|
|
|
private updateUrl(url: string) {
|
|
|
|
this._meta.updateTag({content: url}, "property='og:url'");
|
|
|
|
}
|
2021-02-10 10:12:23 +01:00
|
|
|
}
|