Skip to content

Commit

Permalink
Merge pull request #2148 from ORCID/fix/feb-7-batch-fixes
Browse files Browse the repository at this point in the history
fix/feb-7-batch-fixes
  • Loading branch information
leomendoza123 authored Feb 8, 2024
2 parents ec08f79 + b4fe2f7 commit 365bd0b
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h3 class="orc-font-body" i18n="@@register.affiliationFoud">
<ng-container i18n="@@register.basedOnYourEmailWeThink">
Based on your emails we think you are currently affiliated with
</ng-container>
<strong>TEST.</strong>
<strong> {{ autoCompleteDisplayOrganization(organization) }}.</strong>

<ng-container
i18n="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ import { BaseForm } from '../BaseForm'
import { ErrorStateMatcher } from '@angular/material/core'
import { PlatformInfoService } from 'src/app/cdk/platform-info'
import { Router } from '@angular/router'
import { ApplicationRoutes } from 'src/app/constants'
import {
ApplicationRoutes,
MAX_LENGTH_LESS_THAN_ONE_HUNDRED,
} from 'src/app/constants'
import { LiveAnnouncer } from '@angular/cdk/a11y'
import { environment } from 'src/environments/environment'
import { RegisterBackendErrors } from 'src/app/types/register.local'
Expand Down Expand Up @@ -85,7 +88,6 @@ export class MyErrorStateMatcher implements ErrorStateMatcher {
})
export class FormPersonalComponent extends BaseForm implements OnInit {
matcher = new MyErrorStateMatcher()
maxNameLenght = 100
@Input() nextButtonWasClicked: boolean
@Input() reactivation: ReactivationLocal
@ViewChild(FormGroupDirective) formGroupDir: FormGroupDirective
Expand Down Expand Up @@ -191,14 +193,14 @@ export class FormPersonalComponent extends BaseForm implements OnInit {
validators: [
Validators.required,
OrcidValidators.illegalName,
Validators.maxLength(this.maxNameLenght),
Validators.maxLength(MAX_LENGTH_LESS_THAN_ONE_HUNDRED),
],
asyncValidators: this._register.backendValueValidate('givenNames'),
}),
familyNames: new UntypedFormControl('', {
validators: [
OrcidValidators.illegalName,
Validators.maxLength(this.maxNameLenght),
Validators.maxLength(MAX_LENGTH_LESS_THAN_ONE_HUNDRED),
],
}),
emails: this.emails,
Expand Down
13 changes: 12 additions & 1 deletion src/app/register2/components/step-a/step-a.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,20 @@ <h1 class="orc-font-heading-small" i18n="@@register.create">
</ng-container>
</mat-card-title>
<mat-card-subtitle role="heading" aria-level="2">
<h2 class="orc-font-body-small" i18n="@@register.step1.3">
<h2
class="orc-font-body-small"
i18n="@@register.step1.3"
*ngIf="togglzregistration21"
>
Step 1 of 5 - Names and emails
</h2>
<h2
class="orc-font-body-small"
i18n="@@register.step1.2"
*ngIf="!togglzregistration21"
>
Step 1 of 4 - Names and emails
</h2>
</mat-card-subtitle>
</mat-card-header>

Expand Down
1 change: 1 addition & 0 deletions src/app/register2/components/step-a/step-a.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { BaseStepDirective } from '../BaseStep'
export class StepAComponent extends BaseStepDirective implements AfterViewInit {
@ViewChild('firstInput') firstInput: ElementRef

@Input() togglzregistration21: boolean
@Input() reactivation: ReactivationLocal
nextButtonWasClicked: boolean

Expand Down
13 changes: 12 additions & 1 deletion src/app/register2/components/step-b/step-b.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,20 @@ <h1 class="orc-font-heading-small" i18n="@@register.create">
</ng-container>
</mat-card-title>
<mat-card-subtitle role="heading" aria-level="2">
<h2 class="orc-font-body-small" i18n="@@register.step2.3">
<h2
class="orc-font-body-small"
i18n="@@register.step2.3"
*ngIf="togglzregistration21"
>
Step 2 of 5 - Password
</h2>
<h2
class="orc-font-body-small"
i18n="@@register.step2.2"
*ngIf="!togglzregistration21"
>
Step 2 of 4 - Password
</h2>
</mat-card-subtitle>
</mat-card-header>

Expand Down
2 changes: 2 additions & 0 deletions src/app/register2/components/step-b/step-b.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { BaseStepDirective } from '../BaseStep'
export class StepBComponent extends BaseStepDirective {
@Input() personalData
@Input() reactivation: ReactivationLocal
@Input() togglzregistration21: boolean

nextButtonWasClicked = false

constructor() {
Expand Down
13 changes: 12 additions & 1 deletion src/app/register2/components/step-c/step-c.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,20 @@ <h1 class="orc-font-heading-small" i18n="@@register.create">
</ng-container>
</mat-card-title>
<mat-card-subtitle role="heading" aria-level="2">
<h2 class="orc-font-body-small" i18n="@@register.step4.3">
<h2
class="orc-font-body-small"
i18n="@@register.step4.3"
*ngIf="togglzregistration21"
>
Step 4 of 5 - Visibility
</h2>
<h2
class="orc-font-body-small"
i18n="@@register.step3.2"
*ngIf="!togglzregistration21"
>
Step 3 of 4 - Visibility
</h2>
</mat-card-subtitle>
</mat-card-header>

Expand Down
1 change: 1 addition & 0 deletions src/app/register2/components/step-c/step-c.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { BaseStepDirective } from '../BaseStep'
export class StepCComponent extends BaseStepDirective {
@Input() loading
@Input() reactivation: ReactivationLocal
@Input() togglzregistration21: boolean

constructor() {
super()
Expand Down
13 changes: 12 additions & 1 deletion src/app/register2/components/step-d/step-d.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,20 @@ <h1 class="orc-font-heading-small" i18n="@@register.create">
</ng-container>
</mat-card-title>
<mat-card-subtitle role="heading" aria-level="2">
<h2 class="orc-font-body-small" i18n="@@register.step5.3">
<h2
class="orc-font-body-small"
i18n="@@register.step5.3"
*ngIf="togglzregistration21"
>
Step 5 of 5 - Terms and conditions
</h2>
<h2
class="orc-font-body-small"
i18n="@@register.step4.2"
*ngIf="!togglzregistration21"
>
Step 4 of 4 - Terms and conditions
</h2>
</mat-card-subtitle>
</mat-card-header>

Expand Down
2 changes: 2 additions & 0 deletions src/app/register2/components/step-d/step-d.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { BaseStepDirective } from '../BaseStep'
export class StepDComponent extends BaseStepDirective {
@Input() loading
@Input() reactivation: ReactivationLocal
@Input() togglzregistration21: boolean

nextButtonWasClicked = false

constructor() {
Expand Down
5 changes: 5 additions & 0 deletions src/app/register2/pages/register/register2.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
[(formGroup)]="FormGroupStepA"
[reactivation]="reactivation"
#stepComponentA
[togglzregistration21]="registration21"
></app-step-a>
</mat-step>
<mat-step [stepControl]="FormGroupStepB">
Expand All @@ -29,9 +30,11 @@
[(formGroup)]="FormGroupStepB"
[personalData]="personalData"
[reactivation]="reactivation"
[togglzregistration21]="registration21"
></app-step-b>
</mat-step>
<mat-step
*ngIf="registration21"
[stepControl]="FormGroupStepC2"
[optional]="formGroupStepC2Optional"
>
Expand All @@ -52,13 +55,15 @@
[(formGroup)]="FormGroupStepC"
[loading]="loading"
[reactivation]="reactivation"
[togglzregistration21]="registration21"
></app-step-c>
</mat-step>
<mat-step [stepControl]="FormGroupStepD" #lastStep>
<ng-template matStepLabel i18n="@@register.visibilityAndTerm"
>Visibility and terms</ng-template
>
<app-step-d
[togglzregistration21]="registration21"
#stepComponentD
[(formGroup)]="FormGroupStepD"
(submit)="register()"
Expand Down
8 changes: 7 additions & 1 deletion src/app/register2/pages/register/register2.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { ThirdPartyAuthData } from 'src/app/types/sign-in-data.endpoint'
import { GoogleTagManagerService } from '../../../core/google-tag-manager/google-tag-manager.service'
import { SearchService } from '../../../core/search/search.service'
import { ReactivationLocal } from '../../../types/reactivation.local'
import { TogglzService } from 'src/app/core/togglz/togglz.service'

@Component({
selector: 'app-register-2',
Expand Down Expand Up @@ -70,6 +71,7 @@ export class Register2Component implements OnInit, AfterViewInit {
stepControlStepC2: UntypedFormGroup
formGroupStepC2Optional = false
@ViewChild('stepper') private myStepper: MatStepper
registration21: boolean

constructor(
private _cdref: ChangeDetectorRef,
Expand All @@ -83,7 +85,8 @@ export class Register2Component implements OnInit, AfterViewInit {
private _router: Router,
private _errorHandler: ErrorHandlerService,
private _userInfo: UserService,
private _searchService: SearchService
private _searchService: SearchService,
private _togglz: TogglzService
) {
_platformInfo.get().subscribe((platform) => {
this.platform = platform
Expand All @@ -92,6 +95,9 @@ export class Register2Component implements OnInit, AfterViewInit {
})
}
ngOnInit() {
this._togglz.getStateOf('REGISTRATION_2_1').subscribe((value) => {
this.registration21 = value
})
this._register.getRegisterForm().subscribe()

this.FormGroupStepA = this._formBuilder.group({
Expand Down
5 changes: 3 additions & 2 deletions src/locale/properties/register/register.en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,12 @@ register.onlyPeopleAndOrganization=Only people and organizations you’ve given
register.itemsArePrivateAndOnly=Items are private and only visible to you
register.step1.2=Step 1 of 4 - Names and emails
register.step2.2=Step 2 of 4 - Password
register.step3.2=Step 3 of 4 - Visibility
register.step4.2=Step 4 of 4 - Terms and conditions
register.step2.3=Step 2 of 5 - Password
register.step2.4=Step 4 of 4 - Terms and conditions
register.step1.3=Step 1 of 5 - Names and emails
register.step3.3=Step 3 of 5 - Current employment
register.step4.3=Step 4 of 5 - Visibility
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
Expand Down

0 comments on commit 365bd0b

Please sign in to comment.