Skip to content

Commit

Permalink
Merge pull request #6931 from PasinduYeshan/multiple-temp
Browse files Browse the repository at this point in the history
Temporarily hide multi email, mobile feature-specific attributes
  • Loading branch information
PasinduYeshan authored Sep 30, 2024
2 parents 813e9de + 9e1ff06 commit 32afc62
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/light-seas-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wso2is/admin.users.v1": patch
"@wso2is/myaccount": patch
---

Hide multi email and mobile specifc attributes.
17 changes: 14 additions & 3 deletions apps/myaccount/src/components/profile/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -739,6 +746,10 @@ export const Profile: FunctionComponent<ProfileProps> = (props: ProfileProps): R
const isProfileUsernameReadonly: boolean = config.ui.isProfileUsernameReadonly;
const { displayName, name } = schema;

if (multipleEmailMobileFeatureSpecificSchemaNames?.includes(name)) {
return;
}

if (isProfileUsernameReadonly) {
const usernameClaim: string = "username";

Expand Down
8 changes: 8 additions & 0 deletions features/admin.users.v1/components/user-profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -1524,6 +1528,10 @@ export const UserProfile: FunctionComponent<UserProfilePropsInterface> = (

const domainName: string[] = profileInfo?.get(schema.name)?.toString().split("/");

if (multipleEmailMobileFeatureSpecificSchemaNames?.includes(schema?.name)) {
return;
}

return (
<Grid.Row columns={ 1 } key={ key }>
<Grid.Column mobile={ 12 } tablet={ 12 } computer={ 6 }>
Expand Down

0 comments on commit 32afc62

Please sign in to comment.