diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index a4bab14ac3..13cb7dd6af 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -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": "", diff --git a/services/web/frontend/js/features/settings/components/emails/actions/remove.tsx b/services/web/frontend/js/features/settings/components/emails/actions/remove.tsx index 62a1d8ba7d..214243c28f 100644 --- a/services/web/frontend/js/features/settings/components/emails/actions/remove.tsx +++ b/services/web/frontend/js/features/settings/components/emails/actions/remove.tsx @@ -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 ( diff --git a/services/web/locales/en.json b/services/web/locales/en.json index bb2eac43b5..7d0b9881b8 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -2217,6 +2217,7 @@ "youll_need_to_ask_the_github_repository_owner": "You’ll need to ask the GitHub repository owner (<0>__repoOwnerEmail__) to reconnect the project.", "youll_no_longer_need_to_remember_credentials": "You’ll 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.", "your_account_is_managed_by_admin_cant_join_additional_group": "Your __appName__ account is managed by your current group admin (__admin__). This means you can’t join additional group subscriptions. <0>Read more about Managed Users.", + "your_account_is_managed_by_your_group_admin": "Your account is managed by your group admin. You can’t change or delete your email address.", "your_account_is_suspended": "Your account is suspended", "your_affiliation_is_confirmed": "Your <0>__institutionName__ affiliation is confirmed.", "your_browser_does_not_support_this_feature": "Sorry, your browser doesn’t support this feature. Please update your browser to its latest version.",