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

commit e2c15ed30ee35bfeea33dc1af1b8c29fbfbcb7b0
Author: Nitin Galave <[email protected]>
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'));

Reply via email to