Skip to content

Conversation

@joshuatf
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

Adds the product title to the header when available, otherwise adds a "add new" string to the header based on product type.

Note that product types haven't been officially added yet, so a simple product type placeholder exists.

Screen Shot 2022-10-31 at 2 32 40 PM

Screen Shot 2022-10-31 at 2 28 21 PM

Closes #35172 .

  • This PR is a very minor change/addition and does not require testing instructions (if checked you can ignore/remove the next section).

How to test the changes in this Pull Request:

  1. Navigate to the new product management experience ( Products -> Add new (MVP) ).
  2. Note that "New product" exists in the header initially
  3. Type something in the product name field
  4. Note that the header is updated to reflect this name
  5. Delete the content from the product name field
  6. Note that the header reverts to "New product"
  7. Save the product as a draft or publish
  8. Remove the content from the product name field
  9. Note that the previously saved name shows in the header
  10. Type some content in the product name field
  11. Note that the header is updated to reflect those changes

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 created a changelog file for each project being changed, ie pnpm --filter=<project> 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 31, 2022 21:35
@joshuatf joshuatf self-assigned this Oct 31, 2022
@github-actions github-actions bot added focus: react admin plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Oct 31, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2022

Test Results Summary

Commit SHA: 236c53e

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests26000202620m 53s
E2E Tests186006019218m 6s

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 review from a team and joelclimbsthings and removed request for a team and joelclimbsthings November 2, 2022 19:53
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.

Nice work @joshuatf, this tested well! Also thanks for separating this into different components 🎉
I just left one comment in relation to the call to registerPlugin otherwise this looks good.

registerPlugin( 'woocommerce-product-title', {
render: ProductTitle,
icon: 'admin-generic',
} );
Copy link
Contributor

Choose a reason for hiding this comment

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

This registerPlugin is not necessary as we are rendering it as part of the ProductFormHeader anyway, so we could remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

@louwie17 louwie17 mentioned this pull request Nov 4, 2022
8 tasks
@joshuatf
Copy link
Contributor Author

Thanks for catching that @louwie17! Pushed an update in 068ecab and this should be ready for re-review.

louwie17
louwie17 previously approved these changes Nov 15, 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.

LGTM 🚀 Thanks for removing the registerPlugin logic, this looks good!

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.

Rebase looks good, LGTM 🚀

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.

[Header] Product name

3 participants