-
Notifications
You must be signed in to change notification settings - Fork 22
fix(admin-ui): resolve data inconsistency issues in My Profile #2601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds missing locale entries for user fields, refactors ProfilePage (memoization, rendering helpers, theme and skeleton constants, userInum resolution and API gating), extends profile types, and changes post-action navigation in user-management pages from Changes
Sequence Diagram(s)sequenceDiagram
participant UI as "ProfilePage (UI)"
participant Auth as "AuthState / Session"
participant API as "Userinfo API"
participant Renderer as "Render Helpers"
UI->>Auth: read session / apiAccessToken / userInum
Auth-->>UI: returns hasSession / apiAccessToken / stateUserInum
UI->>API: fetch profile (if canMakeApiCall)
API-->>UI: profile data (givenName, sn, mail, attrs...)
UI->>Renderer: renderField / renderDisplayName / renderUserRolesField
Renderer-->>UI: composed UI elements (badges, skeletons, fields)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@admin-ui/app/routes/Apps/Profile/ProfilePage.tsx`:
- Around line 171-181: The surname currently renders from userinfo
(renderField('fields.sn', userinfo?.family_name, loading)) which can be missing;
update the call to prefer profileDetails (e.g., profileDetails?.sn or
profileDetails?.surname) and fall back to userinfo?.family_name if needed so it
aligns with other fields. Modify the renderField invocation for 'fields.sn' to
use profileDetails first and only use userinfo as a fallback, keeping the same
loading argument and leaving renderField, profileDetails and userinfo
identifiers intact.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
admin-ui/app/routes/Apps/Profile/types.ts (1)
36-40: AddhasSession?: booleantoAuthStateto avoid unsafe casts.
ProfilePagecurrently type-assertsauthStatejust to accesshasSession. Adding it here keeps type safety and removes the need for assertions.♻️ Proposed update
export interface AuthState { userinfo?: UserInfo token?: AuthToken | null issuer?: string | null userInum?: string | null + hasSession?: boolean }
♻️ Duplicate comments (1)
admin-ui/app/routes/Apps/Profile/ProfilePage.tsx (1)
175-180: PreferprofileDetails.sn/surnamebefore customAttributes for last name.If the API returns
sn/surnameas top-level fields (now in the type), the current lookup can still render-. Prefer the direct fields and keep the customAttributes lookup as a fallback.🔧 Suggested adjustment
{renderField( 'fields.sn', - profileDetails?.customAttributes?.find( - (att: CustomAttribute) => att?.name === 'sn', - )?.values?.[0], + profileDetails?.sn ?? + profileDetails?.surname ?? + profileDetails?.customAttributes?.find( + (att: CustomAttribute) => att?.name === 'sn', + )?.values?.[0], loading, )}


fix(admin-ui): resolve data inconsistency issues in My Profile (#2599)
Summary
This PR fixes multiple data consistency and usability issues in My Profile sections of the Admin UI.
Issues Addressed
My Profile
🔗 Ticket
Closes: #2599
Summary by CodeRabbit
New Features
Improvements
Improvements (Navigation)
✏️ Tip: You can customize this high-level summary in your review settings.