@ -4,15 +4,16 @@
< div > < label class = "form-label" > ID : < / label > {{collaborateur.id}}< / div >
< form [ formGroup ] = " registerForm "
(ngSubmit)="onSubmit() ">
< form ( ngSubmit ) = " onSubmit ( ) "
[formGroup]="registerForm ">
< div class = "row mb-2" >
< div class = "form-group col-12 col-sm-6 col-md-4 col-lg-3" >
< label class = "form-label" > Nom< / label >
< input class = "form-control" formControlName = "name" [ ngClass ] = " { ' is-invalid ' : submitted & & f . name . errors } "
[value]="collaborateur.name">
< input [ ngClass ] = " { ' is-invalid ' : submitted & & f . name . errors } " [ value ] = " collaborateur . name "
class="form-control"
formControlName="name">
< div * ngIf = "submitted && f.name.errors" class = "invalid-feedback" >
< div * ngIf = "f.name.errors.required" > Le nom d'un collaborateur est obligatoire< / div >
< / div >
@ -20,8 +21,8 @@
< div class = "form-group col-12 col-sm-6 col-md-4 col-lg-3" >
< label class = "form-label" > Prénom< / label >
< input class = "form-control" formControlName = "firstName "
[ngClass]="{ 'is-invalid': submitted & & f.firstName.errors }" [value]="collaborateur. firstName">
< input [ ngClass ] = " { ' is-invalid ' : submitted & & f . firstName . errors } " [ value ] = " collaborateur . firstName "
class="form-control" formControlName=" firstName">
< div * ngIf = "submitted && f.firstName.errors" class = "invalid-feedback" >
< div * ngIf = "f.firstName.errors.required" > Le prénom d'un collaborateur est obligatoire< / div >
< / div >
@ -29,9 +30,10 @@
< div class = "form-group col-12 col-sm-6 col-md-4 col-lg-3" >
< label class = "form-label" > Date de naissance< / label >
< input type = "date" [ value ] = " collaborateur . birthDate | date: ' yyyy-MM-dd ' " class = "form-control"
formControlName="birthDate" (change)="onBirthDateChange($event)"
[ngClass]="{ 'is-invalid': submitted & & f.birthDate.errors }">
< input ( change ) = " onBirthDateChange ( $ event ) " [ ngClass ] = " { ' is-invalid ' : submitted & & f . birthDate . errors } "
[value]="collaborateur.birthDate | date:'yyyy-MM-dd'"
class="form-control" formControlName="birthDate"
type="date">
< div * ngIf = "submitted && f.birthDate.errors" class = "invalid-feedback" >
< div * ngIf = "f.birthDate.errors.required" > La date de naissance d'un collaborateur est obligatoire< / div >
< / div >
@ -39,9 +41,10 @@
< div class = "form-group col-12 col-sm-6 col-md-4 col-lg-3" >
< label class = "form-label" > Genre< / label >
< select class = "form-select" formControlName = "gender" [ ngClass ] = " { ' is-invalid ' : submitted & & f . gender . errors } "
[value]="collaborateur.gender">
< option value = "" disabled selected > Genre< / option >
< select [ ngClass ] = " { ' is-invalid ' : submitted & & f . gender . errors } " [ value ] = " collaborateur . gender "
class="form-select"
formControlName="gender">
< option disabled selected value = "" > Genre< / option >
< option value = "MASCULIN" > Masculin< / option >
< option value = "FEMININ" > Féminin< / option >
< option value = "AUTRE" > Autre< / option >
@ -57,9 +60,10 @@
< div class = "form-group col-12 col-sm-6 col-md-4 col-lg-3" >
< label class = "form-label" > Statut< / label >
< select class = "form-select" formControlName = "status" [ ngClass ] = " { ' is-invalid ' : submitted & & f . status . errors } "
[value]="collaborateur.status">
< option value = "" disabled selected > Statut< / option >
< select [ ngClass ] = " { ' is-invalid ' : submitted & & f . status . errors } " [ value ] = " collaborateur . status "
class="form-select"
formControlName="status">
< option disabled selected value = "" > Statut< / option >
< option value = "CADRE" > Cadre< / option >
< option value = "NONCADRE" > Non-cadre< / option >
< option value = "ALTERNANT" > Alternant< / option >
@ -72,9 +76,9 @@
< div class = "form-group col-12 col-sm-6 col-md-4 col-lg-3" >
< label class = "form-label" > Nombre d'enfants< / label >
< input class = "form-control" formControlName = "childrenNumber "
[ngClass]="{ 'is-invalid': submitted & & f.childrenNumber.errors }" type="n umber" min="0"
onkeyup="if(this.value< 0 ) { this . value = this.value * -1 } " [ value ] = " collaborateur . childrenNumber " >
< input [ ngClass ] = " { ' is-invalid ' : submitted & & f . childrenNumber . errors } " [ value ] = " collaborateur . childrenNumber "
class="form-control" formControlName="childrenN umber" min="0"
onkeyup="if(this.value< 0 ) { this . value = this.value * -1 } " type = "number ">
< div * ngIf = "submitted && f.childrenNumber.errors" class = "invalid-feedback" >
< div * ngIf = "f.childrenNumber.errors.required" > Le nombre d'enfant d'un collaborateur est obligatoire< / div >
< / div >
@ -82,8 +86,8 @@
< div class = "form-group col-12 col-sm-6 col-md-4 col-lg-3" >
< label class = "form-label" > Adresse< / label >
< input class = "form-control" formControlName = "address "
[ngClass]="{ 'is-invalid': submitted & & f.address.errors }" [value]="collaborateur. address">
< input [ ngClass ] = " { ' is-invalid ' : submitted & & f . address . errors } " [ value ] = " collaborateur . address "
class="form-control" formControlName=" address">
< div * ngIf = "submitted && f.address.errors" class = "invalid-feedback" >
< div * ngIf = "f.address.errors.required" > L'adresse d'un collaborateur est obligatoire< / div >
< / div >
@ -91,8 +95,8 @@
< div class = "form-group col-12 col-sm-6 col-md-4 col-lg-3" >
< label class = "form-label" > Téléphone< / label >
< input class = "form-control" formControlName = "telephone "
[ngClass]="{ 'is-invalid': submitted & & f.telephone.errors }" [value]="collaborateur. telephone">
< input [ ngClass ] = " { ' is-invalid ' : submitted & & f . telephone . errors } " [ value ] = " collaborateur . telephone "
class="form-control" formControlName=" telephone">
< div * ngIf = "submitted && f.telephone.errors" class = "invalid-feedback" >
< div * ngIf = "f.telephone.errors.required" > Le numéro de téléphone d'un collaborateur est obligatoire< / div >
< / div >
@ -106,9 +110,10 @@
< label class = "form-label" style = "padding-right: 5px" > Mail personnel< / label >
< small > (pas Apside)< / small >
< / div >
< input type = "email" class = "form-control" formControlName = "personalMail"
[ngClass]="{ 'is-invalid': submitted & & f.personalMail.errors }" placeholder="prenom.nom@example.com"
[value]="collaborateur.personalMail">
< input [ ngClass ] = " { ' is-invalid ' : submitted & & f . personalMail . errors } " [ value ] = " collaborateur . personalMail "
class="form-control"
formControlName="personalMail" placeholder="prenom.nom@example.com"
type="email">
< div * ngIf = "submitted && f.personalMail.errors" class = "invalid-feedback" >
< div * ngIf = "f.personalMail.errors.required" > Le mail personnel d'un collaborateur est obligatoire< / div >
< div * ngIf = "f.personalMail.errors.pattern" > Le mail personnel d'un collaborateur doit être au format
@ -119,9 +124,10 @@
< div class = "form-group col-12 col-sm-6 col-md-4 col-lg-3" >
< label class = "form-label" > Mail Apside< / label >
< input type = "email" class = "form-control" formControlName = "apsideMail"
[ngClass]="{ 'is-invalid': (submitted & & f.apsideMail.errors) || errorValue==1 }"
placeholder="prenom.nom@apside-groupe.com" [value]="collaborateur.apsideMail">
< input [ ngClass ] = " { ' is-invalid ' : ( submitted & & f . apsideMail . errors ) | | errorValue = =1 } "
[value]="collaborateur.apsideMail" class="form-control"
formControlName="apsideMail"
placeholder="prenom.nom@apside-groupe.com" type="email">
< div * ngIf = "submitted && f.apsideMail.errors" class = "invalid-feedback" >
< div * ngIf = "f.apsideMail.errors.required" > Le mail Apside d'un collaborateur est obligatoire< / div >
< div * ngIf = "f.apsideMail.errors.pattern" > Le mail Apside d'un collaborateur doit être au format
@ -136,9 +142,11 @@
< div class = "form-group col-12 col-sm-6 col-md-4 col-lg-3" >
< label class = "form-label" > Date de départ< / label >
< input type = "date" [ value ] = " collaborateur . resignationDate | date: ' yyyy-MM-dd ' " class = "form-control"
formControlName="resignationDate" (change)="onResignationDateChange($event)"
[ngClass]="{ 'is-invalid': submitted & & f.resignationDate.errors }">
< input ( change ) = " onResignationDateChange ( $ event ) "
[ngClass]="{ 'is-invalid': submitted & & f.resignationDate.errors }"
[value]="collaborateur.resignationDate | date:'yyyy-MM-dd'"
class="form-control" formControlName="resignationDate"
type="date">
< / div >
< / div >
@ -147,9 +155,9 @@
< div class = "form-group col-12 col-md-6" >
< label class = "form-label" > Business Unit< / label >
< select class = "form-select" formControlName = "businessUnitId "
[ngClass]="{ 'is-invalid': submitted & & f.businessUnitId.errors } ">
< option value = "" disabled selected > Choisissez une Business Unit pour le collaborateur< / option >
< select [ ngClass ] = " { ' is-invalid ' : submitted & & f . businessUnitId . errors } " class = "form-select "
formControlName="businessUnitId ">
< option disabled selected value = "" > Choisissez une Business Unit pour le collaborateur< / option >
< option * ngFor = "let businessUnit of businessUnits" [ ngValue ] = " businessUnit . id " > {{businessUnit.name}} < / option >
< / select >
< div * ngIf = "submitted && f.businessUnitId.errors" class = "invalid-feedback" >
@ -162,7 +170,7 @@
< div >
< button type = "submit" > Sauvegarder les changements< / button >
< button ( click ) = " delete ( ) " > Supprimer le collaborateur< / button >
< button type = "reset" ( click ) = " onReset ( ) " > Effacer< / button >
< button ( click ) = " onReset ( ) " type = "reset "> Effacer< / button >
< button ( click ) = " goBack ( ) " > Retour< / button >
< / div >
< / form >