Skip to content
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

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

vviekk
Copy link
Contributor

@vviekk vviekk commented Mar 6, 2023

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?

  • Go to products under admin section
  • Go to edit page of any product and see that there is no none as one of the options under Shipping Categories drop down.

Release notes

Changelog Category: User facing changes | Technical changes

@vviekk vviekk changed the title Removing none from shipping categories from product edit page Removing 'none' from shipping categories from product edit page Mar 6, 2023
@vviekk vviekk marked this pull request as ready for review March 6, 2023 16:50
Copy link
Member

@mkllnk mkllnk left a 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.

Copy link
Contributor

@jibees jibees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! 🙏

@drummer83 drummer83 self-assigned this Mar 19, 2023
@drummer83 drummer83 added the pr-staged-au staging.openfoodnetwork.org.au label Mar 19, 2023
@drummer83
Copy link
Contributor

drummer83 commented Mar 19, 2023

Hi @vviekk,
Thanks for yet another PR! 💪

Before the PR

I have verified that shipping category 'none' can be selected when editing a product

  • as super admin
  • as enterprise user
    image

I have also verified that 'none' cannot be selected when creating new products.

After the PR

Peek.2023-03-19.20-25.mp4

I can confirm that

  • shipping category 'none' is not available anymore for
    • super admin user,
    • enterprise user,
  • the dropdown work well (selecting and saving),
  • nothing has changed when creating new products.

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.

Result

I am adding the feedback-needed label to see what people think about the design.

Thanks again!

@drummer83 drummer83 added feedback-needed and removed pr-staged-au staging.openfoodnetwork.org.au labels Mar 19, 2023
@RachL
Copy link
Contributor

RachL commented Mar 20, 2023

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?

@jibees
Copy link
Contributor

jibees commented Mar 21, 2023

@RachL

To me the best solution is to: harmonize it on this PR. It will be easier when changing the color, later on.

@RachL
Copy link
Contributor

RachL commented Mar 21, 2023

@vviekk would you still be available to make the change? Ie keep the previous color style for this dropdown?

@vviekk
Copy link
Contributor Author

vviekk commented Mar 21, 2023

@RachL will do.

@vviekk
Copy link
Contributor Author

vviekk commented Mar 22, 2023

@jibees ,
Quick clarification: We want to have a common colour config for all the drop downs on this particular page for uniformity, correct?

Copy link
Contributor

@jibees jibees left a 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' })
Copy link
Contributor

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:

Suggested change
= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :class => 'select2' })
= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, {} , { :class => 'select2' })

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Thank you!

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Agree @jibees @vviekk 👍

Copy link
Member

@mkllnk mkllnk left a 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.

Copy link
Contributor

@jibees jibees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@drummer83 drummer83 added the pr-staged-au staging.openfoodnetwork.org.au label Mar 27, 2023
@drummer83
Copy link
Contributor

Hi @vviekk,
Thanks for following up and pushing this over the line! 💪

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.

image

Great work! Merging! 🥂 🎆

@drummer83 drummer83 merged commit c887efe into openfoodfoundation:master Mar 27, 2023
@drummer83 drummer83 removed the pr-staged-au staging.openfoodnetwork.org.au label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants