-
Notifications
You must be signed in to change notification settings - Fork 799
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
Admin Page: Get the connection URL from initial state instead of fetching it #8014
Conversation
35df958
to
623b5cb
Compare
623b5cb
to
11a7848
Compare
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.
The idea makes sense, and I couldn't seem to break anything when testing.
cc @ebinnion because I know you used to have some concerns/theories about the connect URLs were causing issues in some places.
Off of the top of my head, I couldn't recall specific issues. After thinking about it for a bit, I did think of one specific flow where we could get in a bind:
But, then I tested and that flow worked. 🤔 So, I read the PR again, and it looks like @oskosk handled that flow ( 🎉 ) with the following:
With that being said, this seems reasonable to me. 👍 |
Thanks for the review @ebinnion . Merging now |
Did a pass over _inc/client/components looking for things that weren't used anywhere, and found a bunch: * components/data/query-connect-url - Last use removed in #8014 * components/data/query-connection-status - Last use removed in 62e9ab0 * components/data/query-modules - Last use removed in bfc40ad * components/data/query-plugin-updates - Last use removed in #17003 * components/data/query-site-products - Last use removed in #21594 * components/form/* - Didn't check for last use, too many bits. But it looks like the `formsy-react` package many of these depended on wasn't even installed since #8208. * components/inline-expand - Last use removed in #6550 * components/jetpack-dialogue - Last use removed in #16518 * components/jetpack-logo - Last use removed in #20148 * components/jetpack-termination-dialog - Last use removed in #21048 * components/module-settings/index.jsx - Last use removed in #10644 * components/module-settings/inline-module-toggle.jsx - Last use removed in #12118 * components/screen-reader-text - Last use removed in #18843 * components/settings - Last use removed in 26315e1, I think * components/tags-input - Last use removed in #11772 Then there were a few more that were only used from some of the above: * components/data/query-connected-plugins * components/module-settings/form-components.jsx * components/multiple-choice-question * components/setting-toggle
Did a pass over _inc/client/components looking for things that weren't used anywhere, and found a bunch: * components/data/query-connect-url - Last use removed in #8014 * components/data/query-connection-status - Last use removed in 62e9ab0 * components/data/query-modules - Last use removed in bfc40ad * components/data/query-plugin-updates - Last use removed in #17003 * components/data/query-site-products - Last use removed in #21594 * components/form/* - Didn't check for last use, too many bits. But it looks like the `formsy-react` package many of these depended on wasn't even installed since #8208. * components/inline-expand - Last use removed in #6550 * components/jetpack-dialogue - Last use removed in #16518 * components/jetpack-logo - Last use removed in #20148 * components/jetpack-termination-dialog - Last use removed in #21048 * components/module-settings/index.jsx - Last use removed in #10644 * components/module-settings/inline-module-toggle.jsx - Last use removed in #12118 * components/screen-reader-text - Last use removed in #18843 * components/settings - Last use removed in 26315e1, I think * components/tags-input - Last use removed in #11772 Then there were a few more that were only used from some of the above: * components/data/query-connected-plugins * components/module-settings/form-components.jsx * components/multiple-choice-question * components/setting-toggle Co-authored-by: Brandon Kraft <public@brandonkraft.com>
Makes the components that use the connection URL, get the data from the initial state instead of attempting to fetch.
Problem here is that any given output or error that any other plugin putos on the php output will make the user not be able to connect. This is a general problem, but it's critical for us to at least allow the user to connect.
Fixes #7979
Changes proposed in this Pull Request:
connection
reducer react toJETPACK_SET_INITIAL_STATE
by loading thestate.jetpack.connectUrl
with the data coming from the server viawp_localize_script
.<QueryJetpackConnect />
because there's no more need for it.disconnectSite()
action also callfetchConnectUrl()
after disconnection is successful.Testing instructions:
href
.