WDFN-815 Add Text Fields for Parameter Code and Location IDs and a 'Draw graph' button
Before making a pull request
-
Put the appropriate EXEMPT flag if needed in the MR label (see https://practices.wma.chs.usgs.gov/practice/peer_code_review/) -
Run all linters (make lint) -
Run all tests (make test) -
Update the changelog appropriately -
If making a release, update code.json metadataLastUpdated and bump CHANGELOG.md to next version.
WDFN-815 Add Text Fields for Parameter Code and Location IDs and a 'Draw graph' button
The changes here add form fields for location IDs and a parameter code. Once the IDs and parameter has been entered and the 'Draw graph' button pressed. The code will make up to three calls to the site service and place that data in the application state. Pinia is used as the state management tool and the pinia/testing package was added to allow for the creation of 'testing pinias' in unit tests.
The code is not optimized to check if data has been fetched and not re-fetch it, which would be good. It also uses a hard coded 'P7D'for the time span, but the code as is could accept different time spans.
There is a error alert when things fail. It reports which ID didn't return data, and will show the parameter name if it can get it (only possible if at least one call works) if not it will show the parameter code.
Image - fields and error message
The state holds the parameter details if it can get them, and then will hold one location object for each location entered. If the location ID is not valid or the is no data for that parameter at that location it will add a object with the locationId but no values. This way we can keep track of which locations fetched data successfully and which did not, and we can still graph the locations that worked.
Image - structure of the state showing a location with no data
After making a pull request
-
If appropriate, put the link to the PR in the JIRA ticket -
Assign someone to review unless the change is trivial -
Check the accessibility CI step and fix or explain any issues.