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

Limit Classic editor access on Simple WP.com sites to existing Classic posts #15766

Merged
merged 17 commits into from
Apr 2, 2021

Conversation

guarani
Copy link
Contributor

@guarani guarani commented Feb 2, 2021

The next step after notifying users that the classic editor is going away is to actually remove it, starting with Simple sites.

I think this change doesn't warrant inclusion in RELEASE-NOTES.txt since we already notified users about this change in 16.9, but if anyone thinks differently I'd love to hear. Perhaps we could include it in release notes but exclude it from the App Store version notes.

Addresses wordpress-mobile/gutenberg-mobile#3092 (for iOS)

| The toggle switch |

This PR changes two things on Simple sites only:

  1. Remove the "Use block editor" toggle switch from My Site → Settings on Simple sites.
  2. Present the Gutenberg block editor when creating a new post, even on sites which had defaulted to Classic in the app by turning the – now removed – "Use block editor" toggle off.

To reiterate, the above changes only affect Simple sites. They do not affect Atomic sites, Jetpack-connect self-hosted sites, regular self-hosted sites, etc. The classic editor will still be used in in the iOS share extension.

To test

Note: The toggle switch referred to below is the "Use block editor" toggle switch found in My Site → Settings. This is only available to site admins.

  1. Using the app built from this branch, log into a WP.com account
  2. Choose a Simple site where you are an admin
  3. Verify that there is no toggle switch
  4. Using the current App Store version of the app – not the app built from this branch – log into the same WP.com account
  5. Choose the same Simple site where you are an admin, locate the toggle switch and turn it off (meaning use the classic editor)
  6. Moving back over to the app built from this branch – locate the same Simple site
  7. Create a new post and ensure that the block editor is shown (not the classic editor)

Regression notes (new ✨ )

I'm adding this section to try out @startuptester's proposal to improve code quality.

Potential unintended areas of impact (regressions)

This PR removes the classic editor on Simple sites. However, we're leaving it in place for scenarios where the block editor cannot be used instead. These scenarios are a) editing a classic post (i.e. a post that contains only classic content), and b) creating a post via the iOS share extension. We have to check to make sure these scenarios still work on Simple sites. We should also check to make sure all other site types (Atomic/Jetpack/self-hosted) are unaffected by this change.

What you did to manually test those/ what existing automated tests you relied on

I performed the following manual regression tests on a build made locally in Xcode from this branch. This is because one of the tests – the iOS sharing extension test – doesn't work on App Center builds (I get a "Sharing error" and I don't think it's related to the changes I've made in this PR, I've seen it before).

Regression test Simple sites

  1. Log into a WP.com account and choose a Simple site
  2. Locate an existing post that contains only classic content
  3. Open this post for editing and ensure that the classic editor is opened
  4. Background the app and open the Photos app
  5. Select a photo and share it to WordPress
  6. Verify that the classic editor opens as expected

Regression test Atomic sites

Our UI tests will ensure that Atomic sites still show a toggle switch and that the switch works, i.e. it controls the default editor on mobile (feel free to run the EditorAztecTests and EditorGutenbergTests UI tests locally in Xcode to check this). All that's left is to check that existing posts that contain classic content are opened in the classic editor:

  1. Log into a WP.com account and choose an Atomic site
  2. Locate an existing post that contains only classic content
  3. Open this post for editing and ensure that the classic editor is opened

Regression test Jetpack-connected self-hosted sites

  1. Log into a WP.com account in the app
  2. Choose a Jetpack-connected self-hosted site and verify
    • that there is a toggle switch
    • that the toggle switch still controls which editor is used for new posts
    • that existing posts that contain classic content are opened in the classic editor

Regression test self-hosted sites

  1. Log into a self-hosted site in the app where you are an admin (ensure you are using the "Enter your existing site address" option to log in)
  2. Verify
    • that there is a toggle switch
    • that the toggle switch still controls which editor is used for new posts
    • that existing posts that contain classic content are opened in the classic editor

What automated tests you added or what prevented you from doing so

Our current UI test suite includes tests for both the classic editor (a.k.a. Aztec) and the block editor (a.k.a Gutenberg). These tests run on just one site type: Simple sites. Now that classic is no longer an option for new posts on Simple sites, I updated the all UI tests to run on an Atomic site instead. This is was the easiest option to implement, but changes our entire UI test suite, so a less risky option could be to just update the classic editor tests to run on n Atomic site and leave the other UI tests to run on a Simple site as they currently do. We are disabling the Classic Editor tests until they can be migrated to executing on existing classic posts, instead of creating new ones. That work is tracked with this ticket here: #16218

PR submission checklist

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@guarani guarani requested a review from illusaen February 2, 2021 21:52
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Feb 2, 2021

You can test the changes on this Pull Request by downloading it from AppCenter here with build number: 44938. IPA is available here. If you need access to this, you can ask a maintainer to add you.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Feb 2, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@guarani guarani removed the request for review from illusaen February 3, 2021 20:41
@guarani guarani changed the title Remove editor switch for WP.com Simple sites Limit Classic editor access on Simple WP.com sites to existing Classic posts Feb 4, 2021
@guarani
Copy link
Contributor Author

guarani commented Feb 4, 2021

Build 41606

  • Test Simple WP.com sites do not show a toggle switch (used pschrottkydemo.wordpress.com)
  • Test Simple WP.com sites defaulted on mobile to Classic use Gutenberg for new posts (used pschrottkydemo.wordpress.com)
  • Regression test Atomic sites show a toggle switch (pschrottkyatomicsite1.blog)
  • Regression test Jetpack-connected self-hosted sites show a toggle switch (used striped-panda.jurassic.ninja)
  • Regression test self-hosted sites show a toggle switch (used dry-harp.jurassic.ninja)
  • Regression test Simple WP.com site users open existing Classic posts in the Classic editor (pschrottkydemo.wordpress.com)
  • Regression test Simple WP.com site users of the iOS share extension use the Classic editor (used pschrottkydemo.wordpress.com)

@guarani guarani marked this pull request as ready for review February 4, 2021 20:49
@guarani guarani requested a review from illusaen February 4, 2021 20:49
@guarani guarani added this to the 16.7 milestone Feb 4, 2021
@guarani guarani marked this pull request as draft February 5, 2021 16:17
@jkmassel jkmassel modified the milestones: 16.7, 16.8 Feb 8, 2021
@guarani guarani removed the request for review from illusaen February 22, 2021 17:43
@jkmassel
Copy link
Contributor

👋 We're freezing 16.8 today, so this PR is being bumped to 16.9. If you need this to be part of the 16.8 release, please merge it into the release/16.8 branch and DM me – I'll be happy to cut a new beta release!

@jkmassel jkmassel modified the milestones: 16.8, 16.9 Feb 22, 2021
@guarani guarani removed this from the 16.9 milestone Feb 22, 2021
guarani added 4 commits March 15, 2021 15:44
Remove the "Use block editor" setting from My Site → Settings on Simple WP.com sites. In light of the fact that the Classic editor is not available to users on on Simple WP.com sites (except via wp-admin), this PR brings the WordPress for iOS app closer to the web in terms of behavior.
Before this commit, when creating a new post the app would check the site's mobile editor preference (which is different to their web editor preference) and open the corresponding editor (Block editor or Classic editor).

With this commit we now do not look at the preference when the user creates a new post and we will now always use the Block editor in this scenario).
Simple sites are WP.com-connected non-Atomic sites.
On Simple WP.com sites, we no longer show the option to switch to classic. This is part of the classic deprecation/removal project.
@guarani guarani force-pushed the gutenberg/remove-classic-on-simple-sites branch from c4488f0 to 5f023ae Compare March 15, 2021 19:27
guarani added a commit that referenced this pull request Mar 17, 2021
A follow-up to #15766 to add the dismiss alert call to the other Aztec test. Otherwise tests could break if `testBasicPostPublish` is not run before `testTextPostPublish`.
guarani added a commit to wordpress-mobile/WordPressMocks that referenced this pull request Mar 18, 2021
The [classic editor is deprecated](wordpress-mobile/WordPress-iOS#16008) and is [now being removed](wordpress-mobile/WordPress-iOS#15766) for Simple sites (except when editing existing posts with classic content or when using the iOS share extension).

This means that on Simple sites, the site settings screen will no longer have a "Enable block editor" switch. WPiOS has a UI test suite, `EditorAztecTests`, that runs on a mock Simple site ("Tri-County Real Estate") and tests various features of the classic editor.

Since the classic editor is going away for Simple sites, I think it makes sense to make `EditorAztecTests` run on an Atomic site instead of a Simple site. On WPiOS, this mock site is used for all other UI tests, so this has the side-effect of switching all WPiOS UI tests to run on a mock Atomic site instead of a mock Simple site. The same could be true for WPAndroid and the same considerations might apply.
@guarani guarani added this to the 17.1 milestone Mar 18, 2021
@guarani
Copy link
Contributor Author

guarani commented Mar 19, 2021

  1. Using the app built from this branch, log into a WP.com account
  2. Choose a Simple site where you are an admin
  3. Verify that there is no toggle switch
  4. Using the current App Store version of the app – not the app built from this branch – log into the same WP.com account
  5. Choose the same Simple site where you are an admin, locate the toggle switch and turn it off (meaning use the classic editor)
  6. Moving back over to the app built from this branch – locate the same Simple site
  7. Create a new post and ensure that the block editor is shown (not the classic editor)

Tested build 44258 🟢 (if you need help testing this, please let me know and I'd be more than happy to help!)

@guarani
Copy link
Contributor Author

guarani commented Mar 20, 2021

  • Regression test Simple sites
  • Regression test Atomic sites
  • Regression test Jetpack-connected self-hosted sites
  • Regression test self-hosted sites

Tested commit e9cd034 locally 🟢

@cameronvoell cameronvoell force-pushed the gutenberg/remove-classic-on-simple-sites branch from 5ae5a7d to 82ecea5 Compare April 1, 2021 23:12
Copy link
Contributor

@cameronvoell cameronvoell left a comment

Choose a reason for hiding this comment

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

Verified test cases, and disabled Classic editor tests until we migrate them to testing existing classic posts

@cameronvoell cameronvoell requested a review from illusaen April 2, 2021 05:10
@cameronvoell
Copy link
Contributor

@illusaen I had to write some swift code, perhaps you can take a look so final review on this PR isn't just me approving my own code 🙏 .

@mchowning any feedback on issues or plan for disabling tests until they are migrated to existing classic posts would be welcome here as well. 🙇

@mchowning
Copy link
Contributor

Definitely not a blocker, but I wonder whether a change along the lines of what I suggested on the WPAndroid PR would also make sense here. If you both (@illusaen and @cameronvoell ) think it makes sense, would you be willing to make that change for us @illusaen ?

@@ -7,6 +7,10 @@ class EditorFlow {
}
}

static func goToMySiteScreen() -> MySiteScreen {
Copy link
Contributor

Choose a reason for hiding this comment

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

I do think it's a tad confusing that you changed the name from gotoMySiteScreen to goToMySiteScreen (see difference in capitalization in the first "T") but otherwise looks good!

@cameronvoell
Copy link
Contributor

cameronvoell commented Apr 2, 2021

Updates look good, thanks @illusaen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants