fix(admin-ui): unable to remove or reassign admin roles from user profile#2688
fix(admin-ui): unable to remove or reassign admin roles from user profile#2688faisalsiddique4400 wants to merge 8 commits intomainfrom
Conversation
…file (#2684) Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughReplaced modal toggle with an explicit Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@admin-ui/plugins/user-management/components/PasswordChangeModal.tsx`:
- Line 257: The PasswordChangeModal forces a light theme by passing
isDark={false} to the password fields; remove the hard-coded isDark prop (both
occurrences) so the inputs inherit the global/theme context instead, or replace
it with a theme-aware value from the app's theme hook if explicit control is
required; locate the isDark={false} props in PasswordChangeModal.tsx on the
password input components and delete them or wire them to the theme provider
instead.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3703c359-15d7-44c4-9c44-5967d5acb14c
📒 Files selected for processing (1)
admin-ui/plugins/user-management/components/PasswordChangeModal.tsx
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
admin-ui/plugins/user-management/components/UserForm.tsx (1)
137-146: 🧹 Nitpick | 🔵 TrivialThe
closeModal()call insubmitFormis redundant.Looking at the context snippet from
GluuCommitDialogLegacy, thehandler()(which is nowcloseModal) is already called in thefinallyblock ofhandleAcceptafteronAcceptcompletes. CallingcloseModal()explicitly insubmitForm(line 142) beforeonSubmitDataresults in the modal being closed twice.Since
setModal(false)is idempotent, this doesn't cause functional issues, but the call is unnecessary.♻️ Optional: Remove redundant closeModal call
const submitForm = useCallback( (usermessage: string) => { if (isSubmitting) { return } - closeModal() onSubmitData(formik.values, modifiedFields, usermessage) }, - [closeModal, onSubmitData, formik.values, modifiedFields, isSubmitting], + [onSubmitData, formik.values, modifiedFields, isSubmitting], )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@admin-ui/plugins/user-management/components/UserForm.tsx` around lines 137 - 146, Remove the redundant closeModal() invocation from the submitForm callback: the modal is already closed by the handler (closeModal) invoked in the finally block of GluuCommitDialogLegacy.handleAccept, so delete the closeModal() call inside submitForm and leave the existing onSubmitData(formik.values, modifiedFields, usermessage) invocation intact; update the dependency array if necessary (remove closeModal if no longer referenced) to avoid stale lint warnings.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@admin-ui/plugins/user-management/components/UserForm.tsx`:
- Around line 137-146: Remove the redundant closeModal() invocation from the
submitForm callback: the modal is already closed by the handler (closeModal)
invoked in the finally block of GluuCommitDialogLegacy.handleAccept, so delete
the closeModal() call inside submitForm and leave the existing
onSubmitData(formik.values, modifiedFields, usermessage) invocation intact;
update the dependency array if necessary (remove closeModal if no longer
referenced) to avoid stale lint warnings.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 9d4e23c9-a49b-4cc9-b268-555acdb60677
📒 Files selected for processing (1)
admin-ui/plugins/user-management/components/UserForm.tsx
Signed-off-by: faisalsiddique4400 <faisalsiddique10886@gmail.com>
|






fix(admin-ui): unable to remove or reassign admin roles from user profile (#2684)
Summary
This PR fixes an issue where admin roles could not be removed or reassigned from a user's profile in the Admin UI.
Issue
When attempting to remove roles such as
jansAdminRoleoruserRolefrom a user (e.g., admin user), the operation fails and the roles cannot be updated from the UI.Fix
Result
🔗 Ticket
Closes: #2684
Summary by CodeRabbit
Bug Fixes
Style