Skip to content
Snippets Groups Projects
Commit 2265d807 authored by Arthur Guedon's avatar Arthur Guedon
Browse files

adds classType field and rgpd info

parent a2d0652e
Branches
No related tags found
22 merge requests!68Branchetest,!64adds error message when email is already used and redirects after signup,!63Improve error message,!61adds info on phone number format,!59Adds info on phone number format,!58Personnal data fix,!57Validated signup file display,!54Validated signup file display,!53adds message after user modfies personal data,!55Fix Oser to OSER,!52closes three-panes tag,!50Donnees personnelles,!51Adds message after user changes his personal data,!49Donnees personnelles,!47Donnees personnelles,!42Donnees personnelles,!44Donnees personnelles,!48Donnees personnelles,!40adds support for personnal data,!45Donnees personnelles,!46Donnees personnelles,!43Donnees personnelles
...@@ -18,6 +18,7 @@ export class PersonalDataSchema { ...@@ -18,6 +18,7 @@ export class PersonalDataSchema {
parentsEmail:string; parentsEmail:string;
school:string; school:string;
grade:string; grade:string;
classType:string;
specialTeaching:string; specialTeaching:string;
scholarship:string; scholarship:string;
fatherActivity:string; fatherActivity:string;
...@@ -56,6 +57,7 @@ export class PersonalDataAdapter implements IAdapter<PersonalData> { ...@@ -56,6 +57,7 @@ export class PersonalDataAdapter implements IAdapter<PersonalData> {
parentsEmail:data.parentsEmail?data.parentsEmail:'', parentsEmail:data.parentsEmail?data.parentsEmail:'',
school:data.school?data.school:'', school:data.school?data.school:'',
grade:data.grade?data.grade:'', grade:data.grade?data.grade:'',
classType : data.classType?data.classType:'',
specialTeaching:data.specialTeaching?data.specialTeaching:'', specialTeaching:data.specialTeaching?data.specialTeaching:'',
scholarship:data.scholarship?data.scholarship:'', scholarship:data.scholarship?data.scholarship:'',
fatherActivity:data.fatherActivity?data.fatherActivity:'', fatherActivity:data.fatherActivity?data.fatherActivity:'',
...@@ -80,6 +82,7 @@ export class PersonalDataAdapter implements IAdapter<PersonalData> { ...@@ -80,6 +82,7 @@ export class PersonalDataAdapter implements IAdapter<PersonalData> {
parentsEmail:obj.parentsEmail, parentsEmail:obj.parentsEmail,
school:obj.school, school:obj.school,
grade:obj.grade, grade:obj.grade,
classType:obj.classType,
specialTeaching:obj.specialTeaching, specialTeaching:obj.specialTeaching,
scholarship:obj.scholarship, scholarship:obj.scholarship,
fatherActivity:obj.fatherActivity, fatherActivity:obj.fatherActivity,
......
...@@ -8,17 +8,21 @@ ...@@ -8,17 +8,21 @@
<mat-form-field class="full-width" > <mat-form-field class="full-width" >
<input matInput type="text" formControlName="lastName" placeholder="Nom" required> <input matInput type="text" formControlName="lastName" placeholder="Nom" required>
</mat-form-field> </mat-form-field>
<mat-form-field>
<div class="form-group">
<mat-form-field class="horizontal-display">
<mat-label>Sexe</mat-label> <mat-label>Sexe</mat-label>
<mat-select formControlName="gender"> <mat-select formControlName="gender" required>
<mat-option value="man">Homme</mat-option> <mat-option value="Homme">Homme</mat-option>
<mat-option value="woman" >Femme</mat-option> <mat-option value="Femme" >Femme</mat-option>
<mat-option value="other">Autre</mat-option> <mat-option value="Autre">Autre</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field class="full-width" > <mat-form-field class="horizontal-display" >
<input matInput type="text" formControlName="nationality" placeholder="Nationalité" required> <input matInput type="text" formControlName="nationality" placeholder="Nationalité" required>
</mat-form-field> </mat-form-field>
</div>
<p class="text-center">Adresse</p> <p class="text-center">Adresse</p>
<div class="form-group"> <div class="form-group">
<mat-form-field class="full-width address-input quarter-display"> <mat-form-field class="full-width address-input quarter-display">
...@@ -57,17 +61,17 @@ ...@@ -57,17 +61,17 @@
<mat-form-field class="full-width" > <mat-form-field class="full-width" >
<mat-label>Etablissement </mat-label> <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-option *ngFor="let school of possibleSchools" [value]="school.id">{{ school.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field class="full-width" > <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> </mat-form-field>
<div class="form-group"> <div class="form-group">
<mat-form-field class="horizontal-display"> <mat-form-field class="horizontal-display">
<mat-label>Classe</mat-label> <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="troisieme">Troisième</mat-option>
<mat-option value="seconde">Seconde</mat-option> <mat-option value="seconde">Seconde</mat-option>
<mat-option value="premiere" >Première</mat-option> <mat-option value="premiere" >Première</mat-option>
...@@ -75,9 +79,17 @@ ...@@ -75,9 +79,17 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<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 class="horizontal-display">
<mat-label>Boursier </mat-label> <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-option *ngFor="let scholarship of possibleScholarships" [value]="scholarship.id">{{ scholarship.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
...@@ -90,14 +102,14 @@ ...@@ -90,14 +102,14 @@
<div class="form-group"> <div class="form-group">
<mat-form-field class="horizontal-display"> <mat-form-field class="horizontal-display">
<mat-label>Activité de la mère </mat-label> <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-option *ngFor="let activity of possibleParentsActivities" [value]="activity.id">{{ activity.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field class="horizontal-display"> <mat-form-field class="horizontal-display">
<mat-label>Activité du père </mat-label> <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-option *ngFor="let activity of possibleParentsActivities" [value]="activity.id">{{ activity.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
...@@ -106,7 +118,7 @@ ...@@ -106,7 +118,7 @@
<div class="form-group"> <div class="form-group">
<mat-form-field class="horizontal-display"> <mat-form-field class="horizontal-display">
<mat-label>Statut des parents </mat-label> <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-option *ngFor="let status of possibleParentsStatus" [value]="status.id">{{ status.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
...@@ -115,7 +127,23 @@ ...@@ -115,7 +127,23 @@
<input matInput type="number" formControlName="dependantsNumber" placeholder="Nombre de personnes à charge" required> <input matInput type="number" formControlName="dependantsNumber" placeholder="Nombre de personnes à charge" required>
</mat-form-field> </mat-form-field>
</div> </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"> <div class="text-center">
<button mat-raised-button color="primary" [disabled]="!formGroup.valid || loading"> <button mat-raised-button color="primary" [disabled]="!formGroup.valid || loading">
......
...@@ -17,3 +17,12 @@ ...@@ -17,3 +17,12 @@
.quarter-display{ .quarter-display{
width:25%; width:25%;
} }
.horizontal-center{
margin: 0 10px;
}
.checkbox-field {
display: block;
margin: .5em 0;
}
\ No newline at end of file
...@@ -21,23 +21,23 @@ export class EditDataComponent implements OnInit { ...@@ -21,23 +21,23 @@ export class EditDataComponent implements OnInit {
loading = false; loading = false;
public error : String = ""; public error : String = "";
public possibleParentsStatus = [ public possibleParentsStatus = [
{id:"maried",name:"Mariés"}, {id:"Mariés",name:"Mariés"},
{id:"divorced",name:"Divorcés"}, {id:"Divorcés",name:"Divorcés"},
{id:"cohabitation",name:"En concubinage"}, {id:"En concubinage",name:"En concubinage"},
{id:"monoparental",name:"Famille monoparentale"} {id:"Famille Monoparentale",name:"Famille monoparentale"}
] ]
public possibleParentsActivities = [ public possibleParentsActivities = [
{id:"farmer",name:"Agriculteur"}, {id:"Agriculteur",name:"Agriculteur"},
{id:"artisan",name:"Artisan, commerçant, chef d'entreprise"}, {id:"Artisan, commerçant, chef d'entreprise",name:"Artisan, commerçant, chef d'entreprise"},
{id:"executive",name:"Cadre, profession intellectuelle supérieure"}, {id:"Cadre, profession intellectuelle supérieure",name:"Cadre, profession intellectuelle supérieure"},
{id:"teacher",name:"Enseignant et assimilé"}, {id:"Enseignant et assimilé",name:"Enseignant et assimilé"},
{id:"intermediate",name:"Profession intermédiaire"}, {id:"Profession intermédiaire",name:"Profession intermédiaire"},
{id:"employee",name:"Employé"}, {id:"Employé",name:"Employé"},
{id:"worker",name:"Ouvrier"}, {id:"Ouvrier",name:"Ouvrier"},
{id:"retreated",name:"Retraité"}, {id:"Retraité",name:"Retraité"},
{id:"inactive",name:"Inactif"}, {id:"Inactif",name:"Inactif"},
{id:"other",name:"Autre"} {id:"Autre",name:"Autre"}
] ]
public possibleSchools = [ public possibleSchools = [
...@@ -53,13 +53,15 @@ export class EditDataComponent implements OnInit { ...@@ -53,13 +53,15 @@ export class EditDataComponent implements OnInit {
] ]
public possibleScholarships = [ public possibleScholarships = [
{id:"echelon0",name:"Oui, échelon 0"},
{id:"echelon1",name:"Oui, échelon 1"}, {id:"echelon1",name:"Oui, échelon 1"},
{id:"echelon2",name:"Oui, échelon 2"}, {id:"echelon2",name:"Oui, échelon 2"},
{id:"echelon3",name:"Oui, échelon 3"}, {id:"echelon3",name:"Oui, échelon 3"},
{id:"echelon4",name:"Oui, échelon 4"}, {id:"echelon4",name:"Oui, échelon 4"},
{id:"echelon5",name:"Oui, échelon 5"}, {id:"echelon5",name:"Oui, échelon 5"},
{id:"echelon6",name:"Oui, échelon 6"}, {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 { ...@@ -97,20 +99,22 @@ export class EditDataComponent implements OnInit {
parentsEmail:[this.personalData.parentsEmail,Validators.email], parentsEmail:[this.personalData.parentsEmail,Validators.email],
school:this.personalData.school, school:this.personalData.school,
grade:this.personalData.grade, grade:this.personalData.grade,
classType : this.personalData.classType,
specialTeaching:this.personalData.specialTeaching, specialTeaching:this.personalData.specialTeaching,
scholarship:this.personalData.scholarship, scholarship:this.personalData.scholarship,
fatherActivity:this.personalData.fatherActivity, fatherActivity:this.personalData.fatherActivity,
motherActivity:this.personalData.motherActivity, motherActivity:this.personalData.motherActivity,
parentsStatus:this.personalData.parentsStatus, parentsStatus:this.personalData.parentsStatus,
dependantsNumber:this.personalData.dependantsNumber, dependantsNumber:this.personalData.dependantsNumber,
acceptedConditions: false
}) })
} }
submit(){ submit(){
this.loading = true; 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 {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,firstName,lastName,gender,nationality,addressNumber,street,zipCode,city,personalPhone,parentsPhone,parentsEmail,school,grade,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber}; 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( this.personalDataService.edit(personalData).pipe(
tap(() => this.loading = false), tap(() => this.loading = false),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<h1>Mes données</h1> <h1>Mes données</h1>
<p><span class='label'>Prénom : </span>{{personalData.firstName}} </p> <p><span class='label'>Prénom : </span>{{personalData.firstName}} </p>
<p><span class='label'>Nom : </span>{{personalData.lastName}}</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> <p><span class='label'>Nationalité : </span>{{personalData.nationality}}</p>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<p> <span class='label'>Adresse : </span>{{personalData.addressNumber}} {{personalData.street}} {{personalData.zipCode}}, {{personalData.city}}</p> <p> <span class='label'>Adresse : </span>{{personalData.addressNumber}} {{personalData.street}} {{personalData.zipCode}}, {{personalData.city}}</p>
...@@ -13,13 +13,14 @@ ...@@ -13,13 +13,14 @@
<mat-divider></mat-divider> <mat-divider></mat-divider>
<p><span class='label'>Etablissement : </span>{{personalData.school}}</p> <p><span class='label'>Etablissement : </span>{{personalData.school}}</p>
<p><span class='label'>Classe : </span>{{grade[personalData.grade]}}</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'>Enseignement de spécialité : </span>{{personalData.specialTeaching}}</p>
<p><span class='label'>Boursier : </span>{{scholarship[personalData.scholarship]}}</p> <p><span class='label'>Boursier : </span>{{scholarship[personalData.scholarship]}}</p>
<mat-divider></mat-divider> <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'>Activité de la mère : </span>{{personalData.motherActivity}}</p>
<p><span class='label'>Statut des parents : </span>{{status[personalData.parentsStatus]}}</p> <p><span class='label'>Statut des parents : </span>{{personalData.parentsStatus}}</p>
<p><span class='label'>Nombre de personnes à charge : </span>{{personalData.dependantsNumber}}</p> <p><span class='label'>Nombre de personnes à charge : </span>{{personalData.dependantsNumber}}</p>
<div class="text-center"> <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> <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>
......
...@@ -12,11 +12,7 @@ export class MyDataComponent implements OnInit { ...@@ -12,11 +12,7 @@ export class MyDataComponent implements OnInit {
personalData: PersonalData; personalData: PersonalData;
public gender= {
"man":"Homme",
"woman":"Femme",
"other":"Autre"
}
public grade = { public grade = {
"troisieme": "Troisième", "troisieme": "Troisième",
"seconde":"Seconde", "seconde":"Seconde",
...@@ -25,34 +21,19 @@ export class MyDataComponent implements OnInit { ...@@ -25,34 +21,19 @@ export class MyDataComponent implements OnInit {
} }
public scholarship = { public scholarship = {
"echelon0": "Oui, échelon 0",
"echelon1": "Oui, échelon 1", "echelon1": "Oui, échelon 1",
"echelon2": "Oui, échelon 2", "echelon2": "Oui, échelon 2",
"echelon3": "Oui, échelon 3", "echelon3": "Oui, échelon 3",
"echelon4": "Oui, échelon 4", "echelon4": "Oui, échelon 4",
"echelon5": "Oui, échelon 5", "echelon5": "Oui, échelon 5",
"echelon6": "Oui, échelon 6", "echelon6": "Oui, échelon 6",
"echelon7": "Oui, échelon 7",
"no" : "Non" "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)=> { public editData = (e)=> {
this.router.navigate(['./membres/compte/modifier_donnees']) this.router.navigate(['./membres/compte/modifier_donnees'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment