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 Address Editing JS #10602

Merged
merged 7 commits into from
Dec 11, 2020
Merged

Fix Address Editing JS #10602

merged 7 commits into from
Dec 11, 2020

Conversation

MatthewKennedy
Copy link
Contributor

@MatthewKennedy MatthewKennedy commented Dec 9, 2020

Fix an issue where the address ending was not quite the same depending on the editing scenario, at checkout as a guest, or editing a users saved address.

  • Use state_text to display the State abbreviation or name.
  • Clean up JavaScript
  • Add a couple of tests, and remove the ones looking for the css class changes.

@squash-labs
Copy link

squash-labs bot commented Dec 9, 2020

Manage this branch in Squash

Test this branch here: https://matthewkennedyfix-address-edit-q9o07.squash.io

@@ -9,7 +9,7 @@
<%= "#{address.address1} #{address.address2}" %>,
</div>
<div>
<%= "#{address.city}, #{address.state&.abbr} #{address.zipcode}" %>,
<%= "#{address.city}, #{address.state_text} #{address.zipcode}" %>,
Copy link
Member

Choose a reason for hiding this comment

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

👍

@MatthewKennedy
Copy link
Contributor Author

MatthewKennedy commented Dec 9, 2020

@damianlegawiec In this PR the tests failed because I stopped manipulating the CSS classes required & hidden with the javascript.

Hidden was replaced with jQuery.toggle .show .hide where needed, just to help reduce the complexity of the javascript.

And we now toggle the required attribute on the input directly.
To style a required input, it would make more sense to target the attribute required directly.

Copy link
Contributor

@AleksandraKaminska AleksandraKaminska 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 👍🏼

@damianlegawiec damianlegawiec merged commit 1ca3958 into spree:master Dec 11, 2020
@MatthewKennedy MatthewKennedy deleted the fix-address-editing branch January 13, 2021 21:24
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.

3 participants