Merge pull request #18877 from overleaf/jel-sales-ad

[web] Remove 2 sales ad variants and increase probability of FOMO variant

GitOrigin-RevId: 6045dd4255313ae53f255afa528695583171d55b
This commit is contained in:
Davinder Singh 2024-06-13 15:09:10 +01:00 committed by Copybot
parent 6f39e41461
commit 9ff03e9245
5 changed files with 15 additions and 54 deletions

View file

@ -352,7 +352,7 @@ async function projectListPage(req, res, next) {
const groupsAndEnterpriseBannerVariant = const groupsAndEnterpriseBannerVariant =
showGroupsAndEnterpriseBanner && showGroupsAndEnterpriseBanner &&
_.sample(['did-you-know', 'on-premise', 'people', 'FOMO']) _.sample(['on-premise', 'FOMO', 'FOMO', 'FOMO'])
let showWritefullPromoBanner = false let showWritefullPromoBanner = false
if (Features.hasFeature('saas') && !req.session.justRegistered) { if (Features.hasFeature('saas') && !req.session.justRegistered) {

View file

@ -284,7 +284,6 @@
"details_provided_by_google_explanation": "", "details_provided_by_google_explanation": "",
"dictionary": "", "dictionary": "",
"did_you_know_institution_providing_professional": "", "did_you_know_institution_providing_professional": "",
"did_you_know_that_overleaf_offers": "",
"disable_single_sign_on": "", "disable_single_sign_on": "",
"disable_sso": "", "disable_sso": "",
"disable_stop_on_first_error": "", "disable_stop_on_first_error": "",

View file

@ -6,7 +6,18 @@ import customLocalStorage from '../../../../infrastructure/local-storage'
import { useProjectListContext } from '../../context/project-list-context' import { useProjectListContext } from '../../context/project-list-context'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
const variants = ['did-you-know', 'on-premise', 'people', 'FOMO'] as const type variantsType = 'on-premise' | 'FOMO'
const variants = ['on-premise', 'FOMO'] as variantsType[]
type urlForVariantsType = {
[key in variantsType]: string // eslint-disable-line no-unused-vars
}
const urlForVariants: urlForVariantsType = {
'on-premise': '/for/contact-sales-2',
FOMO: '/for/contact-sales-4',
}
type GroupsAndEnterpriseBannerVariant = (typeof variants)[number] type GroupsAndEnterpriseBannerVariant = (typeof variants)[number]
let viewEventSent = false let viewEventSent = false
@ -27,9 +38,7 @@ export default function GroupsAndEnterpriseBanner() {
const hasDismissedGroupsAndEnterpriseBanner = hasRecentlyDismissedBanner() const hasDismissedGroupsAndEnterpriseBanner = hasRecentlyDismissedBanner()
const contactSalesUrl = `/for/contact-sales-${ const contactSalesUrl = urlForVariants[groupsAndEnterpriseBannerVariant]
variants.indexOf(groupsAndEnterpriseBannerVariant) + 1
}`
const shouldRenderBanner = const shouldRenderBanner =
showGroupsAndEnterpriseBanner && showGroupsAndEnterpriseBanner &&
@ -98,11 +107,7 @@ function BannerContent({
}: { }: {
variant: GroupsAndEnterpriseBannerVariant variant: GroupsAndEnterpriseBannerVariant
}) { }) {
const { t } = useTranslation()
switch (variant) { switch (variant) {
case 'did-you-know':
return <span>{t('did_you_know_that_overleaf_offers')}</span>
case 'on-premise': case 'on-premise':
return ( return (
<span> <span>
@ -111,14 +116,6 @@ function BannerContent({
companies. Get in touch to learn more. companies. Get in touch to learn more.
</span> </span>
) )
case 'people':
return (
<span>
Other people at your company may already be using Overleaf. Save money
with Overleaf group and company-wide subscriptions. Request more
information.
</span>
)
case 'FOMO': case 'FOMO':
return ( return (
<span> <span>

View file

@ -408,7 +408,6 @@
"details_provided_by_google_explanation": "Your details were provided by your Google account. Please check youre happy with them.", "details_provided_by_google_explanation": "Your details were provided by your Google account. Please check youre happy with them.",
"dictionary": "Dictionary", "dictionary": "Dictionary",
"did_you_know_institution_providing_professional": "Did you know that __institutionName__ is providing <0>free __appName__ Professional features</0> to everyone at __institutionName__?", "did_you_know_institution_providing_professional": "Did you know that __institutionName__ is providing <0>free __appName__ Professional features</0> to everyone at __institutionName__?",
"did_you_know_that_overleaf_offers": "Did you know that __appName__ offers group and organization-wide subscription options? Request information or a quote.",
"disable_single_sign_on": "Disable single sign-on", "disable_single_sign_on": "Disable single sign-on",
"disable_sso": "Disable SSO", "disable_sso": "Disable SSO",
"disable_stop_on_first_error": "Disable “Stop on first error”", "disable_stop_on_first_error": "Disable “Stop on first error”",

View file

@ -805,7 +805,7 @@ describe('<UserNotifications />', function () {
window.metaAttributesCache.set( window.metaAttributesCache.set(
'ol-groupsAndEnterpriseBannerVariant', 'ol-groupsAndEnterpriseBannerVariant',
'did-you-know' 'on-premise'
) )
}) })
@ -892,23 +892,6 @@ describe('<UserNotifications />', function () {
localStorage.clear() localStorage.clear()
}) })
it('will show the correct text for the `did-you-know` variant', async function () {
window.metaAttributesCache.set(
'ol-groupsAndEnterpriseBannerVariant',
'did-you-know'
)
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
await fetchMock.flush(true)
screen.getByText(
'Did you know that Overleaf offers group and organization-wide subscription options? Request information or a quote.'
)
const link = screen.getByRole('link', { name: 'Contact Sales' })
expect(link.getAttribute('href')).to.equal(`/for/contact-sales-1`)
})
it('will show the correct text for the `on-premise` variant', async function () { it('will show the correct text for the `on-premise` variant', async function () {
window.metaAttributesCache.set( window.metaAttributesCache.set(
'ol-groupsAndEnterpriseBannerVariant', 'ol-groupsAndEnterpriseBannerVariant',
@ -926,23 +909,6 @@ describe('<UserNotifications />', function () {
expect(link.getAttribute('href')).to.equal(`/for/contact-sales-2`) expect(link.getAttribute('href')).to.equal(`/for/contact-sales-2`)
}) })
it('will show the correct text for the `people` variant', async function () {
window.metaAttributesCache.set(
'ol-groupsAndEnterpriseBannerVariant',
'people'
)
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
await fetchMock.flush(true)
screen.getByText(
'Other people at your company may already be using Overleaf. Save money with Overleaf group and company-wide subscriptions. Request more information.'
)
const link = screen.getByRole('link', { name: 'Contact Sales' })
expect(link.getAttribute('href')).to.equal(`/for/contact-sales-3`)
})
it('will show the correct text for the `FOMO` variant', async function () { it('will show the correct text for the `FOMO` variant', async function () {
window.metaAttributesCache.set( window.metaAttributesCache.set(
'ol-groupsAndEnterpriseBannerVariant', 'ol-groupsAndEnterpriseBannerVariant',