activity
activity copied to clipboard
Add help text to Zoom field
Current behavior When updating the zoom for a map and the value has a decimal an error is displayed when you click on the update button.
To Reproduce Steps to reproduce the behavior:
- To the Maps tab in the Organization settings page
- Select a country code, admin boundary, latitude and longitude
- Enter a zoom value that has a decimal e.g 6.4
- Click on the update button
- "There was a problem updating data" error is displayed
Expected behavior
There should be help text thats says:
Select a zoom level between 1-18 (whole number only) for the map.
Note:
It looks like 0 doesn't work nicely and the zooming stops at 18.
Screenshots
Hey @sannleen I think the Zoom level shouldn't accept decimals as we're trying to follow a standard zoom level scale: https://wiki.openstreetmap.org/wiki/Zoom_levels. But good point, user may not know this so we can look at adding help text. If you think that would be enough, maybe we can revise this issue to add help text instead?
Can the field be made a integer only field? If not we can add a help text.
@sannleen Good catch. Indeed the zoom
attribute is defined as an integer in the Workflow app: https://github.com/hikaya-io/activity/blob/dev/workflow/models.py#L191
I don't know exactly what this zoom level entails, but is rounding it to the nearest integer in the form (before insertion) not a viable option? Or does it make a noticeable difference? If it is the same, then we would rather have the form adapt the input, than changing the model and adding an additional migration.
Or even better than implicitly rounding it, let's maybe just set the input field to an integer.
UPDATE: Let's keep the zoom level as an integer and not support decimals. We can use this card to add a help text that says
Select a zoom level between 1-18 for the map.
Note:
It looks like 0 doesn't work nicely and the zooming stops at 18.
I just implemented this.