diff --git a/src/app/core/register2/register2.service.ts b/src/app/core/register2/register2.service.ts index a362de9d4c..486af2c5cd 100644 --- a/src/app/core/register2/register2.service.ts +++ b/src/app/core/register2/register2.service.ts @@ -98,6 +98,8 @@ 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 05bb607bfb..d998bec70b 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 { merge, Subject, of } from 'rxjs' +import { EMPTY, merge, of, Subject } from 'rxjs' import { RecordService } from 'src/app/core/record/record.service' @Component({ @@ -267,59 +267,51 @@ export class WorkFormComponent implements OnInit { externalIdentifierType: string ): AsyncValidatorFn { return (control: AbstractControl) => { - 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('') - } + 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 635eee1c5e..34385dcebf 100644 --- a/src/app/register2/components/register2.scss-theme.scss +++ b/src/app/register2/components/register2.scss-theme.scss @@ -70,14 +70,6 @@ } } - :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 b2a5d99f73..33f5306fc3 100644 --- a/src/app/register2/pages/register/register2.component.scss.theme.scss +++ b/src/app/register2/pages/register/register2.component.scss.theme.scss @@ -8,8 +8,6 @@ $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 7409ce242a..81e29fd316 100644 --- a/src/app/register2/pages/register/register2.component.ts +++ b/src/app/register2/pages/register/register2.component.ts @@ -133,6 +133,18 @@ 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 (