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

Fix FilterTag values sorting #732 (CRASM-908) #733

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

lwersiy
Copy link
Collaborator

@lwersiy lwersiy commented Dec 5, 2024

🗣 Description

  • This PR resolves inconsistent and illogical sorting of values in the FilterTag component.
  • Current behavior:
    • No logical sorting of values, i.e. ascending or alphabetical
    • The re-addition of removed value merely places it an the end of the values array versus maintaining its logical place in the lineup.
      • I.e., The removal and re-addition of "2" in "1, 2, 3, 4" results in "1, 3, 4, 2"
  • New behavior:
    • Values are sorted in ascending/alphabetical order.
    • This sort remains regardless of additions/removals.

💭 Motivation and context

🧪 Testing

Tested Locally
Closes CRASM-908

📷 Screenshots (if appropriate)

Existing behavior of filtered port without sorting logic

Ports

Expected behavior of filtered port after sorting logic

Port-expected

Existing behavior of filtered Region before sorting logic is applied

Region-before sorting

Expected behavior of filtered regions

region expected

Existing behavior of filtered CVE before sorting logic is applied

cve-unexpected

Expected behavior of filtered CVE

cve expected

Existing behavior of filtered Severity before sorting logic is applied

severity-disorder

Expected behavior of filtered severity after sorting logic implemented

Expected severity

Organization not in Alphabetical order

Expected behavior of Organization after implementing the sorting logic

Uncomment this section if a screenshot is needed.

-->

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced
    in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

✅ Pre-merge checklist

  • Revert dependencies to default branches.
  • Finalize version.

✅ Post-merge checklist

  • Create a release.

@lwersiy lwersiy linked an issue Dec 5, 2024 that may be closed by this pull request
@lwersiy lwersiy changed the title Fix Filter by Region gets distortion after unselecting #732 Fix Filter by Region distortion after unselecting #732 Dec 5, 2024
hawkishpolicy and others added 5 commits December 5, 2024 10:59
- Added a function to sort Region filter values in ascending order.
- Edited filtersByColumn to include these sorted values.
- Added severity levels array and sort function to vulnerabilities.severity field.
    - Severity levels are now sorted Low, Medium, High, Critical.
- Added sort function to vulnerabilities.cve field.
    - CVEs are now sorted by numerical value.
- Cleaned up the sort functions for Port, Severity Levels, and CVEs.
@hawkishpolicy hawkishpolicy changed the title Fix Filter by Region distortion after unselecting #732 Fix FilterTag values sorting #732 Dec 5, 2024
- Added a map and sort function the org names accessor function.
- Added sortedValues as an arg to the ellipsis function.
- Added sort to IP's, Domain, and Root Domain values in Filter Tags.
@lwersiy lwersiy added the bug This issue or pull request addresses broken functionality label Dec 12, 2024
@hawkishpolicy hawkishpolicy marked this pull request as ready for review December 17, 2024 19:16
@hawkishpolicy hawkishpolicy changed the title Fix FilterTag values sorting #732 Fix FilterTag values sorting #732 (CRASM-908) Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request addresses broken functionality frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter by Region gets distorted after unselecting
2 participants