Skip to content

Conversation

@xristos3490
Copy link
Member

Submission Review Guidelines:

Changes proposed in this Pull Request:

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

Before starting ensure that you are using a block theme like TT2, or TT3.

Testing in order-again context:

  1. Create a new order and get to the Order Received page (don't close it)
  2. Process the order from wp-admin and refresh the previous page to see the "Order again" button.
  3. Notice that it's missing some styles. See https://d.pr/i/oVXIas
  4. Apply this fix, and ensure the button appears correctly.

Testing in the pagination buttons on the account page:

  1. Navigate to My Account > Orders page and ensure that you have enough so the pagination shows up (hint: one could use the woocommerce_my_account_my_orders_query filter to wire a small number (e.g., 2) in the limit key for the query)
  2. Notice the buttons are missing styles. See https://d.pr/i/lYs1jg
  3. Apply this fix, and ensure the buttons appear correctly.

Testing in the no-downloads cta button on the account page:

  1. Navigate to My Account > Downloads page and ensure your user hasn't downloaded yet.
  2. Check the CTA button inside the notice saying "No downloads available yet"; it shouldn't look right.
  3. Apply this patch and ensure the CTA shows up correctly.

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Apr 21, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 21, 2023

Test Results Summary

Commit SHA: f1b1df9

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests26700202691m 0s
E2E Tests1890010019921m 11s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Merging #37933 (f0ab1de) into trunk (6ed8fb4) will increase coverage by 0.0%.
The diff coverage is 0.0%.

❗ Current head f0ab1de differs from pull request most recent head f1b1df9. Consider uploading reports for the commit f1b1df9 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             trunk   #37933   +/-   ##
========================================
  Coverage     51.2%    51.2%           
+ Complexity   17439    17417   -22     
========================================
  Files          440      440           
  Lines        80722    80636   -86     
========================================
- Hits         41346    41312   -34     
+ Misses       39376    39324   -52     
Impacted Files Coverage Δ
...ins/woocommerce/includes/wc-template-functions.php 12.2% <0.0%> (-<0.1%) ⬇️

... and 10 files with indirect coverage changes

@xristos3490 xristos3490 requested review from a team and coreymckrill and removed request for a team May 4, 2023 07:13
@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2023

Hi @coreymckrill,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2023

Hi @coreymckrill,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@xristos3490
Copy link
Member Author

Hey @coreymckrill! fyi I left the template bumps so we can decide on which version these will land. I can then push another commit containing the proper version number.

Copy link
Contributor

@coreymckrill coreymckrill left a comment

Choose a reason for hiding this comment

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

@xristos3490 👍 looks good, other than the needed fix on the order again template 😅

This PR also needs a rebase since it was originally submitted before the monorepo upgraded pnpm to v8.

'order/order-again.php',
array(
'order' => $order,
'wp_button_class' => wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'wp_button_class' => wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '',
'wp_button_class' => wc_wp_theme_get_element_class_name( 'button' ),

Optional, non-blocking suggestion, but I would argue for having this template parameter only contain the classname, and worry about the whitespace in the template itself. And also, probably not worry about extra whitespace at the end of the class attribute in the case that wp_button_class is empty.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was inspired by other instances of the same fix throughout the codebase (like here)

To be honest, I also believe that the templates should be responsible for managing the classes. Ideally, I'd expect to echo them using arrays and the implode function. We could move forward with this as is, progress with other changes in regards to the block-ification of the templates, and then return to create a more organized solution.

I'd be happy to change it, though. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, I'd expect to echo them using arrays and the implode function. We could move forward with this as is, progress with other changes in regards to the block-ification of the templates, and then return to create a more organized solution.

👍 Yeah, doing this separately sounds like the right approach. No need to make this PR more complicated.

@xristos3490
Copy link
Member Author

Thanks for the review, @coreymckrill! I've updated the base of this fix.

Copy link
Contributor

@coreymckrill coreymckrill left a comment

Choose a reason for hiding this comment

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

Bah, I approved this and then realized that the code sniff test is failing. Should be good to go after that's fixed.

@xristos3490
Copy link
Member Author

Nice catch, @coreymckrill! 🙇

I have made some adjustments to ensure PHPCS is satisfied. However, we still need to determine the appropriate version number for the template modifications. What do you think? Would 7.7.0 be a suitable choice, or perhaps 7.6.2?

coreymckrill
coreymckrill previously approved these changes May 10, 2023
Copy link
Contributor

@coreymckrill coreymckrill left a comment

Choose a reason for hiding this comment

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

we still need to determine the appropriate version number for the template modifications. What do you think? Would 7.7.0 be a suitable choice, or perhaps 7.6.2?

This doesn't seem like an urgent bug fix that would qualify for a point release (let me know if you disagree). Given that 7.7.0 is now out (sorry, was at a conference), I think 7.8.0 would be the right target here.

@xristos3490
Copy link
Member Author

I think 7.8.0 would be the right target here.

Totally agree! Changing templates is always a good idea to do it, at least, on a minor release! Will update the headers shortly!

@xristos3490
Copy link
Member Author

Updated the template version and rebased the branch.

Two templates have already been upgraded to 7.8.0. So, the Highlight templates changes is probably a false positive.

@coreymckrill coreymckrill merged commit 5a3e0b1 into trunk May 16, 2023
@coreymckrill coreymckrill deleted the add/tt3-comp-button-classes branch May 16, 2023 00:18
@github-actions github-actions bot added this to the 7.8.0 milestone May 16, 2023
@coreymckrill
Copy link
Contributor

Thanks @xristos3490 !

@xristos3490 xristos3490 self-assigned this May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants