ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

CKBox(Editing) should warn if the library has not been loaded

Open oleq opened this issue 3 years ago • 5 comments

📝 Provide a description of the improvement

While working on docs (configuring the build) I came across the following scenario:

  • I loaded CKBox in the plugins: [].
  • Added 'ckbox' to the toolbar config.
  • Then I got toolbarview-item-unavailable {item: 'ckbox'} warning in the console. Weird, right?
  • I couldn't understand why, though. I checked and CKBoxUI was loaded.
  • I started digging into the code and I found out CKBoxUI will not register the button unless the command has been registered.
  • OK, not the most common pattern across our codebase but it makes sense. What does not make sense is that CKBoxEditing is loaded but the command is not there 🤔
  • Then I searched the editing plugin and I found out it will not register command unless there's config and the lib already loaded.
  • Finally I found out I forgot to load the lib <script src="https://cdn.ckbox.io/CKBox/1.2.1/ckbox.js"></script> 🤦

It took me a while to debug this and I had access to the source code and knowledge about the architecture. For a developer who tries to integrate this feature and knows very little about the editor this is going to be a nightmare.

What we really need is two warnings:

  • about a missing config
  • about a missing lib

If you'd like to see this improvement implemented, add a 👍 reaction to this post.

oleq avatar Dec 13 '22 13:12 oleq

Add warnings here: https://github.com/ckeditor/ckeditor5/blob/57f2a6833f334c49b9c52e56b0c9f46ec0bfd67e/packages/ckeditor5-ckbox/src/ckboxediting.ts#L68.

arkflpc avatar Oct 02 '23 10:10 arkflpc

@Witoso, this plugin (CKBox) is included as a built-in plugin in all of our builds (i.e. ckeditor5-build-classic). And none of them provides default configuration for ckbox or cloud-services. All of them would emit warnings then (which worries me a bit).

arkflpc avatar Oct 12 '23 12:10 arkflpc

The ckbox config is not required in order for it to work. cloud-services config would do the job. And the latter has all the default values, except tokenUrl. Shouldn't we scope the warning to tokenUrl only?

arkflpc avatar Oct 12 '23 12:10 arkflpc

Moved to backlog. Let's decide first what to do with https://github.com/ckeditor/ckeditor5/issues/13062#issuecomment-1759515299

arkflpc avatar Oct 13 '23 12:10 arkflpc

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar Oct 12 '24 23:10 CKEditorBot

We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

CKEditorBot avatar Nov 12 '24 23:11 CKEditorBot