Fix Unsupported Block Editor on Accounts Created Prior to December 2018#14762
Conversation
The `/sites/{site_id}/gutenberg` endpoint is unreliable (see wordpress-mobile/gutenberg-mobile#3425 (comment)) but was being used to disable the UBE on sites where Gutenberg was unavailable.
Since most users will have Gutenberg enabled in this scenario, it makes sense to remove usage of this API endpoint and just show a failure state if Gutenberg is unavailable. The failure state will show information on how to fix the error (i.e. enable Gutenberg on the site).
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
|
You can test the changes on this Pull Request by downloading the APKs: |
|
@hypest, I wanted to check in with you for help on the approach to take for editing the progress and failed screens. There are two options that I see:
Does either approach stand out to you as being preferable to the other? Looking forward to hearing your opinion! Slack thread for reference: p1623681835423800-slack-C6UJ0KRKQ |
|
Thanks for writing out the two options there in the PR comment, @SiobhyB! On the one hand, I'd like to update the iOS side to implement the new "loading screen" in the Gutenberg repo instead of WPiOS, in order for both the main WPiOS app and the demo app to have the loading screen. On a related note: As mentioned in p1624302343053500/1623681835.423800-slack-C6UJ0KRKQ, the demo app currently differs between iOS and Android with regard to the progress bar. If you run the Android demo app, the UBE shows a progress bar (thin blue line under the navigation bar) by way of a system (I think if WPAndroid were to change its progress bars app-wide at some point in the future, the UBE's progress bar would be difficult to update because it relies on an implementation that resides in Gutenberg instead of the main app.) |
|
It seems like there's a trade-off here where some parts of the editor UI can be implemented in either the Gutenberg repo or the main apps. |
|
👋 thanks for the analysis @SiobhyB and @guarani, and the ping. The demo app is not trying to be the reference implementation and it should be fine to differ from the WP apps, including having slightly different implementation details between the platforms or no implementation at all. In other words, I wouldn't try too hard to keep the implementations exactly aligned. In our case with the progress bar, I'd try to follow the implementation already there in each platform, without spending much more effort on it. We can kick off a refactor to align if we see the need. Does that help? |
|
👋 Thanks for sharing your thoughts here, @hypest! It sounds our current approach, which is differs slightly implementation-wise between Android and iOS, is the best approach for now. @SiobhyB, if you agree, I will merge wordpress-mobile/WordPress-iOS#16586 today which will be included in the 17.7 release cut next Monday. |
|
@hypest, thank you for that insight, it's helpful to know that small implementation differences between the two platforms are okay. It sounds like we went with the best approach, by following the progress bar here. 🎉
Sounds great to me, @guarani! I'll mark my PR chain as ready for review today too. @hypest, would you have time to review this this week? If so, I'll request you as the reviewer when the PRs are green. :) Thanks in advance! |
Ah, let's default to finding someone else besides me for the time being. I might be able to have a look on Thursday/Friday otherwise, thanks for checking @SiobhyB ! |
Sure thing! @AmandaRiu, would you possibly have some time for reviewing this PR this week? |
…s-mobile/WordPress-Android into gb/3425-remove-ube-editor-check
No problem, I'll take a look at it today! 👍 |
…s-mobile/WordPress-Android into gb/3425-remove-ube-editor-check
0d040de to
69b2bcc
Compare
If the 'unsupportedBlockEditorSwitch' boolean evaluates to 'true', it will display an option to sign in via SSO when attempting to access the UBE. As the boolean was only checking for whether SSO is already enabled, it was evaluating to 'true' for self-hosted sites that didn't have Jetpack. This caused the issue outlined here: WordPress/gutenberg#32395 (review) With this commit, an extra check is added to ensure this boolean only evaluates to 'true' when a site is actually a Jetpack site.
AmandaRiu
left a comment
There was a problem hiding this comment.
Code reviewed and works great! Tested the following scenarios and all passed:
- TC001 - User can edit unsupported blocks on Simple WP.com sites
- TC002 - User can discard edits to an unsupported blocks on Simple WP.com sites
- TC003 - Editing unsupported blocks is allowed on Gutenberg-enabled Atomic sites
- TC004 - Editing unsupported blocks is disallowed on Classic-enabled Atomic sites
- TC005 - Editing unsupported blocks is enabled on self-hosted sites accessed via Jetpack
- TC006 – Editing unsupported blocks is disallowed on self-hosted sites accessed via their own username and password
Once the conflict is resolved, this will be ready for merge ![]()
Fixes the Android side of wordpress-mobile/gutenberg-mobile#3425
gutenberg: WordPress/gutenberg#32395gutenberg-mobile: wordpress-mobile/gutenberg-mobile#3573Description
The
/sites/{site_id}/gutenbergendpoint is unreliable but was being used to check if Gutenberg was available on a site's backend, and if so, disable the Unsupported Block Editor (UBE).Since the majority of users will have Gutenberg enabled, it makes sense to remove usage of this unreliable API endpoint. That's done by removing the check for the Gutenberg editor in this PR.
To account for the removal, the loading and failed screens are updated in the Gutenberg PR.
Testing
To verify that the UBE now loads for Jetpack sites on an account created prior to December 2018:
The UBE test cases outlined here were used as a guide for further testing:
When going through each test case, verify that the following is true:
TC004, the failed screen is displayed to users after the progress screen has been visible for 10 seconds.Regression Notes
This could somehow cause issues with the Unsupported Block Editor loading, so it's important to test this across all site types.
Manual testing was carried out, following the steps outlined in the Gutenberg PR.
This PR adds a loading screen that relies on the underlying network request, which seems tricky to account for using automated tests.
PR submission checklist:
RELEASE-NOTES.txtif necessary.