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

Refactor duplication of hard coded soft delete filter logic #10058

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lucasbordeau
Copy link
Contributor

This PR adds a useCheckIsSoftDeleteFilter hook instead of the undocumented in-place logic to retrieve the soft delete filter.

Also took the opportunity to refactor a recent change of @prastoin with it.

Split VariantFilterChip into SoftDeleteFilterChip and RecordFilterChip to separate concerns about this soft delete filtering.

…t delete filter presence

- Created a SoftDeleteFilterChip component to extract logic from VariantFilterChip that had too much responsibility
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR refactors the soft delete filter logic by introducing better separation of concerns and centralized filter management.

  • Added new useCheckIsSoftDeleteFilter hook in /packages/twenty-front/src/modules/object-record/record-filter/hooks/useCheckIsSoftDeleteFilter.ts to centralize soft delete filter detection logic
  • Split VariantFilterChip into SoftDeleteFilterChip and RecordFilterChip components in /packages/twenty-front/src/modules/views/components/ for better separation of concerns
  • Removed variant property from RecordFilter type and moved styling to presentation layer in filter chip components
  • Changed isSoftDeleteFilterActiveComponentState context from table to filters for better organization
  • Fixed minor styling issues in ViewBarDetails component including duplicate CSS properties and misspelled component names

11 file(s) reviewed, 9 comment(s)
Edit PR Review Bot Settings | Greptile

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.

1 participant