Skip to content

Conversation

@mdperez86
Copy link
Contributor

@mdperez86 mdperez86 commented Apr 13, 2023

Submission Review Guidelines:

Changes proposed in this Pull Request:

Closes #37663
Closes #37706
Closes #37707

How to test the changes in this Pull Request:

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

  1. Got to /wp-admin/tools.php?page=woocommerce-admin-test-helper
  2. Under Features tab make sure to enable product-block-editor
  3. Then visit /wp-admin/admin.php?page=wc-admin&path=/add-product
  4. Validations should remains as usual

@mdperez86 mdperez86 requested a review from a team April 13, 2023 00:22
@mdperez86 mdperez86 self-assigned this Apr 13, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 13, 2023

Hi @joshuatf,

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

@github-actions
Copy link
Contributor

github-actions bot commented Apr 13, 2023

Test Results Summary

Commit SHA: c619b21

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202611m 10s
E2E Tests1870010019713m 34s

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 13, 2023

Codecov Report

Merging #37695 (4266c93) into trunk (c226fa1) will decrease coverage by 0.0%.
The diff coverage is n/a.

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

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             trunk   #37695     +/-   ##
==========================================
- Coverage     51.6%    51.6%   -0.0%     
  Complexity   17260    17260             
==========================================
  Files          429      429             
  Lines        79928    79928             
==========================================
- Hits         41213    41211      -2     
- Misses       38715    38717      +2     
Impacted Files Coverage Δ
...ludes/tracks/events/class-wc-products-tracking.php 0.0% <ø> (ø)

... and 1 file with indirect coverage changes

joshuatf
joshuatf previously approved these changes Apr 14, 2023
Copy link
Contributor

@joshuatf joshuatf left a comment

Choose a reason for hiding this comment

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

One optional change, but code tests well and looks great so pre-approving! 🎉

const validateTitle = useCallback( (): ValidationError => {
if ( product.title.length < 2 ) {
return false;
return 'Title must be greater than 1';
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably worth including localization in here just in case people copy/paste this.

Suggested change
return 'Title must be greater than 1';
return __( 'Title must be greater than 1', 'text-domain' );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done -> 0378401

@mdperez86 mdperez86 requested a review from joshuatf April 17, 2023 15:06
Copy link
Contributor

@joshuatf joshuatf left a comment

Choose a reason for hiding this comment

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

A couple very minor semantic issues. Sorry I didn't catch those in my last review.

function dimensionsWidthValidator() {
if ( dimensions?.width && +dimensions.width <= 0 ) {
return false;
return __( 'Width must be higher than zero.', 'woocommerce' );
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
return __( 'Width must be higher than zero.', 'woocommerce' );
return __( 'Width must be greater than zero.', 'woocommerce' );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done -> c619b21

function dimensionsLengthValidator() {
if ( dimensions?.length && +dimensions.length <= 0 ) {
return false;
return __( 'Length must be higher than zero.', 'woocommerce' );
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
return __( 'Length must be higher than zero.', 'woocommerce' );
return __( 'Length must be greater than zero.', 'woocommerce' );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done -> c619b21

function dimensionsHeightValidator() {
if ( dimensions?.height && +dimensions.height <= 0 ) {
return false;
return __( 'Height must be higher than zero.', 'woocommerce' );
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
return __( 'Height must be higher than zero.', 'woocommerce' );
return __( 'Height must be greater than zero.', 'woocommerce' );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done -> c619b21

function weightValidator() {
if ( weight && +weight <= 0 ) {
return false;
return __( 'Weight must be higher than zero.', 'woocommerce' );
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
return __( 'Weight must be higher than zero.', 'woocommerce' );
return __( 'Weight must be greater than zero.', 'woocommerce' );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done -> c619b21

const validateTitle = useCallback( (): ValidationError => {
if ( product.title.length < 2 ) {
return false;
return __( 'Title must be greater than 1', 'text-domain' );
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
return __( 'Title must be greater than 1', 'text-domain' );
return __( 'Title must be more than 1 character', 'text-domain' );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done -> c619b21

@mdperez86 mdperez86 requested a review from joshuatf April 17, 2023 18:04
Copy link
Contributor

@joshuatf joshuatf 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! Thanks for those last changes 🎉

@mdperez86 mdperez86 merged commit 41545ec into trunk Apr 18, 2023
@mdperez86 mdperez86 deleted the add/37663 branch April 18, 2023 03:54
@github-actions github-actions bot added this to the 7.8.0 milestone Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants