-
Notifications
You must be signed in to change notification settings - Fork 293
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
implement filters in nested select #300 #301
implement filters in nested select #300 #301
Conversation
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.
Thanks for the PR, it seems alright but I think there are some things that need to be addressed before we can merge:
- This change includes a new feature so there should be documentation for it, also it should be tested.
- Does this break when there are no filters? Did you consider that case?
Let us know!
My PR simply does something already documented in select2_nested_select.md for a long time but never implemented. |
on_input_ctx("invoice_city_id") { expect_select2_selection("Colina") } | ||
end | ||
|
||
context "updating medium level" do |
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.
Start context description with 'when', 'with', or 'without'.
|
||
create_cities | ||
create_invoice(city: @colina) | ||
visit edit_admin_invoice_path(@invoice) |
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.
Replace instance variable with local variable or let.
end | ||
|
||
create_cities | ||
create_invoice(city: @colina) |
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.
Replace instance variable with local variable or let.
level_2: { | ||
attribute: :region_id, | ||
# filters: { name_contains: 'Met' } | ||
}, |
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.
Indent the right brace the same as the start of the line where the left brace is.
level_1: { attribute: :country_id }, | ||
level_2: { | ||
attribute: :region_id, | ||
# filters: { name_contains: 'Met' } |
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.
Incorrect indentation detected (column 28 instead of 30).
f.input :city_id, as: :nested_select, | ||
level_1: { attribute: :country_id }, | ||
level_2: { | ||
attribute: :region_id, |
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.
Avoid comma after the last item of a hash.
end | ||
end | ||
|
||
context "without filters", focus: true do |
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.
Focused spec found.
on_input_ctx("invoice_city_id") { expect_select2_selection("Colina") } | ||
end | ||
|
||
context "updating medium level" do |
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.
Start context description with 'when', 'with', or 'without'.
|
||
create_cities | ||
create_invoice(city: @colina) | ||
visit edit_admin_invoice_path(@invoice) |
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.
Replace instance variable with local variable or let.
end | ||
|
||
create_cities | ||
create_invoice(city: @colina) |
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.
Replace instance variable with local variable or let.
level_2: { | ||
attribute: :region_id, | ||
filters: { name_contains: 'Met' } | ||
}, |
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.
Indent the right brace the same as the start of the line where the left brace is.
I added the tests as required. |
thank you! I'll review it as soon as I can! |
No description provided.