feat(editor) include query parameters as editor params #60
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
Currently, the following query parameters are only mutable on the URL.
The editor page takes a few important query parameters:
readOnly <boolean> = true
- if set to true, no permanent modifications will be done to existing documents or templates. Very good way to play around, debug components, documents, etc. When you open the editor page directly it's by default set to true in order to prevent unexpected modifications.document <string>
- the id of the document you want to open. Leaving it undefined means you're creating a new document.rootComponent <string>
- the id of the root component. Mandatory when creating a new document (document param is not set).rootTemplate <string>
- the id of the template to copy when creating a new document. Can't be specified together with rootComponent.locale <string>
- a locale id. The locale must exist in Config.locales.This MR enables the parameters to be set as parameters on the editor itself, making them mutable and react when changed. This way changes to any of these parameters won't result in a refresh of the editor, and making it more usable in dynamic hosted environments.