From 78866d5568ab2f2568b90bf3dc086ee275862427 Mon Sep 17 00:00:00 2001
From: Jeremie BRISON <ext.sopra.jbrison@grandlyon.com>
Date: Mon, 1 Feb 2021 18:18:36 +0100
Subject: [PATCH] fix(form) : fix show form

---
 .../components/search/search.component.html            | 10 ++--------
 .../components/search/search.component.ts              |  6 ++----
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/app/structure-list/components/search/search.component.html b/src/app/structure-list/components/search/search.component.html
index c632133f4..419ec6ced 100644
--- a/src/app/structure-list/components/search/search.component.html
+++ b/src/app/structure-list/components/search/search.component.html
@@ -89,7 +89,7 @@
         [text]="'Filtres'"
         (action)="openModal(TypeModal.accompaniment)"
       ></app-button>
-      <a (click)="toogleAddStructure()" tabindex="0">Ajouter une structure</a>
+      <a routerLink="/create-structure" tabindex="0">Ajouter une structure</a>
     </div>
   </div>
   <div class="footerSearchSection isntPhoneContent" fxLayout="row" fxLayoutAlign="space-between center">
@@ -107,12 +107,6 @@
         </label>
       </div>
     </div>
-    <a (click)="toogleAddStructure()" tabindex="0">Ajouter une structure</a>
+    <a routerLink="/create-structure" tabindex="0">Ajouter une structure</a>
   </div>
 </div>
-
-<app-structureForm
-  *ngIf="addStructureFormModal"
-  (closeEvent)="toogleAddStructure($event)"
-  (clickOutside)="toogleAddStructure()"
-></app-structureForm>
diff --git a/src/app/structure-list/components/search/search.component.ts b/src/app/structure-list/components/search/search.component.ts
index de56cc384..341398348 100644
--- a/src/app/structure-list/components/search/search.component.ts
+++ b/src/app/structure-list/components/search/search.component.ts
@@ -1,7 +1,9 @@
 import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
 import { FormBuilder, FormGroup } from '@angular/forms';
+import { Router } from '@angular/router';
 import { forkJoin } from 'rxjs';
 import { GeoJson } from '../../../map/models/geojson.model';
+import { Structure } from '../../../models/structure.model';
 import { GeojsonService } from '../../../services/geojson.service';
 import { AppModalType } from '../../../shared/components/modal/modal-type.enum';
 import { TypeModal } from '../../enum/typeModal.enum';
@@ -220,8 +222,4 @@ export class SearchComponent implements OnInit, OnChanges {
       );
     }
   }
-
-  public toogleAddStructure(): void {
-    this.addStructureFormModal = !this.addStructureFormModal;
-  }
 }
-- 
GitLab