You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by me...@apache.org on 2019/10/18 10:10:58 UTC

[ranger] branch master updated: RANGER-2622 : Ranger UI side code improvement.

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

mehul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new c600fcb  RANGER-2622 : Ranger UI side code improvement.
c600fcb is described below

commit c600fcbfbde71cbf242b0f68910f5d6c2ae9cb9a
Author: Nitin Galave <ni...@apache.org>
AuthorDate: Wed Oct 16 16:00:00 2019 +0530

    RANGER-2622 : Ranger UI side code improvement.
    
    Signed-off-by: Mehul Parikh <me...@apache.org>
---
 security-admin/src/main/webapp/scripts/models/VXRole.js          | 2 +-
 .../src/main/webapp/scripts/views/policies/RangerPolicyRO.js     | 2 +-
 .../src/main/webapp/scripts/views/reports/OperationDiffDetail.js | 2 +-
 security-admin/src/main/webapp/scripts/views/users/RoleCreate.js | 2 +-
 .../src/main/webapp/scripts/views/users/UserTableLayout.js       | 9 ++++++---
 5 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/security-admin/src/main/webapp/scripts/models/VXRole.js b/security-admin/src/main/webapp/scripts/models/VXRole.js
index c12ac2d..75aaab9 100644
--- a/security-admin/src/main/webapp/scripts/models/VXRole.js
+++ b/security-admin/src/main/webapp/scripts/models/VXRole.js
@@ -66,7 +66,7 @@ define(function(require){
                 name : {
                     type        : 'TextFieldWithIcon',
                     title       : localization.tt("lbl.roleName") +' *',
-                    validators  : ['required',{type:'regexp',regexp:/^([A-Za-z0-9_]|[\u00C0-\u017F])([a-z0-9,._\-+/@= ]|[\u00C0-\u017F])+$/i,message :' Invalid group name'}],
+                    validators  : ['required',{type:'regexp',regexp:/^([A-Za-z0-9_]|[\u00C0-\u017F])([a-z0-9,._\-+/@= ]|[\u00C0-\u017F])+$/i,message :' Invalid role name'}],
                     editorAttrs : { 'maxlength': 255},
                     errorMsg    : localization.tt('validationMessages.roleNameValidationMsg'),
                 },
diff --git a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
index 5811ccf..ba94e6f 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
@@ -280,7 +280,7 @@ define(function(require) {
 			//to support old policy log after updating that policy.
 			this.policy.set('serviceType',undefined);
 			if(this.policy.has('conditions')){
-				this.policy.set('conditions', '');
+				this.policy.unset('conditions', { silent: true });
 			}
 			this.policy.fetchByVersion(ver, {
 				cache : false,
diff --git a/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js b/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
index 36f9a2d..40cfd6d 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/OperationDiffDetail.js
@@ -270,7 +270,7 @@ define(function(require){
 					else if(prevRole == "ROLE_KEY_ADMIN")
 						m.set('previousValue',XAEnums.UserRoles.ROLE_KEY_ADMIN.label)
                     else if(prevRole == "ROLE_KEY_ADMIN_AUDITOR")
-                        m.set('previousValue',XAEnums.UserRoles.ROLE_KEY_ADMIN_AUIDTOR.label)
+                        m.set('previousValue',XAEnums.UserRoles.ROLE_KEY_ADMIN_AUDITOR.label)
                     else if(prevRole == "ROLE_ADMIN_AUDITOR")
                         m.set('previousValue',XAEnums.UserRoles.ROLE_ADMIN_AUDITOR.label)
 				} else {
diff --git a/security-admin/src/main/webapp/scripts/views/users/RoleCreate.js b/security-admin/src/main/webapp/scripts/views/users/RoleCreate.js
index 91da5ab..e40eb87 100644
--- a/security-admin/src/main/webapp/scripts/views/users/RoleCreate.js
+++ b/security-admin/src/main/webapp/scripts/views/users/RoleCreate.js
@@ -128,7 +128,7 @@ define(function(require){
                     XAUtil.blockUI('unblock');
                     XAUtil.allowNavigation();
                     Backbone.fetchCache._cache = {}
-                    var msg = that.editGroup ? 'Role updated successfully' :'Role created successfully';
+                    var msg = that.editRole ? 'Role updated successfully' :'Role created successfully';
                     XAUtil.notifySuccess('Success', msg);
                     App.usersGroupsListing = {'showLastPage' : true}
                     App.appRouter.navigate("#!/users/Roletab",{trigger: true});
diff --git a/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js b/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js
index dabad17..4050849 100755
--- a/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js
@@ -99,6 +99,9 @@ define(function(require){
 			if(_.isUndefined(this.groupList)){
 				this.groupList = new VXGroupList();
 			}
+			if(_.isUndefined(this.roleList)){
+				this.roleList = new VXRoleList();
+			}
 
 			this.bindEvents();
 		},
@@ -348,7 +351,7 @@ define(function(require){
 				gridOpts : {
 					row: tableRow,
 					header : XABackgrid,
-					emptyText : 'No Users found!'
+					emptyText : 'No users found!'
 				}
 			}));	
 
@@ -481,7 +484,7 @@ define(function(require){
 				gridOpts : {
 					row: tableRow,
 					header : XABackgrid,
-					emptyText : 'No Groups found!'
+					emptyText : 'No groups found!'
 				}
 			}));	
 
@@ -589,7 +592,7 @@ define(function(require){
                                 gridOpts : {
                                         row: tableRow,
                                         header : XABackgrid,
-                                        emptyText : 'No Groups found!'
+                                        emptyText : 'No roles found!'
                                 }
                         }));
                 },