Skip to content

Update toolbar.js #25934 #26097

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

Closed

Conversation

Nagamaiah007
Copy link
Contributor

Description (*)

Fixed Issues (if relevant)

  1. chrome initiate two times toolbar.js #25934: chrome initiate two times toolbar.js

Manual testing scenarios (*)

  1. got to product list, search or advance search page
  2. open developer tools -> network(tab)(Chrome browser)
  3. Select/click any of the toolbar option like Grid/List, Sort By, or show X per page
  4. Network(Chrome Browser) selected/clicked link triggering two time and because of two time trigger backed doing twice process after canceled one also.
    (for verify put any log in to catalog->product->list controller).
  5. By this fix issue is fixed

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Dec 18, 2019

Hi @Nagamaiah007. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

this._bind($(this.options.modeControl), this.options.mode, this.options.modeDefault);
this._bind($(this.options.directionControl), this.options.direction, this.options.directionDefault);
this._bind($(this.options.orderControl), this.options.order, this.options.orderDefault);
this._bind($(this.options.limitControl), this.options.limit, this.options.limitDefault);
window.isToolbarLoaded = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Storing this in a global variable is not needed, you can move it to a local variable above widget declaration.

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 tried this (this.options.isToolbarLoaded) earlier it is not working as expected so, had to use it as a global variable.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean adding var isToolbarLoaded at line 11 instead: https://github.com/magento/magento2/pull/26097/files#diff-1364732a1dafeccded6675a06411dbdbR11

I also think that changing the wording to isTollbarInitialized would be more informative.

@ghost ghost assigned krzksz Dec 19, 2019
this._bind($(this.options.modeControl), this.options.mode, this.options.modeDefault);
this._bind($(this.options.directionControl), this.options.direction, this.options.directionDefault);
this._bind($(this.options.orderControl), this.options.order, this.options.orderDefault);
this._bind($(this.options.limitControl), this.options.limit, this.options.limitDefault);
window.isToolbarLoaded = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

I mean adding var isToolbarLoaded at line 11 instead: https://github.com/magento/magento2/pull/26097/files#diff-1364732a1dafeccded6675a06411dbdbR11

I also think that changing the wording to isTollbarInitialized would be more informative.

@Nagamaiah007 Nagamaiah007 requested a review from krzksz December 20, 2019 12:12
@ptylek
Copy link
Contributor

ptylek commented Apr 4, 2020

@magento run all tests

ptylek
ptylek previously approved these changes Apr 4, 2020
@magento-engcom-team
Copy link
Contributor

Hi @ptylek, thank you for the review.
ENGCOM-7259 has been created to process this Pull Request
✳️ @ptylek, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@ptylek ptylek added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Apr 4, 2020
Copy link
Contributor

@engcom-Alfa engcom-Alfa left a comment

Choose a reason for hiding this comment

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

Hi @Nagamaiah007 .
Due to Magento Definition of Done all code must be covered by tests. Please cover your fix by jasmine test.
Thanks!

@ghost ghost assigned engcom-Alfa Apr 8, 2020
@ghost ghost dismissed ptylek’s stale review April 8, 2020 11:42

Pull Request state was updated. Re-review required.

@krzksz
Copy link
Contributor

krzksz commented Apr 15, 2020

@magento run Database Compare

@krzksz
Copy link
Contributor

krzksz commented Apr 18, 2020

@magento run all tests

@VladimirZaets VladimirZaets self-assigned this May 1, 2020
@VladimirZaets
Copy link
Contributor

@Nagamaiah007, I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for collaboration

@m2-assistant
Copy link

m2-assistant bot commented May 1, 2020

Hi @Nagamaiah007, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants