From de7eb43f51c3b8e6517d035009f7f24e858fdd75 Mon Sep 17 00:00:00 2001 From: Tim Down Date: Mon, 3 Oct 2022 16:22:13 +0100 Subject: [PATCH] Merge pull request #9792 from overleaf/ds-jpa-remove-stoponfirsterror-split-test Split Test removal - removed stop-on-first-error split test code GitOrigin-RevId: 4a5663397d0a967e0fa957453b36d466aa530630 --- .../src/Features/Project/ProjectController.js | 20 ---- .../web/app/views/project/editor/meta.pug | 1 - .../web/frontend/extracted-translations.json | 3 - .../components/pdf-compile-button.js | 26 ++-- .../components/pdf-preview-error.js | 112 +++++++----------- .../js/features/pdf-preview/util/compiler.js | 5 +- .../preview-logs-pane-max-entries.js | 70 ++++------- services/web/locales/en.json | 3 - 8 files changed, 82 insertions(+), 158 deletions(-) diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index 7bcfef1e22..700b3fdd55 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -932,21 +932,6 @@ const ProjectController = { } ) }, - stopOnFirstErrorAssignment(cb) { - SplitTestHandler.getAssignment( - req, - res, - 'stop-on-first-error', - (error, assignment) => { - // do not fail editor load if assignment fails - if (error) { - cb(null, { variant: 'default' }) - } else { - cb(null, assignment) - } - } - ) - }, interstitialPaymentFromPaywallAssignment(cb) { SplitTestHandler.getAssignment( req, @@ -1072,7 +1057,6 @@ const ProjectController = { newSourceEditorAssignment, pdfjsAssignment, dictionaryEditorAssignment, - stopOnFirstErrorAssignment, } ) => { if (err != null) { @@ -1179,9 +1163,6 @@ const ProjectController = { !userIsMemberOfGroupSubscription && !userHasInstitutionLicence - const showStopOnFirstError = - stopOnFirstErrorAssignment.variant === 'enabled' - const template = detachRole === 'detached' ? 'project/editor_detached' @@ -1252,7 +1233,6 @@ const ProjectController = { showSymbolPalette, galileoEnabled, galileoFeatures, - showStopOnFirstError, detachRole, metadata: { viewport: false }, showUpgradePrompt, diff --git a/services/web/app/views/project/editor/meta.pug b/services/web/app/views/project/editor/meta.pug index 47a90c981d..8574f0b305 100644 --- a/services/web/app/views/project/editor/meta.pug +++ b/services/web/app/views/project/editor/meta.pug @@ -26,7 +26,6 @@ meta(name="ol-galileoEnabled" data-type="string" content=galileoEnabled) meta(name="ol-galileoFeatures" data-type="json" content=galileoFeatures) meta(name="ol-detachRole" data-type="string" content=detachRole) meta(name="ol-showUpgradePrompt" data-type="boolean" content=showUpgradePrompt) -meta(name="ol-showStopOnFirstError" data-type="boolean" content=showStopOnFirstError) - var fileActionI18n = ['edited', 'renamed', 'created', 'deleted'].reduce((acc, i) => {acc[i] = translate('file_action_' + i); return acc}, {}) meta(name="ol-fileActionI18n" data-type="json" content=fileActionI18n) diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 974ef7fc6b..f3bc81de5f 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -317,7 +317,6 @@ "latex_help_guide": "", "layout": "", "layout_processing": "", - "learn_how_to_make_documents_compile_quickly": "", "learn_more": "", "learn_more_about_link_sharing": "", "leave": "", @@ -346,8 +345,6 @@ "log_entry_description": "", "log_entry_maximum_entries": "", "log_entry_maximum_entries_enable_stop_on_first_error": "", - "log_entry_maximum_entries_message": "", - "log_entry_maximum_entries_message_no_errors": "", "log_entry_maximum_entries_see_full_logs": "", "log_entry_maximum_entries_title": "", "log_hint_extra_info": "", diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.js b/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.js index 0aa9900cde..6aa5147371 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.js +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-compile-button.js @@ -7,7 +7,6 @@ import classnames from 'classnames' import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context' import { useStopOnFirstError } from '../../../shared/hooks/use-stop-on-first-error' import PdfCompileButtonInner from './pdf-compile-button-inner' -import getMeta from '../../../utils/meta' function PdfCompileButton() { const { @@ -30,7 +29,6 @@ function PdfCompileButton() { useStopOnFirstError({ eventSource: 'dropdown' }) const { t } = useTranslation() - const showStopOnFirstError = getMeta('ol-showStopOnFirstError') return ( - {showStopOnFirstError && ( - {t('compile_error_handling')} - )} + {t('compile_error_handling')} - {showStopOnFirstError && ( - - - {t('stop_on_first_error')} - - )} + + + {t('stop_on_first_error')} + - {showStopOnFirstError && ( - - - {t('try_to_compile_despite_errors')} - - )} + + + {t('try_to_compile_despite_errors')} + diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-preview-error.js b/services/web/frontend/js/features/pdf-preview/components/pdf-preview-error.js index 30beb6a281..0d0257fad0 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-preview-error.js +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-preview-error.js @@ -6,7 +6,6 @@ import PdfLogEntry from './pdf-log-entry' import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context' import { useStopOnFirstError } from '../../../shared/hooks/use-stop-on-first-error' import StopOnFirstErrorBadge from '../../../shared/components/stop-on-first-error-badge' -import getMeta from '../../../utils/meta' function PdfPreviewError({ error }) { const { t } = useTranslation() @@ -181,7 +180,6 @@ function TimedOutLogEntry() { }) const { startCompile, lastCompileOptions, setAnimateCompileDropdownArrow } = useCompileContext() - const showStopOnFirstError = getMeta('ol-showStopOnFirstError') const handleEnableStopOnFirstErrorClick = useCallback(() => { enableStopOnFirstError() @@ -189,74 +187,56 @@ function TimedOutLogEntry() { setAnimateCompileDropdownArrow(true) }, [enableStopOnFirstError, startCompile, setAnimateCompileDropdownArrow]) - if (showStopOnFirstError) { - return ( - -

{t('project_timed_out_intro')}

-
    -
  • - , - ]} - /> -
  • -
  • - , - ]} - /> - {!lastCompileOptions.stopOnFirstError && ( - <> - {' '} - , - ]} - />{' '} - - - )} -
  • -
-

+ return ( + +

{t('project_timed_out_intro')}

+ +

+ , + ]} + /> +

+
+ ) } TimedOutLogEntry.propTypes = {} diff --git a/services/web/frontend/js/features/pdf-preview/util/compiler.js b/services/web/frontend/js/features/pdf-preview/util/compiler.js index 28c175053d..0ae0753ec3 100644 --- a/services/web/frontend/js/features/pdf-preview/util/compiler.js +++ b/services/web/frontend/js/features/pdf-preview/util/compiler.js @@ -98,10 +98,9 @@ export default class DocumentCompiler { // use incremental compile for all users but revert to a full compile // if there was previously a server error incrementalCompilesEnabled: !this.error, + stopOnFirstError: options.stopOnFirstError, } - if (getMeta('ol-showStopOnFirstError')) { - body.stopOnFirstError = options.stopOnFirstError - } + const data = await postJSON( `/project/${this.projectId}/compile?${params}`, { body, signal: this.signal } diff --git a/services/web/frontend/js/features/preview/components/preview-logs-pane-max-entries.js b/services/web/frontend/js/features/preview/components/preview-logs-pane-max-entries.js index 0ade0e5e09..1833f89b69 100644 --- a/services/web/frontend/js/features/preview/components/preview-logs-pane-max-entries.js +++ b/services/web/frontend/js/features/preview/components/preview-logs-pane-max-entries.js @@ -4,14 +4,12 @@ import { Trans, useTranslation } from 'react-i18next' import { Button } from 'react-bootstrap' import PreviewLogEntryHeader from './preview-log-entry-header' import Icon from '../../../shared/components/icon' -import getMeta from '../../../utils/meta' import { useDetachCompileContext as useCompileContext } from '../../../shared/context/detach-compile-context' import { useStopOnFirstError } from '../../../shared/hooks/use-stop-on-first-error' import StopOnFirstErrorBadge from '../../../shared/components/stop-on-first-error-badge' function PreviewLogsPaneMaxEntries({ totalEntries, entriesShown, hasErrors }) { const { t } = useTranslation() - const showStopOnFirstError = getMeta('ol-showStopOnFirstError') const { startCompile, stoppedOnFirstError, setAnimateCompileDropdownArrow } = useCompileContext() const { enableStopOnFirstError } = useStopOnFirstError({ @@ -34,57 +32,39 @@ function PreviewLogsPaneMaxEntries({ totalEntries, entriesShown, hasErrors }) {
diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 87f074a82c..9e0699aa8c 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -41,8 +41,6 @@ "log_entry_description": "Log entry with level: __level__", "log_entry_maximum_entries": "Maximum log entries limit hit", "log_entry_maximum_entries_title": "__total__ log messages total. Showing the first __displayed__", - "log_entry_maximum_entries_message": "<0>Tip: Try to fix the first error and recompile. Often one error causes many later error messages.<1>If you need to see the full logs, you can still download them or view the raw logs below.", - "log_entry_maximum_entries_message_no_errors": "<0>Tip: If you need to see the full logs, you can still download them or view the raw logs below.", "log_entry_maximum_entries_enable_stop_on_first_error": "Try to fix the first error and recompile. Often one error causes many later error messages. You can to focus on fixing errors. We recommend fixing errors as soon as possible; letting them accumulate may lead to hard-to-debug and fatal errors. Learn more", "log_entry_maximum_entries_see_full_logs": "If you need to see the full logs, you can still download them or view the raw logs below.", "tip": "Tip", @@ -1403,7 +1401,6 @@ "importing_and_merging_changes_in_github": "Importing and merging changes in GitHub", "upgrade_for_faster_compiles": "Upgrade for faster compiles and to increase your timeout limit", "free_accounts_have_timeout_upgrade_to_increase": "Free accounts have a one minute timeout, whereas upgraded accounts have a timeout of four minutes.", - "learn_how_to_make_documents_compile_quickly": "Learn how to fix compile timeouts", "zh-CN": "Chinese", "cn": "Chinese (Simplified)", "sync_to_github": "Sync to GitHub",