Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add REST API service @tool-versions.
Sample contents if you are on a survey group with two surveys: ``` { "@id": "http://localhost:8000/tool-creator/sectors/eu/covid-19/covid-19/@tool-versions", "@type": "euphorie.surveygroup", "items": [ { "@id": "http://localhost:8000/tool-creator/sectors/eu/covid-19/covid-19/oira-tool-import", "created": "2021-05-28T08:14:51+00:00", "id": "oira-tool-import", "modified": "2022-09-30T13:48:45+00:00", "published": "2021-08-30T11:57:27", "review_state": "published", "title": "OiRA Tool import" }, { "@id": "http://localhost:8000/tool-creator/sectors/eu/covid-19/covid-19/second-version-based-on-import", "created": "2021-05-28T08:14:51+00:00", "id": "second-version-based-on-import", "modified": "2024-06-07T08:59:54+00:00", "published": "2024-07-19T18:26:05", "review_state": "published", "title": "Second version based on import" } ], "surveygroup": { "@id": "http://localhost:8000/tool-creator/sectors/eu/covid-19/covid-19", "title": "COVID-19" } } ``` Sample contents when you are on a survey and it has one sibling: ``` { "@id": "http://localhost:8000/tool-creator/sectors/eu/covid-19/covid-19/second-version-based-on-import/@tool-versions", "@type": "euphorie.survey", "items": [ { "@id": "http://localhost:8000/tool-creator/sectors/eu/covid-19/covid-19/oira-tool-import", "created": "2021-05-28T08:14:51+00:00", "id": "oira-tool-import", "modified": "2022-09-30T13:48:45+00:00", "published": "2021-08-30T11:57:27", "review_state": "published", "title": "OiRA Tool import" } ], "survey": { "@id": "http://localhost:8000/tool-creator/sectors/eu/covid-19/covid-19/second-version-based-on-import", "created": "2021-05-28T08:14:51+00:00", "id": "second-version-based-on-import", "modified": "2024-06-07T08:59:54+00:00", "published": "2024-07-19T18:26:05", "review_state": "published", "title": "Second version based on import" }, "surveygroup": { "@id": "http://localhost:8000/tool-creator/sectors/eu/covid-19/covid-19", "title": "COVID-19" } } ``` We probably need more info or less. But it's a nice start. Let me paste what I have put in the docstring of this service, as explanation. From the Quaive side we request this. Then we know if we are on a path that is within a survey group, and we can show info about the versions, if we want. This is meant to show information about versions like on the left in the prototype: https://proto.quaivecloud.com/tools/audio-visual-productions/edit We need this information in the sidebar. And we don't yet have a way of knowing what the "remote" portal_type is of the path we are viewing in Quaive, so we don't know if we are currently viewing a country or survey group or survey or risk. So from the Quaive side we have no idea if we should show this version information. An extra REST API service then seems a good way to me.
- Loading branch information