Merge pull request #7711 from overleaf/ta-misc-section

[SettingsPage] Add Misc Section

GitOrigin-RevId: a4a00c6b2bb920a0c0c6665f30a9657a6e89bc8f
This commit is contained in:
Timothée Alby 2022-04-22 15:49:32 +02:00 committed by Copybot
parent cf2dfc6bf1
commit 0c2c3bff8b
5 changed files with 57 additions and 0 deletions

View file

@ -16,6 +16,8 @@
"autocomplete": "", "autocomplete": "",
"autocomplete_references": "", "autocomplete_references": "",
"back_to_your_projects": "", "back_to_your_projects": "",
"beta_program_already_participating": "",
"beta_program_benefits": "",
"blocked_filename": "", "blocked_filename": "",
"can_edit": "", "can_edit": "",
"cancel": "", "cancel": "",
@ -231,7 +233,10 @@
"make_email_primary_description": "", "make_email_primary_description": "",
"make_primary": "", "make_primary": "",
"make_private": "", "make_private": "",
"manage_beta_program_membership": "",
"manage_files_from_your_dropbox_folder": "", "manage_files_from_your_dropbox_folder": "",
"manage_newsletter": "",
"manage_sessions": "",
"math_display": "", "math_display": "",
"math_inline": "", "math_inline": "",
"maximum_files_uploaded_together": "", "maximum_files_uploaded_together": "",
@ -254,6 +259,7 @@
"new_folder": "", "new_folder": "",
"new_name": "", "new_name": "",
"new_password": "", "new_password": "",
"newsletter": "",
"no_existing_password": "", "no_existing_password": "",
"no_messages": "", "no_messages": "",
"no_new_commits_in_github": "", "no_new_commits_in_github": "",
@ -374,9 +380,11 @@
"server_error": "", "server_error": "",
"session_error": "", "session_error": "",
"session_expired_redirecting_to_login": "", "session_expired_redirecting_to_login": "",
"sessions": "",
"share": "", "share": "",
"share_project": "", "share_project": "",
"share_with_your_collabs": "", "share_with_your_collabs": "",
"sharelatex_beta_program": "",
"show_in_code": "", "show_in_code": "",
"show_in_pdf": "", "show_in_pdf": "",
"show_outline": "", "show_outline": "",

View file

@ -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 (
<>
<h3>{t('sharelatex_beta_program')}</h3>
<p>
{betaProgram
? t('beta_program_already_participating')
: t('beta_program_benefits')}
</p>
<a href="/beta/participate">{t('manage_beta_program_membership')}</a>
<hr />
<h3>{t('sessions')}</h3>
<a href="/user/sessions">{t('manage_sessions')}</a>
<hr />
<h3>{t('newsletter')}</h3>
<a href="/user/email-preferences">{t('manage_newsletter')}</a>
</>
)
}
export default MiscSection

View file

@ -7,6 +7,7 @@ import AccountInfoSection from './account-info-section'
import PasswordSection from './password-section' import PasswordSection from './password-section'
import IntegrationLinkingSection from './integration-linking-section' import IntegrationLinkingSection from './integration-linking-section'
import SSOLinkingSection from './sso-linking-section' import SSOLinkingSection from './sso-linking-section'
import MiscSection from './misc-section'
import LeaveSection from './leave-section' import LeaveSection from './leave-section'
import * as eventTracking from '../../../infrastructure/event-tracking' import * as eventTracking from '../../../infrastructure/event-tracking'
import { UserProvider } from '../../../shared/context/user-context' import { UserProvider } from '../../../shared/context/user-context'
@ -48,6 +49,8 @@ function SettingsPageRoot() {
<hr /> <hr />
<SSOLinkingSection /> <SSOLinkingSection />
<hr /> <hr />
<MiscSection />
<hr />
<LeaveSection /> <LeaveSection />
</div> </div>
</div> </div>

View file

@ -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 (
<UserProvider>
<MiscSection {...args} />
</UserProvider>
)
}
export default {
title: 'Account Settings / Misc / Section',
component: MiscSection,
}

View file

@ -915,6 +915,8 @@
"account_is_linked": "Account is linked", "account_is_linked": "Account is linked",
"unlink_dropbox": "Unlink Dropbox", "unlink_dropbox": "Unlink Dropbox",
"link_to_dropbox": "Link to 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:", "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", "unsubscribed": "Unsubscribed",
"unsubscribing": "Unsubscribing", "unsubscribing": "Unsubscribing",