akvo / akvo-flow-mobile

Akvo Flow app
GNU General Public License v3.0
18 stars 16 forks source link

Do not allow to add another geoshape once 1st is saved #1642

Closed janagombitova closed 3 years ago

janagombitova commented 4 years ago

Do not allow to add shape when editing an existing one

Today once I create a geoshape and save it I can go back to edit it, or add another one to it. After talks with some users, having more shapes in one answer is not desired. We should stick to the rule (for all future data submissions) one shape per question. So after saving the shape, Alphonso can only go back and edit the existing shape.

geoshape2

Originally posted by @janagombitova in https://github.com/akvo/akvo-flow-mobile/issues/1215#issuecomment-531187031

Handling geoshape type - points

This should apply for all shape types (points, lines and areas). Secondly, today we allow more points as part of the geoshape question. We should consider allowing only one point per answer and even question if we need to support the type point as a geoshape considering we have the geolocation question type.

valllllll2000 commented 4 years ago

Unfortunately our geoshape implementation is incomplete, see https://geojson.org/

GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, and MultiPolygon

We support: Polygon, MultiPoint and LineString

I think we should:

Problem: What will happen with old app versions if we make the change? We need to make sure to tell those users to update if they want to use the new geoshpes

valllllll2000 commented 4 years ago

I have give it a bit more thought.

1) Point I think in reality we don't really need adding: Point, MultiPoint can be used, plus for one point geolocation questions make more sense.

2) Multipoint App: "Points" Dashboard "Allow creation of points" We should update the flow dashboard UI and flow app to say it is a "Multipoint" but xml format for forms should stay the same for compatibility reasons. Validation: at least 2 points

3) LineString App: "Line" Dashboard: "Allow creation of lines" This should ne only one LineString. We need to update the dashboard to say "Allow creation of a LineString" Validation: at least 2 points

4) MultiLineStrings This does not exist but since we allow multiple shapes it is possible to add it but the implementation is not really correct as we do not use MultiLineStrings but multiple LineString. We could add this to both app and dashboard.

5) Polygon App: "Area" Dashboard: "Allow creation of areas" In both cases we should replace the word area/areas by Polygon without modifying the xml format.

6) MultiPolygon Same comment as 4). We could add it.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.