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

pradeep 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 c169d6d  RANGER-3568 : Services of one zone are seen in other zone 
from UI
c169d6d is described below

commit c169d6d5608172c752c4a44a1b61d2cfd8567158
Author: Dhaval.Rajpara <dhavalrajpara1...@gmail.com>
AuthorDate: Mon Jan 3 19:21:42 2022 +0530

    RANGER-3568 : Services of one zone are seen in other zone from UI
    
    Signed-off-by: pradeep <prad...@apache.org>
---
 security-admin/src/main/webapp/scripts/views/UploadServicePolicy.js    | 2 ++
 .../src/main/webapp/scripts/views/policymanager/ServiceLayout.js       | 3 ++-
 .../main/webapp/scripts/views/policymanager/ServiceLayoutSidebar.js    | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/security-admin/src/main/webapp/scripts/views/UploadServicePolicy.js 
b/security-admin/src/main/webapp/scripts/views/UploadServicePolicy.js
index 6ef5637..55cfce9 100644
--- a/security-admin/src/main/webapp/scripts/views/UploadServicePolicy.js
+++ b/security-admin/src/main/webapp/scripts/views/UploadServicePolicy.js
@@ -223,6 +223,7 @@ define(function(require){
                         return m.name == that.ui.zoneDestination.val();
                     })
                     var zoneServiceListModel = new RangerServiceList();
+                    zoneServiceListModel.clear();
                     zoneServiceListModel.fetch({
                         cache : false,
                         async : false,
@@ -385,6 +386,7 @@ define(function(require){
                         return m.name == e.val
                     })
                     var zoneServiceListModel = new RangerServiceList();
+                    zoneServiceListModel.clear();
                     zoneServiceListModel.fetch({
                         cache : false,
                         async : false,
diff --git 
a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js 
b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
index e3593e8..589a89a 100644
--- 
a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
+++ 
b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayout.js
@@ -326,12 +326,12 @@ define(function(require){
                 if(e.added){
                     App.vZone.vZoneId = e.added.zoneId;
                     XAUtil.changeParamToUrlFragment({"securityZone" : e.val}, 
that.collection.modelName);
+                    that.zoneServiceList.clear();
                     that.zoneServiceList.fetch({
                                                cache : false,
                                                async : false,
                                                url : 
"service/public/v2/api/zones/"+e.added.zoneId+"/service-headers",
                                        })
-
                 } else {
                     App.vZone.vZoneId = null;
                     //for url change on UI
@@ -369,6 +369,7 @@ define(function(require){
                     App.vZone.vZoneId = zoneID;
                 }
                 if (_.isEmpty(this.zoneServiceList.attributes)) {
+                    this.zoneServiceList.clear()
                     this.zoneServiceList.fetch({
                         cache : false,
                         async : false,
diff --git 
a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayoutSidebar.js
 
b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayoutSidebar.js
index e6a47ab..d7d4639 100644
--- 
a/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayoutSidebar.js
+++ 
b/security-admin/src/main/webapp/scripts/views/policymanager/ServiceLayoutSidebar.js
@@ -403,6 +403,7 @@ define(function(require){
                 App.vZone.vZoneName = e.val;
                 if(e.added){
                     App.vZone.vZoneId = e.added.zoneId;
+                    that.zoneServiceList.clear();
                     that.zoneServiceList.fetch({
                         cache : false,
                         async : false,

Reply via email to