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

Gutenlypso: add convert to blocks dialog #29790

Merged
merged 4 commits into from
Jan 3, 2019
Merged

Conversation

vindl
Copy link
Member

@vindl vindl commented Dec 28, 2018

Changes proposed in this Pull Request

This will display convert to block dialog for old posts created in the Classic editor, once they are opened in Gutenlypso.

screenshot 2019-01-01 at 10 34 03

Testing instructions

  1. Create a post in Classic editor that contains a couple of paragraphs and images for example.
  2. Opt in to Gutenberg editor.
  3. Open the post from step 1 and verify that dialog is shown.
  4. Click on Cancel and verify that the dialog is no longer showing.
  5. Reload the page.
  6. Click on Convert to Blocks and verify that Classic block content has been properly converted.

Note 1: One known issue is that if you start writing a new post in Gutenberg and you add the Classic block first, the dialog will pop up. This won't happen if some other block is inserted first (e.g. paragraph).

Note 2: We might want to request editorial review if you think the messages could be improved.

Note 3: Since I'll be AFK in the following period, feel free to update this PR and land it as you see fit.

Fixes #26594

@vindl vindl added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Task [Goal] Gutenberg Working towards full integration with Gutenberg labels Dec 28, 2018
@vindl vindl self-assigned this Dec 28, 2018
@matticbot
Copy link
Contributor

@vindl vindl requested a review from a team December 28, 2018 16:58
@Copons Copons self-assigned this Dec 31, 2018
@Copons
Copy link
Contributor

Copons commented Dec 31, 2018

Note 1: One known issue is that if you start writing a new post in Gutenberg and you add the Classic block first, the dialog will pop up. This won't happen if some other block is inserted first (e.g. paragraph).

I took the liberty of adding an isDirty check, and avoiding rendering this component altogether if the post is dirty.
The idea is that we only want to show the "Convert to blocks" dialog when we open a post created with the Classic editor, or in other words: when the editor first loads it.

Adding a Classic block even as first thing, it would make the post dirty, automatically preventing the dialog to show.

@Copons Copons requested a review from a team December 31, 2018 16:07
@Copons
Copy link
Contributor

Copons commented Dec 31, 2018

@Automattic/editorial I've pinged you for suggestions regarding the message of this dialog:

This post uses content from the old editor

For the best editing experience we suggest that you convert old content to blocks.

@michelleweber
Copy link

Suggested update -- I'd also recommend adding a little instruction to help people get started:

This post contains content you created using the older editor. For the best editing experience, we recommend converting this content to blocks -- instructions here.

(The instruction could be something like "click the X to get started" or "try adding a text block" or whatever makes the most sense given what's on the screen.)

@gwwar
Copy link
Contributor

gwwar commented Dec 31, 2018

@michelleweber For context we want them to click the CTA button which looks like this:
screen shot 2018-12-31 at 3 02 18 pm

@gwwar
Copy link
Contributor

gwwar commented Dec 31, 2018

I wonder if we should help preview what the convert looks like, or make it really easy to undo changes. I'm going to ask for more design feedback and testing. Waiting on feedback in p7jreA-22i-p2

@michelleweber
Copy link

Got it. That's super clear, thanks. So:

Ready to try blocks?

This post contains content you created using the older editor. For the best editing experience, we recommend converting this content to blocks.

@Copons
Copy link
Contributor

Copons commented Jan 1, 2019

I've updated the copy (and the screen in the PR description as well).

@gwwar re: your comment in p7jreA-22i-p2

make it easy to undo this

This already is the case: the conversion consist of a single action, so folks can just hit the undo button (once) to fully restore the Classic block.

Though, I've added a little enhancement so that clicking on Convert too dismisses the dialog (as opposed to just closing it temporarily).
Without this enhancement, undoing the conversion would have displayed the dialog again.

The dismissal is not stored, so reopening the editor on the same post will display the dialog again, which imho is the correct behaviour.

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.

LGTM 👍

vindl and others added 4 commits January 2, 2019 13:16
This will display convert to block dialog for old posts created
in the Classic editor, once they are opened in Gutenlypso.
@Copons Copons force-pushed the add/gutenlypso-convert-blocks branch from 4ffcd37 to 345f2a9 Compare January 2, 2019 13:17
@gwwar
Copy link
Contributor

gwwar commented Jan 2, 2019

Sounds like folks think this is a good idea 👍

Let's maybe try getting this in, and following up in other PRs on:

@Copons Copons merged commit c08f637 into master Jan 3, 2019
@Copons Copons deleted the add/gutenlypso-convert-blocks branch January 3, 2019 11:32
@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 Jan 3, 2019
blowery added a commit that referenced this pull request Jan 3, 2019
…sh-2019

* origin/master:
  Disable select when only one domain exiists (#29873)
  Tiled galleries: Disable captions (#29776)
  Prevent scrolling up when opening a dialog (#29832)
  Gutenberg: Move Shortlinks to production (#29883)
  Gutenlypso: add convert to blocks dialog (#29790)
  Gutenberg: Move Related Posts to production blocks (#29650)
  Analytics: fix ad-tracking issue on signup for non-gdpr countries (#29741)
  Update mobile phone validation module (used for 2fa) (#29740)
  Gutenlypso: make sure titles load on second edit (#29877)
  Site Picker: Change wording of /page and /block-editor to match /post (#29859)
  Gutenberg: update copy link in page list to be editor aware
  Gutenberg: use core approach of initialEdits over overridePost
  Gutenberg: when duplicating a post, override post content
  Gutenberg: update duplicate url when Gutenlypso is enabled
  Refactor: Replace use of key-mirror with inline code (#29857)
  Fixes wrong selected domain name (#29824)
  Turn off prettier for SASS, use stylelint instead (#29697)
  Gutenberg: Add copy button to Shortlinks (#29556)
  add a section name to the body class (#29563)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Type] Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants