Skip to content

Commit

Permalink
Revert "batch-fixes-4-dec"
Browse files Browse the repository at this point in the history
This reverts commit 1326149.
  • Loading branch information
leomendoza123 committed Dec 4, 2023
1 parent 1326149 commit e0b3cc5
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 57 deletions.
2 changes: 0 additions & 2 deletions src/app/core/register2/register2.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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,
}
}
}
})
)
})
)
}
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/app/register2/components/register2.scss-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
12 changes: 0 additions & 12 deletions src/app/register2/pages/register/register2.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit e0b3cc5

Please sign in to comment.