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

Simplify blocks edit page #33103

Merged
merged 4 commits into from Feb 13, 2020
Merged

Simplify blocks edit page #33103

merged 4 commits into from Feb 13, 2020

Conversation

ajpal
Copy link
Contributor

@ajpal ajpal commented Feb 12, 2020

This is a mostly-no-op change with a small bug fix.
It seems like the intention was to have initializeCodeMirrorForJson be a general purpose function, but at the same time, its code was really intertwined with the specific blocks edit page use case. I decided it would be cleaner to have the blocks edit page own all of its own logic, and just call initializeCodeMirror directly.

Along the way, I found that the onChange callback was not being called, since #27138 changed initializeCodeMirror to accept an options object, and the call in intializeCodeMirrorForJson was not changed. This didn't seem to really cause any issues, since the callback was still called on blur, but this PR fixes that so the preview and generated code live-update as you change the config.

Feb-12-2020 09-46-21

Testing story

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

Copy link
Contributor

@maddiedierker maddiedierker left a comment

Choose a reason for hiding this comment

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

❤️ thank you for this refactor!

@ajpal ajpal merged commit 7293516 into staging Feb 13, 2020
@ajpal ajpal deleted the feb11-blocks-codemirror branch February 13, 2020 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants