From 84cf07c6598f40885306e3853b1a44acf52de8d8 Mon Sep 17 00:00:00 2001
From: naji <naji@cines.fr>
Date: Tue, 28 Sep 2021 08:27:42 +0200
Subject: [PATCH] =?UTF-8?q?fix:=20Affichage=20des=20m=C3=A9tadonn=C3=A9es?=
 =?UTF-8?q?=20complexes=20dans=20le=20panneau=20lat=C3=A9ral?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../edit-profile/file-tree/file-tree.component.html |  7 +++----
 .../edit-profile/file-tree/file-tree.component.scss | 13 ++++++++++---
 .../edit-profile/file-tree/file-tree.component.ts   | 10 +---------
 3 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.html b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.html
index 973b6710f..1b5f44eb0 100644
--- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.html
+++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.html
@@ -11,7 +11,7 @@
     <ng-container *ngIf="!isAttribute(node) && shouldBeOnTab(node) && node" >
       <mat-list-item
         (mouseover)="hover=node.children.length" (click)="updateMedataTable(node);fileTreeService.nestedTreeControl.expand(node)"
-        [ngClass]="{'list-item':!selectedItemSelected(node),'list-item-select':selectedItemSelected(node)}"
+        [ngClass]="{'list-item':!selectedItem(node),'list-item-select':selectedItem(node)}"
         >
 
         <!--Root node name-->
@@ -35,7 +35,7 @@
           <span *ngIf="node.children.length && node.name !== rootElementName
                     && isPartOfCollection(node) && shouldBeOnTab(node) && !isAttribute(node)"
                 (click)="updateMedataTable(node);$event.stopPropagation()">
-            <div class="divTests" [ngStyle]="{'margin-left': calculateNodePosition(node)  + 'px' , 'width': '350px' }">
+            <div [ngStyle]="{'margin-left': calculateNodePosition(node)  + 'px' , 'width': '350px' }" (click)="updateMedataTable(node);$event.stopPropagation()">
               <button *ngIf="isElementComplexAndHasChildren(node)"
                       mat-icon-button matTreeNodeToggle
                       class="pastis-chevron-icon"
@@ -44,10 +44,9 @@
               </button>
               <span class="pastis-tree-node-name">
                 <span class="text text-medium"
-                      [ngStyle]="{'color': selectedItem(node) }">{{onResolveName(node)}}</span>
+                [ngClass]="{'text-medium-normal':!selectedItem(node),'text-medium-primary':selectedItem(node)}">{{onResolveName(node)}}</span>
                 <span *ngIf="node.name === 'ArchiveUnit'"
                       style="float: right;"
-                      i18n-tooltip="Ajouter une UA ToolTip fileTree@@fileTree.AjouterUneUa"
                       tooltip="Ajouter une UA"
                       tooltip-class="pastis-tooltip-class">
                   <!--Button plus-->
diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.scss b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.scss
index a17476b5d..88c968852 100644
--- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.scss
+++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.scss
@@ -113,7 +113,7 @@
   text-align-last:left;
 }
 .pastis-chevron-icon:focus{
-  color: map-get($colors, 'primary-500');
+  color: var(--vitamui-primary);
 }
 
 .pastis-divider{
@@ -139,7 +139,7 @@
 }
 .list-item-select{
   @extend .list-item;
-  border-left: solid map-get($colors , 'primary-500' );
+  border-left: solid var(--vitamui-primary);
 }
 .list-item:hover{
   background: #F6F3FB;
@@ -189,7 +189,7 @@
   border: none;
 }
 .pastis-btn-add-ua-text{
-  color: map-get($colors, 'primary-500');
+  color: var(--vitamui-primary);
   font-family: Mulish;
   font-style: normal;
   font-weight: bold;
@@ -217,3 +217,10 @@
   background-color: var(--vitamui-primary) !important;
   box-shadow: none !important;
 }
+.text-medium-normal {
+  @extend .text-text-medium;
+}
+.text-medium-primary {
+  @extend .text-text-medium;
+  color: var(--vitamui-primary);
+}
diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts
index a25991df5..dfb24a75e 100644
--- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts
+++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts
@@ -720,16 +720,8 @@ export class FileTreeComponent implements OnDestroy {
     }
   }
 
-  selectedItem(node: FileNode){
-    if(this.selectedItemList && node){
-      if(this.selectedItemList.id == node.id){
-        return '#9c31b5';
-      }
-    }
-    return "none";
-  }
 
-  selectedItemSelected(node: FileNode): boolean{
+  selectedItem(node: FileNode): boolean{
     if(this.selectedItemList && node){
       if (node.name==='ManagementMetadata') {
         console.log(this)
-- 
GitLab