From f703943022756747b83b0cbf6a512225be320c02 Mon Sep 17 00:00:00 2001
From: Baptiste Toulemonde <toulemonde@cines.fr>
Date: Wed, 9 Mar 2022 13:46:29 +0100
Subject: [PATCH] ajout input si enum vide

---
 .../file-tree-metadata.component.html         | 30 +++++++++++--------
 .../file-tree-metadata.component.ts           |  6 ++--
 2 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.html b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.html
index 6811d1ad0..2934c0f0a 100644
--- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.html
+++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.html
@@ -244,19 +244,23 @@
         </div>
 
         <div class="ml-5 row">
-
-          <mat-form-field class="mr-3 vitamui-mat-select col-6">
-            <mat-select panelClass="vitamui-mat-select">
-              <mat-option *ngFor="let element of enumerationsSedaControl" [value]="">
-                {{element}}
-              </mat-option>
-            </mat-select>
-            <div class="select-arrow">
-              <i class="material-icons">keyboard_arrow_up</i>
-              <i class="material-icons">keyboard_arrow_down</i>
-            </div>
-          </mat-form-field>
-
+          <div class="col-8">
+            <mat-form-field class="mr-3 vitamui-mat-select " *ngIf="!isEmptyEnumeration(enumerationsSedaControl); else blockInput">
+              <mat-select panelClass="vitamui-mat-select">
+                <mat-option *ngFor="let element of enumerationsSedaControl" [value]="">
+                  {{element}}
+                </mat-option>
+              </mat-select>
+              <div class="select-arrow">
+                <i class="material-icons">keyboard_arrow_up</i>
+                <i class="material-icons">keyboard_arrow_down</i>
+              </div>
+            </mat-form-field>
+            <ng-template #blockInput>
+              <vitamui-common-editable-textarea >
+            </vitamui-common-editable-textarea>
+            </ng-template>
+          </div>
         </div>
       </div>
 
diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts
index dbc213bf9..8d00555c7 100644
--- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts
+++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts
@@ -764,6 +764,8 @@ export class FileTreeMetadataComponent {
     return this.sedaService.isDuplicated(nomDuChamp, this.selectedSedaNode);
   }
 
-
-
+  isEmptyEnumeration(enumerations: string[]): boolean{
+    return enumerations.length === 0;
+  }
+ 
 }
-- 
GitLab