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

Fix Customer Search Autofill Issue #12112

Conversation

chahmedejaz
Copy link
Collaborator

@chahmedejaz chahmedejaz commented Feb 1, 2024

What? Why?

Issue

  • There's an edge case where this.items might not have the selected customer
    const customer = this.items.find((item) => item.id == id);
  • This is because we are always replacing this.items with the latest search results.
  • As shown in the repro steps, if no value is being searched, then the dropdown displays all the previous search results as well
  • This PR merges the latest search results into this.items so that we always have all the searched items in this.items hence mitigates the case where the selected customer might not be present in this.items

What should we test?

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

@chahmedejaz chahmedejaz force-pushed the bugfix/12085-fix-customer-search-autofill-issue branch from 3104365 to a6431bd Compare February 1, 2024 20:58
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

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

Nice one ! Thanks for your help @chahmedejaz

@filipefurtad0 filipefurtad0 self-assigned this Feb 12, 2024
@filipefurtad0 filipefurtad0 added pr-staged-uk staging.openfoodnetwork.org.uk user facing changes Thes pull requests affect the user experience labels Feb 12, 2024
@filipefurtad0
Copy link
Contributor

Hey @chahmedejaz ,

Thank you so much for your PR and your explanation on the previous video, this was really very helpful.

I've reproduced your steps, and could verify the bug is fixed. It is looking great:
https://www.loom.com/share/bc1b078550194289be82acd8a1fe09ce?sid=157a90cf-be74-4dca-977a-73c753916e3d

then the dropdown displays all the previous search results as well

Indeed, and as you demonstrate, this is the case. I have no strong opinion on it, if we actually really need it, or would be best to show no results, after an option was selected. Perhaps we can consider it an additional improvement, further on.

Thank you so much for clarifying and fixing the issue 💪
Merging!

@filipefurtad0 filipefurtad0 merged commit 850918d into openfoodfoundation:master Feb 12, 2024
54 checks passed
@filipefurtad0 filipefurtad0 removed the pr-staged-uk staging.openfoodnetwork.org.uk label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user facing changes Thes pull requests affect the user experience
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BO Orders] Clicking customer search results does not fill the details form
4 participants