-
Notifications
You must be signed in to change notification settings - Fork 2k
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
AT: Disable Jetpack and Vaultpress plugin actions #11817
Conversation
for jetpack and vaultpress
getAllowedPluginActions( ) { | ||
return { | ||
autoupdate: true, | ||
activation: true |
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.
Usually, we use trailing comma. Not a big deal, though.
@@ -160,6 +160,15 @@ module.exports = React.createClass( { | |||
); | |||
} | |||
} | |||
|
|||
if ( this.props.isAutoManaged ) { |
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.
Although this component doesn't have defined rightly any property, I suggest defining isAutoManaged
and allowedActions
(type and default value) on this patch.
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.
updated.
notices={ this.props.notices } wporg={ this.props.plugin.wporg } isMock={ this.props.isMock } /> | ||
<PluginRemoveButton plugin={ this.props.plugin } site={ this.props.selectedSite } | ||
notices={ this.props.notices } isMock={ this.props.isMock } /> | ||
{ canToggleActivation && <PluginActivateToggle plugin={ this.props.plugin } site={ this.props.selectedSite } |
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.
These lines are increasing too much. Could we separate the properties a little to improve reading? Something like ...
{ canToggleActivation && <PluginActivateToggle
plugin={ this.props.plugin }
site={ this.props.selectedSite }
notices={ this.props.notices }
isMock={ this.props.isMock } />
}
Not a big deal. Feel free to ignore this comment.
return { | ||
selectedSite, | ||
selectedSiteSlug: getSelectedSiteSlug( state ), | ||
isSiteAutomatedTransfer: isSiteAutomatedTransfer( state, get( selectedSite, 'ID' ) ) |
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.
missing trailing comma
I wonder if have we get rid of apply transparency to the disabled plugins? cc @rralian #11541 (comment) if not I think they should be applied on this PR. |
return ( | ||
<div className="plugin-item__actions"> | ||
<PluginActivateToggle | ||
{ canToggleActivation && <PluginActivateToggle |
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 wonder if we could hide these components in the same way that they are disabled. Instead of ...
{ canToggleAutoupdate && <PluginAutoupdateToggle
isMock={ this.props.isMock }
// ...
/> }
}
... implement something like ...
<PluginAutoupdateToggle
isMock={ this.props.isMock }
hide={ ! canToggleAutoupdate }
// ...
/>
I think it looks more readable, but I don't wanna bothering you with too many details. Again, feel free to ignore this.
Code-wise, looks good |
I've tested the implementation, and it looks great. It works like expected. |
Lets also update the README.md files if we are updating the props. |
If folks are happy with changes here, let's 🚢 this and follow up in additional PRs. Since this is a larger changeset let's take care to test main flows on stage in addition to the plugin changes here. |
Good job! This looks and works great for me, so I say |
This hides the plugin actions for Jetpack and Vaultpress on automated transfer sites for the following routes:
http://calypso.localhost:3000/plugins/:site
http://calypso.localhost:3000/plugins/:plugin/:site
plugins/:site
The targeted plugins no longer display the activation or auto update toggles. There is also added messaging:
{plugin} is automatically managed on this site
plugins/:plugin/:site
Users can still click through the plugin in the list to access details page. Here the actions again are not displayed but there is no additional messaging.
The PR does not address bulk changes or non site selected pages (
/plugins
or/plugins/:plugin
).The changes here were guided from the feedback in #11541. In particular:
On the last point this PR does use existing logic in calypso to check for automated transfer sites but the check is done further up the component hierarchy. It should be simple to refactor
getAllowedPluginActions
and remove the AT site selector after the new attributes are available from the plugins api.Related PR : #11541
Fixes 84-gh-automated-transfer
@Automattic/stark
cc @johnHackworth @enejb