Skip to content

Commit

Permalink
Merge pull request #110 from buildingSMART/feature/IVS-204---display-…
Browse files Browse the repository at this point in the history
…number-of-outcomes

IVS-204 - display number of outcomes
  • Loading branch information
rw-bsi authored Nov 1, 2024
2 parents 4d35d69 + 6ef7501 commit 64e514e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion frontend/src/GherkinResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ export default function GherkinResult({ summary, content, status, instances }) {
setGrouped(grouped)
}, [page, content, checked]);

function getSuffix(rows) {
return (rows && rows.length > 0) ? '<i>(failed ' + rows.length.toLocaleString() + ' times)</i>' : ''
}

return (
<div>
<TableContainer sx={{ maxWidth: 850 }} component={Paper}>
Expand Down Expand Up @@ -233,7 +237,7 @@ export default function GherkinResult({ summary, content, status, instances }) {
>
<TreeItem
nodeId={feature}
label={<div class='caption'>{feature}</div>}
label={<div class='caption'>{feature} {getSuffix(rows)}</div>}
sx={{ "backgroundColor": severityToColor[severity] }}
>
<div>
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/SchemaResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export default function SchemaResult({ summary, content, status, instances }) {
setGrouped(grouped)
}, [page, content, checked]);

function getSuffix(rows) {
return (rows && rows.length > 0) ? '<i>(failed ' + rows.length.toLocaleString() + ' times)</i>' : ''
}

return (
<div>
<TableContainer sx={{ maxWidth: 850 }} component={Paper}>
Expand Down Expand Up @@ -111,7 +115,7 @@ export default function SchemaResult({ summary, content, status, instances }) {
defaultCollapseIcon={<ExpandMoreIcon />}
defaultExpandIcon={<ChevronRightIcon />}
>
<TreeItem nodeId={hd} label={<div><div class='caption'>{(rows[0].constraint_type || '').replace('_', ' ')}{rows[0].constraint_type && ' - '}{hd}</div><div class='subcaption'>{rows[0].constraint_type !== 'schema' ? (coerceToStr(rows[0].msg)).split('\n')[0] : ''}</div></div>}
<TreeItem nodeId={hd} label={<div><div class='caption'>{(rows[0].constraint_type || '').replace('_', ' ')}{rows[0].constraint_type && ' - '}{hd} {getSuffix(rows)}</div><div class='subcaption'>{rows[0].constraint_type !== 'schema' ? (coerceToStr(rows[0].msg)).split('\n')[0] : ''}</div></div>}
sx={{ "backgroundColor": severityToColor[rows[0].severity] }}
>

Expand Down

0 comments on commit 64e514e

Please sign in to comment.