You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/06/25 14:18:30 UTC
[incubator-dlab] 04/05: [DLAB-652]: update health status check
after applying action
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch feature/projects
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 5ef0b61c768a11783ae3b807e7e854fe58b010bf
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Jun 25 17:17:35 2019 +0300
[DLAB-652]: update health status check after applying action
---
.../app/administration/roles/roles.component.ts | 43 ++++++++++++----------
1 file changed, 24 insertions(+), 19 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 16e5a67..a47c9ee 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
@@ -44,7 +44,7 @@ export class RolesComponent implements OnInit {
public healthStatus: any;
public delimitersRegex = /[-_]?/g;
public groupnamePattern = new RegExp(/^[a-zA-Z0-9_\-]+$/);
-
+
stepperView: boolean = false;
displayedColumns: string[] = ['name', 'roles', 'users', 'actions'];
@Output() manageRolesGroupAction: EventEmitter<{}> = new EventEmitter();
@@ -57,8 +57,8 @@ export class RolesComponent implements OnInit {
) { }
ngOnInit() {
- this.openManageRolesDialog();
- this.getEnvironmentHealthStatus();
+ this.openManageRolesDialog();
+ this.getEnvironmentHealthStatus();
}
openManageRolesDialog() {
@@ -68,12 +68,12 @@ export class RolesComponent implements OnInit {
this.roles = roles;
this.rolesList = roles.map(role => role.description);
this.updateGroupData(groups);
-
+
this.stepperView = false;
},
error => this.toastr.error(error.message, 'Oops!'));
},
- error => this.toastr.error(error.message, 'Oops!'));
+ error => this.toastr.error(error.message, 'Oops!'));
}
getGroupsData() {
@@ -89,15 +89,16 @@ export class RolesComponent implements OnInit {
public manageAction(action: string, type: string, item?: any, value?) {
if (action === 'create') {
this.manageRolesGroups(
- { action, type, value: {
- name: this.setupGroup,
- users: this.setupUser ? this.setupUser.split(',').map(elem => elem.trim()) : [],
- roleIds: this.extractIds(this.roles, this.setupRoles)
- }
- });
+ {
+ action, type, value: {
+ name: this.setupGroup,
+ users: this.setupUser ? this.setupUser.split(',').map(elem => elem.trim()) : [],
+ roleIds: this.extractIds(this.roles, this.setupRoles)
+ }
+ });
this.stepperView = false;
} else if (action === 'delete') {
- const data = (type === 'users') ? {group: item.group, user: value} : {group: item.group, id: item};
+ const data = (type === 'users') ? { group: item.group, user: value } : { group: item.group, id: item };
const dialogRef: MatDialogRef<ConfirmDeleteUserAccountDialogComponent> = this.dialog.open(
ConfirmDeleteUserAccountDialogComponent,
{ data: data, width: '550px', panelClass: 'error-modalbox' }
@@ -106,17 +107,21 @@ export class RolesComponent implements OnInit {
dialogRef.afterClosed().subscribe(result => {
if (result) {
const emitValue = (type === 'users')
- ? {action, type, id: item.name, value: { user: value, group: item.group }}
- : {action, type, id: item.name, value: item.group} ;
+ ? { action, type, id: item.name, value: { user: value, group: item.group } }
+ : { action, type, id: item.name, value: item.group };
this.manageRolesGroups(emitValue);
}
});
} else if (action === 'update') {
- this.manageRolesGroups({action, type, value: {
- name: item.group,
- roleIds: this.extractIds(this.roles, item.selected_roles),
- users: item.users || [] }});
+ this.manageRolesGroups({
+ action, type, value: {
+ name: item.group,
+ roleIds: this.extractIds(this.roles, item.selected_roles),
+ users: item.users || []
+ }
+ });
}
+ this.getEnvironmentHealthStatus();
this.resetDialog();
}
@@ -151,7 +156,7 @@ export class RolesComponent implements OnInit {
default:
}
}
-
+
public extractIds(sourceList, target) {
return sourceList.reduce((acc, item) => {
target.includes(item.description) && acc.push(item._id);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org