Ver Fonte

[web] Fix AI quota paywall upgrade CTA to use interstitial page (#33376)

* Update hrefs

* Revert link on expired subscriptions

* Revert hrefs of other buttons

* Use `plans-2026-phase-1` feature flag

GitOrigin-RevId: 3fe489c6ec192adc2fb836b07429dc2a11f9a57f
Antoine Clausse há 5 meses atrás
pai
commit
590c2ab2e2

+ 7 - 1
services/web/frontend/js/features/ide-react/components/toolbar/upgrade-button.tsx

@@ -1,6 +1,7 @@
 import { useTranslation } from 'react-i18next'
 import { useTranslation } from 'react-i18next'
 import * as eventTracking from '../../../../infrastructure/event-tracking'
 import * as eventTracking from '../../../../infrastructure/event-tracking'
 import OLButton from '@/shared/components/ol/ol-button'
 import OLButton from '@/shared/components/ol/ol-button'
+import { useFeatureFlag } from '@/shared/context/split-test-context'
 
 
 export default function UpgradeButton({
 export default function UpgradeButton({
   className = '',
   className = '',
@@ -12,6 +13,7 @@ export default function UpgradeButton({
   source?: string
   source?: string
 }) {
 }) {
   const { t } = useTranslation()
   const { t } = useTranslation()
+  const plans2026 = useFeatureFlag('plans-2026-phase-1')
 
 
   function handleClick() {
   function handleClick() {
     eventTracking.send('subscription-funnel', source, 'upgrade')
     eventTracking.send('subscription-funnel', source, 'upgrade')
@@ -23,7 +25,11 @@ export default function UpgradeButton({
       <OLButton
       <OLButton
         variant="premium"
         variant="premium"
         size="sm"
         size="sm"
-        href={`/user/subscription/plans?itm_referrer=${referrer}`}
+        href={
+          plans2026
+            ? `/user/subscription/choose-your-plan?itm_referrer=${referrer}`
+            : `/user/subscription/plans?itm_referrer=${referrer}`
+        }
         target="_blank"
         target="_blank"
         rel="noreferrer"
         rel="noreferrer"
         onClick={handleClick}
         onClick={handleClick}

+ 6 - 1
services/web/frontend/js/features/subscription/components/dashboard/states/expired.tsx

@@ -22,7 +22,12 @@ export function ExpiredSubscription({
         >
         >
           {t('view_your_invoices')}
           {t('view_your_invoices')}
         </OLButton>
         </OLButton>
-        <OLButton href="/user/subscription/plans" variant="primary">
+        <OLButton
+          // We need to send users to the public plans page because the
+          // choose-your-plan still redirects them away in this expired state
+          href="/user/subscription/plans"
+          variant="primary"
+        >
           {t('create_new_subscription')}
           {t('create_new_subscription')}
         </OLButton>
         </OLButton>
       </p>
       </p>