Skip to content

Conversation

@joshuatf
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

Adds the advanced section for product inventory management. Note that some styling changes around radios and radio labels exist in #35047.
Screen Shot 2022-10-18 at 3 46 51 PM

Closes #34389 .

How to test the changes in this Pull Request:

  1. Enable/disable the stock management for products at wp-admin/admin.php?page=wc-settings&tab=products&section=inventory
  2. Under the product page (Products -> Add new (MVP)), click "Advanced" in the inventory section
  3. Note that when stock management is enabled, the "out of stock" options exist
  4. Note that in both cases, the limit 1 per purchase checkbox exists

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Have you created a changelog file for each project being changed, ie pnpm --filter=<project> run changelog add?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@joshuatf joshuatf requested a review from a team October 18, 2022 22:50
@joshuatf joshuatf self-assigned this Oct 18, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 2022

Test Results Summary

Commit SHA: 70966d2

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests23200302350m 49s
E2E Tests186006019214m 48s

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.

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Oct 18, 2022
louwie17
louwie17 previously approved these changes Oct 25, 2022
Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

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

This tested well, and changes are simple and straightforward, nice work!
It would be great to add a couple tests around this though.

Approving this, there are some merge conflicts, so let me know when you need a re-approval.

@joshuatf
Copy link
Contributor Author

Thanks, @louwie17! Rebased and also added tests in e121f1a

Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

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

This is looking good @joshuatf, also appreciate you adding tests.
I did leave one comment in one of the tests, the name of it kinda confused me, in relation to what the test was actually doing.
Also when the track quantity is enabled it seems the margin is a lot bigger between the Advanced ^ button and the When out of stock label, compared to the margin between Restrictions and the toggle when track quantity is disabled.
See screenshot:
Screen Shot 2022-10-27 at 2 52 45 PM

).toHaveClass( 'is-disabled' );
} );

it( 'should not render the manage stock section if inventory management is turned on', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this actually be that the manage stock is not disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should! Thanks for the catch!

@joshuatf
Copy link
Contributor Author

Thanks for the review, @louwie17. I must have screwed up the rebase and created the margin issue. Should be resolved now in 5db6f07.

louwie17
louwie17 previously approved these changes Oct 28, 2022
Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

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

Styling looks good now, nice work @joshuatf , this looks good!

Btw you will likely have to rebase again with latest of trunk to fix the code sniff error.

Copy link
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@joshuatf joshuatf merged commit 66370c8 into trunk Oct 31, 2022
@joshuatf joshuatf deleted the add/34389 branch October 31, 2022 21:36
@github-actions github-actions bot added this to the 7.2.0 milestone Oct 31, 2022
@github-actions
Copy link
Contributor

Hi @joshuatf, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:

  • Add the release: add testing instructions label

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.

[Inventory] Advanced section

3 participants