From c1cb70154de5e40750e8f0aecbea22e25fc07ea8 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Mon, 6 Nov 2023 14:12:28 +1100 Subject: [PATCH] feat: trial warnings --- src/components/LogViewer/LogAccordion/index.js | 2 +- src/components/LogViewer/index.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/LogViewer/LogAccordion/index.js b/src/components/LogViewer/LogAccordion/index.js index 218797c4..d51c0571 100644 --- a/src/components/LogViewer/LogAccordion/index.js +++ b/src/components/LogViewer/LogAccordion/index.js @@ -37,7 +37,7 @@ const LogAccordion = forwardRef( }} >
- {header} {metadata.length > 0 ? '(' + metadata + ')' : ''} + {header} {metadata[0].length > 0 ? '(' + metadata[0] + ')' : ''} {metadata[1] == true ? '(WARNING)' : ''}
diff --git a/src/components/LogViewer/index.js b/src/components/LogViewer/index.js index f834fbb7..72e70eb7 100644 --- a/src/components/LogViewer/index.js +++ b/src/components/LogViewer/index.js @@ -127,7 +127,7 @@ const logPreprocessorProcessParse = (tokens, sectionMetadata) => { case 'section-opener': let metadataForSection = sectionMetadata.get(tokens[i].details.trim()); if (metadataForSection == undefined) { - metadataForSection = ''; + metadataForSection.push(''); } let node = { @@ -170,8 +170,14 @@ const logPreprocessorExtractSectionEndDetails = logs => { if (stepName != '' && stepDetails != '') { let durationArray = stepDetails.match(durationRegexp); + let hasWarnings = false + if (stepName.match(/.* Warning$/)) { + hasWarnings = true + } + let payload = new Map(); + payload.set(`Duration: ${durationArray[1]}`, hasWarnings) if (durationArray.length == 2) { - ret.set(stepName, `Duration: ${durationArray[1]}`); + ret.set(stepName, payload); } } }