Try: Only render LastRevision component if plugin is active#55253
Merged
Try: Only render LastRevision component if plugin is active#55253
Conversation
|
Size Change: 0 B Total Size: 1.65 MB ℹ️ View Unchanged
|
|
Flaky tests detected in f3569a0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6482371468
|
Contributor
|
I just cherry-picked this PR to the 6.4-rc1-2 branch to get it included in the next release: 707bf2a |
SiobhyB
pushed a commit
that referenced
this pull request
Oct 16, 2023
* Add selector as id to layout style overrides. (#55291) * Fix flickering when focusing on global style variations (#55267) * ProgressBar: use text color to ensure enough contrast against background (#55285) * Use text color at different opacities for track and indicator * Add high contrast mode styles * CHANGELOG # Conflicts: # packages/components/CHANGELOG.md * Remove empty attrs. (#54496) * Remove empty attrs. * Fix linter errors --------- Co-authored-by: Sarah Norris <sarah@sekai.co.uk> * Add IS_GUTENBERG_PLUGIN flag to LastRevision (#55253) * useBlockPreview: Try outputting EditorStyles to ensure local style overrides are rendered (#55288) * useBlockPreview: Try alternative fix for displaying local style overrides * Avoid duplicate styles, fix rendering issues in Safari * Add more explanatory comments * Remove additional check for styles within the block preview, as it is not needed since EditorStyles handles its own style overrides retrieval * Bug: PHP notice when an image with lightbox is deleted (#55370) * Fix PHP notice when an image with lightbox is deleted * Fix PHP notice when an image with lightbox is deleted --------- Co-authored-by: tellthemachines <tellthemachines@users.noreply.github.com> Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com> Co-authored-by: Jonny Harris <spacedmonkey@users.noreply.github.com> Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Co-authored-by: Kishan Jasani <kishanjasani007@yahoo.in>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
This adds a check for
IS_GUTENBERG_PLUGINto theLastRevisioncomponent. Please see this Slack thread for more context: https://wordpress.slack.com/archives/C055Y7FKS7N/p1696947482790409.Why?
The API that enables this feature to work (i.e. populates
lastRevisionIdandrevisionsCount) has recently been fixed in Core. Currently, theLastRevisioncomponent renders if these variables are set, and will not render if these variables are not set. However, in order to provide more control of this feature from the Gutenberg plugin side, we should consider temporarily putting this behind theIS_GUTENBERG_PLUGINfeature flag.How?
Adds a check for
! process.env.IS_GUTENBERG_PLUGINwhich will rendernullif true, i.e. if the Gutenberg plugin is not active, render nothing.Testing Instructions
LastRevisioncomponent in the Template side panel when the GB plugin is active