From 32e87ab3a0bfcad661814a67d392c5b8e9572dc6 Mon Sep 17 00:00:00 2001
From: Mathieu Ponton <mponton@grandlyon.com>
Date: Tue, 5 Mar 2024 09:04:09 +0000
Subject: [PATCH] fix(onboarding, carto): removed infos COVID

---
 src/app/admin/admin-routing.module.ts         |  6 ----
 src/app/admin/admin.module.ts                 |  2 --
 .../manage-lockdown-info.component.html       | 16 ----------
 .../manage-lockdown-info.component.ts         | 31 -------------------
 .../components/nav-bar/nav-bar.component.html |  5 ---
 src/app/admin/services/parameters.service.ts  | 19 ------------
 src/app/form/form-view/form-view.component.ts |  4 ---
 src/app/form/form-view/form-view.module.ts    |  2 --
 .../structure-covid-info.component.html       | 14 ---------
 .../structure-covid-info.component.scss       |  5 ---
 .../structure-covid-info.component.ts         | 19 ------------
 .../structure-form.component.html             |  7 -----
 .../structure-form.component.ts               |  4 ---
 .../structure-form/structureFormStep.enum.ts  |  1 -
 src/app/models/structure.model.ts             |  1 -
 .../structure-edition-summary.component.html  | 24 --------------
 .../structure-details.component.html          |  3 --
 .../structure-details.component.ts            |  6 ----
 src/app/utils/formUtils.ts                    |  2 --
 19 files changed, 171 deletions(-)
 delete mode 100644 src/app/admin/components/lockdown-info/manage-lockdown-info.component.html
 delete mode 100644 src/app/admin/components/lockdown-info/manage-lockdown-info.component.ts
 delete mode 100644 src/app/admin/services/parameters.service.ts
 delete mode 100644 src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.html
 delete mode 100644 src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.scss
 delete mode 100644 src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.ts

diff --git a/src/app/admin/admin-routing.module.ts b/src/app/admin/admin-routing.module.ts
index 719de652e..75c9867c3 100644
--- a/src/app/admin/admin-routing.module.ts
+++ b/src/app/admin/admin-routing.module.ts
@@ -3,7 +3,6 @@ import { RouterModule, Routes } from '@angular/router';
 import { ClaimStructureComponent } from './components/claim-structure/claim-structure.component';
 import { DeletedStructuresComponent } from './components/deleted-structures/deleted-structures.component';
 import { EspaceCoopCNFSComponent } from './components/espace-coop-cnfs/espace-coop-cnfs.component';
-import { ManageLockdownInfoComponent } from './components/lockdown-info/manage-lockdown-info.component';
 import { ManageEmployersComponent } from './components/manage-employers/manage-employers.component';
 import { ManageJobsComponent } from './components/manage-jobs/manage-jobs.component';
 import { ManageUsersComponent } from './components/manage-users/manage-users.component';
@@ -22,10 +21,6 @@ export const AdminRoutes = {
     link: 'admin/jobs-list',
     path: 'jobs-list',
   },
-  lockdownInfo: {
-    link: 'admin/lockdown-info',
-    path: 'lockdown-info',
-  },
   manageUsers: {
     link: 'admin/manage-users',
     path: 'manage-users',
@@ -52,7 +47,6 @@ const routes: Routes = [
   { path: AdminRoutes.deletedStructures.path, component: DeletedStructuresComponent },
   { path: AdminRoutes.employersList.path, component: ManageEmployersComponent },
   { path: AdminRoutes.jobsList.path, component: ManageJobsComponent },
-  { path: AdminRoutes.lockdownInfo.path, component: ManageLockdownInfoComponent },
   { path: AdminRoutes.manageUsers.path, component: ManageUsersComponent },
   { path: AdminRoutes.pendingStructures.path, component: ClaimStructureComponent },
   {
diff --git a/src/app/admin/admin.module.ts b/src/app/admin/admin.module.ts
index 42cf737cf..050a9decc 100644
--- a/src/app/admin/admin.module.ts
+++ b/src/app/admin/admin.module.ts
@@ -6,7 +6,6 @@ import { AdminRoutingModule } from './admin-routing.module';
 import { ClaimStructureComponent } from './components/claim-structure/claim-structure.component';
 import { DeletedStructuresComponent } from './components/deleted-structures/deleted-structures.component';
 import { EspaceCoopCNFSComponent } from './components/espace-coop-cnfs/espace-coop-cnfs.component';
-import { ManageLockdownInfoComponent } from './components/lockdown-info/manage-lockdown-info.component';
 import { DeleteEmployerComponent } from './components/manage-employers/delete-employer/delete-employer.component';
 import { ManageEmployersComponent } from './components/manage-employers/manage-employers.component';
 import { ValidateEmployerComponent } from './components/manage-employers/validate-employer/validate-employer.component';
@@ -29,7 +28,6 @@ import { AdminStructuresListComponent } from './components/structures-list/admin
   declarations: [
     ClaimStructureComponent,
     AdminStructuresListComponent,
-    ManageLockdownInfoComponent,
     ManageUsersComponent,
     JobRendererComponent,
     EmployerRendererComponent,
diff --git a/src/app/admin/components/lockdown-info/manage-lockdown-info.component.html b/src/app/admin/components/lockdown-info/manage-lockdown-info.component.html
deleted file mode 100644
index 570021ebb..000000000
--- a/src/app/admin/components/lockdown-info/manage-lockdown-info.component.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<app-admin-nav-bar />
-<div *ngIf="isLoading" class="loader" aria-busy="true">
-  <img class="loader-gif" src="/assets/gif/loader_circle.gif" alt />
-</div>
-<div *ngIf="!isLoading" class="adminLayout">
-  <h2>Gestion de l'affichage des infos Covid</h2>
-  <div *ngIf="lockdownInfoDisplay">Les infos covid sont actuellement affichées dans les fiches structure.</div>
-  <div *ngIf="!lockdownInfoDisplay">Les infos covid ne sont actuellement pas affichées dans les fiches structure.</div>
-  <app-switch
-    *ngIf="!error"
-    label="Afficher les infos covid"
-    [checked]="lockdownInfoDisplay"
-    (action)="toggleLockdownInfo()"
-  />
-  <p *ngIf="error" class="error">Une erreur s'est produite a l'enregistrement, veuillez ré-essayer plus tard.</p>
-</div>
diff --git a/src/app/admin/components/lockdown-info/manage-lockdown-info.component.ts b/src/app/admin/components/lockdown-info/manage-lockdown-info.component.ts
deleted file mode 100644
index 2d14dcd60..000000000
--- a/src/app/admin/components/lockdown-info/manage-lockdown-info.component.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { ParametersService } from '../../services/parameters.service';
-
-@Component({
-  selector: 'app-admin-manage-lockdown-info',
-  templateUrl: './manage-lockdown-info.component.html',
-  styleUrls: ['../../admin.scss'],
-})
-export class ManageLockdownInfoComponent implements OnInit {
-  public isLoading = true;
-  public lockdownInfoDisplay: boolean;
-  public error = false;
-  constructor(private parametersService: ParametersService) {}
-
-  ngOnInit(): void {
-    this.parametersService.getParameters().subscribe((params) => {
-      this.lockdownInfoDisplay = params.lockdownInfoDisplay;
-      this.isLoading = false;
-    });
-  }
-
-  public toggleLockdownInfo(): void {
-    this.lockdownInfoDisplay = !this.lockdownInfoDisplay;
-    this.parametersService.SetLockdownInfoDisplay(this.lockdownInfoDisplay).subscribe(
-      () => null,
-      () => {
-        this.error = true;
-      },
-    );
-  }
-}
diff --git a/src/app/admin/components/nav-bar/nav-bar.component.html b/src/app/admin/components/nav-bar/nav-bar.component.html
index ab692b563..f077ae671 100644
--- a/src/app/admin/components/nav-bar/nav-bar.component.html
+++ b/src/app/admin/components/nav-bar/nav-bar.component.html
@@ -32,11 +32,6 @@
       [variant]="'secondary'"
       (click)="router.navigateByUrl(routes.espaceCoopCNFS.link)"
     />
-    <app-button
-      [label]="'Infos covid'"
-      [variant]="'secondary'"
-      (click)="router.navigateByUrl(routes.lockdownInfo.link)"
-    />
     <app-button [variant]="'tertiary'" [label]="'Ghost'" (click)="openGhost()" />
   </nav>
 </header>
diff --git a/src/app/admin/services/parameters.service.ts b/src/app/admin/services/parameters.service.ts
deleted file mode 100644
index 149900697..000000000
--- a/src/app/admin/services/parameters.service.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { HttpClient } from '@angular/common/http';
-import { Injectable } from '@angular/core';
-import { Observable } from 'rxjs';
-
-@Injectable({
-  providedIn: 'root',
-})
-export class ParametersService {
-  private readonly baseUrl = 'api/';
-  constructor(private http: HttpClient) {}
-
-  public getParameters(): Observable<any> {
-    return this.http.get<any>(`${this.baseUrl}parameters`);
-  }
-
-  public SetLockdownInfoDisplay(lockdownInfoDisplay: boolean): Observable<any> {
-    return this.http.post(`${this.baseUrl}parameters/`, { lockdownInfoDisplay });
-  }
-}
diff --git a/src/app/form/form-view/form-view.component.ts b/src/app/form/form-view/form-view.component.ts
index 0b3f715b1..a59b3e73f 100644
--- a/src/app/form/form-view/form-view.component.ts
+++ b/src/app/form/form-view/form-view.component.ts
@@ -522,10 +522,6 @@ export class FormViewComponent implements OnInit, AfterViewInit {
         return {
           description: this.structureForm.get('description').value,
         };
-      case structureFormStep.structureCovidInfo:
-        return {
-          lockdownActivity: this.structureForm.get('lockdownActivity').value,
-        };
       case structureFormStep.structureConsent:
         return {
           dataShareConsentDate: this.structureForm.get('dataShareConsentDate').value ? new Date().toString() : null,
diff --git a/src/app/form/form-view/form-view.module.ts b/src/app/form/form-view/form-view.module.ts
index d68ad3f8a..27b28b74a 100644
--- a/src/app/form/form-view/form-view.module.ts
+++ b/src/app/form/form-view/form-view.module.ts
@@ -22,7 +22,6 @@ import { StructureAccompanimentChoiceComponent } from './structure-form/structur
 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';
 import { StructureDigitalHelpingAccompanimentComponent } from './structure-form/structure-digital-helping-accompaniment/structure-digital-helping-accompaniment.component';
 import { StructureEquipmentsComponent } from './structure-form/structure-equipments/structure-equipments.component';
@@ -65,7 +64,6 @@ import { StructureWifiComponent } from './structure-form/structure-wifi/structur
     StructureEquipmentsComponent,
     StructureLabelsComponent,
     StructureDescriptionComponent,
-    StructureCovidInfoComponent,
     StructureConsentComponent,
     AccountInfoComponent,
     AccountCredentialsComponent,
diff --git a/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.html b/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.html
deleted file mode 100644
index 94d9e035d..000000000
--- a/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<form [formGroup]="structureForm">
-  <app-go-back *ngIf="isEditMode" (action)="goBack()" />
-  <div class="title">
-    <h3>Y a-t-il des informations spécifiques à la période COVID&nbsp;?</h3>
-    <p>Facultatif</p>
-  </div>
-  <app-textarea
-    id="covid"
-    label=""
-    placeholder="Exemple : nous ne sommes joignables que par visio"
-    [value]="getStructureControl('lockdownActivity').value"
-    (valueChange)="getStructureControl('lockdownActivity').setValue($event)"
-  />
-</form>
diff --git a/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.scss b/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.scss
deleted file mode 100644
index 1140b0dd0..000000000
--- a/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-.textareaBlock {
-  p {
-    text-align: right;
-  }
-}
diff --git a/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.ts b/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.ts
deleted file mode 100644
index 156f728f8..000000000
--- a/src/app/form/form-view/structure-form/structure-covid-info/structure-covid-info.component.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Component, Input } from '@angular/core';
-import { AbstractControl, UntypedFormGroup } from '@angular/forms';
-
-@Component({
-  selector: 'app-structure-covid-info',
-  templateUrl: './structure-covid-info.component.html',
-  styleUrls: ['./structure-covid-info.component.scss'],
-})
-export class StructureCovidInfoComponent {
-  @Input() structureForm: UntypedFormGroup;
-  @Input() isEditMode: boolean;
-
-  public getStructureControl(nameControl: string): AbstractControl {
-    return this.structureForm.get(nameControl);
-  }
-  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..245379962 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
@@ -189,13 +189,6 @@
     (validateForm)="setValidationsForm()"
   />
 </div>
-<div *ngIf="currentStep === structureFormStep.structureCovidInfo">
-  <app-structure-covid-info
-    [isEditMode]="isEditMode"
-    [structureForm]="structureForm"
-    (validateForm)="setValidationsForm()"
-  />
-</div>
 <div *ngIf="currentStep === structureFormStep.structureConsent">
   <app-structure-consent
     [structureForm]="structureForm"
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..1a750eda1 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
@@ -69,7 +69,6 @@ export class StructureFormComponent implements OnChanges, OnInit {
         this.currentStep === structureFormStep.structureLabels ||
         this.currentStep === structureFormStep.structureSolidarityMaterial ||
         this.currentStep === structureFormStep.structureDescription ||
-        this.currentStep === structureFormStep.structureCovidInfo ||
         this.currentStep === structureFormStep.mailSentInfo ||
         this.currentStep === structureFormStep.structureFormTime ||
         (this.isEditMode && this.currentStep === structureFormStep.structureConsent)
@@ -198,9 +197,6 @@ export class StructureFormComponent implements OnChanges, OnInit {
     this.pagesValidation[structureFormStep.structureDescription] = {
       valid: true,
     };
-    this.pagesValidation[structureFormStep.structureCovidInfo] = {
-      valid: true,
-    };
 
     this.pagesValidation[structureFormStep.structureConsent] = {
       valid: !this.isEditMode ? this.userAcceptSavedDate : true,
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..d083170a4 100644
--- a/src/app/form/form-view/structure-form/structureFormStep.enum.ts
+++ b/src/app/form/form-view/structure-form/structureFormStep.enum.ts
@@ -22,7 +22,6 @@ export enum structureFormStep {
   structureLabels,
   structureSolidarityMaterial,
   structureDescription,
-  structureCovidInfo,
   structureConsent,
   structureCreationFinishedInfo,
   mailSentInfo,
diff --git a/src/app/models/structure.model.ts b/src/app/models/structure.model.ts
index eb2d28e8e..3fd00f0a6 100644
--- a/src/app/models/structure.model.ts
+++ b/src/app/models/structure.model.ts
@@ -28,7 +28,6 @@ export class Structure {
   public twitter: string = null;
   public instagram: string = null;
   public linkedin: string = null;
-  public lockdownActivity: string = null;
   public pmrAccess: boolean = null;
   public placeOfReception: boolean = null;
   public choiceCompletion: boolean = null;
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 ae04a0fc7..f0b012b06 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
@@ -732,30 +732,6 @@
       </div>
     </section>
 
-    <section class="covid">
-      <div class="sectionHeader">
-        <h3 class="uppercase">Informations spécifiques à la période COVID</h3>
-        <app-button
-          class="hide-on-mobile"
-          [variant]="'secondary'"
-          [label]="'Modifier'"
-          [iconName]="'edit'"
-          [size]="'small'"
-          (action)="goToEdit(structureFormStep.structureCovidInfo)"
-        />
-        <app-icon-button
-          class="hide-on-desktop"
-          [variant]="'secondary'"
-          [iconName]="'edit'"
-          (action)="goToEdit(structureFormStep.structureCovidInfo)"
-        />
-      </div>
-      <div class="content">
-        <app-no-information *ngIf="!structure.lockdownActivity" />
-        <p *ngIf="structure.lockdownActivity">{{ structure.lockdownActivity }}</p>
-      </div>
-    </section>
-
     <section class="dataShare">
       <div class="sectionHeader">
         <h3 class="uppercase">Partage de données sur data.grandlyon.com</h3>
diff --git a/src/app/structure-list/components/structure-details/structure-details.component.html b/src/app/structure-list/components/structure-details/structure-details.component.html
index 7f611ea84..57ad2cd86 100644
--- a/src/app/structure-list/components/structure-details/structure-details.component.html
+++ b/src/app/structure-list/components/structure-details/structure-details.component.html
@@ -162,9 +162,6 @@
     <section *ngIf="structure.description" class="description">
       <h2>Description</h2>
       <div class="description">{{ structure.description }}</div>
-      <div *ngIf="structure.lockdownActivity && lockdownInfoDisplay" class="info">
-        {{ structure.lockdownActivity }}
-      </div>
     </section>
 
     <section *ngIf="structure.hours.hasData()" class="hours">
diff --git a/src/app/structure-list/components/structure-details/structure-details.component.ts b/src/app/structure-list/components/structure-details/structure-details.component.ts
index e0bee71ff..2c128c746 100644
--- a/src/app/structure-list/components/structure-details/structure-details.component.ts
+++ b/src/app/structure-list/components/structure-details/structure-details.component.ts
@@ -3,7 +3,6 @@ import { Location } from '@angular/common';
 import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
 import { ActivatedRoute, Router } from '@angular/router';
 import * as _ from 'lodash';
-import { ParametersService } from '../../../admin/services/parameters.service';
 import { Owner } from '../../../models/owner.model';
 import { Structure } from '../../../models/structure.model';
 import { TclStopPoint } from '../../../models/tclStopPoint.model';
@@ -47,7 +46,6 @@ export class StructureDetailsComponent implements OnInit {
   public tclStopPoints: TclStopPoint[] = [];
   public printMode = false;
   public isLoading = true;
-  public lockdownInfoDisplay = false;
   public currentProfile: User = null;
   public deleteModalOpened = false;
   public structureErrorModalOpened = false;
@@ -68,7 +66,6 @@ export class StructureDetailsComponent implements OnInit {
     private tclService: TclService,
     public profileService: ProfileService,
     private authService: AuthService,
-    private parametersService: ParametersService,
     private route: ActivatedRoute,
     private location: Location,
     private router: Router,
@@ -82,9 +79,6 @@ export class StructureDetailsComponent implements OnInit {
         this.initForm();
       }
     });
-    this.parametersService.getParameters().subscribe((params) => {
-      this.lockdownInfoDisplay = params.lockdownInfoDisplay;
-    });
   }
 
   async ngOnInit(): Promise<void> {
diff --git a/src/app/utils/formUtils.ts b/src/app/utils/formUtils.ts
index fd7484fa3..d4ad4920f 100644
--- a/src/app/utils/formUtils.ts
+++ b/src/app/utils/formUtils.ts
@@ -41,7 +41,6 @@ export class FormUtils {
     { step: structureFormStep.structureEquipments, name: 'Equipements mis à disposition', inputs: null },
     { step: structureFormStep.structureLabels, name: 'Labélisations proposées', inputs: null },
     { step: structureFormStep.structureDescription, name: 'Présentation de la structure', inputs: null },
-    { step: structureFormStep.structureCovidInfo, name: 'Informations spécifiques à la période COVID', inputs: null },
     {
       step: structureFormStep.structureConsent,
       name: 'Partage de données sur data.grandlyon.com',
@@ -72,7 +71,6 @@ export class FormUtils {
         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),
         address: new UntypedFormGroup({
           numero: new UntypedFormControl(structure.address.numero),
           street: new UntypedFormControl(structure.address.street, Validators.required),
-- 
GitLab