From 22c25c01eacc3222446d11f54eb05e63091ebeed Mon Sep 17 00:00:00 2001
From: Bastien DUMONT <bdumont@grandlyon.com>
Date: Thu, 14 Dec 2023 13:32:58 +0000
Subject: [PATCH] fix(carto): check structureType

---
 .../profile-structure/profile-structure.component.html     | 3 ++-
 .../structures-management.component.html                   | 1 +
 src/app/structure-list/components/card/card.component.html | 7 ++++++-
 src/app/structure-list/components/card/card.component.scss | 1 +
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/app/profile/profile-structure/profile-structure.component.html b/src/app/profile/profile-structure/profile-structure.component.html
index 7d9dcad90..2c541a36d 100644
--- a/src/app/profile/profile-structure/profile-structure.component.html
+++ b/src/app/profile/profile-structure/profile-structure.component.html
@@ -6,8 +6,9 @@
         <div class="structureInfos">
           <p class="structureName">{{ structure.structureName }}</p>
           <app-v3-tag-item
+            *ngIf="structure.structureType?.value"
+            [label]="structure.structureType?.value"
             [clickable]="false"
-            [label]="structure.structureType?.category"
             [size]="'small'"
             [color]="'red'"
           />
diff --git a/src/app/profile/structures-management/structures-management.component.html b/src/app/profile/structures-management/structures-management.component.html
index 2010d9544..50824a4d1 100644
--- a/src/app/profile/structures-management/structures-management.component.html
+++ b/src/app/profile/structures-management/structures-management.component.html
@@ -26,6 +26,7 @@
         <div class="structureDetails">
           <h2 class="structureName">{{ elt.structure.structureName }}</h2>
           <app-v3-tag-item
+            *ngIf="elt.structure.structureType?.value"
             [clickable]="false"
             [label]="elt.structure.structureType.value"
             [size]="'small'"
diff --git a/src/app/structure-list/components/card/card.component.html b/src/app/structure-list/components/card/card.component.html
index 06a2f773b..7ad190030 100644
--- a/src/app/structure-list/components/card/card.component.html
+++ b/src/app/structure-list/components/card/card.component.html
@@ -13,7 +13,12 @@
       <span class="structureName" [ngClass]="{ notClaimed: structure.hasNoUserDN && profileService.isAdmin() }">
         {{ structure.structureName }}
       </span>
-      <app-v3-tag-item [label]="structure.structureType.value" [color]="'red'" [size]="'small'" />
+      <app-v3-tag-item
+        *ngIf="structure.structureType?.value"
+        [label]="structure.structureType.value"
+        [color]="'red'"
+        [size]="'small'"
+      />
       <div class="inline">
         <app-svg-icon [type]="'tags'" [icon]="'address'" [iconClass]="'icon-20'" />
         <ng-container *ngIf="structure.distance">
diff --git a/src/app/structure-list/components/card/card.component.scss b/src/app/structure-list/components/card/card.component.scss
index 89836ae30..8e7738a8b 100644
--- a/src/app/structure-list/components/card/card.component.scss
+++ b/src/app/structure-list/components/card/card.component.scss
@@ -30,6 +30,7 @@
     .structureDetails {
       display: flex;
       flex-direction: column;
+      justify-content: center;
       gap: 8px;
       .structureName {
         @include font-bold-18;
-- 
GitLab