hotosm / fmtm

Field Mapping Tasking Manager - coordinated field mapping.
https://fmtm.hotosm.org/
GNU Affero General Public License v3.0
37 stars 42 forks source link

Project task index as an user facing task_id #1470

Closed Sujanadh closed 3 weeks ago

Sujanadh commented 3 weeks ago

What type of PR is this? (check all applicable)

Related Issue

Describe this PR

N/A

Alternative Approaches Considered

Did you attempt any other approaches that are not documented in code?

Review Guide

Notes for the reviewer. How to test this change?

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

spwoodcock commented 3 weeks ago

Apologies Sujan, I have also been working on XForm related code and have created conflicts for you!

Code look good - we should discuss how best to integrate this into the frontend, as it may require updating a significant number of API endpoints for the frontend to pass the project_id+task_numer combo (instead of the task_id) 👍

Sujanadh commented 3 weeks ago

Only the user-facing id will be that project-specific id like that in QR pop up. But for the endpoints, we can still use the same id that we are using till now. Using both project_id and task_index won't be that good. And except id, we don't have other unique fields.

Sujanadh commented 3 weeks ago

So, we can limit the use of both project_id and task index only in submissions endpoints to interact with odk central.

spwoodcock commented 3 weeks ago

You are definitely right - the project_id and task_index combo isn't a good solution!

Looks like the task details from the API return both the id and index, so the best solution is probably to have both in place: image

We use the task.id for referencing via the API, and use the index for user facing things. Nice update to the data extract task_id by the way 😄 I will update the frontend to show the index, then merge this PR.

spwoodcock commented 3 weeks ago

From a brief look I need to update:

spwoodcock commented 3 weeks ago

All done - could you review this works ok @Sujanadh please? 🙏

Sujanadh commented 3 weeks ago

fixed the entity not being uploaded problem

Sujanadh commented 3 weeks ago

All done - could you review this works ok @Sujanadh please? 🙏

looks good so far

Sujanadh commented 3 weeks ago

One thing I noticed quickly was the order of task completion. Screenshot from 2024-04-24 19-21-18 they are not in ascending order.

spwoodcock commented 3 weeks ago

Nice work - thanks! 🎉