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: enable locale search by all locale display options then save locale code #1062

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

prestonb91
Copy link

@prestonb91 prestonb91 commented Feb 23, 2025

βœ… Resolves #1053

  • PR title follows Conventional Commits specifications
  • PR assignee has been selected
  • PR label has been selected
  • @NabbeunNabi has been selected for preliminary review

πŸ”§ What changed

  • ModEditHealthcareProfessionalSection only searched by filtering through language codes
  • This prevented users from searching with the full locale name text (i.e. English) or to search by the local language (i.e. ζ—₯本θͺž (Japan)
  • Updated handleLocaleInputChange to filter across code, simple text, display text based on input value, then map the locale code to filtered items so that it still saves the locale code

πŸ“Έ Screenshots

  • Before

Locale-search-bug-1 Locale-search-bug-2
  • After

Screen.Recording.2025-02-23.at.10.29.53.mov

@prestonb91 prestonb91 added bug Something isn't working good first issue Good for newcomers moderation panel labels Feb 23, 2025
@prestonb91 prestonb91 self-assigned this Feb 23, 2025
Copy link

netlify bot commented Feb 23, 2025

βœ… Deploy Preview for findadoc ready!

Name Link
πŸ”¨ Latest commit 70a2b4f
πŸ” Latest deploy log https://app.netlify.com/sites/findadoc/deploys/67bb0d079303eb00082620d3
😎 Deploy Preview https://deploy-preview-1062--findadoc.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@prestonb91 prestonb91 marked this pull request as ready for review February 23, 2025 01:56
Copy link
Contributor

@NabbeunNabi NabbeunNabi left a comment

Choose a reason for hiding this comment

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

This is a good idea.

We do have a store that has functions to deal with locale values. It has the simple text and code. Could you make a reusable store function with this type of logic where you can input a language and it will use the actually language and then return the code so you can set the value that way and put a comment above it.

Here is the file. https://github.com/ourjapanlife/findadoc-web/blob/main/stores/localeStore.ts

Great start!

@prestonb91
Copy link
Author

@NabbeunNabi thanks for the feedback.
I refactored to create a reusable function getLocaleByInput in the localStore and adjusted the ModEditHealthcareProfessionalSection to use it.
Manually tested and it searches by display options and saves like the original commit.
34ad046

Wanted to confirm if this is what you were looking for based on your comments?

Copy link
Contributor

@NabbeunNabi NabbeunNabi left a comment

Choose a reason for hiding this comment

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

@prestonb91 just one thing to change on my end but I'm sure you will finish by the time @ermish reviews it.

So on to him!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers moderation panel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: update ModEditHealthcareProfessionalSection to search by language name instead of locale code
2 participants