[chore] add forms dsl input for filterable tree views - #23533
Conversation
a004986 to
ddae922
Compare
|
Ahoi @myabc , you asked or adding the filterable tree view as a forms dsl input. Can you check my code here? I'm not very used to those components, do I miss something obvious? For my use case this works quite fine. Is the simple approach of not applying any defaults correct? |
myabc
left a comment
There was a problem hiding this comment.
@Kharonus yes, this looks good! thanks for doing rolling this into an input.
A few small asks:
- a spec for the input. This recently-added spec should be a good template:
spec/lib/primer/open_project/forms/segmented_control_spec.rb. - add a
filterable_tree_viewexample tospec/lib/primer/open_project/forms/dsl/input_methods_spec.rbas well - admittedly this spec is a bit stupid but it exists to verify that attribute help text options are correctly handled.
|
This probably might need a bit more thought after all - I'll try to discuss with @HDinger tomorrow. In your particular case you don't need to render a label, which is fine. However most "inputs" support a label - and for symmetry we should support it here. This might mean:
Either way this brings up an interesting discussion of what the "input" actually consists of in this particular case! |
Yes, I suspected as much, when I saw that Please tell me, when you discussed a solution. |
| <%= @input.label %> | ||
| <% end %> | ||
| <% end %> | ||
| <div class="mb-2"> |
There was a problem hiding this comment.
@HDinger I chose to always render the bottom margin - as (GH Primer, non-advanced) check box group does.
7e2782c to
64dea7b
Compare
Fieldset-style inputs never go through the `FormControl` wrapper, so the legend needs the `FormControl-label` class applied by the component. The input does not support validation for the time being. Wrapper arguments stay on the fieldset, while the component-specific and form arguments flow to the inner tree view.
a9e200b to
33cdb92
Compare
Covers the hidden link attributes and the wiki page selection tree.
Enables the shared help-text examples for the new tree view input.
33cdb92 to
ae83523
Compare
|
@HDinger should we add documentation for this input to the Lookbook in this PR? Or take care of it as a follow-up? |
|
Warning Flaky specs
|
|
tested, looks good for me. |
What are you trying to accomplish?
filterable_tree_viewWhat approach did you choose and why?
nil