From 3375a5d7f275132e200582c685bea54cc5d9f3a0 Mon Sep 17 00:00:00 2001
From: naji <naji@cines.fr>
Date: Wed, 9 Mar 2022 10:21:57 +0100
Subject: [PATCH] =?UTF-8?q?Chercher=20les=20enumeration=20d=C3=A9finit=20d?=
 =?UTF-8?q?ans=20seda=20pour=20les=20metadonnes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../file-tree-metadata.component.html                  |  7 +++----
 .../file-tree-metadata/file-tree-metadata.component.ts | 10 ++++++----
 2 files changed, 9 insertions(+), 8 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 1dd928dc9..6811d1ad0 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
@@ -235,7 +235,6 @@
                 translate}}<mat-icon class="pastis-icon-primary"><i class="vitamui-icon vitamui-icon-info"></i>
                 </mat-icon>
               </span>
-              {{this.clickedControl | json}}
             </h2>
           </div>
           <div style="position: relative; right:20px; "><button class="btn btn-circle large "
@@ -248,8 +247,8 @@
 
           <mat-form-field class="mr-3 vitamui-mat-select col-6">
             <mat-select panelClass="vitamui-mat-select">
-              <mat-option *ngFor="" [value]="">
-
+              <mat-option *ngFor="let element of enumerationsSedaControl" [value]="">
+                {{element}}
               </mat-option>
             </mat-select>
             <div class="select-arrow">
@@ -331,4 +330,4 @@
     </ng-template>
 
   </mat-sidenav-content>
-</mat-sidenav-container>
\ No newline at end of file
+</mat-sidenav-container>
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 a4eb95569..dbc213bf9 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
@@ -141,6 +141,7 @@ export class FileTreeMetadataComponent {
   expressionControl: boolean;
   arrayControl: string[];
   clickedControl: FileNode;
+  enumerationsSedaControl: string[];
 
   formatagePredefini: string[] = ["Date AAAA-MM-JJ", "Date AAAA", "Adresse mail"];
 
@@ -565,7 +566,7 @@ export class FileTreeMetadataComponent {
       console.log("The answer for arrays control was ", popUpAnswer);
       if(popUpAnswer){
         this.arrayControl = popUpAnswer;
-        this.setControlsVues(this.arrayControl)
+        this.setControlsVues(this.arrayControl, popData.fileNode.name)
       }
     }
   }
@@ -578,9 +579,10 @@ export class FileTreeMetadataComponent {
     this.valueControl = false;
   }
 
-  setControlsVues(elements: string[]){
+  setControlsVues(elements: string[], sedaName: string){
     if((this.isStandalone && elements.includes("Enumération")) || elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.ENUMERATIONS_LABEL'))){
       this.enumerationControl = true;
+      this.enumerationsSedaControl = this.sedaService.findSedaChildByName(sedaName, this.selectedSedaNode).Enumeration;
     }
     if((this.isStandalone && elements.includes("Expression régulière")) || elements.includes(this.translated(ADD_PUA_CONTROL_TRANSLATE_PATH + '.EXPRESSION_REGULIERE_LABEL'))){
       this.expressionControl = true;
@@ -762,6 +764,6 @@ export class FileTreeMetadataComponent {
     return this.sedaService.isDuplicated(nomDuChamp, this.selectedSedaNode);
   }
 
- 
-  
+
+
 }
-- 
GitLab