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

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

Merged
merged 79 commits into from
Jun 12, 2024

Conversation

mauberti-bc
Copy link
Collaborator

@mauberti-bc mauberti-bc commented May 23, 2024

Links to Jira Tickets

Description of Changes

Refactors the Manage Animals-related pages to follow SIMS design patterns

  • Create/edit/delete animal workflow
  • Create/edit/delete capture workflow
  • Create/edit/delete mortality workflow
  • Animal profile to display above info

Testing Notes

Requires bcgov/critterbase-api#54, which fixes several related bugs in Critterbase endpoints.

@MacQSL
Copy link
Collaborator

MacQSL commented Jun 7, 2024

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"
        }
    ]
}

@NickPhura
Copy link
Collaborator

NickPhura commented Jun 10, 2024

  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
Copy link
Collaborator

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

@MacQSL
Copy link
Collaborator

MacQSL commented Jun 12, 2024

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?

@MacQSL
Copy link
Collaborator

MacQSL commented Jun 12, 2024

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

Add common names, etc, to animal card when editing existing animal.
Fix route from survey animal table when clicking action menu 'edit'.
@NickPhura
Copy link
Collaborator

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.

Copy link

sonarcloud bot commented Jun 12, 2024

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

Copy link
Collaborator

@MacQSL MacQSL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤯

@MacQSL MacQSL merged commit 34cffde into dev Jun 12, 2024
16 of 19 checks passed
@MacQSL MacQSL deleted the animal-mortality branch June 12, 2024 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants