From 0c2c3bff8b4a09667db04cbaa90a5e97fbb6b60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Alby?= Date: Fri, 22 Apr 2022 15:49:32 +0200 Subject: [PATCH] Merge pull request #7711 from overleaf/ta-misc-section [SettingsPage] Add Misc Section GitOrigin-RevId: a4a00c6b2bb920a0c0c6665f30a9657a6e89bc8f --- .../web/frontend/extracted-translations.json | 8 ++++++ .../settings/components/misc-section.tsx | 27 +++++++++++++++++++ .../js/features/settings/components/root.tsx | 3 +++ .../frontend/stories/settings/misc.stories.js | 17 ++++++++++++ services/web/locales/en.json | 2 ++ 5 files changed, 57 insertions(+) create mode 100644 services/web/frontend/js/features/settings/components/misc-section.tsx create mode 100644 services/web/frontend/stories/settings/misc.stories.js diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 55749f3fa2..8a0f31fa98 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -16,6 +16,8 @@ "autocomplete": "", "autocomplete_references": "", "back_to_your_projects": "", + "beta_program_already_participating": "", + "beta_program_benefits": "", "blocked_filename": "", "can_edit": "", "cancel": "", @@ -231,7 +233,10 @@ "make_email_primary_description": "", "make_primary": "", "make_private": "", + "manage_beta_program_membership": "", "manage_files_from_your_dropbox_folder": "", + "manage_newsletter": "", + "manage_sessions": "", "math_display": "", "math_inline": "", "maximum_files_uploaded_together": "", @@ -254,6 +259,7 @@ "new_folder": "", "new_name": "", "new_password": "", + "newsletter": "", "no_existing_password": "", "no_messages": "", "no_new_commits_in_github": "", @@ -374,9 +380,11 @@ "server_error": "", "session_error": "", "session_expired_redirecting_to_login": "", + "sessions": "", "share": "", "share_project": "", "share_with_your_collabs": "", + "sharelatex_beta_program": "", "show_in_code": "", "show_in_pdf": "", "show_outline": "", diff --git a/services/web/frontend/js/features/settings/components/misc-section.tsx b/services/web/frontend/js/features/settings/components/misc-section.tsx new file mode 100644 index 0000000000..052e2d8010 --- /dev/null +++ b/services/web/frontend/js/features/settings/components/misc-section.tsx @@ -0,0 +1,27 @@ +import { useTranslation } from 'react-i18next' +import { useUserContext } from '../../../shared/context/user-context' + +function MiscSection() { + const { t } = useTranslation() + const { betaProgram } = useUserContext() + + return ( + <> +

{t('sharelatex_beta_program')}

+

+ {betaProgram + ? t('beta_program_already_participating') + : t('beta_program_benefits')} +

+ {t('manage_beta_program_membership')} +
+

{t('sessions')}

+ {t('manage_sessions')} +
+

{t('newsletter')}

+ {t('manage_newsletter')} + + ) +} + +export default MiscSection diff --git a/services/web/frontend/js/features/settings/components/root.tsx b/services/web/frontend/js/features/settings/components/root.tsx index 8396b3ca63..f181838b03 100644 --- a/services/web/frontend/js/features/settings/components/root.tsx +++ b/services/web/frontend/js/features/settings/components/root.tsx @@ -7,6 +7,7 @@ import AccountInfoSection from './account-info-section' import PasswordSection from './password-section' import IntegrationLinkingSection from './integration-linking-section' import SSOLinkingSection from './sso-linking-section' +import MiscSection from './misc-section' import LeaveSection from './leave-section' import * as eventTracking from '../../../infrastructure/event-tracking' import { UserProvider } from '../../../shared/context/user-context' @@ -48,6 +49,8 @@ function SettingsPageRoot() {

+ +
diff --git a/services/web/frontend/stories/settings/misc.stories.js b/services/web/frontend/stories/settings/misc.stories.js new file mode 100644 index 0000000000..89ec5b25dd --- /dev/null +++ b/services/web/frontend/stories/settings/misc.stories.js @@ -0,0 +1,17 @@ +import MiscSection from '../../js/features/settings/components/misc-section' +import { UserProvider } from '../../js/shared/context/user-context' + +export const Section = args => { + window.metaAttributesCache.set('ol-user', { betaProgram: true }) + + return ( + + + + ) +} + +export default { + title: 'Account Settings / Misc / Section', + component: MiscSection, +} diff --git a/services/web/locales/en.json b/services/web/locales/en.json index d7cf30ed02..55f0d91cbf 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -915,6 +915,8 @@ "account_is_linked": "Account is linked", "unlink_dropbox": "Unlink Dropbox", "link_to_dropbox": "Link to Dropbox", + "newsletter": "Newsletter", + "manage_newsletter": "Manage Your Newsletter Preferences", "newsletter_info_and_unsubscribe": "Every few months we send a newsletter out summarizing the new features available. If you would prefer not to receive this email then you can unsubscribe at any time:", "unsubscribed": "Unsubscribed", "unsubscribing": "Unsubscribing",