diff --git a/services/web/app/src/infrastructure/ExpressLocals.js b/services/web/app/src/infrastructure/ExpressLocals.js index 6b979cc47e..310b12f825 100644 --- a/services/web/app/src/infrastructure/ExpressLocals.js +++ b/services/web/app/src/infrastructure/ExpressLocals.js @@ -81,10 +81,7 @@ function getWebpackAssets(entrypoint, section) { module.exports = function (webRouter, privateApiRouter, publicApiRouter) { webRouter.use( expressify( - SplitTestMiddleware.loadAssignmentsInLocals([ - 'design-system-updates', - 'features-page', - ]) + SplitTestMiddleware.loadAssignmentsInLocals(['design-system-updates']) ) ) diff --git a/services/web/app/views/layout/fat-footer.pug b/services/web/app/views/layout/fat-footer.pug index 38d9810996..bb34c73116 100644 --- a/services/web/app/views/layout/fat-footer.pug +++ b/services/web/app/views/layout/fat-footer.pug @@ -1,5 +1,3 @@ -- var featuresPageVariant = splitTestVariants && splitTestVariants['features-page'] - footer.fat-footer.hidden-print .fat-footer-container(role="navigation" aria-label=translate('footer_navigation')) .fat-footer-sections(class=hideFatFooter ? 'hidden' : undefined) @@ -43,10 +41,7 @@ footer.fat-footer.hidden-print ul.list-unstyled li - if !featuresPageVariant || featuresPageVariant === 'default' - a(href="/learn/how-to/Overleaf_premium_features" event-tracking="features-page-link" event-tracking-mb="true" event-tracking-trigger="click" event-segmentation={splitTest: "features-page", splitTestVariant: "default", locationInPage: "footer"}) #{translate('premium_features')} - else - a(href="/about/features-overview" event-tracking="features-page-link" event-tracking-mb="true" event-tracking-trigger="click" event-segmentation={splitTest: "features-page", splitTestVariant: "new", locationInPage: "footer"}) #{translate('features')} + a(href="/learn/how-to/Overleaf_premium_features") #{translate('premium_features')} li a(href="/user/subscription/plans?itm_referrer=footer-for-indv-groups") !{translate('for_individuals_and_groups')} li diff --git a/services/web/app/views/layout/navbar-marketing.pug b/services/web/app/views/layout/navbar-marketing.pug index 386f308b65..fc0fae08da 100644 --- a/services/web/app/views/layout/navbar-marketing.pug +++ b/services/web/app/views/layout/navbar-marketing.pug @@ -30,7 +30,6 @@ nav.navbar.navbar-default.navbar-main - var canDisplayAdminRedirect = canRedirectToAdminDomain() - var canDisplaySplitTestMenu = hasFeature('saas') && (canDisplayAdminMenu || (getSessionUser() && getSessionUser().staffAccess && (getSessionUser().staffAccess.splitTestMetrics || getSessionUser().staffAccess.splitTestManagement))) - var canDisplaySurveyMenu = hasFeature('saas') && canDisplayAdminMenu - - var featuresPageVariant = splitTestVariants && splitTestVariants['features-page'] if (typeof(suppressNavbarRight) == "undefined") .navbar-collapse.collapse(data-ol-navbar-main-collapse) @@ -101,15 +100,14 @@ nav.navbar.navbar-default.navbar-main else li if child.url - if !child.splitTest || child.splitTest && child.splitTest === 'features-page' && child.splitTestVariant === featuresPageVariant - a( - href=child.url, - class=child.class, - event-tracking=child.event - event-tracking-mb="true" - event-tracking-trigger="click" - event-segmentation=child.eventSegmentation - ) !{translate(child.text)} + a( + href=child.url, + class=child.class, + event-tracking=child.event + event-tracking-mb="true" + event-tracking-trigger="click" + event-segmentation=child.eventSegmentation + ) !{translate(child.text)} else | !{translate(child.text)} else diff --git a/services/web/app/views/layout/navbar.pug b/services/web/app/views/layout/navbar.pug index b06de3bd3c..1b5ccfa8b1 100644 --- a/services/web/app/views/layout/navbar.pug +++ b/services/web/app/views/layout/navbar.pug @@ -15,7 +15,6 @@ nav.navbar.navbar-default.navbar-main - var canDisplayAdminRedirect = canRedirectToAdminDomain() - var canDisplaySplitTestMenu = hasFeature('saas') && (canDisplayAdminMenu || (getSessionUser() && getSessionUser().staffAccess && (getSessionUser().staffAccess.splitTestMetrics || getSessionUser().staffAccess.splitTestManagement))) - var canDisplaySurveyMenu = hasFeature('saas') && canDisplayAdminMenu - - var featuresPageVariant = splitTestVariants && splitTestVariants['features-page'] if (typeof(suppressNavbarRight) == "undefined") .navbar-collapse.collapse(collapse="navCollapsed") @@ -76,15 +75,14 @@ nav.navbar.navbar-default.navbar-main else li if child.url - if !child.splitTest || child.splitTest && child.splitTest === 'features-page' && child.splitTestVariant === featuresPageVariant - a( - href=child.url, - class=child.class, - event-tracking=child.event - event-tracking-mb="true" - event-tracking-trigger="click" - event-segmentation=child.eventSegmentation - ) !{translate(child.text)} + a( + href=child.url, + class=child.class, + event-tracking=child.event + event-tracking-mb="true" + event-tracking-trigger="click" + event-segmentation=child.eventSegmentation + ) !{translate(child.text)} else | !{translate(child.text)} else diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 5cc765f69f..b8180b4c00 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -404,7 +404,6 @@ "get_collaborative_benefits": "", "get_discounted_plan": "", "get_most_subscription_by_checking_features": "", - "get_most_subscription_by_checking_premium_features": "", "git": "", "git_authentication_token": "", "git_authentication_token_create_modal_info_1": "", diff --git a/services/web/frontend/js/features/project-list/components/current-plan-widget/commons-plan.tsx b/services/web/frontend/js/features/project-list/components/current-plan-widget/commons-plan.tsx index 5a9a792653..da4d2f1947 100644 --- a/services/web/frontend/js/features/project-list/components/current-plan-widget/commons-plan.tsx +++ b/services/web/frontend/js/features/project-list/components/current-plan-widget/commons-plan.tsx @@ -1,8 +1,6 @@ import { useTranslation, Trans } from 'react-i18next' import { CommonsPlanSubscription } from '../../../../../../types/project/dashboard/subscription' import Tooltip from '../../../../shared/components/tooltip' -import getMeta from '../../../../utils/meta' -import * as eventTracking from '../../../../infrastructure/event-tracking' type CommonsPlanProps = Pick< CommonsPlanSubscription, @@ -18,14 +16,6 @@ function CommonsPlan({ const currentPlanLabel = ( }} /> ) - const featuresPageVariant = getMeta('ol-splitTestVariants')?.['features-page'] - - function handleLinkClick() { - eventTracking.sendMB('features-page-link', { - splitTest: 'features-page', - splitTestVariant: featuresPageVariant, - }) - } return ( <> @@ -38,11 +28,7 @@ function CommonsPlan({ id="commons-plan" overlayProps={{ placement: 'bottom' }} > - + {currentPlanLabel} diff --git a/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx b/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx index d0c20014ef..b9cf6f53e9 100644 --- a/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx +++ b/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx @@ -20,11 +20,7 @@ function CurrentPlanWidget() { const isGroupPlan = type === 'group' const isCommonsPlan = type === 'commons' - const newFeaturesPageVariant = - getMeta('ol-splitTestVariants')?.['features-page'] === 'new' - const featuresPageURL = newFeaturesPageVariant - ? '/about/features-overview' - : '/learn/how-to/Overleaf_premium_features' + const featuresPageURL = '/learn/how-to/Overleaf_premium_features' let currentPlan diff --git a/services/web/frontend/js/features/project-list/components/current-plan-widget/free-plan.tsx b/services/web/frontend/js/features/project-list/components/current-plan-widget/free-plan.tsx index 4eeee9b5d6..07a63f4fbf 100644 --- a/services/web/frontend/js/features/project-list/components/current-plan-widget/free-plan.tsx +++ b/services/web/frontend/js/features/project-list/components/current-plan-widget/free-plan.tsx @@ -3,7 +3,6 @@ import { Button } from 'react-bootstrap' import { FreePlanSubscription } from '../../../../../../types/project/dashboard/subscription' import Tooltip from '../../../../shared/components/tooltip' import * as eventTracking from '../../../../infrastructure/event-tracking' -import getMeta from '../../../../utils/meta' type FreePlanProps = Pick @@ -22,14 +21,6 @@ function FreePlan({ featuresPageURL }: FreePlanProps) { }) } - const featuresPageVariant = getMeta('ol-splitTestVariants')?.['features-page'] - function handleLinkClick() { - eventTracking.sendMB('features-page-link', { - splitTest: 'features-page', - splitTestVariant: featuresPageVariant, - }) - } - return ( <> {currentPlanLabel} @@ -38,11 +29,7 @@ function FreePlan({ featuresPageURL }: FreePlanProps) { id="free-plan" overlayProps={{ placement: 'bottom' }} > - + {currentPlanLabel} {' '} diff --git a/services/web/frontend/js/features/project-list/components/current-plan-widget/group-plan.tsx b/services/web/frontend/js/features/project-list/components/current-plan-widget/group-plan.tsx index 773e776fe8..9198c277d8 100644 --- a/services/web/frontend/js/features/project-list/components/current-plan-widget/group-plan.tsx +++ b/services/web/frontend/js/features/project-list/components/current-plan-widget/group-plan.tsx @@ -1,8 +1,6 @@ import { useTranslation, Trans } from 'react-i18next' import { GroupPlanSubscription } from '../../../../../../types/project/dashboard/subscription' import Tooltip from '../../../../shared/components/tooltip' -import getMeta from '../../../../utils/meta' -import * as eventTracking from '../../../../infrastructure/event-tracking' type GroupPlanProps = Pick< GroupPlanSubscription, @@ -33,14 +31,6 @@ function GroupPlan({ }} /> ) - const featuresPageVariant = getMeta('ol-splitTestVariants')?.['features-page'] - function handleLinkClick() { - eventTracking.sendMB('features-page-link', { - splitTest: 'features-page', - splitTestVariant: featuresPageVariant, - }) - } - return ( <> {currentPlanLabel} @@ -56,11 +46,7 @@ function GroupPlan({ id="group-plan" overlayProps={{ placement: 'bottom' }} > - + {currentPlanLabel} diff --git a/services/web/frontend/js/features/project-list/components/current-plan-widget/individual-plan.tsx b/services/web/frontend/js/features/project-list/components/current-plan-widget/individual-plan.tsx index f031df05de..9aea683aab 100644 --- a/services/web/frontend/js/features/project-list/components/current-plan-widget/individual-plan.tsx +++ b/services/web/frontend/js/features/project-list/components/current-plan-widget/individual-plan.tsx @@ -1,8 +1,6 @@ import { useTranslation, Trans } from 'react-i18next' import { IndividualPlanSubscription } from '../../../../../../types/project/dashboard/subscription' import Tooltip from '../../../../shared/components/tooltip' -import getMeta from '../../../../utils/meta' -import * as eventTracking from '../../../../infrastructure/event-tracking' type IndividualPlanProps = Pick< IndividualPlanSubscription, @@ -32,14 +30,6 @@ function IndividualPlan({ }} /> ) - const featuresPageVariant = getMeta('ol-splitTestVariants')?.['features-page'] - function handleLinkClick() { - eventTracking.sendMB('features-page-link', { - splitTest: 'features-page', - splitTestVariant: featuresPageVariant, - }) - } - return ( <> {currentPlanLabel} @@ -48,11 +38,7 @@ function IndividualPlan({ id="individual-plan" overlayProps={{ placement: 'bottom' }} > - + {currentPlanLabel} diff --git a/services/web/frontend/js/features/subscription/components/dashboard/premium-features-link.tsx b/services/web/frontend/js/features/subscription/components/dashboard/premium-features-link.tsx index f57c0b6a78..b142bb8992 100644 --- a/services/web/frontend/js/features/subscription/components/dashboard/premium-features-link.tsx +++ b/services/web/frontend/js/features/subscription/components/dashboard/premium-features-link.tsx @@ -1,46 +1,16 @@ import { Trans } from 'react-i18next' -import getMeta from '../../../../utils/meta' -import * as eventTracking from '../../../../infrastructure/event-tracking' function PremiumFeaturesLink() { - const featuresPageVariant = - getMeta('ol-splitTestVariants')?.['features-page'] || 'default' - - function handleLinkClick() { - eventTracking.sendMB('features-page-link', { - splitTest: 'features-page', - splitTestVariant: featuresPageVariant, - }) - } - const featuresPageLink = ( // translation adds content // eslint-disable-next-line jsx-a11y/anchor-has-content - + ) - if (featuresPageVariant === 'new') { - return ( -

- -

- ) - } - return (

diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 7ccd38d259..8747d40f1c 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -652,7 +652,6 @@ "get_in_touch_having_problems": "
Get in touch with support if you’re having problems", "get_involved": "Get involved", "get_most_subscription_by_checking_features": "Get the most out of your __appName__ subscription by checking out <0>__appName__’s features.", - "get_most_subscription_by_checking_premium_features": "Get the most out of your __appName__ subscription by checking out the list of <0>__appName__’s premium features.", "get_same_latex_setup": "With __appName__ you get the same LaTeX set-up wherever you go. By working with your colleagues and students on __appName__, you know that you’re not going to hit any version inconsistencies or package conflicts.", "get_started_now": "Get started now", "get_the_most_out_headline": "Get the most out of __appName__ with features such as:", diff --git a/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx b/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx index 7f000b52b0..e23ab96791 100644 --- a/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx +++ b/services/web/test/frontend/features/project-list/components/current-plan-widget.test.tsx @@ -246,12 +246,7 @@ describe('', function () { }) }) - describe('features page split test', function () { - const variants = [ - { name: 'default', link: '/learn/how-to/Overleaf_premium_features' }, - { name: 'new', link: '/about/features-overview' }, - ] - + describe('features page', function () { const plans = [ { type: 'free' }, { @@ -281,38 +276,21 @@ describe('', function () { }, ] - for (const variant of variants) { - describe(`${variant.name} variant`, function () { - beforeEach(function () { - window.metaAttributesCache.set('ol-splitTestVariants', { - 'features-page': variant.name, - }) - }) - afterEach(function () { - window.metaAttributesCache.delete('ol-splitTestVariants') + for (const plan of plans) { + it(`links to features page on ${plan.type} plan`, function () { + window.metaAttributesCache.set('ol-usersBestSubscription', { + ...plan, }) + render() - for (const plan of plans) { - it(`links to ${variant.name} features page on ${plan.type} plan and sends analytics event`, function () { - window.metaAttributesCache.set('ol-usersBestSubscription', { - ...plan, - }) - render() + const links = screen.getAllByRole('link') + expect(links[0].getAttribute('href')).to.equal( + '/learn/how-to/Overleaf_premium_features' + ) - const links = screen.getAllByRole('link') - expect(links[0].getAttribute('href')).to.equal(variant.link) + fireEvent.click(links[0]) - fireEvent.click(links[0]) - expect(sendMBSpy).to.be.calledOnce - expect(sendMBSpy).calledWith('features-page-link', { - splitTest: 'features-page', - splitTestVariant: variant.name, - page: '/', - }) - - window.metaAttributesCache.delete('ol-usersBestSubscription') - }) - } + window.metaAttributesCache.delete('ol-usersBestSubscription') }) } }) diff --git a/services/web/test/frontend/features/subscription/components/dashboard/premium-features-link.test.tsx b/services/web/test/frontend/features/subscription/components/dashboard/premium-features-link.test.tsx deleted file mode 100644 index b8a6713218..0000000000 --- a/services/web/test/frontend/features/subscription/components/dashboard/premium-features-link.test.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import { expect } from 'chai' -import sinon from 'sinon' -import { fireEvent, render, screen, within } from '@testing-library/react' -import * as eventTracking from '../../../../../../frontend/js/infrastructure/event-tracking' -import PremiumFeaturesLink from '../../../../../../frontend/js/features/subscription/components/dashboard/premium-features-link' -import * as useLocationModule from '../../../../../../frontend/js/shared/hooks/use-location' - -describe('', function () { - const originalLocation = window.location - - let sendMBSpy: sinon.SinonSpy - - const variants = [ - { name: 'default', link: '/learn/how-to/Overleaf_premium_features' }, - { name: 'new', link: '/about/features-overview' }, - ] - - beforeEach(function () { - window.metaAttributesCache = new Map() - sendMBSpy = sinon.spy(eventTracking, 'sendMB') - this.locationStub = sinon.stub(useLocationModule, 'useLocation').returns({ - assign: sinon.stub(), - reload: sinon.stub(), - }) - }) - - afterEach(function () { - window.metaAttributesCache = new Map() - sendMBSpy.restore() - this.locationStub.restore() - }) - - for (const variant of variants) { - describe(`${variant.name} variant`, function () { - beforeEach(function () { - window.metaAttributesCache.set('ol-splitTestVariants', { - 'features-page': variant.name, - }) - }) - afterEach(function () { - window.metaAttributesCache.delete('ol-splitTestVariants') - }) - - it('renders the premium features link and sends analytics event', function () { - render() - const premiumText = screen.getByText('Get the most out of your', { - exact: false, - }) - const link = within(premiumText).getByRole('link') - - fireEvent.click(link) - - expect(sendMBSpy).to.be.calledOnce - expect(sendMBSpy).calledWith('features-page-link', { - splitTest: 'features-page', - splitTestVariant: variant.name, - page: originalLocation.pathname, - }) - }) - }) - } -}) diff --git a/services/web/test/frontend/features/subscription/components/dashboard/subscription-dashboard.test.tsx b/services/web/test/frontend/features/subscription/components/dashboard/subscription-dashboard.test.tsx index b2b8668f20..80137a6e1f 100644 --- a/services/web/test/frontend/features/subscription/components/dashboard/subscription-dashboard.test.tsx +++ b/services/web/test/frontend/features/subscription/components/dashboard/subscription-dashboard.test.tsx @@ -33,7 +33,7 @@ describe('', function () { it('renders the "Get the most out of your" subscription text', function () { screen.getByText( - 'Get the most out of your Overleaf subscription by checking out the list of', + 'Get the most out of your Overleaf subscription by checking out', { exact: false } ) }) diff --git a/services/web/test/frontend/features/subscription/components/successful-subscription/successful-subscription.test.tsx b/services/web/test/frontend/features/subscription/components/successful-subscription/successful-subscription.test.tsx index 3cad154062..3c428df955 100644 --- a/services/web/test/frontend/features/subscription/components/successful-subscription/successful-subscription.test.tsx +++ b/services/web/test/frontend/features/subscription/components/successful-subscription/successful-subscription.test.tsx @@ -41,7 +41,7 @@ describe('successful subscription page', function () { /it’s support from people like yourself that allows .* to continue to grow and improve/i ) expect(screen.getByText(/get the most out of your/i).textContent).to.match( - /get the most out of your .* subscription by checking out the list of .*’s premium features/i + /get the most out of your .* subscription by checking out .*’s features/i ) expect( screen @@ -70,11 +70,9 @@ describe('successful subscription page', function () { ) const helpLink = screen.getByRole('link', { - name: /.*’s premium features/i, + name: /.*’s features/i, }) - expect(helpLink.getAttribute('href')).to.equal( - '/learn/how-to/Overleaf_premium_features' - ) + expect(helpLink.getAttribute('href')).to.equal('/about/features-overview') const backToYourProjectsLink = screen.getByRole('link', { name: /back to your projects/i,