Skip to content
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

Merged
merged 5 commits into from
Nov 28, 2023
Merged

Conversation

katie-gardner
Copy link
Contributor

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 all ciMetadata 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 that cir_instrument_id is being used instead of schema_name or schema_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.

@katie-gardner
Copy link
Contributor Author

Copy link
Contributor

@berroar berroar left a 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?

@katie-gardner
Copy link
Contributor Author

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

@katie-gardner katie-gardner merged commit da6234e into main Nov 28, 2023
@katie-gardner katie-gardner deleted the integrate-with-cir branch November 28, 2023 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants