2021-01-13 19:23:31 +01:00
import { Component , Input , ViewChild } from '@angular/core' ;
import { ActivatedRoute , Router } from "@angular/router" ;
import { Subscriber , Subscription } from "rxjs" ;
import { OrcidService } from "./orcid.service" ;
import { ResultLandingInfo } from "../utils/entities/resultLandingInfo" ;
import { ResultLandingService } from "../landingPages/result/resultLanding.service" ;
import { properties } from "../../../environments/environment" ;
2021-02-10 10:01:55 +01:00
import { Session } from "../login/utils/helper.class" ;
import { LoginErrorCodes } from "../login/utils/guardHelper.class" ;
import { ExternalIDV3_0 , WorkV3_0 } from "./orcidWork" ;
[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 { EnvProperties } from "../utils/properties/env-properties" ;
2022-04-12 13:36:31 +02:00
import { UserManagementService } from "../services/user-management.service" ;
2022-05-04 12:57:13 +02:00
import { OpenaireEntities } from "../utils/properties/searchFields" ;
2021-01-13 19:23:31 +01:00
declare var UIkit : any ;
@Component ( {
styles : [
2022-04-16 09:47:30 +02:00
'.loading-action-button { width: 35px; height: 35px; }'
2021-01-13 19:23:31 +01:00
] ,
selector : 'orcid-work' ,
template : `
2021-02-10 10:01:55 +01:00
< ng - container * ngIf = "pageType == 'search'" >
< span * ngIf = "!putCodes || putCodes.length == 0"
2022-04-12 13:36:31 +02:00
[ attr . uk - tooltip ] = "(!isLoggedIn) ? tooltipNoLoggedInUser : tooltipAdd"
2022-05-31 14:37:16 +02:00
class = "uk-margin-remove-bottom" >
[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
< a ( click ) = " currentAction = 'add' ; saveWorkPreparation ( ) ; "
2022-05-31 14:37:16 +02:00
[ class ] = "'uk-button uk-button-link uk-flex uk-flex-middle uk-flex-right@s uk-margin-right '+ ((showLoading || !isLoggedIn) ? 'uk-disabled ' : '') + (!isLoggedIn ? 'half-opacity' : '')" >
2022-04-28 11:13:06 +02:00
< icon * ngIf = "!showLoading" name = "add" ratio = "1" flex = "true" > < / icon >
2021-02-10 10:01:55 +01:00
< span * ngIf = "showLoading" class = "uk-icon icon-button" > < loading [ top_margin ] = " false " > < / loading > < / span >
2022-03-15 12:13:28 +01:00
< span class = "uk-margin-small-left uk-flex uk-flex-middle" > Add to & # 160 ;
2022-04-12 13:36:31 +02:00
< span class = "uk-flex uk-flex-middle" >
2022-03-15 12:13:28 +01:00
< span > ORCID & # 160 ; < / span >
2022-04-28 11:13:06 +02:00
< img class = "" src = "assets/common-assets/common/ORCIDiD_icon16x16.png" alt = "orcid" style = "width:16px; height:16px" loading = "lazy" > & # 160 ;
2021-02-10 10:01:55 +01:00
< / span >
< / span >
< / a >
< / span >
< span * ngIf = "putCodes && putCodes.length > 0"
2022-04-12 13:36:31 +02:00
[ attr . uk - tooltip ] = "(!isLoggedIn) ? tooltipNoLoggedInUser : tooltipDelete"
2022-05-31 14:37:16 +02:00
class = "uk-margin-remove-bottom" >
[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
< a ( click ) = " currentAction = 'delete' ; deleteWorks ( ) ; "
2022-05-31 14:37:16 +02:00
[ class ] = "'uk-button uk-button-link uk-flex uk-flex-middle uk-flex-right@s uk-margin-right '+ (showLoading ? 'uk-disabled' : '')" >
2022-04-28 11:13:06 +02:00
< icon * ngIf = "!showLoading" name = "delete" ratio = "0.8" flex = "true" > < / icon >
2021-02-10 10:01:55 +01:00
< span * ngIf = "showLoading" class = "uk-icon icon-button" > < loading [ top_margin ] = " false " > < / loading > < / span >
2022-03-15 12:13:28 +01:00
< span class = "uk-margin-small-left uk-flex uk-flex-middle" > Delete from & # 160 ;
2022-04-12 13:36:31 +02:00
< span class = "space uk-flex uk-flex-middle" >
2022-03-15 12:13:28 +01:00
< span > ORCID & # 160 ; < / span >
2022-04-28 11:13:06 +02:00
< img class = "space" src = "assets/common-assets/common/ORCIDiD_icon16x16.png" alt = "" loading = "lazy" > & # 160 ;
2021-02-10 10:01:55 +01:00
< / span >
< / span >
< / a >
< / span >
< / n g - c o n t a i n e r >
< ng - container * ngIf = "pageType == 'landing'" >
< span * ngIf = "!putCodes || putCodes.length == 0"
2022-04-16 09:47:30 +02:00
[ attr . uk - tooltip ] = "'pos: right; cls: uk-active landing-action-tooltip uk-text-small uk-padding-small'"
[ title ] = "(!pids || !isLoggedIn) ? (!pids ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd" >
< a * ngIf = "!showLoading" ( click ) = " currentAction = 'add' ; saveWorkPreparation ( ) ; "
class = "uk-icon-button uk-icon landing-action-button landing-action-button-orcid"
[ class . uk - disabled ] = "showLoading || !isLoggedIn || !pids"
[ class . uk - text - muted ] = "!isLoggedIn || !pids"
( mouseover ) = "hoverEvent($event)" ( mouseout ) = "hoverEvent($event)" >
2022-04-20 16:40:18 +02:00
< icon * ngIf = "!hoverAdd" name = "orcid_add" ratio = "1.1" visuallyHidden = "add" > < / icon >
< icon * ngIf = "hoverAdd" name = "add" visuallyHidden = "add" > < / icon >
2021-02-10 10:01:55 +01:00
< / a >
2022-04-16 09:47:30 +02:00
< span * ngIf = "showLoading" class = "uk-icon icon-button loading-action-button" > < loading
[ top_margin ] = "false" > < / loading > < / span >
2021-02-10 10:01:55 +01:00
< / span >
< span * ngIf = "putCodes && putCodes.length > 0"
2022-04-16 09:47:30 +02:00
[ attr . uk - tooltip ] = "'pos: right; cls: uk-active landing-action-tooltip uk-text-small uk-padding-small'"
[ title ] = "(!pids || !isLoggedIn) ? (!pids ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete" >
< a * ngIf = "!showLoading" ( click ) = " currentAction = 'delete' ; deleteWorks ( ) ; "
class = "uk-icon-button uk-icon landing-action-button landing-action-button-orcid"
[ class . uk - disabled ] = "showLoading || !isLoggedIn || !pids"
[ class . uk - text - muted ] = "!isLoggedIn || !pids"
( mouseover ) = "hoverEvent($event, 'delete')" ( mouseout ) = "hoverEvent($event, 'delete')" >
2022-04-20 16:40:18 +02:00
< icon * ngIf = "!hoverDelete" name = "orcid_bin" ratio = "1.1" visuallyHidden = "delete" > < / icon >
< icon * ngIf = "hoverDelete" name = "delete_outline" class = "uk-text-danger" visuallyHidden = "delete" > < / icon >
2022-04-16 09:47:30 +02:00
< / a >
2021-02-10 10:01:55 +01:00
< span * ngIf = "showLoading" class = "uk-icon icon-button loading-action-button" > < loading
[ top_margin ] = "false" > < / loading > < / span >
2022-04-16 09:47:30 +02:00
< / span >
2021-02-10 10:01:55 +01:00
< / n g - c o n t a i n e r >
2022-06-20 12:02:23 +02:00
< modal - alert # grantModal [ overflowBody ] = false ( alertOutput ) = " openGrantWindow ( ) " >
< div >
2021-02-10 10:01:55 +01:00
< div > { { requestGrantMessage } } < / div >
2022-04-20 16:40:18 +02:00
<!-- < div class = "uk-margin-medium-top uk-align-right" > -- >
<!-- < button ( click ) = " closeGrantModal ( ) " type = "submit" - - >
<!-- class = "uk-button uk-padding-small uk-padding-remove-vertical uk-button-default" > -- >
<!-- < span > Cancel < / span > -- >
<!-- < / button > -- >
2021-02-10 10:01:55 +01:00
2021-02-20 10:23:59 +01:00
<!-- < button ( click ) = " openGrantWindow ( ) " type = "submit" - - >
2022-04-20 16:40:18 +02:00
<!-- class = "uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left uk-button-primary" > -- >
<!-- < span > Grant OpenAIRE < / span > -- >
2021-02-20 10:23:59 +01:00
<!-- < / button > -- >
2022-04-20 16:40:18 +02:00
<!-- & lt ; ! & ndash ; < button ( click ) = " openGrantWindow ( ) " type = "submit" & ndash ; & gt ; - - >
<!-- & lt ; ! & ndash ; class = "uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left orcid-button" > & ndash ; & gt ; -- >
<!-- & lt ; ! & ndash ; < img src = "assets/common-assets/common/ORCIDiD_icon16x16.png" alt = "" > { { " " } } & ndash ; & gt ; -- >
<!-- & lt ; ! & ndash ; < span > Create or Connect your ORCID iD < / span > & ndash ; & gt ; -- >
<!-- & lt ; ! & ndash ; < / button > & ndash ; & gt ; -- >
<!-- < / div > -- >
2021-02-10 10:01:55 +01:00
< / div >
< / m o d a l - a l e r t >
< ng - container * ngIf = "pageType == 'my_search'" >
2021-02-20 10:23:59 +01:00
< span class = "uk-margin-bottom uk-flex uk-flex-middle uk-flex-center" >
2022-03-15 12:13:28 +01:00
< span > ORCID & # 160 ; < / span >
2021-07-14 13:19:57 +02:00
< img class = "space" src = "assets/common-assets/common/ORCIDiD_icon16x16.png" alt = "" loading = "lazy" >
2022-03-15 12:13:28 +01:00
< span class = "space" > & # 160 ; ACTIONS < / span >
2021-02-20 10:23:59 +01:00
< / span >
2021-02-10 10:01:55 +01:00
< span [ attr.uk - tooltip ] = " ( ! putCodes | | putCodes.length = = 0 )
? 'This work is currently deleted.'
2021-02-14 23:42:05 +01:00
: 'View this work from your ORCID record' " >
2021-02-10 10:01:55 +01:00
< a ( click ) = " currentAction = 'get' ; getOrcidWorks ( ) "
2022-05-16 13:07:15 +02:00
[ class ] = "'uk-button uk-button-default action uk-flex uk-flex-middle '+ ((showLoading || !putCodes || putCodes.length == 0) ? 'uk-disabled' : '')" >
2022-04-28 11:13:06 +02:00
< icon * ngIf = "!showLoading || currentAction!='get'" name = "visibility" ratio = "1" flex = "true" > < / icon >
2021-02-10 10:01:55 +01:00
< span * ngIf = "showLoading && currentAction=='get'" class = "uk-icon icon-button" > < loading [ top_margin ] = " false " > < / loading > < / span >
2021-02-14 23:42:05 +01:00
< span class = "uk-margin-small-left" > View ORCID work < / span >
2021-02-10 10:01:55 +01:00
< / a >
< / span >
< span [ attr.uk - tooltip ] = " ( ! putCodes | | putCodes.length = = 0 )
? 'This work is currently deleted.'
2021-04-16 10:31:05 +02:00
: ( 'Update this work to your ORCID record' + ( ( properties . environment == 'beta' ) ? '. The action will affect your real ORCID iD.' : '' )
+ showUpdateDatesInTooltip ( ) ) " >
2021-02-10 10:01:55 +01:00
< a ( click ) = " currentAction = 'update' ; updateWorkPreparation ( ) "
2022-05-16 13:07:15 +02:00
[ class ] = "'uk-button uk-button-default action uk-margin-top uk-flex uk-flex-middle '+ ((showLoading || !putCodes || putCodes.length == 0) ? 'uk-disabled' : '')" >
2022-04-28 11:13:06 +02:00
< icon * ngIf = "!showLoading || currentAction!='update'" name = "refresh" ratio = "1" flex = "true" > < / icon >
2021-02-10 10:01:55 +01:00
< span * ngIf = "showLoading && currentAction=='update'" class = "uk-icon icon-button" > < loading [ top_margin ] = " false " > < / loading > < / span >
< span class = "uk-margin-small-left" > Update ORCID work < / span >
< / a >
< / span >
2021-02-14 23:42:05 +01:00
< span * ngIf = "!putCodes || putCodes.length == 0"
2022-04-12 13:36:31 +02:00
[ attr . uk - tooltip ] = "tooltipAdd" >
2021-02-14 23:42:05 +01:00
< a ( click ) = " currentAction = 'add' ; saveWorkPreparation ( ) ; "
2022-05-16 13:07:15 +02:00
[ class ] = "'uk-button uk-button-default action uk-margin-top uk-flex uk-flex-middle '+ (showLoading ? 'uk-disabled' : '')" >
2022-04-28 11:13:06 +02:00
< icon * ngIf = "!showLoading || currentAction!='add'" name = "add" ratio = "1" flex = "true" > < / icon >
2021-02-14 23:42:05 +01:00
< span * ngIf = "showLoading && currentAction=='add'" class = "uk-icon icon-button" > < loading [ top_margin ] = " false " > < / loading > < / span >
< span class = "uk-margin-small-left" > Add to ORCID < / span >
< / a >
< / span >
< span * ngIf = "putCodes && putCodes.length > 0"
2022-04-12 13:36:31 +02:00
[ attr . uk - tooltip ] = "tooltipDelete" >
2021-02-14 23:42:05 +01:00
< a ( click ) = " currentAction = 'delete' ; deleteWorks ( ) ; "
2022-05-16 13:07:15 +02:00
[ class ] = "'uk-button uk-button-default action uk-margin-top uk-flex uk-flex-middle '+ (showLoading ? 'uk-disabled' : '')" >
2022-04-28 11:13:06 +02:00
< icon * ngIf = "!showLoading || currentAction!='delete'" name = "delete" ratio = "1" flex = "true" > < / icon >
2021-02-14 23:42:05 +01:00
< span * ngIf = "showLoading && currentAction=='delete'" class = "uk-icon icon-button" > < loading [ top_margin ] = " false " > < / loading > < / span >
< span class = "uk-margin-small-left" > Delete from ORCID < / span >
< / a >
< / span >
2021-02-10 10:01:55 +01:00
< / n g - c o n t a i n e r >
2022-06-20 14:56:29 +02:00
< modal - alert # workModal large = "true" >
2022-04-20 16:40:18 +02:00
< div * ngIf = "orcidWorks" >
2022-06-20 15:55:05 +02:00
< div * ngFor = "let work of orcidWorks" >
< ng - container * ngIf = "work.work" >
< ng - container * ngTemplateOutlet = "orcidWorkPreview; context:{work: work['work']}" > < / n g - c o n t a i n e r >
< / n g - c o n t a i n e r >
2021-02-10 10:01:55 +01:00
< / div >
< / div >
< / m o d a l - a l e r t >
< ng - template # orcidWorkPreview let - work = "work" >
< div class = "uk-card uk-card-default uk-padding uk-card-hover" >
< div > { { work . title ? . title ? . value } } < / div >
< div > { { work . title ? . subtitle ? . value } } < / div >
< div class = "uk-text-uppercase" > { { work [ 'journal-title' ] ? . value } } < / div >
< div * ngIf = "work['publication-date'] || work['type']" class = "uk-text-small uk-margin-small-bottom" >
< span * ngIf = "work['publication-date']" >
< span * ngIf = "work['publication-date']['year'] && work['publication-date']['year'].value" >
{ { work [ 'publication-date' ] ? . year ? . value } }
< / span >
< span * ngIf = " work [ ' publication - date ' ] [ ' year ' ] & & work [ ' publication - date ' ] [ ' year ' ] .value
&& (
( work [ 'publication-date' ] [ 'month' ] && work [ 'publication-date' ] [ 'month' ] . value ) || ( work [ 'publication-date' ] [ 'day' ] && work [ 'publication-date' ] [ 'day' ] . value ) ) " >
-
< / span >
< span * ngIf = "work['publication-date']['month'] && work['publication-date']['month'].value" >
{ { work [ 'publication-date' ] ? . month ? . value } }
< / span >
< span * ngIf = " work [ ' publication - date ' ] [ ' month ' ] & & work [ ' publication - date ' ] [ ' month ' ] .value
&& ( work [ 'publication-date' ] [ 'day' ] && work [ 'publication-date' ] [ 'day' ] . value ) " >
-
< / span >
< span * ngIf = "work['publication-date']['day'] && work['publication-date']['day'].value" >
{ { work [ 'publication-date' ] ? . day ? . value } }
< / span >
< span * ngIf = "work['type']" > | < / span >
< / span >
< span > { { work [ 'type' ] } } < / span >
< / div >
<!-- Description -- >
< div * ngIf = "work['short-description']" class = "uk-margin-small-bottom multi-line-ellipsis lines-3" >
< p class = "uk-text-muted uk-text-small" >
{ { work [ 'short-description' ] } }
< / p >
< / div >
< div * ngIf = "work['external-ids'] && work['external-ids']['external-id']" class = "uk-margin-small-bottom" >
< showIdentifiers [ identifiers ] = " parseIdentifiers ( work [ ' external - ids ' ] [ ' external - id ' ] ) " > < / showIdentifiers >
< / div >
< div * ngIf = "work['contributors'] && work['contributors']['contributor']" >
< div * ngFor = "let contributor of work['contributors']['contributor']" >
< span * ngIf = "contributor['credit-name'] && contributor['credit-name'].value" >
{ { contributor [ 'credit-name' ] ? . value } }
< / span >
< span * ngIf = " ( contributor [ ' credit - name ' ] & & contributor [ ' credit - name ' ] .value ) & & (
( contributor [ 'contributor-attributes' ] && contributor [ 'contributor-attributes' ] [ 'contributor-role' ] )
||
( contributor [ 'contributor-attributes' ] && contributor [ 'contributor-attributes' ] [ 'contributor-sequence' ] )
||
( contributor [ 'contributor-orcid' ] && contributor [ 'contributor-orcid' ] [ 'path' ] )
) " >
(
< / span >
< span * ngIf = "contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-role']" >
{ { contributor [ 'contributor-attributes' ] [ 'contributor-role' ] } }
< / span >
< span * ngIf = " ( contributor [ ' contributor - attributes ' ] & & contributor [ ' contributor - attributes ' ] [ ' contributor - role ' ] )
&& ( contributor [ 'contributor-attributes' ] [ 'contributor-sequence' ] || ( contributor [ 'contributor-orcid' ] && contributor [ 'contributor-orcid' ] [ 'path' ] ) ) " >
,
< / span >
< span * ngIf = "contributor['contributor-attributes'] && contributor['contributor-attributes']['contributor-sequence']" >
{ { contributor [ 'contributor-attributes' ] [ 'contributor-sequence' ] } }
< / span >
< span * ngIf = " contributor [ ' contributor - attributes ' ] & & contributor [ ' contributor - attributes ' ] [ ' contributor - sequence ' ]
&& contributor [ 'contributor-orcid' ] && contributor [ 'contributor-orcid' ] [ 'path' ] " >
,
< / span >
< span * ngIf = "contributor['contributor-orcid'] && contributor['contributor-orcid']['path']" >
{ { contributor [ 'contributor-orcid' ] ? . path } }
< / span >
< span * ngIf = " ( contributor [ ' credit - name ' ] & & contributor [ ' credit - name ' ] .value ) & & (
( contributor [ 'contributor-attributes' ] && contributor [ 'contributor-attributes' ] [ 'contributor-role' ] )
||
( contributor [ 'contributor-attributes' ] && contributor [ 'contributor-attributes' ] [ 'contributor-sequence' ] )
||
( contributor [ 'contributor-orcid' ] && contributor [ 'contributor-orcid' ] [ 'path' ] )
) " >
)
< / span >
< / div >
< / div >
< / div >
< / n g - t e m p l a t e >
2022-04-20 16:40:18 +02:00
< modal - alert # propagationModal ( alertOutput ) = " confirmedPropagation ( ) " >
< div >
2022-05-04 12:57:13 +02:00
This { { openaireEntities . RESULT } } is the result of < span class = "uk-text-bold" > merged { { openaireEntities . RESULTS } } in OpenAIRE < / span > .
2022-04-20 16:40:18 +02:00
< br > < br >
2022-05-04 12:57:13 +02:00
You have already added < span class = "uk-text-bold" > { { this . putCodes ? . length } } works < / span > in your ORCID record related to the merged { { openaireEntities . RESULT } } .
2022-04-20 16:40:18 +02:00
< div * ngIf = "currentAction == 'delete'" >
If you continue with delete action , < span class = "uk-text-bold" > all these works will be deleted < / span > .
2021-02-10 10:01:55 +01:00
< / div >
2022-04-20 16:40:18 +02:00
< div * ngIf = "currentAction == 'update'" >
If you continue with update action , < span class = "uk-text-bold" > all these works will be deleted and a new merged work will be added < / span > instead .
2021-02-10 10:01:55 +01:00
< / div >
< / div >
2022-04-20 16:40:18 +02:00
<!-- < div class = "uk-margin-medium-top uk-align-right" > -- >
<!-- < button ( click ) = " closePropagationModal ( ) " type = "submit" - - >
<!-- class = "uk-button uk-padding-small uk-padding-remove-vertical uk-button-default" > -- >
<!-- < span > Cancel < / span > -- >
<!-- < / button > -- >
<!-- < button ( click ) = " confirmedPropagation ( ) " type = "submit" - - >
<!-- class = "uk-button uk-padding-small uk-padding-remove-vertical uk-margin-left uk-button-primary" > -- >
<!-- < span > Continue < / span > -- >
<!-- < / button > -- >
<!-- < / div > -- >
2021-02-10 10:01:55 +01:00
< / m o d a l - a l e r t >
2021-01-13 19:23:31 +01:00
`
} )
export class OrcidWorkComponent {
2021-02-10 10:01:55 +01:00
@Input ( ) resultId : string = "" ;
[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
@Input ( ) resultTitle : string = "" ;
2021-01-13 19:23:31 +01:00
@Input ( ) resultLandingInfo : ResultLandingInfo ;
@Input ( ) pids : string = "" ;
2021-02-10 10:01:55 +01:00
@Input ( ) identifiers : Map < string , string [ ] > ;
2021-01-13 19:23:31 +01:00
@Input ( ) type : string ;
2021-02-10 10:01:55 +01:00
@Input ( ) putCodes : string [ ] = [ ] ;
@Input ( ) creationDates : string [ ] = [ ] ;
@Input ( ) updateDates : string [ ] = [ ] ;
2021-01-13 19:23:31 +01:00
@Input ( ) givenPutCode : boolean = false ;
@Input ( ) pageType : string = "search" ;
public subscriptions : Subscription [ ] = [ ] ;
@ViewChild ( 'workModal' ) workModal ;
@ViewChild ( 'saveWorkModal' ) saveWorkModal ;
@ViewChild ( 'grantModal' ) grantModal ;
@ViewChild ( 'messageModal' ) messageModal ;
2021-02-10 10:01:55 +01:00
@ViewChild ( 'propagationModal' ) propagationModal ;
2021-01-13 19:23:31 +01:00
public requestGrant : boolean = false ;
2021-02-10 10:01:55 +01:00
public requestGrantMessage : string = "Please grant OpenAIRE to access and update your ORCID works." ;
2021-01-13 19:23:31 +01:00
private tokenUrl : string ;
public message : string = "" ;
public showLoading : boolean = false ;
public works : any [ ] = [ ] ;
2021-02-10 10:01:55 +01:00
public orcidWorks : any [ ] = [ ] ;
2021-01-13 19:23:31 +01:00
public window : any ;
2022-04-12 13:36:31 +02:00
public isLoggedIn : boolean = false ;
2021-02-10 10:01:55 +01:00
public currentAction : string = "" ;
2022-04-16 09:47:30 +02:00
public hoverAdd : boolean = false ;
public hoverDelete : boolean = false ;
[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 properties : EnvProperties = properties ;
2022-05-04 12:57:13 +02:00
public openaireEntities = OpenaireEntities ;
[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
2021-01-13 19:23:31 +01:00
constructor ( private route : ActivatedRoute ,
private _router : Router ,
private orcidService : OrcidService ,
2022-04-12 13:36:31 +02:00
private resultLandingService : ResultLandingService ,
private userManagementService : UserManagementService ) {
2021-02-10 10:01:55 +01:00
if ( typeof document !== 'undefined' ) {
2021-02-24 21:33:37 +01:00
this . tokenUrl = properties . orcidTokenURL
+ "client_id=" + properties . orcidClientId
2021-01-13 19:23:31 +01:00
// + "&response_type=code&scope=/activities/update"
2021-02-10 10:01:55 +01:00
// + "&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-01-13 19:23:31 +01:00
}
}
ngOnInit() {
2022-04-12 13:36:31 +02:00
this . subscriptions . push ( this . userManagementService . getUserInfo ( ) . subscribe ( user = > {
if ( user ) {
this . isLoggedIn = true ;
if ( ! this . givenPutCode ) {
this . getPutCode ( ) ;
}
} else {
this . isLoggedIn = false ;
}
} , error = > {
this . isLoggedIn = false ;
} ) ) ;
2021-01-13 19:23:31 +01:00
}
ngOnDestroy() {
this . subscriptions . forEach ( subscription = > {
if ( subscription instanceof Subscriber ) {
2021-02-10 10:01:55 +01:00
// console.debug("subscription closing...");
2021-01-13 19:23:31 +01:00
subscription . unsubscribe ( ) ;
}
} ) ;
}
2021-04-16 10:31:05 +02:00
public showUpdateDatesInTooltip() {
const monthNames = [ "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" ] ;
let response : string = "" ;
if ( this . updateDates != null && this . updateDates . length > 0 ) {
response += "<br><br> Last update in ORCID<br>" ;
for ( let i = 0 ; i < this.updateDates.length ; i + + ) {
let date : Date = new Date ( this . updateDates [ i ] ) ;
response += "<span>" + date . getDate ( ) + " " + monthNames [ date . getMonth ( ) ] + " " + date . getFullYear ( ) ;
if ( i < this . updateDates . length - 1 ) {
response += "& " ;
}
response += "</span>" ;
}
}
return response ;
}
2021-02-10 10:01:55 +01:00
public parseIdentifiers ( identifiers : ExternalIDV3_0 [ ] ) : Map < string , string [ ] > {
let identifiersMap : Map < string , string [ ] > = new Map < string , string [ ] > ( ) ;
for ( let identifier of identifiers ) {
if ( ! identifiersMap . has ( identifier [ 'external-id-type' ] ) ) {
identifiersMap . set ( identifier [ 'external-id-type' ] , new Array < string > ( ) ) ;
}
identifiersMap . get ( identifier [ 'external-id-type' ] ) . push ( identifier [ 'external-id-value' ] ) ;
}
return identifiersMap ;
}
2021-01-13 19:23:31 +01:00
openGrantWindow() {
2021-02-10 10:01:55 +01:00
if ( ! Session . isLoggedIn ( ) ) {
//this.userValidMessage = "User session has expired. Please login again.";
this . _router . navigate ( [ '/user-info' ] , { queryParams : { "errorCode" : LoginErrorCodes . NOT_VALID , "redirectUrl" : this . _router . url } } ) ;
} else {
// this.tokenUrl = location.origin+"/orcid";
this . window = window . open ( this . tokenUrl , '_blank' ,
'location=yes,height=700,width=540,left=500,top=100,scrollbars=yes,status=yes' ) ;
// this.requestGrant = false;
this . closeGrantModal ( ) ;
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'
} ) ;
if ( self . currentAction == "add" ) {
self . saveWorkPreparation ( ) ;
} else if ( self . currentAction == "delete" ) {
self . deleteWorks ( ) ;
} else if ( self . currentAction == "update" ) {
self . updateWorkPreparation ( ) ;
}
2021-02-10 10:01:55 +01:00
}
2022-06-20 14:56:29 +02:00
}
2021-02-10 10:01:55 +01:00
}
2021-01-13 19:23:31 +01:00
}
private getPutCode() {
this . subscriptions . push ( this . orcidService . getPutCode ( this . pids ) . subscribe (
putCodes = > {
this . putCodes = putCodes ;
} , error = > {
}
) )
}
2021-02-10 10:01:55 +01:00
private getResultLandingInfo ( action : string ) {
2022-06-09 15:45:39 +02:00
this . subscriptions . push ( this . resultLandingService . getResultLandingInfo ( this . resultId , null , this . type , null , null , properties ) . subscribe (
2021-02-10 10:01:55 +01:00
resultLandingInfo = > {
this . resultLandingInfo = resultLandingInfo ;
if ( this . resultLandingInfo && this . resultLandingInfo . identifiers ) {
let pidsArray : string [ ] = [ ] ;
for ( let key of Array . from ( this . resultLandingInfo . identifiers . keys ( ) ) ) {
pidsArray = pidsArray . concat ( this . resultLandingInfo . identifiers . get ( key ) ) ;
}
this . pids = pidsArray . join ( ) ;
}
if ( action == "save" ) {
this . saveWork ( ) ;
} else if ( action == "update" ) {
this . updateWork ( ) ;
}
} ,
error = > {
[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 . handleError ( error ) ;
2021-02-10 10:01:55 +01:00
console . error ( "Error getting landing info: " , error ) ;
}
) )
}
2021-01-13 19:23:31 +01:00
private saveWorkPreparation() {
2021-02-10 10:01:55 +01:00
if ( ! Session . isLoggedIn ( ) ) {
//this.userValidMessage = "User session has expired. Please login again.";
this . _router . navigate ( [ '/user-info' ] , { queryParams : { "errorCode" : LoginErrorCodes . NOT_VALID , "redirectUrl" : this . _router . url } } ) ;
2021-01-13 19:23:31 +01:00
} else {
2021-02-10 10:01:55 +01:00
if ( this . requestGrant ) {
[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 . openGrantModal ( "Add, delete or edit work in your ORCID record" ) ;
2021-01-13 19:23:31 +01:00
} else {
2021-02-10 10:01:55 +01:00
this . showLoading = true ;
if ( this . resultLandingInfo ) {
this . saveWork ( ) ;
} else {
this . getResultLandingInfo ( "save" ) ;
}
2021-01-13 19:23:31 +01:00
}
}
}
private saveWork() {
this . subscriptions . push ( this . orcidService . saveWork ( this . resultLandingInfo , this . pids ) . subscribe (
response = > {
// for testing only
2021-02-10 10:01:55 +01:00
// this.openGrantModal("Add work in your ORCID record");
2021-01-13 19:23:31 +01:00
// this.requestGrant = true;
// this.requestGrantMessage = "Please grant OpenAIRE to access and update your ORCID record and works.";
if ( response == null ) {
[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 . handleError ( null ) ;
2021-01-13 19:23:31 +01:00
console . error ( "Error posting landing info: null" ) ;
} else {
2021-02-10 10:01:55 +01:00
this . putCodes . push ( "" + response [ 'put-code' ] ) ;
this . creationDates . push ( response [ 'created-date' ] [ 'value' ] ) ;
this . updateDates . push ( response [ 'last-modified-date' ] [ 'value' ] ) ;
2021-01-13 19:23:31 +01:00
2021-02-10 10:01:55 +01:00
// this.closeGrantModal();
[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.message = "You have successfully added work with pids: "+this.pids+" in your ORCID record!";
this . message = "You have successfully added work \"" + this . resultTitle + "\" in your ORCID record!" ;
2021-01-13 19:23:31 +01:00
// this.openMessageModal("Work added successfully");
[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
// message: 'You have <strong>successfully added</strong> work with pids: <strong>'+this.pids+'</strong> in your ORCID record!',
2021-01-13 19:23:31 +01:00
UIkit . notification ( {
2021-04-16 10:31:05 +02:00
message : 'You have <strong>successfully added</strong> work "<strong>' + this . resultTitle + '</strong>" in your ORCID record!'
// +
// '<br><br><a class="uk-link" [href]="goToOrcidLinksPage()">Manager your ORCID links</a>'
,
// '<br><br><a class="uk-link" (click)="goToOrcidLinksPage()">Manager your ORCID links</a>',
// '<br><br><a class="uk-link" routerLinkActive="router-link-active" [routerLink]="myOrcidLinksPage">Manager your ORCID links</a>',
2021-01-13 19:23:31 +01:00
status : 'success' ,
timeout : 6000 ,
pos : 'bottom-right'
} ) ;
this . showLoading = false ;
}
} ,
error = > {
[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 . handleError ( error ) ;
2021-01-13 19:23:31 +01:00
console . error ( "Error posting landing info" , error ) ;
}
) ) ;
}
2021-04-16 10:31:05 +02:00
goToOrcidLinksPage() {
this . _router . navigate ( [ this . properties . myOrcidLinksPage ] ) ;
}
2021-02-10 10:01:55 +01:00
private updateWorkPreparation() {
if ( ! Session . isLoggedIn ( ) ) {
this . _router . navigate ( [ '/user-info' ] , { queryParams : { "errorCode" : LoginErrorCodes . NOT_VALID , "redirectUrl" : this . _router . url } } ) ;
} else {
2021-01-13 19:23:31 +01:00
2021-02-10 10:01:55 +01:00
if ( this . requestGrant ) {
[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 . openGrantModal ( "Add, delete or edit work in your ORCID record" ) ;
2021-02-10 10:01:55 +01:00
} else if ( this . putCodes . length > 1 ) {
this . openPropagationModal ( "Update ORCID work" ) ;
} else {
this . showLoading = true ;
2021-01-13 19:23:31 +01:00
2021-02-10 10:01:55 +01:00
if ( this . resultLandingInfo ) {
this . updateWork ( ) ;
2021-01-13 19:23:31 +01:00
} else {
2021-02-10 10:01:55 +01:00
this . getResultLandingInfo ( "update" ) ;
2021-01-13 19:23:31 +01:00
}
2021-02-10 10:01:55 +01:00
}
}
}
private updateWork() {
this . subscriptions . push ( this . orcidService . updateWork ( this . resultLandingInfo , this . pids , this . putCodes [ 0 ] ) . subscribe (
response = > {
[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 ( response ) {
this . updateDates [ 0 ] = response [ 'last-modified-date' ] . value ;
2021-02-10 10:01:55 +01:00
[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
// message: 'You have <strong>successfully updated</strong> work with pids: <strong>' + this.pids + '</strong> in your ORCID record!',
UIkit . notification ( {
2021-04-16 10:31:05 +02:00
message : 'You have <strong>successfully updated</strong> work "<strong>' + this . resultTitle + '</strong>" in your ORCID record!'
// +
// '<br><br><a routerLinkActive="router-link-active" [routerLink]="myOrcidLinksPage">Manager your ORCID links</a>'
,
[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
status : 'success' ,
timeout : 6000 ,
pos : 'bottom-right'
} ) ;
}
2021-02-10 10:01:55 +01:00
this . showLoading = false ;
} ,
error = > {
[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 . handleError ( error ) ;
2021-02-10 10:01:55 +01:00
console . error ( "Error updating landing info" , error ) ;
}
) ) ;
}
public confirmedPropagation() {
[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 . propagationModal . cancel ( ) ;
this . deleteWorks ( true ) ;
//}
// if(this.currentAction == "update") {
// this.saveWork();
// }
2021-02-10 10:01:55 +01:00
}
private getOrcidWorks() {
[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 ( ! Session . isLoggedIn ( ) ) {
this . _router . navigate ( [ '/user-info' ] , { queryParams : { "errorCode" : LoginErrorCodes . NOT_VALID , "redirectUrl" : this . _router . url } } ) ;
} else {
this . showLoading = true ;
this . subscriptions . push ( this . orcidService . getOrcidWorks ( this . putCodes ) . subscribe (
2022-06-20 15:55:05 +02:00
( response ) = > {
let error : boolean = true ;
if ( response && response [ 'bulk' ] ) {
response = response [ 'bulk' ] . filter ( res = > {
return ( ! res . error && res . work ) ;
} ) ;
if ( response && response . length > 0 ) {
error = false ;
this . orcidWorks = response ;
this . openWorkModal ( ) ;
}
}
if ( error ) {
2022-06-20 14:56:29 +02:00
UIkit . notification ( {
message : 'There was an error getting this work. </br> Please make sure you have not deleted it from your ORCID iD.' ,
status : 'warning' ,
timeout : 6000 ,
pos : 'bottom-right'
} ) ;
}
[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 . showLoading = false ;
} ,
error = > {
this . handleError ( error ) ;
console . error ( "Error getting work" , error ) ;
}
) ) ;
}
2021-01-13 19:23:31 +01:00
}
2021-02-10 10:01:55 +01:00
[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 deleteWorks ( confirmed : boolean = false ) {
2021-02-10 10:01:55 +01:00
if ( ! Session . isLoggedIn ( ) ) {
this . _router . navigate ( [ '/user-info' ] , { queryParams : { "errorCode" : LoginErrorCodes . NOT_VALID , "redirectUrl" : this . _router . url } } ) ;
2021-01-13 19:23:31 +01:00
} else {
2021-02-10 10:01:55 +01:00
if ( this . requestGrant ) {
[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 . openGrantModal ( "Add, delete or edit work in your ORCID record" ) ;
} else if ( this . putCodes . length > 1 && ! confirmed ) {
2021-02-10 10:01:55 +01:00
this . openPropagationModal ( "Delete ORCID work" ) ;
} else {
this . showLoading = true ;
if ( ! this . resultLandingInfo && this . identifiers ) {
let pidsArray : string [ ] = [ ] ;
for ( let key of Array . from ( this . identifiers . keys ( ) ) ) {
pidsArray = pidsArray . concat ( this . identifiers . get ( key ) ) ;
}
this . pids = pidsArray . join ( ) ;
}
this . subscriptions . push ( this . orcidService . deleteWorks ( this . putCodes ) . subscribe (
deletedPutCodes = > {
let deletedAll : boolean = true ;
if ( deletedPutCodes ) {
for ( let i = 0 ; i < deletedPutCodes . length ; i ++ ) {
let deletedPutCode = deletedPutCodes [ i ] ;
if ( deletedPutCode == null ) {
deletedAll = false ;
} else {
this . putCodes . splice ( i , 1 ) ;
this . creationDates . splice ( i , 1 ) ;
this . updateDates . splice ( i , 1 ) ;
// this.works.splice(i, 1);
}
2021-01-13 19:23:31 +01:00
}
2021-02-10 10:01:55 +01:00
} else {
deletedAll = false ;
2021-01-13 19:23:31 +01:00
}
2021-02-10 10:01:55 +01:00
if ( ! deletedAll ) {
[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 . handleError ( null ) ;
2021-02-10 10:01:55 +01:00
console . error ( "Error deleting landing info: null" ) ;
} else {
[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 ( this . currentAction == "update" ) {
this . saveWork ( ) ;
} else {
// this.closeGrantModal();
// this.message = "You have successfully deleted work with pids: " + this.pids + " from your ORCID record!";
this . message = "You have successfully deleted work \"" + this . resultTitle + "\" from your ORCID record!" ;
// this.openMessageModal("Work deleted successfully");
// message: 'You have <strong>successfully deleted</strong> work with pids: <strong>' + this.pids + '</strong> from your ORCID record!',
UIkit . notification ( {
2021-04-16 10:31:05 +02:00
message : 'You have <strong>successfully deleted</strong> work "<strong>' + this . resultTitle + '</strong>" from your ORCID record!'
// +
// '<br><br><a routerLinkActive="router-link-active" [routerLink]="myOrcidLinksPage">Manager your ORCID links</a>'
,
[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
status : 'success' ,
timeout : 6000 ,
pos : 'bottom-right'
} ) ;
this . showLoading = false ;
}
2021-02-10 10:01:55 +01:00
}
} ,
error = > {
[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 . handleError ( error ) ;
2021-02-10 10:01:55 +01:00
console . error ( "Error deleting work" , error ) ;
2021-01-13 19:23:31 +01:00
}
2021-02-10 10:01:55 +01:00
) ) ;
}
2021-01-13 19:23:31 +01:00
}
}
[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
openGrantModal ( title : string ) {
2022-04-20 16:40:18 +02:00
this . grantModal . cancelButton = true ;
this . grantModal . okButton = true ;
this . grantModal . okButtonText = "Grant OpenAIRE" ;
this . grantModal . okButtonLeft = false ;
2021-02-10 10:01:55 +01:00
this . grantModal . alertTitle = title ;
this . grantModal . open ( ) ;
}
closeGrantModal() {
this . grantModal . cancel ( ) ;
}
openWorkModal() {
2021-01-13 19:23:31 +01:00
this . workModal . cancelButton = false ;
this . workModal . okButton = false ;
2021-02-10 10:01:55 +01:00
this . workModal . alertTitle = "Work in your ORCID record" ;
2021-01-13 19:23:31 +01:00
this . workModal . open ( ) ;
}
closeWorkModal() {
this . workModal . cancel ( ) ;
}
openMessageModal ( title : string ) {
this . messageModal . cancelButton = false ;
this . messageModal . okButton = false ;
this . messageModal . alertTitle = title ;
this . messageModal . open ( ) ;
}
closeMessageModal() {
this . messageModal . cancel ( ) ;
}
2021-02-10 10:01:55 +01:00
openPropagationModal ( title : string ) {
2022-04-20 16:40:18 +02:00
this . propagationModal . cancelButton = true ;
this . propagationModal . okButton = true ;
this . propagationModal . okButtonText = "Continue" ;
this . propagationModal . okButtonLeft = false ;
2021-02-10 10:01:55 +01:00
this . propagationModal . alertTitle = title ;
this . propagationModal . open ( ) ;
}
closePropagationModal() {
this . propagationModal . cancel ( ) ;
}
[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
handleError ( error ) {
2021-01-13 19:23:31 +01:00
if ( error && error . status == "401" ) {
[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 . openGrantModal ( "Add, delete or edit work in your ORCID record" ) ;
2021-01-13 19:23:31 +01:00
this . requestGrant = true ;
2021-02-10 10:01:55 +01:00
this . requestGrantMessage = "Please grant OpenAIRE to access and update your ORCID record and works. " ;
// + "If you have already granted OpenAIRE, you just need to login again to ORCID!";
2021-01-13 19:23:31 +01:00
} else if ( error && error . status == "403" ) {
[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 . openGrantModal ( "Add, delete or edit work in your ORCID record" ) ;
2021-01-13 19:23:31 +01:00
this . requestGrant = true ;
this . requestGrantMessage = "Please login again to ORCID."
// this.openGrantModal();
} else {
[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 . message = "" ;
if ( error && error . status == "409" ) {
this . message = "There is <span class='uk-text-bold'>already a work in your ORCID record</span> with the same information of the work you are trying to add now. <br><br>" ;
}
if ( this . currentAction == "get" ) {
// this.message += "There was an <span class='uk-text-bold'>error getting</span> work with pids: <span class='uk-text-bold'>" + this.pids + "</span> from your ORCID record. <br> Please try again later.";
this . message += "There was an <span class='uk-text-bold'>error getting</span> work \"<span class='uk-text-bold'>" + this . resultTitle + "</span>\" from your ORCID record. <br> Please try again later." ;
} else if ( this . currentAction == "add" ) {
// this.message += "There was an <span class='uk-text-bold'>error adding</span> work with pids: <span class='uk-text-bold'>"+this.pids+"</span> to your ORCID record. <br> Please try again later.";
2022-06-20 14:56:29 +02:00
this . message += "There was an <span class='uk-text-bold'>error adding</span> work with pids: \"<span class='uk-text-bold'>" + this . pids + "</span>\" to your ORCID record. <br> Please try again later." ;
[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
} else if ( this . currentAction == "update" ) {
// this.message += "There was an <span class='uk-text-bold'>error updating</span> work with pids: <span class='uk-text-bold'>"+this.pids+"</span> to your ORCID record. <br> Please try again later.";
2022-06-20 14:56:29 +02:00
this . message += "There was an <span class='uk-text-bold'>error updating</span> work \"<span class='uk-text-bold'>" + this . resultTitle + "</span>\" to your ORCID record. <br> Please try again later." ;
[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
} else if ( this . currentAction == "delete" ) {
// this.message += "There was an <span class='uk-text-bold'>error deleting</span> work with pids: <span class='uk-text-bold'>"+this.pids+"</span> from your ORCID record. <br> Please try again later.";
2022-06-20 14:56:29 +02:00
this . message += "There was an <span class='uk-text-bold'>error deleting</span> work \"<span class='uk-text-bold'>" + this . resultTitle + "</span>\" from your ORCID record. <br> Please try again later." ;
[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
} else {
this . message += "There was an error. Please try again later."
}
2021-01-13 19:23:31 +01:00
UIkit . notification ( {
2021-02-10 10:01:55 +01:00
message : this.message ,
[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
status : 'danger' ,
2021-01-13 19:23:31 +01:00
timeout : 6000 ,
pos : 'bottom-right'
} ) ;
// this.openMessageModal("An error occured");
}
this . showLoading = false ;
}
2022-04-12 13:36:31 +02:00
get tooltipAdd() {
return "Add this work to your <span class=\"text-orcid\">ORCID</span> record" + ( ( properties . environment == "beta" ) ? ". The action will affect your real ORCID iD." : "" ) ;
}
get tooltipDelete() {
return "Delete this work from your <span class=\"text-orcid\">ORCID</span> record" + ( ( properties . environment == "beta" ) ? ". The action will affect your real ORCID iD." : "" ) ;
}
get tooltipNoPid() {
2022-04-16 09:47:30 +02:00
return "Only resources with a PID (persistent identifier) like DOI, handle, PMID can be added or deleted from your <span class=\"text-orcid\">ORCID</span> record" ;
2022-04-12 13:36:31 +02:00
}
get tooltipNoLoggedInUser() {
2022-05-13 13:51:53 +02:00
return "Add or delete a work from your <span class=\"text-orcid\">ORCID</span> record. Please log in first."
2022-04-16 09:47:30 +02:00
}
hoverEvent ( $event , action : string = "add" ) {
if ( action == "add" ) {
this . hoverAdd = $event . type == "mouseover" ;
this . hoverDelete = false ;
} else if ( action == "delete" ) {
this . hoverDelete = $event . type == "mouseover" ;
this . hoverAdd = false ;
}
2022-04-12 13:36:31 +02:00
}
2021-03-11 14:27:30 +01:00
}