-
Notifications
You must be signed in to change notification settings - Fork 1
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: add extra_params option #36
Conversation
@@ -24,14 +24,16 @@ class MainComponent < ViewComponent::Base | |||
# @param [String, nil] search_filter_name Optional, enable's and set's the search filter, specified by the filter's parameter name | |||
# @param [Boolean] show_sidebar If true, will show the sidebar with the filters. | |||
# @param [Boolean] update_url_on_submit If true, will update the URL in the user's browser on form submission. | |||
def initialize(frame_id:, filtered:, filters:, url: nil, search_filter_name: nil, show_sidebar: true, update_url_on_submit: true) | |||
# @param [Hash] extra_params Optional, allows for custom form values to be supplied. Useful if you need to retain non-filterable query params |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure on a great name for this variable, let me know if you have any suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the name is fine, I guess we could maybe do hidden_params
to convey that it will generate hidden inputs.
@@ -24,14 +24,16 @@ class MainComponent < ViewComponent::Base | |||
# @param [String, nil] search_filter_name Optional, enable's and set's the search filter, specified by the filter's parameter name | |||
# @param [Boolean] show_sidebar If true, will show the sidebar with the filters. | |||
# @param [Boolean] update_url_on_submit If true, will update the URL in the user's browser on form submission. | |||
def initialize(frame_id:, filtered:, filters:, url: nil, search_filter_name: nil, show_sidebar: true, update_url_on_submit: true) | |||
# @param [Hash] extra_params Optional, allows for custom form values to be supplied. Useful if you need to retain non-filterable query params |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the name is fine, I guess we could maybe do hidden_params
to convey that it will generate hidden inputs.
Solution
add a new named parameter to SnFilterable::MainComponent.
extra_params: { tab: "my_organizations" }
will add a hidden form input with name tab and value my_organizations