Repository: incubator-ranger Updated Branches: refs/heads/master cab5b3da8 -> 83b6a0a03
RANGER-451 : Multiple user module bug fixes Signed-off-by: Velmurugan Periasamy <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/83b6a0a0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/83b6a0a0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/83b6a0a0 Branch: refs/heads/master Commit: 83b6a0a0399fa3d6f51fb6e8eb6b19467904213b Parents: cab5b3d Author: Gautam Borad <[email protected]> Authored: Mon May 4 19:45:02 2015 +0530 Committer: Velmurugan Periasamy <[email protected]> Committed: Mon May 4 10:44:00 2015 -0400 ---------------------------------------------------------------------- .../src/main/webapp/scripts/models/VXPortalUser.js | 4 ++-- .../src/main/webapp/scripts/utils/XAUtils.js | 15 ++++++++++----- .../webapp/scripts/views/policies/PermissionList.js | 4 ++-- .../src/main/webapp/scripts/views/users/UserForm.js | 4 ++-- .../webapp/scripts/views/users/UserTableLayout.js | 2 ++ security-admin/src/main/webapp/styles/xa.css | 9 +++++++++ 6 files changed, 27 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/83b6a0a0/security-admin/src/main/webapp/scripts/models/VXPortalUser.js ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/scripts/models/VXPortalUser.js b/security-admin/src/main/webapp/scripts/models/VXPortalUser.js index f2962e6..079fc9c 100644 --- a/security-admin/src/main/webapp/scripts/models/VXPortalUser.js +++ b/security-admin/src/main/webapp/scripts/models/VXPortalUser.js @@ -50,14 +50,14 @@ define(function(require){ firstName : { type : 'Text', title : localization.tt("lbl.firstName")+' *', - validators : ['required',{type:'regexp',regexp:/^[a-zA-Z][a-z0-9- ]*[a-zA-Z0-9]+$/,message :'First name should start with alphabets & can have hyphen, space.'}], + validators : ['required',{type:'regexp',regexp:/^[a-zA-Z][a-zA-Z0-9\s_-]*[a-zA-Z0-9]+$/,message :'First name should start with alphabets & can have underscore, hyphen, space.'}], editorAttrs : { 'placeholder' : localization.tt("lbl.firstName")} }, lastName : { type : 'Text', title : localization.tt("lbl.lastName")+' *', - validators : [{type:'regexp',regexp:/^[a-zA-Z][a-z0-9- ]*[a-zA-Z0-9]+$/,message :'Last name should start with alphabets & can have hyphen, space.'}], + validators : [{type:'regexp',regexp:/^[a-zA-Z][a-zA-Z0-9\s_-]*[a-zA-Z0-9]+$/,message :'Last name should start with alphabets & can have underscore, hyphen, space.'}], editorAttrs : { 'placeholder' : localization.tt("lbl.lastName")} }, emailAddress : { http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/83b6a0a0/security-admin/src/main/webapp/scripts/utils/XAUtils.js ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/scripts/utils/XAUtils.js b/security-admin/src/main/webapp/scripts/utils/XAUtils.js index f0a8723..b87ff51 100644 --- a/security-admin/src/main/webapp/scripts/utils/XAUtils.js +++ b/security-admin/src/main/webapp/scripts/utils/XAUtils.js @@ -437,25 +437,27 @@ define(function(require) { } var newGroupArr = _.map(groupArr, function(name, i) { if (i >= 4) - return '<span class="label label-info" policy-group-id="' + return '<span class="label label-info float-left-margin-2" policy-group-id="' + id + '" style="display:none;">' + name + '</span>'; else if (i == 3 && groupArr.length > 4) { showMoreLess = true; - return '<span class="label label-info" policy-group-id="' + return '<span class="label label-info float-left-margin-2" policy-group-id="' + id + '">' + name + '</span>'; } else - return '<span class="label label-info" policy-group-id="' + return '<span class="label label-info float-left-margin-2" policy-group-id="' + id + '">' + name + '</span>'; }); if (showMoreLess) { newGroupArr - .push('<span class="pull-left"><a href="javascript:void(0);" data-id="showMore" class="" policy-group-id="' + .push('<span class="float-left-margin-2"><a href="javascript:void(0);" data-id="showMore" class="" policy-group-id="' + id - + '"><code style=""> + More..</code></a></span><span class="pull-left" ><a href="javascript:void(0);" data-id="showLess" class="" policy-group-id="' + + '"><code style=""> + More..</code></a></span><span class="float-left-margin-2"><a href="javascript:void(0);" data-id="showLess" class="" policy-group-id="' + id + '" style="display:none;"><code> - Less..</code></a></span>'); } + newGroupArr.unshift('<div data-id="groupsDiv">'); + newGroupArr.push('</div>'); return newGroupArr.length ? newGroupArr.join(' ') : '--'; } else return '--'; @@ -546,6 +548,9 @@ define(function(require) { XAUtils.defaultErrorHandler = function(model, error) { var App = require('App'); var vError = require('views/common/ErrorView'); + if(!_.isUndefined(model) && !_.isUndefined(model.modelName) && model.modelName == XAEnums.ClassTypes.CLASS_TYPE_XA_ACCESS_AUDIT.modelName){ + return; + } if (error.status == 404) { App.rContent.show(new vError({ status : error.status http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/83b6a0a0/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js b/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js index 978d242..38e528a 100644 --- a/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js +++ b/security-admin/src/main/webapp/scripts/views/policies/PermissionList.js @@ -361,8 +361,8 @@ define(function(require) { vals.push.apply(vals, m.get(name+'Name').split(',')); } }); - if(!_.isEmpty($select.select2('val'))) - selectedVals = $select.select2('val'); + if(!_.isEmpty($select.select2('data'))) + selectedVals = _.map($select.select2('data'),function(obj){ return obj.text}); vals.push.apply(vals , selectedVals); vals = $.unique(vals); return vals; http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/83b6a0a0/security-admin/src/main/webapp/scripts/views/users/UserForm.js ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/scripts/views/users/UserForm.js b/security-admin/src/main/webapp/scripts/views/users/UserForm.js index c94a20e..abd3097 100644 --- a/security-admin/src/main/webapp/scripts/views/users/UserForm.js +++ b/security-admin/src/main/webapp/scripts/views/users/UserForm.js @@ -83,12 +83,12 @@ define(function(require){ firstName : { type : 'Text', title : localization.tt("lbl.firstName")+' *', - validators : ['required',{type:'regexp',regexp:/^[a-zA-Z][a-z0-9- ]*[a-zA-Z0-9]+$/,message :'First name should start with alphabets & can have hyphen, space.'}] + validators : ['required',{type:'regexp',regexp:/^[a-zA-Z][a-zA-Z0-9\s_-]*[a-zA-Z0-9]+$/,message :'First name should start with alphabets & can have underscore, hyphen, space.'}] }, lastName : { type : 'Text', title : localization.tt("lbl.lastName"), - validators : [{type:'regexp',regexp:/^[a-zA-Z][a-z0-9- ]*[a-zA-Z0-9]+$/,message :'Last name should start with alphabets & can have hyphen, space.'}] + validators : [{type:'regexp',regexp:/^[a-zA-Z][a-zA-Z0-9\s_-]*[a-zA-Z0-9]+$/,message :'Last name should start with alphabets & can have underscore, hyphen, space.'}] }, emailAddress : { type : 'Text', http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/83b6a0a0/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js ---------------------------------------------------------------------- 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 89a9a36..136ae5d 100644 --- a/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js +++ b/security-admin/src/main/webapp/scripts/views/users/UserTableLayout.js @@ -531,12 +531,14 @@ define(function(require){ this.rTableList.$el.find('[policy-group-id="'+id+'"]').show(); $('[data-id="showLess"][policy-group-id="'+id+'"]').show(); $('[data-id="showMore"][policy-group-id="'+id+'"]').hide(); + $('[data-id="showMore"][policy-group-id="'+id+'"]').parents('div[data-id="groupsDiv"]').addClass('set-height-groups'); }, onShowLess : function(e){ var id = $(e.currentTarget).attr('policy-group-id'); this.rTableList.$el.find('[policy-group-id="'+id+'"]').slice(4).hide(); $('[data-id="showLess"][policy-group-id="'+id+'"]').hide(); $('[data-id="showMore"][policy-group-id="'+id+'"]').show(); + $('[data-id="showMore"][policy-group-id="'+id+'"]').parents('div[data-id="groupsDiv"]').removeClass('set-height-groups') }, /** all post render plugin initialization */ initializePlugins: function(){ http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/83b6a0a0/security-admin/src/main/webapp/styles/xa.css ---------------------------------------------------------------------- diff --git a/security-admin/src/main/webapp/styles/xa.css b/security-admin/src/main/webapp/styles/xa.css index 7deda0d..6b1d77f 100644 --- a/security-admin/src/main/webapp/styles/xa.css +++ b/security-admin/src/main/webapp/styles/xa.css @@ -1826,3 +1826,12 @@ td.select-row-cell { border: 1px solid #dddddd; padding-left: 0; } +.set-height-groups{ + width: 100%; + height: 100px; + overflow-x: hidden; +} +.float-left-margin-2{ + float: left; + margin: 2px; +}
