Merge pull request #18422 from overleaf/rh-managed-acct-delete-email

[web]: Clarify tooltip for managed user attempting to delete email address

GitOrigin-RevId: 82eabc0b9d96773d5d418bec52ea917fd585ec63
This commit is contained in:
roo hutton 2024-05-22 08:40:08 +01:00 committed by Copybot
parent a6d7636a70
commit 5aea030184
3 changed files with 14 additions and 5 deletions

View file

@ -1589,6 +1589,7 @@
"youll_need_to_ask_the_github_repository_owner": "",
"youll_no_longer_need_to_remember_credentials": "",
"your_account_is_managed_by_admin_cant_join_additional_group": "",
"your_account_is_managed_by_your_group_admin": "",
"your_affiliation_is_confirmed": "",
"your_browser_does_not_support_this_feature": "",
"your_compile_timed_out": "",

View file

@ -8,6 +8,7 @@ import OLIconButton, {
OLIconButtonProps,
} from '@/features/ui/components/ol/ol-icon-button'
import { bsVersion } from '@/features/utils/bootstrap-5'
import getMeta from '@/utils/meta'
type DeleteButtonProps = Pick<
OLIconButtonProps,
@ -45,6 +46,16 @@ function Remove({ userEmailData, deleteEmailAsync }: RemoveProps) {
const { t } = useTranslation()
const { state, deleteEmail, resetLeaversSurveyExpiration } =
useUserEmailsContext()
const isManaged = getMeta('ol-isManagedAccount', false)
const getTooltipText = () => {
if (isManaged) {
return t('your_account_is_managed_by_your_group_admin')
}
return userEmailData.default
? t('please_change_primary_to_remove')
: t('remove')
}
const handleRemoveUserEmail = () => {
deleteEmailAsync
@ -69,11 +80,7 @@ function Remove({ userEmailData, deleteEmailAsync }: RemoveProps) {
return (
<OLTooltip
id={userEmailData.email}
description={
userEmailData.default
? t('please_change_primary_to_remove')
: t('remove')
}
description={getTooltipText()}
overlayProps={{ placement: userEmailData.default ? 'left' : 'top' }}
>
<span>

View file

@ -2217,6 +2217,7 @@
"youll_need_to_ask_the_github_repository_owner": "Youll need to ask the GitHub repository owner (<0>__repoOwnerEmail__</0>) to reconnect the project.",
"youll_no_longer_need_to_remember_credentials": "Youll no longer need to remember a separate email address and password. Instead, you will use single-sign on to login to Overleaf. <0>Read more about SSO</0>.",
"your_account_is_managed_by_admin_cant_join_additional_group": "Your __appName__ account is managed by your current group admin (__admin__). This means you cant join additional group subscriptions. <0>Read more about Managed Users.</0>",
"your_account_is_managed_by_your_group_admin": "Your account is managed by your group admin. You cant change or delete your email address.",
"your_account_is_suspended": "Your account is suspended",
"your_affiliation_is_confirmed": "Your <0>__institutionName__</0> affiliation is confirmed.",
"your_browser_does_not_support_this_feature": "Sorry, your browser doesnt support this feature. Please update your browser to its latest version.",