You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ni...@apache.org on 2019/03/11 08:40:40 UTC

[ranger] branch master updated: RANGER-2350: Ranger UI: Clicking on zone edit Breadcrumb redirect to 404 page not found

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 a5c6adb  RANGER-2350: Ranger UI: Clicking on zone edit Breadcrumb redirect to 404 page not found
a5c6adb is described below

commit a5c6adb025a8c741774ca893a995edd3d7beca25
Author: Nitin Galave <ni...@apache.org>
AuthorDate: Fri Mar 8 19:54:30 2019 +0530

    RANGER-2350: Ranger UI: Clicking on zone edit Breadcrumb redirect to 404 page not found
---
 .../src/main/java/org/apache/ranger/common/AppConstants.java     | 2 +-
 security-admin/src/main/webapp/scripts/modules/XALinks.js        | 9 +--------
 security-admin/src/main/webapp/scripts/utils/XAEnums.js          | 2 +-
 security-admin/src/main/webapp/scripts/utils/XAViewUtils.js      | 8 ++++----
 security-admin/src/main/webapp/templates/helpers/XAHelpers.js    | 2 +-
 5 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java b/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java
index 34391a3..09ed06a 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/AppConstants.java
@@ -980,7 +980,7 @@ public class AppConstants extends RangerCommonEnums {
 			return "Usersync Audit Info"; //CLASS_TYPE_UGYNC_AUDIT_INFO
 		}
 		if( elementValue == 1056 ) {
-			return "Ranger Secuity Zone"; //CLASS_TYPE_RANGER_SECURITY_ZONE
+			return "Ranger Security Zone"; //CLASS_TYPE_RANGER_SECURITY_ZONE
 		}
 		return null;
 	}
diff --git a/security-admin/src/main/webapp/scripts/modules/XALinks.js b/security-admin/src/main/webapp/scripts/modules/XALinks.js
index a462033..7885b72 100755
--- a/security-admin/src/main/webapp/scripts/modules/XALinks.js
+++ b/security-admin/src/main/webapp/scripts/modules/XALinks.js
@@ -309,15 +309,8 @@ define(function(require) {
                 title: 'h.zoneCreate'
             },
             ZoneEdit : function(options){
-                var href = "javascript:void(0);";
-                if(_.has(options,'model')){
-                    href =  '#!/zone/edit/'+options.model.get('id');
-                }
-                if(_.has(options,'id')){
-                    href =  '#!/zone/edit'+options.id;
-                }
                 return {
-                    href : href,
+                    href : 'javascript:void(0);',
                     text : 'h.zoneEdit',
                     title: 'h.zoneEdit'
                 };
diff --git a/security-admin/src/main/webapp/scripts/utils/XAEnums.js b/security-admin/src/main/webapp/scripts/utils/XAEnums.js
index 4865a4f..c67ad3d 100644
--- a/security-admin/src/main/webapp/scripts/utils/XAEnums.js
+++ b/security-admin/src/main/webapp/scripts/utils/XAEnums.js
@@ -184,7 +184,7 @@ define(function(require) {
 		CLASS_TYPE_XA_TRANSACTION_LOG_ATTRIBUTE:{value:1012, label:'Transaction log attribute', rbkey:'xa.enum.ClassTypes.CLASS_TYPE_XA_TRANSACTION_LOG_ATTRIBUTE', tt: 'lbl.ClassTypes_CLASS_TYPE_XA_TRANSACTION_LOG_ATTRIBUTE'},
 		CLASS_TYPE_RANGER_POLICY:{value:1020, label:'Ranger Policy', rbkey:'xa.enum.ClassTypes.CLASS_TYPE_RANGER_POLICY', modelName:'VXRangerPolicy', type:'vXResource', tt: 'lbl.ClassTypes_CLASS_TYPE_RANGER_POLICY'},
 		CLASS_TYPE_RANGER_SERVICE:{value:1030, label:'Ranger Service', rbkey:'xa.enum.ClassTypes.CLASS_TYPE_RANGER_SERVICE', modelName:'VXRangerService', type:'vXRangerService', tt: 'lbl.ClassTypes_CLASS_TYPE_RANGER_SERVICE'},
-		CLASS_TYPE_RANGER_SECURITY_ZONE:{value:1056, label:'Ranger Secuity Zone', rbkey:'xa.enum.ClassTypes.CLASS_TYPE_RANGER_SECURITY_ZONE', modelName:'VXRangerService', type:'vXRangerService', tt: 'lbl.ClassTypes_CLASS_TYPE_RANGER_SECURITY_ZONE'}
+		CLASS_TYPE_RANGER_SECURITY_ZONE:{value:1056, label:'Ranger Security Zone', rbkey:'xa.enum.ClassTypes.CLASS_TYPE_RANGER_SECURITY_ZONE', modelName:'VXRangerService', type:'vXRangerService', tt: 'lbl.ClassTypes_CLASS_TYPE_RANGER_SECURITY_ZONE'}
 	});
 
 	XAEnums.DataType = mergeParams(XAEnums.DataType, {
diff --git a/security-admin/src/main/webapp/scripts/utils/XAViewUtils.js b/security-admin/src/main/webapp/scripts/utils/XAViewUtils.js
index a9f7df3..6ef3343 100644
--- a/security-admin/src/main/webapp/scripts/utils/XAViewUtils.js
+++ b/security-admin/src/main/webapp/scripts/utils/XAViewUtils.js
@@ -35,14 +35,14 @@ define(function(require) {
             && model.get('requestData')){
             if(resourcePath && !_.isEmpty(model.get('requestData'))) {
                 return '<div class="clearfix">\
-                            <div class="pull-left resourceText" title="'+ resourcePath+'">'+resourcePath+'</div>\
+                            <div class="pull-left resourceText" title="'+ _.escape(resourcePath)+'">'+_.escape(resourcePath)+'</div>\
                             <div class="pull-right">\
                                 <div class="queryInfo btn btn-mini link-tag query-icon" title="Query Info" data-name = "queryInfo" data-id ="'+model.get('id')+'">\
                                     <i class="icon-table" ></i>\
                                 </div>\
                             </div>\
                         </div>\
-                        <div title="'+resourceType+'" class="border-top-1">'+resourceType+'</div>';
+                        <div title="'+_.escape(resourceType)+'" class="border-top-1">'+_.escape(resourceType)+'</div>';
             }else{
                 return '<div class="clearfix">\
                             <div class="pull-left">--</div>\
@@ -55,8 +55,8 @@ define(function(require) {
             }
         }else{
             if(resourcePath){
-                return '<div class ="resourceText" title="'+resourcePath+'">'+resourcePath+'</div>\
-                        <div title="'+resourceType+'" class="border-top-1">'+resourceType+'</div>';
+                return '<div class ="resourceText" title="'+_.escape(resourcePath)+'">'+_.escape(resourcePath)+'</div>\
+                        <div title="'+_.escape(resourceType)+'" class="border-top-1">'+_.escape(resourceType)+'</div>';
             }else{
                 return '--';
             }
diff --git a/security-admin/src/main/webapp/templates/helpers/XAHelpers.js b/security-admin/src/main/webapp/templates/helpers/XAHelpers.js
index 181ffc4..1d4f04e 100644
--- a/security-admin/src/main/webapp/templates/helpers/XAHelpers.js
+++ b/security-admin/src/main/webapp/templates/helpers/XAHelpers.js
@@ -571,7 +571,7 @@
 		_.each(zoneServiceResources, function(resourceGroup){
 			resourceStr += '<div class="zone-resource">';
 			_.map(resourceGroup,function(res, resType){ 
-				resourceStr +=  '<strong>' + resType + '</strong> : ' + res + '<br>' ;
+				resourceStr +=  '<strong>' + _.escape(resType) + '</strong> : ' + _.escape(res) + '<br>' ;
 			});
 			resourceStr += '</div>';
 		});