fix(admin-ui): unable to map permission to the role using GUI #2400#2403
fix(admin-ui): unable to map permission to the role using GUI #2400#2403
Conversation
📝 WalkthroughWalkthroughRefactors GluuTypeAhead into a typed, memoized, Formik-aware component; updates MappingItem and MappingAddDialogForm to initialize and manage permission arrays correctly; changes MappingPage add flow to merge existing and new permissions into a payload before dispatch. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as User UI
participant Dialog as MappingAddDialogForm
participant Formik as Formik State
participant TypeAhead as GluuTypeAhead
participant Page as MappingPage
participant Store as Redux (actions)
rect #f0f8ff
Note over UI,Dialog: Open "Add Permission" dialog
UI->>Dialog: open(apiRole)
Dialog->>Formik: init form (mappingAddPermissions: [])
Dialog->>Dialog: getPermissionsForSearch(apiRole) -> filter existing
end
rect #f6fff0
Note over Formik,TypeAhead: Select permissions via TypeAhead
TypeAhead->>Formik: read value (formik.values.mappingAddPermissions)
UI->>TypeAhead: select permissions
TypeAhead->>Formik: handleChange -> setFieldValue('mappingAddPermissions', newValue)
end
rect #fff8f0
Note over Page,Store: Confirm add -> merge and dispatch
Dialog->>Page: onAddConfirmed(mappingData)
Page->>Page: compute existing permissions for role -> mergedPermissions
Page->>Store: dispatch addNewRolePermissions({ data: { role, permissions: mergedPermissions } })
Store->>Page: ack
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (2)admin-ui/plugins/admin/components/Mapping/MappingPage.js (1)
admin-ui/plugins/admin/components/Mapping/MappingAddDialogForm.js (1)
🔇 Additional comments (8)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|




fix(admin-ui): unable to map permission to the role using GUI #2400
Description
The Admin UI does not allow users to map a permission to a role from the Security → Mapping screen.
When selecting a role such as
api-viewerand attempting to search and add a permission, the operation does not work.Fix implemented
Steps Verified
api-viewer(or any role)🔗 Ticket
Closes: #2400
Summary by CodeRabbit
Refactor
Behavioral Changes
UX