diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.js b/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.js index 2f20aa9e96..100dd0f1f2 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.js +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-log-entry.js @@ -67,7 +67,7 @@ function PdfLogEntry({ PdfLogEntry.propTypes = { ruleId: PropTypes.string, sourceLocation: PreviewLogEntryHeader.propTypes.sourceLocation, - headerTitle: PropTypes.string, + headerTitle: PreviewLogEntryHeader.propTypes.headerTitle, headerIcon: PropTypes.element, rawContent: PropTypes.string, logType: PropTypes.string, diff --git a/services/web/frontend/js/features/pdf-preview/components/pdf-logs-entries.js b/services/web/frontend/js/features/pdf-preview/components/pdf-logs-entries.js index 57ef298b30..86a3bccb8f 100644 --- a/services/web/frontend/js/features/pdf-preview/components/pdf-logs-entries.js +++ b/services/web/frontend/js/features/pdf-preview/components/pdf-logs-entries.js @@ -25,7 +25,7 @@ function PdfLogsEntries({ entries, hasErrors }) { string | [string, JSX.Element] +} + +const rules: Rule[] = [ { ruleId: 'hint_misplaced_alignment_tab_character', regexToMatch: /Misplaced alignment tab character \&/, @@ -50,15 +63,17 @@ const rules = [ regexToMatch: /Undefined control sequence/, contentRegex: /^(?:l\.[0-9]+|<(?:recently read|inserted text|to be read again)>)\s*(\\\S+)/, - improvedTitle: (currentTitle, details) => { + improvedTitle: (currentTitle: string, details?: [string]) => { if (details?.length && packageSuggestionsForCommands.has(details[0])) { const command = details[0] const suggestion = packageSuggestionsForCommands.get(command) - return ( + return [ + `Is ${suggestion.command} missing?`, + // eslint-disable-next-line react/jsx-key Is {suggestion.command} missing? - - ) + , + ] } return currentTitle }, @@ -67,18 +82,20 @@ const rules = [ ruleId: 'hint_undefined_environment', regexToMatch: /LaTeX Error: Environment .+ undefined/, contentRegex: /\\begin\{(\S+)\}/, - improvedTitle: (currentTitle, details) => { + improvedTitle: (currentTitle: string, details?: [string]) => { if ( details?.length && packageSuggestionsForEnvironments.has(details[0]) ) { const environment = details[0] const suggestion = packageSuggestionsForEnvironments.get(environment) - return ( + return [ + `Is ${suggestion.command} missing?`, + // eslint-disable-next-line react/jsx-key Is {suggestion.command} missing? - - ) + , + ] } return currentTitle },