Open dereklieu opened 8 years ago
This looks solid. Although the object may be more convenient, I'd go with the array. If we need to attach more info it can handle it, or you think this won't be necessary? Where would you query the server for the task details?
@danielfdsilva I didn't get to this last week, but wanted to do a write-up of how I would try to approach this.
First I would attach a function on
window.context
which iD uses to preserve state, in id.js:Up to you whether the data structure is be an array or an object, an object seems convenient to do like
{TASK_1: true, TASK_2: false}
corresponding to whether the task is marked finished, but it could just as easily be[{id: TASK_1, completed: true}, {id: TASK_2, completed: false}]
Then I would check for a task id in the url query around the same place where the
bounds
query is in #67. This would populate the initial task ids.The third step is a little harder because it involves rendering the UI. In commit.js I would generate some HTML form elements by attaching
context.taskIDs()
tod3.data()
, with event handlers to listen for user validation that the task is finished.Finally, I would
post
the appropriate task IDs to the API concurrent with thechangeset
upload inconnection.js
@danielfdsilva let me know if you have questions or thoughts here, as we're still not in that different a time zone, just going the other way now :)