-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Added default value to useComputedState in the CKEDITOR config object #4940
Added default value to useComputedState in the CKEDITOR config object #4940
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @shabab477! Thanks for your contribution.
The change looks good. However, we require that every change be accompanied by the test. Could I ask you to add a test to /tests/config
directory? The test can be simple, e.g. creating the editor and then checking its editor.config.useComputedState
value.
It'd be also good to remove the logic connected to treating undefined config.useComputedState
variable the same way as the one set to true
(see the issue's description for more info). Could you add it as a part of this PR?
Alright 👍 |
02ef654
to
f10519e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your fixes!
The test looks good. Could I ask you to add a similar one also to tests/core/config/themed_ui.js
?
There are also several other places in plugins where the trick similar to the one with undefined
is used, e.g.
ckeditor4/plugins/bidi/plugin.js
Line 83 in 6111ac2
var useComputedState = ( 'useComputedState' in editor.config ) ? editor.config.useComputedState : 1; |
core/config.js
Outdated
* | ||
* @since 3.4.0 | ||
* @cfg {Boolean} [useComputedState=true] | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation here seems to be incorrect:
* | |
* @since 3.4.0 | |
* @cfg {Boolean} [useComputedState=true] | |
*/ | |
* | |
* @since 3.4.0 | |
* @cfg {Boolean} [useComputedState=true] | |
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
tests/core/config/inline.js
Outdated
@@ -22,6 +22,10 @@ bender.test( { | |||
} ); | |||
}, | |||
|
|||
test_startup_computed_state_value: function() { | |||
assert.isTrue( this.editor.config.useComputedState === true, 'config.useComputedState should return true as default' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to compare variable's value to true
, asserting its value is enough in this case:
assert.isTrue( this.editor.config.useComputedState === true, 'config.useComputedState should return true as default' ); | |
assert.isTrue( this.editor.config.useComputedState, 'config.useComputedState should return true as default' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
f10519e
to
478711b
Compare
Fixed usages of
|
478711b
to
d7507d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks once again for your contribution.
Issue #4918
What is the purpose of this pull request?
Does your PR contain necessary tests?
All patches that change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.
This PR contains
Did you follow the CKEditor 4 code style guide?
Your code should follow the guidelines from the CKEditor 4 code style guide which helps keep the entire codebase consistent.
What is the proposed changelog entry for this pull request?
Skipped
What changes did you make?
Added default config value for
useComputedState
Which issues does your PR resolve?
Closes #4918.