[develop | DONE | FIXED]: orcid-work.component.ts & result-preview.component.html & result-preview.component.ts: Added checks not to allow ORCID claim for results with no PIDs when not on development environment (until new version of orcid service is deployed).

This commit is contained in:
Konstantina Galouni 2024-09-18 11:50:12 +03:00
parent 1593ea6ed9
commit 8f668cd4ff
3 changed files with 21 additions and 10 deletions

View File

@ -24,7 +24,9 @@ declare var UIkit: any;
<span *ngIf="!putCodes || putCodes.length == 0"
[ngClass]="isMobile && pageType == 'landing' ? ' uk-width-1-1' : ''"
[attr.uk-tooltip]="isMobile? 'cls: uk-invisible' : 'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
[title]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipAdd">
[title]="((noPids && properties.environment != 'development') || !isLoggedIn) ? ((noPids && properties.environment != 'development') ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd">
<!-- [title]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipAdd">-->
<span (click)="currentAction='add'; saveWorkPreparation();"
[class.uk-disabled]="isDisabled"
[class.clickable]="!isDisabled">
@ -32,7 +34,8 @@ declare var UIkit: any;
[ngClass]="isMobile && !(pageType == 'landing') ? 'uk-margin-left' : ''"
[class.uk-text-bolder]="!(isMobile && pageType == 'landing')"
[class.uk-text-muted]="isDisabled">
<icon *ngIf="!showLoading" [class.text-orcid]="properties.environment != 'beta' && !showLoading && isLoggedIn"
<!-- <icon *ngIf="!showLoading" [class.text-orcid]="properties.environment != 'beta' && !showLoading && isLoggedIn"-->
<icon *ngIf="!showLoading" [class.text-orcid]="properties.environment != 'beta' && !showLoading && isLoggedIn && (pids || identifiers?.size > 0 || properties.environment == 'development')"
[class.uk-text-muted]="isDisabled"
name="orcid_add" [ratio]="(isMobile && pageType == 'search') ? 0.7 : 1" visuallyHidden="add"></icon>
<span *ngIf="showLoading" class="uk-icon"><loading
@ -40,13 +43,15 @@ declare var UIkit: any;
<span *ngIf="!compactView" [ngClass]="(isMobile && pageType == 'landing') ? 'uk-margin-small-left' : 'uk-margin-xsmall-left'">Claim</span>
</a>
<div *ngIf="isMobile && pageType == 'landing'" class="uk-margin-xsmall-top uk-padding uk-padding-remove-vertical uk-text-meta uk-text-xsmall"
[innerHTML]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipAdd"></div>
[innerHTML]="((noPids && properties.environment != 'development') || !isLoggedIn) ? ((noPids && properties.environment != 'development') ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd"></div>
<!-- [innerHTML]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipAdd"></div>-->
</span>
</span>
<span *ngIf="putCodes && putCodes.length > 0" [ngClass]="isMobile && pageType == 'landing' ? ' uk-width-1-1' : ''"
[attr.uk-tooltip]="isMobile? 'cls: uk-invisible' : 'pos: bottom; cls: uk-active uk-text-small uk-padding-small'"
[title]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipDelete">
[title]="((noPids && properties.environment != 'development') || !isLoggedIn) ? ((noPids && properties.environment != 'development') ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete">
<!-- [title]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipDelete">-->
<span (click)="currentAction='delete'; deleteWorks();"
[class.uk-disabled]="isDisabled"
[class.clickable]="!isDisabled">
@ -54,7 +59,8 @@ declare var UIkit: any;
[ngClass]="isMobile && !(pageType == 'landing') ? 'uk-margin-left' : ''"
[class.uk-text-bolder]="!(isMobile && pageType == 'landing')"
[class.uk-text-muted]="isDisabled">
<icon *ngIf="!showLoading" [class.text-orcid]="!showLoading && isLoggedIn"
<!-- <icon *ngIf="!showLoading" [class.text-orcid]="!showLoading && isLoggedIn"-->
<icon *ngIf="!showLoading" [class.text-orcid]="!showLoading && isLoggedIn && (pids || identifiers?.size > 0 || properties.environment == 'development')"
[class.uk-text-muted]="isDisabled"
name="orcid_bin" [ratio]="(isMobile && pageType == 'search') ? 0.7 : 1" visuallyHidden="delete"></icon>
<span *ngIf="showLoading" class="uk-icon"><loading
@ -62,7 +68,8 @@ declare var UIkit: any;
<span *ngIf="!compactView" [ngClass]="(isMobile && pageType == 'landing') ? 'uk-margin-small-left' : 'uk-margin-xsmall-left'">Remove</span>
</a>
<div *ngIf="isMobile && pageType == 'landing'" class="uk-margin-xsmall-top uk-padding uk-padding-remove-vertical uk-text-meta uk-text-xsmall"
[innerHTML]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipDelete"></div>
[innerHTML]="((noPids && properties.environment != 'development') || !isLoggedIn) ? ((noPids && properties.environment != 'development') ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete"></div>
<!-- [innerHTML]="!isLoggedIn ? tooltipNoLoggedInUser : tooltipDelete"></div>-->
</span>
</span>
</ng-container>
@ -893,7 +900,8 @@ export class OrcidWorkComponent {
}
get isDisabled() {
return (this.properties.environment == 'beta' || this.showLoading || !this.isLoggedIn);
// return (this.properties.environment == 'beta' || this.showLoading || !this.isLoggedIn);
return (this.properties.environment == 'beta' || this.showLoading || !this.isLoggedIn || (!this.pids && (!this.identifiers || this.identifiers.size == 0) && properties.environment != 'development'));
}
get noPids() {

View File

@ -193,7 +193,8 @@
[url]="properties.domain + properties.baseLink + url + '?' + urlParam + '=' + result.id"
[showTooltip]="false" [compactView]="compactView">
<span *ngIf="orcid">
<orcid-work *ngIf="showOrcid"
<!-- <orcid-work *ngIf="showOrcid"-->
<orcid-work *ngIf="showOrcid && ((result.identifiers && result.identifiers.size > 0) || properties.environment == 'development')"
[resultId]="result.relcanId" [resultTitle]="result.title"
[type]="result.resultType" [pageType]="'search'"
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers"
@ -339,7 +340,8 @@
[isMobile]="isMobile"
[showTooltip]="false">
<span *ngIf="orcid">
<orcid-work *ngIf="showOrcid"
<!-- <orcid-work *ngIf="showOrcid"-->
<orcid-work *ngIf="showOrcid && ((result.identifiers && result.identifiers.size > 0) || properties.environment == 'development')"
[resultId]="result.relcanId" [resultTitle]="result.title"
[type]="result.resultType" [pageType]="'search'"
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers"

View File

@ -129,7 +129,8 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
this.share = true;
this.cite = true;
this.orcid = (this.properties.adminToolsPortalType == 'explore' || this.properties.adminToolsPortalType == 'community' || this.properties.adminToolsPortalType == 'aggregator' || this.properties.dashboard == 'irish') &&
this.showOrcid;
this.showOrcid && ((this.result.identifiers && this.result.identifiers.size > 0) || properties.environment == 'development');
// this.showOrcid;
}
projectActions() {