From 57fcadaf014aaf1847ea178aeca544bb7d6a6730 Mon Sep 17 00:00:00 2001
From: FORESTIER Fabien <fabien.forestier@soprasteria.com>
Date: Mon, 20 May 2019 16:01:41 +0200
Subject: [PATCH] remove useless <br> + update Resource property initialization

---
 .../components/resources/detail/resource-detail.component.html  | 2 --
 src/app/components/resources/edit/resource-form.component.ts    | 2 --
 src/app/models/resource.model.ts                                | 2 +-
 3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/app/components/resources/detail/resource-detail.component.html b/src/app/components/resources/detail/resource-detail.component.html
index ef28fb5..60a5b01 100644
--- a/src/app/components/resources/detail/resource-detail.component.html
+++ b/src/app/components/resources/detail/resource-detail.component.html
@@ -40,7 +40,6 @@
                   <span class="empty-property">Non renseigné</span>
                 </ng-template>
               </div>
-              <br>
 
               <p>
                 <span class="has-text-weight-bold">Requêtable: </span>
@@ -76,7 +75,6 @@
                   <span class="empty-property">Non renseigné</span>
                 </ng-template>
               </div>
-              <br>
 
               <div *ngIf="resource.messageWarning">
                 <span class="has-text-weight-bold">Message d'alerte: </span>
diff --git a/src/app/components/resources/edit/resource-form.component.ts b/src/app/components/resources/edit/resource-form.component.ts
index e4756d8..b40283e 100644
--- a/src/app/components/resources/edit/resource-form.component.ts
+++ b/src/app/components/resources/edit/resource-form.component.ts
@@ -42,9 +42,7 @@ export class ResourceFormComponent implements OnInit {
       switchMap((paramMap: ParamMap) => this._resourceService.findById(paramMap.get('id'))))
       .subscribe((resource: Resource) => {
         this.resource = resource;
-
         this.initForm();
-
       });
 
   }
diff --git a/src/app/models/resource.model.ts b/src/app/models/resource.model.ts
index fe8df0a..2d28cdd 100644
--- a/src/app/models/resource.model.ts
+++ b/src/app/models/resource.model.ts
@@ -28,7 +28,7 @@ export class Resource {
       this.isStandard = resource.isStandard;
       this.parametersUrl = resource.parametersUrl;
       this.messageWarning = resource.messageWarning;
-      this.resourceFormats = resource.resourceFormats;
+      this.resourceFormats = resource.resourceFormats ? resource.resourceFormats : [];
     } else {
       this.name = '';
       this.acronym = '';
-- 
GitLab