mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
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:
parent
19dc975e3a
commit
d93299d47d
5 changed files with 2 additions and 28 deletions
|
@ -729,6 +729,7 @@ const _ProjectController = {
|
||||||
referal_id: user.referal_id,
|
referal_id: user.referal_id,
|
||||||
signUpDate: user.signUpDate,
|
signUpDate: user.signUpDate,
|
||||||
allowedFreeTrial,
|
allowedFreeTrial,
|
||||||
|
hasRecurlySubscription: subscription?.recurlySubscription_id != null,
|
||||||
featureSwitches: user.featureSwitches,
|
featureSwitches: user.featureSwitches,
|
||||||
features: user.features,
|
features: user.features,
|
||||||
featureUsage,
|
featureUsage,
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import { useTranslation, Trans } from 'react-i18next'
|
import { useTranslation, Trans } from 'react-i18next'
|
||||||
import { isSplitTestEnabled } from '@/utils/splitTestUtils'
|
|
||||||
import { AI_STANDALONE_PLAN_CODE } from '../../data/add-on-codes'
|
|
||||||
|
|
||||||
function FreePlan() {
|
function FreePlan() {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
@ -28,14 +26,6 @@ function FreePlan() {
|
||||||
<a className="btn btn-primary me-1" href="/user/subscription/plans">
|
<a className="btn btn-primary me-1" href="/user/subscription/plans">
|
||||||
{t('upgrade_now')}
|
{t('upgrade_now')}
|
||||||
</a>
|
</a>
|
||||||
{isSplitTestEnabled('ai-add-on') && (
|
|
||||||
<a
|
|
||||||
className="btn btn-secondary"
|
|
||||||
href={`/user/subscription/new?planCode=${AI_STANDALONE_PLAN_CODE}`}
|
|
||||||
>
|
|
||||||
{t('buy_overleaf_assist')}
|
|
||||||
</a>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,6 @@ import { ConfirmChangePlanModal } from './change-plan/modals/confirm-change-plan
|
||||||
import { KeepCurrentPlanModal } from './change-plan/modals/keep-current-plan-modal'
|
import { KeepCurrentPlanModal } from './change-plan/modals/keep-current-plan-modal'
|
||||||
import { ChangeToGroupModal } from './change-plan/modals/change-to-group-modal'
|
import { ChangeToGroupModal } from './change-plan/modals/change-to-group-modal'
|
||||||
import OLButton from '@/features/ui/components/ol/ol-button'
|
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({
|
export function ActiveSubscription({
|
||||||
subscription,
|
subscription,
|
||||||
|
@ -29,8 +27,6 @@ export function ActiveSubscription({
|
||||||
|
|
||||||
if (showCancellation) return <CancelSubscription />
|
if (showCancellation) return <CancelSubscription />
|
||||||
|
|
||||||
const aiAddOnAvailable = isSplitTestEnabled('ai-add-on')
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<p>
|
<p>
|
||||||
|
@ -149,8 +145,6 @@ export function ActiveSubscription({
|
||||||
<ConfirmChangePlanModal />
|
<ConfirmChangePlanModal />
|
||||||
<KeepCurrentPlanModal />
|
<KeepCurrentPlanModal />
|
||||||
<ChangeToGroupModal />
|
<ChangeToGroupModal />
|
||||||
{/* to be removed once we have purchasing options ready */}
|
|
||||||
{aiAddOnAvailable && <BuyAiAddOnButton />}
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
|
||||||
}
|
|
|
@ -37,6 +37,7 @@ export type User = {
|
||||||
isAdmin?: boolean
|
isAdmin?: boolean
|
||||||
email: string
|
email: string
|
||||||
allowedFreeTrial?: boolean
|
allowedFreeTrial?: boolean
|
||||||
|
hasRecurlySubscription?: boolean
|
||||||
first_name?: string
|
first_name?: string
|
||||||
last_name?: string
|
last_name?: string
|
||||||
alphaProgram?: boolean
|
alphaProgram?: boolean
|
||||||
|
|
Loading…
Reference in a new issue