Open russbiggs opened 4 years ago
@JorgeMartinezG @localjo @Eleonore9 we can use this issue to ask questions or provide suggestions for other modifications
How will we look up the display name from the osm_id? If that requires an ajax request, maybe we should store both in the json. Something like:
"campaign_viewers": [
{ osm_id: "123456", name: "Jo Sprague" },
{ osm_id: "987654", name: "Russ Biggs" }
]
@localjo good catch. As discussed I think this can work even though username is editable, for now we will keep it static from the time the user is added. We can look at options to check for updates in future sprints
I'm working on the new campaign creation flow, which depends on some of these changes. Have we started implementing any part of these changes yet in any of our branches? If I'm understanding correctly, this is what the relevant keys in campaign.json should look like;
{
"name": "Campaign Name",
"uuid": "000000000000",
"campaign_creator": "Jo",
"user_id": "123456",
"total_participants_count": 0, // Is this being used?
"participants_count_per_type": {}, // Is this being used?
"campaign_managers": [
{ "osm_id": "123456", "name": "Jo" },
{ "osm_id": "987654", "name": "Russ" }
],
"campaign_viewers": [
{ "osm_id": "564738", "name": "Eleonore" }
],
"features": [
{
"type": "school", // Is this the OSM feature name, or user-entered name?
"total": 345,
"complete": 12
}
],
"contributors": [
{
"osm_id": "192837",
"name": "Jorge",
"teams": [1,3] // What is the teams key and how is it used?
}
]
}
The comments in this snippet have some questions that we'll need to discuss.
The delete campaign function also expects
"campaign_viewers": [
{ osm_id: "123456", name: "Jo Sprague" },
{ osm_id: "987654", name: "Russ Biggs" }
]
I've added the osm_id
to campaign_managers
in this commit. @JorgeMartinezG Can you give this a quick look and see if you think the way I did this will cause any problems? https://github.com/hotosm/MapCampaigner/pull/773/commits/ae8d6d75e12f57cd721a130e7b5123771d318a08
Currently the fields we will need to add to campaign.json are
Updating
campaign_managers
key include osm_id instead of display nameAdd
campaign_viewers
for easier querying when deleting projectsadding
features
key which is an array of objects representing each feature type and their total feature count and complete feature count. This will be used to calculate feature completeness more efficientlye.g.:
adding a
contributors
key to track individual osm user for contributor list and detail pages. We will want to include team keys for these as well