diff --git a/src/app/form/form.component.html b/src/app/form/form.component.html index 635b6f601f9b9e91517da5602a095874dd718d90..455d10040dc4795f1d331caa5c9e63199f6c9677 100644 --- a/src/app/form/form.component.html +++ b/src/app/form/form.component.html @@ -770,6 +770,16 @@ </p> </div> </div> + <div *ngIf="currentPage == pageTypeEnum.structureRemoteAccompaniment" class="page"> + <div class="title"> + <h3>Proposez vous un accompagnement à distance ?</h3> + </div> + <app-radio-form + [selectedOption]="getStructureControl('remoteAccompaniment').value" + (selectedEvent)="onRadioBtnChange('remoteAccompaniment', $event)" + > + </app-radio-form> + </div> <div *ngIf="currentPage == pageTypeEnum.structureWorkshop" class="page"> <div class="title"> <h3>Quel(s) atelier(s) au numérique proposez-vous ?</h3> diff --git a/src/app/form/form.component.ts b/src/app/form/form.component.ts index a54e3282a431e9ee4aa63550e3a4779d38c1fe81..21276568cf1007fa76bf05a90e5a75fbf0785d76 100644 --- a/src/app/form/form.component.ts +++ b/src/app/form/form.component.ts @@ -48,7 +48,7 @@ export class FormComponent implements OnInit { // Page and progress var public currentPage = 0; // Change this value to start on a different page for dev testing public progressStatus = 0; - public nbPagesForm = 23; + public nbPagesForm = 24; public isPageValid: boolean; public pagesValidation = []; @@ -248,7 +248,7 @@ export class FormComponent implements OnInit { } private createStructureForm(structure): FormGroup { - const form = new FormGroup({ + return new FormGroup({ _id: new FormControl(structure._id), coord: new FormControl(structure.coord), structureType: new FormControl(structure.structureType, Validators.required), @@ -280,6 +280,7 @@ export class FormComponent implements OnInit { accessModality: this.loadArrayForCheckbox(structure.accessModality, true), publicsAccompaniment: this.loadArrayForCheckbox(structure.publicsAccompaniment, false), proceduresAccompaniment: this.loadArrayForCheckbox(structure.proceduresAccompaniment, false), + remoteAccompaniment: new FormControl(structure.remoteAccompaniment, Validators.required), otherDescription: new FormControl(structure.otherDescription), equipmentsAndServices: this.loadArrayForCheckbox(structure.equipmentsAndServices, false), publics: this.loadArrayForCheckbox(structure.publics, true), @@ -310,7 +311,6 @@ export class FormComponent implements OnInit { ]), freeWorkShop: new FormControl(structure.freeWorkShop, [Validators.required]), }); - return form; } private showCollapse(s: Structure): void { @@ -544,6 +544,10 @@ export class FormComponent implements OnInit { valid: this.getStructureControl('otherDescription').value, name: 'Autres démarches proposés', }; + this.pagesValidation[PageTypeEnum.structureRemoteAccompaniment] = { + valid: this.getStructureControl('remoteAccompaniment').valid, + name: 'Accompagnement à distance', + }; this.pagesValidation[PageTypeEnum.structureWorkshop] = { valid: this.getStructureControl('accessRight').valid && @@ -750,7 +754,10 @@ export class FormComponent implements OnInit { } // Check if "other" isn't check to hide "other description" page - if (this.currentPage === PageTypeEnum.structureWorkshop && !this.isInArray('autres', 'proceduresAccompaniment')) { + if ( + this.currentPage === PageTypeEnum.structureRemoteAccompaniment && + !this.isInArray('autres', 'proceduresAccompaniment') + ) { this.currentPage--; // page 14 skip and go to page 13 this.progressStatus -= 100 / this.nbPagesForm; } diff --git a/src/app/form/pageType.enum.ts b/src/app/form/pageType.enum.ts index 708f64b1567e7cc326df1f3e5e85168950bb1ce5..7ce4cd6321a73c20f17df2f2f829645198c1bf37 100644 --- a/src/app/form/pageType.enum.ts +++ b/src/app/form/pageType.enum.ts @@ -1,25 +1,26 @@ export enum PageTypeEnum { - summary = 0, - info = 1, - accountInfo = 2, - accountCredentials = 3, - structureNameAndAddress = 4, - structurePhone = 5, - structureType = 6, - structureAccessModality = 7, - structureHours = 8, - structurePmr = 9, - structureWebAndSocialNetwork = 10, - structurePublicTarget = 11, - structureAccompaniment = 12, - structureOtherAccompaniment = 13, - structureWorkshop = 14, - structureWorkshopPrice = 15, - structureWifi = 16, - structureEquipments = 17, - structureLabels = 18, - structureOtherServices = 19, - structureDescription = 20, - structureCovidInfo = 21, - cgu = 22, + summary, + info, + accountInfo, + accountCredentials, + structureNameAndAddress, + structurePhone, + structureType, + structureAccessModality, + structureHours, + structurePmr, + structureWebAndSocialNetwork, + structurePublicTarget, + structureAccompaniment, + structureOtherAccompaniment, + structureRemoteAccompaniment, + structureWorkshop, + structureWorkshopPrice, + structureWifi, + structureEquipments, + structureLabels, + structureOtherServices, + structureDescription, + structureCovidInfo, + cgu, } diff --git a/src/app/models/structure.model.ts b/src/app/models/structure.model.ts index 0aa47e7a14729dccd72daf7b5d8fd79698ab7263..5fe14f20be3ac59b3a6c832a445e531ad4ca2b69 100644 --- a/src/app/models/structure.model.ts +++ b/src/app/models/structure.model.ts @@ -25,6 +25,7 @@ export class Structure { public pmrAccess: boolean = null; public publicsAccompaniment: string[] = []; public proceduresAccompaniment: string[] = []; + public remoteAccompaniment: boolean = null; public accessModality: string[] = []; public labelsQualifications: string[] = []; public publics: string[] = []; diff --git a/src/app/structure-list/components/structure-details/structure-details.component.html b/src/app/structure-list/components/structure-details/structure-details.component.html index 49fff57c42763c015c843f3b7de7d3a6403d0b52..5d5fcd8d6e6826b2321aa1e3626dad73ff4bbe2d 100644 --- a/src/app/structure-list/components/structure-details/structure-details.component.html +++ b/src/app/structure-list/components/structure-details/structure-details.component.html @@ -167,7 +167,7 @@ </div> <!-- Accueil --> <div - *ngIf="structure.accessModality.length > 0 || structure.hours.hasData()" + *ngIf="structure.accessModality.length > 0 || structure.hours.hasData() || structure.remoteAccompaniment" fxLayout="column" class="structure-details-block" fxLayoutAlign="baseline baseline" @@ -230,6 +230,9 @@ <h3 class="subtitle">Précisions sur les horaires</h3> <p>{{ structure.exceptionalClosures }}</p> </div> + <div *ngIf="structure.remoteAccompaniment" class="bold-info"> + <h3>Cette structure propose un accompagnement à distance.</h3> + </div> </div> <!-- Démarches en ligne --> <div