-
Notifications
You must be signed in to change notification settings - Fork 55
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
Solve issue 859 and 871 #872
Conversation
@Mubra it's always good to put a |
ready @idgserpro |
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.
tests are failing; please review your solution.
@@ -6,6 +6,12 @@ There's a frood who really knows where his towel is. | |||
2.2.1 (unreleased) | |||
^^^^^^^^^^^^^^^^^^ | |||
|
|||
- The solution was to change the selector "$ le" to "le" because it did not take the charged element, only those created (fixes `#871 <https://github.com/collective/collective.cover/issues/871>`_). |
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.
these changelog entries are wrong; please fix them.
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.
Entry must contain what has been fixed.
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.
I don't know if the recent changes in "Travis" affect the tests, I corrected the error, adding these variables to the environment:
export ZSERVER_PORT = 55001
export LISTENER_HOST = 49999
With this, the robot tests run me without any problem, in fact I already did some simple tests of mine
well, use the |
}; | ||
button.on('click', onClick.bind(this)); | ||
le_delete.trigger('modified.layout'); | ||
}); |
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.
please use the bind this
in the event instead to fix the this inside the jquery event. ex.:
https://github.com/collective/collective.cover/blob/master/webpack/app/js/cssclasswidget.js#L19
this way you don't need the le_delete
variable.
also we are using ES6 here, prefer to use let
and const
instead of var
to create variables; prefer to use arrow functions instead of old functions if possible.
please take a looks at http://es6-features.org
webpack/app/js/layout.js
Outdated
@@ -478,7 +479,7 @@ export default class LayoutView { | |||
$('#slider').off("slide"); | |||
$('#slider').on("slide", function(event, ui) { | |||
column.attr('data-column-size', ui.value); | |||
le.trigger('modified.layout'); | |||
le_resize.trigger('modified.layout'); |
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.
please look at the comments about le_delete
, the same apply here.
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.
"le_resize" is needed cause "le" is not reached into function
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.
yes, that's why you should use the .bind(this)
code when add an event, look at the other comments please.
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.
Please look at my comments, need some changes to keep everything consistent in the codebase.
Ok @rodfersou , reviewing, thanks for the comments 👍 |
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.
Please create a new PR to try fix the tests. This has to work without the instance being started. These errors were most likely caused by the new version 4.3.19
of Plone.
It would also be good testing for this PR.
@@ -6,6 +6,12 @@ There's a frood who really knows where his towel is. | |||
2.2.1 (unreleased) | |||
^^^^^^^^^^^^^^^^^^ | |||
|
|||
- The solution was to change the selector "$ le" to "le" because it did not take the charged element, only those created (fixes `#871 <https://github.com/collective/collective.cover/issues/871>`_). |
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.
Entry must contain what has been fixed.
- The solution was to change the selector "$ le" to "le" because it did not take the charged element, only those created (fixes `#871 <https://github.com/collective/collective.cover/issues/871>`_). | ||
[Mubra] | ||
|
||
- This indirectly corrects issue `#859 <https://github.com/collective/collective.cover/issues/859>`_ using a variable quickly with this selector ("le_resize") (fixes `#859 <https://github.com/collective/collective.cover/issues/859>`_). |
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.
Entry must contain what has been fixed.
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.
I still see console error while resizing a column:
cover-2a86fa7.js:1 Uncaught TypeError: Cannot read property 'trigger' of undefined
at HTMLDivElement.<anonymous> (cover-2a86fa7.js:1)
at HTMLDivElement.dispatch (++resource++plone.app.jquery.js:3)
at HTMLDivElement.i (++resource++plone.app.jquery.js:3)
at Object.trigger (++resource++plone.app.jquery.js:3)
at HTMLDivElement.<anonymous> (++resource++plone.app.jquery.js:3)
at Function.each (++resource++plone.app.jquery.js:2)
at init.each (++resource++plone.app.jquery.js:2)
at init.trigger (++resource++plone.app.jquery.js:3)
at e.<computed>.<computed>._trigger (collective.js.jqueryui.custom.min.js:16)
at e.<computed>.<computed>._slide (collective.js.jqueryui.custom.min.js:131)
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.
I found the problem, if I need to declare "let le_resize = this.$le;". @rodfersou's comment is correct (that's why I had deleted this variable), but using a variable "le_resize" I think, helps to understand that it is a local object, if you add this, the console error should no longer appear.
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.
I don't know if the recent changes in "Travis" affect the tests, I corrected the error, adding these variables to the environment:
export ZSERVER_PORT = 55001
export LISTENER_HOST = 49999
With this, the robot tests run me without any problem, in fact I already did some simple tests of mine
I will close this PR to generate a new one with the correct changes, also to verify the "travis" tests. |
The solution was to change the selector "$ le" to "le" because it did not take the charged element, only those created.( closes #871 )
This indirectly closes #859 using a variable quickly with this selector ("le_resize")