diff --git a/src/app/core/register2/register2.service.ts b/src/app/core/register2/register2.service.ts index 486af2c5cd..a362de9d4c 100644 --- a/src/app/core/register2/register2.service.ts +++ b/src/app/core/register2/register2.service.ts @@ -98,8 +98,6 @@ export class Register2Service extends _RegisterServiceMixingBase { StepC, StepD ) - console.log('_______ >>>>>>>> ________') - console.log(registerForm) this.addOauthContext(registerForm, requestInfoForm) return this._platform.get().pipe( first(), diff --git a/src/app/record/components/work-form/work-form/work-form.component.ts b/src/app/record/components/work-form/work-form/work-form.component.ts index d998bec70b..05bb607bfb 100644 --- a/src/app/record/components/work-form/work-form/work-form.component.ts +++ b/src/app/record/components/work-form/work-form/work-form.component.ts @@ -52,7 +52,7 @@ import { SnackbarService } from 'src/app/cdk/snackbar/snackbar.service' import { WorkIdentifiers } from 'src/app/shared/validators/work-identifiers/work-identifiers.validator' import { workCitationValidator } from 'src/app/shared/validators/citation/work-citation.validator' import { translatedTitleValidator } from 'src/app/shared/validators/translated-title/translated-title.validator' -import { EMPTY, merge, of, Subject } from 'rxjs' +import { merge, Subject, of } from 'rxjs' import { RecordService } from 'src/app/core/record/record.service' @Component({ @@ -267,51 +267,59 @@ export class WorkFormComponent implements OnInit { externalIdentifierType: string ): AsyncValidatorFn { return (control: AbstractControl) => { - return this._workService - .validateWorkIdTypes(externalIdentifierType, control.value) - .pipe( - map((value) => { - if ( - (formGroup.controls.externalIdentifierUrl?.value?.length > 0 && - formGroup.controls.externalIdentifierUrl.value !== - formGroup.controls.externalIdentifierUrlWasBackendGenerated - .value) || - formGroup.controls.externalIdentifierId.value === - formGroup.controls.externalIdentifierIdStored.value - ) { - // do not overwrite the existing URL - } else if ( - value.generatedUrl && - value.generatedUrl !== - formGroup.controls.externalIdentifierUrl.value - ) { - formGroup.controls.externalIdentifierUrl.setValue( - decodeURI(value.generatedUrl) - ) - formGroup.controls.externalIdentifierUrlWasBackendGenerated.setValue( - decodeURI(value.generatedUrl) - ) - } else if ( - !value.validFormat || - (value.attemptedResolution && !value.resolved) - ) { - if (!this.work?.putCode) { - formGroup.controls.externalIdentifierUrl.setValue('') + if (externalIdentifierType === 'isbn') { + if (!(control.value?.length === 10 || control.value?.length === 13)) { + return of({ validFormat: true }) + } else { + return of({}) + } + } else { + return this._workService + .validateWorkIdTypes(externalIdentifierType, control.value) + .pipe( + map((value) => { + if ( + (formGroup.controls.externalIdentifierUrl?.value?.length > 0 && + formGroup.controls.externalIdentifierUrl.value !== + formGroup.controls.externalIdentifierUrlWasBackendGenerated + .value) || + formGroup.controls.externalIdentifierId.value === + formGroup.controls.externalIdentifierIdStored.value + ) { + // do not overwrite the existing URL + } else if ( + value.generatedUrl && + value.generatedUrl !== + formGroup.controls.externalIdentifierUrl.value + ) { + formGroup.controls.externalIdentifierUrl.setValue( + decodeURI(value.generatedUrl) + ) + formGroup.controls.externalIdentifierUrlWasBackendGenerated.setValue( + decodeURI(value.generatedUrl) + ) + } else if ( + !value.validFormat || + (value.attemptedResolution && !value.resolved) + ) { + if (!this.work?.putCode) { + formGroup.controls.externalIdentifierUrl.setValue('') + } } - } - if (value.attemptedResolution && !value.resolved) { - return { - unResolved: true, + if (value.attemptedResolution && !value.resolved) { + return { + unResolved: true, + } } - } - if (!value.validFormat) { - return { - validFormat: true, + if (!value.validFormat) { + return { + validFormat: true, + } } - } - }) - ) + }) + ) + } } } diff --git a/src/app/register2/components/register2.scss-theme.scss b/src/app/register2/components/register2.scss-theme.scss index 34385dcebf..635eee1c5e 100644 --- a/src/app/register2/components/register2.scss-theme.scss +++ b/src/app/register2/components/register2.scss-theme.scss @@ -70,6 +70,14 @@ } } + :host { + ::ng-deep { + .container .mat-horizontal-content-container, + .container { + // background-color: map-get($background, 'ui-background-lightest'); + } + } + } ::ng-deep { .valid-password-input { diff --git a/src/app/register2/pages/register/register2.component.scss.theme.scss b/src/app/register2/pages/register/register2.component.scss.theme.scss index 33f5306fc3..b2a5d99f73 100644 --- a/src/app/register2/pages/register/register2.component.scss.theme.scss +++ b/src/app/register2/pages/register/register2.component.scss.theme.scss @@ -8,6 +8,8 @@ $foreground: map-get($theme, foreground); $background: map-get($theme, background); - + :host { + // background-color: map-get($background, 'ui-background-lightest'); + } } @include theme($orcid-app-theme); diff --git a/src/app/register2/pages/register/register2.component.ts b/src/app/register2/pages/register/register2.component.ts index 81e29fd316..7409ce242a 100644 --- a/src/app/register2/pages/register/register2.component.ts +++ b/src/app/register2/pages/register/register2.component.ts @@ -133,18 +133,6 @@ export class Register2Component implements OnInit, AfterViewInit { } register() { - console.log('register') - console.log(this.FormGroupStepA) - console.log("______________________") - console.log(this.FormGroupStepB) - console.log("______________________") - - console.log(this.FormGroupStepC) - console.log("______________________") - - console.log(this.FormGroupStepD) - console.log("______________________") - this.loading = true this.lastStep.interacted = true if (