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

Make Enter submit the form on both products and orders admin #5599

Merged
merged 3 commits into from Jul 3, 2020

Conversation

luisramos0
Copy link
Contributor

@luisramos0 luisramos0 commented Jun 13, 2020

What? Why?

Closes #4437

It feels like too much copy paste for such a simple feature. I left the first commit so reviewers can see the alternative directive approach. The alternative approach was not working for the orders page, so I decided to go with ng-keypress.

On the orders page we only add the behavior to free text fields.

What should we test?

Products search /admin/products - type something on quick search and press enter, see the results being updated.
Orders search /admin/orders - type something on any of the text fields (Invoice number, email, first name and last name) and press enter, see results being updated

Release notes

Changelog Category: Added
Pressing enter will submit the search form on admin orders and products.

@luisramos0 luisramos0 changed the title Submit on enteer Make Enter submit both products and orders search forms Jun 13, 2020
@luisramos0 luisramos0 changed the title Make Enter submit both products and orders search forms Make Enter submit the form on both products and orders admin Jun 13, 2020
Copy link
Contributor

@sauloperez sauloperez left a comment

Choose a reason for hiding this comment

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

Good enough IMO 👍

Copy link
Contributor

@Matt-Yorkley Matt-Yorkley left a comment

Choose a reason for hiding this comment

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

I think I prefer the option in the first commit. It's a lot more DRY, no?

@luisramos0
Copy link
Contributor Author

luisramos0 commented Jun 17, 2020 via email

@sauloperez
Copy link
Contributor

sauloperez commented Jun 19, 2020

I'm of the opinion that better done than nothing, at least here. Then, we can spend some time improving it but knowing this is already done.

@sauloperez
Copy link
Contributor

sauloperez commented Jun 23, 2020

so @Matt-Yorkley, which way do you want to go?

@filipefurtad0 filipefurtad0 self-assigned this Jul 3, 2020
@filipefurtad0 filipefurtad0 added the pr-staged-fr staging.coopcircuits.fr label Jul 3, 2020
@filipefurtad0
Copy link
Contributor

Hi @luisramos0 ,

Thank you for your notes on the issue and in this PR.

I verified that the PR makes hitting enter work, as an alternative to manually pressing the Filter Results button on:

  • Products page
    -- Quick search field
  • Orders Page
    -- Fields Invoice number, Email, First name begins with, Last name begins with

Good to go,
Thank you!

@filipefurtad0 filipefurtad0 removed the pr-staged-fr staging.coopcircuits.fr label Jul 3, 2020
@Matt-Yorkley Matt-Yorkley merged commit d2db9b3 into openfoodfoundation:master Jul 3, 2020
@luisramos0 luisramos0 deleted the submit_on_enteer branch July 3, 2020 09:30
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.

'Enter' key activates search on Products (and Orders?) page
4 participants