-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add product tabs to product layout #35862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| } | ||
|
|
||
| .woocommerce-admin-product-layout .woocommerce-layout__header { | ||
| min-height: $header-height + $product-form-tabs-height; |
There was a problem hiding this comment.
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:
- We don't have a slot that works well for this case/layout.
- The
TabPaneldoes 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 ) => { |
There was a problem hiding this comment.
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.
Test Results SummaryCommit SHA: fa8548d
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
left a comment
There was a problem hiding this 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! 🚀
* 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
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.
Closes #35706 .
How to test the changes in this Pull Request:
Products -> Add new (MVP))Other information:
pnpm --filter=<project> changelog add?FOR PR REVIEWER ONLY: