Navigation: Reset submenu before making Flyout (https://github.com/woocommerce/woocommerce-admin/pull/6396)

* reset flyout before adding things

* instructions and changelog
This commit is contained in:
Paul Sealock 2021-02-23 13:09:59 +13:00 committed by GitHub
parent da1afbc669
commit 5c2402e6f3
4 changed files with 152 additions and 120 deletions

View File

@ -1,10 +1,17 @@
Testing instructions
====================
# Testing instructions
## Unreleased
## 2.1.0
### Navigation: Reset submenu before making Flyout #6396
- Download and activate the MailChimp plugin.
- Turn on Navigation at Settings > Advanced > Features
- Return to the WP dashboard
- Hover over WooCommerce and see the flyout menu appear
- MailChimp should not be included.
### Email notes now are turned off by default #6324
- Create a zip for testing with `npm run zip:test`.
@ -55,6 +62,7 @@ wp db query 'SELECT status FROM wp_wc_admin_notes WHERE name = "wc-admin-add-fir
6. Make sure the menu item order is correct after unfavoriting.
7. Create a user with permissions to see some but not all registered WooCommerce pages.
8. Check that a user without permission to access a menu item cannot see said menu item.
### Remove CES actions for adding and editing a product and editing an order #6355
1. Add a product. The customer effort score survey should not appear.
@ -69,8 +77,8 @@ wp db query 'SELECT status FROM wp_wc_admin_notes WHERE name = "wc-admin-add-fir
### Make sure that industry is defined in payment methods #6281
- Start a new store, and skip the initial onboarding flow, there is a button `Skip store details` at the bottom
- Load the `Set up payments` task, the payment options should load correctly.
- Start a new store, and skip the initial onboarding flow, there is a button `Skip store details` at the bottom
- Load the `Set up payments` task, the payment options should load correctly.
### Add a new note with a link to the downloadable product doc #6277
@ -82,27 +90,28 @@ wp db query 'SELECT status FROM wp_wc_admin_notes WHERE name = "wc-admin-add-fir
### Onboarding - Fixed "Business Details" error #6271
- Check out this branch.
- Go to the "Industry" step in the OBW and select `Food and drink`.
- Go to the "Business Details" step and press `Free features`.
- Press `Continue`.
- It should work.
- Try also selecting and unselecting some checkboxes before pressing `Continue`.
- Check out this branch.
- Go to the "Industry" step in the OBW and select `Food and drink`.
- Go to the "Business Details" step and press `Free features`.
- Press `Continue`.
- It should work.
- Try also selecting and unselecting some checkboxes before pressing `Continue`.
### Change `siteUrl` to `homeUrl` on navigation site title #6240
- Go to WP settings and set the home page to My account
- Go to WC settings and use the new navigation feature
- Click on the header site title My Site and see that the page direct to My account
- Go to WP settings and set the home page to My account
- Go to WC settings and use the new navigation feature
- Click on the header site title My Site and see that the page direct to My account
### Refactor panel with withFocusOutside #6233
- Go to WooCommerce home page
- Click on Display and Help button back and forth, check that the popover and the panel close as expected.
- Check that the setup store tab continues to work.
- Go to WooCommerce home page
- Click on Display and Help button back and forth, check that the popover and the panel close as expected.
- Check that the setup store tab continues to work.
### Move capability checks to client #6365
1. Create various non-admin users with custom capabilities. Make sure to not include the `view_woocommerce_reports` for at least one role. https://wordpress.org/plugins/leira-roles/
1. Create various non-admin users with custom capabilities. Make sure to not include the `view_woocommerce_reports` for at least one role. https://wordpress.org/plugins/leira-roles/
2. Log in as the non-admin users.
3. Check that the correct menu items are shown.
4. Check that there aren't items shown to the user they should not be able to use or interact with.
@ -133,6 +142,7 @@ localStorage.setItem( 'debug', 'wc-admin:tracks' );
- Click on `Save changes`.
- Observe in developer console, `wcadmin_ces_snackbar_view` is logged when CES prompt is displayed.
- In the event props, it should have a new `settings_area` key followed by the value of the settings tab you have selected.
### Add navigation intro modal #6367
1. Visit the homescreen and dismiss the original welcome modal if you haven't already.
@ -151,14 +161,14 @@ localStorage.setItem( 'debug', 'wc-admin:tracks' );
### Add the Mollie payment provider setup task #6257
- You'll need a site that has the setup task list visible. Complete the OBW and make sure you're in a Mollie supported country (Such as United Kingdom).
- Go to the setup payments task
- Mollie should be listed as an option
- Click "Set up" button on the Mollie task
- It should install and activate the mollie payments plugin
- The connect step should provide links to create an account or go straight to Mollie settings. (test both links work)
- Click "continue"
- You should arrive back at the payment provider list
- You'll need a site that has the setup task list visible. Complete the OBW and make sure you're in a Mollie supported country (Such as United Kingdom).
- Go to the setup payments task
- Mollie should be listed as an option
- Click "Set up" button on the Mollie task
- It should install and activate the mollie payments plugin
- The connect step should provide links to create an account or go straight to Mollie settings. (test both links work)
- Click "continue"
- You should arrive back at the payment provider list
### Fix: allow for more terms to be shown for product attributes in the Analytics orders report. #5868
@ -170,73 +180,74 @@ localStorage.setItem( 'debug', 'wc-admin:tracks' );
### Add: new inbox message - Getting started in Ecommerce - watch this webinar. #6086
- First you'll need to make sure you meet the criteria for the note:
- First you'll need to make sure you meet the criteria for the note:
1. obw is done
2. revenue is between 0-2500
3. do not check "setting up for client" in obw
4. store should have no products
- Next you need to install WP Crontrol, go to its list of cron events and click "run now" on "wc_admin_daily"
- Confirm the new note is displayed and that the content matches that specified below:
- Title: Getting Started in eCommerce - webinar
- Copy: We want to make eCommerce and this process of getting started as easy as possible for you. Watch this webinar to get tips on how to have our store up and running in a breeze.
- CTA leads to: https://youtu.be/V_2XtCOyZ7o
- CTA label: Watch the webinar
- Next you need to install WP Crontrol, go to its list of cron events and click "run now" on "wc_admin_daily"
- Confirm the new note is displayed and that the content matches that specified below:
- Title: Getting Started in eCommerce - webinar
- Copy: We want to make eCommerce and this process of getting started as easy as possible for you. Watch this webinar to get tips on how to have our store up and running in a breeze.
- CTA leads to: https://youtu.be/V_2XtCOyZ7o
- CTA label: Watch the webinar
### Update: store deprecation welcome modal support doc link #6094
- Starting with a fresh store (or by deleting the woocommerce_task_list_welcome_modal_dismissed option), visit /wp-admin/admin.php?page=wc-admin. You should see the standard welcome modal.
- Add &from-calypso to the URL. You should see the Calypso welcome modal.
- Notice "Learn more" links to https://wordpress.com/support/new-woocommerce-experience-on-wordpress-dot-com/
- Starting with a fresh store (or by deleting the woocommerce_task_list_welcome_modal_dismissed option), visit /wp-admin/admin.php?page=wc-admin. You should see the standard welcome modal.
- Add &from-calypso to the URL. You should see the Calypso welcome modal.
- Notice "Learn more" links to https://wordpress.com/support/new-woocommerce-experience-on-wordpress-dot-com/
### Enhancement: Allowing users to create products by selecting a template. #5892
- Load new store and finish the Wizard
- Go to the `Add my products` task
- Click the `Start with a template` option, and select either a physical, digital, variable product
- Once you click `Go`, it should redirect you to an edit page of the new post, with the data from the sample-data.csv (mentioned in the original ticket). Only the title is missing, as it is saved as auto-draft.
- You should be able to save the new product as draft or publish it.
- You should be able to exit without making any changes, and not having the product show up as draft in your product list.
- Create new product from template
- Wait until redirected
- Without saving go to the **Products > all products** page, the new product should not be displayed.
- Load new store and finish the Wizard
- Go to the `Add my products` task
- Click the `Start with a template` option, and select either a physical, digital, variable product
- Once you click `Go`, it should redirect you to an edit page of the new post, with the data from the sample-data.csv (mentioned in the original ticket). Only the title is missing, as it is saved as auto-draft.
- You should be able to save the new product as draft or publish it.
- You should be able to exit without making any changes, and not having the product show up as draft in your product list.
- Create new product from template
- Wait until redirected
- Without saving go to the **Products > all products** page, the new product should not be displayed.
### Update: Homescreen layout, moving Inbox panel for better interaction. #6122
- Create a new woo store, and finish the onboarding wizard.
- Go to the home screen, and make sure the panels follow this order:
- Two column:
- Left column: store setup and/or management tasks + inbox panel
- Right column: stats overview + store management shortcuts (only shows when setup tasks is hidden)
- Single column:
- store setup tasks, inbox panel, stats overview, store management links (only visible when setup tasks is hidden).
- Hide the setup tasks list, and see if the store management links show up in the right place.
- Create a new woo store, and finish the onboarding wizard.
- Go to the home screen, and make sure the panels follow this order:
- Two column:
- Left column: store setup and/or management tasks + inbox panel
- Right column: stats overview + store management shortcuts (only shows when setup tasks is hidden)
- Single column:
- store setup tasks, inbox panel, stats overview, store management links (only visible when setup tasks is hidden).
- Hide the setup tasks list, and see if the store management links show up in the right place.
### Enhancement: Use the new Paypal payments plugin for onboarding. #6261
- Create new woo store, and finish the onboarding wizard
- Go to the home screen, and click the **Set up payments** task. **Paypal Payments** option should be listed as an option, with a **Set up** button.
- Click **Set up** on the Paypal plugin.
- It should automatically start the **Install** step, and install and enable the [Paypal Payments](https://woocommerce.com/products/woocommerce-paypal-payments/) plugin.
- For Paypal Payments version greater then `1.1.0`.
- For the second step it should show a `Connect` button
- Click on **Connect** and a window should popup for Paypal, follow this until finished. The last button is - Go back to Woocommerce Developers
- Once done, the page should reload, and briefly show the setup screen again, it should then finish and go back to the payment list.
- Once on the payment list, the `Set up` button should be gone, and instead show a toggle, that is set to enabled.
- The enable/disable button should be correctly reflected in the Woocommerce payment settings screen as well.
- For Paypal Payments version `1.1.0` and below
- For the second step it will show the manual fields (merchant email, merchant id, client id, client secret).
- Check if the help links work below, they should help with finding the above credentials.
- If you have a business account set up, you can find the credentials in these two places
- [Get live app credentials](https://developer.paypal.com/developer/applications/)
- [Merchant id](https://www.paypal.com/businessmanage/account/aboutBusiness)
- Fill in the credentials and click **Proceed**, this should succeed and redirect you to the Payment options list
- The **Set up** button should be replaced by a toggle, that is set to enabled.
- The enable/disable button should be correctly reflected in the Woocommerce payment settings screen as well.
- Create new woo store, and finish the onboarding wizard
- Go to the home screen, and click the **Set up payments** task. **Paypal Payments** option should be listed as an option, with a **Set up** button.
- Click **Set up** on the Paypal plugin.
- It should automatically start the **Install** step, and install and enable the [Paypal Payments](https://woocommerce.com/products/woocommerce-paypal-payments/) plugin.
- For Paypal Payments version greater then `1.1.0`.
- For the second step it should show a `Connect` button
- Click on **Connect** and a window should popup for Paypal, follow this until finished. The last button is - Go back to Woocommerce Developers
- Once done, the page should reload, and briefly show the setup screen again, it should then finish and go back to the payment list.
- Once on the payment list, the `Set up` button should be gone, and instead show a toggle, that is set to enabled.
- The enable/disable button should be correctly reflected in the Woocommerce payment settings screen as well.
- For Paypal Payments version `1.1.0` and below
- For the second step it will show the manual fields (merchant email, merchant id, client id, client secret).
- Check if the help links work below, they should help with finding the above credentials.
- If you have a business account set up, you can find the credentials in these two places
- [Get live app credentials](https://developer.paypal.com/developer/applications/)
- [Merchant id](https://www.paypal.com/businessmanage/account/aboutBusiness)
- Fill in the credentials and click **Proceed**, this should succeed and redirect you to the Payment options list
- The **Set up** button should be replaced by a toggle, that is set to enabled.
- The enable/disable button should be correctly reflected in the Woocommerce payment settings screen as well.
Once everything is configured and enabled do a client test
- Make sure you have added a product and store homescreen (Finish the **Personalize my store** task)
- Navigate to one of the products and add it to the cart
- Click **go to checkout**
- Paypal should be one of the options to pay
- Filling in your billing/shipping info then click pay with **Paypal**
- The paypal pay window should pop up correctly without errors.
- Make sure you have added a product and store homescreen (Finish the **Personalize my store** task)
- Navigate to one of the products and add it to the cart
- Click **go to checkout**
- Paypal should be one of the options to pay
- Filling in your billing/shipping info then click pay with **Paypal**
- The paypal pay window should pop up correctly without errors.

View File

@ -230,4 +230,4 @@
"node": ">=8.0.0",
"npm": ">=6.14.2"
}
}
}

View File

@ -117,6 +117,7 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt
- Dev: Change `siteUrl` to `homeUrl` on navigation site title #6240
- Dev: Add navigation favorites data store #6275
- Add: Add navigation intro modal. #6367
- Fix: Reset Navigation submenu before making Flyout #6396
== 2.0.0 02/05/2021 ==

View File

@ -513,6 +513,54 @@ class Menu {
}
}
/**
* Add an item or taxonomy.
*
* @param array $menu_item Menu item.
*/
public function add_item_and_taxonomy( $menu_item ) {
if ( in_array( $menu_item[2], CoreMenu::get_excluded_items(), true ) ) {
return;
}
$menu_item[2] = htmlspecialchars_decode( $menu_item[2] );
// Don't add already added items.
$callbacks = self::get_callbacks();
if ( array_key_exists( $menu_item[2], $callbacks ) ) {
return;
}
// Don't add these Product submenus because they are added elsewhere.
if ( in_array( $menu_item[2], array( 'product_importer', 'product_exporter', 'product_attributes' ), true ) ) {
return;
}
self::add_plugin_item(
array(
'title' => $menu_item[0],
'capability' => $menu_item[1],
'id' => sanitize_title( $menu_item[0] ),
'url' => $menu_item[2],
)
);
// Determine if migrated items are a taxonomy or post_type. If they are, register them.
$parsed_url = wp_parse_url( $menu_item[2] );
$query_string = isset( $parsed_url['query'] ) ? $parsed_url['query'] : false;
if ( $query_string ) {
$query = array();
parse_str( $query_string, $query );
if ( isset( $query['taxonomy'] ) ) {
Screen::register_taxonomy( $query['taxonomy'] );
} elseif ( isset( $query['post_type'] ) ) {
Screen::register_post_type( $query['post_type'] );
}
}
}
/**
* Migrate any remaining WooCommerce child items.
*
@ -526,52 +574,24 @@ class Menu {
return $menu;
}
$submenu_items = array_merge(
isset( $submenu['woocommerce'] ) ? $submenu['woocommerce'] : array(),
isset( $submenu['edit.php?post_type=product'] ) ? $submenu['edit.php?post_type=product'] : array()
);
$main_items = isset( $submenu['woocommerce'] ) ? $submenu['woocommerce'] : array();
$product_items = isset( $submenu['edit.php?post_type=product'] ) ? $submenu['edit.php?post_type=product'] : array();
foreach ( $submenu_items as $key => $menu_item ) {
if ( in_array( $menu_item[2], CoreMenu::get_excluded_items(), true ) ) {
foreach ( $main_items as $key => $menu_item ) {
self::add_item_and_taxonomy( $menu_item );
// phpcs:disable
if ( ! isset( $menu_item[ self::CSS_CLASSES ] ) ) {
$submenu['woocommerce'][ $key ][] .= ' hide-if-js';
} else if ( strpos( $submenu['woocommerce'][ $key ][ self::CSS_CLASSES ], 'hide-if-js' ) !== false ) {
continue;
} else {
$submenu['woocommerce'][ $key ][ self::CSS_CLASSES ] .= ' hide-if-js';
}
// phpcs:enable
}
$menu_item[2] = htmlspecialchars_decode( $menu_item[2] );
// Don't add already added items.
$callbacks = self::get_callbacks();
if ( array_key_exists( $menu_item[2], $callbacks ) ) {
continue;
}
// Don't add these Product submenus because they are added elsewhere.
if ( in_array( $menu_item[2], array( 'product_importer', 'product_exporter', 'product_attributes' ), true ) ) {
continue;
}
self::add_plugin_item(
array(
'title' => $menu_item[0],
'capability' => $menu_item[1],
'id' => sanitize_title( $menu_item[0] ),
'url' => $menu_item[2],
)
);
// Determine if migrated items are a taxonomy or post_type. If they are, register them.
$parsed_url = wp_parse_url( $menu_item[2] );
$query_string = isset( $parsed_url['query'] ) ? $parsed_url['query'] : false;
if ( $query_string ) {
$query = array();
parse_str( $query_string, $query );
if ( isset( $query['taxonomy'] ) ) {
Screen::register_taxonomy( $query['taxonomy'] );
} elseif ( isset( $query['post_type'] ) ) {
Screen::register_post_type( $query['post_type'] );
}
}
foreach ( $product_items as $key => $menu_item ) {
self::add_item_and_taxonomy( $menu_item );
}
return $menu;