From 7677330dee7fb2b95c06c99fc230447513843b7d Mon Sep 17 00:00:00 2001 From: orcid-releaser Date: Thu, 8 Feb 2024 02:46:28 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20GITHUB=20ACTIONS=20format=5Fpret?= =?UTF-8?q?tier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../side-bar/side-bar/side-bar.component.html | 5 +- .../record-header.component.html | 132 +++++++++++++----- .../record-header.component.scss | 5 +- .../record-header.component.spec.ts | 40 +++--- .../record-header/record-header.component.ts | 55 ++++---- .../record-info/record-info.component.html | 77 +++++++--- .../record-info/record-info.component.spec.ts | 37 +++-- .../record-info/record-info.component.ts | 19 +-- .../components/top-bar/top-bar.component.html | 6 +- .../components/top-bar/top-bar.component.ts | 9 +- .../pages/my-orcid/my-orcid.component.html | 25 +++- src/app/record/record.module.ts | 4 +- .../form-personal/form-personal.component.ts | 4 +- src/app/shared/utils/names.util.ts | 24 ++-- 14 files changed, 283 insertions(+), 159 deletions(-) diff --git a/src/app/cdk/side-bar/side-bar/side-bar.component.html b/src/app/cdk/side-bar/side-bar/side-bar.component.html index e77d2b2d60..a79381cc7e 100644 --- a/src/app/cdk/side-bar/side-bar/side-bar.component.html +++ b/src/app/cdk/side-bar/side-bar/side-bar.component.html @@ -6,8 +6,9 @@ >

+ [ngClass]="{ 'sr-only': isPublicRecord ? !newRecordHeaderTogglz : true }" + i18n="@@shared.personalInformation" + > Personal information

diff --git a/src/app/record/components/record-header/record-header.component.html b/src/app/record/components/record-header/record-header.component.html index a12397cf21..2f3f8e392b 100644 --- a/src/app/record/components/record-header/record-header.component.html +++ b/src/app/record/components/record-header/record-header.component.html @@ -1,46 +1,77 @@ - -
+ +
-
+
-

+ }" + > {{ creditName }} - {{ givenNames + ' ' }} + {{ + givenNames + ' ' + }} {{ familyName }}

-
+

{{ otherNames }}

-

- This record has been deactivated +

+ This record has been deactivated This record is locked + *ngIf=" + userInfo.IS_LOCKED === 'true' && + !(userInfo.IS_DEACTIVATED === 'true' && !userInfo.PRIMARY_RECORD) + " + i18n="@@summary.recordIsLocked" + >This record is locked - This record has been - deprecated + This record has been deprecated

-
-

- No public information available. +
+

+ No public information available.

@@ -48,28 +79,55 @@
-
+ }" + dir="ltr" + >
- +
-

{{ orcidId }}

-
+ {{ orcidId }} +

+
- -
diff --git a/src/app/record/components/record-header/record-header.component.scss b/src/app/record/components/record-header/record-header.component.scss index 53512d7485..0bf67d74ea 100644 --- a/src/app/record/components/record-header/record-header.component.scss +++ b/src/app/record/components/record-header/record-header.component.scss @@ -8,7 +8,8 @@ gap: 16px; word-break: break-all; - h1,p { + h1, + p { margin: 0; } @@ -46,7 +47,7 @@ align-items: center; .col { - padding: 0 !important + padding: 0 !important; } .orcid-logo { diff --git a/src/app/record/components/record-header/record-header.component.spec.ts b/src/app/record/components/record-header/record-header.component.spec.ts index 60ca1a17ee..41515c415a 100644 --- a/src/app/record/components/record-header/record-header.component.spec.ts +++ b/src/app/record/components/record-header/record-header.component.spec.ts @@ -1,20 +1,20 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing' -import { RecordHeaderComponent } from './record-header.component'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { WINDOW_PROVIDERS } from 'src/app/cdk/window'; -import { PlatformInfoService } from 'src/app/cdk/platform-info'; -import { ErrorHandlerService } from 'src/app/core/error-handler/error-handler.service'; -import { SnackbarService } from 'src/app/cdk/snackbar/snackbar.service'; +import { RecordHeaderComponent } from './record-header.component' +import { HttpClientTestingModule } from '@angular/common/http/testing' +import { WINDOW_PROVIDERS } from 'src/app/cdk/window' +import { PlatformInfoService } from 'src/app/cdk/platform-info' +import { ErrorHandlerService } from 'src/app/core/error-handler/error-handler.service' +import { SnackbarService } from 'src/app/cdk/snackbar/snackbar.service' import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar' import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog' -import { Overlay } from '@angular/cdk/overlay'; -import { RouterTestingModule } from '@angular/router/testing'; -import { RecordService } from 'src/app/core/record/record.service'; +import { Overlay } from '@angular/cdk/overlay' +import { RouterTestingModule } from '@angular/router/testing' +import { RecordService } from 'src/app/core/record/record.service' describe('RecordHeaderComponent', () => { - let component: RecordHeaderComponent; - let fixture: ComponentFixture; + let component: RecordHeaderComponent + let fixture: ComponentFixture beforeEach(async () => { await TestBed.configureTestingModule({ @@ -22,7 +22,7 @@ describe('RecordHeaderComponent', () => { declarations: [RecordHeaderComponent], providers: [ WINDOW_PROVIDERS, - RecordService , + RecordService, PlatformInfoService, ErrorHandlerService, SnackbarService, @@ -34,12 +34,12 @@ describe('RecordHeaderComponent', () => { }) beforeEach(() => { - fixture = TestBed.createComponent(RecordHeaderComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); + fixture = TestBed.createComponent(RecordHeaderComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) it('should create', () => { - expect(component).toBeTruthy(); - }); -}); + expect(component).toBeTruthy() + }) +}) diff --git a/src/app/record/components/record-header/record-header.component.ts b/src/app/record/components/record-header/record-header.component.ts index f53f1fec9d..056e9b6c92 100644 --- a/src/app/record/components/record-header/record-header.component.ts +++ b/src/app/record/components/record-header/record-header.component.ts @@ -1,23 +1,23 @@ -import { Component, Inject, Input, OnInit } from '@angular/core'; -import { isEmpty } from 'lodash'; -import { Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; -import { PlatformInfo, PlatformInfoService } from 'src/app/cdk/platform-info'; -import { WINDOW } from 'src/app/cdk/window'; -import { UserService } from 'src/app/core'; -import { RecordService } from 'src/app/core/record/record.service'; -import { NamesUtil } from 'src/app/shared/utils/names.util'; -import { Assertion, UserInfo } from 'src/app/types'; -import { UserRecord } from 'src/app/types/record.local'; -import { environment } from 'src/environments/environment'; +import { Component, Inject, Input, OnInit } from '@angular/core' +import { isEmpty } from 'lodash' +import { Subject } from 'rxjs' +import { takeUntil } from 'rxjs/operators' +import { PlatformInfo, PlatformInfoService } from 'src/app/cdk/platform-info' +import { WINDOW } from 'src/app/cdk/window' +import { UserService } from 'src/app/core' +import { RecordService } from 'src/app/core/record/record.service' +import { NamesUtil } from 'src/app/shared/utils/names.util' +import { Assertion, UserInfo } from 'src/app/types' +import { UserRecord } from 'src/app/types/record.local' +import { environment } from 'src/environments/environment' @Component({ selector: 'app-record-header', templateUrl: './record-header.component.html', styleUrls: [ './record-header.component.scss', - './record-header.component.scss-theme.scss' - ] + './record-header.component.scss-theme.scss', + ], }) export class RecordHeaderComponent implements OnInit { $destroy: Subject = new Subject() @@ -50,18 +50,18 @@ export class RecordHeaderComponent implements OnInit { @Inject(WINDOW) private window: Window, private _platform: PlatformInfoService, private _user: UserService, - private _record: RecordService, - ) { } + private _record: RecordService + ) {} ngOnInit(): void { this.orcidId = 'https:' + environment.BASE_URL + this.isPublicRecord this._platform - .get() - .pipe(takeUntil(this.$destroy)) - .subscribe((data) => { - this.platform = data - }) + .get() + .pipe(takeUntil(this.$destroy)) + .subscribe((data) => { + this.platform = data + }) this._record .getRecord({ @@ -77,7 +77,10 @@ export class RecordHeaderComponent implements OnInit { this.givenNames = NamesUtil.getGivenNames(this.userRecord) this.familyName = NamesUtil.getFamilyName(this.userRecord) this.creditName = NamesUtil.getCreditName(this.userRecord) - this.ariaLabelName = NamesUtil.getAriaLabelName(this.userRecord, this.ariaLabelName) + this.ariaLabelName = NamesUtil.getAriaLabelName( + this.userRecord, + this.ariaLabelName + ) } else { if (this.affiliations > 0) { this.creditName = this.privateName @@ -85,15 +88,15 @@ export class RecordHeaderComponent implements OnInit { } if (!isEmpty(this.userRecord.otherNames?.otherNames)) { - this.otherNames = NamesUtil.getOtherNamesUnique(userRecord.otherNames?.otherNames) + this.otherNames = NamesUtil.getOtherNamesUnique( + userRecord.otherNames?.otherNames + ) } }) } clipboard() { - this.window.navigator.clipboard.writeText( - this.orcidId - ) + this.window.navigator.clipboard.writeText(this.orcidId) } printRecord() { diff --git a/src/app/record/components/record-info/record-info.component.html b/src/app/record/components/record-info/record-info.component.html index 87612bd5e6..3bf99c65e8 100644 --- a/src/app/record/components/record-info/record-info.component.html +++ b/src/app/record/components/record-info/record-info.component.html @@ -1,35 +1,56 @@
- +

We lock records when they violate conditions of our - terms of - service. + terms of service.

If you feel this record has been locked in error please - contact - ORCID - support for further assistance. + contact ORCID support for further assistance.

- +

- When an ORCID record is deactivated all information in the record is deleted. Deactivated records are not - shown - in registry searches. + When an ORCID record is deactivated all information in the record is + deleted. Deactivated records are not shown in registry searches.

- Find - out more about reactivating an ORCID account + Find out more about reactivating an ORCID account

@@ -37,30 +58,40 @@

- A deprecated record is a duplicate or unwanted ORCID record that has been merged with another owned by the - same - person. + A deprecated record is a duplicate or unwanted ORCID record that has + been merged with another owned by the same person.

- Find out more about removing additional or duplicate ORCID records + Find out more about removing additional or duplicate ORCID records

- +

- No public information available. + No public information available.

- The record owner may not have added information to their record or the visibility for items on their record may be to Trusted parties or Only me. + The record owner may not have added information to their record or the + visibility for items on their record may be to Trusted parties or Only + me.

- Find out more about visibility settings in ORCID + Find out more about visibility settings in ORCID

diff --git a/src/app/record/components/record-info/record-info.component.spec.ts b/src/app/record/components/record-info/record-info.component.spec.ts index 9ed8462152..3a330dd48f 100644 --- a/src/app/record/components/record-info/record-info.component.spec.ts +++ b/src/app/record/components/record-info/record-info.component.spec.ts @@ -1,19 +1,19 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing' -import { RecordInfoComponent } from './record-info.component'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { WINDOW_PROVIDERS } from 'src/app/cdk/window'; -import { PlatformInfoService } from 'src/app/cdk/platform-info'; -import { ErrorHandlerService } from 'src/app/core/error-handler/error-handler.service'; -import { SnackbarService } from 'src/app/cdk/snackbar/snackbar.service'; +import { RecordInfoComponent } from './record-info.component' +import { HttpClientTestingModule } from '@angular/common/http/testing' +import { RouterTestingModule } from '@angular/router/testing' +import { WINDOW_PROVIDERS } from 'src/app/cdk/window' +import { PlatformInfoService } from 'src/app/cdk/platform-info' +import { ErrorHandlerService } from 'src/app/core/error-handler/error-handler.service' +import { SnackbarService } from 'src/app/cdk/snackbar/snackbar.service' import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar' import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog' -import { Overlay } from '@angular/cdk/overlay'; +import { Overlay } from '@angular/cdk/overlay' describe('RecordInfoComponent', () => { - let component: RecordInfoComponent; - let fixture: ComponentFixture; + let component: RecordInfoComponent + let fixture: ComponentFixture beforeEach(async () => { await TestBed.configureTestingModule({ @@ -32,13 +32,12 @@ describe('RecordInfoComponent', () => { }) beforeEach(() => { - fixture = TestBed.createComponent(RecordInfoComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - + fixture = TestBed.createComponent(RecordInfoComponent) + component = fixture.componentInstance + fixture.detectChanges() + }) it('should create', () => { - expect(component).toBeTruthy(); - }); -}); + expect(component).toBeTruthy() + }) +}) diff --git a/src/app/record/components/record-info/record-info.component.ts b/src/app/record/components/record-info/record-info.component.ts index 60d4008553..93b51cc3f2 100644 --- a/src/app/record/components/record-info/record-info.component.ts +++ b/src/app/record/components/record-info/record-info.component.ts @@ -1,14 +1,14 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; -import { RecordService } from 'src/app/core/record/record.service'; -import { NamesUtil } from 'src/app/shared/utils/names.util'; -import { UserInfo } from 'src/app/types'; +import { Component, Input, OnInit } from '@angular/core' +import { Subject } from 'rxjs' +import { takeUntil } from 'rxjs/operators' +import { RecordService } from 'src/app/core/record/record.service' +import { NamesUtil } from 'src/app/shared/utils/names.util' +import { UserInfo } from 'src/app/types' @Component({ selector: 'app-record-info', templateUrl: './record-info.component.html', - styleUrls: ['./record-info.component.scss'] + styleUrls: ['./record-info.component.scss'], }) export class RecordInfoComponent implements OnInit { $destroy: Subject = new Subject() @@ -29,7 +29,10 @@ export class RecordInfoComponent implements OnInit { .pipe(takeUntil(this.$destroy)) .subscribe((userRecord) => { this.userInfo = userRecord?.userInfo - this.isNamePublic = NamesUtil.isNamePublicAndAffiliations(userRecord, this.affiliations) + this.isNamePublic = NamesUtil.isNamePublicAndAffiliations( + userRecord, + this.affiliations + ) }) } } diff --git a/src/app/record/components/top-bar/top-bar.component.html b/src/app/record/components/top-bar/top-bar.component.html index 793e5b5d5b..98c4e2a3ee 100644 --- a/src/app/record/components/top-bar/top-bar.component.html +++ b/src/app/record/components/top-bar/top-bar.component.html @@ -151,7 +151,9 @@

[id]="'names'" role="region" [attr.aria-label]="regionNames" - *ngIf="!newRecordHeaderTogglz && (userRecord?.names || userRecord?.otherNames)" + *ngIf=" + !newRecordHeaderTogglz && (userRecord?.names || userRecord?.otherNames) + " >
@@ -280,7 +282,7 @@

>

Biography diff --git a/src/app/record/components/top-bar/top-bar.component.ts b/src/app/record/components/top-bar/top-bar.component.ts index eac4c347e6..b31def8bb7 100644 --- a/src/app/record/components/top-bar/top-bar.component.ts +++ b/src/app/record/components/top-bar/top-bar.component.ts @@ -97,11 +97,16 @@ export class TopBarComponent implements OnInit, OnDestroy { this.givenNames = NamesUtil.getGivenNames(this.userRecord) this.familyName = NamesUtil.getFamilyName(this.userRecord) this.creditName = NamesUtil.getCreditName(this.userRecord) - this.ariaLabelName = NamesUtil.getAriaLabelName(this.userRecord, this.ariaLabelName) + this.ariaLabelName = NamesUtil.getAriaLabelName( + this.userRecord, + this.ariaLabelName + ) } if (!isEmpty(this.userRecord.otherNames?.otherNames)) { - this.otherNames = NamesUtil.getOtherNamesUnique(userRecord.otherNames?.otherNames) + this.otherNames = NamesUtil.getOtherNamesUnique( + userRecord.otherNames?.otherNames + ) } }) } diff --git a/src/app/record/pages/my-orcid/my-orcid.component.html b/src/app/record/pages/my-orcid/my-orcid.component.html index 8b9fd7639f..741c0bbf76 100644 --- a/src/app/record/pages/my-orcid/my-orcid.component.html +++ b/src/app/record/pages/my-orcid/my-orcid.component.html @@ -11,10 +11,21 @@ [affiliations]="affiliations" > -
+
error
diff --git a/src/app/record/record.module.ts b/src/app/record/record.module.ts index a2c5b08684..8e1479b942 100644 --- a/src/app/record/record.module.ts +++ b/src/app/record/record.module.ts @@ -77,8 +77,8 @@ import { TopBarMyPublicRecordPreviewModule } from '../cdk/top-bar-my-public-reco import { WorkContributorRolesComponent } from './components/work-contributor-role/work-contributor-roles.component' import { WorkContributorsComponent } from './components/work-contributors/work-contributors.component' import { VisibilitySelectorModule } from '../cdk/visibility-selector/visibility-selector.module' -import { TopBarVerificationEmailModule } from '../cdk/top-bar-verification-email/top-bar-verification-email.module'; -import { RecordHeaderComponent } from './components/record-header/record-header.component'; +import { TopBarVerificationEmailModule } from '../cdk/top-bar-verification-email/top-bar-verification-email.module' +import { RecordHeaderComponent } from './components/record-header/record-header.component' import { RecordInfoComponent } from './components/record-info/record-info.component' @NgModule({ diff --git a/src/app/register2/components/form-personal/form-personal.component.ts b/src/app/register2/components/form-personal/form-personal.component.ts index 49c4dd4653..3d0a2c29b1 100644 --- a/src/app/register2/components/form-personal/form-personal.component.ts +++ b/src/app/register2/components/form-personal/form-personal.component.ts @@ -325,8 +325,8 @@ export class FormPersonalComponent extends BaseForm implements OnInit { return !( backendError && (backendError[0] === 'orcid.frontend.verify.duplicate_email' || - backendError[0] === 'orcid.frontend.verify.unclaimed_email' || - backendError[0] === 'orcid.frontend.verify.deactivated_email') && + backendError[0] === 'orcid.frontend.verify.unclaimed_email' || + backendError[0] === 'orcid.frontend.verify.deactivated_email') && !this.nextButtonWasClicked ) } diff --git a/src/app/shared/utils/names.util.ts b/src/app/shared/utils/names.util.ts index 1838931d98..b0ab61603f 100644 --- a/src/app/shared/utils/names.util.ts +++ b/src/app/shared/utils/names.util.ts @@ -1,8 +1,7 @@ -import { Assertion } from "src/app/types" -import { UserRecord } from "src/app/types/record.local" +import { Assertion } from 'src/app/types' +import { UserRecord } from 'src/app/types/record.local' export class NamesUtil { - static getGivenNames(userRecord: UserRecord): string { return userRecord?.names?.givenNames ? userRecord.names.givenNames.value @@ -21,19 +20,24 @@ export class NamesUtil { : '' } - static isNamePublicAndAffiliations(userRecord: UserRecord, affiliations: number): boolean { + static isNamePublicAndAffiliations( + userRecord: UserRecord, + affiliations: number + ): boolean { if ( - affiliations === 0 && - !!this.getGivenNames(userRecord) || + (affiliations === 0 && !!this.getGivenNames(userRecord)) || !!this.getFamilyName(userRecord) || !!this.getCreditName(userRecord) - ) { - return true + ) { + return true } return false } - static getAriaLabelName(userRecord: UserRecord,ariaLabelName: string): string { + static getAriaLabelName( + userRecord: UserRecord, + ariaLabelName: string + ): string { if (userRecord?.names) { if (userRecord?.names?.creditName?.value) { return userRecord?.names?.creditName?.value @@ -43,7 +47,7 @@ export class NamesUtil { } if (userRecord?.names?.familyName?.value) { if (ariaLabelName) { - return ariaLabelName + ' ' + userRecord?.names?.familyName?.value + return ariaLabelName + ' ' + userRecord?.names?.familyName?.value } else { return userRecord?.names?.familyName?.value }