Loris icon indicating copy to clipboard operation
Loris copied to clipboard

[API] subprojects and subproject endpoints

Open xlecours opened this issue 4 years ago • 10 comments

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.

xlecours avatar Oct 28 '21 13:10 xlecours

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 avatar Oct 28 '21 16:10 driusan

@driusan, what are the changes requested? I only see questions and a suggestion.

xlecours avatar Oct 28 '21 18:10 xlecours

Changes requested

  1. 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.
  2. Remove WindowDifference
  3. 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 avatar Oct 28 '21 19:10 driusan

@driusan Remove WindowDifference why? this is a property of a subproject.

xlecours avatar Oct 28 '21 19:10 xlecours

@driusan Possibly remove RecruitmentTarget something like the dashboard could use that to create the chart.

xlecours avatar Oct 28 '21 19:10 xlecours

@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.

xlecours avatar Oct 28 '21 20:10 xlecours

--

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

xlecours avatar Oct 29 '21 12:10 xlecours

There was 1 error:

1) EEGBrowserIntegrationTest::testEEGBrowserSortableByColumn

restarting jobs

xlecours avatar Oct 29 '21 17:10 xlecours

There was 1 error:

1) TestInstrumentTestIntegrationTest::testTextElement

restarting

xlecours avatar Nov 01 '21 18:11 xlecours

@driusan I think your comments have been addressed.

xlecours avatar Nov 16 '21 16:11 xlecours

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.

xlecours avatar Nov 29 '22 21:11 xlecours