Skip to content

Commit

Permalink
Merge pull request #2450 from ORCID/migrate-reactivation-form
Browse files Browse the repository at this point in the history
migrate reactivation form
  • Loading branch information
leomendoza123 authored Jan 22, 2025
2 parents a5df61b + d964f49 commit 6f14eee
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 75 deletions.
2 changes: 1 addition & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const routes: Routes = [
matcher: routerReactivation,
canActivateChild: [LanguageGuard, RegisterGuard],
loadChildren: () =>
import('./register/register.module').then((m) => m.RegisterModuleLegacy),
import('./register2/register.module').then((m) => m.Register2Module),
},
{
path: ApplicationRoutes.selfService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,16 @@ <h3 i18n="@@register.yourEmailAddresses" class="orc-font-body margin-top-12">
appearance="outline"
[hideRequiredMarker]="true"
[ngClass]="{
'valid-password-input': emailsAreValid,
'valid-password-input':
emailsAreValid || this.reactivation?.isReactivation,
'disable-error': !emailError
}"
>
<mat-icon *ngIf="emailsAreValid" matSuffix>done</mat-icon>
<mat-icon
*ngIf="emailsAreValid || this.reactivation?.isReactivation"
matSuffix
>done</mat-icon
>

<input
aria-labelledby="email-input-input-label"
Expand Down Expand Up @@ -234,10 +239,9 @@ <h3 i18n="@@register.yourEmailAddresses" class="orc-font-body margin-top-12">
<!-- <mat-label i18n="@@register.confirmEmail"
>Confirm primary email</mat-label
> -->
<div class="input-container">
<div class="input-container" *ngIf="!reactivation?.isReactivation">
<mat-form-field
appearance="outline"
*ngIf="!reactivation?.isReactivation"
[hideRequiredMarker]="true"
[ngClass]="{ 'valid-password-input': emailsAreValid }"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ export class FormPersonalComponent
{
email: new UntypedFormControl('', {
validators: [Validators.required, OrcidValidators.email],
asyncValidators: this._register.backendValueValidate('email'),
asyncValidators:
!this.reactivation?.isReactivation &&
this._register.backendValueValidate('email'),
}),
additionalEmails: this.additionalEmails,
},
Expand Down Expand Up @@ -320,7 +322,7 @@ export class FormPersonalComponent

get emailConfirmationValid() {
return ((this.form.controls.emails as any).controls?.confirmEmail as any)
.valid
?.valid
}

get givenNameFormTouched() {
Expand Down
23 changes: 17 additions & 6 deletions src/app/register2/components/step-a/step-a.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ <h1 class="orc-font-heading-small" i18n="@@register.create">
Create your ORCID iD
</h1>
</ng-container>
<ng-container
*ngIf="reactivation?.isReactivation"
i18n="@@register.reactivation"
>
Thank you for reactivating your ORCID iD.
<ng-container *ngIf="reactivation?.isReactivation">
<h1
class="orc-font-heading-small"
i18n="@@register.reactivateYourOrcidAccount"
>
Reactivate your ORCID account
</h1>
</ng-container>
</mat-card-title>
<mat-card-subtitle role="heading" aria-level="2">
Expand Down Expand Up @@ -71,7 +73,16 @@ <h2 class="orc-font-body-small" i18n="@@register.step1.3">
type="button"
id="step-a-back-button"
>
<a i18n="@@register.cancelRegistration"> Cancel registration</a>
<a
i18n="@@register.cancelRegistration"
*ngIf="!reactivation?.isReactivation"
>Cancel registration</a
>
<a
i18n="@@register.cancelReactivation"
*ngIf="reactivation?.isReactivation"
>Cancel reactivation</a
>
</button>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion src/app/register2/components/step-a/step-a.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class StepAComponent
ngAfterViewInit(): void {
// Timeout used to get focus on the first input after the first step loads
setTimeout(() => {
this.firstInput.nativeElement.focus()
this.firstInput?.nativeElement.focus()
}),
100
}
Expand Down
25 changes: 8 additions & 17 deletions src/app/register2/components/step-b/step-b.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ <h1 class="orc-font-heading-small" i18n="@@register.create">
Create your ORCID iD
</h1>
</ng-container>
<ng-container
*ngIf="reactivation?.isReactivation"
i18n="@@register.reactivation"
>
Thank you for reactivating your ORCID iD.
<ng-container *ngIf="reactivation?.isReactivation">
<h1
class="orc-font-heading-small"
i18n="@@register.reactivateYourOrcidAccount"
>
Reactivate your ORCID account
</h1>
</ng-container>
</mat-card-title>
<mat-card-subtitle role="heading" aria-level="2">
Expand All @@ -41,18 +43,7 @@ <h2 class="orc-font-body-small" i18n="@@register.step2.3">
matStepperNext
(click)="nextButton2()"
>
<ng-container
*ngIf="!reactivation?.isReactivation"
i18n="@@register.nextStep"
>
Next Step
</ng-container>
<ng-container
*ngIf="reactivation?.isReactivation"
i18n="@@register.reactivate"
>
REACTIVATE
</ng-container>
<ng-container i18n="@@register.nextStep"> Next Step </ng-container>
</button>
<button
mat-button
Expand Down
25 changes: 8 additions & 17 deletions src/app/register2/components/step-c/step-c.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ <h1 class="orc-font-heading-small" i18n="@@register.create">
Create your ORCID iD
</h1>
</ng-container>
<ng-container
*ngIf="reactivation?.isReactivation"
i18n="@@register.reactivation"
>
Thank you for reactivating your ORCID iD.
<ng-container *ngIf="reactivation?.isReactivation">
<h1
class="orc-font-heading-small"
i18n="@@register.reactivateYourOrcidAccount"
>
Reactivate your ORCID account
</h1>
</ng-container>
</mat-card-title>
<mat-card-subtitle role="heading" aria-level="2">
Expand All @@ -47,18 +49,7 @@ <h2 class="orc-font-body-small" i18n="@@register.step4.3">
matStepperNext
(click)="nextButton2()"
>
<ng-container
*ngIf="!reactivation?.isReactivation"
i18n="@@register.nextStep"
>
Next Step
</ng-container>
<ng-container
*ngIf="reactivation?.isReactivation"
i18n="@@register.reactivate"
>
REACTIVATE
</ng-container>
<ng-container i18n="@@register.nextStep"> Next Step </ng-container>
</button>
<button
mat-button
Expand Down
25 changes: 8 additions & 17 deletions src/app/register2/components/step-c2/step-c2.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ <h1 class="orc-font-heading-small" i18n="@@register.create">
Create your ORCID iD
</h1>
</ng-container>
<ng-container
*ngIf="reactivation?.isReactivation"
i18n="@@register.reactivation"
>
Thank you for reactivating your ORCID iD.
<ng-container *ngIf="reactivation?.isReactivation">
<h1
class="orc-font-heading-small"
i18n="@@register.reactivateYourOrcidAccount"
>
Reactivate your ORCID account
</h1>
</ng-container>
</mat-card-title>
<mat-card-subtitle role="heading" aria-level="2">
Expand Down Expand Up @@ -51,18 +53,7 @@ <h2 class="orc-font-body-small" i18n="@@register.step3.3">
[disabled]="loading"
(click)="nextButton2()"
>
<ng-container
*ngIf="!reactivation?.isReactivation"
i18n="@@register.nextStep"
>
Next Step
</ng-container>
<ng-container
*ngIf="reactivation?.isReactivation"
i18n="@@register.reactivate"
>
REACTIVATE
</ng-container>
<ng-container i18n="@@register.nextStep"> Next Step </ng-container>
</button>
<button
mat-button
Expand Down
18 changes: 10 additions & 8 deletions src/app/register2/components/step-d/step-d.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ <h1 class="orc-font-heading-small" i18n="@@register.create">
Create your ORCID iD
</h1>
</ng-container>
<ng-container
*ngIf="reactivation?.isReactivation"
i18n="@@register.reactivation"
>
Thank you for reactivating your ORCID iD.
<ng-container *ngIf="reactivation?.isReactivation">
<h1
class="orc-font-heading-small"
i18n="@@register.reactivateYourOrcidAccount"
>
Reactivate your ORCID account
</h1>
</ng-container>
</mat-card-title>
<mat-card-subtitle role="heading" aria-level="2">
Expand Down Expand Up @@ -57,9 +59,9 @@ <h2 class="orc-font-body-small" i18n="@@register.step5.3">
</ng-container>
<ng-container
*ngIf="reactivation?.isReactivation"
i18n="@@register.reactivate"
i18n="@@register.reactivateMyOrcidAccount"
>
REACTIVATE
Reactivate my ORCID account
</ng-container>
</button>
<button
Expand All @@ -70,7 +72,7 @@ <h2 class="orc-font-body-small" i18n="@@register.step5.3">
id="step-d-back-button"
(click)="backButton()"
>
<a i18n="@@shared.previousStep"> Previous Step</a>
<a i18n="@@shared.previousStep">Previous Step</a>
</button>
</div>
</form>
Expand Down
4 changes: 2 additions & 2 deletions src/app/register2/register-observability.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export class RegisterObservabilityService {
emailError: (form.controls.emails as UntypedFormGroup).controls.email
.errors,
confirmEmailError: (form.controls.emails as UntypedFormGroup).controls
.confirmEmail.errors,
.confirmEmail?.errors,
additionalEmailsError: (form.controls.emails as UntypedFormGroup)
.controls.additionalEmails.errors,
.controls.additionalEmails?.errors,
},
}
)
Expand Down
3 changes: 3 additions & 0 deletions src/locale/properties/register/register.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ register.reactivating=Reactivating your account
register.resendReactivate=click here to reactivate
register.deactivated=A deactivated ORCID record is associated with this email address.
register.reactivation=Thank you for reactivating your ORCID iD.
register.reactivateYourOrcidAccount=Reactivate your ORCID account
register.reactivateMyOrcidAccount=Reactivate my ORCID account
register.reactivate=REACTIVATE
register.passwordIsToLong=Passwords must be between 8 and 256 characters long
register.wrongPasswordPatternV2=Password must meet all requirements
Expand Down Expand Up @@ -166,6 +168,7 @@ register.step3.3=Step 3 of 5 - Current employment
register.step5.3=Step 5 of 5 - Terms and conditions
register.nextStep=Next Step
register.cancelRegistration=Cancel registration
register.cancelReactivation=Cancel reactivation
register.previousStep=Previous Step
register.completeRegistration=Complete registration
register.passwordRequired2=Please enter a password
Expand Down

0 comments on commit 6f14eee

Please sign in to comment.