Repository: ranger
Updated Branches:
  refs/heads/master d02cdaee6 -> b35551124


RANGER-1944: Action filter for Admin Audit is not working

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

Branch: refs/heads/master
Commit: b35551124f765d3129eca6922102b29ae6c87586
Parents: d02cdae
Author: ni3galave <[email protected]>
Authored: Tue Jan 2 10:59:48 2018 +0530
Committer: Mehul Parikh <[email protected]>
Committed: Thu Jan 4 17:36:52 2018 +0530

----------------------------------------------------------------------
 .../src/main/webapp/scripts/utils/XAGlobals.js       | 11 +++++++++++
 .../main/webapp/scripts/views/reports/AuditLayout.js | 15 ++++++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/b3555112/security-admin/src/main/webapp/scripts/utils/XAGlobals.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/utils/XAGlobals.js 
b/security-admin/src/main/webapp/scripts/utils/XAGlobals.js
index d16e5de..d55ab4a 100644
--- a/security-admin/src/main/webapp/scripts/utils/XAGlobals.js
+++ b/security-admin/src/main/webapp/scripts/utils/XAGlobals.js
@@ -73,5 +73,16 @@ define(function(require){
                                                                'Permissions' : 
['modulePermissionsAction','modulePermissionEditAction'] },
                };
        
+       XAGlobals.ActionType = {
+                       Create : { value: 'create', label: 'Create' },
+                       Update : { value: 'update', label: 'Update' },
+                       Delete : { value: 'delete', label: 'Delete' },
+                       Password_Change : { value: 'password change', label: 
'Password Change' },
+                       Export_Json  : { value: 'EXPORT JSON',  label: 'Export 
Json' },
+                       Export_Csv   : { value: 'EXPORT CSV',   label: 'Export 
Csv' },
+                       Export_Excel : { value: 'EXPORT EXCEL', label: 'Export 
Excel' },
+                       Import_End   : { value: 'IMPORT END',   label: 'Import 
End' },
+                       Import_Start : { value: 'IMPORT START', label: 'Import 
Start'}
+       };
        return XAGlobals;
 });

http://git-wip-us.apache.org/repos/asf/ranger/blob/b3555112/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
----------------------------------------------------------------------
diff --git 
a/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js 
b/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
index 76a8aa5..0e864b6 100644
--- a/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/reports/AuditLayout.js
@@ -370,11 +370,11 @@ define(function(require) {
                        var that = this;
                        var searchOpt = ["Audit Type", "User", "Actions", 
"Session Id", "Start Date", "End Date"];
                        var serverAttrName  = [{text : "Audit Type", label 
:"objectClassType",'multiple' : true, 'optionsArr' : 
XAUtils.enumToSelectLabelValuePairs(XAEnums.ClassTypes)},
-                                              {text : "User", label :"owner"},
-                                              {text : "Actions", label 
:"action"},{text :  "Session Id", label :"sessionId"},
-                                              {text : 'Start Date',label 
:'startDate'},{text : 'End Date',label :'endDate'} ];
+                                               {text : "User", label 
:"owner"}, {text :  "Session Id", label :"sessionId"},
+                                               {text : 'Start Date',label 
:'startDate'},{text : 'End Date',label :'endDate'},
+                                               {text : "Actions", label 
:"action",'multiple' : true, 'optionsArr' : 
XAUtils.enumToSelectLabelValuePairs(XAGlobals.ActionType)},];
                        
-                       var auditList = [],query = '';
+                        var auditList = [],query = '', actionTypeList = [];
                        _.each(XAEnums.ClassTypes, function(obj){
                                if((obj.value == 
XAEnums.ClassTypes.CLASS_TYPE_XA_ASSET.value) 
                                                || (obj.value == 
XAEnums.ClassTypes.CLASS_TYPE_XA_RESOURCE.value) 
@@ -384,6 +384,11 @@ define(function(require) {
                                                || (obj.value == 
XAEnums.ClassTypes.CLASS_TYPE_XA_GROUP.value))
                                        auditList.push({label :obj.label, value 
:obj.label+''});
                        });
+                       _.each(XAGlobals.ActionType, function(obj){
+                               if(obj.label){
+                                       actionTypeList.push({label :obj.label, 
value :obj.label})
+                               }
+                       })
                        if(!_.isUndefined(App.sessionId)){
                                 App.vsHistory.admin = [] ;
                                query = '"Session Id": "'+App.sessionId+'"';
@@ -404,7 +409,7 @@ define(function(require) {
                                                                                
callback(auditList);
                                                                                
break;
                                                                        case 
'Actions':
-                                                                               
callback(["Create","Update","Delete","Password Change","Export Json","Export 
Csv","Export Excel","Import End","Import Start"]);
+                                                                               
callback(actionTypeList);
                                                                                
break;
                                                                        case 
'Start Date' :
                                                                                
        var endDate, models = 
that.visualSearch.searchQuery.where({category:"End Date"});

Reply via email to