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

Update is_fse_active to utilize FSE helper function #13449

Merged
merged 1 commit into from
Sep 9, 2019

Conversation

noahtallen
Copy link
Contributor

@noahtallen noahtallen commented Sep 6, 2019

This past week, we added a helper function to FSE which tells us when FSE is active on a site (which has now been deployed). I'm currently updating our API work to use this function, as it centralizes most of the logic needed! (Including all of the previous checks in this function.) Now we'll be able to update anything necessary without having to modify a bunch of API endpoints all the time. (yay!)

This is a bit of a followup to #13392. Testing instructions are practically the same as in that PR since behavior should be identical.

Changes proposed in this Pull Request:

  • Uses \A8C\FSE\is_full_site_editing_active(); to replace logic in is_fse_active endpoint.
  • From the user's pov, there is no functional change with this PR. It simply improves code quality :)

Testing instructions:

  1. Create a jurassic ninja site with this branch: https://jurassic.ninja/create/?branch=update/use-fse-active-helper-function-in-plugin. (also connect it to jetpack so you can see it in Calypso)
  2. Before doing anything, use the api console to make sure that is_fse_active is false without the plugin installed. We're using the endpoint /sites/abc.jurassic.ninja
  3. Install the Full Site Editing Plugin, Gutenberg development plugin and activate both
  4. Check to make sure that is_fse_active is still false
  5. Using calypso (URL like https://wordpress.com/themes/abc.jurassic.ninja), activate the "Maywood" theme
  6. Now, in the console, is_fse_active should be true.
  7. Verify that you can see the FSE editor by editing a page.
  8. Add the following filter to the site, can be done easily in the plugin editor: add_filter( 'a8c_disable_full_site_editing', '__return_true' );
  9. Now, in the console, is_fse_active should be false.
  10. FSE flows for the post editor should not be available, but other features still are like Starter Page Templates (which you'll see creating a new page) and Recent Blog Posts

This is much more concise and also centralizes logic around this check
into the same function which makes things much easier to reason about
@noahtallen noahtallen added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] WPCOM API labels Sep 6, 2019
@noahtallen noahtallen requested review from jeherve, gwwar and a team September 6, 2019 22:01
@noahtallen noahtallen self-assigned this Sep 6, 2019
@jetpackbot
Copy link

Warnings
⚠️

The PR is missing at least one [Status] label. Suggestions: [Status] In Progress, [Status] Needs Review

⚠️ "Proposed changelog entry" is missing for this PR. Please include any meaningful changes

This is an automated check which relies on PULL_REQUEST_TEMPLATE. We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

Generated by 🚫 dangerJS against 3588eeb

@noahtallen noahtallen added the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Sep 6, 2019
@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Sep 9, 2019
@jeherve jeherve added this to the 7.8 milestone Sep 9, 2019
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

This works well in my tests. 👍

@gwwar
Copy link
Contributor

gwwar commented Sep 9, 2019

The Gutenberg plugin is also required to be installed for full site editing flows to work properly :D

Copy link
Contributor

@gwwar gwwar left a comment

Choose a reason for hiding this comment

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

Thanks @noahtallen this tests well for me, and the site response now also matches in /me/sites vs /sites/site with D32626-code applied.

@noahtallen noahtallen merged commit 45eaaa1 into master Sep 9, 2019
@noahtallen noahtallen deleted the update/use-fse-active-helper-function-in-plugin branch September 9, 2019 21:59
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Sep 9, 2019
jeherve added a commit that referenced this pull request Sep 20, 2019
jeherve added a commit that referenced this pull request Sep 24, 2019
jeherve added a commit that referenced this pull request Sep 24, 2019
* Changelog: initial set of changes for 7.8

* Changelog: add #13310

* Changelog: add #13103

* Changelog: add #13426

* Changelog: add #13389

* Changelog: add #13449

* Changelog: add #13461

* Changelog: add #13460

* Changelog: add #13441

* Changelog: add #13454

* Changelog: add #13457

* Changelog: add #13425

* Changelog: add #13473

* Changelog: add #13355

* Changelog: add #13451

* Changelog: add #13358

* Changelog: add #13464

* Changelog: add #13416

* Changelog: add #13494

* Changelog: add #13465

* Changelog: add #13424

* Changelog: add #13432

* Changelog: add #13471

* Changelog: add 7.7.2 entry

* Changelog: add #13446

* Add more testing elements
jeherve added a commit that referenced this pull request Sep 24, 2019
* Changelog: initial set of changes for 7.8

* Changelog: add #13310

* Changelog: add #13103

* Changelog: add #13426

* Changelog: add #13389

* Changelog: add #13449

* Changelog: add #13461

* Changelog: add #13460

* Changelog: add #13441

* Changelog: add #13454

* Changelog: add #13457

* Changelog: add #13425

* Changelog: add #13473

* Changelog: add #13355

* Changelog: add #13451

* Changelog: add #13358

* Changelog: add #13464

* Changelog: add #13416

* Changelog: add #13494

* Changelog: add #13465

* Changelog: add #13424

* Changelog: add #13432

* Changelog: add #13471

* Changelog: add 7.7.2 entry

* Changelog: add #13446

* Add more testing elements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] WPCOM API [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants