Skip to content

Conversation

@joshuatf
Copy link
Contributor

@joshuatf joshuatf commented Dec 6, 2022

All Submissions:

Changes proposed in this Pull Request:

Adds in the product tabs to the header and moves sections to the respective tabs.

Note that this PR does not yet fully address extensibility, which will be saved for a future cycle.

Screen Shot 2022-12-06 at 11 53 38 AM

Closes #35706 .

  • 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. Click the various tabs in the header to navigate between product sections (General/Pricing/etc)
  3. Make sure that all content is shown and works as expected
  4. Narrow your viewport to make sure that the header placement works with various screen sizes
  5. Scroll down inside a given tab and then click another tab to make sure you're scrolled back to the top

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 December 6, 2022 20:06
@joshuatf joshuatf self-assigned this Dec 6, 2022
@github-actions github-actions bot added focus: react admin plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Dec 6, 2022
}

.woocommerce-admin-product-layout .woocommerce-layout__header {
min-height: $header-height + $product-form-tabs-height;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a hacky workaround. Ideally we would SlotFill this into the header, but there are 2 issues:

  1. We don't have a slot that works well for this case/layout.
  2. The TabPanel does not have a way to separate out just the tabs, so we will end up just copying over most of that component from Gutenberg to separate the tabs and content.

This current solution will present issues if another plugin or party modifies the header height or menu widths. We should follow up on this to create the correct slots.

};
}, [] );

const tabs = Children.map( children, ( child: JSX.Element ) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opted to extract the tabs from children so we can avoid using applyFilters and create the necessary SlotFills for extensibility going forward.

See the ProductFormTab below for usage and how a plugin might extend or create a new tab.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

Test Results Summary

Commit SHA: fa8548d

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 53s
E2E Tests187006019313m 1s

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.

@octaedro octaedro requested review from octaedro and removed request for a team December 12, 2022 17:04
Copy link
Contributor

@octaedro octaedro left a comment

Choose a reason for hiding this comment

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

Good job @joshuatf! The code looks good and is testing well on my end! 🚀

@joshuatf joshuatf merged commit 4eacc67 into trunk Dec 13, 2022
@joshuatf joshuatf deleted the add/35706 branch December 13, 2022 16:13
@github-actions github-actions bot added this to the 7.3.0 milestone Dec 13, 2022
samueljseay pushed a commit that referenced this pull request Dec 15, 2022
* Add product form tabs to layout

* Move product sections to respective tabs

* Add tab styling

* Add changelog entry

* Scroll to top on tab change

* Update font weight on active or inactive tabs

* Add blank EOL
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.

Top navigation tabs [MVP]

3 participants