From a1161756984fbeba612a2b5b4c23a744b7aaa32a Mon Sep 17 00:00:00 2001 From: Jessica Lawshe <5312836+lawshe@users.noreply.github.com> Date: Thu, 22 Jan 2026 09:01:55 -0600 Subject: [PATCH] Merge pull request #30520 from overleaf/ii-flexible-group-licensing-upgrade-message [web] Plan upgrade error message when subscription is manually collected GitOrigin-RevId: 76bda80c81a5f934cbddfb6f24d29c4dd3d6da56 --- .../SubscriptionGroupController.mjs | 5 +-- .../manually-collected-subscription.pug | 1 + .../web/frontend/extracted-translations.json | 1 + .../manually-collected-subscription.tsx | 32 +++++++++++-------- .../manually-collected-subscription.tsx | 7 +--- services/web/frontend/js/utils/meta.ts | 1 + services/web/locales/en.json | 1 + .../SubscriptionGroupController.test.mjs | 4 +-- 8 files changed, 29 insertions(+), 23 deletions(-) diff --git a/services/web/app/src/Features/Subscription/SubscriptionGroupController.mjs b/services/web/app/src/Features/Subscription/SubscriptionGroupController.mjs index 9b67a0ad38..d52a8df6ec 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionGroupController.mjs +++ b/services/web/app/src/Features/Subscription/SubscriptionGroupController.mjs @@ -181,7 +181,7 @@ async function addSeatsToGroupSubscription(req, res) { if (error instanceof HasNoAdditionalLicenseWhenManuallyCollectedError) { return res.redirect( - '/user/subscription/group/manually-collected-subscription' + '/user/subscription/group/manually-collected-subscription?error_type=no-additional-license' ) } @@ -375,7 +375,7 @@ async function subscriptionUpgradePage(req, res) { if (error instanceof ManuallyCollectedError) { return res.redirect( - '/user/subscription/group/manually-collected-subscription' + '/user/subscription/group/manually-collected-subscription?error_type=plan-upgrade' ) } @@ -437,6 +437,7 @@ async function manuallyCollectedSubscription(req, res) { res.render('subscriptions/manually-collected-subscription', { groupName: subscription.teamName, + errorType: req.query.error_type, }) } catch (error) { logger.err( diff --git a/services/web/app/views/subscriptions/manually-collected-subscription.pug b/services/web/app/views/subscriptions/manually-collected-subscription.pug index a693ac749f..892ded0d7c 100644 --- a/services/web/app/views/subscriptions/manually-collected-subscription.pug +++ b/services/web/app/views/subscriptions/manually-collected-subscription.pug @@ -6,6 +6,7 @@ block entrypointVar block append meta meta(name='ol-user' data-type='json' content=user) meta(name='ol-groupName' data-type='string' content=groupName) + meta(name='ol-errorType' data-type='string' content=errorType) block content main#manually-collected-subscription-root.content.content-alt diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 20330a7db9..84e61631ef 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -934,6 +934,7 @@ "issued_on": "", "it_looks_like_that_didnt_work_you_can_try_again_or_get_in_touch": "", "it_looks_like_your_account_is_billed_manually_purchasing_additional_license_or_upgrading_subscription": "", + "it_looks_like_your_account_is_billed_manually_upgrading_subscription": "", "it_looks_like_your_payment_details_are_missing_please_update_your_billing_information": "", "italics": "", "join_beta_program": "", diff --git a/services/web/frontend/js/features/group-management/components/manually-collected-subscription.tsx b/services/web/frontend/js/features/group-management/components/manually-collected-subscription.tsx index 633c2d23f8..1bbf76c054 100644 --- a/services/web/frontend/js/features/group-management/components/manually-collected-subscription.tsx +++ b/services/web/frontend/js/features/group-management/components/manually-collected-subscription.tsx @@ -1,15 +1,11 @@ import { Trans, useTranslation } from 'react-i18next' import OLNotification from '@/shared/components/ol/ol-notification' import Card from '@/features/group-management/components/card' -import useWaitForI18n from '@/shared/hooks/use-wait-for-i18n' +import getMeta from '@/utils/meta' function ManuallyCollectedSubscription() { const { t } = useTranslation() - const { isReady } = useWaitForI18n() - - if (!isReady) { - return null - } + const errorType = getMeta('ol-errorType') return ( @@ -17,13 +13,23 @@ function ManuallyCollectedSubscription() { type="error" title={t('account_billed_manually')} content={ - , - ]} - /> + errorType === 'plan-upgrade' ? ( + , + ]} + /> + ) : ( + , + ]} + /> + ) } className="m-0" /> diff --git a/services/web/frontend/js/pages/user/subscription/group-management/manually-collected-subscription.tsx b/services/web/frontend/js/pages/user/subscription/group-management/manually-collected-subscription.tsx index dedeffe15d..49aee93ca0 100644 --- a/services/web/frontend/js/pages/user/subscription/group-management/manually-collected-subscription.tsx +++ b/services/web/frontend/js/pages/user/subscription/group-management/manually-collected-subscription.tsx @@ -1,14 +1,9 @@ import '../base' import { createRoot } from 'react-dom/client' import ManuallyCollectedSubscription from '@/features/group-management/components/manually-collected-subscription' -import { SplitTestProvider } from '@/shared/context/split-test-context' const element = document.getElementById('manually-collected-subscription-root') if (element) { const root = createRoot(element) - root.render( - - - - ) + root.render() } diff --git a/services/web/frontend/js/utils/meta.ts b/services/web/frontend/js/utils/meta.ts index e910b54335..cc1f523de9 100644 --- a/services/web/frontend/js/utils/meta.ts +++ b/services/web/frontend/js/utils/meta.ts @@ -123,6 +123,7 @@ export interface Meta { 'ol-email': string 'ol-emailAddressLimit': number 'ol-error': { name: string } | undefined + 'ol-errorType': string | undefined 'ol-expired': boolean 'ol-features': Features 'ol-footer': FooterMetadata diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 81e8fe8c34..66ed776eb6 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -1191,6 +1191,7 @@ "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_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_account_is_billed_manually_upgrading_subscription": "It looks like your account is being billed manually - 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", "ja": "Japanese", diff --git a/services/web/test/unit/src/Subscription/SubscriptionGroupController.test.mjs b/services/web/test/unit/src/Subscription/SubscriptionGroupController.test.mjs index b326e3f030..406195ab69 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionGroupController.test.mjs +++ b/services/web/test/unit/src/Subscription/SubscriptionGroupController.test.mjs @@ -532,7 +532,7 @@ describe('SubscriptionGroupController', function () { const res = { redirect: url => { url.should.equal( - '/user/subscription/group/manually-collected-subscription' + '/user/subscription/group/manually-collected-subscription?error_type=no-additional-license' ) resolve() }, @@ -872,7 +872,7 @@ describe('SubscriptionGroupController', function () { const res = { redirect: url => { url.should.equal( - '/user/subscription/group/manually-collected-subscription' + '/user/subscription/group/manually-collected-subscription?error_type=plan-upgrade' ) resolve() },