Skip to content

Commit

Permalink
feat(configaudit): display description or message (#79)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
  • Loading branch information
danielpacak authored Mar 1, 2022
1 parent 0f082a9 commit 08d2113
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aquasecurity/starboard-lens-extension",
"publisher": "aquasecurity.github.io",
"version": "0.8.0",
"version": "0.9.0",
"description": "Lens extension for viewing Starboard security information",
"homepage": "https://github.com/aquasecurity/starboard-lens-extension",
"repository": {
Expand Down
9 changes: 8 additions & 1 deletion src/configauditreports/checks-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ const BySeverity = (v1: Check, v2: Check) => {

export class ChecksList extends React.Component<Props> {

getMessage = (check: Check) => {
if (check.message !== undefined && check.message !== "") {
return check.message
}
return check.description
}

getTableRow = (uid: string) => {
const {checks} = this.props;
const check = checks.find(item => item.checkID == uid);
Expand All @@ -49,7 +56,7 @@ export class ChecksList extends React.Component<Props> {
<Badge className={"Badge severity-" + check.severity} small label={check.severity}/>
</TableCell>
<TableCell className="message">
<Badge flat expandable={false} label={check.message} tooltip={check.message}/>
<Badge flat expandable={false} label={this.getMessage(check)} tooltip={this.getMessage(check)}/>
</TableCell>
<TableCell className="status">
<Badge className={"Badge status-" + status} small label={status}/>
Expand Down
4 changes: 3 additions & 1 deletion src/configauditreports/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export type Summary = {

export class Check {
checkID: string;
message: string;
title: string;
description: string;
message?: string;
success: boolean;
severity: string;
category: string;
Expand Down

0 comments on commit 08d2113

Please sign in to comment.