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

Clearer error message and clean up for Product Categories #12779

Conversation

EdwardLi-coder
Copy link
Contributor

@EdwardLi-coder EdwardLi-coder commented Aug 15, 2024

What? Why?

I found that the code had no place to use spree_classification_primary_taxon_error and invalid_taxonomy_id, so I deleted them

What should we test?

As described in the issue:

  • Admin setting page should work properly with new taxons options
  • All crud actions should be available in admin settings for taxons

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

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.

Thank you for tackling this. Could you reduce your change to only en.yml? The other files will get updated automatically in our release process. It will be easier to see your actual changes then as well.

@@ -2653,7 +2653,6 @@ ar:
spree_admin_single_enterprise_hint: "لمحة: للسماح للأشخاص بالعثور عليك ، قم بتشغيل الرؤية الخاصة بك أسفل"
spree_admin_eg_pickup_from_school: "على سبيل المثال. "البيك اب من المدرسة الابتدائية""
spree_admin_eg_collect_your_order: "على سبيل المثال. "يرجى جمع طلبك من 123 Imaginary St، Northcote ، 3070""
spree_classification_primary_taxon_error: "Taxon %{taxon} هو التصنيف الأساسي %{product} ولا يمكن حذفه"
Copy link
Member

Choose a reason for hiding this comment

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

We never change other locales than en.yml because they are updated automatically through our Transifex integration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We never change other locales than en.yml because they are updated automatically through our Transifex integration.

OK.I will update it.

@mkllnk mkllnk added the user facing changes Thes pull requests affect the user experience label Aug 15, 2024
@EdwardLi-coder EdwardLi-coder force-pushed the clearer_error_message_and_clean_up branch from 4211605 to 503148b Compare August 16, 2024 01:05
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.

Great, thank you!

Note that we usually don't merge master but rebase on master if needed. You don't have to do that for this pull request though.

Copy link
Collaborator

@chahmedejaz chahmedejaz left a comment

Choose a reason for hiding this comment

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

Looks good, thanks. However as per the issue, can you please also confirm if spree.new_taxon translation is being used?

@EdwardLi-coder
Copy link
Contributor Author

Great, thank you!

Note that we usually don't merge master but rebase on master if needed. You don't have to do that for this pull request though.

Ok,I see.Thank you tell me.

@EdwardLi-coder
Copy link
Contributor Author

Looks good, thanks. However as per the issue, can you please also confirm if spree.new_taxon translation is being used?

Maybe this use it.I'm not sure.
%li = button_link_to t(".new_taxon"), spree.new_admin_taxon_url, icon: 'icon-plus', id: 'admin_new_taxon_link'

@chahmedejaz
Copy link
Collaborator

chahmedejaz commented Aug 16, 2024

%li = button_link_to t(".new_taxon"), spree.new_admin_taxon_url, icon: 'icon-plus', id: 'admin_new_taxon_link'

I think the following translation is being used here because it's using Rail's lazy translation lookup and it should get translated to this key based upon the file path in which it's used, spree.admin.taxons.index.new_taxon:

new_taxon: 'New product category'

I think we should validate this and remove spree.new_taxon as well if it's unused. Would be good to please do that? Thanks.

@EdwardLi-coder
Copy link
Contributor Author

%li = button_link_to t(".new_taxon"), spree.new_admin_taxon_url, icon: 'icon-plus', id: 'admin_new_taxon_link'

I think the following translation is being used here because it's using Rail's lazy translation lookup and it should get translated to this key based upon the file path in which it's used, spree.admin.taxons.index.new_taxon:

new_taxon: 'New product category'

I think we should validate this and remove spree.new_taxon as well if it's unused. Would be good to please do that? Thanks.

I have already deleted spree.new_taxon.Thanks

@chahmedejaz
Copy link
Collaborator

%li = button_link_to t(".new_taxon"), spree.new_admin_taxon_url, icon: 'icon-plus', id: 'admin_new_taxon_link'

I think the following translation is being used here because it's using Rail's lazy translation lookup and it should get translated to this key based upon the file path in which it's used, spree.admin.taxons.index.new_taxon:

new_taxon: 'New product category'

I think we should validate this and remove spree.new_taxon as well if it's unused. Would be good to please do that? Thanks.

I have already deleted spree.new_taxon.Thanks

Really sorry, but I believe you have pushed that change in another branch which might not be relevant to that change.
https://github.com/EdwardLi-coder/openfoodnetwork/tree/change_colour_of_complete_order

Can you please validate and push that change in this branch so that the relevant issue's changes are within their respective branches?

@EdwardLi-coder
Copy link
Contributor Author

%li = button_link_to t(".new_taxon"), spree.new_admin_taxon_url, icon: 'icon-plus', id: 'admin_new_taxon_link'

I think the following translation is being used here because it's using Rail's lazy translation lookup and it should get translated to this key based upon the file path in which it's used, spree.admin.taxons.index.new_taxon:

new_taxon: 'New product category'

I think we should validate this and remove spree.new_taxon as well if it's unused. Would be good to please do that? Thanks.

I have already deleted spree.new_taxon.Thanks

Really sorry, but I believe you have pushed that change in another branch which might not be relevant to that change. https://github.com/EdwardLi-coder/openfoodnetwork/tree/change_colour_of_complete_order

Can you please validate and push that change in this branch so that the relevant issue's changes are within their respective branches?

Thank you for bringing this to my attention. I apologize for the confusion earlier. I have now verified and corrected the issue.

@chahmedejaz
Copy link
Collaborator

No worries @EdwardLi-coder, all good now. Thanks♥️

@EdwardLi-coder EdwardLi-coder force-pushed the clearer_error_message_and_clean_up branch from 60e637e to 05315ff Compare August 20, 2024 00:12
@drummer83 drummer83 changed the title clearer error message and clean up Clearer error message and clean up for Product Categories Aug 22, 2024
@drummer83 drummer83 self-assigned this Aug 22, 2024
@drummer83 drummer83 added the pr-staged-fr staging.coopcircuits.fr label Aug 22, 2024
@drummer83
Copy link
Contributor

Hi @EdwardLi-coder,
Thank you for finishing this up! 💪

I have tested the product categories and couldn't find any problems.

Also the new error message is shown:
image

Excellent! Merging! 🎉
Thanks again!

@drummer83 drummer83 merged commit 2710eaf into openfoodfoundation:master Aug 22, 2024
52 checks passed
@drummer83 drummer83 removed the pr-staged-fr staging.coopcircuits.fr label Aug 22, 2024
@EdwardLi-coder
Copy link
Contributor Author

Hi @EdwardLi-coder,

Thank you for finishing this up! 💪

I have tested the product categories and couldn't find any problems.

Also the new error message is shown:

image

Excellent! Merging! 🎉

Thanks again!

Ok.I'm glad my code can merge.Thanks

@EdwardLi-coder EdwardLi-coder deleted the clearer_error_message_and_clean_up branch August 22, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user facing changes Thes pull requests affect the user experience
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Product Categories] Clearer error message and clean up
5 participants