BMMRO-tech / BMMRO

MIT License
3 stars 5 forks source link

Refresh Button to update lat/long on habitat form #171

Closed lroyTW closed 2 years ago

lroyTW commented 3 years ago

Background

As a Research Scientist I want to be able to refresh the Lat / Long of a Habitat So that positioning data is updated when I arrive at the Encounter

Currently the Lat / Long are auto-populated when creating a New Habitat, they can also be manually populated if out of range.

However research scientists may begin the Encounter and Habitat before they reach the animals, a refresh button would allow the Researchers to refresh the Lat / Long positional data once in the correct position.

Behavior

Assets to be used from the nounproject:

https://thenounproject.com/icon/refresh-815229/

The "refresh" button should sit between the Longitude field and the GPS Mark field, with appropriate level of spacing.

The refresh button and its functions should be on the New and Edit Habitat forms, NOT on Exported Habitats.

Clicking the refresh button will try to retrieve new Geolocation values, and replace Lat / Long if successful.

Whilst the Geolocation is being loaded, the button icon should be spinning AND disabled for further clicking

IF out of range or other Geolocation error THEN there should be error text in form "Geolocation could not be retrieved" AND the button should be available again.

Further Ideas

IF out of range or other Geolocation error AND there were already populated Lat / Long data THEN a modal should pop up.

Pop Up prompt "Geolocation could not be retrieved. Clear?" Prompt Option 1: "Yes", clear Lat / Long and return to form Prompt Option 2: "No", keep current Lat / Long and return to form AND in both cases the button should be available again.

Reminders

josh-simpson-TW commented 2 years ago

Do we need the refresh button to spin while we wait? Yes Should the refresh button be disabled whilst a request is already being handled? Yes Should we have the refresh button disabled/spinning on new form? Not needed???? Do we need the button on the edit of already ended habitat? Yes