Skip to content

Backend: focus search field when pressing forwardslash - '/' #27674

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

Conversation

vovayatsyuk
Copy link
Member

@vovayatsyuk vovayatsyuk commented Apr 9, 2020

Description

This PR adds a keydown event listener in magento backend to activate global search form if forward slash was pressed.

No need to grab the mouse!

ezgif com-video-to-gif

Manual testing scenarios (*)

  1. Login to backend
  2. Press '/' on the keyboard.
  3. Start typing a query.

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] Backend: focus search field when pressing forwardslash - '/' #29551: Backend: focus search field when pressing forwardslash - '/'

@m2-assistant
Copy link

m2-assistant bot commented Apr 9, 2020

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

@sidolov
Copy link
Contributor

sidolov commented Aug 14, 2020

@magento create issue

@sidolov sidolov added Priority: P3 May be fixed according to the position in the backlog. Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. labels Aug 14, 2020
@sidolov sidolov added Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. and removed Priority: P3 May be fixed according to the position in the backlog. labels Aug 27, 2020
@ihorvansach ihorvansach self-assigned this Sep 8, 2020
@ihorvansach
Copy link
Contributor

@magento run all tests

@ihorvansach
Copy link
Contributor

@magento run Functional Tests B2B

@ihorvansach
Copy link
Contributor

Hello @vovayatsyuk, thank you for your contribution. Can you please add a few improvements to the pull request?

  1. Define key code 191 in the Magento_Ui/js/lib/key-codes (https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Ui/view/base/web/js/lib/key-codes.js), here is an example of key-codes use https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Ui/view/base/web/js/grid/columns/image-preview.js

  2. Better to rename "e" variable into "event"

  3. Could you please also add "multiselect" to the inputs array

  4. Cover this case with MFTF tests (https://devdocs.magento.com/mftf/docs/introduction.html)

  5. Don't forget to sign the Adobe CLA agreement.

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

@vovayatsyuk could you update your PR with requested changes in #27674 (comment) ?

@ghost ghost assigned ihor-sviziev Sep 23, 2020
@ihor-sviziev ihor-sviziev added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Sep 23, 2020
@ihor-sviziev ihor-sviziev removed their assignment Sep 23, 2020
@vovayatsyuk
Copy link
Member Author

Define key code 191

Done.

Rename "e" variable into "event"

Done.

Add "multiselect" to the inputs array

Multiselect is a 'select' with multiple attribute, so it's already in the list.

Cover this case with MFTF tests

I'll try to write the tests in a few days.

Sign the Adobe CLA agreement.

Should be ok.

@ihor-sviziev
Copy link
Contributor

@magento run all tests

@engcom-Charlie engcom-Charlie self-assigned this Oct 23, 2020
@engcom-Charlie
Copy link
Contributor

@vovayatsyuk can you please cover your changes by mftf test?
Thank you.

@vovayatsyuk
Copy link
Member Author

Will do today.

@ihor-sviziev
Copy link
Contributor

Thank you for your fixes! Let's start the tests

@magento run all tests

@ihor-sviziev
Copy link
Contributor

@magento run Functional Tests EE, Integration Tests

@ihor-sviziev
Copy link
Contributor

@magento run Functional Tests EE

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

✔ Approved.

Failing tests looks not related to changes form this PR.

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-8393 has been created to process this Pull Request

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Manual testing scenario:

  1. Login to backend
  2. Press '/' on the keyboard.
  3. Start typing a query.

After: ✔️ the search box focuses when clicking on the slash - '/'

Peek 2020-11-02 13-00

@m2-assistant
Copy link

m2-assistant bot commented Nov 9, 2020

Hi @vovayatsyuk, 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
Labels
Area: Design/Frontend Area: Frontend Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: MFTF test coverage Component: Backend Component: Ui 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
Archived in project
Development

Successfully merging this pull request may close these issues.

[Issue] Backend: focus search field when pressing forwardslash - '/'
7 participants