Переглянути джерело

Merge pull request #26135 from overleaf/dp-error-logs-ai

Add AI paywall to new error logs

GitOrigin-RevId: 2d6dad11dfe3b27c8ff322a9778a53496cfe7277
David 1 рік тому
батько
коміт
637312e4f8

+ 1 - 0
services/web/config/settings.defaults.js

@@ -1002,6 +1002,7 @@ module.exports = {
     fullProjectSearchPanel: [],
     fullProjectSearchPanel: [],
     integrationPanelComponents: [],
     integrationPanelComponents: [],
     referenceSearchSetting: [],
     referenceSearchSetting: [],
+    errorLogsComponents: [],
   },
   },
 
 
   moduleImportSequence: [
   moduleImportSequence: [

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

@@ -1,7 +1,9 @@
 {
 {
+  "0_free_suggestions": "",
   "12x_more_compile_time": "",
   "12x_more_compile_time": "",
   "1_2_width": "",
   "1_2_width": "",
   "1_4_width": "",
   "1_4_width": "",
+  "1_free_suggestion": "",
   "3_4_width": "",
   "3_4_width": "",
   "About": "",
   "About": "",
   "Account": "",
   "Account": "",
@@ -624,6 +626,7 @@
   "generic_if_problem_continues_contact_us": "",
   "generic_if_problem_continues_contact_us": "",
   "generic_linked_file_compile_error": "",
   "generic_linked_file_compile_error": "",
   "generic_something_went_wrong": "",
   "generic_something_went_wrong": "",
+  "get_ai_assist": "",
   "get_collaborative_benefits": "",
   "get_collaborative_benefits": "",
   "get_discounted_plan": "",
   "get_discounted_plan": "",
   "get_error_assist": "",
   "get_error_assist": "",

+ 10 - 1
services/web/frontend/js/features/ide-redesign/components/error-logs/error-logs.tsx

@@ -1,5 +1,5 @@
 import { useTranslation } from 'react-i18next'
 import { useTranslation } from 'react-i18next'
-import { memo, useMemo, useState } from 'react'
+import { ElementType, memo, useMemo, useState } from 'react'
 import { usePdfPreviewContext } from '@/features/pdf-preview/components/pdf-preview-provider'
 import { usePdfPreviewContext } from '@/features/pdf-preview/components/pdf-preview-provider'
 import StopOnFirstErrorPrompt from '@/features/pdf-preview/components/stop-on-first-error-prompt'
 import StopOnFirstErrorPrompt from '@/features/pdf-preview/components/stop-on-first-error-prompt'
 import PdfPreviewError from '@/features/pdf-preview/components/pdf-preview-error'
 import PdfPreviewError from '@/features/pdf-preview/components/pdf-preview-error'
@@ -11,6 +11,12 @@ import { useDetachCompileContext as useCompileContext } from '@/shared/context/d
 import { Nav, NavLink, TabContainer, TabContent } from 'react-bootstrap'
 import { Nav, NavLink, TabContainer, TabContent } from 'react-bootstrap'
 import { LogEntry as LogEntryData } from '@/features/pdf-preview/util/types'
 import { LogEntry as LogEntryData } from '@/features/pdf-preview/util/types'
 import LogEntry from './log-entry'
 import LogEntry from './log-entry'
+import importOverleafModules from '../../../../../macros/import-overleaf-module.macro'
+
+const logsComponents: Array<{
+  import: { default: ElementType }
+  path: string
+}> = importOverleafModules('errorLogsComponents')
 
 
 type ErrorLogTab = {
 type ErrorLogTab = {
   key: string
   key: string
@@ -52,6 +58,9 @@ function ErrorLogs() {
           <TabHeader key={tab.key} tab={tab} active={activeTab === tab.key} />
           <TabHeader key={tab.key} tab={tab} active={activeTab === tab.key} />
         ))}
         ))}
       </Nav>
       </Nav>
+      {logsComponents.map(({ import: { default: Component }, path }) => (
+        <Component key={path} />
+      ))}
       <TabContent className="error-logs">
       <TabContent className="error-logs">
         <div className="logs-pane-content">
         <div className="logs-pane-content">
           {stoppedOnFirstError && includeErrors && <StopOnFirstErrorPrompt />}
           {stoppedOnFirstError && includeErrors && <StopOnFirstErrorPrompt />}

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

@@ -1,8 +1,10 @@
 {
 {
+  "0_free_suggestions": "0 free suggestions",
   "12x_basic": "12x Basic",
   "12x_basic": "12x Basic",
   "12x_more_compile_time": "12x more compile time on our fastest servers",
   "12x_more_compile_time": "12x more compile time on our fastest servers",
   "1_2_width": "½ width",
   "1_2_width": "½ width",
   "1_4_width": "¼ width",
   "1_4_width": "¼ width",
+  "1_free_suggestion": "1 free suggestion",
   "3_4_width": "¾ width",
   "3_4_width": "¾ width",
   "About": "About",
   "About": "About",
   "Account": "Account",
   "Account": "Account",
@@ -824,6 +826,7 @@
   "generic_if_problem_continues_contact_us": "If the problem continues please contact us",
   "generic_if_problem_continues_contact_us": "If the problem continues please contact us",
   "generic_linked_file_compile_error": "This project’s output files are not available because it failed to compile. Please open the project to see the compilation error details.",
   "generic_linked_file_compile_error": "This project’s output files are not available because it failed to compile. Please open the project to see the compilation error details.",
   "generic_something_went_wrong": "Sorry, something went wrong",
   "generic_something_went_wrong": "Sorry, something went wrong",
+  "get_ai_assist": "Get AI Assist",
   "get_collaborative_benefits": "Get the collaborative benefits from __appName__, even if you prefer to work offline",
   "get_collaborative_benefits": "Get the collaborative benefits from __appName__, even if you prefer to work offline",
   "get_discounted_plan": "Get discounted plan",
   "get_discounted_plan": "Get discounted plan",
   "get_error_assist": "Get Error Assist",
   "get_error_assist": "Get Error Assist",