Przeglądaj źródła

Merge pull request #20547 from overleaf/em-assist-plan

Add a button for buying standalone Overleaf Assist

GitOrigin-RevId: 50baea48ea990eba38ef564b71a79a76bbd45dfc
Eric Mc Sween 2 lat temu
rodzic
commit
918d0f24eb

+ 1 - 0
services/web/app/src/Features/Subscription/SubscriptionController.js

@@ -231,6 +231,7 @@ async function userSubscriptionPage(req, res) {
     res,
     'local-ccy-format-v2'
   )
+  await SplitTestHandler.promises.getAssignment(req, res, 'ai-add-on')
 
   // Populates splitTestVariants with a value for the split test name and allows
   // Pug to read it

+ 1 - 0
services/web/frontend/extracted-translations.json

@@ -146,6 +146,7 @@
   "browser": "",
   "bulk_accept_confirm": "",
   "bulk_reject_confirm": "",
+  "buy_overleaf_assist": "",
   "by_subscribing_you_agree_to_our_terms_of_service": "",
   "can_edit": "",
   "can_link_institution_email_acct_to_institution_acct": "",

+ 10 - 1
services/web/frontend/js/features/subscription/components/dashboard/free-plan.tsx

@@ -1,4 +1,5 @@
 import { useTranslation, Trans } from 'react-i18next'
+import { isSplitTestEnabled } from '@/utils/splitTestUtils'
 
 function FreePlan() {
   const { t } = useTranslation()
@@ -23,9 +24,17 @@ function FreePlan() {
         <li>{t('github_integration_lowercase')}</li>
         <li>{t('priority_support')}</li>
       </ul>
-      <a className="btn btn-primary" href="/user/subscription/plans">
+      <a className="btn btn-primary me-1" href="/user/subscription/plans">
         {t('upgrade_now')}
       </a>
+      {isSplitTestEnabled('ai-add-on') && (
+        <a
+          className="btn btn-secondary"
+          href="/user/subscription/new?planCode=assist"
+        >
+          {t('buy_overleaf_assist')}
+        </a>
+      )}
     </>
   )
 }

+ 11 - 2
services/web/frontend/js/features/subscription/components/dashboard/states/expired.tsx

@@ -1,5 +1,6 @@
 import { useTranslation } from 'react-i18next'
 import { RecurlySubscription } from '../../../../../../../types/subscription/dashboard/subscription'
+import { isSplitTestEnabled } from '@/utils/splitTestUtils'
 
 export function ExpiredSubscription({
   subscription,
@@ -14,12 +15,20 @@ export function ExpiredSubscription({
       <p>
         <a
           href={subscription.recurly.accountManagementLink}
-          className="btn btn-secondary-info btn-secondary"
+          className="btn btn-secondary-info btn-secondary me-1"
           target="_blank"
           rel="noreferrer noopener"
         >
           {t('view_your_invoices')}
-        </a>{' '}
+        </a>
+        {isSplitTestEnabled('ai-add-on') && (
+          <a
+            className="btn btn-secondary me-1"
+            href="/user/subscription/new?planCode=assist"
+          >
+            {t('buy_overleaf_assist')}
+          </a>
+        )}
         <a href="/user/subscription/plans" className="btn btn-primary">
           {t('create_new_subscription')}
         </a>

+ 1 - 0
services/web/locales/en.json

@@ -203,6 +203,7 @@
   "bulk_accept_confirm": "Are you sure you want to accept the selected __nChanges__ changes?",
   "bulk_reject_confirm": "Are you sure you want to reject the selected __nChanges__ changes?",
   "buy_now_no_exclamation_mark": "Buy now",
+  "buy_overleaf_assist": "Buy Overleaf Assist",
   "by": "by",
   "by_joining_labs": "By joining Labs, you agree to receive occasional emails and updates from Overleaf—for example, to request your feedback. You also agree to our <0>terms of service</0> and <1>privacy notice</1>.",
   "by_registering_you_agree_to_our_terms_of_service": "By registering, you agree to our <0>terms of service</0> and <1>privacy notice</1>.",