Selaa lähdekoodia

[web] Add AI to plan features list (#31968)

* Add tooltip next to "Overleaf AI" row

* Add AI to features list

* Fix tests

* Revert changes which will be overwritten by https://github.com/overleaf/internal/pull/31993

* Add missing import (conflict with main)

GitOrigin-RevId: ce236670bd63701a3976a3eb84dc695ee0e928b1
Antoine Clausse 5 kuukautta sitten
vanhempi
sitoutus
e87488899a

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

@@ -2078,6 +2078,7 @@
   "university_school": "",
   "unknown": "",
   "unknown_group": "",
+  "unlimited_ai_use": "",
   "unlimited_collaborators_per_project": "",
   "unlimited_collabs": "",
   "unlimited_document_history": "",

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

@@ -1626,6 +1626,7 @@
   "overall_theme": "Overall theme",
   "overleaf": "Overleaf",
   "overleaf_ai": "Overleaf AI",
+  "overleaf_ai_info": "Built-in AI tools that support writing, editing, and LaTeX workflows. Fair usage applies.",
   "overleaf_group_plans": "Overleaf group plans",
   "overleaf_history_system": "Overleaf History System",
   "overleaf_individual_plans": "Overleaf individual plans",
@@ -2617,6 +2618,7 @@
   "unknown": "Unknown",
   "unknown_group": "Unknown group",
   "unlimited": "Unlimited",
+  "unlimited_ai_use": "Unlimited AI use",
   "unlimited_collaborators_per_project": "Unlimited collaborators per project",
   "unlimited_collabs": "Unlimited collaborators",
   "unlimited_document_history": "Unlimited document history",

+ 7 - 3
services/web/test/frontend/features/subscription/fixtures/plans.ts

@@ -1,8 +1,9 @@
-import { GroupPlans } from '../../../../../types/subscription/dashboard/group-plans'
-import { Plan } from '../../../../../types/subscription/plan'
+import { GroupPlans } from '@ol-types/subscription/dashboard/group-plans'
+import { Features, Plan } from '@ol-types/subscription/plan'
 
 const features = {
   student: {
+    aiUsageQuota: 'unlimited',
     collaborators: 6,
     dropbox: true,
     versioning: true,
@@ -19,6 +20,7 @@ const features = {
     symbolPalette: true,
   },
   personal: {
+    aiUsageQuota: 'basic',
     collaborators: 1,
     dropbox: true,
     versioning: true,
@@ -35,6 +37,7 @@ const features = {
     symbolPalette: true,
   },
   collaborator: {
+    aiUsageQuota: 'unlimited',
     collaborators: 10,
     dropbox: true,
     versioning: true,
@@ -51,6 +54,7 @@ const features = {
     symbolPalette: true,
   },
   professional: {
+    aiUsageQuota: 'unlimited',
     collaborators: -1,
     dropbox: true,
     versioning: true,
@@ -66,7 +70,7 @@ const features = {
     trackChanges: true,
     symbolPalette: true,
   },
-}
+} satisfies Record<string, Features>
 
 const studentAccounts: Array<Plan> = [
   {

+ 2 - 1
services/web/types/subscription/plan.ts

@@ -1,6 +1,7 @@
 import { StripeCurrencyCode } from './currency'
 
-type Features = {
+export type Features = {
+  aiUsageQuota: 'basic' | 'unlimited'
   collaborators: number
   compileGroup: string
   compileTimeout: number