Jetpack Settings: Introduce a Publishing Tools card under Writing #10663

Merged
merged 11 commits into from Jan 27, 2017

Projects

None yet

8 participants

@tyxla
Member
tyxla commented Jan 16, 2017 edited

Introduction

This PR is part of #9171. It introduces a Publishing Tools card under Writing Settings. This card will be used to manage the settings of the Post by Email module, and will also shelter the Press This block.

Preview

Post by Email disabled

Post by Email enabled

Post by Email enabled, regenerating

Testing

  • Checkout this branch.
  • Select one of your Jetpack sites that has Jetpack 4.5 or newer.
  • Go to /settings/writing/$site, where $site is the slug of your Jetpack site.
  • Verify the Publishing Tools card is displayed properly as shown on the previews.
  • Play with the main toggle that toggles the Post by Email module, and verify it saves correctly in your Jetpack site.
  • Verify that the Post by Email settings are displayed only when the Post by Email module is active.
  • Try copying the email address and verify it works properly.
  • Click "Regenerate Address" and verify it disables just the Post by Email form and nothing else. Verify it loads a new email shortly after.
  • Verify the link of the info popover is working as expected and lead to the right place.
  • Test with a Jetpack site with Jetpack 4.4.2 or older and verify the card is not shown.
  • Test with a WordPress.com site and verify that the card is not shown at all,
  • Test with a WordPress.com site and verify that the Press This block is shown as a separate card.

Final notes

This PR has borrowed the Redux functionality from #10811, but I'll remove it once #10811 is merged.

@tyxla tyxla self-assigned this Jan 16, 2017
@oskosk oskosk referenced this pull request Jan 16, 2017
Open

Implement Jetpack Module Settings #9171

51 of 56 tasks complete
+ <div className="publishing-tools__info-link-container">
+ <InfoPopover position={ 'left' }>
+ <ExternalLink icon={ true } href={ 'https://jetpack.com/support/post-by-email/' } target="_blank">
+ { translate( 'Learn more about Post by Email' ) }
@a8ci18n
a8ci18n Jan 16, 2017

Alternate string suggestion:

  • translate( 'Learn more about Email Forwarding' )— translations: 25.

PR translation status page

+ >
+ { isFormPending
+ ? translate( 'Regenerating…' )
+ : translate( 'Regenerate address' )
@a8ci18n
a8ci18n Jan 16, 2017

Alternate string suggestion:

  • translate( 'Regenerate' )— translations: 38.

PR translation status page

+ disabled={ isFormPending }
+ >
+ { isFormPending
+ ? translate( 'Regenerating…' )
@a8ci18n
a8ci18n Jan 16, 2017

Alternate string suggestion:

  • translate( 'Regenerate' )— translations: 38.

PR translation status page

+ } = this.props;
+
+ return (
+ <SectionHeader label={ translate( 'Publishing Tools' ) }>
@a8ci18n
a8ci18n Jan 16, 2017

Alternate string suggestion:

  • translate( 'Additional tools that make creating and publishing your content easy:' )— translations: 3.

PR translation status page

+ <div className="publishing-tools__info-link-container">
+ <InfoPopover position={ 'left' }>
+ <ExternalLink href={ 'https://jetpack.com/support/post-by-email/' } target="_blank">
+ { translate( 'Learn more about Post by Email' ) }
@a8ci18n
a8ci18n Jan 20, 2017

Alternate string suggestion:

  • translate( 'Learn more about Email Forwarding' )— translations: 25.

PR translation status page

+ >
+ { regeneratingPostByEmail
+ ? translate( 'Regenerating…' )
+ : translate( 'Regenerate address' )
@a8ci18n
a8ci18n Jan 20, 2017

Alternate string suggestion:

  • translate( 'Regenerate' )— translations: 38.

PR translation status page

+ disabled={ isFormPending || regeneratingPostByEmail }
+ >
+ { regeneratingPostByEmail
+ ? translate( 'Regenerating…' )
@a8ci18n
a8ci18n Jan 20, 2017

Alternate string suggestion:

  • translate( 'Regenerate' )— translations: 38.

PR translation status page

@roccotripaldi

A few things:

  • i haven't worked a lot with post-by-email, so i was a little surprised that it defaults to an empty field even though the module is active. but that seems to be expected, as it also happens

  • also, generating a new email address works as expected. BUT, when i switch to an other site using the site picker, the post-by-email settings load up with the same email generated for the previous site. we need to fix that.

@MichaelArestad
Contributor

Looks great!

@tyxla
Member
tyxla commented Jan 24, 2017

i haven't worked a lot with post-by-email, so i was a little surprised that it defaults to an empty field even though the module is active. but that seems to be expected, as it also happens

Yes, I realize this might be not the most intuitive UI for the case when the module is activated but there is no email generated yet.

@MichaelArestad what can we do to improve this? I have several ideas - when you initially activate Post by Email, or it's activated but email is not generated:

  • Add a notice/nudge below the module toggle that would say something like "You need to generate an email address - click here to do it".
  • Change the button from "Regenerate" to "Generate".
  • Hide the ClipboardButtonInput when there's no email generated yet.

We can use one or more of these, @MichaelArestad what do you think? Marking as "Needs Design Review" again.

also, generating a new email address works as expected. BUT, when i switch to an other site using the site picker, the post-by-email settings load up with the same email generated for the previous site. we need to fix that.

Good catch, thanks for that! It appears we were handling null emails incorrectly. I've fixed this in 5067999

@roccotrip this one is ready for a new code review, too.

@folletto
Member

but that seems to be expected, as it also happens

what can we do to improve this?

I'll wait for Michael's word on this, but... can't we just generate it automatically if the field is empty, showing a pulsating skeleton while the email gets generated? Maybe I'm missing some step here, but experience wise I would expect to just get the email.

@tyxla
Member
tyxla commented Jan 24, 2017

@folletto the problem with automatic generation upon activating is that it wouldn't help for a most of the cases. The Post by Email module is enabled by default with Jumpstart. So for most of the people who are not actively using that module, it will probably already be active, but without an email generated.

@folletto
Member
folletto commented Jan 24, 2017 edited

The Post by Email module is enabled by default with Jumpstart. So for most of the people who are not actively using that module, it will probably already be active, but without an email generated.

Ok three things then...

  1. Can we generate it at Jumpstart then?
  2. Can we auto-generate once the person hits that page for the first time ("if the page loads with no email, we trigger the generation automatically" condition)?
  3. So the most likely situation is "already active with empty field"? In that case maybe we can change the default empty text label to "click Generate to get your post-by-email address" (or something)?
@rickybanister
Member
rickybanister commented Jan 24, 2017 edited

Why is there a save button here? There's nothing to save. Clicking 'regenerate' creates the email, presumably it's already active and working at that point.

I also feel like we could improve the button layout between 'copy' and 'regenerate'. Or at least we can create a standard for the 'copyable field' since I think there may be other implementations of that floating around.

@rickybanister
Member

One other thought—we are 'hiding' rather than 'disabling' the post by email sub-settings. Since we've decided to disable the subsettings rather than hide for other settings cards, we should do the same here—display the email field in a disabled state.

@roccotripaldi
Member

Thanks for the fix, looks good to me!

@tyxla
Member
tyxla commented Jan 25, 2017

Can we auto-generate once the person hits that page for the first time ("if the page loads with no email, we trigger the generation automatically" condition)?

@folletto I've chosen this solution - if there is no email, but the module is active, email not regenerating currently and it hasn't been generated yet, this will trigger a new regeneration of the email. Seems to be the painless solution for affected users, as it does not bother them at all. It appears to work fine for my tests, but I'd appreciate some more 👀 - @roccotripaldi would you like to test that too?

@tyxla
Member
tyxla commented Jan 25, 2017

Why is there a save button here? There's nothing to save. Clicking 'regenerate' creates the email, presumably it's already active and working at that point.

Good point, I've removed the "Save Settings" button completely.

I also feel like we could improve the button layout between 'copy' and 'regenerate'. Or at least we can create a standard for the 'copyable field' since I think there may be other implementations of that floating around.

@rickybanister I'm using a <ClipboardButtonInput /> here, and the regenerate button is below it. There is one case in Google Adwords credit where we use a similar layout:

As you can see, the button below is primary (blue), so perhaps it makes sense to change the "Regenerate Address" button to a primary one? @MichaelArestad do you have any thoughts on this one?

@tyxla
Member
tyxla commented Jan 25, 2017

One other thought—we are 'hiding' rather than 'disabling' the post by email sub-settings. Since we've decided to disable the subsettings rather than hide for other settings cards, we should do the same here—display the email field in a disabled state.

@rickybanister Thanks for the suggestion, sub-settings will now be disabled when the module is disabled, here is a preview:

@tyxla
Member
tyxla commented Jan 25, 2017 edited

All concerns so far have been addressed. This one needs another design and code review.

/cc
@MichaelArestad @rickybanister @folletto for a new 👁 on design;
@roccotripaldi for a final code review, since I changed several things.

@folletto
Member

Seems to be the painless solution for affected users, as it does not bother them at all.

👍

@rickybanister
Member

My only thought is whether the Email Address label should also get some kind of dimming effect to match the disabled fields and buttons. I mentioned something similar for the Related Posts 'Preview' area.

@MichaelArestad what do you think, should we dim everything that's disabled including labels and previews?

@roccotripaldi
Member

LGTM!

@MichaelArestad
Contributor

@rickybanister Not previews (there's only one, right), but definitely dim the labels.

@tyxla
Member
tyxla commented Jan 26, 2017

@MichaelArestad @rickybanister I've updated the label to be dimmed when the toggle is disabled, here is an updated preview of the disabled state:

If you feel this is ready to go, you can mark it as "Ready to Merge", as code has already been approved.

+
+ return (
+ <div>
+ <SectionHeader label={ translate( 'Publishing Tools' ) } />
@a8ci18n
a8ci18n Jan 26, 2017

Alternate string suggestion:

  • translate( 'Additional tools that make creating and publishing your content easy:' )— translations: 3. ES Score: 5.05

PR translation status page

+ >
+ { regeneratingPostByEmail
+ ? translate( 'Regenerating…' )
+ : translate( 'Regenerate address' )
@a8ci18n
a8ci18n Jan 26, 2017

Alternate string suggestion:

  • translate( 'Regenerate' )— translations: 38. ES Score: 9.10

PR translation status page

@yoavf
yoavf Jan 26, 2017 Member

@tyxla why 👎 ? Can't "Regenerate" substitute for "Regenerate address"?

@tyxla
tyxla Jan 26, 2017 Member

Thanks for dropping by, @yoavf! Well, we can, but it will probably not be specific enough. @MichaelArestad do you think we can replace it with the suggested one? I'm fine with replacing it, but didn't want to deviate from the design mockups.

@yoavf
yoavf Jan 26, 2017 edited Member

Oh, you definitely don't have to switch - I'm just hoping to use the 👍 and 👎 to judge the perceived quality of the suggestions. 👎 is more for cases when a suggestion doesn't make sense at all :)

@tyxla
tyxla Jan 26, 2017 Member

Sorry for the confusion @yoavf - it totally makes sense here, so removing the 👎 .

@MichaelArestad
MichaelArestad Jan 26, 2017 Contributor

@yoavf @tyxla This suggestion is close, but I think the full "Regenerate address" is needed for this one as it's kind of a confusing thing without it.

@MichaelArestad
Contributor

LGTM @tyxla Nice work again!

@rickybanister
Member

The dimmed label looks much better. Let's make sure we do that same treatment for all other settings with any sort of preview or example.

@tyxla tyxla merged commit 9208d11 into master Jan 27, 2017

2 checks passed

ci/circleci Your tests passed on CircleCI!
Details
ci/i18n Total: 5 strings (3 new). Translations: 40% coverage.
Details
@tyxla tyxla deleted the add/jetpack-settings-publishing-tools-card branch Jan 27, 2017
@MichaelArestad
Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment