From b8f112557bc615036490abb20c4e800036e4b588 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Fri, 26 Jan 2024 06:00:03 +0530 Subject: [PATCH 1/5] fix: Expense - Title tooltip shows user email below workspace name. Signed-off-by: Krishna Gupta --- .../UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx index 21e19ac7c2e8..8aecaced4f32 100644 --- a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx +++ b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx @@ -37,9 +37,10 @@ function BaseUserDetailsTooltip({accountID, fallbackUserDetails, icon, delegateA } let title = String(userDisplayName).trim() ? userDisplayName : ''; - const subtitle = userLogin.trim() && LocalePhoneNumber.formatPhoneNumber(userLogin) !== userDisplayName ? Str.removeSMSDomain(userLogin) : ''; + let subtitle = userLogin.trim() && LocalePhoneNumber.formatPhoneNumber(userLogin) !== userDisplayName ? Str.removeSMSDomain(userLogin) : ''; if (icon && (icon.type === CONST.ICON_TYPE_WORKSPACE || !title)) { title = icon.name ?? ''; + subtitle = ''; } const renderTooltipContent = useCallback( () => ( From 44edf1d66372bc231073499ce6e7fdfe8bc4f59c Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Mon, 29 Jan 2024 19:53:50 +0530 Subject: [PATCH 2/5] added extra check. Signed-off-by: Krishna Gupta --- .../UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx index 8aecaced4f32..974ce30cbf67 100644 --- a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx +++ b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx @@ -40,7 +40,9 @@ function BaseUserDetailsTooltip({accountID, fallbackUserDetails, icon, delegateA let subtitle = userLogin.trim() && LocalePhoneNumber.formatPhoneNumber(userLogin) !== userDisplayName ? Str.removeSMSDomain(userLogin) : ''; if (icon && (icon.type === CONST.ICON_TYPE_WORKSPACE || !title)) { title = icon.name ?? ''; - subtitle = ''; + if (icon.type === CONST.ICON_TYPE_WORKSPACE) { + subtitle = ''; + } } const renderTooltipContent = useCallback( () => ( From 7611dae3120c76ea899f8aab131a0f390e7e18f0 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Mon, 29 Jan 2024 20:30:05 +0530 Subject: [PATCH 3/5] added comment. Signed-off-by: Krishna Gupta --- .../UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx index 974ce30cbf67..09bdb1b70279 100644 --- a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx +++ b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx @@ -40,6 +40,8 @@ function BaseUserDetailsTooltip({accountID, fallbackUserDetails, icon, delegateA let subtitle = userLogin.trim() && LocalePhoneNumber.formatPhoneNumber(userLogin) !== userDisplayName ? Str.removeSMSDomain(userLogin) : ''; if (icon && (icon.type === CONST.ICON_TYPE_WORKSPACE || !title)) { title = icon.name ?? ''; + + // We need to ensure we only clear the subtitle only when icon is of type workspace if (icon.type === CONST.ICON_TYPE_WORKSPACE) { subtitle = ''; } From e118db57ee9087f44f916c3d396eccb1f9c1c654 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Mon, 29 Jan 2024 20:44:19 +0530 Subject: [PATCH 4/5] comment udpated. Signed-off-by: Krishna Gupta --- .../UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx index 09bdb1b70279..2555836b90a1 100644 --- a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx +++ b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx @@ -41,7 +41,8 @@ function BaseUserDetailsTooltip({accountID, fallbackUserDetails, icon, delegateA if (icon && (icon.type === CONST.ICON_TYPE_WORKSPACE || !title)) { title = icon.name ?? ''; - // We need to ensure we only clear the subtitle only when icon is of type workspace + // We need to clear the subtitle for the workspaces otherwise user's email will be shown as subtitle + // Also we need to clear only when icon is of type `Workspace` if (icon.type === CONST.ICON_TYPE_WORKSPACE) { subtitle = ''; } From 30c2a90b3f039a048f08688a4dc8af77ffb570f9 Mon Sep 17 00:00:00 2001 From: Krishna Gupta Date: Tue, 30 Jan 2024 20:22:42 +0530 Subject: [PATCH 5/5] update comment. Signed-off-by: Krishna Gupta --- .../UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx index 2555836b90a1..4535874c3fac 100644 --- a/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx +++ b/src/components/UserDetailsTooltip/BaseUserDetailsTooltip/index.tsx @@ -41,8 +41,7 @@ function BaseUserDetailsTooltip({accountID, fallbackUserDetails, icon, delegateA if (icon && (icon.type === CONST.ICON_TYPE_WORKSPACE || !title)) { title = icon.name ?? ''; - // We need to clear the subtitle for the workspaces otherwise user's email will be shown as subtitle - // Also we need to clear only when icon is of type `Workspace` + // We need to clear the subtitle for workspaces so that we don't display any user details under the workspace name if (icon.type === CONST.ICON_TYPE_WORKSPACE) { subtitle = ''; }