feat(gatsby-plugin-gatsby-cloud): Add disablePreviewUI option#32907
Merged
DanielSLew merged 2 commits intoAug 26, 2021
Conversation
DanielSLew
reviewed
Aug 25, 2021
| export const wrapRootElement = ({ element }, pluginOptions) => { | ||
| if ( | ||
| process.env.GATSBY_PREVIEW_INDICATOR_ENABLED === `true` && | ||
| !pluginOptions.disablePreviewUI |
Contributor
There was a problem hiding this comment.
Suggested change
| !pluginOptions.disablePreviewUI | |
| !pluginOptions?.disablePreviewUI |
I can't remember if they have no options pluginOptions will be undefined or it will be an empty object. So let's just guard against it in case it is undefined
DanielSLew
suggested changes
Aug 25, 2021
Contributor
DanielSLew
left a comment
There was a problem hiding this comment.
Let's also add our new pluginOption to the schema. You can see an example of it here
In this case it will just be a boolean
disablePreviewUI option
…eivew property to the schema
wardpeet
pushed a commit
that referenced
this pull request
Aug 27, 2021
* added pluginOptions from wrappRootElement * updated access to the pluginOptions property and added the disabledPreivew property to the schema Co-authored-by: Leithon Englidh <[email protected]>
This was referenced Aug 31, 2021
This was referenced Oct 19, 2024
This was referenced Oct 20, 2024
This was referenced Oct 21, 2024
raffishquartan
pushed a commit
to raffishquartan/gatsby
that referenced
this pull request
Apr 28, 2026
…byjs#32907) * added pluginOptions from wrappRootElement * updated access to the pluginOptions property and added the disabledPreivew property to the schema Co-authored-by: Leithon Englidh <[email protected]>
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.
Description
Added pluginOptions to wrappRootElement browser API function. Specifically added the "disablePreviewUI" property for enabling/disabling preview UI
Documentation
https://www.gatsbyjs.com/docs/reference/config-files/gatsby-browser/#wrapRootElement