Skip to content
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

Subscriptions Block: Remove logged in view for wpcom #18550

Merged
merged 6 commits into from
Feb 11, 2021

Conversation

apeatling
Copy link
Member

@apeatling apeatling commented Jan 26, 2021

Fixes #15474
Fixes #18085

Changes proposed in this Pull Request:

  • Remove the logged in view for WordPress.com so that the Subscriptions block always renders what is in the editor. When a user is logged in to WordPress.com they will still see the email subscription form and can subscribe as normal.
Before After

Does this pull request change what data or activity we track or use?

No

Testing instructions:

  • Apply D56029-code to your sandbox.
  • Apply this branch to a local Jetpack install
  • Confirm that this works correctly on WordPress.com based on testing instructions on D56029-code
  • Confirm the subscriptions form works on your Jetpack site still (you will need it to be a publicly accessible site via jurrassic.tube or ngrok) and the subscriptions Jetpack setting turned on.
  • Try subscribing and confirm that you can still subscribe to a site.

Proposed changelog entry for your changes:

  • Not needed.

@apeatling apeatling added [Feature] Subscriptions All subscription-related things such as paid and unpaid, user management, and newsletter settings. [Block] Subscriptions [Status] Needs Team Review labels Jan 26, 2021
@apeatling apeatling requested a review from a team January 26, 2021 18:54
@apeatling apeatling self-assigned this Jan 26, 2021
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello apeatling! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer and confirm D56029-code works as expected before merging this PR. Once this PR is merged, please commit the changes to WP.com. Thank you!
This revision will be updated with each commit to this PR

@jetpackbot
Copy link

jetpackbot commented Jan 26, 2021

Scheduled Jetpack release: February 16, 2021.
Scheduled code freeze: February 8, 2021

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Generated by 🚫 dangerJS against 5c61b44

@apeatling apeatling requested review from a team and removed request for a team January 26, 2021 19:07
@stacimc stacimc self-requested a review January 28, 2021 19:16
Copy link
Contributor

@stacimc stacimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On wpcom, I was able to see the subscription form both as a logged-in and a not-logged-in user.

When I submitted the form as a logged-in user, it worked as expected, and I received the follow up email at the address I used:
Screen Shot 2021-01-28 at 11 24 22 AM

However when I tested as a logged-out user, I got a message saying I was already subscribed (I made 100% sure the email I was using was not already subscribed), and received no email: <-- After rebuilding jetpack, this is no longer happening. It is now working for both logged-in and logged-out users.

@@ -108,11 +108,7 @@ function widget( $args, $instance ) {

self::render_widget_status_messages( $instance );

if ( self::is_current_user_subscribed() ) {
self::render_widget_already_subscribed( $instance );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checking -- is removing this already-subscribed view meant to be included with removing the logged-in view? If so, can we get rid of the now unused render_widget_already_subscribed function?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that would be a good idea. Done in 5c61b44

@apeatling
Copy link
Member Author

**Update -- I just tried this on a different sandboxed site, and it worked even as a logged-out user. I'm not sure what was different.

Just checked this on a sandboxed site, and it seemed to work okay logged in and logged out.

stacimc
stacimc previously approved these changes Jan 28, 2021
Copy link
Contributor

@stacimc stacimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested well for me on Jetpack, and the error I saw on wpcom for logged-out is working fine after a rebuild. LGTM!

@apeatling apeatling requested a review from a team January 28, 2021 20:18
@apeatling apeatling added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Team Review labels Jan 28, 2021
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linting errors will stop us from merging this I'm afraid.

@jeherve jeherve added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jan 29, 2021
@apeatling
Copy link
Member Author

apeatling commented Jan 29, 2021

The linting errors will stop us from merging this I'm afraid.

I think I'll need to mark to ignore these errors because removing these extra escapes was breaking the reg ex.

Edit: Wrong PR :)

@apeatling
Copy link
Member Author

I've added the jetpack textdomain since the ignore does not work. The wpautop() pre-existed this PR, but I can't escape html with this since, or remove it since it will break existing usage.

@apeatling apeatling added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Jan 29, 2021
@apeatling
Copy link
Member Author

@jeherve This one look good now?

@apeatling
Copy link
Member Author

Nevermind! Seeing one last lint error 🤦🏻 Fixing.

@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Feb 11, 2021
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. It's a big change for WordPress.com so I think it may be good to warn Happiness about the change, but I think it makes for a good change.

@@ -108,11 +108,7 @@ function widget( $args, $instance ) {

self::render_widget_status_messages( $instance );

if ( self::is_current_user_subscribed() ) {
self::render_widget_already_subscribed( $instance );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that would be a good idea. Done in 5c61b44

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Feb 11, 2021
@jeherve jeherve added this to the 9.5 milestone Feb 11, 2021
@apeatling apeatling merged commit 32919e1 into master Feb 11, 2021
@apeatling apeatling deleted the fix/subscription-block-alignment branch February 11, 2021 19:10
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Feb 11, 2021
@jeherve
Copy link
Member

jeherve commented Mar 4, 2021

r222134-wpcom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Subscriptions [Feature] Subscriptions All subscription-related things such as paid and unpaid, user management, and newsletter settings. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Touches WP.com Files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subscriptions Block: Unable to create logged-in centred layout Subscriptions Block: Improve different states
5 participants