Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

campaign.json updates #765

Open
russbiggs opened this issue Nov 8, 2019 · 6 comments
Open

campaign.json updates #765

russbiggs opened this issue Nov 8, 2019 · 6 comments
Assignees

Comments

@russbiggs
Copy link
Contributor

Currently the fields we will need to add to campaign.json are

Updating campaign_managers key include osm_id instead of display name

Add campaign_viewers for easier querying when deleting projects

    "campaign_viewers": [
        "123456",
        "987654"
    ],

adding 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 efficiently

e.g.:

        "features": [
            {"type":"school",
            "total":345,
            "complete":12
            }
        ]

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

    "contributors": [
        {"osm_id": 12345,
         "teams": [1,3]
        }
    ]
@russbiggs
Copy link
Contributor Author

@JorgeMartinezG @localjo @Eleonore9 we can use this issue to ask questions or provide suggestions for other modifications

@localjo
Copy link
Collaborator

localjo commented Nov 8, 2019

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" }
]

@russbiggs
Copy link
Contributor Author

@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

@localjo
Copy link
Collaborator

localjo commented Nov 22, 2019

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.

@Eleonore9
Copy link
Collaborator

The delete campaign function also expects

"campaign_viewers": [
  { osm_id: "123456", name: "Jo Sprague" },
  { osm_id: "987654", name: "Russ Biggs" }
]

#762

@localjo
Copy link
Collaborator

localjo commented Nov 22, 2019

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? ae8d6d7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants