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

When editing prices keep the currency locked. #3150

Merged
merged 2 commits into from
Mar 27, 2019

Conversation

peterberkenbosch
Copy link
Contributor

@peterberkenbosch peterberkenbosch commented Mar 20, 2019

Description

When editing a price that has a different currency then the default currency set, the edit form defaults the currency to the default currency.

This PR fixes that by passing in the price currency to the currency form partial. It also improves the feature spec for editing prices by actually verifying that the edit worked.

before: https://cl.ly/420fb991710b
after: https://cl.ly/2b141684337f

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)

@peterberkenbosch peterberkenbosch force-pushed the edit-price-keep-currency branch 2 times, most recently from 6a2a94e to cbfad0d Compare March 20, 2019 09:09
Copy link
Contributor

@aitbw aitbw 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, @peterberkenbosch! 🎉

@peterberkenbosch
Copy link
Contributor Author

seems there are some unrelated failing specs on the rails51, I do see them in master now and then too actually. @kennyadsl could you restart the circleci workflow?

@kennyadsl
Copy link
Member

@peterberkenbosch done!

@kennyadsl
Copy link
Member

@peterberkenbosch Thanks, I think this works, I just have a doubt about if the currency choice should be disabled in the form. Can't/Shouldn't the price currency be edited by an admin user?

@peterberkenbosch
Copy link
Contributor Author

I kept the existing expected(?) functionality in tact in this PR. Noticed the same though. Wanted to keep the PR to the bugfix, but I can update it to have the currency change as well. WDYT @kennyadsl

@kennyadsl
Copy link
Member

I'm fine with the fix, just wondering. Maybe some git blame could help us remember why currency is not changeable.

@peterberkenbosch
Copy link
Contributor Author

The currency component was introduced like that. It's used on multiple places actually.

@kennyadsl
Copy link
Member

@peterberkenbosch can you please rebase now, I hope flaky specs are fixed with #3141 .

@peterberkenbosch
Copy link
Contributor Author

@kennyadsl indeed! Specs are passing! Thanks

Copy link
Contributor

@jacobherrington jacobherrington 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 this is a good fix for now. Thanks @peterberkenbosch!

I'd like to see the admin have the ability to change price currencies in the near future.

@peterberkenbosch
Copy link
Contributor Author

Thanks @jacobherrington, will make another PR for that ;)

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 @peterberkenbosch !!!

@kennyadsl kennyadsl merged commit 0d4a42e into solidusio:master Mar 27, 2019
@kennyadsl kennyadsl added type:bug Error, flaw or fault changelog:solidus_backend Changes to the solidus_backend gem labels Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem type:bug Error, flaw or fault
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants