-
Notifications
You must be signed in to change notification settings - Fork 4
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
Ecommerce Admin Menu: Apply changes to the site with nav redesign #1449
Conversation
Size Change: 0 B Total Size: 197 kB ℹ️ View Unchanged
|
28e4c9a
to
ec34a9d
Compare
ec34a9d
to
42dafad
Compare
f42e472
to
da1a6c8
Compare
Hey @arthur791004 , thanks for working on this fix. I've added @xristos3490 from SomewhereWarm as a reviewer, since he developed the menu; maybe he would have something to add. As for testing steps, I'd recommend adding testing steps with disabled nav redesign to double check there's no regression. |
Thank you! I added the step to disable the nav redesign and review whether the menu items are the same as before 🙂 |
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 fixes, ran out of time to test but the changes lgtm.
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 did:
The URL is https:// |
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.
Hey, @arthur791004! Great work! 💪
Here are the steps I took to test this:
- Created a fresh Entrepreneur store and set the
wpcom_classic_early_release
option to1
. - Synced this PR.
- Everything works as expected. ✅ cc @candy02058912 I couldn't replicate the issue with the Plugins landing page; for me, it shows up as expected (using the exact same mockup on the free trial conditional.) 🤔
However, I went to the Hosting Configuration panel and changed the "Admin interface style" to "Default". As a result, I noticed a few issues. I'm not sure if this is relevant or if you plan to remove this view completely. If not, I think we should address these issues. Here's what I found:
- The "My home" item appears twice.
- The Plugins item appears twice (when I mock the trial conditional; both items are working tho.)
- The "Orders" menu item bleeds into the Calypso's menu.
Moreover, from what is worth, I'm seeing the same results using an old "Woo Express: Performance" store.
Screenshots:
- (Bonus, and most probably unrelated to this PR) The Calypso's submenu highlighting shows this blue background instead of green text.
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.
@candy02058912 It's weird. I cannot reproduce this issue either 🥲 |
@xristos3490 Thanks for the review! I made 2be0730 to address the following issues: ✅ The "My home" item appears twice. |
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 tested the changes by comparing with nav unification.
✅ My Home
Nav unification | Classic view |
---|---|
✅ Jetpack
Nav unification | Classic view |
---|---|
✅ Top Level
Nav unification | Classic view |
---|---|
✅ Tools (can see WooCommerce Status menu, order is a bit different but I think it's OK)
Nav unification | Classic view |
---|---|
✅ Settings (can see WooCommerce menu)
Nav unification | Classic view |
---|---|
On Trial plan (by mocking wc_calypso_bridge_is_ecommerce_trial_plan
to true)
❌ The "Plugins" displays the "WC Plugins Upgrade" page
Got not allowed instead (both nav unification and classic view)
✅ The "Feedback" menu is moved to "Jetpack > Feedback"
Nav unification | Classic view |
---|---|
Issues
❓ If My Home menu is active, somehow the Extensions menu is also active:
Nav unification | Classic view |
---|---|
It's weird... I created a new WooCommerce (Entrepreneur) site but I couldn't reproduce the above 2 issues 🫠 |
I created a new Woo Express Trial site (woo.com/express) and could not reproduce the issues as well. Maybe mocking |
@fushar @miksansegundo
in wc-calypso-bridge/ |
Referring to #1449 (comment), it also resolves the My Home and Extensions menus are active 😂 |
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.
Retested things after running #1449 (comment)
When I switch from "classic" to the "default" admin interface, I see two "My Home" submenus.
✅ Fixed
❓ If My Home menu is active, somehow the Extensions menu is also active:
✅ Fixed
❌ The "Plugins" displays the "WC Plugins Upgrade" page
✅ Fixed
See #1449 (comment)
You can see the "My Home" menu, and it displays the "Welcome to your Woo Express store" page
✅
You can see the "Orders" menu
✅
The "WooCommerce" menu is renamed to "Extensions"
- The submenu "Orders" is moved to the top level
- The submenu "Customers" is moved to the top level
- The submenu "Extensions" is renamed to "Discover"
- The submenu "Home" is hidden
- The submenu "Settings" is moved to "Settings > WooCommerce" menu, and it's right before "Settings > General"
- The submenu "Status" is moved to "Tools > WooCommerce Status"
✅
The "Settings > Jetpack" menu is removed
✅
The "Jetpack > Search" menu is removed
✅
The "Jetpack > Akismet" menu is moved to "Settings > Anti-Spam"
✅
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.
You'll have to run
npm install
npm run build
in wc-calypso-bridge/
And then rsync to the site and visit /wp-admin/admin.php?page=wc-admin&path=%2Fplugins-upgrade
Oh my god... thanks @candy02058912!!! Now everything works perfectly!! 😂
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.
Tested:
- Create a new WoA site with Entrepreneur plan
- Build and sync changes from your local to the WoA site
- Enable the nav redesign on your site, e.g.: turning on your proxy or seting the wpcom_classic_early_release option to 1 on your site
- ✅ Make sure the menu works as expected
- ✅ You can see the "My Home" menu, and it displays the "Welcome to your Woo Express store" page
- ✅ You can see the "Orders" menu
- ✅ The "WooCommerce" menu is renamed to "Extensions"
- ✅ The submenu "Orders" is moved to the top level
- ✅ The submenu "Customers" is moved to the top level
- ✅ The submenu "Extensions" is renamed to "Discover"
- ✅ The submenu "Home" is hidden
- ✅ The submenu "Settings" is moved to "Settings > WooCommerce" menu, and it's right before "Settings > General"
- ✅ The submenu "Status" is moved to "Tools > WooCommerce Status"
- ✅ The "Settings > Jetpack" menu is removed
- ✅ The "Jetpack > Search" menu is removed
- ✅ The "Jetpack > Akismet" menu is moved to "Settings > Anti-Spam"
- Follow peapX7-1D4-p2 to create another WoA site with eCommerce trial plan. Or mark your site as a free trial site by mocking the return value of wc_calypso_bridge_is_ecommerce_trial_plan to true
- Make sure the following items work as expected
- ✅ The "Plugins" displays the "WC Plugins Upgrade" page
- ✅ The "Feedback" menu is moved to "Jetpack > Feedback"
- Make sure the following items work as expected
- ✅ Disable the nav redesign on your site, e.g.: turning off your proxy or unsetting the wpcom_classic_early_release option
- ✅ Review the menu items, and it should be the same as before
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 @arthur791004! Everything works as expected now. We are almost ready!
I noticed the "My Home" item appears within the Hosting menu. Is this expected? 🤔
This is calypso's My Home, and it's the default route for the "Hosting" menu item as well. ... Ah that's right, Woo Express wants to use wc-admin as the sites "My Home", that doesn't really work with the new menu setup. We'll need to figure this out separately (issue). I'm not sure if the change should go here or in our menu as we would want to do something on the calypso side too. Probably just need to make /plans the home route. |
// Replace "Hosting" (/home) link with "Hosting" (/plans). | ||
$this->update_menu( | ||
'wpcom-hosting-menu', | ||
esc_url( "https://wordpress.com/plans/{$this->domain}" ), | ||
esc_attr__( 'Hosting', 'wc-calypso-bridge' ), | ||
'manage_options', | ||
'dashicons-cloud', | ||
3 | ||
); | ||
|
||
// Remove "Hosting" submenu item created by the above. | ||
remove_submenu_page( | ||
'wpcom-hosting-menu', | ||
esc_url( "https://wordpress.com/plans/{$this->domain}" ) | ||
); | ||
|
||
// Remove "My Home" submenu item. | ||
remove_submenu_page( | ||
'wpcom-hosting-menu', | ||
esc_url( "https://wordpress.com/home/{$this->domain}" ) | ||
); |
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.
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.
👍
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.
Tested this change and it looks good!
✅ The “My Home” of Hosting is removed
✅ The “Hosting” menu points to the /plans
page on Calypso
Changes proposed in this Pull Request:
Closes https://github.com/Automattic/dotcom-forge/issues/5919
The feature, Ecommerce Admin Menu, relies on the
Atomic_Admin_Menu
class from Jetpack and hook the new navigation class to thejetpack_admin_menu_class
filter. However, both class and filter won't be loaded after the nav redesign. So, this PR proposes to restore the Ecommerce Admin Menu when the nav redesign is enabled.How to test the changes in this Pull Request:
wpcom_classic_early_release
option to1
on your sitewc_calypso_bridge_is_ecommerce_trial_plan
to truewpcom_classic_early_release
optionOther information:
FOR PR REVIEWER ONLY: