You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by dg...@apache.org on 2020/12/04 16:11:13 UTC

[incubator-datalab] branch develop updated: [DATALAB-2141]: Fixed role values change their position during update (#1003)

This is an automated email from the ASF dual-hosted git repository.

dgnatyshyn pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git


The following commit(s) were added to refs/heads/develop by this push:
     new d28e498  [DATALAB-2141]: Fixed role values change their position during update (#1003)
d28e498 is described below

commit d28e498550b0f5375d94eda1e1ce48d5e272fd07
Author: Dmytro Gnatyshyn <42...@users.noreply.github.com>
AuthorDate: Fri Dec 4 18:11:05 2020 +0200

    [DATALAB-2141]: Fixed role values change their position during update (#1003)
    
    [DATALAB-2141]: Fixed role values change their position during update
---
 .../app/administration/roles/roles.component.ts    | 34 +++++++++-------------
 1 file changed, 14 insertions(+), 20 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
index b194851..a44922b 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/roles/roles.component.ts
@@ -165,13 +165,7 @@ export class RolesComponent implements OnInit {
       case 'update':
         this.rolesService.updateGroup($event.value).subscribe(() => {
           this.toastr.success(`Group data is updated successfully!`, 'Success!');
-          // if (!$event.value.roleIds.includes('admin' || 'projectAdmin')) {
-          //   this.applicationSecurityService.isLoggedIn().subscribe(() => {
-          //     this.getEnvironmentHealthStatus();
-          //   });
-          // } else {
             this.openManageRolesDialog();
-          // }
         }, (re) => this.toastr.error('Failed group data updating!', 'Oops!'));
 
         break;
@@ -194,6 +188,20 @@ export class RolesComponent implements OnInit {
     }
   }
 
+  public updateGroupData(groups) {
+    this.groupsData = groups.map(v => {
+      if (!v.users) {
+        v.users = [];
+      }
+      return v;
+    }).sort((a, b) => (a.group > b.group) ? 1 : ((b.group > a.group) ? -1 : 0));
+    this.groupsData.forEach(item => {
+      const selectedRoles = item.roles.map(role => ({role: role.description, type: role.type, cloud: role.cloud}));
+      item.selected_roles = SortUtils.sortByKeys(selectedRoles, ['role', 'type']);
+    });
+    this.getGroupsListCopy();
+  }
+
   public extractIds(sourceList, target) {
     const map = new Map();
     const mapped = sourceList.reduce((acc, item) => {
@@ -214,20 +222,6 @@ export class RolesComponent implements OnInit {
     return obj;
   }
 
-  public updateGroupData(groups) {
-    this.groupsData = groups.map(v => {
-      if (!v.users) {
-        v.users = [];
-      }
-      return v;
-    }).sort((a, b) => (a.group > b.group) ? 1 : ((b.group > a.group) ? -1 : 0));
-    this.groupsData.forEach(item => {
-      const selectedRoles = item.roles.map(role => ({role: role.description, type: role.type, cloud: role.cloud}));
-      item.selected_roles = SortUtils.sortByKeys(selectedRoles, ['type']);
-    });
-    this.getGroupsListCopy();
-  }
-
   private getGroupsListCopy() {
     this.startedGroups = JSON.parse(JSON.stringify(this.groupsData));
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org