mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 21:31:36 +02:00
Use prefixed strings for tracked counts of compile errors (#16870)
GitOrigin-RevId: 4023822a73c204fe1365cdc0fe311b4289a8cbcf
This commit is contained in:
@@ -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),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user