Repository: ranger
Updated Branches:
  refs/heads/ranger-1 b7998dee4 -> 7e19c5355


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/7e19c535
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/7e19c535
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/7e19c535

Branch: refs/heads/ranger-1
Commit: 7e19c5355b7c7d604214d43f2b42fd997b11346b
Parents: b7998de
Author: ni3galave <[email protected]>
Authored: Tue Sep 11 18:32:57 2018 +0530
Committer: Mehul Parikh <[email protected]>
Committed: Wed Sep 19 11:36:13 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/7e19c535/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