Open nertc opened 2 weeks ago
This seems like an awful lot of complication...
It seems to me that we have the option of either allowing the user to input freetext, or of generating something from the location with Nominatim but this tries to do both at once which just makes things very complicated and probably quite confusing.
How often does nomination actually manage to match? I don't see any indication of zoom on the reverse geocode, and you're just taking the last name, so how likely is it that will match what the user entered even if they are trying to be accurate? Are we just going to wind up telling everybody their location doesn't match?
@tomhughes Thank you for the comment. I agree with you about the complexity of the code, but there are several reasons for both methods.
Changing location name manually solves cases like:
Meanwhile, changing location with Nominatim autofill introduces:
By choosing only one solution we sacrifice either functionality or better UX.
Currently, autofill suggests name of the country and warning is only shown if manually typed location doesn't contain country name. Therefore, "Germany & Georgia", "Tbilisi, Georgia", "Georgia" won't show any autofill warning if user has home location set in Georgia.
Thank you for the review. PR was updated according to the comments.
PR adds location name info on the user profile page. Location name can be changed from "Edit Profile" page either by manual typing or auto-filling according to the home location.
One column was added to the user table to save user's location. JS logics are responsible for handling: 1) Delete-Undelete buttons interactions 2) Nominatim calls to locate home locations country name 3) Warning logic of the location name