Skip to content
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

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
98b5191
Add multi valued fields
PasinduYeshan Jul 12, 2024
fe73c74
Add actions to multivalued fields
PasinduYeshan Jul 12, 2024
ce35db5
Add changeset
PasinduYeshan Jul 12, 2024
b00e664
Merge branch 'wso2:master' into feature/mv-console
PasinduYeshan Jul 13, 2024
acd2afe
Update translations
PasinduYeshan Jul 13, 2024
7c17639
Fix lint issues
PasinduYeshan Jul 15, 2024
0ec2a90
Fix lint issues
PasinduYeshan Jul 15, 2024
2284ce8
Hide verify button in mobile numbers field
PasinduYeshan Jul 15, 2024
39b1aac
Refactor - Address comments
PasinduYeshan Jul 15, 2024
9e4a12d
Remove additional lines
PasinduYeshan Jul 15, 2024
ff215e5
Hide delete button for required primary email/mobile
PasinduYeshan Jul 15, 2024
a04f12a
Add limit to multiple emails and mobile numbers
PasinduYeshan Jul 17, 2024
8560bd9
Add componentids
PasinduYeshan Jul 17, 2024
77d4842
Change governance config labels
PasinduYeshan Jul 18, 2024
9aa976b
Remove governance config and add deployment config for multiple email…
PasinduYeshan Jul 19, 2024
f85c1af
Merge remote-tracking branch 'upstream/master' into feature/mv-console
PasinduYeshan Sep 26, 2024
9e8f133
Add required constants
PasinduYeshan Sep 26, 2024
15a75c4
Merge remote-tracking branch 'upstream/master' into feature/mv-console
PasinduYeshan Oct 10, 2024
60485ad
Fix lint issue and refactor user-profile.
PasinduYeshan Oct 14, 2024
a89c368
lint
PasinduYeshan Oct 14, 2024
489972c
Add missing componentids
PasinduYeshan Oct 14, 2024
1f436b4
Improve logic to add existing primary email/mobile to the list when p…
PasinduYeshan Oct 16, 2024
615fdbb
Enable,disable multi emails and mobiles based on gov config
PasinduYeshan Oct 20, 2024
5c4e314
Update logic to use excluded user stores
PasinduYeshan Nov 5, 2024
d0374e3
Handle single valued data
PasinduYeshan Nov 7, 2024
03a0be1
Remove trailing spaces
PasinduYeshan Nov 7, 2024
f018a55
Refactor
PasinduYeshan Nov 7, 2024
6f7caa1
Merge remote-tracking branch 'upstream/master' into feature/mv-console
PasinduYeshan Nov 7, 2024
33374b4
Merge remote-tracking branch 'upstream/master' into feature/mv-console
PasinduYeshan Nov 7, 2024
a3eff62
Fix merge issues
PasinduYeshan Nov 7, 2024
22bdbde
Merge remote-tracking branch 'upstream/master' into feature/mv-console
PasinduYeshan Nov 8, 2024
3d52207
Address PR Comments
PasinduYeshan Nov 9, 2024
f3976c0
Address comments
PasinduYeshan Nov 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/cyan-rockets-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@wso2is/admin.users.v1": minor
"@wso2is/admin.server-configurations.v1": patch
"@wso2is/i18n": patch
---
PasinduYeshan marked this conversation as resolved.
Show resolved Hide resolved

Add UI support for multiple email and mobile numbers per user
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@
{% if console.ui.show_app_switch_button is defined %}
"showAppSwitchButton": {{ console.ui.show_app_switch_button }},
{% endif %}
{% if identity_mgt.user_claim_update.enable_multiple_emails_and_mobile_numbers is defined %}
"isMultipleEmailsAndMobileNumbersEnabled": {{ identity_mgt.user_claim_update.enable_multiple_emails_and_mobile_numbers }},
{% endif %}
"features": {
{% if console.extensions.features is defined %}
{% for name, feature in console.extensions.features.items() %}
Expand Down
1 change: 1 addition & 0 deletions apps/console/src/public/deployment.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,7 @@
"isHeaderAvatarLabelAllowed": false,
"isLeftNavigationCategorized": true,
"isMarketingConsentBannerEnabled": false,
"isMultipleEmailsAndMobileNumbersEnabled": false,
PasinduYeshan marked this conversation as resolved.
Show resolved Hide resolved
"isPasswordInputValidationEnabled": true,
"isRequestPathAuthenticationEnabled": false,
"isSAASDeployment": false,
Expand Down
4 changes: 3 additions & 1 deletion features/admin.core.v1/configs/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ export class Config {
isGroupAndRoleSeparationEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isGroupAndRoleSeparationEnabled,
isHeaderAvatarLabelAllowed: window[ "AppUtils" ]?.getConfig()?.ui?.isHeaderAvatarLabelAllowed,
isLeftNavigationCategorized: window[ "AppUtils" ]?.getConfig()?.ui?.isLeftNavigationCategorized,
isMarketingConsentBannerEnabled: window[ "AppUtils" ]?.getConfig()?.ui?.isMarketingConsentBannerEnabled,
isMarketingConsentBannerEnabled: window["AppUtils"]?.getConfig()?.ui?.isMarketingConsentBannerEnabled,
isMultipleEmailsAndMobileNumbersEnabled:
window["AppUtils"]?.getConfig()?.ui?.isMultipleEmailsAndMobileNumbersEnabled,
isPasswordInputValidationEnabled: window["AppUtils"]?.getConfig()?.ui?.isPasswordInputValidationEnabled,
isRequestPathAuthenticationEnabled:
window[ "AppUtils" ]?.getConfig()?.ui?.isRequestPathAuthenticationEnabled,
Expand Down
4 changes: 4 additions & 0 deletions features/admin.core.v1/models/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,10 @@ export interface UIConfigInterface extends CommonUIConfigInterface<FeatureConfig
* Config to check whether consent is required for trusted apps.
*/
isTrustedAppConsentRequired?: boolean;
/**
* Config to check whether the multiple emails and mobile numbers per user feature is enabled.
*/
isMultipleEmailsAndMobileNumbersEnabled?: boolean;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
export class ServerConfigurationsConstants {

/**
* Private constructor to avoid object instantiation from outside the class.
*
*/
* Private constructor to avoid object instantiation from outside the class.
*
*/
/* eslint-disable @typescript-eslint/no-empty-function */
private constructor() { }

Expand Down Expand Up @@ -314,6 +314,18 @@ export class ServerConfigurationsConstants {
public static readonly PASSWORD_POLICY_PATTERN: string = "passwordPolicy.pattern";
public static readonly PASSWORD_POLICY_ERROR_MESSAGE: string = "passwordPolicy.errorMsg";

/**
* User claim update - API Keyword constants.
*/
public static readonly ENABLE_MOBILE_VERIFICATION: string = "UserClaimUpdate.MobileNumber.EnableVerification";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

public static readonly ENABLE_EMAIL_VERIFICATION: string = "UserClaimUpdate.Email.EnableVerification";
public static readonly ENABLE_MOBILE_VERIFICATION_BY_PRIVILEGED_USER: string
= "UserClaimUpdate.MobileNumber.EnableVerificationByPrivilegedUser";

PasinduYeshan marked this conversation as resolved.
Show resolved Hide resolved
public static readonly ENABLE_MULTIPLE_EMAILS_AND_MOBILE_NUMBERS: string =
"UserClaimUpdate.EnableMultipleEmailsAndMobileNumbers";

/**
* Real Configurations constants.
*/
Expand All @@ -335,7 +347,7 @@ export class ServerConfigurationsConstants {
"configurations.";

public static readonly ADMIN_ADVISORY_BANNER_CONFIGS_UPDATE_REQUEST_ERROR: string = "An error occurred " +
"while updating the admin advisory banner configurations.";
"while updating the admin advisory banner configurations.";

public static readonly ADMIN_ADVISORY_BANNER_CONFIGS_INVALID_INPUT_ERROR: string = "An invalid input value " +
"in the request.";
Expand Down
96 changes: 96 additions & 0 deletions features/admin.users.v1/components/user-profile.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/**
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

.multi-valued-accordion {
.accordion-summary {
display: flex;
padding: 0px 12px 0px 8px;
flex-wrap: nowrap;
align-items: center;
gap: 4px;
border-radius: 8px;

.accordion-label {
margin: 0 0 0 8px;
flex-shrink: 0;
padding-right: 4px;
min-width: 250px;

&.mobile-label {
min-width: 150px;
}
}

.verified-icon, .primary-icon {
align-items: center;
padding: 0 4px;
}
}

.accordion-details {
border-radius: 8px;

.multi-value-table {

PasinduYeshan marked this conversation as resolved.
Show resolved Hide resolved
.multi-value-table-data-row {
&:last-child td, &:last-child th {
border: none;
}
}

.table-c1 {
display: flex;
flex-wrap: nowrap;
align-items: center;
font-size: 1rem;

.c1-value{
margin-bottom: 0;
flex-shrink: 0;
padding-right: 12px;
min-width: 250px;

&.mobile-label {
min-width: 150px;
}
}

.verified-icon, .primary-icon {
align-items: center;
padding: 0 4px;
}
}

.table-c2 {
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: flex-end;
gap: 4px;
}
}
}

.MuiAccordionDetails-root {
padding: 0px;
}

.MuiAccordionSummary-root {
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adjustment was required coz, in the Oxygen UI, the accordion details section shifts slightly to the right. While this alignment correct, in this case, the details should be displayed without the offset.

Without css:
image

With css:
image

min-height: 48px;
}
}
Loading
Loading