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

ni3galave 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 3db2009  RANGER-3323 : Ranger Hive Table lookup is not working.
3db2009 is described below

commit 3db20090ba448f844eee69661e11f008ca259128
Author: Nitin Galave <ni3gal...@apache.org>
AuthorDate: Mon Jun 28 11:00:27 2021 +0530

    RANGER-3323 : Ranger Hive Table lookup is not working.
---
 .../main/webapp/scripts/views/policies/RangerPolicyForm.js   | 11 +++++++++--
 .../webapp/scripts/views/security_zone/ZoneResourceForm.js   | 12 ++++++++++--
 .../scripts/views/service/ServiceAuditFilterResources.js     | 12 ++++++++++--
 3 files changed, 29 insertions(+), 6 deletions(-)

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 4f08c75..3ea1db3 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyForm.js
@@ -852,7 +852,7 @@ define(function(require){
                        }
                },
                getDataParams : function(term, options) {
-                       var resources = {},resourceName = options.type;
+                       var resources = {},resourceName = options.type, 
dataResources = {};
                        var isParent = true, name = options.type, val = 
null,isCurrentSameLevelField = true;
                        while(isParent){
                                var currentResource = 
_.findWhere(this.getResources(), {'name': name });
@@ -880,10 +880,17 @@ define(function(require){
                                }
                                isCurrentSameLevelField = false;
                        }
+                       if(resources && !_.isEmpty(resources)) {
+                               _.each(resources, function(val, key) {
+                                       dataResources[key] = _.map(val, 
function(obj){
+                                               return obj.text
+                                       })
+                               })
+                       }
                        var context ={
                                        'userInput' : term,
                                        'resourceName' : resourceName,
-                                       'resources' : resources
+                                       'resources' : dataResources
                                };
                        return JSON.stringify(context);
                },
diff --git 
a/security-admin/src/main/webapp/scripts/views/security_zone/ZoneResourceForm.js
 
b/security-admin/src/main/webapp/scripts/views/security_zone/ZoneResourceForm.js
index 1725670..700d4f4 100644
--- 
a/security-admin/src/main/webapp/scripts/views/security_zone/ZoneResourceForm.js
+++ 
b/security-admin/src/main/webapp/scripts/views/security_zone/ZoneResourceForm.js
@@ -436,7 +436,8 @@ define(function(require) {
 
             getDataParams: function(term, options) {
                 var resources = {},
-                    resourceName = options.type;
+                    resourceName = options.type,
+                    dataResources = {};
                 var isParent = true,
                     name = options.type,
                     val = null,
@@ -469,10 +470,17 @@ define(function(require) {
                     }
                     isCurrentSameLevelField = false;
                 }
+                if(resources && !_.isEmpty(resources)) {
+                    _.each(resources, function(val, key) {
+                        dataResources[key] = _.map(val, function(obj){
+                            return obj.text
+                        })
+                    })
+                }
                 var context = {
                     'userInput': term,
                     'resourceName': resourceName,
-                    'resources': resources
+                    'resources': dataResources
                 };
                 return JSON.stringify(context);
             },
diff --git 
a/security-admin/src/main/webapp/scripts/views/service/ServiceAuditFilterResources.js
 
b/security-admin/src/main/webapp/scripts/views/service/ServiceAuditFilterResources.js
index 318cdcb..6a489b5 100644
--- 
a/security-admin/src/main/webapp/scripts/views/service/ServiceAuditFilterResources.js
+++ 
b/security-admin/src/main/webapp/scripts/views/service/ServiceAuditFilterResources.js
@@ -422,7 +422,8 @@ define(function(require) {
 
             getDataParams: function(term, options) {
                 var resources = {},
-                    resourceName = options.type;
+                    resourceName = options.type,
+                    dataResources = {};
                 var isParent = true,
                     name = options.type,
                     val = null,
@@ -455,10 +456,17 @@ define(function(require) {
                     }
                     isCurrentSameLevelField = false;
                 }
+                if(resources && !_.isEmpty(resources)) {
+                    _.each(resources, function(val, key) {
+                        dataResources[key] = _.map(val, function(obj){
+                            return obj.text
+                        })
+                    })
+                }
                 var context = {
                     'userInput': term,
                     'resourceName': resourceName,
-                    'resources': resources
+                    'resources': dataResources
                 };
                 return JSON.stringify(context);
             },

Reply via email to