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

[ENG-1896] Improved search filters and added date range #2717

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

jamiepine
Copy link
Member

@jamiepine jamiepine commented Sep 22, 2024

This PR refactors the Filters.tsx module, breaking it down into a more modular and maintainable structure while also adding support for date range filters.

Changes:

  1. Date Range Support:

    • Introduced DateRange filter options for both objects and file_paths
  2. Filter Factories Modularization:

    • Broke down the logic from Filters.tsx into dedicated filter factory functions:
      • createInOrNotInFilter
      • createRangeFilter
      • createBooleanFilter
      • createTextMatchFilter
    • Centralized shared logic (e.g., argsToOptions, getCondition) within these factory functions to reduce redundancy and improve reusability across filters.
  3. Simplified filterRegistry:

    • The filterRegistry is now cleaner, using the modularized filter factories to define filters concisely.

Benefits:

  • The refactor makes it easier to add new filters, including complex ones like date ranges, without duplicating code.
  • Modularization improves maintainability and readability by splitting the logic into more manageable components.
  • The addition of type guards ensures robustness and reduces the risk of accessing invalid fields within filters.

Copy link

linear bot commented Sep 22, 2024

Copy link

vercel bot commented Sep 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
spacedrive-landing ❌ Failed (Inspect) Dec 9, 2024 11:50pm
spacedrive-web ❌ Failed (Inspect) Dec 9, 2024 11:50pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants