zooniverse / wildcam-gorongosa-education

This is WildCam Labs, the education/exploration-oriented extension of the WildCam Gorongosa project.
https://lab.wildcamgorongosa.org/
Apache License 2.0
0 stars 1 forks source link

Program filter and assignment create update #325

Closed srallen closed 6 years ago

srallen commented 6 years ago

This updates the WG:L for the current API:

The assignment creation still isn't fully testable because as noted on slack, there's still an issue with the POST request failing permissions with Panoptes, however, the code itself could be reviewed in the interim.

srallen commented 6 years ago

@shaunanoordin I think this is ready for review. One last change is that I added the program filter to the student classroom request. The assignment POST works now with a successful 201 response, though, there's still one last API side bug with the new subject set getting the subjects in the POST linked. So far that appears to be an API only bug.

srallen commented 6 years ago

Noting that the subjects linking now works on the API.

shaunanoordin commented 6 years ago

I just remembered one thing that'll make things a bit weird: there's already a previous +"hardcode the selected Subjects for Assignments when on staging/development",_ code, hidden in AssignmentForm.jsx. It does exactly what the new code does, and it looks like...

    //TESTING: localhost uses 'Bacon' Zooniverse project for Subject IDs.
    //WildCam Gorongosa has no Staging data that we can use to create Subjects.
    //Therefore, we need to hardcode some Subject IDs.
    //--------
    if (!this.editMode() && window.location.hostname === 'localhost') {
      newAssignment.subjects = [
          '4077',
          '4079',
          '4078',
          '4076',
          '4080',
          '4075',
        ];
    }
    //--------

OK, a few notes for this one:

As a result, I'm marking the Bacon code as something that needs to be fixed separately from this PR.

It doesn't matter in practice, since the duplication just means that...