Repository: ranger
Updated Branches:
  refs/heads/ranger-1.1 46d31a92c -> bb8575ef7


RANGER-2215: Can't copy and paste multiple paths into Ranger Admin UI for HDFS 
create policy

Signed-off-by: Mehul Parikh <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/bb8575ef
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/bb8575ef
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/bb8575ef

Branch: refs/heads/ranger-1.1
Commit: bb8575ef777daba5b97e6212e546a8960526de6e
Parents: 46d31a9
Author: ni3galave <[email protected]>
Authored: Tue Sep 11 18:32:57 2018 +0530
Committer: Mehul Parikh <[email protected]>
Committed: Wed Sep 19 11:41:50 2018 +0530

----------------------------------------------------------------------
 .../scripts/views/policies/RangerPolicyForm.js       | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/bb8575ef/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js 
b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
index e3d9635..6c0cf36 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
@@ -597,11 +597,16 @@ define(function(require){
                         $(this).removeClass('working');
                     },
                     search: function() {
-                        if(!_.isUndefined(this.value) && 
_.contains(this.value,',')){
-                            _.each(this.value.split(',') , function(tag){
-                                
that.fields[that.pathFieldName].editor.$el.tagit("createTag", tag);
-                            });
-                            return false;
+                        if(!_.isUndefined(this.value) && (/[ 
,]+/).test(this.value)){
+                            var values = this.value.trim().split(/[ ,]+/);
+                            if (values.length > 1) {
+                                for (var i = 0; i < values.length; i++) {
+                                    
that.fields[that.pathFieldName].editor.$el.find('[data-js="resource"]').tagit("createTag",
 values[i]);
+                                }
+                                return ''
+                            } else {
+                                return val
+                            }
                         }
                         var term = extractLast( this.value );
                         $(this).addClass('working');

Reply via email to