-
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
Integrate sds with launcher #49
Conversation
… sds_dataset_id is required by survey,
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.
LGTM
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.
👍
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.
You need to clear the browser cache and it would fix this @berroar |
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.
I can't find anything except some whitespace and what @berroar mentioned above.
What is the context of this PR?
This PR is the launcher component of the ticket to Integrate SDS with Launcher. When a schema is selected, the
survey_id
of that schema is retrieved and returned along with the metadata so that if the metadata also containssurvey_id
, then it will be pre-populated with thesurvey_id
of the survey (to make life easier for devs)The metadata
survey_id
can be changed to anything, and when bothsurvey_id
andperiod_id
are populated fields in the metadata, and when either of them change, a new call is made to the mock endpoint in the corresponding runner PR to fetch the SDS datasets and use them to fill the dropdown list.Changes
Adjusted
launch.go
to replace themetadataHandler
with asurveyDataHandler
. This is because we need thesurvey_id
from the schema, to pre-populate anysurvey_id
that might be found in metadata, and it was not enough to return the metadata alone to render the page.Additionally in
launch.go
added a similarsupplementaryDataHandler
to intercept any requests to thesupplementary-data
url in the front-end and make the request to the mock end point with proper handlingThe actual fetching of supplementary datasets is done in
surveys.go
in a similar style to other fetches and using theDatasetMetadata
struct to model the response, as per the sds api documentationlaunch.html
has been refactored to improve the way fetches were being done, make reusable components for the various input fields and whenever the schema changes and metadata is populated, check for a survey id and period id in the metadata and fetch supplementary datasets if both can be found.If supplementary datasets are found, the supplementary data div is displayed and populated with the selected dataset
How to review
go run launch.go
make dev-compose-up
as normal (delete the launcher container if that is built despite launcher already being run)python -m scripts.mock_sds_endpoint
test_supplementary_data
test_supplementary_data_with_multiple_datasets
sds_dataset_ids
in thesds_dataset_id
dropdown. The first one will auto-select.test_supplementary_data
ortest_supplementary_data_with_multiple_datasets
.sds_dataset_id
dropdown should clear of options, and the Launch Survey button should not be available, as the survey requires ansds_dataset_id
value.How to review