diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index f50fc2e17f63602f99e22f202270161be342aa1a..279e2672ad9c9754e53914fa04130d5dc3d0c24d 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -1041,7 +1041,7 @@ </div> <div *ngIf="currentPage == pageTypeEnum.structureCovidInfo" class="page"> <div class="title"> - <h3>Y a-t-il des informations spécifique à la période COVID ?</h3> + <h3>Y a-t-il des informations spécifiques à la période COVID ?</h3> <p class="notRequired">facultatif</p> </div> <div class="textareaBlock" fxLayout="column"> diff --git a/src/app/form/form.component.ts b/src/app/form/form.component.ts index f98e30a38f5acfe3a8516543ae8a0fed2b2db6cc..9d4d64af46594d25e841dc1b1a18c84e368e11ac 100644 --- a/src/app/form/form.component.ts +++ b/src/app/form/form.component.ts @@ -49,7 +49,7 @@ export class FormComponent implements OnInit { // Page and progress var public currentPage = 0; public progressStatus = 0; - public nbPagesForm = 24; + public nbPagesForm = 23; public isPageValid: boolean; public pagesValidation = []; @@ -280,7 +280,7 @@ export class FormComponent implements OnInit { Validators.required, Validators.pattern(CustomRegExp.NO_NULL_NUMBER), ]), - freeWorkShop: new FormControl(structure.freeWorkShop, Validators.required), + freeWorkShop: new FormControl(structure.freeWorkShop), }); return form; } @@ -684,6 +684,22 @@ export class FormComponent implements OnInit { this.currentPage++; // page structureOtherAccompaniment skip and go to page structureWorkshop this.progressStatus += 100 / this.nbPagesForm; } + + if (this.currentPage == PageTypeEnum.structureWorkshop) { + //console.log('procedure:', this.proceduresAccompaniment.); + // console.log('public:', this..modules); + if ( + !this.structureForm.get('baseSkills').value.length && + !this.structureForm.get('accessRight').value.length && + !this.structureForm.get('parentingHelp').value.length && + !this.structureForm.get('socialAndProfessional').value.length && + !this.structureForm.get('digitalCultureSecurity').value.length + ) { + this.getStructureControl('freeWorkShop').reset(); + this.currentPage++; + this.progressStatus += 100 / this.nbPagesForm; + } + } // Check if going to the last page to submit form and send email verification. if (this.currentPage == this.nbPagesForm - 1) { this.validateForm(); @@ -711,6 +727,20 @@ export class FormComponent implements OnInit { this.currentPage--; // page 14 skip and go to page 13 this.progressStatus -= 100 / this.nbPagesForm; } + if (this.currentPage == PageTypeEnum.structureWifi) { + //console.log('procedure:', this.proceduresAccompaniment.); + // console.log('public:', this..modules); + if ( + !this.structureForm.get('baseSkills').value.length && + !this.structureForm.get('accessRight').value.length && + !this.structureForm.get('parentingHelp').value.length && + !this.structureForm.get('socialAndProfessional').value.length && + !this.structureForm.get('digitalCultureSecurity').value.length + ) { + this.currentPage--; + this.progressStatus -= 100 / this.nbPagesForm; + } + } this.currentPage--; this.progressStatus -= 100 / this.nbPagesForm; this.updatePageValid(); diff --git a/src/app/form/pageType.enum.ts b/src/app/form/pageType.enum.ts index fbe238d634b20727dca17f593aaa99a97bb28dfc..708f64b1567e7cc326df1f3e5e85168950bb1ce5 100644 --- a/src/app/form/pageType.enum.ts +++ b/src/app/form/pageType.enum.ts @@ -18,7 +18,7 @@ export enum PageTypeEnum { structureWifi = 16, structureEquipments = 17, structureLabels = 18, - structureOtherServices = 29, + structureOtherServices = 19, structureDescription = 20, structureCovidInfo = 21, cgu = 22,