diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index c57f04bcc6..c2caaf7045 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -67,6 +67,7 @@ "add_company_details_lowercase": "", "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": "", @@ -551,7 +552,7 @@ "get_discounted_plan": "", "get_dropbox_sync": "", "get_early_access_to_ai": "", - "get_error_assistant": "", + "get_error_assist": "", "get_exclusive_access_to_labs": "", "get_full_project_history": "", "get_git_integration": "", 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 e60397d60b..451412a11e 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 @@ -2,7 +2,10 @@ import { useCallback } from 'react' import { Grid, Row, Col, Button } from 'react-bootstrap' import moment from 'moment' import { useTranslation, Trans } from 'react-i18next' -import { SubscriptionChangePreview } from '../../../../../../types/subscription/subscription-change-preview' +import { + SubscriptionChangePreview, + AddOnPurchase, +} from '../../../../../../types/subscription/subscription-change-preview' import getMeta from '@/utils/meta' import { formatCurrencyLocalized } from '@/shared/utils/currency' import useAsync from '@/shared/hooks/use-async' @@ -12,9 +15,12 @@ import { postJSON } from '@/infrastructure/fetch-json' import Notification from '@/shared/components/notification' import { subscriptionUpdateUrl } from '@/features/subscription/data/subscription-url' import * as eventTracking from '@/infrastructure/event-tracking' +import sparkleText from '@/shared/svgs/ai-sparkle-text.svg' function PreviewSubscriptionChange() { - const preview = getMeta('ol-subscriptionChangePreview') + const preview = getMeta( + 'ol-subscriptionChangePreview' + ) as SubscriptionChangePreview const { t } = useTranslation() const payNowTask = useAsync() const location = useLocation() @@ -29,6 +35,10 @@ function PreviewSubscriptionChange() { .catch(debugConsole.error) }, [location, payNowTask, preview]) + const addOnChange = preview.change.type === 'add-on-purchase' + const aiAddOnChange = + addOnChange && (preview.change as AddOnPurchase).addOn.code === 'assistant' + return ( @@ -59,6 +69,25 @@ function PreviewSubscriptionChange() { /> )} + {aiAddOnChange && ( +
+
+ )} +

{t('payment_summary')}

diff --git a/services/web/frontend/js/shared/svgs/ai-sparkle-text.svg b/services/web/frontend/js/shared/svgs/ai-sparkle-text.svg new file mode 100644 index 0000000000..2f004cb17e --- /dev/null +++ b/services/web/frontend/js/shared/svgs/ai-sparkle-text.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/services/web/locales/en.json b/services/web/locales/en.json index c0ef3860d5..df4e9d1139 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -79,7 +79,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_to_your_projects": "Add Error Assist to your projects and get AI help to fix LaTeX errors faster.", + "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_editors": "Add more editors", @@ -220,7 +221,6 @@ "built_in": "Built-In", "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_error_assistant_for": "Buy Error Assist for $__aiAddonCost__ per year", "buy_now_no_exclamation_mark": "Buy now", "buy_overleaf_assist": "Buy Overleaf Assist", "by": "by", @@ -713,7 +713,6 @@ "first_name_sentence_case": "First name", "fit_to_height": "Fit to height", "fit_to_width": "Fit to width", - "fix_latex_errors_fast_and_perfect_your_projects": "Fix LaTeX errors fast and perfect your projects with the AI-powered Error Assist.", "fixed_width": "Fixed width", "fixed_width_wrap_text": "Fixed width, wrap text", "flexible_plans_for_everyone": "Flexible plans for everyone—from individual students and researchers, to large businesses and universities.", @@ -787,7 +786,7 @@ "get_discounted_plan": "Get discounted plan", "get_dropbox_sync": "Get Dropbox Sync", "get_early_access_to_ai": "Get early access to the new AI Error Assistant in Overleaf Labs", - "get_error_assistant": "Get Error Assistant", + "get_error_assist": "Get Error Assist", "get_exclusive_access_to_labs": "Get exclusive access to early-stage experiments when you join Overleaf Labs. All we ask in return is your honest feedback to help us develop and improve.", "get_full_project_history": "Get full project history", "get_git_integration": "Get Git integration", @@ -1117,7 +1116,6 @@ "latam_discount_offer_plans_page_banner": "__flag__ We’ve applied a __discount__ discount to premium plans on this page for our users in __country__. Check out the new lower prices (in __currency__).", "latex_articles_page_summary": "Papers, presentations, reports and more, written in LaTeX and published by our community. Search or browse below.", "latex_articles_page_title": "Articles - Papers, Presentations, Reports and more", - "latex_error_fixing_with_a_little_help": "LaTeX error fixing with a little help from AI", "latex_examples": "LaTeX examples", "latex_examples_page_summary": "Examples of powerful LaTeX packages and techniques in use — a great way to learn LaTeX by example. Search or browse below.", "latex_examples_page_title": "Examples - Equations, Formatting, TikZ, Packages and More", diff --git a/services/web/types/subscription/subscription-change-preview.ts b/services/web/types/subscription/subscription-change-preview.ts index 5e4072b75d..7ea578d279 100644 --- a/services/web/types/subscription/subscription-change-preview.ts +++ b/services/web/types/subscription/subscription-change-preview.ts @@ -36,7 +36,7 @@ type AddOn = { export type SubscriptionChangeDescription = AddOnPurchase | PremiumSubscription -type AddOnPurchase = { +export type AddOnPurchase = { type: 'add-on-purchase' addOn: { code: string