Skip to content

SIMSBIOHUB-490/521: Import Observations with measurements#1227

Merged
NickPhura merged 211 commits into
devfrom
SIMSBIOHUB-490
Mar 12, 2024
Merged

SIMSBIOHUB-490/521: Import Observations with measurements#1227
NickPhura merged 211 commits into
devfrom
SIMSBIOHUB-490

Conversation

@al-rosenthal
Copy link
Copy Markdown
Contributor

@al-rosenthal al-rosenthal commented Mar 1, 2024

Links to Jira Tickets

SIMSBIOHUB-490
SIMSBIOHUB-521

Description of Changes

  • Added support for measurement columns to observation imports
  • Added custom validation to measurement columns

Note: Test coverage needs updating still, but we plan to merge this to Dev first, so QA can proceed in the meantime.

New Env Vars

API_RESPONSE_VALIDATION_ENABLED
DATABASE_RESPONSE_VALIDATION_ENABLED
NUM_SEED_OBSERVATIONS_PER_SURVEY
NUM_SEED_SUBCOUNTS_PER_OBSERVATION (We only really support a value of 1 for this)

Testing Notes

CSV Upload

Requires critterbase SIMSBIOHUB-471-ITIS branch to be running locally
Only valid TSN: 180596
Valid Measurements:
Juvenile at heel indicator (true, false)
Life Stage (Adult, Subadult, Young of Year, Juvenile, Neonate)
Estimated age (min 0)
Juvenile count (min 0)

  • Get test file attached to SIMBIOHUB-490 ticket
  • Navigate to observation management page
  • Upload CSV
  • See new wolf observations appear in table
  • See new measurement data at the end of the table
  • Modify the CSV to try different valid and invalid combinations

Life Stage is currently applied twice to the TSN: 180596 which is a data issue with the critterbase seed data

NickPhura and others added 30 commits February 2, 2024 17:54
- Manage column components (initial structure)
- Autocomplete with stubbed response (issue: input clearing on option select)
- Not wired up to sims backend yet
- Not wired up to observations table yet
Comment thread api/src/utils/xlsx-utils/worksheet-utils.ts Outdated
Comment thread api/src/utils/xlsx-utils/worksheet-utils.ts
Comment thread api/src/utils/xlsx-utils/worksheet-utils.ts Outdated
Comment thread app/src/contexts/observationsTableContext.tsx Outdated
Comment thread app/src/contexts/observationsTableContext.tsx Outdated
Comment thread app/src/contexts/observationsTableContext.tsx Outdated
Comment thread app/src/features/projects/ProjectsRouter.tsx
Comment thread app/src/utils/Utils.tsx Outdated
curtisupshall

This comment was marked as resolved.

@NickPhura
Copy link
Copy Markdown
Contributor

NickPhura commented Mar 12, 2024

Two things I noticed while testing:

1. Column widths are a bit off (see attached image).

2. The new measurement columns should not be marked as `sortable` in the DataGrid.

image

Updated to make the measurement columns not sortable.
The widths will probably have to be a Jer thing. Right now they just match the dropdown and number widths of the other fields.

curtisupshall
curtisupshall previously approved these changes Mar 12, 2024
Copy link
Copy Markdown
Contributor

@curtisupshall curtisupshall left a comment

Choose a reason for hiding this comment

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

LGTM. Nice work!

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link
Copy Markdown
Contributor

@NickPhura NickPhura left a comment

Choose a reason for hiding this comment

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

🐀

@NickPhura NickPhura merged commit decf49e into dev Mar 12, 2024
@NickPhura NickPhura deleted the SIMSBIOHUB-490 branch March 12, 2024 22:48
KjartanE pushed a commit that referenced this pull request Mar 13, 2024
Updates to survey observation api/app components:
- Support import of Critterbase measurement columns in observation CSV.
- Support add/edit/view of Critterbase measurement columns in observation table.
- Misc tech debt, enhancements, improvements.

---------

Co-authored-by: Nick Phura <nickphura@gmail.com>
Co-authored-by: jeznorth <twenty15creative@gmail.com>
KjartanE pushed a commit that referenced this pull request Mar 13, 2024
Updates to survey observation api/app components:
- Support import of Critterbase measurement columns in observation CSV.
- Support add/edit/view of Critterbase measurement columns in observation table.
- Misc tech debt, enhancements, improvements.

---------

Co-authored-by: Nick Phura <nickphura@gmail.com>
Co-authored-by: jeznorth <twenty15creative@gmail.com>
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.

5 participants