Merge pull request #21741 from overleaf/jdt-assist-paywall-routing

Direct users to the correct assistant add-on checkout

GitOrigin-RevId: 884d6e68458bc8f27ce79a4849f580a9ec0997fb
This commit is contained in:
Jimmy Domagala-Tang 2024-11-13 07:37:30 -08:00 committed by Copybot
parent 19dc975e3a
commit d93299d47d
5 changed files with 2 additions and 28 deletions

View file

@ -729,6 +729,7 @@ const _ProjectController = {
referal_id: user.referal_id,
signUpDate: user.signUpDate,
allowedFreeTrial,
hasRecurlySubscription: subscription?.recurlySubscription_id != null,
featureSwitches: user.featureSwitches,
features: user.features,
featureUsage,

View file

@ -1,6 +1,4 @@
import { useTranslation, Trans } from 'react-i18next'
import { isSplitTestEnabled } from '@/utils/splitTestUtils'
import { AI_STANDALONE_PLAN_CODE } from '../../data/add-on-codes'
function FreePlan() {
const { t } = useTranslation()
@ -28,14 +26,6 @@ function FreePlan() {
<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=${AI_STANDALONE_PLAN_CODE}`}
>
{t('buy_overleaf_assist')}
</a>
)}
</>
)
}

View file

@ -15,8 +15,6 @@ import { ConfirmChangePlanModal } from './change-plan/modals/confirm-change-plan
import { KeepCurrentPlanModal } from './change-plan/modals/keep-current-plan-modal'
import { ChangeToGroupModal } from './change-plan/modals/change-to-group-modal'
import OLButton from '@/features/ui/components/ol/ol-button'
import { BuyAiAddOnButton } from './change-plan/buy-ai-add-on-button'
import { isSplitTestEnabled } from '@/utils/splitTestUtils'
export function ActiveSubscription({
subscription,
@ -29,8 +27,6 @@ export function ActiveSubscription({
if (showCancellation) return <CancelSubscription />
const aiAddOnAvailable = isSplitTestEnabled('ai-add-on')
return (
<>
<p>
@ -149,8 +145,6 @@ export function ActiveSubscription({
<ConfirmChangePlanModal />
<KeepCurrentPlanModal />
<ChangeToGroupModal />
{/* to be removed once we have purchasing options ready */}
{aiAddOnAvailable && <BuyAiAddOnButton />}
</>
)
}

View file

@ -1,12 +0,0 @@
import { Button } from 'react-bootstrap'
import { postJSON } from '@/infrastructure/fetch-json'
import { AI_ADD_ON_CODE } from '../../../../../data/add-on-codes'
export function BuyAiAddOnButton() {
const addAiAddon = async () => {
await postJSON(`/user/subscription/addon/${AI_ADD_ON_CODE}/add`)
location.reload()
}
return <Button onClick={addAiAddon}>Purchase AI subscription </Button>
}

View file

@ -37,6 +37,7 @@ export type User = {
isAdmin?: boolean
email: string
allowedFreeTrial?: boolean
hasRecurlySubscription?: boolean
first_name?: string
last_name?: string
alphaProgram?: boolean