Implement community feedback

Remove other registration references
Enabled enter submit in registration form
Fixed create-profile password validation to be on debounce
Fixed register page title
This commit is contained in:
Yana De Pauw
2020-06-10 10:15:06 +02:00
parent 8fc2309d48
commit ca7a76b80f
9 changed files with 37 additions and 110 deletions

View File

@@ -1,6 +1,6 @@
import { Component, Inject, OnInit } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { map } from 'rxjs/operators';
import { debounceTime, map } from 'rxjs/operators';
import { Registration } from '../../core/shared/registration.model';
import { Observable } from 'rxjs';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
@@ -32,6 +32,8 @@ export class CreateProfileComponent implements OnInit {
passwordForm: FormGroup;
activeLangs: LangConfig[];
isValidPassWord$: Observable<boolean>;
constructor(
private translateService: TranslateService,
private ePersonDataService: EPersonDataService,
@@ -68,15 +70,26 @@ export class CreateProfileComponent implements OnInit {
this.passwordForm = this.formBuilder.group({
password: new FormControl('', {
validators: [Validators.required, Validators.minLength(6)],
updateOn: 'blur'
updateOn: 'change'
}),
confirmPassword: new FormControl('', {
validators: [Validators.required],
updateOn: 'blur'
updateOn: 'change'
})
}, {
validator: ConfirmedValidator('password', 'confirmPassword')
});
this.isValidPassWord$ = this.passwordForm.statusChanges.pipe(
debounceTime(300),
map((status: string) => {
if (status === 'VALID') {
return true;
} else {
return false;
}
})
);
}
get firstName() {