Skip to content

Commit

Permalink
Merge pull request #7533 from amanda-ariyaratne/fix-manager-value-dis…
Browse files Browse the repository at this point in the history
…play

Fix manager.value value display in profile
  • Loading branch information
amanda-ariyaratne authored Feb 7, 2025
2 parents 0c77568 + 2f4f0b8 commit b7a5004
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-monkeys-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/admin.users.v1": patch
---

Fix enterprise schema sub attributes not displaying in console profile
29 changes: 14 additions & 15 deletions features/admin.users.v1/components/user-profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -451,21 +451,20 @@ export const UserProfile: FunctionComponent<UserProfilePropsInterface> = (
const schemaName: string = schemaNames[0];
const schemaSecondaryProperty: string = schemaNames[1];

if (schema.extended && userInfo[userConfig.userProfileSchema]) {
schemaName && schemaSecondaryProperty &&
userInfo[userConfig.userProfileSchema][schemaName] &&
userInfo[userConfig.userProfileSchema][schemaName][schemaSecondaryProperty] && (
tempProfileInfo.set(schema.name,
userInfo[userConfig.userProfileSchema][schemaName][schemaSecondaryProperty])
);
} else if (schema.extended && userInfo[ProfileConstants.SCIM2_ENT_USER_SCHEMA]
&& userInfo[ProfileConstants.SCIM2_ENT_USER_SCHEMA][schemaName]) {
const enterpriseUserInfo: {[key: string]: any}
= userInfo[ProfileConstants.SCIM2_ENT_USER_SCHEMA];

tempProfileInfo.set(
schema.name, enterpriseUserInfo[schemaName][schemaSecondaryProperty]
);
const userProfileSchema: string = userInfo
?.[userConfig.userProfileSchema]?.[schemaName]
?.[schemaSecondaryProperty];

const enterpriseSchema: string = userInfo
?.[ProfileConstants.SCIM2_ENT_USER_SCHEMA]?.[schemaName]
?.[schemaSecondaryProperty];

if (schema.extended && (userProfileSchema || enterpriseSchema)) {
if (userProfileSchema) {
tempProfileInfo.set(schema.name, userProfileSchema);
} else if (enterpriseSchema) {
tempProfileInfo.set(schema.name, enterpriseSchema);
}
} else {
const subValue: SubValueInterface = userInfo[schemaName] &&
Array.isArray(userInfo[schemaName]) &&
Expand Down

0 comments on commit b7a5004

Please sign in to comment.