Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Solve issue 859 and 871 #872

wants to merge 2 commits into from

Conversation

Mubra
Copy link
Member

@Mubra Mubra commented Oct 8, 2019

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")

issue_close_final

@idgserpro
Copy link
Member

@Mubra it's always good to put a closes #xxx in the description of a PR to create a link to the issue it fixing. Please add.

@Mubra
Copy link
Member Author

Mubra commented Oct 8, 2019

ready @idgserpro

Copy link
Member

@hvelarde hvelarde left a 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>`_).
Copy link
Member

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.

Copy link
Member

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.

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 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

@rodfersou
Copy link
Member

well, use the $ in the variable name is a pattern used to know that the variable is a jquery object, and we have it in many projects, please keep this way.

};
button.on('click', onClick.bind(this));
le_delete.trigger('modified.layout');
});
Copy link
Member

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

@@ -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');
Copy link
Member

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.

Copy link

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

Copy link
Member

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.

Copy link
Member

@rodfersou rodfersou left a 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.

@Mubra
Copy link
Member Author

Mubra commented Oct 8, 2019

Ok @rodfersou , reviewing, thanks for the comments 👍

@Mubra
Copy link
Member Author

Mubra commented Oct 8, 2019

proof
show

Copy link
Member

@idgserpro idgserpro left a 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>`_).
Copy link
Member

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>`_).
Copy link
Member

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.

Copy link
Member

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)

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 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.

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 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

@Mubra
Copy link
Member Author

Mubra commented Oct 9, 2019

I will close this PR to generate a new one with the correct changes, also to verify the "travis" tests.
@hvelarde
@idgserpro
@rodfersou
@scmos

@Mubra Mubra closed this Oct 9, 2019
@idgserpro idgserpro deleted the fix_issue_859 branch October 9, 2019 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error deleting previously saved items slide control error
5 participants