Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

feat: add filtering by callout response for contacts #574

Closed
wants to merge 32 commits into from

Conversation

wpf500
Copy link
Member

@wpf500 wpf500 commented Apr 11, 2024

This PR adds the frontend support for filtering contacts by their answers to callouts, the related backend changes are in beabee-communityrm/beabee#392.

image

AppSearch* components have been refactored to support dynamic filters. In this particular use case the filters are dependent on the callout the admin wants to filter by, when they choose a callout it loads the answer filters for that callout.

To support this filter groups can now define a custom component which handles rendering filter rules instead of the default component AppSearchRuleFilterGroup. See CalloutResponseFilterGroup for how this is implemented for callout response filtering.

This PR also includes the following changes:
*Added type="button" to AppToggle to stop it trying to submit forms

  • Simplified AppSearch by moving most of the logic into new AppSearchForm and AppSearchSummary components which handle the form and summary views respectively
  • FilterGroup.items used to be a string[] of filter item IDs, now it is the actual list of filter items. This simplifies the component logic as there's no need to pass both filterGroups and filterItems to the components. The method withItem gives developers a type-safe way to define filters for a given model.

The PR introduces a cleaner layout for filter groups, separating them out into "tabs" instead of optgroups

Before:
Screenshot from 2024-04-17 14-48-29

After:
image

@wpf500 wpf500 marked this pull request as ready for review April 17, 2024 14:03
@wpf500 wpf500 requested a review from JumpLink April 17, 2024 14:03
Copy link
Contributor

@JumpLink JumpLink left a comment

Choose a reason for hiding this comment

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

Looks good so far, only the import of the styles should be changed

src/assets/styles/multiselect.css Outdated Show resolved Hide resolved
@wpf500
Copy link
Member Author

wpf500 commented Jun 7, 2024

Closing in favour of beabee-communityrm/monorepo#5

@wpf500 wpf500 closed this Jun 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants