From b56b69a29024e557318079f8b52ee50a160c7f59 Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Mon, 4 Mar 2024 14:41:03 +0100
Subject: [PATCH] cleanup: remove unused StructureContactCompletionComponent

---
 .../form/footer-form/footer-form.component.ts | 12 ----
 src/app/form/form-view/form-view.module.ts    |  2 -
 ...tructure-contact-completion.component.html | 70 -------------------
 .../structure-contact-completion.component.ts | 23 ------
 .../structure-form.component.html             |  7 --
 .../structure-form.component.ts               |  7 --
 .../structure-form/structureFormStep.enum.ts  |  1 -
 src/app/utils/formUtils.ts                    |  6 --
 8 files changed, 128 deletions(-)
 delete mode 100644 src/app/form/form-view/structure-form/structure-contact-completion/structure-contact-completion.component.html
 delete mode 100644 src/app/form/form-view/structure-form/structure-contact-completion/structure-contact-completion.component.ts

diff --git a/src/app/form/footer-form/footer-form.component.ts b/src/app/form/footer-form/footer-form.component.ts
index d3381fc7a..13bbe7992 100644
--- a/src/app/form/footer-form/footer-form.component.ts
+++ b/src/app/form/footer-form/footer-form.component.ts
@@ -95,10 +95,6 @@ export class FooterFormComponent implements OnChanges {
     }
 
     if (this.currentForm === formType.structure) {
-      if (this.currentStep === structureFormStep.structureType) {
-        this.changeCurrentStep.emit(structureFormStep.structureFormTime);
-        return;
-      }
       if (this.currentStep === structureFormStep.structureWifi) {
         if (this.isTrainingsSelected()) {
           this.changeCurrentStep.emit(structureFormStep.structureTrainingPrice);
@@ -150,10 +146,6 @@ export class FooterFormComponent implements OnChanges {
           return;
         }
       }
-      if (this.currentStep === structureFormStep.structureFormTime) {
-        this.changeCurrentStep.emit(structureFormStep.structureType);
-        return;
-      }
       // Check if trainings are selected in order to ask for pricing
       if (this.currentStep === structureFormStep.structureTrainingType) {
         if (this.isTrainingsSelected()) {
@@ -172,10 +164,6 @@ export class FooterFormComponent implements OnChanges {
         }
         return;
       }
-      if (this.currentStep === structureFormStep.structureContactCompletion) {
-        // TODO Go to send mail page and send the mail
-        return;
-      }
     }
     if (this.isPersonalOfferPage()) {
       this.endForm.emit({ formType: this.currentForm });
diff --git a/src/app/form/form-view/form-view.module.ts b/src/app/form/form-view/form-view.module.ts
index d68ad3f8a..02714b62f 100644
--- a/src/app/form/form-view/form-view.module.ts
+++ b/src/app/form/form-view/form-view.module.ts
@@ -20,7 +20,6 @@ import { ProfileStructureChoiceComponent } from './profile-form/profile-structur
 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 { StructureConsentComponent } from './structure-form/structure-consent/structure-consent.component';
-import { StructureContactCompletionComponent } from './structure-form/structure-contact-completion/structure-contact-completion.component';
 import { StructureContactComponent } from './structure-form/structure-contact/structure-contact.component';
 import { StructureCovidInfoComponent } from './structure-form/structure-covid-info/structure-covid-info.component';
 import { StructureDescriptionComponent } from './structure-form/structure-description/structure-description.component';
@@ -54,7 +53,6 @@ import { StructureWifiComponent } from './structure-form/structure-wifi/structur
     StructureNameAndAddressComponent,
     StructureContactComponent,
     StructureAccompanimentChoiceComponent,
-    StructureContactCompletionComponent,
     StructureAccessModalityComponent,
     StructureHoursComponent,
     StructureWebAndSocialNetworkComponent,
diff --git a/src/app/form/form-view/structure-form/structure-contact-completion/structure-contact-completion.component.html b/src/app/form/form-view/structure-form/structure-contact-completion/structure-contact-completion.component.html
deleted file mode 100644
index c0d833c40..000000000
--- a/src/app/form/form-view/structure-form/structure-contact-completion/structure-contact-completion.component.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<form *ngIf="structureForm" [formGroup]="structureForm">
-  <app-go-back *ngIf="isEditMode" (action)="goBack()" />
-  <div class="title">
-    <h3>Quelle personne pourrait connaître ces informations&nbsp;?</h3>
-    <p>Informations demandées : téléphone, email, accessibilité PMR, type de public...</p>
-  </div>
-  <div class="form-group" fxLayout="column">
-    <label for="contactPersonFirstname">Prénom</label>
-    <div fxLayout="row" fxLayoutGap="13px">
-      <input
-        type="text"
-        name="contactPersonFirstname"
-        id="contactPersonFirstname"
-        formControlName="contactPersonFirstname"
-        class="form-input"
-        (input)="setValidationsForm()"
-      />
-      <app-svg-icon
-        *ngIf="structureForm.get('contactPersonFirstname').valid"
-        [iconClass]="'icon-26'"
-        [folder]="'form'"
-        [icon]="'validate'"
-      />
-    </div>
-  </div>
-  <div class="form-group" fxLayout="column">
-    <label for="contactPersonLastname">Nom</label>
-    <div fxLayout="row" fxLayoutGap="13px">
-      <input
-        type="text"
-        id="contactPersonLastname"
-        name="contactPersonLastname"
-        formControlName="contactPersonLastname"
-        class="form-input"
-        (input)="setValidationsForm()"
-      />
-      <app-svg-icon
-        *ngIf="structureForm.get('contactPersonLastname').valid"
-        [iconClass]="'icon-26'"
-        [folder]="'form'"
-        [icon]="'validate'"
-      />
-    </div>
-  </div>
-  <div class="form-group" fxLayout="column">
-    <label for="contactPersonEmail">Email</label>
-    <div fxLayout="row" fxLayoutGap="13px">
-      <input
-        type="text"
-        id="contactPersonEmail"
-        name="contactPersonEmail"
-        formControlName="contactPersonEmail"
-        class="form-input"
-        (input)="setValidationsForm()"
-      />
-      <app-svg-icon
-        *ngIf="structureForm.get('contactPersonEmail').valid"
-        [iconClass]="'icon-26'"
-        [folder]="'form'"
-        [icon]="'validate'"
-      />
-      <app-svg-icon
-        *ngIf="structureForm.get('contactPersonEmail').invalid && structureForm.get('contactPersonEmail').value"
-        [iconClass]="'icon-26'"
-        [folder]="'form'"
-        [icon]="'notValidate'"
-      />
-    </div>
-  </div>
-</form>
diff --git a/src/app/form/form-view/structure-form/structure-contact-completion/structure-contact-completion.component.ts b/src/app/form/form-view/structure-form/structure-contact-completion/structure-contact-completion.component.ts
deleted file mode 100644
index 55171c1f8..000000000
--- a/src/app/form/form-view/structure-form/structure-contact-completion/structure-contact-completion.component.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
-import { UntypedFormGroup } from '@angular/forms';
-
-@Component({
-  selector: 'app-structure-contact-completion',
-  templateUrl: './structure-contact-completion.component.html',
-})
-export class StructureContactCompletionComponent implements OnInit {
-  @Input() structureForm: UntypedFormGroup;
-  @Input() isEditMode: boolean;
-  @Output() validateForm = new EventEmitter<any>();
-
-  ngOnInit(): void {
-    this.validateForm.emit();
-  }
-
-  public setValidationsForm(): void {
-    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 1ce93bf0a..49e45d2a5 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
@@ -44,13 +44,6 @@
     (radioChange)="onRadioChange($event)"
   />
 </div>
-<div *ngIf="currentStep === structureFormStep.structureContactCompletion">
-  <app-structure-contact-completion
-    [isEditMode]="isEditMode"
-    [structureForm]="structureForm"
-    (validateForm)="setValidationsForm()"
-  />
-</div>
 <div *ngIf="currentStep === structureFormStep.structureType">
   <app-structure-type
     [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 dc85a4ee1..5df54bc3e 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
@@ -134,13 +134,6 @@ export class StructureFormComponent implements OnChanges, OnInit {
     this.pagesValidation[structureFormStep.structureAccompanimentChoice] = {
       valid: this.structureForm.get('placeOfReception').valid,
     };
-    this.pagesValidation[structureFormStep.structureContactCompletion] = {
-      valid: this.isEditMode
-        ? true
-        : this.structureForm.get('contactPersonFirstname').valid &&
-          this.structureForm.get('contactPersonLastname').valid &&
-          this.structureForm.get('contactPersonEmail').valid,
-    };
     this.pagesValidation[structureFormStep.structureType] = {
       valid: this.structureForm.get('structureType').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 154d2a881..aa44903c7 100644
--- a/src/app/form/form-view/structure-form/structureFormStep.enum.ts
+++ b/src/app/form/form-view/structure-form/structureFormStep.enum.ts
@@ -4,7 +4,6 @@ export enum structureFormStep {
   structureNameAndAddress,
   structureContact,
   structureFormTime,
-  structureContactCompletion,
   structureType,
   structureAccessModality,
   structureHours,
diff --git a/src/app/utils/formUtils.ts b/src/app/utils/formUtils.ts
index fd7484fa3..9a435eacd 100644
--- a/src/app/utils/formUtils.ts
+++ b/src/app/utils/formUtils.ts
@@ -47,12 +47,6 @@ export class FormUtils {
       name: 'Partage de données sur data.grandlyon.com',
       inputs: ['dataShareConsentDate'],
     },
-    {
-      step: structureFormStep.structureContactCompletion,
-      name: 'Personne contact informations',
-      inputs: ['contactPersonFirstname', 'contactPersonLastname', 'contactPersonEmail'],
-      hideForEdit: true,
-    },
     {
       step: structureFormStep.structureAccompanimentChoice,
       name: "Lieu d'accueil",
-- 
GitLab