1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-14 07:44:30 +00:00

Update log error ordering and wording on tips ()

* Show bibtex errors with compile errors
* Update wording on error log tips

GitOrigin-RevId: 0e25a05418b241526958016f1b525334d33ad741
This commit is contained in:
Miguel Serrano 2021-11-25 11:24:25 +01:00 committed by Copybot
parent ec065147fb
commit 7de1e6f979
6 changed files with 32 additions and 11 deletions
services/web

View file

@ -185,6 +185,7 @@
"log_entry_description": "",
"log_entry_maximum_entries": "",
"log_entry_maximum_entries_message": "",
"log_entry_maximum_entries_message_no_errors": "",
"log_entry_maximum_entries_title": "",
"log_hint_extra_info": "",
"log_viewer_error": "",

View file

@ -7,7 +7,7 @@ import { useIdeContext } from '../../../shared/context/ide-context'
const LOG_PREVIEW_LIMIT = 100
function PdfLogsEntries({ entries }) {
function PdfLogsEntries({ entries, hasErrors }) {
const { t } = useTranslation()
const ide = useIdeContext()
@ -34,6 +34,7 @@ function PdfLogsEntries({ entries }) {
<PreviewLogsPaneMaxEntries
totalEntries={entries.length}
entriesShown={LOG_PREVIEW_LIMIT}
hasErrors={hasErrors}
/>
)}
{logEntries.map(logEntry => (
@ -61,6 +62,7 @@ function PdfLogsEntries({ entries }) {
}
PdfLogsEntries.propTypes = {
entries: PropTypes.arrayOf(PropTypes.object),
hasErrors: PropTypes.bool,
}
export default memo(PdfLogsEntries)

View file

@ -42,7 +42,12 @@ function PdfLogsViewer() {
<PdfValidationIssue key={name} name={name} issue={issue} />
))}
{logEntries?.all && <PdfLogsEntries entries={logEntries.all} />}
{logEntries?.all && (
<PdfLogsEntries
entries={logEntries.all}
hasErrors={logEntries.errors.length > 0}
/>
)}
{rawLog && (
<PdfLogEntry

View file

@ -53,7 +53,6 @@ export const handleOutputFiles = async (projectId, data) => {
}
result.logEntries = {
all: [],
errors: [],
warnings: [],
typesetting: [],
@ -72,7 +71,6 @@ export const handleOutputFiles = async (projectId, data) => {
entry.key = `${entry.file}:${entry.line}:${entry.column}:${entry.message}`
}
result.logEntries[key].push(...newEntries[key])
result.logEntries.all.push(...newEntries[key])
}
}
}
@ -114,6 +112,12 @@ export const handleOutputFiles = async (projectId, data) => {
result.fileList = buildFileList(outputFiles, data.clsiServerId)
result.logEntries.all = [
...result.logEntries.errors,
...result.logEntries.warnings,
...result.logEntries.typesetting,
]
return result
}

View file

@ -3,7 +3,7 @@ import { Trans, useTranslation } from 'react-i18next'
import PreviewLogEntryHeader from './preview-log-entry-header'
import Icon from '../../../shared/components/icon'
function PreviewLogsPaneMaxEntries({ totalEntries, entriesShown }) {
function PreviewLogsPaneMaxEntries({ totalEntries, entriesShown, hasErrors }) {
const { t } = useTranslation()
const title = t('log_entry_maximum_entries_title', {
@ -16,10 +16,17 @@ function PreviewLogsPaneMaxEntries({ totalEntries, entriesShown }) {
<PreviewLogEntryHeader level="raw" headerTitle={title} />
<div className="log-entry-content">
<Icon type="lightbulb-o" />{' '}
<Trans
i18nKey="log_entry_maximum_entries_message"
components={[<b key="bold-1" />]}
/>
{hasErrors ? (
<Trans
i18nKey="log_entry_maximum_entries_message"
components={[<b key="bold-1" />, <p />]} // eslint-disable-line react/jsx-key
/>
) : (
<Trans
i18nKey="log_entry_maximum_entries_message_no_errors"
components={[<b key="bold-1" />]}
/>
)}
</div>
</div>
)
@ -28,6 +35,7 @@ function PreviewLogsPaneMaxEntries({ totalEntries, entriesShown }) {
PreviewLogsPaneMaxEntries.propTypes = {
totalEntries: PropTypes.number,
entriesShown: PropTypes.number,
hasErrors: PropTypes.bool,
}
export default PreviewLogsPaneMaxEntries

View file

@ -28,8 +28,9 @@
"view_error_plural": "View all errors",
"log_entry_description": "Log entry with level: __level__",
"log_entry_maximum_entries": "Maximum log entries limit hit",
"log_entry_maximum_entries_title": "__total__ issues total. Showing the first __displayed__",
"log_entry_maximum_entries_message": "<0>Tip</0>: Try to fix the first error and recompile. Often one error causes many later error messages",
"log_entry_maximum_entries_title": "__total__ log messages total. Showing the first __displayed__",
"log_entry_maximum_entries_message": "<0>Tip</0>: 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.</1>",
"log_entry_maximum_entries_message_no_errors": "<0>Tip</0>: If you need to see the full logs, you can still download them or view the raw logs below.",
"navigate_log_source": "Navigate to log position in source code: __location__",
"other_output_files": "Download other output files",
"refresh": "Refresh",