Skip to content

Commit

Permalink
fix: UI now handles missing vulnDiscussion (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
csmig authored Jul 22, 2021
1 parent dac7ee8 commit 5900469
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
9 changes: 1 addition & 8 deletions api/source/service/mysql/STIGService.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,7 @@ exports.queryBenchmarkRules = async function ( benchmarkId, revisionStr, inProje
sql += ` order by substring(r.ruleId from 4) + 0`

try {
let formatted = dbUtils.pool.format(sql, predicates.binds)
let [rows, fields] = await dbUtils.pool.query(sql, predicates.binds)
for (let x = 0, l = rows.length; x < l; x++) {
let record = rows[x]
// remove keys with null value
Object.keys(record).forEach(key => record[key] == null && delete record[key])
}

let [rows] = await dbUtils.pool.query(sql, predicates.binds)
return (rows)
}
catch (err) {
Expand Down
14 changes: 8 additions & 6 deletions clients/extjs/js/review.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,24 +795,26 @@ async function addReview( params ) {
'<div class=cs-home-body-title>Manual Check',
'<div class=cs-home-body-text>',
'<tpl for="checks">',
'<pre>{[values.content.trim()]}</pre>',
'<pre>{[values.content?.trim()]}</pre>',
'</tpl>',
'</div>',
'</div>',
'<div class=cs-home-body-title>Fix',
'<div class=cs-home-body-text>',
'<tpl for="fixes">',
'<pre>{[values.text.trim()]}</pre>',
'<pre>{[values.text?.trim()]}</pre>',
'</tpl>',
'</div>',
'</div>',
'<div class=cs-home-header-sub></div>',
'<div class=cs-home-body-title>Other Data',
'<div class=cs-home-body-text><b>Vulnerability Discussion</b><br><br>',
'<pre>{[values.vulnDiscussion.trim()]}</pre>',
'</div>',
'<tpl if="values.vulnDiscussion">',
'<div class=cs-home-body-text><b>Vulnerability Discussion</b><br><br>',
'<pre>{[values.vulnDiscussion?.trim()]}</pre>',
'</div>',
'</tpl>',
'<div class=cs-home-body-text><b>Documentable: </b>{documentable}</div>',
`<tpl if="typeof(responsibility) != 'undefined'">`,
`<tpl if="values.responsibility">`,
'<div class=cs-home-body-text><b>Responsibility: </b>{responsibility}</div>',
'</tpl>',
'<tpl if="values.ccis.length === 0">',
Expand Down

0 comments on commit 5900469

Please sign in to comment.