-
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
Plugins: Add QueryJetpackPlugins query component #8275
Conversation
@ryelle that's good to know - go ahead and remove them at will 👍 |
Just a small naming detail: in #8103, we are trying to add a definite Calypso plugin pattern so people can extend Calypso with plugins (w00t woot). When I saw this PR, I thought: "wow, more people got involved in this Calypso plugin stuff". However, I suppose Could we rename |
cdca205
to
d282c00
Compare
@lamosty sorry to disappoint that this is not a Calypso plugin PR 😆 But that's a good point, I've renamed the component to what you suggested. Jetpack/.com plugins currently occupy |
d282c00
to
62d0541
Compare
cc @ryelle @roccotripaldi @johnHackworth @oskosk - let's land it and start integrating it into the plugjn components altogether with the redux state. |
Related with what @lamosty, I don't think "jetpack plugins" is a good name ... eventually "jetpack plugins" could become a thing (we have discussed a lot of times if jetpack modules should be independent plugins, so who knows what the future will bring), so it's not a good name. Maybe DotOrgPlugins ... anyway, I think what we should change is not this 'plugins' but the new calypso 'plugins' name. It's going to be confusing enough to reuse 'plugins' for something else than 'classic' WordPress plugins |
That's a good point @johnHackworth - we should be careful about naming here. But anyway, I'm positive that the name of the component should't stop us from getting this query component in. We can always rename the component at a later point if necessary. |
}; | ||
|
||
QueryJetpackPlugins.defaultProps = { | ||
fetchPlugins: () => {} |
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.
since we are injecting fetchPlugins before exporting the component, is it necessary to declare the default?
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.
Good point - it's actually not necessary. Omitted.
|
||
QueryJetpackPlugins.propTypes = { | ||
sites: PropTypes.array.isRequired, | ||
isRequestingForSites: PropTypes.bool, |
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.
Let's ask a native english speaker about it, but shouldn't it be "isRequestingSites", without the 'for' ?
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.
isRequestingForSites
makes sense to me because we're checking if it's requesting plugins for sites, but I can see it either way. English ¯_(ツ)_/¯
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.
ok, yeah, that makes sense ... "isRequestingForSites" sounds ok if you think about it like that .
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 agree with @ryelle on this one - we're requesting the plugins for the given sites, so naming makes sense.
I left two minor comments about naming & defaults, but this is looking good! |
I just updated this PR with the updated action name & selector parameters - which have changed since this was first written. |
Yes… it should, but I think the action still expects the site object. It doesn't need to, |
That sounds like a good way to proceed @ryelle. I've updated the PR:
Feel free to review again. 😃 |
Looks great. Thanks for the test cleanup too :) |
1a1053b
to
d791f73
Compare
6397275
to
01568f7
Compare
This PR adds a
QueryJetpackPlugins
query component, which can be used in managing network requests for Jetpack plugins.To test:
I haven't yet integrated it within the plugins components, because this will be done in a series of subsequent PRs that are outside of the scope of this PR. So to test it, insert it in a component and verify that it performs the expected network requests.