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

BlockToolbar and BalloonToolbar should init after all plugins are init-ed (and afterInit-ed). #15898

Merged
merged 7 commits into from Feb 26, 2024

Conversation

niegowski
Copy link
Contributor

@niegowski niegowski commented Feb 21, 2024

Suggested merge commit message (convention)

Fix (ckbox): Plugin order should not matter when it comes to registering schema for ckboxImageId attribute. Closes #15581.

Fix (ui): BlockToolbar and BalloonToolbar plugins order should not matter when it comes to registering toolbar items. Closes #15581.

MINOR BREAKING CHANGE (ui): The contents of the BlockToolbar and BalloonToolbar are now filled on the EditorUIReadyEvent instead of afterInit().


Additional information

This PR solves actually 3 issues:

  1. When adding the CKBox plugin before the  ImageBlock and ImageInline plugins, the schema for schema for ckboxImageId attribute was not registered.
  2. Loading BlockToolbar (or BalloonToolbar) before CKBox (or actually any other plugin that registers toolbar buttons in afterInit()) resulted in the button not being registered.
  3. Because the InsertImage integration sometimes happens in init(), and it is possible to load the plugin ui part before editing, it could happen that when the ui was loaded first, the command was not yet created, resulting in an error saying that it was not possible to bind dropdown's isEnabled to the observable (the command) - because the command was undefined. So we added the ability to pass a function to the integration registration instead, and we used that in all of our integrations. This way we always make sure that the command is there when we bind it.

@mmotyczynska mmotyczynska marked this pull request as ready for review February 25, 2024 11:18
@niegowski niegowski merged commit 38ff3f1 into master Feb 26, 2024
7 checks passed
@niegowski niegowski deleted the ck/15581 branch February 26, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CKBox plugin order matters, and it shouldn't
4 participants