mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-08 16:52:33 +00:00
Use prefixed strings for tracked counts of compile errors (#16870)
GitOrigin-RevId: 4023822a73c204fe1365cdc0fe311b4289a8cbcf
This commit is contained in:
parent
fd717dff01
commit
a3ba2284d6
2 changed files with 10 additions and 10 deletions
|
@ -164,12 +164,14 @@ export function buildLogEntryAnnotations(entries, fileTreeData, rootDocId) {
|
|||
return logEntryAnnotations
|
||||
}
|
||||
|
||||
export const countRules = (entries = []) =>
|
||||
entries.reduce((counts, entry) => {
|
||||
const { ruleId } = entry
|
||||
counts[ruleId] = counts[ruleId] ? counts[ruleId] + 1 : 1
|
||||
return counts
|
||||
}, {})
|
||||
export const buildRuleCounts = (entries = []) => {
|
||||
const counts = {}
|
||||
for (const entry of entries) {
|
||||
const key = `${entry.level}_${entry.ruleId}`
|
||||
counts[key] = counts[key] ? counts[key] + 1 : 1
|
||||
}
|
||||
return counts
|
||||
}
|
||||
|
||||
function buildURL(file, pdfDownloadDomain) {
|
||||
if (file.build && pdfDownloadDomain) {
|
||||
|
|
|
@ -21,7 +21,7 @@ import {
|
|||
} from '../../infrastructure/event-tracking'
|
||||
import {
|
||||
buildLogEntryAnnotations,
|
||||
countRules,
|
||||
buildRuleCounts,
|
||||
handleLogFiles,
|
||||
handleOutputFiles,
|
||||
} from '../../features/pdf-preview/util/output-files'
|
||||
|
@ -414,9 +414,7 @@ export const LocalCompileProvider: FC = ({ children }) => {
|
|||
stopOnFirstError: data.options.stopOnFirstError,
|
||||
isAutoCompileOnLoad: !!data.options.isAutoCompileOnLoad,
|
||||
isAutoCompileOnChange: !!data.options.isAutoCompileOnChange,
|
||||
errors: countRules(result.logEntries.errors),
|
||||
warnings: countRules(result.logEntries.warnings),
|
||||
typesetting: countRules(result.logEntries.typesetting),
|
||||
...buildRuleCounts(result.logEntries.all),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue