-
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
People: Accept invite by email subscription only #1190
Conversation
585599a
to
1498536
Compare
Note: we'll need to add the |
@@ -6,11 +6,12 @@ import page from 'page'; | |||
/** | |||
* Internal dependencies | |||
*/ | |||
import { acceptInvite } from './controller'; |
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.
Personally I find it more beautiful { acceptInvite, saveSubscriptionActivationKey }
instead of importing controller
This is looking good :) |
@lezama thanks for the review. I've address all your feedback. I'm going to look into changing the redirect, and try to do it in this PR. To clarify, we should redirect to subscribe.wordpress.com/?update=activated&email=$email&key=$key I think it may be possible to return the latest key on the API after the subscription is activate. |
I changed my mind. In keeping more with the current way we do things, I decided to add the 3rd key to the URL. so now we'll have All other invites will only have $invite_key |
@@ -10,14 +10,19 @@ import i18n from 'lib/mixins/i18n'; | |||
import titleActions from 'lib/screen-title/actions'; | |||
import InviteAccept from 'my-sites/invites/invite-accept'; | |||
|
|||
export function acceptInvite( context ) { | |||
titleActions.setTitle( i18n.translate( 'Accept Invite', { textOnly: true } ) ); | |||
export 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.
this could be export function acceptInvite(
cd45a52
to
34261a9
Compare
@lezama - i did an other iteration taking your feedback into account. For now, because of API limitations, I'm keeping all 3 keys in the URL In another PR, we can clean up the URL by perhaps doing something like the signup flow is using, |
Perhaps i'm misunderstand, but an API limitation doesn't necessarily impact whether we do
|
React.createElement( InviteAccept, context.params ), | ||
React.createElement( | ||
InviteAccept, | ||
context.params |
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.
My guess is that if we moved to using GET
parameters, the heavy lifting would be done here. In this method we would get the GET
parameters above (See what I did there 😛 👓 ) and then we would do the page.replace()
or similar.
The only other change I think we would need is updating the route in my-sites/invites/index.js
to be '/accept-invite/:site_id/:invitation_key
.
Object.assign( invite.invite, { | ||
activationKey: this.props.activation_key, | ||
authKey: this.props.auth_key | ||
} ); |
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 was wondering if you had changed the endpoint to add the activationKey
. But, now I see where you added it 😄
Functionally, this seemed to work well. The only issue I noticed is that after clicking the "Follow by email subscription only" link, there was a lag of a second or two before I was redirected without the UI updating. Perhaps, we could do something similar to #1237 and disable the form once that link is clicked? |
- Render a footer link to accept a follower invite by email subscription only. - modifying the route to accept a subscription activation key and a subscription auth key via url context - Updating wpcom undocumented to add an activation to the request so that we can accept follower invites by email only. - redirect user to subscribe.wordpress.com with their auth key so they can view / manage their subscription
34261a9
to
57ae744
Compare
Thanks for the review Eric. I addressed all your feedback. I was already doing https://github.com/Automattic/wp-calypso/pull/1190/files#diff-c1058d9fea1b7d007377a2a1e78a3cccR377 |
The disabling looks good to me! I am getting a JS error after accepting an invite and then going back to My guess is that it's related to this block in refreshInvite(). We should probably wrap that in an: if ( ! error ) {
// Do work
} |
People: Accept invite by email subscription only
closes #668
This PR adds a footer link to the logged out invite accept, allowing an invited user to follow a blog by email subscription only.
To Test
cc: @lezama @ebinnion