developmentseed / osm-teams

Teams for OpenStreetMap!
https://mapping.team
MIT License
26 stars 5 forks source link

Add OSM users by username #438

Closed willemarcel closed 1 year ago

willemarcel commented 1 year ago

Contributes to #97

It first searches in the osm teams database. If it doesn't find a user, then we search in OSM.

It's missing to modify the frontend yet.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
osm-teams ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 20, 2023 10:24pm
willemarcel commented 1 year ago

@LanesGood I've added the frontend to allow adding users to teams by username. @kamicut The only thing that is missing is to update the members' table after adding a member. Could you take a look?

LanesGood commented 1 year ago

@willemarcel this is looking great!

willemarcel commented 1 year ago

@LanesGood thanks for the feedback! I'll make the changes you suggested. I prefer to keep the modal open.

willemarcel commented 1 year ago

@LanesGood I made the changes and also increased the size of the input fields.

LanesGood commented 1 year ago

@willemarcel I'm still seeing the "adding" loading spinner when I find a user and hit "search" - but I haven't hit "add" yet. I'm working in Chrome.

I also realized that I was expecting "fuzzy" search and the platform requires exact search.

LanesGood commented 1 year ago

Thanks for debugging with me @willemarcel! As you saw on the slack, i don't see the issue when I reload... though I did see it again a little, I'm not sure how to reproduce but will let you know if it continues to pop up.

I pushed up some styling changes for the form field layout: image

Finally, I noticed that there are no error notifications/toasts when a user adds a member twice, or when they try to add themselves. I think this is restricted at the API level, and I see no console or network errors, so I'm guessing that we should make some UI changes.

willemarcel commented 1 year ago

To confirm, does this cache searches for the OSM database? Are these usernames cached in the osm teams database and now available without hitting OSM for all OSM Teams users?

I didn't implement cache. When the user search, we try first to find the user in the OSM Teams database, if it's not found, we fetch the OSM API.