From 9ff03e9245329c5feac0b49b22deb1836883039f Mon Sep 17 00:00:00 2001 From: Davinder Singh Date: Thu, 13 Jun 2024 15:09:10 +0100 Subject: [PATCH] Merge pull request #18877 from overleaf/jel-sales-ad [web] Remove 2 sales ad variants and increase probability of FOMO variant GitOrigin-RevId: 6045dd4255313ae53f255afa528695583171d55b --- .../Features/Project/ProjectListController.js | 2 +- .../web/frontend/extracted-translations.json | 1 - .../groups-and-enterprise-banner.tsx | 29 +++++++-------- services/web/locales/en.json | 1 - .../components/notifications.test.tsx | 36 +------------------ 5 files changed, 15 insertions(+), 54 deletions(-) diff --git a/services/web/app/src/Features/Project/ProjectListController.js b/services/web/app/src/Features/Project/ProjectListController.js index 318533e68d..afeb022448 100644 --- a/services/web/app/src/Features/Project/ProjectListController.js +++ b/services/web/app/src/Features/Project/ProjectListController.js @@ -352,7 +352,7 @@ async function projectListPage(req, res, next) { const groupsAndEnterpriseBannerVariant = showGroupsAndEnterpriseBanner && - _.sample(['did-you-know', 'on-premise', 'people', 'FOMO']) + _.sample(['on-premise', 'FOMO', 'FOMO', 'FOMO']) let showWritefullPromoBanner = false if (Features.hasFeature('saas') && !req.session.justRegistered) { diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index b8caf49ea9..bb58d3a1fc 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -284,7 +284,6 @@ "details_provided_by_google_explanation": "", "dictionary": "", "did_you_know_institution_providing_professional": "", - "did_you_know_that_overleaf_offers": "", "disable_single_sign_on": "", "disable_sso": "", "disable_stop_on_first_error": "", diff --git a/services/web/frontend/js/features/project-list/components/notifications/groups-and-enterprise-banner.tsx b/services/web/frontend/js/features/project-list/components/notifications/groups-and-enterprise-banner.tsx index 6be16fccb2..73c0d39078 100644 --- a/services/web/frontend/js/features/project-list/components/notifications/groups-and-enterprise-banner.tsx +++ b/services/web/frontend/js/features/project-list/components/notifications/groups-and-enterprise-banner.tsx @@ -6,7 +6,18 @@ import customLocalStorage from '../../../../infrastructure/local-storage' import { useProjectListContext } from '../../context/project-list-context' 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] let viewEventSent = false @@ -27,9 +38,7 @@ export default function GroupsAndEnterpriseBanner() { const hasDismissedGroupsAndEnterpriseBanner = hasRecentlyDismissedBanner() - const contactSalesUrl = `/for/contact-sales-${ - variants.indexOf(groupsAndEnterpriseBannerVariant) + 1 - }` + const contactSalesUrl = urlForVariants[groupsAndEnterpriseBannerVariant] const shouldRenderBanner = showGroupsAndEnterpriseBanner && @@ -98,11 +107,7 @@ function BannerContent({ }: { variant: GroupsAndEnterpriseBannerVariant }) { - const { t } = useTranslation() - switch (variant) { - case 'did-you-know': - return {t('did_you_know_that_overleaf_offers')} case 'on-premise': return ( @@ -111,14 +116,6 @@ function BannerContent({ companies. Get in touch to learn more. ) - case 'people': - return ( - - Other people at your company may already be using Overleaf. Save money - with Overleaf group and company-wide subscriptions. Request more - information. - - ) case 'FOMO': return ( diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 00b071ab37..2f89d5daba 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -408,7 +408,6 @@ "details_provided_by_google_explanation": "Your details were provided by your Google account. Please check you’re happy with them.", "dictionary": "Dictionary", "did_you_know_institution_providing_professional": "Did you know that __institutionName__ is providing <0>free __appName__ Professional features 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_sso": "Disable SSO", "disable_stop_on_first_error": "Disable “Stop on first error”", diff --git a/services/web/test/frontend/features/project-list/components/notifications.test.tsx b/services/web/test/frontend/features/project-list/components/notifications.test.tsx index d759e36b43..975dd50703 100644 --- a/services/web/test/frontend/features/project-list/components/notifications.test.tsx +++ b/services/web/test/frontend/features/project-list/components/notifications.test.tsx @@ -805,7 +805,7 @@ describe('', function () { window.metaAttributesCache.set( 'ol-groupsAndEnterpriseBannerVariant', - 'did-you-know' + 'on-premise' ) }) @@ -892,23 +892,6 @@ describe('', function () { 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 () { window.metaAttributesCache.set( 'ol-groupsAndEnterpriseBannerVariant', @@ -926,23 +909,6 @@ describe('', function () { 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 () { window.metaAttributesCache.set( 'ol-groupsAndEnterpriseBannerVariant',