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

Remove over complicated setup for closing minicart dropdown #28906

Merged

Conversation

lumnn
Copy link
Contributor

@lumnn lumnn commented Jun 26, 2020

Description (*)

When investigating minicart code I've noticed a bit strange way to add event listener to elements that are supposed to close minicart when clicked.

Please first look on removed line with data-bind="visible: closeSidebar()". visible knockout binding is used to control whether the element should be shown. However, the closeSidebar function is always returning true value. The side effect of this function is it setup an event listeners to [data-action="close"] elements, which will close the minicart dropdown.

This pull request removes closeSidebar function and the knockout binding on completely unrelated element. Instead, the appropriate click binding is added to the only [data-action="close"] element I've found.

Manual testing scenarios (*)

  1. Open minibasket
  2. Close with an "X" button
  3. Add a product to basket
  4. Open, close minibasket
  5. Open basket and click on "Proceed to Checkout"

Questions or comments

I've searched the codebase for elements with data-action="close" to ensure that it will not break any other functionality. However I'm guessing some modules may using this "API".

Other question is whether data-action="close" attribute is needed. By searching in a code it doesn't seem to have a purpose, but it increase HTML to content ratio.

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)

Resolved issues:

  1. resolves [Issue] Remove over complicated setup for closing minicart dropdown #29161: Remove over complicated setup for closing minicart dropdown

@m2-assistant
Copy link

m2-assistant bot commented Jun 26, 2020

Hi @lumnn. 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

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

@lbajsarowicz
Copy link
Contributor

@magento run all tests

Very interesting change. Let's make sure that everything works fine!

@lumnn
Copy link
Contributor Author

lumnn commented Jun 27, 2020

I'm unsure why tests fails as from the reports I can't find that any of the issue is related to the changes I've done

@magento run Functional Tests CE , Functional Tests B2B

@lumnn
Copy link
Contributor Author

lumnn commented Jun 27, 2020

I guess it's worth noting that Functional Tests CE and Functional Tests B2B failed in the first go, but passed in second.

Copy link
Contributor

@lbajsarowicz lbajsarowicz left a comment

Choose a reason for hiding this comment

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

✔️ Wow. Great work! Thank you for your contribution.

@ghost ghost moved this from Pending Review to Ready for Testing in Pull Requests Dashboard Jun 27, 2020
@ghost ghost assigned lbajsarowicz Jun 27, 2020
@magento-engcom-team
Copy link
Contributor

Hi @lbajsarowicz, thank you for the review.
ENGCOM-7752 has been created to process this Pull Request
✳️ @lbajsarowicz, 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

@magento-engcom-team
Copy link
Contributor

@lumnn thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@ghost ghost assigned ptylek Jun 28, 2020
@magento-engcom-team
Copy link
Contributor

Hi @ptylek, thank you for the review.
ENGCOM-7752 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 Required Changes in Pull Request does not require coverage by auto-tests label Jul 11, 2020
@ptylek
Copy link
Contributor

ptylek commented Jul 11, 2020

Adding not required label as this PR improves on some redundant javascript. Functionality should stay the same.

@ptylek ptylek added the Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. label Jul 11, 2020
@engcom-Delta engcom-Delta self-assigned this Jul 13, 2020
@engcom-Delta engcom-Delta moved this from Ready for Testing to Testing in Progress in Pull Requests Dashboard Jul 13, 2020
@engcom-Delta
Copy link
Contributor

✔️ QA passed
Was checked that behavior minicart "X" button is same as before for Mobile, Tablet, Desktop views

  • Mobile
    MobileView

  • Tablet
    TAbletView

  • Desktop
    Peek 2020-07-13 09-44

@engcom-Delta engcom-Delta moved this from Testing in Progress to Extended Testing (optional) in Pull Requests Dashboard Jul 13, 2020
@engcom-Echo engcom-Echo self-assigned this Jul 13, 2020
@engcom-Echo engcom-Echo added the QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) label Jul 13, 2020
@VladimirZaets
Copy link
Contributor

@magento create issue

@ghost ghost added the Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. label Jul 15, 2020
@engcom-Delta engcom-Delta added QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope and removed QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) labels Jul 24, 2020
@engcom-Echo engcom-Echo moved this from Extended Testing (optional) to Merge in Progress in Pull Requests Dashboard Jul 28, 2020
@magento-engcom-team magento-engcom-team merged commit 4f7e659 into magento:2.4-develop Jul 29, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jul 29, 2020

Hi @lumnn, 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.

@ghost ghost moved this from Merge in Progress to Recently Merged in Pull Requests Dashboard Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Component: Checkout Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”.
Projects
Pull Requests Dashboard
  
Recently Merged
Development

Successfully merging this pull request may close these issues.

[Issue] Remove over complicated setup for closing minicart dropdown
7 participants