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

Enhancement: Make ComponentFactory case-insensitive. #325

Merged
merged 2 commits into from
Oct 16, 2017
Merged

Enhancement: Make ComponentFactory case-insensitive. #325

merged 2 commits into from
Oct 16, 2017

Conversation

jodator
Copy link
Contributor

@jodator jodator commented Oct 16, 2017

Suggested merge commit message (convention)

Enhancement: Make ComponentFactory case-insensitive. Closes ckeditor/ckeditor5#5422.

Defining toolbar components should not fail if someone use different case than defined by pluign.


Additional information

  • I've added internal method that ensures name is a string before executing .toLowerCase() just to not have trying to call .toLowerCase() of undefined in console.

Copy link
Member

@oleq oleq left a comment

Choose a reason for hiding this comment

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

Minor fixes requested.

* @param {String} name
* @returns {String}
*/
function _componentsMapKey( name ) {
Copy link
Member

@oleq oleq Oct 16, 2017

Choose a reason for hiding this comment

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

}
}

/**
Copy link
Member

@oleq oleq Oct 16, 2017

Choose a reason for hiding this comment

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

Private non–class functions are documented with // in the project. No need to @ignore it. See: https://github.com/ckeditor/ckeditor5-design/wiki/Code-Style#comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I saw two patterns for that. I've used the one looked nicer for me ;) But I guess the other pattern is a standard now.

@oleq
Copy link
Member

oleq commented Oct 16, 2017

A documentation explaining that component names are case insensitive would be nice too. At least in class ComponentFactory.

@oleq oleq merged commit 94417e9 into master Oct 16, 2017
@oleq oleq deleted the t/324 branch October 16, 2017 12:25
@oleq
Copy link
Member

oleq commented Oct 16, 2017

@jodator, make sure the merge commit message you propose is compatible with the convention. Changelog is generated automatically based on this commit schema.

@jodator
Copy link
Contributor Author

jodator commented Oct 16, 2017

@oleq Thanks for reminder. I'm so used to Enhancement that I've forgot that it is not official.

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.

Make ComponentFactory case-insensitive
2 participants