MushroomObserver / mushroom-observer

A website for sharing observations of mushrooms.
https://mushroomobserver.org
MIT License
77 stars 25 forks source link

Observation form phase 2a (closed) #2183

Closed nimmolo closed 3 months ago

nimmolo commented 3 months ago

This "phase 2a" PR adds some JS and a query scope that tries to guess a Location as soon as we get a lat/lng.

It adds a JS listener so that changes to the lat/lng fields, either from user input or image autofill, call up a new autocompleter class, ForLocationContaining. This class queries the db to return all MO locations encompassing the lat/lng given, in order of ascending area. The JS then populates the autocomplete options of the Location input with these locations, and auto-fills the place_name and hidden location_id fields with the first (smallest fitting) location.

"phase 2b" would move the UI for creating a custom location to a pop-up modal, available from the "create_obs" form. It would require any undefined place_name to be created as a db Location prior to saving the obs, rather than offering this optionally, after creating the obs, as is currently the case. (It would still not require a Location however — it would only block creating an obs with an undefined place name.)

"phase 2c" is intended to supplement the suggestions in 2a with a call to Google's reverse geolocation service, in the event that MO does not have any matching locations.

coveralls commented 3 months ago

Coverage Status

coverage: 94.366% (-0.09%) from 94.454% when pulling 33d08fc10e31c857072bfbfe493c36d71e7e3887 on create-obs-location into 7ad69b92f469bb769846a650929c37c5d9956807 on create-obs-reorg.

coveralls commented 3 months ago

Coverage Status

coverage: 94.323% (-0.1%) from 94.454% when pulling ac4f40f00077993aa4f2e24acef8b96ab9a42184 on create-obs-location into 7ad69b92f469bb769846a650929c37c5d9956807 on create-obs-reorg.

coveralls commented 3 months ago

Coverage Status

coverage: 94.313% (-0.1%) from 94.454% when pulling 40edfff899db9ccafeef3bcea9ffe51b2b813a71 on create-obs-location into 7ad69b92f469bb769846a650929c37c5d9956807 on create-obs-reorg.

coveralls commented 3 months ago

Coverage Status

coverage: 94.31% (-0.08%) from 94.394% when pulling 5733bf308e2032c978bf8ea6f1ad02d7c25faa90 on create-obs-location into 168b33d1c64a2160a3b3d03e011219e375b0591d on create-obs-reorg.

coveralls commented 3 months ago

Coverage Status

coverage: 94.31% (-0.08%) from 94.394% when pulling 2738e6d26edafcb259fb5c95670f34d1a309cf05 on create-obs-location into e48785cfb8cba36f0f3e846b09321561a7807000 on create-obs-reorg.

coveralls commented 3 months ago

Coverage Status

coverage: 94.389%. remained the same when pulling 6e6ff3e567799c53d4466ec353b13d9fb68e88b3 on create-obs-location into abad11862ab6c4e5e52b2871781f9e367eba603b on create-obs-reorg.

coveralls commented 3 months ago

Coverage Status

coverage: 94.383% (-0.006%) from 94.389% when pulling 06003419feff19d28e2a5f5fbcae82e2a32942eb on create-obs-location into abad11862ab6c4e5e52b2871781f9e367eba603b on create-obs-reorg.

coveralls commented 3 months ago

Coverage Status

coverage: 94.387% (-0.006%) from 94.393% when pulling ac41c99dbe1ff1ce9f8a20f57da3e4d867e5d2ea on create-obs-location into f0140638787c176811629114f21284e90cd68c93 on create-obs-reorg.

coveralls commented 3 months ago

Coverage Status

coverage: 94.387% (-0.006%) from 94.393% when pulling d6a2bc8b255ebff116e9e34cd2d479ddb3e82c23 on create-obs-location into f0140638787c176811629114f21284e90cd68c93 on create-obs-reorg.

coveralls commented 3 months ago

Coverage Status

coverage: 94.392% (-0.007%) from 94.399% when pulling 5aba6851189250c2656f7109d43fadfc6b0df0fe on create-obs-location into 61c1a81ffc06eda9d67373fabca23982de4366f6 on main.

nimmolo commented 3 months ago

TODOs for this phase:

coveralls commented 3 months ago

Coverage Status

coverage: 94.392% (-0.007%) from 94.399% when pulling 5723a4a19fb999471241674a30be80d133d29ff2 on create-obs-location into 61c1a81ffc06eda9d67373fabca23982de4366f6 on main.

coveralls commented 3 months ago

Coverage Status

coverage: 94.392% (-0.007%) from 94.399% when pulling 5723a4a19fb999471241674a30be80d133d29ff2 on create-obs-location into 61c1a81ffc06eda9d67373fabca23982de4366f6 on main.

coveralls commented 3 months ago

Coverage Status

coverage: 94.392% (-0.007%) from 94.399% when pulling b482c83c573eeb34ca85baef06bb1d5a7c5086d0 on create-obs-location into 61c1a81ffc06eda9d67373fabca23982de4366f6 on main.

coveralls commented 3 months ago

Coverage Status

coverage: 94.392% (-0.007%) from 94.399% when pulling 0cea9b353f09590966ee5c1a09de5b5d70a6723d on create-obs-location into 61c1a81ffc06eda9d67373fabca23982de4366f6 on main.

coveralls commented 3 months ago

Coverage Status

coverage: 94.403% (+0.004%) from 94.399% when pulling a2338f560fbe84ee4f2fcb742cfea592ec727a33 on create-obs-location into 61c1a81ffc06eda9d67373fabca23982de4366f6 on main.

nimmolo commented 3 months ago

This is now deployed on the test server, in case you want to check it there.

Reviewers please feel free to discuss/question the overall plan for this "phase" as described up top.

coveralls commented 3 months ago

Coverage Status

coverage: 94.403% (+0.004%) from 94.399% when pulling a2338f560fbe84ee4f2fcb742cfea592ec727a33 on create-obs-location into 61c1a81ffc06eda9d67373fabca23982de4366f6 on main.

nimmolo commented 3 months ago

Issues discovered by @pellaea

coveralls commented 3 months ago

Coverage Status

coverage: 94.458% (+0.004%) from 94.454% when pulling c9c8232eda29a37e134b3f37e9b02db78c2ad872 on create-obs-location into c37bb9c403aef0aafd3d0a92586a5b3e93b9ddfe on main.

coveralls commented 3 months ago

Coverage Status

coverage: 94.458% (+0.004%) from 94.454% when pulling f198304372aa1851fa0734d2f1558a4606e09fd4 on create-obs-location into c37bb9c403aef0aafd3d0a92586a5b3e93b9ddfe on main.

coveralls commented 3 months ago

Coverage Status

coverage: 94.458% (+0.004%) from 94.454% when pulling 09c9ae7309e618e901da85d3bca56ca4e13bf1e6 on create-obs-location into 253c3e7299d33303ac2d176cd1f4dca2106ea9dc on main.

nimmolo commented 3 months ago

This passes tests for me locally now. Idk what's up with CI.