diff --git a/src/app/carto/carto.component.ts b/src/app/carto/carto.component.ts index 9f384e8af08b3b588767308f1377919a753fce2f..8c50ecba492c99308f9161f7ac3430814cb6b919 100644 --- a/src/app/carto/carto.component.ts +++ b/src/app/carto/carto.component.ts @@ -2,6 +2,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Meta } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import * as _ from 'lodash'; +import { NeedsTypes } from '../form/orientation-form-view/enums/orientation.enums'; import { GeoJson } from '../map/models/geojson.model'; import { Structure } from '../models/structure.model'; import { ProfileService } from '../profile/services/profile.service'; @@ -22,6 +23,7 @@ export class CartoComponent implements OnInit { @Input() public userLatitude: number = null; @Input() public userLongitude: number = null; @Input() public structuresSelected: Structure[] = []; + @Input() public needType: NeedsTypes = null; @Output() structureSelection = new EventEmitter<any>(); @Output() structureSelectionRDV = new EventEmitter<any>(); @@ -91,10 +93,15 @@ export class CartoComponent implements OnInit { } if (mustLoadStructures) { - // For orientation rdv, structure offers will be ignored: we filter only on personalOffers of the structure with appointment + // For orientation rdv: we filter only on personalOffers of the structure with appointment which allows orientation this.structureService.getStructures(filters, 'search', this.isOrientationRdv).subscribe((structures) => { if (structures) { - if (this.isOrientationRdv) structures = structures.filter((structure) => structure.hasUserWithAppointmentDN); + if (this.isOrientationRdv) { + structures = structures.filter((structure) => structure.hasUserWithAppointmentDN); + } + if (this.needType === NeedsTypes.onlineDemarch) { + structures = structures.filter((structure) => structure.allowOrientation); + } this.updateStructuresDistance(structures, this.userLongitude, this.userLatitude, sortByDistance); } else { this.structures = []; diff --git a/src/app/form/form-view/form-view.component.ts b/src/app/form/form-view/form-view.component.ts index fd4498791e8962cfc95a3f37c1877e68024204cb..b6fd2d625d8f3e34125ea3fbdfd6df2ebaa4eba5 100644 --- a/src/app/form/form-view/form-view.component.ts +++ b/src/app/form/form-view/form-view.component.ts @@ -443,6 +443,10 @@ export class FormViewComponent implements OnInit, AfterViewInit { return { pmrAccess: this.structureForm.get('pmrAccess').value, }; + case structureFormStep.structureAllowOrientation: + return { + allowOrientation: this.structureForm.get('allowOrientation').value, + }; case structureFormStep.structureWebAndSocialNetwork: return { facebook: this.structureForm.get('facebook').value, diff --git a/src/app/form/form-view/form-view.module.ts b/src/app/form/form-view/form-view.module.ts index d74d10215e3edf1f050c771a3429bbf5e470254f..3b653de9e3b6aee2f1b9def2e5d006923861bb8f 100644 --- a/src/app/form/form-view/form-view.module.ts +++ b/src/app/form/form-view/form-view.module.ts @@ -20,6 +20,7 @@ import { ProfileJobSelectionComponent } from './profile-form/profile-job-selecti import { ProfileStructureChoiceComponent } from './profile-form/profile-structure-choice/profile-structure-choice.component'; import { StructureAccessModalityComponent } from './structure-form/structure-access-modality/structure-access-modality.component'; import { StructureAccompanimentChoiceComponent } from './structure-form/structure-accompaniment-choice/structure-accompaniment-choice.component'; +import { StructureAllowOrientationComponent } from './structure-form/structure-allow-orientation/structure-allow-orientation.component'; import { StructureConsentComponent } from './structure-form/structure-consent/structure-consent.component'; import { StructureContactComponent } from './structure-form/structure-contact/structure-contact.component'; import { StructureDescriptionComponent } from './structure-form/structure-description/structure-description.component'; @@ -60,6 +61,7 @@ import { StructureWifiComponent } from './structure-form/structure-wifi/structur StructureDigitalHelpingAccompanimentComponent, StructureTrainingPriceComponent, StructureWifiComponent, + StructureAllowOrientationComponent, StructureEquipmentsComponent, StructureLabelsComponent, StructureDescriptionComponent, diff --git a/src/app/form/form-view/structure-form/structure-allow-orientation/structure-allow-orientation.component.html b/src/app/form/form-view/structure-form/structure-allow-orientation/structure-allow-orientation.component.html new file mode 100644 index 0000000000000000000000000000000000000000..9d0ecc57a4316c30d04afc4e956362eab4590dbb --- /dev/null +++ b/src/app/form/form-view/structure-form/structure-allow-orientation/structure-allow-orientation.component.html @@ -0,0 +1,22 @@ +<form [formGroup]="structureForm"> + <app-go-back *ngIf="isEditMode" (action)="goBack()" /> + <div class="title"> + <h3>Est-il possible d’orienter des bénéficiaires vers cette structure ?</h3> + </div> + <div class="formGroup"> + <app-radio-option + [id]="'yes'" + [label]="'Oui'" + [value]="true" + [selected]="structureForm.get('allowOrientation').value === true" + (click)="onRadioChange('allowOrientation', true)" + /> + <app-radio-option + [id]="'no'" + [label]="'Non'" + [value]="false" + [selected]="structureForm.get('allowOrientation').value === false" + (click)="onRadioChange('allowOrientation', false)" + /> + </div> +</form> diff --git a/src/app/form/form-view/structure-form/structure-allow-orientation/structure-allow-orientation.component.ts b/src/app/form/form-view/structure-form/structure-allow-orientation/structure-allow-orientation.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..19d4b407144d801eca91faf86c77f985a3067db3 --- /dev/null +++ b/src/app/form/form-view/structure-form/structure-allow-orientation/structure-allow-orientation.component.ts @@ -0,0 +1,27 @@ +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { UntypedFormGroup } from '@angular/forms'; +import { FormUtils } from 'src/app/utils/formUtils'; + +@Component({ + selector: 'app-structure-allow-orientation', + templateUrl: './structure-allow-orientation.component.html', +}) +export class StructureAllowOrientationComponent implements OnInit { + @Input() structureForm: UntypedFormGroup; + @Input() isEditMode: boolean; + @Output() radioChange = new EventEmitter<any>(); + @Output() validateForm = new EventEmitter<any>(); + + public formUtils = new FormUtils(); + ngOnInit(): void { + this.validateForm.emit(); + } + + public onRadioChange(name: string, value: boolean): void { + this.radioChange.emit({ name, value }); + this.validateForm.emit(); + } + public goBack(): void { + history.back(); + } +} 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 d426db66719ea1e6ddaee0a18cb48bc2f5c40383..4561235a24aa3bfb2a80914f65a87c04e1751396 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 @@ -78,6 +78,14 @@ (radioChange)="onRadioChange($event)" /> </div> +<div *ngIf="currentStep === structureFormStep.structureAllowOrientation"> + <app-structure-allow-orientation + [isEditMode]="isEditMode" + [structureForm]="structureForm" + (validateForm)="setValidationsForm()" + (radioChange)="onRadioChange($event)" + /> +</div> <div *ngIf="currentStep === structureFormStep.structureWebAndSocialNetwork"> <app-structure-web-and-social-network [isEditMode]="isEditMode" 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 5a6b30b1581d8a04d6e873162381c300ad775ead..b628571628d5b9f842ae245002aa211721dafebd 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 @@ -123,6 +123,9 @@ export class StructureFormComponent implements OnInit, OnChanges { this.pagesValidation[structureFormStep.structurePmr] = { valid: this.structureForm.get('pmrAccess').valid, }; + this.pagesValidation[structureFormStep.structureAllowOrientation] = { + valid: this.structureForm.get('allowOrientation').valid, + }; this.pagesValidation[structureFormStep.structureWebAndSocialNetwork] = { valid: this.structureForm.get('website').valid && 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 ca7aeca355ccde89dabe9bf2ad5632004e65c2a5..71e9a18f9e20b3176ccd64e0fc313373add81796 100644 --- a/src/app/form/form-view/structure-form/structureFormStep.enum.ts +++ b/src/app/form/form-view/structure-form/structureFormStep.enum.ts @@ -8,6 +8,7 @@ export enum structureFormStep { structureAccessModality, structureHours, structurePmr, + structureAllowOrientation, structureWebAndSocialNetwork, structurePublicTarget, /** Accompagnements adaptés à des publics spécifiques */ diff --git a/src/app/form/orientation-form-view/equipment-access/equipment-access.component.html b/src/app/form/orientation-form-view/equipment-access/equipment-access.component.html index 51673974545d459600608cafa25d292b7b66ec66..f67f34a95cfe251592b356b2d3148cd2a78265b2 100644 --- a/src/app/form/orientation-form-view/equipment-access/equipment-access.component.html +++ b/src/app/form/orientation-form-view/equipment-access/equipment-access.component.html @@ -5,6 +5,7 @@ /> <app-orientation-structure-list *ngIf="genericStep === GenericOrientationSteps.accompanimentTunnel" + [needType]="NeedsTypes.equipmentAccess" [currentStep]="currentStep" [form]="orientationForm" [filters]="filters" diff --git a/src/app/form/orientation-form-view/equipment-access/equipment-access.component.ts b/src/app/form/orientation-form-view/equipment-access/equipment-access.component.ts index f538bbdad1e2daf96065fe102381a4557e704c4d..28ab8646ed6a7e8e762968024d52dbf501b7b579 100644 --- a/src/app/form/orientation-form-view/equipment-access/equipment-access.component.ts +++ b/src/app/form/orientation-form-view/equipment-access/equipment-access.component.ts @@ -3,7 +3,7 @@ import { FormGroup } from '@angular/forms'; import { User } from '../../../models/user.model'; import { Filter } from '../../../structure-list/models/filter.model'; import { OrientationUtils } from '../../../utils/orientationUtils'; -import { CommonSteps, GenericOrientationSteps, StructuresListSteps } from '../enums/orientation.enums'; +import { CommonSteps, GenericOrientationSteps, NeedsTypes, StructuresListSteps } from '../enums/orientation.enums'; import { FiltersForm } from '../interfaces/filtersForm.interface'; import { StructureOrientationForm } from '../interfaces/structureOrientationForm.interface'; import { AllOrientationSteps } from '../types/orientation.types'; @@ -26,6 +26,7 @@ export class EquipmentAccessComponent { // Enums public GenericOrientationSteps = GenericOrientationSteps; + public NeedsTypes = NeedsTypes; public checkValidation(): void { switch (this.genericStep) { diff --git a/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.html b/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.html index e5e8a9aaaf812f0688333305bc591cd17d261685..2a55b64493ba1b69008ff59698d89641e4a3af3d 100644 --- a/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.html +++ b/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.html @@ -5,8 +5,9 @@ /> <app-orientation-structure-list *ngIf="genericStep === GenericOrientationSteps.accompanimentTunnel" - [form]="orientationForm" + [needType]="NeedsTypes.equipmentBuy" [currentStep]="currentStep" + [form]="orientationForm" [filters]="filters" [profile]="profile" (validatePage)="checkValidation()" diff --git a/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.ts b/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.ts index 2e1a7c8ec224284bc750d075543cd4d1e8300fef..ad8230a85742ce7c9fe68ef4a9e2a6f1523d5e79 100644 --- a/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.ts +++ b/src/app/form/orientation-form-view/equipment-buy/equipment-buy.component.ts @@ -3,7 +3,7 @@ import { FormGroup } from '@angular/forms'; import { User } from '../../../models/user.model'; import { Filter } from '../../../structure-list/models/filter.model'; import { OrientationUtils } from '../../../utils/orientationUtils'; -import { CommonSteps, GenericOrientationSteps, StructuresListSteps } from '../enums/orientation.enums'; +import { CommonSteps, GenericOrientationSteps, NeedsTypes, StructuresListSteps } from '../enums/orientation.enums'; import { FiltersForm } from '../interfaces/filtersForm.interface'; import { StructureOrientationForm } from '../interfaces/structureOrientationForm.interface'; import { AllOrientationSteps } from '../types/orientation.types'; @@ -26,6 +26,7 @@ export class EquipmentBuyComponent { // Enums public GenericOrientationSteps = GenericOrientationSteps; + public NeedsTypes = NeedsTypes; public checkValidation(): void { switch (this.genericStep) { diff --git a/src/app/form/orientation-form-view/online-demarch/appointment/make-appointment/make-appointment.component.ts b/src/app/form/orientation-form-view/online-demarch/appointment/make-appointment/make-appointment.component.ts index 0eeb9ea3fd8b057305befa09860ecccc5217b9a7..819e8a14d5699c612c7c7ba6fd61e2ed2c1b6db3 100644 --- a/src/app/form/orientation-form-view/online-demarch/appointment/make-appointment/make-appointment.component.ts +++ b/src/app/form/orientation-form-view/online-demarch/appointment/make-appointment/make-appointment.component.ts @@ -105,7 +105,7 @@ export class MakeAppointmentComponent implements OnInit { const filteredStructures = []; // for each structure this.structures.forEach((structure) => { - // check each of its personnalOffers + // check each of its personalOffers structure.personalOffers?.forEach((po) => { // if the needs the user selected are all part of the personalOffer, keep the structure for display if ( diff --git a/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.html b/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.html index 06caabc759410b67278da984cc702165682f7194..3e66262ff97543e82115a9453cfc681bb267af24 100644 --- a/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.html +++ b/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.html @@ -22,8 +22,9 @@ <!-- STRUCTURE LIST FORM --> <app-orientation-structure-list *ngIf="accompanimentType === AccompanimentTypes.structuresList" - [form]="form" + [needType]="needType" [currentStep]="currentStep" + [form]="form" [filters]="filters" [profile]="profile" (validatePage)="checkValidation()" @@ -40,7 +41,7 @@ *ngIf="currentStep === OnlineDemarchesAppointmentSteps.pmrAccess" [structureForm]="form" (validateForm)="checkValidation()" - (radioChange)="onRadioChange($event)" + (radioChange)="applyPMRFilter($event)" /> <app-orientation-structure-address *ngIf="currentStep === OnlineDemarchesAppointmentSteps.location" diff --git a/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.ts b/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.ts index f0d87444d436bacb5f182683c59c674eace2bb0a..e068521da56fa19a5a3000b87539ba07d38458aa 100644 --- a/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.ts +++ b/src/app/form/orientation-form-view/online-demarch/onlineDemarch-form.component.ts @@ -155,10 +155,10 @@ export class OnlineDemarchFormComponent implements OnInit { } return false; } - public onRadioChange(event: { name: string; value: boolean }): void { + public applyPMRFilter(event: { name: string; value: boolean }): void { const { name, value } = event; this.form.get(name).setValue(value); - this.orientationUtils.manuallySetOfPmr(this.filters, event); + this.orientationUtils.manuallySetOffPmr(this.filters, event); this.checkValidation(); } public setFailedOrientation(): void { diff --git a/src/app/form/orientation-form-view/orientation-form-view.component.ts b/src/app/form/orientation-form-view/orientation-form-view.component.ts index e9fd1e6c12ebaa3db0285b23fec5d14cc451636b..685d6243561e96c74f6347e9ad66fae7f4444787 100644 --- a/src/app/form/orientation-form-view/orientation-form-view.component.ts +++ b/src/app/form/orientation-form-view/orientation-form-view.component.ts @@ -398,7 +398,9 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked if (this.tunnelingStepIs(AccompanimentTypes.appointment, AppointmentSteps.location)) { const eligibleStructures = ( await lastValueFrom(this.structureService.getStructures(this.filters, 'search', true)) - ).filter((structure) => structure.hasUserWithAppointmentDN); + ) + .filter((structure) => structure.hasUserWithAppointmentDN) + .filter((structure) => structure.allowOrientation); if (eligibleStructures.length === 0) { this.sendOrientationIndicator(this.structureOrientationForm ?? this.onlineDemarcheForm); this.failedOrientation = true; @@ -473,23 +475,17 @@ export class OrientationFormViewComponent implements OnInit, AfterContentChecked return Math.round((this.currentStep / this.nbSteps) * 100); } private async sendOrientationIndicator(orientationForm: FormGroup): Promise<void> { - let isConnected = false; - let profile: User = null; - if (this.authService.isLoggedIn()) { - isConnected = true; - profile = await this.profilService.getProfile(); - } - + this.profile = await this.profilService.getProfile(); const orientationCompleted: boolean = this.isLastStep; const orientationIndicator: IOrientationIndicator = { origin: { id: undefined, - prescripteur: this.utils.nullifyEmpty(profile?.job?.name), + prescripteur: this.utils.nullifyEmpty(this.profile?.job?.name), adresse: this.utils.nullifyEmpty(orientationForm?.get('address')?.value), }, target: this.utils.nullifyEmpty(this.targetStructures(orientationForm.get('structureChoice'))), type: this.orientationType(this.filters), - connected: isConnected, + connected: true, completed: orientationCompleted, progress: this.getProgress(), }; diff --git a/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.html b/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.html index 175cb0c0e120f700feea6ce719113a20b0a6de89..98f02e291364fdd54b0c7fd8bcf698746d9c8b31 100644 --- a/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.html +++ b/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.html @@ -14,6 +14,7 @@ [isOrientationForm]="true" [structuresSelected]="selectedStructures" [filters]="filters" + [needType]="needType" [userLongitude]="form.get('address').value?.coordinates[0]" [userLatitude]="form.get('address').value?.coordinates[1]" (structureSelection)="checkValidation($event)" diff --git a/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.ts b/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.ts index be95e999d79a990b6448609ab75c81c0e4cf6d4d..ca657fca5504b90098646e89c63fa97cce66da5d 100644 --- a/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.ts +++ b/src/app/form/orientation-form-view/orientation-structure-list/orientation-structure-list.component.ts @@ -4,7 +4,7 @@ import { Structure } from '../../../models/structure.model'; import { User } from '../../../models/user.model'; import { Filter } from '../../../structure-list/models/filter.model'; import { OrientationUtils } from '../../../utils/orientationUtils'; -import { AccompanimentTypes, StructuresListSteps } from '../enums/orientation.enums'; +import { AccompanimentTypes, NeedsTypes, StructuresListSteps } from '../enums/orientation.enums'; import { AllOrientationSteps } from '../types/orientation.types'; @Component({ @@ -12,6 +12,7 @@ import { AllOrientationSteps } from '../types/orientation.types'; templateUrl: './orientation-structure-list.component.html', }) export class OrientationStructureListComponent implements OnChanges { + @Input() needType: NeedsTypes; @Input() currentStep: AllOrientationSteps; @Input() profile: User; @Input() form: UntypedFormGroup; @@ -34,7 +35,7 @@ export class OrientationStructureListComponent implements OnChanges { public radioChange(event: { name: string; value: boolean }): void { const { name, value } = event; this.form.get(name).setValue(value); - this.orientationUtils.manuallySetOfPmr(this.filters, event); + this.orientationUtils.manuallySetOffPmr(this.filters, event); this.checkValidation(); } diff --git a/src/app/models/structure.model.ts b/src/app/models/structure.model.ts index ff79e00fdd4ad009a81d7a5f99bd539ca2a9f34b..b33cb513bf5b314912ed2ada9697d96e6c893774 100644 --- a/src/app/models/structure.model.ts +++ b/src/app/models/structure.model.ts @@ -1,6 +1,5 @@ import { StructureCategoryEnum } from '../shared/enum/structureCategory.enum'; import { StructureCategoryIconEnum } from '../shared/enum/structureCategoryIcon.enum'; -import { Weekday } from '../structure-list/enum/weekday.enum'; import { Module } from '../structure-list/models/module.model'; import { FreeWorkShopIDs, FreeWorkShopLabels } from '../structure/enums/freeWorkshop.enum'; import { Utils } from '../utils/utils'; @@ -8,7 +7,7 @@ import { Address } from './address.model'; import { OpeningDay } from './openingDay.model'; import { PersonalOffer } from './personalOffer.model'; import { StructureType } from './structureType.model'; -import { Day, Week } from './week.model'; +import { Week } from './week.model'; export class Structure { public _id: string = null; @@ -30,6 +29,7 @@ export class Structure { public instagram: string = null; public linkedin: string = null; public pmrAccess: boolean = null; + public allowOrientation: boolean = null; public placeOfReception: boolean = null; public choiceCompletion: boolean = null; public contactPersonFirstName: string = null; @@ -86,27 +86,6 @@ export class Structure { }); } - public getDayhours(day: Weekday): Day { - switch (day) { - case Weekday.monday: - return this.hours.monday; - case Weekday.tuesday: - return this.hours.tuesday; - case Weekday.thursday: - return this.hours.thursday; - case Weekday.wednesday: - return this.hours.wednesday; - case Weekday.friday: - return this.hours.friday; - case Weekday.saturday: - return this.hours.saturday; - case Weekday.sunday: - return this.hours.sunday; - default: - return null; - } - } - /** * Check if a structure has equipments */ @@ -216,7 +195,7 @@ export class Structure { * Check if a structure proposes learning skills for free under condition and if it has these conditions specified */ public hasFreenessCondition(): boolean { - const isUnderCondition = this.categoriesDisplay.freeWorkShop[0].name === FreeWorkShopLabels.underCondition; + const isUnderCondition = this.categoriesDisplay.freeWorkShop[0]?.name === FreeWorkShopLabels.underCondition; const freenessCondition = this.getFreenessCondition(); const freenessConditionExists = !(this.utils.isNullOrEmpty(freenessCondition) || freenessCondition.length === 0); return isUnderCondition && freenessConditionExists; 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 eb5045fc3f161039237841ecfb012e46676e0be7..d1119d4bf6588f779f789a2da0479b9551b9160c 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 @@ -407,6 +407,28 @@ </div> </section> + <section class="allowOrientation"> + <div class="sectionHeader"> + <h3 class="uppercase">Orientation de bénéficiaires</h3> + <app-button + class="hide-on-mobile" + [variant]="'secondary'" + [label]="'Modifier'" + [iconName]="'edit'" + [size]="'small'" + (action)="goToEdit(structureFormStep.structureAllowOrientation)" + /> + <app-icon-button + ariaLabel="Modifier les autorisations de visibilité dans l'orientation" + class="hide-on-desktop" + [variant]="'secondary'" + [iconName]="'edit'" + (action)="goToEdit(structureFormStep.structureAllowOrientation)" + /> + </div> + {{ structure.allowOrientation ? 'Oui' : 'Non' }} + </section> + <section class="wifi"> <div class="sectionHeader"> <h3 class="uppercase">Wifi</h3> diff --git a/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts b/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts index 0ac2ebdd7ef3f7601d01cca863f5739633f5c539..4bf33d79abbe45df84377aeb9263d3d641a03049 100644 --- a/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts +++ b/src/app/profile/structure-edition-summary/structure-edition-summary.component.ts @@ -80,7 +80,7 @@ export class StructureEditionSummaryComponent implements OnInit { const updatedAt = DateTime.fromISO(this.structure.updatedAt); const sixMonthsAgo = DateTime.local().minus({ month: 6 }); if (updatedAt < sixMonthsAgo) this.isUpdateStructure = true; - this.freeWorkShop = this.structure.categoriesDisplay.freeWorkShop[0].displayText; + this.freeWorkShop = this.structure.categoriesDisplay.freeWorkShop[0]?.displayText; this.freenessCondition = this.structure.categories.freenessCondition as unknown as string; this.structureService.getStructureWithOwners(data.structure._id).subscribe((result) => { diff --git a/src/app/utils/formUtils.ts b/src/app/utils/formUtils.ts index 387d0b801bfbfd927ccc29a16f2148889599ae17..612b39bfddfff0f18f7963d73c09456080f11fac 100644 --- a/src/app/utils/formUtils.ts +++ b/src/app/utils/formUtils.ts @@ -93,6 +93,7 @@ export class FormUtils { linkedin: new UntypedFormControl(structure.linkedin, Validators.pattern(CustomRegExp.LINKEDIN)), hours: new UntypedFormGroup({}), pmrAccess: new UntypedFormControl(structure.pmrAccess, Validators.required), + allowOrientation: new UntypedFormControl(structure.allowOrientation, Validators.required), placeOfReception: new UntypedFormControl(structure.placeOfReception, !isEditMode && Validators.required), choiceCompletion: new UntypedFormControl(structure.choiceCompletion, !isEditMode && Validators.required), exceptionalClosures: new UntypedFormControl(structure.exceptionalClosures), diff --git a/src/app/utils/orientationUtils.ts b/src/app/utils/orientationUtils.ts index f7180922fb7437d84071f22c80aa5bb9a5297bc6..2c04e342742e6b15ac5d278f725f1f806974acf4 100644 --- a/src/app/utils/orientationUtils.ts +++ b/src/app/utils/orientationUtils.ts @@ -234,7 +234,7 @@ export class OrientationUtils { updatePageValid(pagesValidation[step].valid); } - public manuallySetOfPmr(filters: Filter[], event: { name: string; value: boolean }): void { + public manuallySetOffPmr(filters: Filter[], event: { name: string; value: boolean }): void { // Handle special PMR access case if (event.name === 'pmrAccess') { const filterIndex = filters.findIndex((f) => f.name === 'pmrAccess');