hotosm / osm-tasking-manager2

Designed and built for Humanitarian OpenStreetMap Team collaborative emergency/disaster mapping, the OSM Tasking Manager 2.0 divides an area into individual squares that can be rapidly mapped by thousands of volunteers.
http://tasks.hotosm.org
Other
425 stars 156 forks source link

Don't fetch all users list when opening the contribute panel #923

Open pgiraud opened 7 years ago

pgiraud commented 7 years ago

The complete list of users is loaded via the users.json request when starting to contribute on a task. This is useful to be able to mention a user in the comment field. This request is heavy and not always required. See https://github.com/hotosm/osm-tasking-manager2/issues/918#issuecomment-269898668

We should find a better way to handle this and potentially do the filter queries on the server on-the-fly.

CloCkWeRX commented 7 years ago

Shifted from comment on #926 - I think that'll help, but we might want further work on the feature - this data supports @notifications; which are very often common to the task or even project you are looking at.

I think the call to /stats for a project already contains a list of users; potentially loading that to populate the typeahead might be even more efficient

pgiraud commented 7 years ago

@CloCkWeRX I agree with you. The list should by default show the users who contributed to the task and then project first.

pgiraud commented 7 years ago

Instead of query the whole list of users at once, we should do some server side filtering. At.js support server side filtering. See https://github.com/hotosm/osm-tasking-manager2/pull/926#issuecomment-270066060