Skip to content

Conversation

@joelclimbsthings
Copy link
Contributor

@joelclimbsthings joelclimbsthings commented Apr 20, 2023

Submission Review Guidelines:

Changes proposed in this Pull Request:

Adds stock status to product block editor inventory section.

I also ended up refactoring a previous inventory fields block and adding a generic toggle block.

Closes #37884 .

How to test the changes in this Pull Request:

  1. Checkout branch and enable product-block-editor feature flag using WCA Test Helper.

  2. Navigate to Products -> Add new to see new product block editor.

  3. Add a name to the product.

  4. Go to Inventory tab.

  5. With "track stock quantity" toggle disabled, you should see the "Stock status" radio field.
    image

  6. Select a different option, refresh, and ensure that your selection persists.

  7. Enable the "track stock status" toggle above.

  8. The "Stock status" radio should disappear and now display the "available quantity" field.

  9. Ensure values for both of those fields also persist when saving and refreshing.

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

github-actions bot commented Apr 20, 2023

Test Results Summary

Commit SHA: 2e4d857

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests26700202690m 52s
E2E Tests1870010019715m 21s

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.

@joelclimbsthings joelclimbsthings requested a review from a team April 20, 2023 20:25
@joelclimbsthings joelclimbsthings self-assigned this Apr 20, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 20, 2023

Hi @mdperez86,

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

@joelclimbsthings joelclimbsthings marked this pull request as ready for review April 20, 2023 20:26
@joelclimbsthings joelclimbsthings changed the title Adding toggle block Adding Stock status to inventory tab and toggle block Apr 20, 2023
Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

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

Nice job here @joelclimbsthings I just left 2 comments about the block naming convention.

@joelclimbsthings
Copy link
Contributor Author

Thanks @mdperez86 , good call! I've remedied the block names in 41c7227.

mdperez86
mdperez86 previously approved these changes Apr 21, 2023
Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

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

LGTM @joelclimbsthings !!
This PR needs a rebase. Ping me when ready to go.

mdperez86
mdperez86 previously approved these changes Apr 21, 2023
Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

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

Nice job here @joelclimbsthings

Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

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

"apiVersion": 2,
"name": "woocommerce/product-track-inventory-fields",
"title": "Product track inventory fields",
"name": "woocommerce/product-inventory-quantity-field",
Copy link
Contributor

Choose a reason for hiding this comment

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

{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "woocommerce/product-toggle-field",
Copy link
Contributor

Choose a reason for hiding this comment

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

@joelclimbsthings
Copy link
Contributor Author

Thanks @mdperez86 , added in 2e4d857

Copy link
Contributor

@mdperez86 mdperez86 left a comment

Choose a reason for hiding this comment

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

Nice job @joelclimbsthings thanks for such great work here this LGTM!!!

@joelclimbsthings joelclimbsthings merged commit 3c5a967 into trunk Apr 21, 2023
@joelclimbsthings joelclimbsthings deleted the add/stock-status-37884 branch April 21, 2023 21:49
@github-actions github-actions bot added this to the 7.8.0 milestone Apr 21, 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.

Product Block Editor: Add stock status field to the inventory section

3 participants