['dateOfBirth' non obligatoire] + [popup forgotten password]
This commit is contained in:
parent
a70574a8e2
commit
7a0d1136a9
30 changed files with 262 additions and 454 deletions
|
|
@ -12,6 +12,7 @@ import {Router} from "@angular/router";
|
|||
|
||||
|
||||
interface VideoHistory {
|
||||
videoId: string,
|
||||
imageUrl: string,
|
||||
title: string,
|
||||
date: Date,
|
||||
|
|
@ -115,6 +116,7 @@ export class PageHistoryUserComponent implements AfterViewInit
|
|||
videoAllToVideoHistory(videoAll: VideoAll): VideoHistory
|
||||
{
|
||||
return {
|
||||
videoId: videoAll.videoId,
|
||||
imageUrl: videoAll.imageUrl,
|
||||
title: videoAll.title,
|
||||
date: videoAll.watchedDates[videoAll.watchedDates.length-1],
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export class PopupUpdateUserComponent implements OnInit
|
|||
_id: user0._id,
|
||||
login: user0.login,
|
||||
hashPass: user0.hashPass,
|
||||
email: user0.mail,
|
||||
email: user0.email,
|
||||
role: {
|
||||
name: user0.role.name,
|
||||
permission: user0.role.permission,
|
||||
|
|
@ -79,18 +79,13 @@ export class PopupUpdateUserComponent implements OnInit
|
|||
this.errorMessage = "Email invalide." ;
|
||||
this.hasError = true;
|
||||
}
|
||||
else if((this.userCopy.dateOfBirth === undefined) || (this.userCopy.dateOfBirth === null)) {
|
||||
this.errorMessage = "Veuillez remplir le champ 'date de naissance'.";
|
||||
else if((this.changePassword) && (this.newPassword.length === 0)) {
|
||||
this.errorMessage = "Veuillez remplir le champ 'mot de passe'" ;
|
||||
this.hasError = true;
|
||||
}
|
||||
else if(this.changePassword) {
|
||||
if (this.newPassword.length === 0) {
|
||||
this.errorMessage = "Veuillez remplir le champ 'mot de passe'." ;
|
||||
this.hasError = true;
|
||||
} else if (this.newPassword !== this.confirmNewPassword) {
|
||||
this.errorMessage = "Le mot de passe est différent de sa confirmation." ;
|
||||
this.hasError = true;
|
||||
}
|
||||
else if((this.changePassword) && (this.newPassword !== this.confirmNewPassword)) {
|
||||
this.errorMessage = "Le mot de passe est différent de sa confirmation" ;
|
||||
this.hasError = true;
|
||||
}
|
||||
else {
|
||||
this.errorMessage = "" ;
|
||||
|
|
|
|||
Reference in a new issue