From 94f43b8e204872a5f4ab062e78ee8d242c463ff0 Mon Sep 17 00:00:00 2001
From: NOUMANE <ahmed.noumane@xelians.fr>
Date: Fri, 8 Jan 2021 17:13:59 +0100
Subject: [PATCH] [US TRTL-661] fix  Modification of the user group

---
 .../user/group-attribution/group-attribution.component.html | 2 +-
 .../user/group-attribution/group-attribution.component.ts   | 2 ++
 .../group-attribution/group-list/group-list.component.ts    | 6 +++++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html
index 93c7f49cf..1fe59e363 100644
--- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html
+++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.html
@@ -4,7 +4,7 @@
 
 <div class="mt-3 content">
   <div>
-    <app-group-list [groups] = "activeGroups" (selectedGroupEvent)="updateGroup($event)"></app-group-list>
+    <app-group-list [groups] = "activeGroups" (selectedGroupEvent)="updateGroup($event)" [userGroupName] = "userGroupName"></app-group-list>
   </div>
   <div class="actions">
     <button type="button" class="btn primary" (click)="saveUserUpdate()" [disabled]="!selectedGroupName" i18n="group attribution edit@@groupAttributionEdit">Modifier</button>
diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts
index c7e274a85..da600c306 100644
--- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts
+++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts
@@ -62,6 +62,7 @@ export class GroupAttributionComponent implements OnInit {
   activeGroups: GroupSelection[];
   selectedGroupName: string;
   CUSTOMER_ACTIVE_PROFILE_GROUPS_INDEX = 2;
+  userGroupName: string;
 
   public stepIndex = 0;
   public stepCount = 1;
@@ -78,6 +79,7 @@ export class GroupAttributionComponent implements OnInit {
 
   public ngOnInit(): void {
     this.user = this.data[0];
+    this.userGroupName = this.data[1].name;
     this.resetActiveGroups();
   }
 
diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts
index 9f76fb939..d81f28314 100644
--- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts
+++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts
@@ -39,7 +39,6 @@ import { Component, EventEmitter, Inject, Input, OnInit, Output } from '@angular
 import { MAT_DIALOG_DATA } from '@angular/material/dialog';
 import { collapseAnimation, rotateAnimation } from 'ui-frontend-common';
 import { GroupSelection } from './../../group-selection.interface';
-
 @Component({
   selector: 'app-group-list',
   templateUrl: './group-list.component.html',
@@ -60,6 +59,11 @@ export class GroupListComponent implements OnInit {
   @Input()
   public searchActiv = false;
 
+  @Input()
+  public set userGroupName(val: string) {
+    this.groupName = val;
+  }
+
   @Output()
   public selectedGroupEvent = new EventEmitter<GroupSelection>();
 
-- 
GitLab