mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
[web] update notification settings copy for mentions (#35953)
GitOrigin-RevId: cc86f0931f6740f1d509118ee558719bc3559816
This commit is contained in:
@@ -1249,6 +1249,8 @@
|
||||
"mendeley_sync_description": "",
|
||||
"mendeley_upgrade_prompt_content": "",
|
||||
"mendeley_upgrade_prompt_title": "",
|
||||
"mentions_and_replies_only": "",
|
||||
"mentions_and_replies_only_description": "",
|
||||
"menu": "",
|
||||
"merge_cells": "",
|
||||
"message_received": "",
|
||||
|
||||
+8
-2
@@ -6,9 +6,11 @@ import {
|
||||
} from '../../hooks/use-project-notification-preferences'
|
||||
import BetaBadgeIcon from '@/shared/components/beta-badge-icon'
|
||||
import LoadingSpinner from '@/shared/components/loading-spinner'
|
||||
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
||||
|
||||
export default function ProjectNotificationsSetting() {
|
||||
const { t } = useTranslation()
|
||||
const commentMentionsEnabled = useFeatureFlag('comment-mentions')
|
||||
const { notificationLevel, setNotificationLevel, isLoading } =
|
||||
useProjectNotificationPreferences()
|
||||
|
||||
@@ -24,8 +26,12 @@ export default function ProjectNotificationsSetting() {
|
||||
},
|
||||
{
|
||||
value: 'replies',
|
||||
label: t('replies_to_your_activity_only'),
|
||||
description: t('replies_to_your_activity_only_description'),
|
||||
label: commentMentionsEnabled
|
||||
? t('mentions_and_replies_only')
|
||||
: t('replies_to_your_activity_only'),
|
||||
description: commentMentionsEnabled
|
||||
? t('mentions_and_replies_only_description')
|
||||
: t('replies_to_your_activity_only_description'),
|
||||
},
|
||||
{
|
||||
value: 'off',
|
||||
|
||||
@@ -1618,6 +1618,8 @@
|
||||
"mendeley_sync_description": "With the Mendeley integration you can import your references from Mendeley into your __appName__ projects.",
|
||||
"mendeley_upgrade_prompt_content": "Link your Mendeley account to search and add your references from Mendeley directly in your project—they’ll automatically be added to your .bib file. Or import them as a file into your __appName__ projects.",
|
||||
"mendeley_upgrade_prompt_title": "Cite from Mendeley",
|
||||
"mentions_and_replies_only": "Mentions and replies only",
|
||||
"mentions_and_replies_only_description": "You’ll be notified about @mentions, replies and activity on your track changes.",
|
||||
"menu": "Menu",
|
||||
"merge": "Merge",
|
||||
"merge_cells": "Merge cells",
|
||||
|
||||
+23
@@ -100,6 +100,7 @@ function renderComponent(props: { permissionsLevel?: string } = {}) {
|
||||
describe('<ProjectNotificationsSetting />', function () {
|
||||
afterEach(function () {
|
||||
fetchMock.removeRoutes().clearHistory()
|
||||
window.metaAttributesCache.delete('ol-splitTestVariants')
|
||||
})
|
||||
|
||||
it('shows loading indicator while preferences are loading', async function () {
|
||||
@@ -168,6 +169,28 @@ describe('<ProjectNotificationsSetting />', function () {
|
||||
).to.be.false
|
||||
})
|
||||
|
||||
it('shows mentions copy when comment-mentions is enabled', async function () {
|
||||
window.metaAttributesCache.set('ol-splitTestVariants', {
|
||||
'comment-mentions': 'enabled',
|
||||
})
|
||||
fetchMock.get(preferencesUrl, repliesOnlyPreferences)
|
||||
|
||||
renderComponent()
|
||||
|
||||
await waitFor(
|
||||
() =>
|
||||
expect(
|
||||
screen.getByLabelText('Mentions and replies only', { exact: false })
|
||||
).to.exist
|
||||
)
|
||||
expect(
|
||||
screen.getByText(
|
||||
'You’ll be notified about @mentions, replies and activity on your track changes.',
|
||||
{ exact: false }
|
||||
)
|
||||
).to.exist
|
||||
})
|
||||
|
||||
it('selects "Off" when all notifications are off', async function () {
|
||||
fetchMock.get(preferencesUrl, allNotificationsOff)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user