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(app-aco): support reference field in advanced search filter #3783

Merged
merged 34 commits into from
Mar 18, 2024

Conversation

leopuleo
Copy link
Contributor

@leopuleo leopuleo commented Dec 27, 2023

Changes

With this PR, we add support to reference fields inside the Advanced Search Filter.

The user can pick the referenced entry via the Autocomplete input field and search through the models set during the entry configuration.

For the value picked, we save both the entryId and the modelId: both are needed to create the filter query and get the saved entry while loading the reference field.

Refactor: field renderer definition via react properties

To support app-specific field renderers, such as the reference field, we introduce the new <AdvancedSearch.FieldRenderer> config, allowing us to define field renderers outside of app-aco.

<AcoConfig>
  <AdvancedSearch.FieldRenderer name={"text"} type={FieldType.TEXT} element={<Input />} />
</AcoConfig>
  • name: arbitrary name used to target the config
  • type: FieldTypes used by the element
  • element: the element that will be rendered

Together with the config, the developer will have at his disposal:

  • useInputField to access the current input field data (no external props passed to the renderer element)
  • FieldType enum

How Has This Been Tested?

Manually + Jest

@leopuleo leopuleo changed the title feat(app-aco): support reference field in advanced search filter wip: feat(app-aco): support reference field in advanced search filter Dec 27, 2023
@leopuleo leopuleo self-assigned this Feb 23, 2024
@leopuleo leopuleo added this to the 5.40.0 milestone Feb 23, 2024
@leopuleo leopuleo marked this pull request as ready for review February 27, 2024 08:50
@leopuleo leopuleo changed the title wip: feat(app-aco): support reference field in advanced search filter feat(app-aco): support reference field in advanced search filter Feb 27, 2024
Copy link
Collaborator

@Pavel910 Pavel910 left a comment

Choose a reason for hiding this comment

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

Thank you! 👍

@leopuleo leopuleo merged commit 0e0841f into next Mar 18, 2024
82 checks passed
@leopuleo leopuleo deleted the leo/feat/advanced-filters-manager-ref-field branch April 5, 2024 07:06
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.

2 participants