-
Notifications
You must be signed in to change notification settings - Fork 10
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
refactor: adjust Frontend to new Editor storage format #4465
Draft
hejtful
wants to merge
19
commits into
staging
Choose a base branch
from
refactor/adjust-frontent-to-new-editor-storage-format
base: staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
78ed69b
refactor(editor): adjust local storage logic to new storage format
hejtful 66eb06c
refactor(web): adjust converting editor response to state
hejtful 62c19ab
refactor: use Editor onChange in web + some Editor optimizations
hejtful 1136bdd
chore: remove deprecated selectRootDocument
hejtful d482947
fix(web): type and format after switching to Editor storage format
hejtful e1b9ff2
refactor(editor): Editor component slightly more readable
hejtful 1c9543b
fix(editor-integration): add missing plugins
hejtful 8ea391f
fix(request-page): wrap Video and Applet content in Rows plugin
hejtful aa7630a
chore(entity): temporarily wrap entity content in Editor metadata
hejtful 4bdd6bb
merge staging
hejtful 7354088
merge staging 2
hejtful d3c0318
merge staging 3
hejtful 8f5affa
chore(web): remove temp editor metadata wrappers
hejtful 7796ec6
fix(web): unwrap editor document for serlo renderers
hejtful 8d1029a
refactor(web): add StorageFormat unwrap to parseDocumentString
elbotho dcd65dc
Merge pull request #4490 from serlo/refactor/cleanup-editor-state-unwrap
hejtful 25bad25
chore(web): don't use raw string
elbotho 7ab902e
fix(web): only render save button if editor state loaded and valid
hejtful 70491c8
fix(web): convert Editor state to API data before saving
hejtful File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
createEmptyDocument
could generate different initial editor states in the future. Example:createEmptyDocument(editorVariant: 'serlo-org', type: 'article')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't mind, could you please explain the benefits of that in more detail? Is it to avoid this destructuring approach, or are there other benefits?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I created this function in the past there was only one root plugin☺️
type-generic-content
so it made sense to hard code it. Now, there are different types. I think I would slightly prefer having all that logic in functioncreateEmptyDocument
. But the way it is now is also fine for me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point! And it should stay like that, actually. I only exported the
createEmptyDocument
function through the package as a special case for Serlo (which is also documented by comments in the package index file, and also why it's not mentioned in the README). So it's a temporary hacky solution, and I wouldn't change the original function for it.It's definitely not great, but I decided that these refactorings need to go step by step, if I tried to make everything perfect on the first go, I'd get lost in it 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, alright. Thanks for clarifying. Going step by step sounds great to me. Just wanted to share my thoughts.