Skip to content

Commit

Permalink
Merge pull request #974 from AI4Bharat/Rahul-539
Browse files Browse the repository at this point in the history
Warning pop-up message upon demotion of user roles.
  • Loading branch information
ishvindersethi22 authored Mar 18, 2024
2 parents 538e12f + 5538202 commit 53e3dfc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ui/pages/container/Admin/EditProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,15 @@ const EditProfile = (props) => {
id="demo-simple-select-helper"
value={Role}
label="Role"
onChange={(e) => setRole(e.target.value)}
//onChange={(e) => setRole(e.target.value)}
onChange={(e) => {
const newRole = e.target.value;
const currentRole = Role;
if (newRole < currentRole) {
alert("Warning: Demoting someone’s role on the platform may cause inconsistencies and is not advised. Please check with platform admins on this");
}
setRole(newRole);
}}
sx={{
textAlign: "left",
}}
Expand Down

0 comments on commit 53e3dfc

Please sign in to comment.