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

Fix TaxCategory default not showing up in admin #3759

Merged

Conversation

vl3
Copy link
Contributor

@vl3 vl3 commented Sep 14, 2020

Description
When visiting New products page, Spree::TaxCategory with is_default set to true is not being shown as the first selected option in the tax category select box. Additionally, the hint of the select box is saying that the default is None despite having other Spree::TaxCategory as default. This PR aims to fix it.

Without change
tax_category_failed

With change
tax_category_success

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

@kennyadsl
Copy link
Member

Thanks! It seems to make sense but I can't find in the codebase a single place where we are using the default tax category. I mean in the tax calculation... Can you help me understand if it's better to remove the concept of the default tax category entirely?

@jarednorman
Copy link
Member

I think it is useful to have a tax category that's the default for creating new products. Beyond that I don't think it has any meaning, but it's still useful for that.

@vl3 vl3 force-pushed the fix-tax-category-default-not-showing-up branch from 3764bce to 8100fc9 Compare September 22, 2020 15:37
@kennyadsl
Copy link
Member

Thanks, I think it's ready to be merged so I'm going to approve.

An extra thing that we could do in terms of UX is explaining what's the meaning of the default checkbox in the Tax Category edit page with another hint:

Screenshot 2020-09-24 at 11 31 40

Of course, we can also do that with another PR. Let me know if you want to take care of that or I'll open a new issue to keep track of this.

Thanks again! 🙏

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

👍 Thanks!

Copy link
Member

@aldesantis aldesantis left a comment

Choose a reason for hiding this comment

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

Thanks @vl3, just left a comment on an extra SQL query that I think we can get rid of.

backend/app/controllers/spree/admin/products_controller.rb Outdated Show resolved Hide resolved
@vl3 vl3 force-pushed the fix-tax-category-default-not-showing-up branch from 8100fc9 to fbc2d16 Compare September 24, 2020 19:10
@vl3
Copy link
Contributor Author

vl3 commented Sep 24, 2020

Thanks, I think it's ready to be merged so I'm going to approve.

An extra thing that we could do in terms of UX is explaining what's the meaning of the default checkbox in the Tax Category edit page with another hint:

Screenshot 2020-09-24 at 11 31 40

Of course, we can also do that with another PR. Let me know if you want to take care of that or I'll open a new issue to keep track of this.

Thanks again!

I can take care of that next week. Is it ok if I merge this and then open another PR?

@vl3 vl3 requested a review from aldesantis September 24, 2020 23:34
@aldesantis
Copy link
Member

@vl3 thanks, looking great! Also looking forward to your next PR. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants