@ -5,9 +5,150 @@
< div > < label class = "form-label" > ID : < / label > {{collaborateur.id}}< / div >
< div > < label class = "form-label" > ID : < / label > {{collaborateur.id}}< / div >
< app-collaborateur-detail [ collaborateur ] = " collaborateur " > < / app-collaborateur-detail >
< 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 " >
< div * ngIf = "submitted && f.name.errors" class = "invalid-feedback" >
< div * ngIf = "f.name.errors.required" > Le nom d'un collaborateur est obligatoire< / div >
< / div >
< / div >
< 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 " >
< 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 >
< / div >
< 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 " >
< 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 >
< / div >
< 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 >
< option value = "MASCULIN" > Masculin< / option >
< option value = "FEMININ" > Féminin< / option >
< option value = "AUTRE" > Autre< / option >
< / select >
< div * ngIf = "submitted && f.gender.errors" class = "invalid-feedback" >
< div * ngIf = "f.gender.errors.required" > Vous devez préciser le genre du collaborateur< / div >
< / div >
< / div >
< / div >
< div class = "row mb-2" >
< 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 >
< option value = "CADRE" > Cadre< / option >
< option value = "NON-CADRE" > Non-cadre< / option >
< option value = "ALTERNANT" > Alternant< / option >
< option value = "STAGIAIRE" > Stagiaire< / option >
< / select >
< div * ngIf = "submitted && f.status.errors" class = "invalid-feedback" >
< div * ngIf = "f.status.errors.required" > Vous devez préciser le statut du collaborateur< / div >
< / div >
< / div >
< 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 " >
< 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 >
< / div >
< 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 " >
< div * ngIf = "submitted && f.address.errors" class = "invalid-feedback" >
< div * ngIf = "f.address.errors.required" > L'adresse d'un collaborateur est obligatoire< / div >
< / div >
< / div >
< 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 " >
< 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 >
< / div >
< / div >
< div class = "row mb-2" >
< div class = "form-group col-12 col-sm-6 col-md-4 col-lg-3" >
< label class = "form-label" > Mail personnel< / label >
< 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 >
< / 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 } " 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 >
< / 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 >
< / div >
< / div >
< div class = "row mb-2" >
< div class = "form-group col-12 col-md-6" >
< label class = "form-label" > Référent< / label >
< select class = "form-select" formControlName = "referrerId" [ ngClass ] = " { ' is-invalid ' : submitted & & f . referrerId . errors } " >
< option value = "" disabled selected > Choisissez un référent pour le collaborateur< / option >
< option * ngFor = "let collaborateur of collaborateurs" [ ngValue ] = " collaborateur . id " > {{collaborateur.name}} {{collaborateur.firstName}}< / option >
< / select >
< div * ngIf = "submitted && f.referrerId.errors" class = "invalid-feedback" >
< div * ngIf = "f.referrerId.errors.required" > Vous devez préciser le référent du collaborateur< / div >
< / div >
< / div >
< 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 >
< option * ngFor = "let businessUnit of businessUnits" [ ngValue ] = " businessUnit . id " > {{businessUnit.name}} < / option >
< / select >
< div * ngIf = "submitted && f.businessUnitId.errors" class = "invalid-feedback" >
< div * ngIf = "f.businessUnitId.errors.required" > Vous devez préciser la Business Unit du collaborateur< / div >
< / div >
< / div >
< / div >
< div >
< button ( click ) = " goBack ( ) " > Retour< / button >
< button type = "submit" > Sauvegarder les changements< / button >
< button ( click ) = " delete ( ) " > Supprimer le collaborateur< / button >
< button type = "reset" ( click ) = " onReset ( ) " > Effacer< / button >
< / div >
< / form >
< button ( click ) = " goBack ( ) " > Retour< / button >
< button ( click ) = " save ( ) " > Sauvegarder les changements< / button >
< button ( click ) = " delete ( ) " > Supprimer le collaborateur< / button >
< / div >
< / div >