This repository was archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Added support for initializing Collection using a constructor #326
Conversation
This file contains hidden or 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
Also changed the name from _getItemIdBeforeAdding to _getItemId - as the method logic is not really related to adding.
… used in add method too so it will make more sense.
Restored `CKEditorError` old interface, no big reason to change the API here.
Reinmar
reviewed
Feb 27, 2020
oleq
suggested changes
Feb 27, 2020
Co-Authored-By: Piotrek Koszuliński <[email protected]>
Co-Authored-By: Aleksander Nowodzinski <[email protected]>
Co-Authored-By: Aleksander Nowodzinski <[email protected]>
Co-Authored-By: Aleksander Nowodzinski <[email protected]>
oleq
approved these changes
Mar 12, 2020
Member
|
Let's merge it ASAP in the upcoming iteration. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Suggested merge commit message (convention)
Feature: Added support for initializing
Collectionitems using a constructor. Closes ckeditor/ckeditor5#6319.Additional information
This PR was mostly based on #309 with some notable changes:
collection-add-invalid-idandcollection-add-item-already-existserror interfaces back to what we have on themasterbranch (see current vs originally proposed). I don't think there's a strong reason to change this API.add()remains unchanged with exception of reusing_getItemIdBeforeAdding().generates id for items that doesn\'t have it,throws an error when invalid item key is provided,throws an error when items have a duplicated key.I had some doubts:
options.itemsinstead of addinginitialItemsOrOptionsnext tooptions. I believe anyxOrYkind of variables are confusing for the API consumer.Once this PR is merged, the
masterbranch should get merged to the #309 PR so that the diff will get smaller and easier to review.There's a subpr: ckeditor/ckeditor5-ui#545