diff --git a/.changeset/light-seas-dance.md b/.changeset/light-seas-dance.md new file mode 100644 index 00000000000..baea536ec5c --- /dev/null +++ b/.changeset/light-seas-dance.md @@ -0,0 +1,6 @@ +--- +"@wso2is/admin.users.v1": patch +"@wso2is/myaccount": patch +--- + +Hide multi email and mobile specifc attributes. diff --git a/apps/myaccount/src/components/profile/profile.tsx b/apps/myaccount/src/components/profile/profile.tsx index a22343c3f56..4127336638e 100644 --- a/apps/myaccount/src/components/profile/profile.tsx +++ b/apps/myaccount/src/components/profile/profile.tsx @@ -18,13 +18,16 @@ import { ProfileConstants } from "@wso2is/core/constants"; import { IdentityAppsApiException } from "@wso2is/core/exceptions"; -import { - getUserNameWithoutDomain, - hasRequiredScopes, +/** + * `useRequiredScopes` is not supported for myaccount. + */ +/* eslint-disable no-restricted-imports */ +import { getUserNameWithoutDomain, hasRequiredScopes, isFeatureEnabled, resolveUserDisplayName, resolveUserEmails } from "@wso2is/core/helpers"; +/* eslint-enable */ import { ProfileSchemaInterface, SBACInterface, @@ -75,6 +78,10 @@ import { CommonUtils } from "../../utils"; import { EditSection, SettingsSection } from "../shared"; import { MobileUpdateWizard } from "../shared/mobile-update-wizard"; +// TODO: Remove this once multiple email and mobile support is onboarded. +const multipleEmailMobileFeatureSpecificSchemaNames: string[] = [ "emailAddresses", "verifiedEmailAddresses", + "mobileNumbers", "verifiedMobileNumbers" ]; + /** * Prop types for the basic details component. * Also see {@link Profile.defaultProps} @@ -739,6 +746,10 @@ export const Profile: FunctionComponent = (props: ProfileProps): R const isProfileUsernameReadonly: boolean = config.ui.isProfileUsernameReadonly; const { displayName, name } = schema; + if (multipleEmailMobileFeatureSpecificSchemaNames?.includes(name)) { + return; + } + if (isProfileUsernameReadonly) { const usernameClaim: string = "username"; diff --git a/features/admin.users.v1/components/user-profile.tsx b/features/admin.users.v1/components/user-profile.tsx index ea690948348..c814bf8bf74 100644 --- a/features/admin.users.v1/components/user-profile.tsx +++ b/features/admin.users.v1/components/user-profile.tsx @@ -66,6 +66,10 @@ import { updateUserInfo } from "../api"; import { AdminAccountTypes, LocaleJoiningSymbol, UserManagementConstants } from "../constants"; import { AccountConfigSettingsInterface, SchemaAttributeValueInterface, SubValueInterface } from "../models"; +// TODO: Remove this once multiple email and mobile support is onboarded. +const multipleEmailMobileFeatureSpecificSchemaNames: string[] = [ "emailAddresses", "verifiedEmailAddresses", + "mobileNumbers", "verifiedMobileNumbers" ]; + /** * Prop types for the basic details component. */ @@ -1524,6 +1528,10 @@ export const UserProfile: FunctionComponent = ( const domainName: string[] = profileInfo?.get(schema.name)?.toString().split("/"); + if (multipleEmailMobileFeatureSpecificSchemaNames?.includes(schema?.name)) { + return; + } + return (