diff --git a/package-lock.json b/package-lock.json index 9ba8779d9d0d7875e92167fa3fb0979661f8398e..37449d1a61b2fcd91eb2b5bb2d43b507c7775cb7 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 7891f206e7c2131007ac0226e6b59b965660a2a1..250e466d6e051fbc391cdcf494ee6345e77cd52f 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 e333e17598739d2590e04475a25c2e0c8e7e90fd..3ef262c0deeee4e5fca87c1cf66a6266c4f9683a 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 9955689b95291c8856e1881d40608e0c0e77a98f..2c1e6716a34053b823fee5a3d6953167b5aea29b 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 0dbb10aed37bd0a4ff98a4232f751ae7135b7118..8b448259b93d0fe74a1c42b47b34e2daeb550c9a 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 5657dfa5affb6a043f92459ddc65a0965c2ade21..1772e4390b554ea4adbc492a61b87d98ca21a084 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 e1785e27cf69176ff38e6b9082e37f4518196b81..c8454422f5772ee3bd79bf9bc64302b48d5194ef 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 d79d66ac853312ad54e8320fb3ca46b8c9ed9ae1..208d6f07ffd19b7c14f01d6f8777848c34cf5a55 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 2abea25cf4038c6370ef3301505bdce38ea04301..2472ea48043e23ff72e00010e1e1519b454dbd2d 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 cb08925ce5b3db29731f903e7f852f89fbfd775a..8caa539957e524559b89c52508a902e565975af6 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 0000000000000000000000000000000000000000..df34468e7b5f934ba219daf392d08b4729539521 --- /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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 0000000000000000000000000000000000000000..aad52249c627fa53b776ebd78378ece794c5f6c5 --- /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 0000000000000000000000000000000000000000..9c7cd719bbde4a1e940e792cb8155e66b5fb9f24 --- /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 0000000000000000000000000000000000000000..f3d15c7f6d75d357b94c75211485405f1a2d192b --- /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 0000000000000000000000000000000000000000..88e5de70b6d2237538270ce9b56cbd78d2ac5f6a --- /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 0000000000000000000000000000000000000000..0815eb8ee2b37f9623583bf614806e4306b9becd --- /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 0000000000000000000000000000000000000000..69120155c9f3ed37fb033da0ca8f5eb99b0ff4b7 --- /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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 0000000000000000000000000000000000000000..40da1f749c05caf6fc2556b66f4d7d8e5e0b5832 --- /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 0000000000000000000000000000000000000000..50a8f2f659fba6c0e1c88af7cb58ac3dce5952b0 --- /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 0000000000000000000000000000000000000000..c5718b07fe80fdb312fd6bd683a00cd2eef63c00 --- /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 0000000000000000000000000000000000000000..c7687462f94b842cadeb016795ae596344e8c03b --- /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 b1ce9b1b06623b8a6f9ff8b2f030527cd251714a..32b5c4905e20aebad461352a24808f64e1ec6710 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 62966ba8a2caecae924d4395dc4baceaa0ba35d0..a07350b4b48ac2c3ac3732fd816c3e5e1d8e8ad0 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 a35a8ee3a40d4326972a6d31edf57a9bce437520..4dfbe28709a954d6809235ff44ac0a763faa36c7 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 } }