Просмотр исходного кода

Merge pull request #29289 from overleaf/rh-compile-timeout-remove-info

Support compile-timeout-remove-info split test in paywalls

GitOrigin-RevId: d557417ab0bd63fce82f4ffb5d66e8e1c9b0b039
roo hutton 9 месяцев назад
Родитель
Сommit
43c0ba828d

+ 1 - 0
services/web/app/src/Features/Project/ProjectController.mjs

@@ -405,6 +405,7 @@ const _ProjectController = {
       'editor-redesign-new-users',
       'writefull-frontend-migration',
       'chat-edit-delete',
+      'compile-timeout-remove-info',
     ].filter(Boolean)
 
     const getUserValues = async userId =>

+ 9 - 4
services/web/frontend/js/features/ide-redesign/components/pdf-preview/pdf-error-state/compile-timeout-error-state.tsx

@@ -12,12 +12,15 @@ import {
   isNewUser,
   useIsNewEditorEnabled,
 } from '@/features/ide-redesign/utils/new-editor-utils'
-import { getSplitTestVariant } from '@/utils/splitTestUtils'
+import { getSplitTestVariant, isSplitTestEnabled } from '@/utils/splitTestUtils'
 
 export const ShortCompileTimeoutErrorState = () => {
   const { t } = useTranslation()
   const { isProjectOwner } = useCompileContext()
   const newEditor = useIsNewEditorEnabled()
+  const shouldHideCompileTimeoutInfo = isSplitTestEnabled(
+    'compile-timeout-remove-info'
+  )
 
   const { compileTimeout } = getMeta('ol-compileSettings')
   const segmentation = useMemo(
@@ -79,9 +82,11 @@ export const ShortCompileTimeoutErrorState = () => {
       }
       iconType="running_with_errors"
       extraContent={
-        <div className="pdf-error-state-info-box">
-          <ReasonsForTimeoutInfo />
-        </div>
+        !shouldHideCompileTimeoutInfo && (
+          <div className="pdf-error-state-info-box">
+            <ReasonsForTimeoutInfo />
+          </div>
+        )
       }
       actions={
         isProjectOwner && (

+ 13 - 7
services/web/frontend/js/features/pdf-preview/components/timeout-upgrade-prompt-new.tsx

@@ -13,7 +13,7 @@ import {
   useIsNewEditorEnabled,
   useIsNewErrorLogsPositionEnabled,
 } from '@/features/ide-redesign/utils/new-editor-utils'
-import { getSplitTestVariant } from '@/utils/splitTestUtils'
+import { getSplitTestVariant, isSplitTestEnabled } from '@/utils/splitTestUtils'
 
 function TimeoutUpgradePromptNew() {
   const {
@@ -23,6 +23,9 @@ function TimeoutUpgradePromptNew() {
     isProjectOwner,
   } = useDetachCompileContext()
   const newEditor = useIsNewEditorEnabled()
+  const shouldHideCompileTimeoutInfo = isSplitTestEnabled(
+    'compile-timeout-remove-info'
+  )
 
   const { enableStopOnFirstError } = useStopOnFirstError({
     eventSource: 'timeout-new',
@@ -55,12 +58,15 @@ function TimeoutUpgradePromptNew() {
         isProjectOwner={isProjectOwner}
         segmentation={sharedSegmentation}
       />
-      {getMeta('ol-ExposedSettings').enableSubscriptions && (
-        <PreventTimeoutHelpMessage
-          handleEnableStopOnFirstErrorClick={handleEnableStopOnFirstErrorClick}
-          lastCompileOptions={lastCompileOptions}
-        />
-      )}
+      {getMeta('ol-ExposedSettings').enableSubscriptions &&
+        !shouldHideCompileTimeoutInfo && (
+          <PreventTimeoutHelpMessage
+            handleEnableStopOnFirstErrorClick={
+              handleEnableStopOnFirstErrorClick
+            }
+            lastCompileOptions={lastCompileOptions}
+          />
+        )}
     </>
   )
 }