Skip to content

Commit

Permalink
Merge pull request buildingSMART#72 from buildingSMART/IVS-23-V2-clea…
Browse files Browse the repository at this point in the history
…rer-message-for-citical-errors

IVS-23 Critical error message in schema column
  • Loading branch information
rw-bsi authored Jun 18, 2024
2 parents 0d831a8 + 0175230 commit b7ca857
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions frontend/src/SchemaResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,29 @@ export default function SchemaResult({ summary, content, status, instances }) {
<tr><th>Id</th><th>Entity</th><th>Severity</th><th>Message</th></tr>
</thead>
<tbody>
{
rows.map((row) => {
return <tr>
<td>{instances[row.instance_id] ? instances[row.instance_id].guid : '-'}</td>
<td>{instances[row.instance_id] ? instances[row.instance_id].type : '-'}</td>
<td>{severityToLabel[row.severity]}</td>
<td><span class='pre'>{
row.feature
? `${row.feature}\n${coerceToStr(row.msg)}`
: (row.constraint_type !== 'schema'
? coerceToStr(row.msg).split('\n').slice(2).join('\n')
: coerceToStr(row.msg))
}</span></td>
</tr>
})
}
{rows.map((row, rowIndex) => {
return (
<tr key={rowIndex}>
<td>{instances[row.instance_id] ? instances[row.instance_id].guid : '-'}</td>
<td>{instances[row.instance_id] ? instances[row.instance_id].type : '-'}</td>
<td>{severityToLabel[row.severity]}</td>
<td>
<span className='pre'>
{row.expected && row.observed
? `Expected: ${coerceToStr(row.expected)}, Observed: ${coerceToStr(row.observed)}`
: (
row.feature
? `${row.feature}\n${coerceToStr(row.msg)}`
: (row.constraint_type !== 'schema'
? coerceToStr(row.msg).split('\n').slice(2).join('\n')
: coerceToStr(row.msg))
)
}
</span>
</td>
</tr>
);
})}
</tbody>
</table>
</TreeItem>
Expand Down

0 comments on commit b7ca857

Please sign in to comment.