From 8e816444822c8d03d26b558a8f0abd960a9cfb6f Mon Sep 17 00:00:00 2001 From: ilkin-overleaf <100852799+ilkin-overleaf@users.noreply.github.com> Date: Thu, 10 Jul 2025 13:22:43 +0300 Subject: [PATCH] Merge pull request #27018 from overleaf/ii-flexible-licensing-manually-billed-billed-tear-down-revert [web] Revert "FL manually billed subscription feature flag tear down" GitOrigin-RevId: 7cc809570d310f56b8f9e1a4f43ca895db8a8073 --- .../SubscriptionGroupController.mjs | 44 ++++--------------- .../web/frontend/extracted-translations.json | 1 - .../components/add-seats/add-seats.tsx | 17 +++---- .../manually-collected-subscription.tsx | 29 +++--------- services/web/locales/en.json | 1 - .../components/add-seats.spec.tsx | 3 -- .../SubscriptionGroupController.test.mjs | 16 ++----- 7 files changed, 24 insertions(+), 87 deletions(-) diff --git a/services/web/app/src/Features/Subscription/SubscriptionGroupController.mjs b/services/web/app/src/Features/Subscription/SubscriptionGroupController.mjs index 82064c173a..7aa596836d 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionGroupController.mjs +++ b/services/web/app/src/Features/Subscription/SubscriptionGroupController.mjs @@ -8,7 +8,6 @@ import SessionManager from '../Authentication/SessionManager.js' import UserAuditLogHandler from '../User/UserAuditLogHandler.js' import { expressify } from '@overleaf/promise-utils' import Modules from '../../infrastructure/Modules.js' -import SplitTestHandler from '../SplitTests/SplitTestHandler.js' import UserGetter from '../User/UserGetter.js' import { Subscription } from '../../models/Subscription.js' import { isProfessionalGroupPlan } from './PlansHelper.mjs' @@ -152,29 +151,13 @@ async function addSeatsToGroupSubscription(req, res) { await SubscriptionGroupHandler.promises.ensureSubscriptionHasNoPastDueInvoice( subscription ) - - const { variant: flexibleLicensingForManuallyBilledSubscriptionsVariant } = - await SplitTestHandler.promises.getAssignment( - req, - res, - 'flexible-group-licensing-for-manually-billed-subscriptions' - ) - - if (flexibleLicensingForManuallyBilledSubscriptionsVariant === 'enabled') { - await SubscriptionGroupHandler.promises.checkBillingInfoExistence( - paymentProviderSubscription, - userId - ) - await SubscriptionGroupHandler.promises.ensureSubscriptionHasAdditionalLicenseAddOnWhenCollectionMethodIsManual( - paymentProviderSubscription - ) - } else { - await SubscriptionGroupHandler.promises.ensureSubscriptionCollectionMethodIsNotManual( - paymentProviderSubscription - ) - // Check if the user has missing billing details - await Modules.promises.hooks.fire('getPaymentMethod', userId) - } + await SubscriptionGroupHandler.promises.checkBillingInfoExistence( + paymentProviderSubscription, + userId + ) + await SubscriptionGroupHandler.promises.ensureSubscriptionHasAdditionalLicenseAddOnWhenCollectionMethodIsManual( + paymentProviderSubscription + ) res.render('subscriptions/add-seats', { subscriptionId: subscription._id, @@ -191,10 +174,7 @@ async function addSeatsToGroupSubscription(req, res) { ) } - if ( - error instanceof ManuallyCollectedError || - error instanceof HasNoAdditionalLicenseWhenManuallyCollectedError - ) { + if (error instanceof HasNoAdditionalLicenseWhenManuallyCollectedError) { return res.redirect( '/user/subscription/group/manually-collected-subscription' ) @@ -235,7 +215,6 @@ async function previewAddSeatsSubscriptionChange(req, res) { } catch (error) { if ( error instanceof MissingBillingInfoError || - error instanceof ManuallyCollectedError || error instanceof PendingChangeError || error instanceof InactiveError || error instanceof HasPastDueInvoiceError || @@ -279,7 +258,6 @@ async function createAddSeatsSubscriptionChange(req, res) { } catch (error) { if ( error instanceof MissingBillingInfoError || - error instanceof ManuallyCollectedError || error instanceof PendingChangeError || error instanceof InactiveError || error instanceof HasPastDueInvoiceError || @@ -420,12 +398,6 @@ async function manuallyCollectedSubscription(req, res) { const subscription = await SubscriptionLocator.promises.getUsersSubscription(userId) - await SplitTestHandler.promises.getAssignment( - req, - res, - 'flexible-group-licensing-for-manually-billed-subscriptions' - ) - res.render('subscriptions/manually-collected-subscription', { groupName: subscription.teamName, }) diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 1f9cd2928c..4031c6db26 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -873,7 +873,6 @@ "is_email_affiliated": "", "issued_on": "", "it_looks_like_that_didnt_work_you_can_try_again_or_get_in_touch": "", - "it_looks_like_your_account_is_billed_manually": "", "it_looks_like_your_account_is_billed_manually_purchasing_additional_license_or_upgrading_subscription": "", "it_looks_like_your_payment_details_are_missing_please_update_your_billing_information": "", "italics": "", diff --git a/services/web/frontend/js/features/group-management/components/add-seats/add-seats.tsx b/services/web/frontend/js/features/group-management/components/add-seats/add-seats.tsx index 5f9237807d..e795ed6a2d 100644 --- a/services/web/frontend/js/features/group-management/components/add-seats/add-seats.tsx +++ b/services/web/frontend/js/features/group-management/components/add-seats/add-seats.tsx @@ -30,7 +30,6 @@ import { } from '../../../../../../types/subscription/subscription-change-preview' import { MergeAndOverride, Nullable } from '../../../../../../types/utils' import { sendMB } from '../../../../infrastructure/event-tracking' -import { useFeatureFlag } from '@/shared/context/split-test-context' export const MAX_NUMBER_OF_USERS = 20 export const MAX_NUMBER_OF_PO_NUMBER_CHARACTERS = 50 @@ -50,9 +49,6 @@ function AddSeats() { const [addSeatsInputError, setAddSeatsInputError] = useState() const [poNumberInputError, setPoNumberInputError] = useState() const [shouldContactSales, setShouldContactSales] = useState(false) - const isFlexibleGroupLicensingForManuallyBilledSubscriptions = useFeatureFlag( - 'flexible-group-licensing-for-manually-billed-subscriptions' - ) const controller = useAbortController() const { signal: addSeatsSignal } = useAbortController() const { signal: contactSalesSignal } = useAbortController() @@ -373,13 +369,12 @@ function AddSeats() { {addSeatsInputError} )} - {isFlexibleGroupLicensingForManuallyBilledSubscriptions && - isCollectionMethodManual && ( - - )} + {isCollectionMethodManual && ( + + )} , - ]} - /> - ) : ( - , - ]} - /> - ) + , + ]} + /> } className="m-0" /> diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 8b8c13620e..60ab856e03 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -1132,7 +1132,6 @@ "issued_on": "Issued: __date__", "it": "Italian", "it_looks_like_that_didnt_work_you_can_try_again_or_get_in_touch": "It looks like that didn’t work. You can try again or <0>get in touch with our Support team for more help.", - "it_looks_like_your_account_is_billed_manually": "It looks like your account is being billed manually - adding seats or upgrading your subscription can only be done by the Support team. Please <0>get in touch for help.", "it_looks_like_your_account_is_billed_manually_purchasing_additional_license_or_upgrading_subscription": "It looks like your account is being billed manually - purchasing additional licenses or upgrading your subscription can only be done by the Support team. Please <0>get in touch for help.", "it_looks_like_your_payment_details_are_missing_please_update_your_billing_information": "It looks like your payment details are missing. Please <0>update your billing information, or <1>get in touch with our Support team for more help.", "italics": "Italics", diff --git a/services/web/test/frontend/features/group-management/components/add-seats.spec.tsx b/services/web/test/frontend/features/group-management/components/add-seats.spec.tsx index ead0c74a1c..f26357d842 100644 --- a/services/web/test/frontend/features/group-management/components/add-seats.spec.tsx +++ b/services/web/test/frontend/features/group-management/components/add-seats.spec.tsx @@ -14,9 +14,6 @@ describe('', function () { win.metaAttributesCache.set('ol-totalLicenses', this.totalLicenses) win.metaAttributesCache.set('ol-isProfessional', false) win.metaAttributesCache.set('ol-isCollectionMethodManual', true) - win.metaAttributesCache.set('ol-splitTestVariants', { - 'flexible-group-licensing-for-manually-billed-subscriptions': 'enabled', - }) }) cy.mount( diff --git a/services/web/test/unit/src/Subscription/SubscriptionGroupController.test.mjs b/services/web/test/unit/src/Subscription/SubscriptionGroupController.test.mjs index a64ef71b60..ddfa8b0790 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionGroupController.test.mjs +++ b/services/web/test/unit/src/Subscription/SubscriptionGroupController.test.mjs @@ -107,12 +107,6 @@ describe('SubscriptionGroupController', function () { }, } - ctx.SplitTestHandler = { - promises: { - getAssignment: sinon.stub().resolves({ variant: 'enabled' }), - }, - } - ctx.UserGetter = { promises: { getUserEmail: sinon.stub().resolves(ctx.user.email), @@ -174,13 +168,6 @@ describe('SubscriptionGroupController', function () { default: ctx.Modules, })) - vi.doMock( - '../../../../app/src/Features/SplitTests/SplitTestHandler', - () => ({ - default: ctx.SplitTestHandler, - }) - ) - vi.doMock('../../../../app/src/Features/User/UserGetter', () => ({ default: ctx.UserGetter, })) @@ -459,6 +446,9 @@ describe('SubscriptionGroupController', function () { ctx.SubscriptionGroupHandler.promises.checkBillingInfoExistence .calledWith(ctx.recurlySubscription, ctx.adminUserId) .should.equal(true) + ctx.SubscriptionGroupHandler.promises.ensureSubscriptionHasAdditionalLicenseAddOnWhenCollectionMethodIsManual + .calledWith(ctx.recurlySubscription) + .should.equal(true) page.should.equal('subscriptions/add-seats') props.subscriptionId.should.equal(ctx.subscriptionId) props.groupName.should.equal(ctx.subscription.teamName)