SIMSBIOHUB-579/583: Updated Animal Workflow (Capture, Mortality, Measurements, Profile)
Links to Jira Tickets
- https://apps.nrs.gov.bc.ca/int/jira/browse/SIMSBIOHUB-579
- https://apps.nrs.gov.bc.ca/int/jira/browse/SIMSBIOHUB-583
Description of Changes
Refactors the Manage Animals-related pages to follow SIMS design patterns
- Create/edit animal workflow
- Create/edit capture workflow
- Animal profile to display
Testing Notes
Requires https://github.com/bcgov/critterbase-api/pull/53, which fixes a bug when deleting multiple critter attributes (markings, measurements, etc.)
Codecov Report
Attention: Patch coverage is 8.04170% with 1235 lines in your changes missing coverage. Please review.
Project coverage is 49.15%. Comparing base (
70bf407) to head (d32c456).
Additional details and impacted files
@@ Coverage Diff @@
## dev #1291 +/- ##
==========================================
- Coverage 52.65% 49.15% -3.50%
==========================================
Files 581 639 +58
Lines 16757 17875 +1118
Branches 2600 2801 +201
==========================================
- Hits 8823 8787 -36
- Misses 7344 8504 +1160
+ Partials 590 584 -6
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Openshift URLs for the PR Deployment:
- App Route: https://biohubbc-app-1291-af2668-dev.apps.silver.devops.gov.bc.ca/
- Api Route: https://biohubbc-api-1291-af2668-dev.apps.silver.devops.gov.bc.ca/
- Pods: https://console.apps.silver.devops.gov.bc.ca/k8s/ns/af2668-dev/pods?name=1291
Few things I noticed:
- Looks like the markings cards are missing some margins between them (ignore if intended)
- The save on Mortality failed when entered a measurement value (I cleared and re-added). Looks like the value is not being removed when it switches from qualitative<->quantitative error:
{
"error": "Zod validation failed.",
"issues": [
{
"code": "unrecognized_keys",
"keys": [
"value"
],
"path": [
0
],
"message": "Unrecognized key(s) in object: 'value'"
}
]
}
request body:
{
"markings": [
{
"_id": "cab39c06-062a-4419-968c-69b8f03f30c0",
"marking_type_id": "3e24234e-dea6-445d-9e18-5987fad81d67",
"taxon_marking_body_location_id": "3618a897-fee3-45d3-8629-6e1c6a6c5ec4",
"identifier": "asdfasdf",
"primary_colour_id": "618c811b-4e05-462a-a01f-d3814613ae79",
"secondary_colour_id": "618c811b-4e05-462a-a01f-d3814613ae79",
"comment": "asdfasdfasdf",
"critter_id": "8fc1f48a-4328-43d3-aa07-da0684e89857",
"mortality_id": "1cb8468b-d32e-40f7-b561-20e1e6a2524c"
},
{
"_id": "272974c6-137f-4c23-a344-4cb102bab78e",
"marking_type_id": "3e24234e-dea6-445d-9e18-5987fad81d67",
"taxon_marking_body_location_id": "1c028dcf-9108-49b7-9a51-be233cbf0c8b",
"identifier": "asdfasdf",
"primary_colour_id": "0a861e69-e452-4a8c-a3bd-6ddf362254bc",
"secondary_colour_id": null,
"comment": null,
"critter_id": "8fc1f48a-4328-43d3-aa07-da0684e89857",
"mortality_id": "1cb8468b-d32e-40f7-b561-20e1e6a2524c"
}
],
"qualitative_measurements": [
{
"taxon_measurement_id": "30d6ca71-e4a7-419b-b392-225332f4db44",
"qualitative_option_id": "8646875f-34d8-4469-9500-6a7cd30d88ae",
"value": 234,
"critter_id": "8fc1f48a-4328-43d3-aa07-da0684e89857",
"mortality_id": "1cb8468b-d32e-40f7-b561-20e1e6a2524c"
}
],
"quantitative_measurements": [
{
"taxon_measurement_id": "30d6ca71-e4a7-419b-b392-225332f4db44",
"qualitative_option_id": "8646875f-34d8-4469-9500-6a7cd30d88ae",
"value": 234,
"critter_id": "8fc1f48a-4328-43d3-aa07-da0684e89857",
"mortality_id": "1cb8468b-d32e-40f7-b561-20e1e6a2524c"
}
]
}
- Looks like the markings cards are missing some margins between them (ignore if intended)
- Fixed
- The save on Mortality failed when entered a measurement value (I cleared and re-added). Looks like the value is not being removed when it switches from qualitative<->quantitative
- Fixed
@MacQSL Okay I've pushed all of my review related changes up. I believe I've covered everything. Ill give it one more round of manual tests tomorrow morning to make sure.
Few minor tech debt things which are outside scope of this PR, but putting here to track them.
- The capture map icons appear clickable, maybe we should disable that or allow the capture to be edited on click?
- The icon beside 'Cervidae' almost appears to be a tooltip or some hoverable info action.
- The release locations don't appear on the map (maybe they should?)
- The measurement cards look like they could use some additional styling help
- Feels like the capture / mortality map components should share the same map component?
The edit animal action from the 'Survey Page' doesn't select the animal in the manage animals page.
The previous implementation was using url query params to keep the selected animal state. This will also fix the animal from being unselected on a page refresh.
The edit animal action from the 'Survey Page' doesn't select the animal in the manage animals page. The previous implementation was using url query params to keep the selected animal state. This will also fix the animal from being unselected on a page refresh.
This should be fixed.
I also added 'startCase' calls to the marking and measurement labels, and updated the species card to show common names, etc, when editing an existing animal.
Quality Gate failed
Failed conditions
2 Security Hotspots
10.0% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)
See analysis details on SonarCloud
Catch issues before they fail your Quality Gate with our IDE extension
SonarLint
