biohubbc icon indicating copy to clipboard operation
biohubbc copied to clipboard

SIMSBIOHUB-579/583: Updated Animal Workflow (Capture, Mortality, Measurements, Profile)

Open mauberti-bc opened this issue 1 year ago • 1 comments

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.)

mauberti-bc avatar May 23 '24 17:05 mauberti-bc

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).

Files Patch % Lines
...ile/captures/capture-form/edit/EditCapturePage.tsx 0.00% 81 Missing :warning:
...tures/surveys/animals/list/AnimalListContainer.tsx 0.00% 76 Missing :warning:
...ortality/mortality-form/edit/EditMortalityPage.tsx 0.00% 71 Missing :warning:
...captures/capture-form/create/CreateCapturePage.tsx 0.00% 61 Missing :warning:
...urveys/animals/animal-form/edit/EditAnimalPage.tsx 0.00% 55 Missing :warning:
...lity/mortality-form/create/CreateMortalityPage.tsx 0.00% 55 Missing :warning:
.../surveys/animals/profile/markings/MarkingsForm.tsx 0.00% 47 Missing :warning:
.../components/location/CaptureLocationMapControl.tsx 0.00% 46 Missing :warning:
...omponents/location/MortalityLocationMapControl.tsx 0.00% 42 Missing :warning:
...ys/animals/animal-form/create/CreateAnimalPage.tsx 0.00% 41 Missing :warning:
... and 83 more
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.

codecov[bot] avatar May 30 '24 16:05 codecov[bot]

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

github-actions[bot] avatar Jun 03 '24 22:06 github-actions[bot]

Few things I noticed:

  1. Looks like the markings cards are missing some margins between them (ignore if intended) image
  2. 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"
        }
    ]
}

MacDeluca avatar Jun 07 '24 21:06 MacDeluca

  1. Looks like the markings cards are missing some margins between them (ignore if intended)
  • Fixed
  1. 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

NickPhura avatar Jun 10 '24 18:06 NickPhura

@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.

NickPhura avatar Jun 11 '24 00:06 NickPhura

Few minor tech debt things which are outside scope of this PR, but putting here to track them.

  1. The capture map icons appear clickable, maybe we should disable that or allow the capture to be edited on click? image
  2. The icon beside 'Cervidae' almost appears to be a tooltip or some hoverable info action. image
  3. The release locations don't appear on the map (maybe they should?)
  4. The measurement cards look like they could use some additional styling help image
  5. Feels like the capture / mortality map components should share the same map component?

MacDeluca avatar Jun 12 '24 00:06 MacDeluca

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. image

MacDeluca avatar Jun 12 '24 00:06 MacDeluca

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. image

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.

NickPhura avatar Jun 12 '24 00:06 NickPhura

Quality Gate Failed 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

sonarqubecloud[bot] avatar Jun 12 '24 00:06 sonarqubecloud[bot]