ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From me...@apache.org
Subject [12/28] ranger git commit: RANGER-2153 Supply the function of reverting policy history version.
Date Tue, 04 Sep 2018 12:58:22 GMT
RANGER-2153 Supply the function of reverting policy history version.

Signed-off-by: pengjianhua <35573597@qq.com>


Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/be3dc31a
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/be3dc31a
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/be3dc31a

Branch: refs/heads/ranger-1.1
Commit: be3dc31a4f64f7d00077850af8e75479ad551b9b
Parents: 87fccb5
Author: zhangqiang2 <zhangqiang2@zte.com.cn>
Authored: Thu Aug 2 15:33:55 2018 +0800
Committer: Mehul Parikh <mehul@apache.org>
Committed: Tue Sep 4 11:36:01 2018 +0530

----------------------------------------------------------------------
 .../src/main/webapp/scripts/views/policies/RangerPolicyRO.js | 8 ++++++--
 .../webapp/scripts/views/policies/RangerPolicyTableLayout.js | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/be3dc31a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
index 1e3554f..3a6a59e 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyRO.js
@@ -287,7 +287,7 @@ define(function(require) {
 			}
 		},
 
-		revert : function(e){
+		revert : function(e, collection, modal){
 			e.preventDefault();
 			var policyId = this.policy.attributes.id;
 			var rangerPolicy = new RangerPolicy({id : policyId});
@@ -297,7 +297,11 @@ define(function(require) {
 				success: function() {
 					XAUtil.blockUI('unblock');
 					XAUtil.notifySuccess('Success', 'Policy reverted successfully.');
-					location.reload();
+					collection.fetch({
+						cache : false,
+						reset : true
+					});
+					modal.close();
 				},
 				error: function(model, response, options) {
 					XAUtil.blockUI('unblock');

http://git-wip-us.apache.org/repos/asf/ranger/blob/be3dc31a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
----------------------------------------------------------------------
diff --git a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
index 83253e4..1150838 100644
--- a/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
+++ b/security-admin/src/main/webapp/scripts/views/policies/RangerPolicyTableLayout.js
@@ -203,7 +203,7 @@ define(function(require){
 					view.nextVer(e);
 				});
 				policyVerEl.after('<a id="revert" href="#" class="btn btn-primary" style="display:none;">Revert</a>').next('#revert').click(function(e){
-					view.revert(e);
+					view.revert(e, that.collection, modal);
 				});
 				modal.$el.find('.cancel').hide();
 			});


Mime
View raw message