Skip to content
Snippets Groups Projects
Commit cada5534 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

Merge branch '55-separer-l-age-des-autres-publics' into 'V2.0'

Resolve "Séparer l'âge des autres publics"

See merge request !387
parents d5a29d66 d66d67c9
No related branches found
No related tags found
4 merge requests!418V2.1.0,!400V2.0,!387Resolve "Séparer l'âge des autres publics",!230V2.0
......@@ -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,
......
......@@ -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)"
>
......
......@@ -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,
};
......
......@@ -8,74 +8,84 @@
[icon]="'arrowBack'"
></app-svg-icon>
<div class="titleContent">
<h3>Quel public peut être accueilli dans cette structure&nbsp;?</h3>
<p>Plusieurs choix possibles</p>
<h3>
{{
isMandatoryFields
? 'Quel public peut être accueilli dans cette structure&nbsp;?'
: 'Quels publics spécifiques peuvent être accueillis dans cette structure&nbsp;?'
}}
</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>
......@@ -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>();
......
......@@ -12,6 +12,7 @@ export enum structureFormStep {
structurePmr,
structureWebAndSocialNetwork,
structurePublicTarget,
structurePublicTargetOptional,
structureDigitalHelpingAccompaniment,
structureDigitalHelpingAccompanimentOther,
structureTrainingType,
......
......@@ -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">
......
......@@ -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',
......
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