|
|
|
@ -1,19 +1,18 @@ |
|
|
|
|
|
|
|
|
|
<div *ngIf="collaborateur"> |
|
|
|
|
|
|
|
|
|
<h2>{{collaborateur.name | uppercase}} {{collaborateur.firstName | uppercase}} </h2> |
|
|
|
|
|
|
|
|
|
<div><label class="form-label">ID : </label>{{collaborateur.id}}</div> |
|
|
|
|
|
|
|
|
|
<form *ngIf="collaborateurObservable | async;" |
|
|
|
|
[formGroup]="registerForm" |
|
|
|
|
(ngSubmit)="onSubmit()" > |
|
|
|
|
<form [formGroup]="registerForm" |
|
|
|
|
(ngSubmit)="onSubmit()"> |
|
|
|
|
|
|
|
|
|
<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 class="form-control" formControlName="name" [ngClass]="{ 'is-invalid': submitted && f.name.errors }" |
|
|
|
|
[value]="collaborateur.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> |
|
|
|
@ -21,7 +20,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 class="form-control" formControlName="firstName" |
|
|
|
|
[ngClass]="{ 'is-invalid': submitted && f.firstName.errors }" [value]="collaborateur.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,7 +29,9 @@ |
|
|
|
|
|
|
|
|
|
<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" class="form-control" formControlName="birthDate" (change)="onBirthDateChange($event)" [ngClass]="{ 'is-invalid': submitted && f.birthDate.errors }" [value]="collaborateur.birthDate"> |
|
|
|
|
<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 }"> |
|
|
|
|
<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> |
|
|
|
@ -37,7 +39,8 @@ |
|
|
|
|
|
|
|
|
|
<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"> |
|
|
|
|
<select class="form-select" formControlName="gender" [ngClass]="{ 'is-invalid': submitted && f.gender.errors }" |
|
|
|
|
[value]="collaborateur.gender"> |
|
|
|
|
<option value="" disabled selected>Genre</option> |
|
|
|
|
<option value="MASCULIN">Masculin</option> |
|
|
|
|
<option value="FEMININ">Féminin</option> |
|
|
|
@ -54,7 +57,8 @@ |
|
|
|
|
|
|
|
|
|
<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"> |
|
|
|
|
<select class="form-select" formControlName="status" [ngClass]="{ 'is-invalid': submitted && f.status.errors }" |
|
|
|
|
[value]="collaborateur.status"> |
|
|
|
|
<option value="" disabled selected>Statut</option> |
|
|
|
|
<option value="CADRE">Cadre</option> |
|
|
|
|
<option value="NONCADRE">Non-cadre</option> |
|
|
|
@ -68,7 +72,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="number" min="0" onkeyup="if(this.value<0){this.value= this.value * -1}" [value]="collaborateur.childrenNumber"> |
|
|
|
|
<input class="form-control" formControlName="childrenNumber" |
|
|
|
|
[ngClass]="{ 'is-invalid': submitted && f.childrenNumber.errors }" type="number" min="0" |
|
|
|
|
onkeyup="if(this.value<0){this.value= this.value * -1}" [value]="collaborateur.childrenNumber"> |
|
|
|
|
<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> |
|
|
|
@ -76,7 +82,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 class="form-control" formControlName="address" |
|
|
|
|
[ngClass]="{ 'is-invalid': submitted && f.address.errors }" [value]="collaborateur.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> |
|
|
|
@ -84,7 +91,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 class="form-control" formControlName="telephone" |
|
|
|
|
[ngClass]="{ 'is-invalid': submitted && f.telephone.errors }" [value]="collaborateur.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> |
|
|
|
@ -98,31 +106,39 @@ |
|
|
|
|
<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 type="email" class="form-control" formControlName="personalMail" |
|
|
|
|
[ngClass]="{ 'is-invalid': submitted && f.personalMail.errors }" placeholder="prenom.nom@example.com" |
|
|
|
|
[value]="collaborateur.personalMail"> |
|
|
|
|
<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 "exemple@nom.de.domaine"</div> |
|
|
|
|
<div *ngIf="f.personalMail.errors.pattern">Le mail personnel d'un collaborateur doit être au format |
|
|
|
|
"exemple@nom.de.domaine" |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<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 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"> |
|
|
|
|
<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 "exemple@apside-groupe.com" ou "exemple@apside.fr"</div> |
|
|
|
|
<div *ngIf="f.apsideMail.errors.pattern">Le mail Apside d'un collaborateur doit être au format |
|
|
|
|
"exemple@apside-groupe.com" ou "exemple@apside.fr" |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div *ngIf="submitted && errorValue==1" class="invalid-feedback"> |
|
|
|
|
<div *ngIf="errorValue==1">Le mail Apside que vous avez entré est déjà utilisé pour un autre collaborateur</div> |
|
|
|
|
<div *ngIf="errorValue==1">Le mail Apside que vous avez entré est déjà utilisé pour un autre collaborateur |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<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" class="form-control" formControlName="resignationDate" (change)="onResignationDateChange($event)" [ngClass]="{ 'is-invalid': submitted && f.resignationDate.errors }" [value]="collaborateur.resignationDate"> |
|
|
|
|
<div *ngIf="submitted && f.resignationDate.errors" class="invalid-feedback"> |
|
|
|
|
<div *ngIf="f.resignationDate.errors.required">La date de départ d'un collaborateur est obligatoire</div> |
|
|
|
|
</div> |
|
|
|
|
<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 }"> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
@ -131,7 +147,8 @@ |
|
|
|
|
|
|
|
|
|
<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 }"> |
|
|
|
|
<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> |
|
|
|
|
<option *ngFor="let businessUnit of businessUnits" [ngValue]="businessUnit.id">{{businessUnit.name}} </option> |
|
|
|
|
</select> |
|
|
|
|