Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Severity Level Validation Improvements #747

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

hawkishpolicy
Copy link
Collaborator

  • Refined and uniformed the grouping and sorting logic of irregular severity levels in the Vulns Bar Chart and All Vulns Table components.

🗣 Description

  • Null, undefined, empty strings, and stringified versions on Null, N/A, and undefined are now grouped into the N/A category in both the Vulns Bar Chart and All Vulns table.
  • Both components now force Title Case on the severity level strings first then sort and group into their respective categories.
  • Edited the comparator function in the All Vulns tables to sort the severity levels in the correct order from N/A, Low, Medium, High, Critical, Other.

💭 Motivation and context

  • Improves sorting and grouping of irregular severity levels.

🧪 Testing

  • Seeded local DB with irregular values.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

✅ Pre-merge checklist

  • Revert dependencies to default branches.
  • Finalize version.

✅ Post-merge checklist

  • Create a release.

- Ensured N/A severity level in Bar Chart includes all permutations of null, undefined, and empty strings.
- Ensured filtering by severity level in All Vulns table matches the filtering in the Bar Chart.
- Null, undefined, empty strings, and stringified versions on Null, N/A, and undefined are now grouped into the N/A category in both the Vulns Bar Chart and All Vulns table.
- Both components now force Title Case on the severity level strings first then sort and group into their respective categories.
- Edited the comporator function in the All Vulns tables to sort the severity levels in the correct order from N/A, Low, Medium, High, Critical, Other.
- Adjusted the number values of the severity levels object to start with 1 instead of 0.
- This removes the need for the long if statement previously used to handle N/A values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant