[web] tear down group-pricing-2025 split test on non-plans pages (#22785)

* [web] rm split test from the change to group modal
* [web] rm split test from cancel flow
* [web] rm split test from checkout flow
* [web] rm unused translations

GitOrigin-RevId: 0188f2631ed18e79fdf55dabedac7cdea4f213d3
This commit is contained in:
Kristina
2025-01-15 11:10:30 +01:00
committed by Copybot
parent a234dcd44c
commit 218c376f37
6 changed files with 24 additions and 97 deletions
@@ -55,7 +55,6 @@ async function userSubscriptionPage(req, res) {
res,
'bootstrap-5-subscription'
)
await SplitTestHandler.promises.getAssignment(req, res, 'group-pricing-2025')
const results =
await SubscriptionViewModelBuilder.promises.buildUsersSubscriptionViewModel(
@@ -444,7 +444,6 @@
"editor_theme": "",
"educational_disclaimer": "",
"educational_disclaimer_heading": "",
"educational_discount_for_groups_of_x_or_more": "",
"educational_percent_discount_applied": "",
"email": "",
"email_address": "",
@@ -832,8 +831,7 @@
"let_us_know_how_we_can_help": "",
"let_us_know_what_you_think": "",
"library": "",
"license_for_educational_purposes": "",
"license_for_educational_purposes_2025": "",
"license_for_educational_purposes_confirmation": "",
"limited_offer": "",
"limited_to_n_editors": "",
"limited_to_n_editors_per_project": "",
@@ -1099,7 +1097,6 @@
"pending_addon_cancellation": "",
"pending_invite": "",
"per_user": "",
"percent_discount_for_groups": "",
"percent_is_the_percentage_of_the_line_width": "",
"permanently_disables_the_preview": "",
"personal_library": "",
@@ -1329,7 +1326,6 @@
"save_or_cancel-cancel": "",
"save_or_cancel-or": "",
"save_or_cancel-save": "",
"save_x_percent_or_more": "",
"saving": "",
"saving_notification_with_seconds": "",
"search": "",
@@ -16,7 +16,6 @@ import { useLocation } from '../../../../../../../shared/hooks/use-location'
import { debugConsole } from '@/utils/debugging'
import OLButton from '@/features/ui/components/ol/ol-button'
import moment from 'moment'
import { getSplitTestVariant } from '@/utils/splitTestUtils'
import OLNotification from '@/features/ui/components/ol/ol-notification'
const planCodeToDowngradeTo = 'paid-personal'
@@ -160,8 +159,6 @@ export function CancelSubscription() {
isSuccessSecondaryAction ||
isSuccessCancel
const groupPricingVariant = getSplitTestVariant('group-pricing-2025')
if (!personalSubscription || !('recurly' in personalSubscription)) return null
const showDowngrade = showDowngradeOption(
@@ -179,7 +176,6 @@ export function CancelSubscription() {
const startDate = moment.utc(personalSubscription.recurly.account.created_at)
const pricingChangeEffectiveDate = moment.utc('2025-01-08T12:00:00Z')
const displayPricingWarning =
groupPricingVariant === 'enabled' &&
personalSubscription.plan.groupPlan &&
startDate.isBefore(pricingChangeEffectiveDate)
@@ -25,10 +25,8 @@ import OLButton from '@/features/ui/components/ol/ol-button'
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
import OLNotification from '@/features/ui/components/ol/ol-notification'
import { bsVersion } from '@/features/utils/bootstrap-5'
import { useFeatureFlag } from '@/shared/context/split-test-context'
const educationalPercentDiscount = 40
const groupSizeForEducationalDiscount = 10
function GroupPlanCollaboratorCount({ planCode }: { planCode: string }) {
const { t } = useTranslation()
@@ -47,34 +45,6 @@ function GroupPlanCollaboratorCount({ planCode }: { planCode: string }) {
return null
}
function EducationDiscountAppliedOrNot({
groupSize,
showGroupPricing2025,
}: {
groupSize: string
showGroupPricing2025: boolean
}) {
const { t } = useTranslation()
const size = parseInt(groupSize)
if (size >= groupSizeForEducationalDiscount || showGroupPricing2025) {
return (
<p className="applied">
{t('educational_percent_discount_applied', {
percent: educationalPercentDiscount,
})}
</p>
)
}
return (
<p className="ineligible">
{t('educational_discount_for_groups_of_x_or_more', {
size: groupSizeForEducationalDiscount,
})}
</p>
)
}
function GroupPrice({
groupPlanToChangeToPrice,
queryingGroupPlanToChangeToPrice,
@@ -152,7 +122,6 @@ export function ChangeToGroupModal() {
const [error, setError] = useState(false)
const [inflight, setInflight] = useState(false)
const location = useLocation()
const showGroupPricing2025 = useFeatureFlag('group-pricing-2025')
async function upgrade() {
setError(false)
@@ -203,14 +172,6 @@ export function ChangeToGroupModal() {
<OLModalHeader closeButton>
<OLModalTitle className="lh-sm">
{t('customize_your_group_subscription')}
<br />
{!showGroupPricing2025 && (
<span className="h5">
{t('save_x_percent_or_more', {
percent: '30',
})}
</span>
)}
</OLModalTitle>
</OLModalHeader>
@@ -286,17 +247,6 @@ export function ChangeToGroupModal() {
</OLFormSelect>
</OLFormGroup>
{!showGroupPricing2025 && (
<OLFormGroup>
<strong>
{t('percent_discount_for_groups', {
percent: educationalPercentDiscount,
size: groupSizeForEducationalDiscount,
})}
</strong>
</OLFormGroup>
)}
<OLFormCheckbox
id="usage"
type="checkbox"
@@ -310,22 +260,18 @@ export function ChangeToGroupModal() {
}
}}
label={
showGroupPricing2025 ? (
<Trans
i18nKey="license_for_educational_purposes_2025"
values={{ percent: educationalPercentDiscount }}
shouldUnescape
tOptions={{ interpolation: { escapeValue: true } }}
components={[
/* eslint-disable-next-line react/jsx-key */
<strong />,
/* eslint-disable-next-line react/jsx-key */
<br />,
]}
/>
) : (
t('license_for_educational_purposes')
)
<Trans
i18nKey="license_for_educational_purposes_confirmation"
values={{ percent: educationalPercentDiscount }}
shouldUnescape
tOptions={{ interpolation: { escapeValue: true } }}
components={[
/* eslint-disable-next-line react/jsx-key */
<strong />,
/* eslint-disable-next-line react/jsx-key */
<br />,
]}
/>
}
/>
</form>
@@ -333,10 +279,11 @@ export function ChangeToGroupModal() {
</div>
<div className="educational-discount-badge pt-4 text-center">
{groupPlanToChangeToUsage === 'educational' && (
<EducationDiscountAppliedOrNot
groupSize={groupPlanToChangeToSize}
showGroupPricing2025={showGroupPricing2025}
/>
<p className="applied">
{t('educational_percent_discount_applied', {
percent: educationalPercentDiscount,
})}
</p>
)}
</div>
</div>
+1 -5
View File
@@ -579,7 +579,6 @@
"editor_theme": "Editor theme",
"educational_disclaimer": "I confirm that users will be students or faculty using Overleaf primarily for study and teaching, and can provide evidence of this if requested.",
"educational_disclaimer_heading": "Educational discount confirmation",
"educational_discount_for_groups_of_x_or_more": "The educational discount is available for groups of __size__ or more",
"educational_percent_discount_applied": "__percent__% educational discount applied!",
"email": "Email",
"email_address": "Email address",
@@ -1120,8 +1119,7 @@
"libraries": "Libraries",
"library": "Library",
"license": "License",
"license_for_educational_purposes": "This license is for educational purposes (applies to students or faculty using __appName__ for teaching)",
"license_for_educational_purposes_2025": "<0>__percent__% educational discount</0><1/>I confirm this subscription is for educational purposes (applies to students or faculty using __appName__ for teaching)",
"license_for_educational_purposes_confirmation": "<0>__percent__% educational discount</0><1/>I confirm this subscription is for educational purposes (applies to students or faculty using __appName__ for teaching)",
"limited_to_n_editors": "Limited to __count__ editor",
"limited_to_n_editors_per_project": "Limited to __count__ editor per project",
"limited_to_n_editors_per_project_plural": "Limited to __count__ editors per project",
@@ -1495,7 +1493,6 @@
"per_user_per_year": "per user / per year",
"per_user_year": "per user / year",
"per_year": "per year",
"percent_discount_for_groups": "__appName__ offers a __percent__% educational discount for groups of __size__ or more.",
"percent_is_the_percentage_of_the_line_width": "% is the percentage of the line width",
"permanently_disables_the_preview": "Permanently disables the preview",
"personal": "Personal",
@@ -1787,7 +1784,6 @@
"save_or_cancel-cancel": "Cancel",
"save_or_cancel-or": "or",
"save_or_cancel-save": "Save",
"save_x_percent_or_more": "Save __percent__% or more",
"saving": "Saving",
"saving_notification_with_seconds": "Saving __docname__... (__seconds__ seconds of unsaved changes)",
"search": "Search",
@@ -322,7 +322,7 @@ describe('<ChangePlanModal />', function () {
const standardPlanCollaboratorText = '10 collaborators per project'
const professionalPlanCollaboratorText = 'Unlimited collaborators'
const educationInputLabel =
'This license is for educational purposes (applies to students or faculty using Overleaf for teaching)'
'40% educational discountI confirm this subscription is for educational purposes (applies to students or faculty using Overleaf for teaching)'
let modal: HTMLElement
async function openModal() {
@@ -342,7 +342,6 @@ describe('<ChangePlanModal />', function () {
await openModal()
within(modal).getByText('Customize your group subscription')
within(modal).getByText('Save 30% or more')
within(modal).getByText('$1,290 per year')
expect(within(modal).getAllByText('$129 per user').length).to.equal(2)
@@ -369,16 +368,14 @@ describe('<ChangePlanModal />', function () {
expect(sizeSelect.value).to.equal('10')
const sizeOption = within(sizeSelect).getAllByRole('option')
expect(sizeOption.length).to.equal(groupPlans.sizes.length)
within(modal).getByText(
'Overleaf offers a 40% educational discount for groups of 10 or more.'
)
within(modal).getByText('40% educational discount')
const educationalCheckbox = within(modal).getByRole(
'checkbox'
) as HTMLInputElement
expect(educationalCheckbox.checked).to.be.false
within(modal).getByText(
'This license is for educational purposes (applies to students or faculty using Overleaf for teaching)'
'I confirm this subscription is for educational purposes (applies to students or faculty using Overleaf for teaching)'
)
within(modal).getByText(
@@ -406,10 +403,8 @@ describe('<ChangePlanModal />', function () {
expect(within(modal).queryByText(standardPlanCollaboratorText)).to.be.null
})
it('shows educational discount applied when input checked and also notes if not enough users to get discount', async function () {
it('shows educational discount applied when input checked', async function () {
const discountAppliedText = '40% educational discount applied!'
const discountNotAppliedText =
'The educational discount is available for groups of 10 or more'
renderActiveSubscription(annualActiveSubscription)
await openModal()
@@ -417,12 +412,10 @@ describe('<ChangePlanModal />', function () {
const educationInput = within(modal).getByLabelText(educationInputLabel)
fireEvent.click(educationInput)
await within(modal).findByText(discountAppliedText)
expect(within(modal).queryByText(discountNotAppliedText)).to.be.null
const sizeSelect = within(modal).getByRole('combobox') as HTMLInputElement
await userEvent.selectOptions(sizeSelect, [screen.getByText('5')])
await within(modal).findByText(discountNotAppliedText)
expect(within(modal).queryByText(discountAppliedText)).to.be.null
await within(modal).findByText(discountAppliedText)
})
it('shows total with tax when tax applied', async function () {