Skip to content
Snippets Groups Projects
Commit b1d1ec36 authored by Antonin COQUET's avatar Antonin COQUET
Browse files

feat: remove workshop price if no workshop

parent 88216e5f
No related branches found
No related tags found
3 merge requests!178release V1.10.0,!135Dev,!128Feat/formulaire feedback
......@@ -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">
......
......@@ -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();
......
......@@ -18,7 +18,7 @@ export enum PageTypeEnum {
structureWifi = 16,
structureEquipments = 17,
structureLabels = 18,
structureOtherServices = 29,
structureOtherServices = 19,
structureDescription = 20,
structureCovidInfo = 21,
cgu = 22,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment