Commit 509129bc authored by Antonin COQUET's avatar Antonin COQUET Committed by Hugo SUBTIL
Browse files

feat(structure-form): add remote accompaniment step

parent c54587c3
......@@ -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>
......
......@@ -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;
}
......
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,
}
......@@ -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[] = [];
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment