-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add support for launching CIR Surveys #59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just been testing this PR - A bit weird that you can select survey_type "Social" and then Launch a Business Schema with no issues? Do we need the survey_type for CIR?
I do agree with this, but I think might be one to do if the CIR has an update to include it in the metadata? Then we can really easily remove it, or infer it in a follow up |
What is the context of this PR?
This PR adds support for launching surveys that have come from CIR. A new env var
CIR_API_BASE_URL
has been added just like the SDS one for the base url of the service. By default it is that of the mock CIR. The backend uses this to fetch allciMetadata
and populate a new dropdown in launcher for CIR schemas. Just like with Runner, if the service is down, launcher will continue to work, but not populate the dropdown.On Selection of a CIR schema and survey type clicking
Load Schema
will fetch the schema from CIR and use it to populate the Survey Metadata. It will use the attributes of the option to populate CIR Metadata (version, title, description, etc.)The existing approach to disabling fields has been removed in favour of clearing fields when switching the launch type. So that you can easily swap between CIR schemas, Schema URL and Schema Name without needing to empty local storage. Local storage saving has also been extended to save the cir schema or schema url so repeated testing via these options is easier.
How to review
To test functionally, switch to the Runner branch with support for CIR and the Mock CIR branch of the mock repo
Run
make load-schemas
in both runner and the Mock CIR then start launcher. You should be see all the schemas in the CIR Schemas dropdown, with their names and language. Selecting and launching one should work, and the dump and submission endpoints should show thatcir_instrument_id
is being used instead ofschema_name
orschema_url
Check that the launcher UI works as expected when swapping between the different types of schema launches and when refreshing the page. Additionally, check it still works for normal schemas when CIR is down.