mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #28379 from overleaf/dp-general-error-state
Update general error states in new editor GitOrigin-RevId: f6dd50fd8ecfb307c2b7f48df712328b4ab25cbc
This commit is contained in:
@@ -252,7 +252,7 @@
|
||||
"characters": "",
|
||||
"chat": "",
|
||||
"chat_error": "",
|
||||
"check_logs": "",
|
||||
"check_error_logs": "",
|
||||
"checking_dropbox_status": "",
|
||||
"checking_project_github_status": "",
|
||||
"choose_a_custom_color": "",
|
||||
@@ -1787,7 +1787,7 @@
|
||||
"thanks_settings_updated": "",
|
||||
"the_add_on_will_remain_active_until": "",
|
||||
"the_code_editor_color_scheme": "",
|
||||
"the_document_environment_contains_no_content": "",
|
||||
"the_document_environment_contains_no_content_learn_about_environments": "",
|
||||
"the_following_files_already_exist_in_this_project": "",
|
||||
"the_following_files_and_folders_already_exist_in_this_project": "",
|
||||
"the_following_folder_already_exists_in_this_project": "",
|
||||
@@ -1805,7 +1805,7 @@
|
||||
"then_x_price_per_month": "",
|
||||
"then_x_price_per_year": "",
|
||||
"there_are_lots_of_options_to_edit_and_customize_your_figures": "",
|
||||
"there_is_an_unrecoverable_latex_error_check_logs": "",
|
||||
"there_is_a_latex_error_check_logs": "",
|
||||
"there_was_a_problem_restoring_the_project_please_try_again_in_a_few_moments_or_contact_us": "",
|
||||
"they_lose_access_to_account": "",
|
||||
"they_will_be_removed_from_the_group": "",
|
||||
@@ -1827,7 +1827,7 @@
|
||||
"this_is_the_file_that_references_pulled_from_your_reference_manager_will_be_added_to": "",
|
||||
"this_project_already_has_maximum_collaborators": "",
|
||||
"this_project_compiled_but_soon_might_not": "",
|
||||
"this_project_contains_a_file_called_output": "",
|
||||
"this_project_contains_a_file_called_output_pdf": "",
|
||||
"this_project_exceeded_collaborator_limit": "",
|
||||
"this_project_exceeded_compile_timeout_limit_on_free_plan": "",
|
||||
"this_project_has_more_than_max_collabs": "",
|
||||
@@ -2086,7 +2086,6 @@
|
||||
"visual_editor": "",
|
||||
"visual_editor_is_only_available_for_tex_files": "",
|
||||
"want_change_to_apply_before_plan_end": "",
|
||||
"we_are_unable_to_generate_the_pdf_at_this_time": "",
|
||||
"we_are_unable_to_opt_you_into_this_experiment": "",
|
||||
"we_cant_find_any_sections_or_subsections_in_this_file": "",
|
||||
"we_do_not_share_personal_information": "",
|
||||
@@ -2176,6 +2175,7 @@
|
||||
"you_have_been_invited_to_transfer_management_of_your_account": "",
|
||||
"you_have_been_invited_to_transfer_management_of_your_account_to": "",
|
||||
"you_have_been_removed_from_this_project_and_will_be_redirected_to_project_dashboard": "",
|
||||
"you_have_errors_the_pdf_couldnt_compile": "",
|
||||
"you_have_x_licenses_and_your_plan_supports_up_to_y": "",
|
||||
"you_have_x_licenses_on_your_subscription": "",
|
||||
"you_may_be_able_to_fix_issues_to_speed_up_the_compile": "",
|
||||
|
||||
@@ -13,7 +13,7 @@ export default function ErrorState({
|
||||
extraContent,
|
||||
}: {
|
||||
title: string
|
||||
description: React.ReactNode
|
||||
description?: React.ReactNode
|
||||
iconType?: string
|
||||
actions?: React.ReactNode
|
||||
iconClassName?: string
|
||||
@@ -33,7 +33,9 @@ export default function ErrorState({
|
||||
</div>
|
||||
<div className="pdf-error-state-text">
|
||||
<p className="pdf-error-state-label">{title}</p>
|
||||
<p className="pdf-error-state-description">{description}</p>
|
||||
{description && (
|
||||
<p className="pdf-error-state-description">{description}</p>
|
||||
)}
|
||||
</div>
|
||||
{actions}
|
||||
</div>
|
||||
@@ -54,7 +56,7 @@ export const CheckLogsButton = () => {
|
||||
openRailTab('errors')
|
||||
}}
|
||||
>
|
||||
{t('check_logs')}
|
||||
{t('check_error_logs')}
|
||||
</OLButton>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,14 +1,36 @@
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import ErrorState, { CheckLogsButton } from './error-state'
|
||||
import MaterialIcon from '@/shared/components/material-icon'
|
||||
import { useDetachCompileContext as useCompileContext } from '@/shared/context/detach-compile-context'
|
||||
|
||||
export default function GeneralErrorState() {
|
||||
const { logEntries } = useCompileContext()
|
||||
const hasErrors = (logEntries?.errors?.length || 0) > 0
|
||||
|
||||
if (hasErrors) {
|
||||
return <GeneralErrorStateWithErrors />
|
||||
}
|
||||
|
||||
return <GeneralErrorStateWithoutErrors />
|
||||
}
|
||||
|
||||
function GeneralErrorStateWithErrors() {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<ErrorState
|
||||
title={t('you_have_errors_the_pdf_couldnt_compile')}
|
||||
actions={<CheckLogsButton />}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function GeneralErrorStateWithoutErrors() {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<ErrorState
|
||||
title={t('pdf_couldnt_compile')}
|
||||
description={t('we_are_unable_to_generate_the_pdf_at_this_time')}
|
||||
actions={<CheckLogsButton />}
|
||||
extraContent={
|
||||
<div className="pdf-error-state-info-box">
|
||||
@@ -18,9 +40,21 @@ export default function GeneralErrorState() {
|
||||
</div>
|
||||
<div className="pdf-error-state-info-box-text">
|
||||
<ul className="pdf-error-state-info-box-list">
|
||||
<li>{t('there_is_an_unrecoverable_latex_error_check_logs')}</li>
|
||||
<li>{t('the_document_environment_contains_no_content')}</li>
|
||||
<li>{t('this_project_contains_a_file_called_output')}</li>
|
||||
<li>{t('there_is_a_latex_error_check_logs')}</li>
|
||||
<li>
|
||||
<Trans
|
||||
i18nKey="the_document_environment_contains_no_content_learn_about_environments"
|
||||
components={[
|
||||
/* eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-key */
|
||||
<a
|
||||
href="/learn/latex/Environments"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
/>,
|
||||
]}
|
||||
/>
|
||||
</li>
|
||||
<li>{t('this_project_contains_a_file_called_output_pdf')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -321,7 +321,7 @@
|
||||
"characters": "Characters",
|
||||
"chat": "Chat",
|
||||
"chat_error": "Could not load chat messages, please try again.",
|
||||
"check_logs": "Check logs",
|
||||
"check_error_logs": "Check error logs",
|
||||
"check_your_email": "Check your email",
|
||||
"checking": "Checking",
|
||||
"checking_dropbox_status": "Checking Dropbox status",
|
||||
@@ -2304,7 +2304,7 @@
|
||||
"thanks_settings_updated": "Thanks, your settings have been updated.",
|
||||
"the_add_on_will_remain_active_until": "The add-on will remain active until the end of the current billing period.",
|
||||
"the_code_editor_color_scheme": "The code editor color scheme",
|
||||
"the_document_environment_contains_no_content": "The document environment contains no content. If it’s empty, please add some content and compile again.",
|
||||
"the_document_environment_contains_no_content_learn_about_environments": "The document environment contains no content. <0>Learn about environments</0>.",
|
||||
"the_file_supplied_is_of_an_unsupported_type ": "The link to open this content on Overleaf pointed to the wrong kind of file. Valid file types are .tex documents and .zip files. If this keeps happening for links on a particular site, please report this to them.",
|
||||
"the_following_files_already_exist_in_this_project": "The following files already exist in this project:",
|
||||
"the_following_files_and_folders_already_exist_in_this_project": "The following files and folders already exist in this project:",
|
||||
@@ -2330,7 +2330,7 @@
|
||||
"then_x_price_per_month": "Then __price__ per month",
|
||||
"then_x_price_per_year": "Then __price__ per year",
|
||||
"there_are_lots_of_options_to_edit_and_customize_your_figures": "There are lots of options to edit and customize your figures, such as wrapping text around the figure, rotating the image, or including multiple images in a single figure. You’ll need to edit the LaTeX code to do this. <0>Find out how</0>",
|
||||
"there_is_an_unrecoverable_latex_error_check_logs": "There is an unrecoverable LaTeX error. If there are LaTeX errors shown in the logs, please try to fix them and compile again.",
|
||||
"there_is_a_latex_error_check_logs": "There is a LaTeX error. Check the error logs and fix any errors.",
|
||||
"there_was_a_problem_restoring_the_project_please_try_again_in_a_few_moments_or_contact_us": "There was a problem restoring the project. Please try again in a few moments. Contact us if the problem persists.",
|
||||
"there_was_an_error_opening_your_content": "There was an error creating your project",
|
||||
"thesis": "Thesis",
|
||||
@@ -2355,7 +2355,7 @@
|
||||
"this_is_your_template": "This is your template from your project",
|
||||
"this_project_already_has_maximum_collaborators": "This project already has the maximum number of collaborators permitted on the owner’s plan. This means you can view but not edit or review the project.",
|
||||
"this_project_compiled_but_soon_might_not": "This project compiled, but soon it might not",
|
||||
"this_project_contains_a_file_called_output": "This project contains a file called output.pdf. If that file exists, please rename it and compile again.",
|
||||
"this_project_contains_a_file_called_output_pdf": "The project contains a file called output.pdf. If that file exists, rename it.",
|
||||
"this_project_exceeded_collaborator_limit": "This project exceeded the collaborator limit for your plan. All other users now have view-only access.",
|
||||
"this_project_exceeded_compile_timeout_limit_on_free_plan": "This project exceeded the compile timeout limit on our free plan.",
|
||||
"this_project_has_more_than_max_collabs": "This project has more than the maximum number of collaborators allowed on the project owner’s Overleaf plan. This means you could lose edit access from __linkSharingDate__.",
|
||||
@@ -2636,7 +2636,6 @@
|
||||
"visual_editor_is_only_available_for_tex_files": "Visual Editor is only available for TeX files",
|
||||
"want_access_to_overleaf_premium_features_through_your_university": "Want access to __appName__ premium features through your university?",
|
||||
"want_change_to_apply_before_plan_end": "If you wish this change to apply before the end of your current billing period, please contact us.",
|
||||
"we_are_unable_to_generate_the_pdf_at_this_time": "We are unable to generate the PDF at this time.",
|
||||
"we_are_unable_to_opt_you_into_this_experiment": "We are unable to opt you into this experiment at this time, please ensure your organization has allowed this feature, or try again later.",
|
||||
"we_cant_confirm_this_email": "We can’t confirm this email",
|
||||
"we_cant_find_any_sections_or_subsections_in_this_file": "We can’t find any sections or subsections in this file",
|
||||
@@ -2739,6 +2738,7 @@
|
||||
"you_have_been_invited_to_transfer_management_of_your_account": "You have been invited to transfer management of your account.",
|
||||
"you_have_been_invited_to_transfer_management_of_your_account_to": "You have been invited to transfer management of your account to __groupName__.",
|
||||
"you_have_been_removed_from_this_project_and_will_be_redirected_to_project_dashboard": "You have been removed from this project, and will no longer have access to it. You will be redirected to your project dashboard momentarily.",
|
||||
"you_have_errors_the_pdf_couldnt_compile": "You have errors. The PDF couldn’t compile.",
|
||||
"you_have_x_licenses_and_your_plan_supports_up_to_y": "You have allocated __addedUsersSize__ licenses and your plan supports up to __groupSize__.",
|
||||
"you_have_x_licenses_on_your_subscription": "You have __groupSize__ licenses on your subscription.",
|
||||
"you_may_be_able_to_fix_issues_to_speed_up_the_compile": "You may be able to fix issues to <0>speed up the compile</0>.",
|
||||
|
||||
Reference in New Issue
Block a user