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

Add support for buttonAttributes and set default height to 48px #175

Merged
merged 6 commits into from
Aug 2, 2024

Conversation

alexflorisca
Copy link
Member

@alexflorisca alexflorisca commented Jul 10, 2024

All Submissions:

  • Does your code follow the WooCommerce Sniffs variant of WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Will this change require new documentation or changes to existing documentation?

Changes proposed in this Pull Request:

This PR adds a default button height of 48px to match the payment design guidelines and Woo defaults. If this height is not set explicitly on the container, the buttons default to 40px and look smaller than other buttons in the express checkout area. We also get the height from the new buttonAttributes API if available.

Steps to test the changes in this Pull Request:

  1. Activate the plugin and make sure the express payment button is rendering
  2. Add an item to your cart and view the checkout block.
  3. The button should have a height of 48px, and should align with other express payment methods when activated

Changelog entry

Fix - Inconsistency in the height of Express Payment Button and compliance with the new Woo Express Payment Method Styling API.

@alexflorisca alexflorisca self-assigned this Jul 10, 2024
@alexflorisca alexflorisca added type: enhancement The issue is a request for an enhancement. changelog: fix Took care of something that wasn't working. labels Jul 10, 2024
@@ -171,6 +179,7 @@ const ButtonComponent = () => {
)}
{!isGooglePayDisabled && (
<div
style={{ height: `${buttonHeight}px` }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious why the Google Pay button needs px added but the Apple Pay one doesn't?

Copy link
Member

Choose a reason for hiding this comment

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

Using a number instead of a string implies the px unit. As for which one to use, I guess it's a matter of preference, maybe the latter is preferable since it's very clear that we are using pixels 🤷🏼 .

Copy link
Member Author

Choose a reason for hiding this comment

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

That's actually an oversight on my part, good spot!

Copy link
Member Author

Choose a reason for hiding this comment

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

Should be fixed now, both should use px values

@qasumitbagthariya
Copy link
Contributor

qasumitbagthariya commented Jul 11, 2024

QA Update ✅


I have checked this issue in the add/button-attributes-support branch and working as expected.

I tested the following on this branch:

  • Cross check express payment button with different theme

image

image

Testing Environment

  • WordPress: 6.5.5
  • Theme: Storefront 4.6.0
  • Theme: Twenty Twenty-Four 1.1
  • WooCommerce - 9.0.2
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS Ventura 13.3

Steps to Test- As mentioned in the PR description.
Test Results - It is working as expected.
Functional Demo / Screencast -
Special Notes - Ready for code review (Woo)
Testing Document status:
Cases related to this Issue/PR are added to the Critical Flow Wiki pages:

  • Yes
  • Not Required/Applicable for this PR

Copy link
Member

@diegocurbelo diegocurbelo left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @alexflorisca, it tests great.

@@ -171,6 +179,7 @@ const ButtonComponent = () => {
)}
{!isGooglePayDisabled && (
<div
style={{ height: `${buttonHeight}px` }}
Copy link
Member

Choose a reason for hiding this comment

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

Using a number instead of a string implies the px unit. As for which one to use, I guess it's a matter of preference, maybe the latter is preferable since it's very clear that we are using pixels 🤷🏼 .

@alexflorisca
Copy link
Member Author

Thank you all for the reviews and QA. I've made a small change as pointed out to make sure we pass px values to both Google and Apple Pay buttons. When you're happy, could someone please merge this as I don't have the right permission to do so. Also what is your release process like?

@dkotter
Copy link
Contributor

dkotter commented Jul 16, 2024

When you're happy, could someone please merge this as I don't have the right permission to do so. Also what is your release process like?

This will go through a final round of regression testing with all other PRs that are ready to be released. Once that passes, we will get this merged in and a release prepped

@qasumitbagthariya
Copy link
Contributor

Regression / Smoke Test Report ✅

Tested with Archive File created via "php woorelease.phar build repo_URL" (Composer version 2.5.5, npm version 8.19.4, node version 16.20.0)

Status- Working expected with Plugin Archive/Zip file same as fix specific branch.

Testing Environment

  • WordPress: 6.6.1
  • Theme: Storefront 4.6.0
  • Theme: Twenty Twenty-Four 1.2
  • WooCommerce - 9.1.2
  • PHP: 8.0.30
  • Web Server: Nginx 1.20.2
  • Browser: Chrome
  • OS: macOS Ventura 13.3

Next Step- Ready to Merge 🚀

@vikrampm1 vikrampm1 modified the milestones: Future Release, 4.7.3 Aug 2, 2024
@vikrampm1 vikrampm1 merged commit b27d996 into trunk Aug 2, 2024
6 checks passed
@vikrampm1 vikrampm1 deleted the add/button-attributes-support branch August 2, 2024 14:47
@vikrampm1 vikrampm1 mentioned this pull request Aug 2, 2024
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: fix Took care of something that wasn't working. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants