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

feat: implement new functionality with inserted_at__gte in findings a… #6864

Merged

Conversation

paabloLC
Copy link
Member

@paabloLC paabloLC commented Feb 7, 2025

Description

Fix: Avoid default date filter when inserted_at or scan__in is present in the URL

🛠 Changes

  • Updated logic to skip the default filter[inserted_at__gte] if searchParams contain:
    • Any key related to inserted_at (e.g., filter[inserted_at__gte], filter[inserted_at__lte], filter[inserted_at__date]).
    • filter[scan__in].
  • Used Object.entries(searchParams).some(...) to ensure correct detection of date-related filters.
  • Ensured no unnecessary default filters are applied when relevant search parameters exist.

✅ Expected Behavior

URL Applies Default filter[inserted_at__gte]?
/findings Yes (no inserted_at or scan__in)
/findings?filter[scan__in]=123 No (contains scan__in)
/findings?filter[inserted_at]=2025-02-06 No (contains inserted_at)
/findings?filter[inserted_at__gte]=2025-02-05&filter[scan__in]=123 No (both filters present)

Checklist

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@paabloLC paabloLC self-assigned this Feb 7, 2025
@paabloLC paabloLC requested a review from a team as a code owner February 7, 2025 11:53
@paabloLC paabloLC force-pushed the PRWLR-6176-Require-date-filter-for-findings-views-UI-side branch from bb7b405 to 04f5953 Compare February 7, 2025 13:12
@paabloLC paabloLC merged commit 62cbff4 into master Feb 7, 2025
10 checks passed
@paabloLC paabloLC deleted the PRWLR-6176-Require-date-filter-for-findings-views-UI-side branch February 7, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant