Skip to content

Commit

Permalink
Refined if check for N/A severity level values
Browse files Browse the repository at this point in the history
- Now includes permutations of NUll, N/A, empty string, and undefined values.
  • Loading branch information
hawkishpolicy committed Dec 23, 2024
1 parent 86bb333 commit 73b1a8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/components/DrawerInterior.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,16 @@ export const DrawerInterior: React.FC<Props> = (props) => {
)
: [];

// To-Do: Create array(s) to handle permutations of null and N/A values
const titleCaseSeverityFacet = facets['vulnerabilities.severity']
? facets['vulnerabilities.severity'][0].data.map(
(d: { value: string; count: number }) => {
if (
d.value === 'null' ||
d.value === null ||
d.value === 'null' ||
d.value === 'NULL' ||
d.value === undefined ||
d.value === '' ||
d.value === 'undefined' ||
d.value === 'N/A'
) {
return { value: 'N/A', count: d.count };
Expand Down

0 comments on commit 73b1a8e

Please sign in to comment.