-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Move product action buttons to header menu #35214
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
Test Results SummaryCommit SHA: 4eb8f8a
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. |
joshuatf
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.
Excellent work, Maikel! Code looks great and action buttons are testing well.
Left one comment about possibly updating the regex check, but otherwise LGTM 💯
| const isProductPage = () => { | ||
| return ( | ||
| query.page === 'wc-admin' && | ||
| /^(\/add-product|\/product)/gi.test( query.path ) |
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.
Could we use a check to see if that path is strictly equal to product or add-product instead of regex? If we were to add a new page with a path of product-settings, for example, this would give us a false positive and remove the activity panel items.
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.
Awesome!!! what do you think if we check for /add-product and /product/ segments strictly?
/^\/(add-product|product\/.+)$/gi.test( query.path )Since the edit product page path is something like /product/{id} that's why I used a regex.
dc63b3c to
4eb8f8a
Compare
joshuatf
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.
Looks great! Thanks for the improvements and added tests, @mdperez86! LGTM 🚢
| { input: '', output: [ '' ] }, | ||
| { input: 'product', output: [ 'product' ] }, | ||
| { input: 'product/', output: [ 'product' ] }, | ||
| { input: '/product', output: [ 'product' ] }, |
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.
Thanks for adding these tests around different formats for the path 💯
|
Hi @mdperez86, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
|
All Submissions:
Changes proposed in this Pull Request:
Closes #35139.
How to test the changes in this Pull Request:
Other information:
pnpm changelog add --filter=<project>?FOR PR REVIEWER ONLY: