Skip to content

Commit

Permalink
display touchTs in grids for checklist, reviews, and other assets
Browse files Browse the repository at this point in the history
  • Loading branch information
csmig committed Feb 29, 2024
1 parent e233dc5 commit d073f93
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 10 deletions.
5 changes: 4 additions & 1 deletion api/source/service/AssetService.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,10 @@ exports.queryChecklist = async function (inProjection, inPredicates, elevate, us
`result.api as "result"`,
`CASE WHEN review.resultEngine = 0 THEN NULL ELSE review.resultEngine END as resultEngine`,
`review.autoResult`,
`status.api as "status"`
`status.api as "status"`,
`review.statusTs`,
`review.ts`,
`review.touchTs`
]
const joins = [
'current_rev rev',
Expand Down
6 changes: 6 additions & 0 deletions api/source/specification/stig-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4299,6 +4299,12 @@ components:
type: boolean
status:
$ref: '#/components/schemas/ChecklistStatus'
statusTs:
$ref: '#/components/schemas/StringDateTime'
ts:
$ref: '#/components/schemas/StringDateTime'
touchTs:
$ref: '#/components/schemas/StringDateTime'
ChecklistCkl:
type: object
description: The CKL format generated and read by DISA STIG VIewer
Expand Down
14 changes: 13 additions & 1 deletion client/src/css/stigman.css
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@
}
.sm-engine-result-icon {
background-image: url(../img/bot2.svg);
background-repeat: no-repeat
background-repeat: no-repeat;
width: 12px;
}
.sm-engine-override-icon {
background-image: url(../img/override2.svg);
Expand All @@ -258,6 +259,17 @@
height: 14px;
width: 14px
}
.x-menu-item-text .sm-engine-result-icon, .x-menu-item-text .sm-history-icon{
background-size: 12px 12px;
height: 12px
}

.x-grid3-cell.x-grid3-hd .sm-history-icon {
background-size: 12px 12px;
background-position: center;
height: 12px
}

.x-menu-check-item .x-menu-item-icon {
background-image: url(../img/checkboxes.svg);
background-position: 1px 0;
Expand Down
14 changes: 13 additions & 1 deletion client/src/js/collectionReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ async function addCollectionReview ( params ) {
type: 'string'
},
'resultEngine',
'touchTs',
{
name: 'engineResult',
convert: engineResultConverter
Expand Down Expand Up @@ -1044,7 +1045,18 @@ async function addCollectionReview ( params ) {
filter: {
type: 'values'
}
}
},
{
id: 'touchTs' + idAppend,
header: '<div exportvalue="touchTs" class="sm-history-icon" ext:qtip="Last action"></div>',
fixed: true,
width: 48,
align: 'center',
dataIndex: 'touchTs',
sortable: true,
renderer: renderDurationToNow
}

],
isCellEditable: function(col, row) {
var record = reviewsStore.getAt(row);
Expand Down
31 changes: 24 additions & 7 deletions client/src/js/review.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ async function addReview( params ) {
name: 'engineResult',
convert: engineResultConverter
},
{
name: 'reviewComplete',
type: 'boolean'
}
'touchTs'
]);


Expand Down Expand Up @@ -625,8 +622,17 @@ async function addReview( params ) {
type: 'values',
renderer: SM.ColumnFilters.Renderers.status
}
},
{
id: 'touchTs' + idAppend,
header: '<div exportvalue="touchTs" class="sm-history-icon" ext:qtip="Last action"></div>',
fixed: true,
width: 44,
align: 'center',
dataIndex: 'touchTs',
sortable: true,
renderer: renderDurationToNow
}

],
autoExpandColumn: 'ruleTitle' + idAppend,
loadMask: {msg: ''},
Expand Down Expand Up @@ -762,6 +768,7 @@ async function addReview( params ) {
type: 'string'
},
'resultEngine',
'touchTs',
{
name: 'engineResult',
convert: engineResultConverter
Expand Down Expand Up @@ -909,7 +916,7 @@ async function addReview( params ) {
},
{
header: "Status",
width: 50,
width: 44,
fixed: true,
align: 'center',
dataIndex: 'status',
Expand All @@ -922,6 +929,16 @@ async function addReview( params ) {
renderer: SM.ColumnFilters.Renderers.status
}
},
{
id: 'touchTs' + idAppend,
header: '<div exportvalue="touchTs" class="sm-history-icon" ext:qtip="Last action"></div>',
fixed: true,
width: 44,
align: 'center',
dataIndex: 'touchTs',
sortable: true,
renderer: renderDurationToNow
},
{
header: "User",
width: 50,
Expand Down Expand Up @@ -1385,8 +1402,8 @@ async function addReview( params ) {

// Update group grid
fp.groupGridRecord.data.result = reviewFromApi.result
fp.groupGridRecord.data.reviewComplete = reviewFromApi.reviewComplete
fp.groupGridRecord.data.status = reviewFromApi.status.label
fp.groupGridRecord.data.touchTs = reviewFromApi.touchTs
fp.groupGridRecord.data.resultEngine = reviewFromApi.resultEngine
fp.groupGridRecord.data.engineResult = engineResultConverter('', reviewFromApi)
fp.groupGridRecord.commit()
Expand Down

0 comments on commit d073f93

Please sign in to comment.