Skip to content

[BDMS-241 & BDMS-228] Add additional info accordion to well detail page #148

Merged
jirhiker merged 10 commits intostagingfrom
TAM-BDMS-241-AND-228-well-detail-additional-fields
Dec 9, 2025
Merged

[BDMS-241 & BDMS-228] Add additional info accordion to well detail page #148
jirhiker merged 10 commits intostagingfrom
TAM-BDMS-241-AND-228-well-detail-additional-fields

Conversation

@TylerAdamMartinez
Copy link
Contributor

@TylerAdamMartinez TylerAdamMartinez commented Dec 4, 2025

Why

This PR addresses the following problem/context:

  • The Well Detail Page needed an opt-out option to view the remaining useful information about any specific well that the user wants to see.

How

Implementation summary - the following was changed/added/removed:

  • Created a new Additional Information accordion and placed it directly below the hydrograph card to make it the first accordion that the user would see in the list of additional informational accordions.

Notes

Any special considerations, workarounds, or follow-up work to note?

image image

@chasetmartin
Copy link
Collaborator

chasetmartin commented Dec 5, 2025

@TylerAdamMartinez I think that is looking great. My only notes are: can you make some of the fields display 3 columns wide on large screens so there is less vertical distance (like you have for casing info)? And I have a new idea on ordering based on talking with AMP folks. Here is what I'm thinking for order in this section:

  1. Permissions
  2. Well Physical Properties
  3. Geology info
  4. Construction info

For width on large screens:
Completion Date | Driller Name | Construction Method - in one row
Completion Date Source | Construction method source - in one row

Formation Code | Aquifer Systems | Aquifer types - in one row - maybe?

Obviously those one line have to wrap as you see fit when displayed on smaller screens. But I think it would be nice to have less scrolling when the user is on a desktop. Thoughts?

@TylerAdamMartinez TylerAdamMartinez force-pushed the TAM-BDMS-241-AND-228-well-detail-additional-fields branch from de36bd6 to bc34ad3 Compare December 6, 2025 05:39
@TylerAdamMartinez
Copy link
Contributor Author

Captura de pantalla 2025-12-08 a la(s) 12 16 17

@TylerAdamMartinez
Copy link
Contributor Author

Small Devices

Captura de pantalla 2025-12-08 a la(s) 12 25 58 Captura de pantalla 2025-12-08 a la(s) 12 26 25

Large Devices

Captura de pantalla 2025-12-08 a la(s) 12 27 13 Captura de pantalla 2025-12-08 a la(s) 12 27 35

@TylerAdamMartinez
Copy link
Contributor Author

Captura de pantalla 2025-12-08 a la(s) 13 03 26

@TylerAdamMartinez TylerAdamMartinez marked this pull request as ready for review December 8, 2025 19:14
@chasetmartin
Copy link
Collaborator

@codex review

@TylerAdamMartinez TylerAdamMartinez force-pushed the TAM-BDMS-241-AND-228-well-detail-additional-fields branch from 6fb619d to 83de086 Compare December 8, 2025 19:49
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +196 to +198
<Typography variant="h6">Aquifer Systems:</Typography>
<Typography variant="body1">
{well?.aquifers?.map((a) => a.aquifer_system).join(', ') || 'N/A'}

Choose a reason for hiding this comment

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

P1 Badge Guard optional aquifer list before join in AdditionalWellInformation

Rendering this accordion calls well?.aquifers?.map(...).join(', ') without guarding the join when well.aquifers is undefined or null; in that case the map short-circuits to undefined and .join throws a TypeError, breaking the entire well detail page for wells without aquifer metadata. Consider defaulting to an empty array before joining (as done elsewhere in the app) so wells lacking aquifer data still render.

Useful? React with 👍 / 👎.

Comment on lines +404 to +406
<LineItem
title="Casing Materials"
value={well?.well_casing_materials.join(', ')}

Choose a reason for hiding this comment

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

P1 Badge Null-check casing materials before joining in Well PDF

The new PDF section calls well?.well_casing_materials.join(', ') without verifying the array exists. For wells where well_casing_materials is undefined or null (common when data is incomplete), this will throw during PDF generation and prevent the document from rendering. Default to an empty array or skip the line item when the field is absent.

Useful? React with 👍 / 👎.

Comment on lines +443 to +445
<LineItem
title="Aquifer Systems"
value={well?.aquifers?.map((a) => a.aquifer_system).join(', ')}

Choose a reason for hiding this comment

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

P1 Badge Null-check aquifer systems before joining in Well PDF

Similar to casing materials, the PDF now calls well?.aquifers?.map((a) => a.aquifer_system).join(', ') without guarding the join. If aquifers is missing for a well, the map returns undefined and the subsequent join throws, causing PDF generation to fail for wells lacking aquifer metadata. Use a default empty array or optional chaining on the join to keep PDF creation resilient.

Useful? React with 👍 / 👎.

Copy link
Collaborator

@chasetmartin chasetmartin left a comment

Choose a reason for hiding this comment

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

I think it's looking really good. It looks like Codex had a few suggestions that do seem relevant before merging.

@TylerAdamMartinez
Copy link
Contributor Author

Fixed codex reviews. I still need to create and merge two more PRs to fix the Vite and Cypress tests, respectively.

@TylerAdamMartinez TylerAdamMartinez force-pushed the TAM-BDMS-241-AND-228-well-detail-additional-fields branch from 9b372b1 to 179484a Compare December 9, 2025 00:15
Copy link
Collaborator

@chasetmartin chasetmartin left a comment

Choose a reason for hiding this comment

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

The added guards look good

@jirhiker jirhiker merged commit 65a1041 into staging Dec 9, 2025
3 of 4 checks passed
@TylerAdamMartinez TylerAdamMartinez deleted the TAM-BDMS-241-AND-228-well-detail-additional-fields branch December 9, 2025 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants