This is an automated email from the ASF dual-hosted git repository. dhavalrajpara pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ranger.git
commit d793c59482a280355d919baa499de765621ba1d4 Author: Mugdha Varadkar <mug...@apache.org> AuthorDate: Fri Mar 8 12:46:10 2024 +0530 RANGER-4737 : The inactivityTimeout is getting reset when user updates its profile from UserProfile page Signed-off-by: Dhaval.Rajpara <dhavalrajpara1...@gmail.com> --- .../UserGroupRoleListing/users_details/UserFormComp.jsx | 13 +++++++++++-- .../src/main/webapp/react-webapp/src/views/UserProfile.jsx | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/security-admin/src/main/webapp/react-webapp/src/views/UserGroupRoleListing/users_details/UserFormComp.jsx b/security-admin/src/main/webapp/react-webapp/src/views/UserGroupRoleListing/users_details/UserFormComp.jsx index 3cafa2848..d57d6571c 100644 --- a/security-admin/src/main/webapp/react-webapp/src/views/UserGroupRoleListing/users_details/UserFormComp.jsx +++ b/security-admin/src/main/webapp/react-webapp/src/views/UserGroupRoleListing/users_details/UserFormComp.jsx @@ -32,8 +32,8 @@ import { } from "Utils/XAEnums"; import { toast } from "react-toastify"; import { getUserAccessRoleList, serverError } from "Utils/XAUtils"; -import { getUserProfile } from "Utils/appState"; -import { has, isEmpty, isUndefined } from "lodash"; +import { getUserProfile, setUserProfile } from "Utils/appState"; +import { cloneDeep, has, isEmpty, isUndefined } from "lodash"; import { SyncSourceDetails } from "../SyncSourceDetails"; import { BlockUi } from "../../../components/CommonComponents"; import { InfoIcon } from "../../../utils/XAUtils"; @@ -112,6 +112,15 @@ function UserFormComp(props) { type: "SET_BLOCK_UI", blockUI: false }); + + const userProps = cloneDeep(getUserProfile()); + if (userProps.loginId == userInfo.name) { + userProps.firstName = userEditData.firstName; + userProps.emailAddress = userEditData.emailAddress; + userProps.lastName = userEditData.lastName; + + setUserProfile(userProps); + } toast.success("User updated successfully!!"); navigate("/users/usertab"); } catch (error) { diff --git a/security-admin/src/main/webapp/react-webapp/src/views/UserProfile.jsx b/security-admin/src/main/webapp/react-webapp/src/views/UserProfile.jsx index 17db1bb29..b074a40a9 100644 --- a/security-admin/src/main/webapp/react-webapp/src/views/UserProfile.jsx +++ b/security-admin/src/main/webapp/react-webapp/src/views/UserProfile.jsx @@ -55,6 +55,9 @@ class UserProfile extends Component { skipNavigate: true }); this.setState({ blockUI: false }); + if (has(profResp, "data")) { + profResp.data["configProperties"] = userProps.configProperties; + } setUserProfile(profResp.data); this.props.navigate("/"); toast.success("Successfully updated user profile");