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

Premium Content: Remove double banners #46659

Merged
merged 5 commits into from
Oct 29, 2020

Conversation

apeatling
Copy link
Member

@apeatling apeatling commented Oct 21, 2020

Changes proposed in this Pull Request

Update the premium content block to remove the Stripe connect banner, and the subscriber/non subscriber banner. Doing this means there is no persistent block UI in the canvas, improving the design experience for patterns using this block. These two banners have been merged into the block toolbar for the block.

Before After
Multiple "banners" when selecting the block. Options from the old banners merged into the block toolbar.
Screen Shot 2020-10-21 at 1 10 53 PM Screen Shot 2020-10-21 at 1 11 47 PM

Testing instructions

  • Check out this branch locally and run yarn dev --sync in the wp-calypso/apps/editing-toolkit directory
  • Open up a site on your sandbox and insert the premium content block.
  • Confirm that you see the "After" UI above.
  • Confirm that you can connect stripe and the "Connect Stripe" button disappears.
  • Confirm that you can switch back and forth between the Visitor, and Subscriber views.
  • Confirm that you can edit blocks in both views.

Fixes https://github.com/Automattic/view-design/issues/84
cc @ianstewart

@apeatling apeatling added Premium Content Controlling specific content for paying site visitors. Editing Toolkit For issues and PRs that affect the Editing Toolkit plugin labels Oct 21, 2020
@apeatling apeatling requested a review from a team October 21, 2020 20:16
@apeatling apeatling self-assigned this Oct 21, 2020
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Oct 21, 2020
@matticbot
Copy link
Contributor

@apeatling apeatling requested a review from a team October 21, 2020 20:21
@apeatling
Copy link
Member Author

Adding in serenity for possible review since they've worked or are actively working on this block also.

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

} }
className="connect-stripe components-tab-button"
>
{ __( 'Connect Stripe', 'full-site-editing' ) }
Copy link

Choose a reason for hiding this comment

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

ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 28 times:
translate( 'Stripe Connection' ) ES Score: 6

</span>
<span className="premium-content-block-nudge__message">
{ __(
'This block will be hidden from your visitors until you connect to Stripe.',
'Premium content will be hidden from your visitors until you connect to Stripe.',
Copy link

Choose a reason for hiding this comment

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

🆗 This change will be queued for retranslation. We'll use the existing translations in the meantime.

@matticbot
Copy link
Contributor

Caution: This PR affects files in the Editing Toolkit Plugin on WordPress.com
Please ensure your changes work on WordPress.com before merging.

D51610-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing the Editing Toolkit Plugin for more info: PCYsg-ly5-p2

Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

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

I'm so excited to see this coming!

I quickly tested this and noticed that the block toolbar is not visible after inserting the block, making impossible to switch views. I had to select the block using the block navigation menu from the header in order to see the block toolbar. Is this expected?

Oct-22-2020 16-51-27

@blackjackkent
Copy link
Contributor

Oh, man, this is a great UI improvement overall!

I am seeing the same thing Miguel sees...it definitely makes for a slightly confusing user experience. 🤔 I also am only seeing "Connect" instead of "Connect Stripe" on the block-level controls; not sure if this is the desired text or not. (I think "Connect Stripe" is probably clearer.)

image

@apeatling
Copy link
Member Author

apeatling commented Oct 22, 2020

Thanks for the reviews! It should definitely show the the parent block toolbar on first insert, I will check that and see what's going on. As a follow up to this I'll also be working on persisting the parent navigation bar in some way (see https://github.com/Automattic/view-design/issues/94). Right now the user would need to hover over the child block icon, and select the parent block icon that pops up.

@apeatling
Copy link
Member Author

@mmtr I made some tweaks. Can you try the block focus again? This is what I get on my sandbox:

2020-10-26 12 05 19

@apeatling
Copy link
Member Author

@blackjackkent Did you have the latest version? I'm not able to reproduce the "Connect" vs "Connect Stripe" text. It should always be "Connect Stripe".

@kwight
Copy link
Contributor

kwight commented Oct 27, 2020

Can you try the block focus again?

Works well for me!

2020-10-27 12 52 11

@sixhours
Copy link
Contributor

This is working for me in testing, but I have concerns about the subtlety of the Stripe connection component with this change.

It's not obvious that the toolbar is a call to action and a required first step for making this block work. A user can publish a post with a Premium Content block that has not been connected to Stripe and there's no warning or messaging; the block simply does not appear on the front end. I worry this makes it look broken and will generate more support requests for an already confusing block.

@apeatling
Copy link
Member Author

@sixhours I totally agree re: front end. I have a follow up issue for this. https://github.com/Automattic/view-design/issues/95 What I will do is add a message in the front end about connecting Stripe if this has not been done.

There's a few issues that I'm coming straight back to this sprint, I'm just trying to break them out into separate PRs.

@blackjackkent
Copy link
Contributor

@apeatling No idea why I was just seeing "Connect" before but it looks fine now!

Re @sixhours 's comment -- is there a way to give the button a color highlight? (maybe red text or something like that?) That way it would draw the eye a little more.

Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

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

Awesome, it works great now!

It's not obvious that the toolbar is a call to action and a required first step for making this block work. A user can publish a post with a Premium Content block that has not been connected to Stripe and there's no warning or messaging

I share this concern too. Do we have any other block that includes a required action in the block toolbar? I have the feeling that the block toolbar has always being used for customizing the block, so I'm not sure if users will be aware that they have to click on that action in order to make the block work.

Anyway, this dramatically improves the UX in other aspects so I don't want to block changes here due to that. But if we notice there is a spike if published posts containing Premium Content blocks without a Stripe connection, we should reconsider bringing back the Stripe nudge.

Comment on lines +342 to +348
const shouldShowConnectButton = () => {
if ( ! shouldUpgrade && apiState !== API_STATE_CONNECTED && connectURL ) {
return true;
}

stripeNudge = <StripeNudge { ...props } stripeConnectUrl={ stripeConnectUrl } />;
}
return false;
};
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick and non-blocking: This can be simplified to

const shouldShowConnectButton = () => ! shouldUpgrade && apiState !== API_STATE_CONNECTED && connectURL;

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I'll fix this in a followup PR.

@apeatling
Copy link
Member Author

Thanks for the reviews. I'm going to work on the call to action, and communicating that Stripe connection is required in follow up PRs. 👍

@apeatling apeatling force-pushed the update/premium-content-block-editing-ui branch from ab2a951 to 85b700b Compare October 29, 2020 14:40
@apeatling
Copy link
Member Author

✅ Rebased.

@apeatling apeatling merged commit dcca967 into master Oct 29, 2020
@apeatling apeatling deleted the update/premium-content-block-editing-ui branch October 29, 2020 16:36
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Oct 29, 2020
@a8ci18n
Copy link

a8ci18n commented Oct 29, 2020

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/5067016

Thank you @apeatling for including a screenshot in the description! This is really helpful for our translators.

ciampo pushed a commit that referenced this pull request Nov 2, 2020
Release 2.8.3:

* Editor close button should deal with situation where experimental GB feature is unavailable (#46666)
* Premium Content: Remove double banners (#46659)
* Premium Content: Add missing migrations for margin fix (#46924)
* Editing Toolkit: Add a workaround to prevent slider blocks breaking the editor at full width (#46951)
* Focused Launch: added WIP Focused Launch modal behind a flag (#46686)
@a8ci18n
Copy link

a8ci18n commented Nov 9, 2020

Translation for this Pull Request has now been finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Editing Toolkit For issues and PRs that affect the Editing Toolkit plugin Premium Content Controlling specific content for paying site visitors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants