From ab37e18bc33d09be17e9abeb8706797ee4aff714 Mon Sep 17 00:00:00 2001 From: Domagoj Kriskovic Date: Mon, 19 May 2025 15:06:25 +0200 Subject: [PATCH] Update AI Assist wording on checkout page if not in rollout (#25689) (#25733) * Update AI Assist wording on checkout page if not in rollout * update wording when buyin addon GitOrigin-RevId: 7133b4fd3efac8e8a7361dcc15d54367f809f16d --- .../Subscription/SubscriptionController.js | 6 +++ .../web/frontend/extracted-translations.json | 2 + .../preview-subscription-change/root.tsx | 47 +++++++++++++------ .../user/subscription/preview-change.tsx | 7 ++- services/web/locales/en.json | 2 + 5 files changed, 49 insertions(+), 15 deletions(-) diff --git a/services/web/app/src/Features/Subscription/SubscriptionController.js b/services/web/app/src/Features/Subscription/SubscriptionController.js index be2f409b86..d0025c460b 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionController.js +++ b/services/web/app/src/Features/Subscription/SubscriptionController.js @@ -379,6 +379,12 @@ async function previewAddonPurchase(req, res) { paymentMethod ) + await SplitTestHandler.promises.getAssignment( + req, + res, + 'overleaf-assist-bundle' + ) + res.render('subscriptions/preview-change', { changePreview, purchaseReferrer, diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index bb5d208f12..6c5af98c38 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -74,6 +74,8 @@ "add_company_details": "", "add_email_address": "", "add_email_to_claim_features": "", + "add_error_assist_annual_to_your_projects": "", + "add_error_assist_to_your_projects": "", "add_files": "", "add_more_collaborators": "", "add_more_licenses_to_my_plan": "", diff --git a/services/web/frontend/js/features/subscription/components/preview-subscription-change/root.tsx b/services/web/frontend/js/features/subscription/components/preview-subscription-change/root.tsx index 705af73e27..367a5e35a9 100644 --- a/services/web/frontend/js/features/subscription/components/preview-subscription-change/root.tsx +++ b/services/web/frontend/js/features/subscription/components/preview-subscription-change/root.tsx @@ -20,6 +20,7 @@ import OLButton from '@/features/ui/components/ol/ol-button' import { subscriptionUpdateUrl } from '@/features/subscription/data/subscription-url' import * as eventTracking from '@/infrastructure/event-tracking' import sparkleText from '@/shared/svgs/ai-sparkle-text.svg' +import { useFeatureFlag } from '@/shared/context/split-test-context' function PreviewSubscriptionChange() { const preview = getMeta( @@ -29,6 +30,7 @@ function PreviewSubscriptionChange() { const { t } = useTranslation() const payNowTask = useAsync() const location = useLocation() + const aiAssistEnabled = useFeatureFlag('overleaf-assist-bundle') useEffect(() => { if (preview.change.type === 'add-on-purchase') { @@ -107,20 +109,37 @@ function PreviewSubscriptionChange() { {aiAddOnChange && (
-
)} diff --git a/services/web/frontend/js/pages/user/subscription/preview-change.tsx b/services/web/frontend/js/pages/user/subscription/preview-change.tsx index 7b4b4c68b0..9ff5f14d45 100644 --- a/services/web/frontend/js/pages/user/subscription/preview-change.tsx +++ b/services/web/frontend/js/pages/user/subscription/preview-change.tsx @@ -1,9 +1,14 @@ import '@/marketing' import { createRoot } from 'react-dom/client' import PreviewSubscriptionChange from '@/features/subscription/components/preview-subscription-change/root' +import { SplitTestProvider } from '@/shared/context/split-test-context' const element = document.getElementById('subscription-preview-change') if (element) { const root = createRoot(element) - root.render() + root.render( + + + + ) } diff --git a/services/web/locales/en.json b/services/web/locales/en.json index ddf96c30bc..6495a24fbd 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -88,6 +88,8 @@ "add_email": "Add Email", "add_email_address": "Add email address", "add_email_to_claim_features": "Add an institutional email address to claim your features.", + "add_error_assist_annual_to_your_projects": "Add Error Assist Annual to your projects and get unlimited AI help to fix LaTeX errors faster.", + "add_error_assist_to_your_projects": "Add Error Assist to your projects and get unlimited AI help to fix LaTeX errors faster.", "add_files": "Add Files", "add_more_collaborators": "Add more collaborators", "add_more_licenses_to_my_plan": "Add more licenses to my plan",