diff --git a/src/app/form/form-view/form-view.component.ts b/src/app/form/form-view/form-view.component.ts index 49cecd5ea1f58864d554e0eec5125defe2a92636..41b2ad9ac36a14960c19dbf54f2b710351a947d1 100644 --- a/src/app/form/form-view/form-view.component.ts +++ b/src/app/form/form-view/form-view.component.ts @@ -447,6 +447,11 @@ export class FormViewComponent implements OnInit, AfterViewInit { return { categories: { age: this.structureForm.get('categories').get('age').value, + }, + }; + case structureFormStep.structurePublicTargetOptional: + return { + categories: { languageAndIlliteracy: this.structureForm.get('categories').get('languageAndIlliteracy').value, handicaps: this.structureForm.get('categories').get('handicaps').value, publicOthers: this.structureForm.get('categories').get('publicOthers').value, diff --git a/src/app/form/form-view/structure-form/structure-form.component.html b/src/app/form/form-view/structure-form/structure-form.component.html index aba2c1cf6f0f5bfa9f1074b961f03674ef0ba0bf..6fbba87db95c38950e0257788821c7381c2710df 100644 --- a/src/app/form/form-view/structure-form/structure-form.component.html +++ b/src/app/form/form-view/structure-form/structure-form.component.html @@ -113,9 +113,19 @@ [isEditMode]="isEditMode" [structureForm]="structureForm" [age]="age" + (validateForm)="setValidationsForm()" + (updateChoice)="updateChoice($event)" + > + </app-structure-public-target> + </div> + <div *ngIf="currentStep == structureFormStep.structurePublicTargetOptional"> + <app-structure-public-target + [isEditMode]="isEditMode" + [structureForm]="structureForm" [handicaps]="handicaps" [publicOthers]="publicOthers" [languageAndIlliteracy]="languageAndIlliteracy" + [isMandatoryFields]="false" (validateForm)="setValidationsForm()" (updateChoice)="updateChoice($event)" > diff --git a/src/app/form/form-view/structure-form/structure-form.component.ts b/src/app/form/form-view/structure-form/structure-form.component.ts index 3079d5194a1fbe12dd15e2dd128ddf63c0637b5c..5cdc8cba6a09dd1b0c14e1612c2eacd584a13220 100644 --- a/src/app/form/form-view/structure-form/structure-form.component.ts +++ b/src/app/form/form-view/structure-form/structure-form.component.ts @@ -68,6 +68,7 @@ export class StructureFormComponent implements OnChanges, OnInit { this.currentStep === structureFormStep.structureCreationFinishedInfo || this.currentStep === structureFormStep.structureHours || this.currentStep === structureFormStep.structureTrainingType || + this.currentStep === structureFormStep.structurePublicTargetOptional || this.currentStep === structureFormStep.structureEquipments || this.currentStep === structureFormStep.structureLabels || this.currentStep === structureFormStep.structureSolidarityMaterial || @@ -194,6 +195,9 @@ export class StructureFormComponent implements OnChanges, OnInit { this.pagesValidation[structureFormStep.structurePublicTarget] = { valid: this.structureForm.get('categories').get('age').valid, }; + this.pagesValidation[structureFormStep.structurePublicTargetOptional] = { + valid: true, + }; this.pagesValidation[structureFormStep.structureDigitalHelpingAccompanimentOther] = { valid: this.structureForm.get('otherDescription').valid, }; diff --git a/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.html b/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.html index 838a9d05a990c5af186974619f1ff6624d54619f..beaaccd1434998e66e284c883758a04406dd8901 100644 --- a/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.html +++ b/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.html @@ -8,74 +8,84 @@ [icon]="'arrowBack'" ></app-svg-icon> <div class="titleContent"> - <h3>Quel public peut être accueilli dans cette structure ?</h3> - <p>Plusieurs choix possibles</p> + <h3> + {{ + isMandatoryFields + ? 'Quel public peut être accueilli dans cette structure ?' + : 'Quels publics spécifiques peuvent être accueillis dans cette structure ?' + }} + </h3> + <p>{{ isMandatoryFields ? '' : 'Facultatif - ' }}Plusieurs choix possibles</p> </div> </div> <p class="missing-information" *ngIf="isEditMode && !structureForm.get('categories').get('age').valid"> <app-svg-icon [iconClass]="'icon-26'" [type]="'form'" [icon]="'notValidate'" class="validationIcon"></app-svg-icon> <span>Il faut renseigner au moins un champ</span> </p> - <div *ngIf="publicOthers"> - <div class="btn-grid"> - <app-button - *ngFor="let choice of publicOthers.modules" - [ngClass]="{ selectedChoice: true }" - [extraClass]="isInArray(choice.id, 'publicOthers') ? 'selected' : ''" - [style]="buttonTypeEnum.CheckButton" - [text]="choice.name" - (action)="updateChoicePublic(choice.id, 'publicOthers')" - ></app-button> + <ng-container *ngIf="!isMandatoryFields"> + <div *ngIf="languageAndIlliteracy"> + <div class="title"> + <h4>Langue et illettrisme</h4> + </div> + <div class="btn-grid"> + <app-button + *ngFor="let choice of languageAndIlliteracy.modules" + [ngClass]="{ selectedChoice: true }" + [extraClass]="isInArray(choice.id, 'languageAndIlliteracy') ? 'selected' : ''" + [style]="buttonTypeEnum.CheckButton" + [text]="choice.name" + (action)="updateChoicePublic(choice.id, 'languageAndIlliteracy')" + ></app-button> + </div> </div> - </div> - <div *ngIf="age"> - <div class="title"> - <h4>Âge</h4> - </div> - <div class="btn-grid"> - <app-button - *ngFor="let choice of age.modules" - [ngClass]="{ selectedChoice: true }" - [extraClass]="isInArray(choice.id, 'age') ? 'selected' : ''" - [style]="buttonTypeEnum.CheckButton" - [text]="choice.name" - (action)="updateChoicePublic(choice.id, 'age')" - ></app-button> - </div> - </div> + <div *ngIf="handicaps"> + <div class="title"> + <h4>Handicaps</h4> + </div> - <div *ngIf="languageAndIlliteracy"> - <div class="title"> - <h4>Langue et illettrisme</h4> - <p>Facultatif</p> + <div class="btn-grid"> + <app-button + *ngFor="let choice of handicaps.modules" + [ngClass]="{ selectedChoice: true }" + [extraClass]="isInArray(choice.id, 'handicaps') ? 'selected' : ''" + [style]="buttonTypeEnum.CheckButton" + [text]="choice.name" + (action)="updateChoicePublic(choice.id, 'handicaps')" + ></app-button> + </div> </div> - <div class="btn-grid"> - <app-button - *ngFor="let choice of languageAndIlliteracy.modules" - [ngClass]="{ selectedChoice: true }" - [extraClass]="isInArray(choice.id, 'languageAndIlliteracy') ? 'selected' : ''" - [style]="buttonTypeEnum.CheckButton" - [text]="choice.name" - (action)="updateChoicePublic(choice.id, 'languageAndIlliteracy')" - ></app-button> - </div> - </div> - - <div *ngIf="handicaps"> - <div class="title"> - <h4>Handicaps</h4> - <p>Facultatif</p> + <div *ngIf="publicOthers"> + <div class="title"> + <h4>Autre</h4> + </div> + <div class="btn-grid"> + <app-button + *ngFor="let choice of publicOthers.modules" + [ngClass]="{ selectedChoice: true }" + [extraClass]="isInArray(choice.id, 'publicOthers') ? 'selected' : ''" + [style]="buttonTypeEnum.CheckButton" + [text]="choice.name" + (action)="updateChoicePublic(choice.id, 'publicOthers')" + ></app-button> + </div> </div> + </ng-container> - <div class="btn-grid"> - <app-button - *ngFor="let choice of handicaps.modules" - [ngClass]="{ selectedChoice: true }" - [extraClass]="isInArray(choice.id, 'handicaps') ? 'selected' : ''" - [style]="buttonTypeEnum.CheckButton" - [text]="choice.name" - (action)="updateChoicePublic(choice.id, 'handicaps')" - ></app-button> + <ng-container *ngIf="isMandatoryFields"> + <div *ngIf="age"> + <div class="title"> + <h4>Âge</h4> + </div> + <div class="btn-grid"> + <app-button + *ngFor="let choice of age.modules" + [ngClass]="{ selectedChoice: true }" + [extraClass]="isInArray(choice.id, 'age') ? 'selected' : ''" + [style]="buttonTypeEnum.CheckButton" + [text]="choice.name" + (action)="updateChoicePublic(choice.id, 'age')" + ></app-button> + </div> </div> - </div> + </ng-container> </form> diff --git a/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.ts b/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.ts index def473a164052d272d291b670f6bca2e32518373..6471b6372918ece4d45c0c491bcacd718d97b7f5 100644 --- a/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.ts +++ b/src/app/form/form-view/structure-form/structure-public-target/structure-public-target.component.ts @@ -14,6 +14,7 @@ export class StructurePublicTargetComponent implements OnInit { @Input() handicaps: Category; @Input() publicOthers: Category; @Input() isEditMode: boolean; + @Input() isMandatoryFields = true; @Output() updateChoice = new EventEmitter<any>(); @Output() validateForm = new EventEmitter<any>(); diff --git a/src/app/form/form-view/structure-form/structureFormStep.enum.ts b/src/app/form/form-view/structure-form/structureFormStep.enum.ts index 84e8465441b83550e69cc2e3946796add6ef6fb4..5e1ce4ffb19d686e933efecbf2ecf3f90fb3b875 100644 --- a/src/app/form/form-view/structure-form/structureFormStep.enum.ts +++ b/src/app/form/form-view/structure-form/structureFormStep.enum.ts @@ -12,6 +12,7 @@ export enum structureFormStep { structurePmr, structureWebAndSocialNetwork, structurePublicTarget, + structurePublicTargetOptional, structureDigitalHelpingAccompaniment, structureDigitalHelpingAccompanimentOther, structureTrainingType, diff --git a/src/app/profile/structure-edition-summary/structure-edition-summary.component.html b/src/app/profile/structure-edition-summary/structure-edition-summary.component.html index 039edaef5e9ba26094104cee90e0e14bd2bb67ad..84bd07da633008cefdbea65506e960cee83290a4 100644 --- a/src/app/profile/structure-edition-summary/structure-edition-summary.component.html +++ b/src/app/profile/structure-edition-summary/structure-edition-summary.component.html @@ -300,6 +300,25 @@ <app-missing-information></app-missing-information> </ng-container> </div> + </div> + + <div class="section publics"> + <div class="sectionHeader"> + <p>Public spécifique admis</p> + <app-button + class="hide-on-mobile" + [text]="'Modifier'" + [style]="buttonTypeEnum.Secondary" + [extraClass]="'editButton'" + (action)="goToEdit(structureFormStep.structurePublicTargetOptional)" + ></app-button> + <app-button + class="hide-on-desktop" + [iconBtn]="'edit'" + [style]="buttonTypeEnum.SecondaryOnlyIcon" + (action)="goToEdit(structureFormStep.structurePublicTargetOptional)" + ></app-button> + </div> <div class="content"> <ng-container *ngIf=" @@ -339,6 +358,17 @@ </div> </ng-container> </div> + <div class="content"> + <ng-container + *ngIf=" + structure.categoriesDisplay.languageAndIlliteracy.length === 0 && + structure.categoriesDisplay.publicOthers.length === 0 && + structure.categoriesDisplay.handicaps.length === 0 + " + > + <app-no-information></app-no-information> + </ng-container> + </div> </div> <div class="section proceduresAccompaniment"> diff --git a/src/app/utils/formUtils.ts b/src/app/utils/formUtils.ts index 8ce4f2a2c05f0885f408ccbc82cca69adf3bddab..97cb7c613b01f86777a4b1029477773a6a587bd8 100644 --- a/src/app/utils/formUtils.ts +++ b/src/app/utils/formUtils.ts @@ -30,7 +30,7 @@ export class formUtils { inputs: ['website', 'facebook', 'twitter', 'instagram'], }, { step: structureFormStep.structurePublicTarget, name: 'Public admis', inputs: ['publics'] }, - + { step: structureFormStep.structurePublicTarget, name: 'Public admis - Optionnel', inputs: ['publics'] }, { step: structureFormStep.structureDigitalHelpingAccompaniment, name: 'Aides au numérique',