Skip to content
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

Sidebar: Remove Plugins menu item for all sites except Jetpack ones #3079

Merged
merged 7 commits into from
Feb 25, 2016

Conversation

stephanethomas
Copy link
Contributor

This pull request disables the Plugins menu item from the sidebar for all except Jetpack sites. This is a preliminary step to removing ecommerce plugins - it just makes sure the Plugins page is not linked from the sidebar for sites with a Business plan:

screenshot

Testing instructions

There are several conditions to test. First start with a single blog:

  1. Run git checkout remove/ecommerce-plugin-sidebar and start your server
  2. Get a test account with only one WordPress.com blog
  3. Open any page from My Sites
  4. Check that there is no Plugins menu item in the sidebar
  5. Purchase a Business plan
  6. Open any page from My Sites
  7. Check that there is no Plugins menu item in the sidebar
  8. Get a test account with only one Jetpack blog
  9. Check that there is a Plugins menu item with a Add button in the sidebar

Now repeat the same steps for a test account with several blogs:

  1. Get a test account with two WordPress.com blogs
  2. Select any of these two blogs
  3. Open any page from My Sites
  4. Check that there is no Plugins menu item in the sidebar
  5. Switches to the other blog
  6. Check that there is no Plugins menu item in the sidebar
  7. Purchase a Business plan
  8. Open any page from My Sites
  9. Check that there is no Plugins menu item in the sidebar
  10. Switches to the former blog
  11. Check that there is no Plugins menu item in the sidebar
  12. Switches to All My Sites
  13. Check that there is still no Plugins menu item in the sidebar

Finally let's add a Jetpack site to the mix:

  1. Get a test account with one WordPress.com blog and one Jetpack blog
  2. Select the WordPress.com blog
  3. Open any page from My Sites
  4. Check that there is no Plugins menu item in the sidebar
  5. Purchase a Business plan
  6. Open any page from My Sites
  7. Check that there is no Plugins menu item in the sidebar
  8. Switches to the Jetpack blog
  9. Check that there is a Plugins menu item with a Add button in the sidebar
  10. Switches to All My Sites
  11. Check that there is a Plugins menu item with a Add button in the sidebar

Additional notes

The Plugins page is still accessible by entering the url directly in the browser.

Reviews

  • Code
  • Product

@stephanethomas stephanethomas added Jetpack [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Business Plugins labels Feb 4, 2016
@stephanethomas stephanethomas self-assigned this Feb 4, 2016
@enejb
Copy link
Member

enejb commented Feb 4, 2016

Works as expected. There is still some clean up that will need to happen which should probably be done in different PRs.

@enejb enejb added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 4, 2016
@scruffian
Copy link
Member

I also tested, and it looks good to me.

classNames = require( 'classnames' ),
contains = require( 'lodash/collection/contains' ),
Copy link
Contributor

Choose a reason for hiding this comment

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

this will break if merged. contains is now includes and we can ditch the path

@blowery
Copy link
Contributor

blowery commented Feb 18, 2016

lodash 4 broke this one. Needs a rebase and fixup before proceeding.

has = require( 'lodash/object/has' ),
contains = require( 'lodash/collection/contains' );
React = require( 'react' ),
startsWith = require( 'lodash/string/startsWith' );
Copy link
Contributor

Choose a reason for hiding this comment

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

just need to drop the path

@stephanethomas stephanethomas force-pushed the remove/ecommerce-plugin-sidebar branch from 0ae6854 to 9afc01a Compare February 19, 2016 11:46
@stephanethomas
Copy link
Contributor Author

Rebased.

@blowery
Copy link
Contributor

blowery commented Feb 19, 2016

Rebased

Thanks @stephanethomas !

@stephanethomas
Copy link
Contributor Author

Well thank you to you @blowery. You did all the hard work!

This make sure the Plugins page is not accessible from the sidebar for sites with a Business plan and ecommerce plugins.
@stephanethomas stephanethomas force-pushed the remove/ecommerce-plugin-sidebar branch from 9afc01a to 50c17bf Compare February 22, 2016 14:12
stephanethomas added a commit that referenced this pull request Feb 25, 2016
Sidebar: Remove Plugins menu item for all sites except Jetpack ones
@stephanethomas stephanethomas merged commit 6da2d5a into master Feb 25, 2016
@stephanethomas stephanethomas deleted the remove/ecommerce-plugin-sidebar branch February 25, 2016 16:42
Tug added a commit that referenced this pull request Feb 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants