[API] subprojects and subproject endpoints
Rebased version of https://github.com/aces/Loris/pull/7502
Create a subproject endpoint to support:
GET request to /projects/{project}/subprojects: return all the existing subprojects. GET request to /projects/{project}/subprojects/{subproject} : return a subproject with supported VisitName from the database.
I haven't looked at them in depth, but maybe the php/libraries changes should be moved out to a different PR? They seem useful on their own and only need to be documented to make sense to internal LORIS developers, not external API users.
@driusan, what are the changes requested? I only see questions and a suggestion.
Changes requested
- Add an expository paragraph or 2 to explain what the API user is getting when they access the endpoint, so they know why they would want to do that. The answers to the questions can be a good starting point for that.
- Remove WindowDifference
- Possibly remove RecruitmentTarget, depending on if there's a reasonable explanation for why it's useful to an API user (based on 1)
The question of if the asymmetry with "Visits" makes sense also needs to be resolved.
@driusan Remove WindowDifference why? this is a property of a subproject.
@driusan Possibly remove RecruitmentTarget something like the dashboard could use that to create the chart.
@driusan I have removed SubprojectID, WindowDifference and RecruitmentTarget in the subproject details. The /subprojects endpoint now returns an array of title+link. Having the details in a single endpoint obfuscate the asymmetry problem.
--
There was 1 failure:
1) NextStageTestIntegrationTest::testNextStageDoespageLoad
Failed asserting that [<dashboard page body>] contains "Next Stage".
/app/modules/next_stage/test/next_stageTest.php:46
restarting jobs
There was 1 error:
1) EEGBrowserIntegrationTest::testEEGBrowserSortableByColumn
restarting jobs
There was 1 error:
1) TestInstrumentTestIntegrationTest::testTextElement
restarting
@driusan I think your comments have been addressed.
Consensus is that subproject should be renamed "Cohort" mostly because they are not sub entities of projects. The endpoint should be at the root and not under projects.