diff --git a/src/app/members/account/core/personal-data.model.ts b/src/app/members/account/core/personal-data.model.ts index ebef0c4c0c861a2c1b94ed7516d3791d752cec93..108b3f78218d53b6c5cafb6de0ce5814671582cb 100644 --- a/src/app/members/account/core/personal-data.model.ts +++ b/src/app/members/account/core/personal-data.model.ts @@ -18,6 +18,7 @@ export class PersonalDataSchema { parentsEmail:string; school:string; grade:string; + classType:string; specialTeaching:string; scholarship:string; fatherActivity:string; @@ -56,6 +57,7 @@ export class PersonalDataAdapter implements IAdapter<PersonalData> { parentsEmail:data.parentsEmail?data.parentsEmail:'', school:data.school?data.school:'', grade:data.grade?data.grade:'', + classType : data.classType?data.classType:'', specialTeaching:data.specialTeaching?data.specialTeaching:'', scholarship:data.scholarship?data.scholarship:'', fatherActivity:data.fatherActivity?data.fatherActivity:'', @@ -80,6 +82,7 @@ export class PersonalDataAdapter implements IAdapter<PersonalData> { parentsEmail:obj.parentsEmail, school:obj.school, grade:obj.grade, + classType:obj.classType, specialTeaching:obj.specialTeaching, scholarship:obj.scholarship, fatherActivity:obj.fatherActivity, diff --git a/src/app/members/account/edit-data/edit-data.component.html b/src/app/members/account/edit-data/edit-data.component.html index fb5f01eec24a5461a53e005842a748572761eb16..910473fc32d8319136eabffedad412bd542f7c44 100644 --- a/src/app/members/account/edit-data/edit-data.component.html +++ b/src/app/members/account/edit-data/edit-data.component.html @@ -8,17 +8,21 @@ <mat-form-field class="full-width" > <input matInput type="text" formControlName="lastName" placeholder="Nom" required> </mat-form-field> - <mat-form-field> - <mat-label>Sexe</mat-label> - <mat-select formControlName="gender"> - <mat-option value="man">Homme</mat-option> - <mat-option value="woman" >Femme</mat-option> - <mat-option value="other">Autre</mat-option> - </mat-select> - </mat-form-field> - <mat-form-field class="full-width" > - <input matInput type="text" formControlName="nationality" placeholder="Nationalité" required> - </mat-form-field> + + <div class="form-group"> + <mat-form-field class="horizontal-display"> + <mat-label>Sexe</mat-label> + <mat-select formControlName="gender" required> + <mat-option value="Homme">Homme</mat-option> + <mat-option value="Femme" >Femme</mat-option> + <mat-option value="Autre">Autre</mat-option> + </mat-select> + </mat-form-field> + <mat-form-field class="horizontal-display" > + <input matInput type="text" formControlName="nationality" placeholder="Nationalité" required> + </mat-form-field> + </div> + <p class="text-center">Adresse</p> <div class="form-group"> <mat-form-field class="full-width address-input quarter-display"> @@ -57,27 +61,35 @@ <mat-form-field class="full-width" > <mat-label>Etablissement </mat-label> - <mat-select formControlName="school"> + <mat-select formControlName="school" required> <mat-option *ngFor="let school of possibleSchools" [value]="school.id">{{ school.name }}</mat-option> </mat-select> </mat-form-field> <mat-form-field class="full-width" > - <input matInput type="text" formControlName="specialTeaching" placeholder="Enseignements de spécialité (entrer 'aucun' si jamais vous n'etes pas concerné)" > + <input matInput required type="text" formControlName="specialTeaching" placeholder="Enseignements de spécialité (entrer 'aucun' si jamais vous n'etes pas concerné)" > </mat-form-field> <div class="form-group"> <mat-form-field class="horizontal-display"> <mat-label>Classe</mat-label> - <mat-select formControlName="grade"> + <mat-select formControlName="grade" required> <mat-option value="troisieme">Troisième</mat-option> <mat-option value="seconde">Seconde</mat-option> <mat-option value="premiere" >Première</mat-option> <mat-option value="terminale">Terminale</mat-option> </mat-select> </mat-form-field> + + <mat-form-field class="horizontal-display horizontal-center"> + <mat-label>Voie</mat-label> + <mat-select formControlName="classType" required> + <mat-option value="General">General</mat-option> + <mat-option value="Technologique">Technologique</mat-option> + </mat-select> + </mat-form-field> - <mat-form-field> + <mat-form-field class="horizontal-display"> <mat-label>Boursier </mat-label> - <mat-select formControlName="scholarship"> + <mat-select formControlName="scholarship" required> <mat-option *ngFor="let scholarship of possibleScholarships" [value]="scholarship.id">{{ scholarship.name }}</mat-option> </mat-select> </mat-form-field> @@ -90,14 +102,14 @@ <div class="form-group"> <mat-form-field class="horizontal-display"> <mat-label>Activité de la mère </mat-label> - <mat-select formControlName="motherActivity"> + <mat-select formControlName="motherActivity" required> <mat-option *ngFor="let activity of possibleParentsActivities" [value]="activity.id">{{ activity.name }}</mat-option> </mat-select> </mat-form-field> <mat-form-field class="horizontal-display"> <mat-label>Activité du père </mat-label> - <mat-select formControlName="fatherActivity"> + <mat-select formControlName="fatherActivity" required> <mat-option *ngFor="let activity of possibleParentsActivities" [value]="activity.id">{{ activity.name }}</mat-option> </mat-select> </mat-form-field> @@ -106,7 +118,7 @@ <div class="form-group"> <mat-form-field class="horizontal-display"> <mat-label>Statut des parents </mat-label> - <mat-select formControlName="parentsStatus" > + <mat-select formControlName="parentsStatus" required > <mat-option *ngFor="let status of possibleParentsStatus" [value]="status.id">{{ status.name }}</mat-option> </mat-select> </mat-form-field> @@ -115,7 +127,23 @@ <input matInput type="number" formControlName="dependantsNumber" placeholder="Nombre de personnes à charge" required> </mat-form-field> </div> - + <p> + <small> + Données personnelles : nous utiliserons les données fournies pour assurer le contact avec toi et ta famille, + équilibrer les participations aux activités organisées ainsi qu'à des fins d'aggrégation anonymisée + (statistiques, demandes de subvention). Plus d'informations dans nos <a routerLink="/mentions-legales" + target="_blank">mentions légales</a>. + </small> + </p> + + <p> + J'accepte qu'OSER utilise mes données personnelles fournies ci-dessus ou dans le formulaire d'inscription + adminsitrative, dans le strict respect du cadre spécifié ci-dessus : + </p> + + <mat-checkbox class="checkbox-field" formControlName="acceptedConditions" required > + J'accepte cette utilisation + </mat-checkbox> <div class="text-center"> <button mat-raised-button color="primary" [disabled]="!formGroup.valid || loading"> diff --git a/src/app/members/account/edit-data/edit-data.component.scss b/src/app/members/account/edit-data/edit-data.component.scss index 6b9ebbd3bb938b3928645ed0a96e8d27d00dfb1f..94479bb41b43b5561a20755df745b9c043b80aab 100644 --- a/src/app/members/account/edit-data/edit-data.component.scss +++ b/src/app/members/account/edit-data/edit-data.component.scss @@ -16,4 +16,13 @@ .quarter-display{ width:25%; + } + + .horizontal-center{ + margin: 0 10px; + } + + .checkbox-field { + display: block; + margin: .5em 0; } \ No newline at end of file diff --git a/src/app/members/account/edit-data/edit-data.component.ts b/src/app/members/account/edit-data/edit-data.component.ts index 1dd613aeb8a16b99721fdef74b05e4f4d193c5f7..fe03f5a382a6150243750e0d80c0eceb926c2570 100644 --- a/src/app/members/account/edit-data/edit-data.component.ts +++ b/src/app/members/account/edit-data/edit-data.component.ts @@ -21,23 +21,23 @@ export class EditDataComponent implements OnInit { loading = false; public error : String = ""; public possibleParentsStatus = [ - {id:"maried",name:"Mariés"}, - {id:"divorced",name:"Divorcés"}, - {id:"cohabitation",name:"En concubinage"}, - {id:"monoparental",name:"Famille monoparentale"} + {id:"Mariés",name:"Mariés"}, + {id:"Divorcés",name:"Divorcés"}, + {id:"En concubinage",name:"En concubinage"}, + {id:"Famille Monoparentale",name:"Famille monoparentale"} ] public possibleParentsActivities = [ - {id:"farmer",name:"Agriculteur"}, - {id:"artisan",name:"Artisan, commerçant, chef d'entreprise"}, - {id:"executive",name:"Cadre, profession intellectuelle supérieure"}, - {id:"teacher",name:"Enseignant et assimilé"}, - {id:"intermediate",name:"Profession intermédiaire"}, - {id:"employee",name:"Employé"}, - {id:"worker",name:"Ouvrier"}, - {id:"retreated",name:"Retraité"}, - {id:"inactive",name:"Inactif"}, - {id:"other",name:"Autre"} + {id:"Agriculteur",name:"Agriculteur"}, + {id:"Artisan, commerçant, chef d'entreprise",name:"Artisan, commerçant, chef d'entreprise"}, + {id:"Cadre, profession intellectuelle supérieure",name:"Cadre, profession intellectuelle supérieure"}, + {id:"Enseignant et assimilé",name:"Enseignant et assimilé"}, + {id:"Profession intermédiaire",name:"Profession intermédiaire"}, + {id:"Employé",name:"Employé"}, + {id:"Ouvrier",name:"Ouvrier"}, + {id:"Retraité",name:"Retraité"}, + {id:"Inactif",name:"Inactif"}, + {id:"Autre",name:"Autre"} ] public possibleSchools = [ @@ -53,13 +53,15 @@ export class EditDataComponent implements OnInit { ] public possibleScholarships = [ + {id:"echelon0",name:"Oui, échelon 0"}, {id:"echelon1",name:"Oui, échelon 1"}, {id:"echelon2",name:"Oui, échelon 2"}, {id:"echelon3",name:"Oui, échelon 3"}, {id:"echelon4",name:"Oui, échelon 4"}, {id:"echelon5",name:"Oui, échelon 5"}, {id:"echelon6",name:"Oui, échelon 6"}, - {id:"no",name:"Non"}, + {id:"echelon7",name:"Oui, échelon 7"}, + {id:"non",name:"Non"}, ] @@ -97,20 +99,22 @@ export class EditDataComponent implements OnInit { parentsEmail:[this.personalData.parentsEmail,Validators.email], school:this.personalData.school, grade:this.personalData.grade, + classType : this.personalData.classType, specialTeaching:this.personalData.specialTeaching, scholarship:this.personalData.scholarship, fatherActivity:this.personalData.fatherActivity, motherActivity:this.personalData.motherActivity, parentsStatus:this.personalData.parentsStatus, dependantsNumber:this.personalData.dependantsNumber, + acceptedConditions: false }) } submit(){ this.loading = true; - const {firstName,lastName,gender,nationality,addressNumber,street,zipCode,city,personalPhone,parentsPhone,parentsEmail,school,grade,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber} = this.formGroup.value; - const personalData: PersonalData = {...this.personalData,firstName,lastName,gender,nationality,addressNumber,street,zipCode,city,personalPhone,parentsPhone,parentsEmail,school,grade,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber}; + const {firstName,lastName,gender,nationality,classType,addressNumber,street,zipCode,city,personalPhone,parentsPhone,parentsEmail,school,grade,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber} = this.formGroup.value; + const personalData: PersonalData = {...this.personalData,classType,firstName,lastName,gender,nationality,addressNumber,street,zipCode,city,personalPhone,parentsPhone,parentsEmail,school,grade,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber}; this.personalDataService.edit(personalData).pipe( tap(() => this.loading = false), diff --git a/src/app/members/account/my-data/my-data.component.html b/src/app/members/account/my-data/my-data.component.html index 72adcf89179d107e40de0bcc03a09362c4f82ec0..882ddaef2168ce4f20eb8420d209b6fcaaa2336e 100644 --- a/src/app/members/account/my-data/my-data.component.html +++ b/src/app/members/account/my-data/my-data.component.html @@ -2,7 +2,7 @@ <h1>Mes données</h1> <p><span class='label'>Prénom : </span>{{personalData.firstName}} </p> <p><span class='label'>Nom : </span>{{personalData.lastName}}</p> - <p><span class='label'>Sexe : </span>{{gender[personalData.gender]}}</p> + <p><span class='label'>Sexe : </span>{{personalData.gender}}</p> <p><span class='label'>Nationalité : </span>{{personalData.nationality}}</p> <mat-divider></mat-divider> <p> <span class='label'>Adresse : </span>{{personalData.addressNumber}} {{personalData.street}} {{personalData.zipCode}}, {{personalData.city}}</p> @@ -13,13 +13,14 @@ <mat-divider></mat-divider> <p><span class='label'>Etablissement : </span>{{personalData.school}}</p> <p><span class='label'>Classe : </span>{{grade[personalData.grade]}}</p> + <p><span class='label'>Voie : </span>{{[personalData.classType]}}</p> <p><span class='label'>Enseignement de spécialité : </span>{{personalData.specialTeaching}}</p> <p><span class='label'>Boursier : </span>{{scholarship[personalData.scholarship]}}</p> <mat-divider></mat-divider> - <p><span class='label'>Activité du père : </span>{{activity[personalData.fatherActivity]}}</p> + <p><span class='label'>Activité du père : </span>{{personalData.fatherActivity}}</p> - <p><span class='label'>Activité de la mère : </span>{{activity[personalData.motherActivity]}}</p> - <p><span class='label'>Statut des parents : </span>{{status[personalData.parentsStatus]}}</p> + <p><span class='label'>Activité de la mère : </span>{{personalData.motherActivity}}</p> + <p><span class='label'>Statut des parents : </span>{{personalData.parentsStatus}}</p> <p><span class='label'>Nombre de personnes à charge : </span>{{personalData.dependantsNumber}}</p> <div class="text-center"> <button mat-raised-button color="primary" (click)="editData()" [disabled]="loading"><mat-icon aria-hidden="false" aria-label="Example home icon">edit</mat-icon>Modifier mes données</button> diff --git a/src/app/members/account/my-data/my-data.component.ts b/src/app/members/account/my-data/my-data.component.ts index 512cb55763f5d6facccf61c8ec1714713d2c3345..54b7f171b4dd7d7e4dc7425826bf6ecdb1959fef 100644 --- a/src/app/members/account/my-data/my-data.component.ts +++ b/src/app/members/account/my-data/my-data.component.ts @@ -12,11 +12,7 @@ export class MyDataComponent implements OnInit { personalData: PersonalData; - public gender= { - "man":"Homme", - "woman":"Femme", - "other":"Autre" - } + public grade = { "troisieme": "Troisième", "seconde":"Seconde", @@ -25,34 +21,19 @@ export class MyDataComponent implements OnInit { } public scholarship = { + "echelon0": "Oui, échelon 0", "echelon1": "Oui, échelon 1", "echelon2": "Oui, échelon 2", "echelon3": "Oui, échelon 3", "echelon4": "Oui, échelon 4", "echelon5": "Oui, échelon 5", "echelon6": "Oui, échelon 6", + "echelon7": "Oui, échelon 7", "no" : "Non" } - public activity = { - "farmer":"Agriculteur", - "artisan":"Artisan, commerçant, chef d'entreprise", - "executive":"Cadre, profession intellectuelle supérieure", - "teacher":"Enseignant et assimilé", - "intermediate":"Profession intermédiaire", - "employee":"Employé", - "worker":"Ouvrier", - "retreated":"Retraité", - "inactive":"Inactif", - "other":"Autre" - } - public status = { - "maried":"Mariés", - "divorced":"Divorcés", - "cohabitation":"En concubinage", - "monoparental":"Famille monoparentale" - } + public editData = (e)=> { this.router.navigate(['./membres/compte/modifier_donnees'])