-
-
Notifications
You must be signed in to change notification settings - Fork 708
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
Removing 'none' from shipping categories from product edit page #10519
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.
Nice! So simple. I think in this case it's okay to not have a spec because we don't need to test absent code. A spec for the present select options would have been nice though. Maybe when we replace select2 then we can also write better specs.
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 a lot! 🙏
Hi @vviekk, Before the PRI have verified that shipping category 'none' can be selected when editing a product I have also verified that 'none' cannot be selected when creating new products. After the PRPeek.2023-03-19.20-25.mp4I can confirm that
BUT: The design of the dropdown has changed. It's probably the new design we will want to use at some point, but I am not so sure if we want to have this one dropdown looking different than all the others. Requesting feedback from @openfoodfoundation/train-drivers-product-owners. ResultI am adding the feedback-needed label to see what people think about the design. Thanks again! |
FYI the work on BUU won't change anything to the product edit page apart from colors, we only focus on the product list for now. @jibees do you think the color change will harmonize the dropdowns? |
To me the best solution is to: harmonize it on this PR. It will be easier when changing the color, later on. |
@vviekk would you still be available to make the change? Ie keep the previous color style for this dropdown? |
@RachL will do. |
@jibees , |
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 design issue is pretty straightforward with my following suggestion.
@@ -45,7 +45,7 @@ | |||
|
|||
= f.field_container :shipping_categories do | |||
= f.label :shipping_category_id, t(:shipping_categories) | |||
= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :include_blank => t(:none) }, { :class => 'select2' }) | |||
= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :class => 'select2' }) |
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.
You removed the third parameters (previously was { :include_blank => t(:none) }
), so the 4th parameter is considered as the third.
Anyway, you probably should remplace { :include_blank => t(:none) }
by { }
, which is the following suggestion:
= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :class => 'select2' }) | |
= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, {} , { :class => 'select2' }) |
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.
Awesome. Thank you!
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.
Do you think there should be a spec for this?
Can there be, with reasonable amount of work?
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 don't think this small modification deserves a spec. I might be wrong, maybe let's @filipefurtad0 answer this.
By the way, I think this PR needs commits to be squashed to have a clean git history.
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.
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 agree, please rebase. You can use pick and fixup to combine your commits into one.
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!
Hi @vviekk, I can now confirm, that we have the previous dropdown design back, 'none' is not shown anymore and functionality is still given as tested in my previous notes. Great work! Merging! 🥂 🎆 |
Simply removing the 'none' option from shipping categories drop down from product edit page as it cannot be saved set to none.
What should we test?
none
as one of the options underShipping Categories
drop down.Release notes
Changelog Category: User facing changes | Technical changes