From 0329e7597540cffe1c4057ccb46c79bf2905a308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Gu=C3=A9don?= <arthur.guedon@student-cs.fr> Date: Wed, 26 Aug 2020 17:01:44 +0200 Subject: [PATCH] =?UTF-8?q?modifie=20le=20form=20pour=20inclure=20la=20nat?= =?UTF-8?q?ionalit=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 15 ++++ package.json | 1 + .../members/account/account-routing.module.ts | 5 ++ src/app/members/account/account.component.ts | 1 + src/app/members/account/account.module.ts | 19 ++++- .../account/core/personnal-data.model.ts | 3 + .../edit-data/edit-data.component.html | 3 + .../account/edit-data/edit-data.component.ts | 6 +- .../account/my-data/my-data.component.html | 1 + .../account/my-data/my-data.component.ts | 1 + .../account/my-file/my-file.component.html | 8 ++ .../account/my-file/my-file.component.scss | 0 .../account/my-file/my-file.component.ts | 20 +++++ .../members/account/my-file/my-file.module.ts | 13 +++ .../upload/dialog/dialog.component.html | 48 +++++++++++ .../upload/dialog/dialog.component.scss | 17 ++++ .../account/upload/dialog/dialog.component.ts | 84 +++++++++++++++++++ .../account/upload/upload.component.html | 4 + .../account/upload/upload.component.scss | 0 .../account/upload/upload.component.ts | 32 +++++++ .../members/account/upload/upload.module.ts | 33 ++++++++ .../account/upload/upload.service.spec.ts | 15 ++++ .../members/account/upload/upload.service.ts | 64 ++++++++++++++ .../student-signup.component.html | 7 +- .../student-signup.component.ts | 20 ++--- tsconfig.json | 4 +- 26 files changed, 406 insertions(+), 18 deletions(-) create mode 100644 src/app/members/account/my-file/my-file.component.html create mode 100644 src/app/members/account/my-file/my-file.component.scss create mode 100644 src/app/members/account/my-file/my-file.component.ts create mode 100644 src/app/members/account/my-file/my-file.module.ts create mode 100644 src/app/members/account/upload/dialog/dialog.component.html create mode 100644 src/app/members/account/upload/dialog/dialog.component.scss create mode 100644 src/app/members/account/upload/dialog/dialog.component.ts create mode 100644 src/app/members/account/upload/upload.component.html create mode 100644 src/app/members/account/upload/upload.component.scss create mode 100644 src/app/members/account/upload/upload.component.ts create mode 100644 src/app/members/account/upload/upload.module.ts create mode 100644 src/app/members/account/upload/upload.service.spec.ts create mode 100644 src/app/members/account/upload/upload.service.ts diff --git a/package-lock.json b/package-lock.json index 9ba8779..37449d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -336,6 +336,21 @@ "tslib": "^1.9.0" } }, + "@angular/flex-layout": { + "version": "10.0.0-beta.32", + "resolved": "https://registry.npmjs.org/@angular/flex-layout/-/flex-layout-10.0.0-beta.32.tgz", + "integrity": "sha512-JvuY4dUoy5jyCTIrFiq7n30Znakh1pD3nbg0h0hs2r3t1OiDQb0ZSI1wcumosG/vYHsuJQTuNhbfaIZzA1x8nA==", + "requires": { + "tslib": "^2.0.0" + }, + "dependencies": { + "tslib": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.0.tgz", + "integrity": "sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==" + } + } + }, "@angular/forms": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-6.0.4.tgz", diff --git a/package.json b/package.json index 7891f20..250e466 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@angular/compiler": "6.0.4", "@angular/compiler-cli": "6.0.4", "@angular/core": "6.0.4", + "@angular/flex-layout": "^10.0.0-beta.32", "@angular/forms": "6.0.4", "@angular/http": "6.0.4", "@angular/material": "^6.2.1", diff --git a/src/app/members/account/account-routing.module.ts b/src/app/members/account/account-routing.module.ts index e333e17..3ef262c 100644 --- a/src/app/members/account/account-routing.module.ts +++ b/src/app/members/account/account-routing.module.ts @@ -4,6 +4,7 @@ import { RouterModule, Routes } from '@angular/router'; import { AccountComponent } from './account.component'; import {MyDataComponent} from './my-data/my-data.component' import {EditDataComponent} from './edit-data/edit-data.component' +import {MyFileComponent} from './my-file/my-file.component' import { PersonnalDataResolver } from './core' @@ -28,6 +29,10 @@ const routes: Routes = [ // }, }, + { + path: 'mon_dossier', component: MyFileComponent, + + } ], }, ]; diff --git a/src/app/members/account/account.component.ts b/src/app/members/account/account.component.ts index 9955689..2c1e671 100644 --- a/src/app/members/account/account.component.ts +++ b/src/app/members/account/account.component.ts @@ -14,6 +14,7 @@ export class AccountComponent implements OnInit { navLinks: Link[] = [ { href: './donnees', text: 'Mes données' }, { href: './modifier_donnees', text: 'Modifier mes données' }, + { href: './mon_dossier', text: 'Mon dossier' }, ]; ngOnInit() { diff --git a/src/app/members/account/account.module.ts b/src/app/members/account/account.module.ts index 0dbb10a..8b44825 100644 --- a/src/app/members/account/account.module.ts +++ b/src/app/members/account/account.module.ts @@ -22,13 +22,19 @@ import { MatSlideToggleModule, MatTableModule, MatDividerModule, + MatProgressBarModule, + MatDialogModule, + MatListModule, + } from '@angular/material'; // Components import {AccountComponent} from './account.component' import {MyDataComponent} from './my-data/my-data.component' import {EditDataComponent} from './edit-data/edit-data.component' - +import {MyFileComponent} from './my-file/my-file.component' +import {UploadComponent} from './upload/upload.component' +import { DialogComponent } from './upload/dialog/dialog.component'; @NgModule({ imports: [ CommonModule, @@ -51,11 +57,20 @@ import {EditDataComponent} from './edit-data/edit-data.component' MatSlideToggleModule, MatTableModule, MatDividerModule, + MatProgressBarModule, + MatButtonModule, + MatDialogModule, + MatListModule, + ], declarations: [ AccountComponent, MyDataComponent, - EditDataComponent + EditDataComponent, + MyFileComponent, + UploadComponent, + DialogComponent ], + entryComponents:[DialogComponent] }) export class AccountModule { } diff --git a/src/app/members/account/core/personnal-data.model.ts b/src/app/members/account/core/personnal-data.model.ts index 5657dfa..1772e43 100644 --- a/src/app/members/account/core/personnal-data.model.ts +++ b/src/app/members/account/core/personnal-data.model.ts @@ -9,6 +9,7 @@ export class PersonnalDataSchema { firstName:string; lastName: string; gender: string; + nationality: string; adressNumber:string; street:string; zipCode:string; @@ -46,6 +47,7 @@ export class PersonnalDataAdapter implements IAdapter<PersonnalData> { firstName: data.firstName, lastName: data.lastName, gender: data.gender, + nationality : data.nationality, adressNumber: data.adressNumber, street:data.street, zipCode:data.zipCode, @@ -68,6 +70,7 @@ export class PersonnalDataAdapter implements IAdapter<PersonnalData> { encode(obj: PersonnalData): any { return { gender: obj.gender, + nationality: obj.nationality, adressNumber: obj.adressNumber, street:obj.street, zipCode:obj.zipCode, 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 e1785e2..c845442 100644 --- a/src/app/members/account/edit-data/edit-data.component.html +++ b/src/app/members/account/edit-data/edit-data.component.html @@ -16,6 +16,9 @@ <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> <p class="text-center">Adresse</p> <div class="form-group"> <mat-form-field class="full-width adress-input quarter-display"> 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 d79d66a..208d6f0 100644 --- a/src/app/members/account/edit-data/edit-data.component.ts +++ b/src/app/members/account/edit-data/edit-data.component.ts @@ -70,6 +70,7 @@ export class EditDataComponent implements OnInit { firstName:"Exemple", lastName: "Exemple", gender: "man", + nationality: "Française", adressNumber:"25", street:"avenue exemple", zipCode:"99 999", @@ -97,6 +98,7 @@ export class EditDataComponent implements OnInit { firstName:this.personnalData.firstName, lastName:this.personnalData.lastName, gender:this.personnalData.gender, + nationality : this.personnalData.nationality, adressNumber:this.personnalData.adressNumber, street:this.personnalData.street, zipCode:this.personnalData.zipCode, @@ -119,8 +121,8 @@ export class EditDataComponent implements OnInit { submit(){ //this.loading = true; - const {firstName,lastName,gender,adressNumber,street,zipCode,city,personnalPhone,parentsPhone,parentsEmail,school,grade,section,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber} = this.formGroup.value; - const personnalData: PersonnalData = {user:this.personnalData.user,firstName,lastName,gender,adressNumber,street,zipCode,city,personnalPhone,parentsPhone,parentsEmail,school,grade,section,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber}; + const {firstName,lastName,gender,nationality,adressNumber,street,zipCode,city,personnalPhone,parentsPhone,parentsEmail,school,grade,section,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber} = this.formGroup.value; + const personnalData: PersonnalData = {user:this.personnalData.user,firstName,lastName,gender,nationality,adressNumber,street,zipCode,city,personnalPhone,parentsPhone,parentsEmail,school,grade,section,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber}; console.log("data",personnalData) //La partie commentée sera à rajouter lors de la connexion au back 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 2abea25..2472ea4 100644 --- a/src/app/members/account/my-data/my-data.component.html +++ b/src/app/members/account/my-data/my-data.component.html @@ -3,6 +3,7 @@ <p><span class='label'>Prénom : </span>{{personnalData.firstName}} </p> <p><span class='label'>Nom : </span>{{personnalData.lastName}}</p> <p><span class='label'>Sexe : </span>{{gender[personnalData.gender]}}</p> + <p><span class='label'>Nationalité : </span>{{personnalData.nationality}}</p> <mat-divider></mat-divider> <p> <span class='label'>Adresse : </span>{{personnalData.adressNumber}} {{personnalData.street}} {{personnalData.zipCode}}, {{personnalData.city}}</p> <mat-divider></mat-divider> 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 cb08925..8caa539 100644 --- a/src/app/members/account/my-data/my-data.component.ts +++ b/src/app/members/account/my-data/my-data.component.ts @@ -62,6 +62,7 @@ export class MyDataComponent implements OnInit { firstName:"Exemple", lastName:"Exemple", gender: "man", + nationality:"Française", adressNumber:"25", street:"avenue exemple", zipCode:"99 999", diff --git a/src/app/members/account/my-file/my-file.component.html b/src/app/members/account/my-file/my-file.component.html new file mode 100644 index 0000000..df34468 --- /dev/null +++ b/src/app/members/account/my-file/my-file.component.html @@ -0,0 +1,8 @@ +<app-form-page> + <h1>Mon dossier</h1> + <app-upload-file></app-upload-file> +</app-form-page> +<messages></messages> +<router-outlet></router-outlet> + + \ No newline at end of file diff --git a/src/app/members/account/my-file/my-file.component.scss b/src/app/members/account/my-file/my-file.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/members/account/my-file/my-file.component.ts b/src/app/members/account/my-file/my-file.component.ts new file mode 100644 index 0000000..aad5224 --- /dev/null +++ b/src/app/members/account/my-file/my-file.component.ts @@ -0,0 +1,20 @@ +import { Component, OnInit } from '@angular/core'; +import {ActivatedRoute} from '@angular/router' +import {UploadComponent} from '../upload/upload.component' +import {PersonnalData} from '../core' +@Component({ + selector: 'app-my-file', + templateUrl: './my-file.component.html', + styleUrls: ['./my-file.component.scss'] +}) +export class MyFileComponent implements OnInit { + + + + constructor(private route: ActivatedRoute) { } + + ngOnInit() { + + +} +} diff --git a/src/app/members/account/my-file/my-file.module.ts b/src/app/members/account/my-file/my-file.module.ts new file mode 100644 index 0000000..9c7cd71 --- /dev/null +++ b/src/app/members/account/my-file/my-file.module.ts @@ -0,0 +1,13 @@ +import { NgModule } from '@angular/core' +import { CommonModule } from '@angular/common' +import { UploadModule } from '../upload/upload.module' +import {UploadComponent} from '../upload/upload.component' +import {MyFileComponent} from './my-file.component' + +@NgModule({ + imports : [UploadModule], + declarations: [MyFileComponent,UploadModule], + entryComponents:[UploadComponent] + +}) +export class MyFileModule {} \ No newline at end of file diff --git a/src/app/members/account/upload/dialog/dialog.component.html b/src/app/members/account/upload/dialog/dialog.component.html new file mode 100644 index 0000000..f3d15c7 --- /dev/null +++ b/src/app/members/account/upload/dialog/dialog.component.html @@ -0,0 +1,48 @@ +<input + type="file" + #file + style="display: none" + (change)="onFilesAdded()" + single +/> +<div class="container" fxLayout="column" fxLayoutAlign="space-evenly stretch"> + <h1 mat-dialog-title>Déposer un fichier</h1> + <div> + <button + [disabled]="uploading || uploadSuccessful" + mat-raised-button + color="primary" + class="add-files-btn" + (click)="addFiles()" + > + Ajouter un fichier + </button> + </div> + + <!-- This is the content of the dialog, containing a list of the files to upload --> + <mat-dialog-content fxFlex> + <mat-list> + <mat-list-item *ngFor="let file of files"> + <h4 mat-line>{{file.name}}</h4> + <mat-progress-bar + *ngIf="progress" + mode="determinate" + [value]="progress[file.name].progress | async" + ></mat-progress-bar> + </mat-list-item> + </mat-list> + </mat-dialog-content> + + <!-- This are the actions of the dialog, containing the primary and the cancel button--> + <mat-dialog-actions class="actions"> + <button *ngIf="showCancelButton" mat-button mat-dialog-close>Annuler</button> + <button + mat-raised-button + color="primary" + [disabled]="!canBeClosed" + (click)="closeDialog()" + > + {{primaryButtonText}} + </button> + </mat-dialog-actions> +</div> \ No newline at end of file diff --git a/src/app/members/account/upload/dialog/dialog.component.scss b/src/app/members/account/upload/dialog/dialog.component.scss new file mode 100644 index 0000000..88e5de7 --- /dev/null +++ b/src/app/members/account/upload/dialog/dialog.component.scss @@ -0,0 +1,17 @@ + + + :host { + height: 100%; + display: flex; + flex: 1; + flex-direction: column; + } + + .actions { + justify-content: flex-end; + float:bottom; + } + + .container { + height: 100%; + } \ No newline at end of file diff --git a/src/app/members/account/upload/dialog/dialog.component.ts b/src/app/members/account/upload/dialog/dialog.component.ts new file mode 100644 index 0000000..0815eb8 --- /dev/null +++ b/src/app/members/account/upload/dialog/dialog.component.ts @@ -0,0 +1,84 @@ +import { Component, OnInit, ViewChild } from '@angular/core' +import { MatDialogRef } from '@angular/material' +import { UploadService } from '../upload.service' +import { forkJoin } from 'rxjs' + +@Component({ + selector: 'app-dialog', + templateUrl: './dialog.component.html', + styleUrls: ['./dialog.component.scss'], +}) + + + +export class DialogComponent { + @ViewChild('file') file + public files: Set<File> = new Set() + progress + canBeClosed = true + primaryButtonText = 'Envoyer' + showCancelButton = true + uploading = false + uploadSuccessful = false + + addFiles() { + this.file.nativeElement.click(); + } + + onFilesAdded() { + console.log(this.file.nativeElement.files) + const files: { [key: string]: File } = this.file.nativeElement.files; + for (let key in files) { + if (!isNaN(parseInt(key))) { + this.files.clear() + this.files.add(files[key]); + } + } + } + + closeDialog() { + // if everything was uploaded already, just close the dialog + if (this.uploadSuccessful) { + return this.dialogRef.close(); + } + + // set the component state to "uploading" + this.uploading = true; + + // start the upload and save the progress map + this.progress = this.uploadService.upload(this.files); + + // convert the progress map into an array + let allProgressObservables = []; + for (let key in this.progress) { + allProgressObservables.push(this.progress[key].progress); + } + + // Adjust the state variables + + // The OK-button should have the text "Finish" now + this.primaryButtonText = 'Terminer'; + + // The dialog should not be closed while uploading + this.canBeClosed = false; + this.dialogRef.disableClose = true; + + // Hide the cancel-button + this.showCancelButton = false; + + // When all progress-observables are completed... + forkJoin(allProgressObservables).subscribe(end => { + // ... the dialog can be closed again... + this.canBeClosed = true; + this.dialogRef.disableClose = false; + + // ... the upload was successful... + this.uploadSuccessful = true; + + // ... and the component is no longer uploading + this.uploading = false; + }); + } + + constructor(public dialogRef: MatDialogRef<DialogComponent>, public uploadService: UploadService) {} +} \ No newline at end of file diff --git a/src/app/members/account/upload/upload.component.html b/src/app/members/account/upload/upload.component.html new file mode 100644 index 0000000..6912015 --- /dev/null +++ b/src/app/members/account/upload/upload.component.html @@ -0,0 +1,4 @@ +<h3>Charte de l'éleve</h3><button mat-raised-button (click)="openStudentChartDialog()">Déposer le fichier</button> +<h3>Autorisation parentale</h3><button mat-raised-button (click)="openParentalAuthDialog()">Déposer le fichier</button> +<h3>Droit à l'image</h3><button mat-raised-button (click)="openImageRightsDialog()">Déposer le fichier</button> +<h3>Statut du dossier : </h3> \ No newline at end of file diff --git a/src/app/members/account/upload/upload.component.scss b/src/app/members/account/upload/upload.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/members/account/upload/upload.component.ts b/src/app/members/account/upload/upload.component.ts new file mode 100644 index 0000000..40da1f7 --- /dev/null +++ b/src/app/members/account/upload/upload.component.ts @@ -0,0 +1,32 @@ +import { Component } from '@angular/core' +import { MatDialog } from '@angular/material' +import { DialogComponent } from './dialog/dialog.component' +import { UploadService } from './upload.service' + +@Component({ + selector: 'app-upload-file', + templateUrl: './upload.component.html', + styleUrls: ['./upload.component.scss'], +}) +export class UploadComponent { + constructor(public dialog: MatDialog, public uploadService: UploadService) {} + + public openStudentChartDialog() { + let dialogRef = this.dialog.open(DialogComponent, { + width: '50%', + height: '50%', + }) + } + public openParentalAuthDialog() { + let dialogRef = this.dialog.open(DialogComponent, { + width: '50%', + height: '50%', + }) + } + public openImageRightsDialog() { + let dialogRef = this.dialog.open(DialogComponent, { + width: '50%', + height: '50%', + }) + } +} \ No newline at end of file diff --git a/src/app/members/account/upload/upload.module.ts b/src/app/members/account/upload/upload.module.ts new file mode 100644 index 0000000..50a8f2f --- /dev/null +++ b/src/app/members/account/upload/upload.module.ts @@ -0,0 +1,33 @@ +import { NgModule } from '@angular/core' +import { CommonModule } from '@angular/common' +import { UploadComponent } from './upload.component' +import { DialogComponent } from './dialog/dialog.component' +import { + MatButtonModule, + MatDialogModule, + MatListModule, + MatProgressBarModule, +} from '@angular/material' + +import { BrowserAnimationsModule } from '@angular/platform-browser/animations' +import { FlexLayoutModule } from '@angular/flex-layout' +import { UploadService } from './upload.service' +import { HttpClientModule } from '@angular/common/http' + +@NgModule({ + imports: [ + CommonModule, + MatButtonModule, + MatDialogModule, + MatListModule, + FlexLayoutModule, + HttpClientModule, + BrowserAnimationsModule, + MatProgressBarModule, + ], + declarations: [UploadComponent, DialogComponent], + exports: [UploadComponent], + providers: [UploadService], + entryComponents : [DialogComponent] +}) +export class UploadModule {} \ No newline at end of file diff --git a/src/app/members/account/upload/upload.service.spec.ts b/src/app/members/account/upload/upload.service.spec.ts new file mode 100644 index 0000000..c5718b0 --- /dev/null +++ b/src/app/members/account/upload/upload.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { UploadService } from './upload.service'; + +describe('UploadService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [UploadService] + }); + }); + + it('should be created', inject([UploadService], (service: UploadService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/src/app/members/account/upload/upload.service.ts b/src/app/members/account/upload/upload.service.ts new file mode 100644 index 0000000..c768746 --- /dev/null +++ b/src/app/members/account/upload/upload.service.ts @@ -0,0 +1,64 @@ +import { Injectable } from '@angular/core' +import { + HttpClient, + HttpRequest, + HttpEventType, + HttpResponse, +} from '@angular/common/http' +import { Observable,Subject } from 'rxjs' + +const url = 'http://localhost:8000/upload' //to change + +@Injectable({ + providedIn: 'root' +}) +export class UploadService { + constructor(private http: HttpClient) {} + + public upload( + files: Set<File> + ): { [key: string]: { progress: Observable<number> } } { + // this will be the our resulting map + const status: { [key: string]: { progress: Observable<number> } } = {}; + + files.forEach(file => { + // create a new multipart-form for every file + const formData: FormData = new FormData(); + formData.append('file', file, file.name); + + // create a http-post request and pass the form + // tell it to report the upload progress + const req = new HttpRequest('POST', url, formData, { + reportProgress: true + }); + + // create a new progress-subject for every file + const progress = new Subject<number>(); + + // send the http-request and subscribe for progress-updates + this.http.request(req).subscribe(event => { + if (event.type === HttpEventType.UploadProgress) { + + // calculate the progress percentage + const percentDone = Math.round(100 * event.loaded / event.total); + + // pass the percentage into the progress-stream + progress.next(percentDone); + } else if (event instanceof HttpResponse) { + + // Close the progress-stream if we get an answer form the API + // The upload is complete + progress.complete(); + } + }); + + // Save every progress-observable in a map of all observables + status[file.name] = { + progress: progress.asObservable() + }; + }); + + // return the map of progress.observables + return status; + } +} \ No newline at end of file diff --git a/src/app/signup/student-signup/student-signup.component.html b/src/app/signup/student-signup/student-signup.component.html index b1ce9b1..32b5c49 100644 --- a/src/app/signup/student-signup/student-signup.component.html +++ b/src/app/signup/student-signup/student-signup.component.html @@ -34,7 +34,8 @@ </mat-form-field> - +<!-- + Cette zone permet de saisir les données personnelles lors de l'inscription <p> <small> Données personnelles : nous utiliserons les données fournies pour assurer le contact avec toi et ta famille, @@ -178,13 +179,13 @@ </ng-container> - + --> <p> Il ne te reste plus qu'à choisir un mot de passe. :-) </p> - + <!-- Password --> <mat-form-field class="full-width"> <input matInput type="password" formControlName="password" placeholder="Mot de passe" required> diff --git a/src/app/signup/student-signup/student-signup.component.ts b/src/app/signup/student-signup/student-signup.component.ts index 62966ba..a07350b 100644 --- a/src/app/signup/student-signup/student-signup.component.ts +++ b/src/app/signup/student-signup/student-signup.component.ts @@ -111,10 +111,10 @@ export class StudentSignupComponent implements OnInit { submit() { this.loading = true; const {email,firstName,lastName,phoneNumber} = this.formGroup.value - const {gender,adressNumber,street,zipCode,city,personnalPhone,parentsPhone,parentsEmail,school,grade,section,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber} = this.formGroup.value; + //const {gender,adressNumber,street,zipCode,city,personnalPhone,parentsPhone,parentsEmail,school,grade,section,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber} = this.formGroup.value; const registration: Registration = {email,firstName,lastName,phoneNumber}; - const personnalData: PersonnalData = {gender,adressNumber,street,zipCode,city,personnalPhone,parentsPhone,parentsEmail,school,grade,section,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber}; - console.log(registration) + // const personnalData: PersonnalData = {gender,adressNumber,street,zipCode,city,personnalPhone,parentsPhone,parentsEmail,school,grade,section,specialTeaching,scholarship,fatherActivity,motherActivity,parentsStatus,dependantsNumber}; + const password: string = this.formGroup.controls.password.value; this.registrationService.create(registration, password).pipe( mergeMap(() => this.auth.login(registration.email, password)), @@ -128,12 +128,12 @@ export class StudentSignupComponent implements OnInit { () => {}, (error) => this.loading = false, ); - this.personnalDataService.create(personnalData).pipe( - tap(() => this.loading = false), - tap(() => this.router.navigate(['/'])), - ).subscribe( - () => {}, - (error) => this.loading = false, - ); + // this.personnalDataService.create(personnalData).pipe( + // tap(() => this.loading = false), + // tap(() => this.router.navigate(['/'])), + // ).subscribe( + // () => {}, + // (error) => this.loading = false, + // ); } } diff --git a/tsconfig.json b/tsconfig.json index a35a8ee..4dfbe28 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compileOnSave": false, "compilerOptions": { + "outDir": "./dist/out-tsc", "baseUrl": "src", "sourceMap": true, @@ -15,6 +16,7 @@ "lib": [ "es2016", "dom" - ] + ], + "skipLibCheck": true } } -- GitLab