[DREAM-703] FilterableTreeView does not keep default filter arguments - #474
Conversation
🦋 Changeset detectedLatest commit: cabb7af The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
There was a problem hiding this comment.
Pull request overview
This PR fixes Primer::OpenProject::FilterableTreeView so callers can pass partial filter_input_arguments overrides without having to manually merge in DEFAULT_FILTER_INPUT_ARGUMENTS, preserving expected default attributes (e.g., type=search, name=filter).
Changes:
- Change
FilterableTreeViewinitializer to apply defaults viareverse_mergeforfilter_input_arguments(and forno_results_node_argumentsas well). - Update the component test to assert defaults are still present when only overriding a subset of
filter_input_arguments. - Simplify the preview example by removing explicit filter defaults that are now applied automatically.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
app/components/primer/open_project/filterable_tree_view.rb |
Applies default arguments via reverse_merge so partial overrides keep expected defaults. |
test/components/primer/open_project/filterable_tree_view_test.rb |
Updates test to validate partial override behavior while defaults remain intact. |
previews/primer/open_project/filterable_tree_view_preview/custom_no_results_text.html.erb |
Removes redundant explicit defaults in the preview now that defaults are preserved in the component. |
.changeset/fancy-groups-kiss.md |
Adds a patch changeset documenting the user-facing behavior fix. |
myabc
left a comment
There was a problem hiding this comment.
Looks good! 👍🏻
nice to have: a simple (probably one-line) test for partial no_results_node_arguments merge.
What are you trying to accomplish?
Preserve defaults for
filter_input_argumentsList the issues that this change affects.
https://community.openproject.org/wp/DREAM-703
Risk Assessment