mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
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:
@@ -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() {
|
||||
|
Reference in New Issue
Block a user