Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export function getFilteredCVEColumns(columns, workflowState) {
const shouldKeepCveType =
currentEntityType === entityTypes.CVE || currentEntityType === entityTypes.CLUSTER_CVE;

const shouldKeepSeverity =
currentEntityType === entityTypes.IMAGE_CVE || currentEntityType === entityTypes.NODE_CVE;

return columns.filter((col) => {
switch (col.accessor) {
// TODO: remove after generic CVE list is removed
Expand All @@ -55,7 +58,7 @@ export function getFilteredCVEColumns(columns, workflowState) {
return shouldKeepEntitiesColumn;
}
case 'severity': {
return shouldKeepDiscoveredAtImageColumn;
return shouldKeepSeverity || shouldKeepDiscoveredAtImageColumn;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you checking for shouldKeepDiscoveredAtImageColumn to determine the visibility of severity?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we use that to determine whether to show the severity column. If you git blame you can track it down to this PR https://github.com/stackrox/rox/pull/8080. It seems like he added it according to that PR. All I know is that we want to show the severity for the Image CVEs and Node CVEs tables so I'm adding that conditional logic to display it for those. I don't want to mess around too much with what's here right now since we will eventually make changes to VM soon. If you want to dig into why it was added, maybe you can ask Gorman for clarification.

}
default: {
return true;
Expand Down