-
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
Sites: Don't bind selectors to state #14030
Conversation
@mcsf I'm thinking we can add |
@tyxla: sounds like a good idea. Would you be interested in picking it up, or should I? |
Sure, @mcsf, I've added a couple of commits to tackle that 👍 |
Woot! Thanks! |
I can't formally approve this PR, since I created it, but LGTM!. :) |
Well, let's request some more 👀 here then 😉 |
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'm no longer able to search for wpcom sites that have upgrades, or can be upgraded. For example when visiting http://calypso.localhost:3000/plans
client/my-sites/sites/sites.jsx
Outdated
@@ -47,7 +47,7 @@ export const Sites = React.createClass( { | |||
|
|||
// Filter out sites with no upgrades on particular routes | |||
if ( /^\/domains/.test( path ) || /^\/plans/.test( this.props.sourcePath ) ) { | |||
return this.props.isSiteUpgradeable( site.ID ); | |||
return site.isSiteUpgradeable !== false; |
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.
This does the trick, but I wonder if we could be a bit more clear with:
return ! site.isJetpack || site.isSiteUpgradable;
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.
Sure, I'd go that way, but I was wondering: is there a case where upgradeable state can't be determined for a WordPress.com site? For example, if a site request fails to complete.
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.
What does state look like in that case? I'd also be fine with the above and adding a clarifying comment so folks don't try and simplify the check.
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.
After further consideration, I've decided to go with your suggestion here, it makes it much more readable than what I suggested.
@mcsf that one is ready to go; do you want to deploy it, or should I? 😉 |
@tyxla I feel you should do the honors, since I merely opened the PR and you did all the work :) |
40c5c11
to
9510156
Compare
Part of #14024
This PR seeks to remove
from
my-sites/sites
. @tyxla: You've been working a lot with Jetpack and capabilities, do you have recommendations on how to approach this?Sites
passes afilter
function prop toSiteSelector
, which calls it to filter all site objects. How wrong would it be to inspect the site objects instead of calling the selector?