Skip to content

Commit

Permalink
Cleaned up code
Browse files Browse the repository at this point in the history
- Removed console.logs.
- Removed commented out code.
  • Loading branch information
hawkishpolicy committed Dec 12, 2024
1 parent 48a5907 commit 7e9723f
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions frontend/src/components/DrawerInterior.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,6 @@ export const DrawerInterior: React.FC<Props> = (props) => {
)
: [];

// const severityFacet: any[] = facets['vulnerabilities.severity']
// ? facets['vulnerabilities.severity'][0].data.sort(
// (a: { value: string }, b: { value: string }) =>
// severityLevels.indexOf(a.value) - severityLevels.indexOf(b.value)
// )
// : [];

console.log('facets', facets['vulnerabilities.severity']);
const titleCaseSeverityFacet = facets['vulnerabilities.severity']
? facets['vulnerabilities.severity'][0].data.map(
Expand All @@ -205,7 +198,6 @@ export const DrawerInterior: React.FC<Props> = (props) => {
}
)
: [];
console.log('titleCaseSeverityFacet', titleCaseSeverityFacet);

const groupedData: GroupedData = titleCaseSeverityFacet
.map((d: SeverityData) => {
Expand All @@ -232,17 +224,13 @@ export const DrawerInterior: React.FC<Props> = (props) => {
return acc;
}, {});

console.log('groupedData', groupedData);

const sortedSeverityFacets = Object.entries(groupedData)
.map(([value, count]) => ({ value, count }))
.sort((a, b) => {
const order = ['N/A', 'Low', 'Medium', 'High', 'Critical', 'Other'];
return order.indexOf(a.value) - order.indexOf(b.value);
});

console.log('sortedSeverityFacets', sortedSeverityFacets);

return (
<StyledWrapper style={{ overflowY: 'auto' }}>
<Toolbar sx={{ justifyContent: 'center' }}>
Expand Down

0 comments on commit 7e9723f

Please sign in to comment.