Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Changes in EditorWithUI and ElementApi interfaces #129

Merged
merged 11 commits into from
Jul 3, 2018
Merged

Changes in EditorWithUI and ElementApi interfaces #129

merged 11 commits into from
Jul 3, 2018

Conversation

pomek
Copy link
Member

@pomek pomek commented Jun 13, 2018

Renamed editor.element to editor.sourceElement. Introduced an "element" property to "EditorWithUI" interface.

Suggested merge commit message (convention)

Feature: Introduced the #element property to the EditorWithUI interface. The #element property fromElementApi interface has been renamed to #sourceElement. Closes ckeditor/ckeditor5#2882.

BREAKING CHANGE: Renamed attribute in ElementApi interface – from #element to #sourceElement.

BREAKING CHANGE: Renamed method name in ElementApi interface – from updateElement() to updateSourceElement().


Required for:

CI: https://travis-ci.org/ckeditor/ckeditor5/builds/391732850 (ckeditor/ckeditor5@960395e)
CI: https://travis-ci.org/ckeditor/ckeditor5/builds/398155989 (ckeditor/ckeditor5@220950d)
CI: https://travis-ci.org/ckeditor/ckeditor5/builds/399007024 (ckeditor/ckeditor5@ed334a6)

@coveralls
Copy link

coveralls commented Jun 13, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling d01f919 on t/64 into 3bab479 on master.

@@ -19,8 +19,8 @@ const ElementApiMixin = {
/**
* @inheritDoc
*/
updateElement() {
Copy link
Member

Choose a reason for hiding this comment

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

Let's add a check here that sourceElement exists and throw otherwise. We expect that it may not be set.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in e8cc7ed.

*
* @error elementapimixin-missing-sourceelement
*/
throw new CKEditorError( 'elementapi-missing-sourceelement: The "sourceElement" is required by the "ElementApi" interface.' );
Copy link
Member

Choose a reason for hiding this comment

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

How's an external developer supposed to understand this? He/she doesn't know our interfaces. They know what method they used. They should learn that it doesn't work if the editor wasn't created by passing the source element.

PS. Keep the error msg short. Explain it more thoroughly in the comment above.

Copy link
Member Author

Choose a reason for hiding this comment

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

I improved a little the error description but I'm not able to check it out so I'm not sure whether it works... Could you help me? :D

@pomek
Copy link
Member Author

pomek commented Jul 2, 2018

One more PR that requires these changes: ckeditor/ckeditor5-editor-decoupled#18

I missed it. The description of this PR has been updated.

@Reinmar Reinmar merged commit eb43b63 into master Jul 3, 2018
@Reinmar Reinmar deleted the t/64 branch July 3, 2018 07:06
Reinmar added a commit to ckeditor/ckeditor5-build-classic that referenced this pull request Jul 3, 2018
Tests: Adjusted the code to the changes in ckeditor5-editor-classic. See ckeditor/ckeditor5-core#129.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to create editor without replacing an existing element
3 participants