-
Notifications
You must be signed in to change notification settings - Fork 259
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
[Console] Add UI Support for Multiple Email Addresses and Mobile Numbers per User #6583
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6583 +/- ##
==========================================
+ Coverage 31.79% 32.02% +0.22%
==========================================
Files 41 41
Lines 890 893 +3
Branches 204 215 +11
==========================================
+ Hits 283 286 +3
+ Misses 607 557 -50
- Partials 0 50 +50
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…rimary is changed or add new one.
padding: 0px; | ||
} | ||
|
||
.MuiAccordionSummary-root { |
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.
Do we need to override these values? typically (if Oxygen-UI components are used) adjusting these will not be needed
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.
const domainName: string[] = profileInfo?.get("userName")?.toString().split("/"); | ||
const userStoreDomain: string = (domainName.length > 1 | ||
? domainName[0] | ||
: PRIMARY_USERSTORE)?.toUpperCase(); |
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.
Is this expected? Is the userstore primary
in both Asgardeo and IS?
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.
If not use the constants from userstoreConfig
so that it will properly resolve to primary
and default
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.
This is intended, In asgardeo users in DEFAULT user store has user store domain as prefix to username (DEFAULT/test1@abc.com), here Im checking what is the user store domain of the user, if the user name doesnt have user store domain prefixed, then it should be "PRIMARY", in both IS and Asgardeo.
if (multiValuedAttributes.includes(schemaNames[0])) { | ||
|
||
const attributeValue: string | string[] = | ||
userInfo[ProfileConstants.SCIM2_WSO2_CUSTOM_SCHEMA]?.[schemaNames[0]]; |
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.
Similar to PRIMARY_USERSTORE
const, is the ProfileConstants.SCIM2_WSO2_CUSTOM_SCHEMA
expected? This also might vary within products. If it is so, get this value from the userConfig
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.
Check in other places as well
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.
if (
schema.extended && userInfo[ProfileConstants.SCIM2_WSO2_CUSTOM_SCHEMA]
&& userInfo[ProfileConstants.SCIM2_WSO2_CUSTOM_SCHEMA][schemaNames[0]]
) {
const multiValuedAttributes: string[] = [
EMAIL_ADDRESSES_ATTRIBUTE,
MOBILE_NUMBERS_ATTRIBUTE,
VERIFIED_EMAIL_ADDRESSES_ATTRIBUTE,
VERIFIED_MOBILE_NUMBERS_ATTRIBUTE
];
if (multiValuedAttributes.includes(schemaNames[0])) {
**const attributeValue: string | string[] =
userInfo[ProfileConstants.SCIM2_WSO2_CUSTOM_SCHEMA]?.[schemaNames[0]];**
const formattedValue: string = Array.isArray(attributeValue)
? attributeValue.join(",")
: "";
tempProfileInfo.set(schema.name, formattedValue);
return;
}
tempProfileInfo.set(
schema.name, userInfo[ProfileConstants.SCIM2_WSO2_CUSTOM_SCHEMA][schemaNames[0]]
);
return;
}
Here I have added this custom logic under userInfo[ProfileConstants.SCIM2_WSO2_CUSTOM_SCHEMA] handling, part. And these new attributes are registered under wso2 custom schema in both IS and Asgardeo.
|
||
</label> | ||
{ | ||
showVerifiedPopup(accordionLabelValue) |
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.
Don't we need to use react states to dynamically display these elements? I'm only seeing JS variables used within this function
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.
These values are derived from profileInfo which is already managed by state. When verification happens, profileInfo gets updated, causing a re-render, and these values are recomputed automatically.
* User claim update - API Keyword constants. | ||
*/ | ||
public static readonly ENABLE_MOBILE_VERIFICATION: string = "UserClaimUpdate.MobileNumber.EnableVerification"; | ||
|
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.
features/admin.server-configurations.v1/constants/server-configurations-constants.ts
Show resolved
Hide resolved
/** | ||
* Excluded user stores. | ||
*/ | ||
excludedUserStores?: string; |
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.
excluded user stores is something that doesn't belong to profile schema interface.
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.
It was introduced recently to scim2/Schema.
.catch((error: AxiosError) => { | ||
if (error?.response?.data?.detail || error?.response?.data?.description) { | ||
dispatch(addAlert({ | ||
description: error?.response?.data?.detail || error?.response?.data?.description, |
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.
Let's not display the error description coming from the backend, as we can't guarantee that the BE always returns a end user friendly message. Let's show the generic description defined on the frontend instead.
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.
We have shown the description in other places as well, I think this is useful in some cases, since console is used by Admins it's okay to show this kind of errors. For example, an LDAP-specific error message provides more insight than a generic error, guiding admins to address attribute compatibility.
🦋 Changeset detectedThe changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. |
Purpose
Add UI support for multiple email addresses and mobile numbers per user feature.
Key changes
When multiple email and mobile number support is enabled:
Primary Indicators: The primary email and mobile number are marked with a star icon for easy identification.
Verified Indicators:
Admin Actions:
Related Issues
Merge after