From 30e3a969ce398b5058590aef65c5bd3c86987b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marl=C3=A8ne=20SIMONDANT?= <msimondant@grandlyon.com> Date: Fri, 13 Jan 2023 17:18:07 +0000 Subject: [PATCH] feat(structure): edit structure type --- src/app/form/form-view/form-view.component.ts | 4 ++++ .../structure-edition-summary.component.html | 22 +++++++++++++++++++ src/app/utils/formUtils.ts | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/app/form/form-view/form-view.component.ts b/src/app/form/form-view/form-view.component.ts index 168cd76d9..ac44e0183 100644 --- a/src/app/form/form-view/form-view.component.ts +++ b/src/app/form/form-view/form-view.component.ts @@ -412,6 +412,10 @@ export class FormViewComponent implements OnInit, AfterViewInit { structureName: this.structureForm.get('structureName').value, address: this.structureForm.get('address').value, }; + case structureFormStep.structureType: + return { + structureType: this.structureForm.get('structureType').value, + }; case structureFormStep.structureContact: return { contactPhone: this.structureForm.get('contactPhone').value, 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 79d354b62..caf119fa8 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 @@ -37,6 +37,28 @@ </div> </div> + <div class="section structureType"> + <div class="sectionHeader"> + <p>Type de structure</p> + <app-button + class="hide-on-mobile" + [text]="'Modifier'" + [style]="buttonTypeEnum.SecondaryWide" + [extraClass]="'editButton'" + (action)="goToEdit(structureFormStep.structureType)" + ></app-button> + <app-button + class="hide-on-desktop" + [iconBtn]="'edit'" + [style]="buttonTypeEnum.SecondaryOnlyIcon" + (action)="goToEdit(structureFormStep.structureType)" + ></app-button> + </div> + <div class="content"> + <p>{{ structure.structureType.category }} - {{ structure.getLabelTypeStructure() }}</p> + </div> + </div> + <div class="section phoneAndMail"> <div class="sectionHeader"> <p>Téléphone et email</p> diff --git a/src/app/utils/formUtils.ts b/src/app/utils/formUtils.ts index df9cf117a..56adeccf5 100644 --- a/src/app/utils/formUtils.ts +++ b/src/app/utils/formUtils.ts @@ -71,7 +71,7 @@ export class formUtils { return new UntypedFormGroup({ _id: new UntypedFormControl(structure._id, Validators.required), coord: new UntypedFormControl(structure.coord), - structureType: new UntypedFormControl(structure.structureType, Validators.required), + structureType: new UntypedFormControl(structure.structureType?._id, Validators.required), structureName: new UntypedFormControl(structure.structureName, Validators.required), description: new UntypedFormControl(structure.description), lockdownActivity: new UntypedFormControl(structure.lockdownActivity), -- GitLab