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 2020/10/20 06:06:37 UTC

[ranger] 03/03: RANGER-3044 : User is not able to change the password from user profile page

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

ni3galave pushed a commit to branch ranger-2.2
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit 2b98b58c606f8e9b3ac159739f1cf2261cfc1691
Author: Nitin Galave <ni...@apache.org>
AuthorDate: Mon Oct 19 16:16:46 2020 +0530

    RANGER-3044 : User is not able to change the password from user profile page
---
 .../webapp/scripts/model_bases/VXPortalUserBase.js | 30 ----------------------
 .../src/main/webapp/scripts/models/VXPortalUser.js |  4 +--
 .../main/webapp/scripts/views/user/UserProfile.js  |  5 ++++
 3 files changed, 6 insertions(+), 33 deletions(-)

diff --git a/security-admin/src/main/webapp/scripts/model_bases/VXPortalUserBase.js b/security-admin/src/main/webapp/scripts/model_bases/VXPortalUserBase.js
index ece67e3..fdef2a8 100644
--- a/security-admin/src/main/webapp/scripts/model_bases/VXPortalUserBase.js
+++ b/security-admin/src/main/webapp/scripts/model_bases/VXPortalUserBase.js
@@ -35,9 +35,6 @@ define(function(require){
 			"id" : {
 				"dataType" : "Long"
 			},
-			"version" : {
-				"dataType" : "int"
-			},
 			"createDate" : {
 				"dataType" : "Date"
 			},
@@ -48,36 +45,12 @@ define(function(require){
 				"dataType" : "list",
 				"listType" : "VNameValue"
 			},
-			"forUserId" : {
-				"dataType" : "Long"
-			},
-			"loginId" : {
-				"dataType" : "String"
-			},
 			"password" : {
 				"dataType" : "String"
 			},
-			"profileImageGId" : {
-				"dataType" : "Long"
-			},
-			"status" : {
-				"dataType" : "int"
-			},
 			"emailAddress" : {
 				"dataType" : "String"
 			},
-			"isTestUser" : {
-				"dataType" : "boolean"
-			},
-			"isRegistered" : {
-				"dataType" : "boolean"
-			},
-			"isInternal" : {
-				"dataType" : "boolean"
-			},
-			"gender" : {
-				"dataType" : "int"
-			},
 			"firstName" : {
 				"dataType" : "String"
 			},
@@ -90,9 +63,6 @@ define(function(require){
 			"userSource" : {
 				"dataType" : "int"
 			},
-			"timeZone" : {
-				"dataType" : "String"
-			},
 			"userRoleList" : {
 				"dataType" : "list",
 				"listType" : "String"
diff --git a/security-admin/src/main/webapp/scripts/models/VXPortalUser.js b/security-admin/src/main/webapp/scripts/models/VXPortalUser.js
index 0292ceb..e2d4447 100644
--- a/security-admin/src/main/webapp/scripts/models/VXPortalUser.js
+++ b/security-admin/src/main/webapp/scripts/models/VXPortalUser.js
@@ -35,9 +35,7 @@ define(function(require){
 		 */
 
 		schema : function(){
-			var attrs = _.omit(this.serverSchema, 'id', 'createDate', 'updateDate', "version",
-					"displayOption", "permList", "forUserId", "status", "priGrpId",
-					 "updatedBy","isSystem");
+			var attrs = _.omit(this.serverSchema, 'id', 'createDate', 'updateDate', "permList", "publicScreenName");
 
 			_.each(attrs, function(o){
 				o.type = 'Hidden';
diff --git a/security-admin/src/main/webapp/scripts/views/user/UserProfile.js b/security-admin/src/main/webapp/scripts/views/user/UserProfile.js
index 11d1bed..9ae07ee 100644
--- a/security-admin/src/main/webapp/scripts/views/user/UserProfile.js
+++ b/security-admin/src/main/webapp/scripts/views/user/UserProfile.js
@@ -120,6 +120,7 @@ define(function(require){
 			if(! _.isEmpty(errors)){
 				return;
 			}
+			XAUtil.blockUI();
 			this.form.afterCommit();
 			if(this.showBasicFields){
 				this.saveUserDetail();
@@ -131,12 +132,14 @@ define(function(require){
 			this.model.saveUserProfile(this.model,{
 				wait: true,
 				success: function () {
+					XAUtil.blockUI('unblock');
 					XAUtil.notifySuccess('Success', "User profile updated successfully !!");
 					SessionMgr.updateUserProfile();
 					App.appRouter.navigate("#!/policymanager/resource",{trigger: true});
 					Communicator.vent.trigger('ProfileBar:rerender');
 				},
 				error: function (model, response, options) {
+					XAUtil.blockUI('unblock');
 					if(model.responseJSON != undefined && _.isArray(model.responseJSON.messageList)){
 						if(model.responseJSON.messageList[0].name == "INVALID_INPUT_DATA"){
 							if (model.responseJSON.msgDesc == "Validation failure"){
@@ -173,11 +176,13 @@ define(function(require){
 			this.model.changePassword(this.model.get('id'),vPasswordChange,{
 				wait: true,
 				success: function () {
+					XAUtil.blockUI('unblock');
 					XAUtil.notifySuccess('Success', "User profile updated successfully !!");
 					App.appRouter.navigate("#!/policymanager/resource",{trigger: true});
 					that.clearPasswordFields();
 				},
 				error: function (msResponse, options) {
+					XAUtil.blockUI('unblock');
 					XAUtil.notifyError('Error', 'Error occured while updating user profile');
 					if(localization.tt(msResponse.responseJSON.msgDesc) == "Invalid new password"){
 						that.form.fields.newPassword.setError(localization.tt('validationMessages.newPasswordError'));