From e0240d4c1eb282d741fe46bd4699caf61596feff Mon Sep 17 00:00:00 2001 From: jross Date: Mon, 30 Mar 2026 15:09:47 -0600 Subject: [PATCH 1/4] refactor(well-info): Simplify layout and enhance FieldRow component for better readability --- src/components/WellShow/ConstructionInfo.tsx | 39 ++++-- .../WellShow/GeologyInformation.tsx | 91 +++++++++----- .../WellShow/WellPhysicalProperties.tsx | 115 ++++++++++-------- src/components/card/CoreWellInfo.tsx | 39 ++++-- .../card/RecentWaterLevelObservations.tsx | 11 +- 5 files changed, 198 insertions(+), 97 deletions(-) diff --git a/src/components/WellShow/ConstructionInfo.tsx b/src/components/WellShow/ConstructionInfo.tsx index df2200c7..6493ed70 100644 --- a/src/components/WellShow/ConstructionInfo.tsx +++ b/src/components/WellShow/ConstructionInfo.tsx @@ -54,16 +54,41 @@ const Section = ({ children }: { children: React.ReactNode }) => ( const FieldRow = ({ label, value }: { label: string; value: string }) => ( - + {label} - {value} + + {value} + ) @@ -78,7 +103,7 @@ const FieldGroup = ({ }) => ( - + { - - - - Formation Completion Code: - - - {well?.formation_completion_code || 'N/A'} - - - - - Aquifer Systems: - - - {(well?.aquifers ?? []) + + + a?.aquifer_system) ?.filter(Boolean) - ?.join(', ') || 'N/A'} - - - - - Aquifer Types: - - - {well?.aquifers && well.aquifers.length > 0 - ? [ - ...new Set(well.aquifers.flatMap((a) => a.aquifer_types)), - ].join(', ') - : 'N/A'} - - + ?.join(', ') || 'N/A' + } + /> + 0 + ? [...new Set(well.aquifers.flatMap((a) => a.aquifer_types))].join(', ') + : 'N/A' + } + /> ) } + +const FieldRow = ({ label, value }: { label: string; value: string }) => ( + + + {label} + + + {value} + + +) diff --git a/src/components/WellShow/WellPhysicalProperties.tsx b/src/components/WellShow/WellPhysicalProperties.tsx index 2a460f4e..3f57aa8e 100644 --- a/src/components/WellShow/WellPhysicalProperties.tsx +++ b/src/components/WellShow/WellPhysicalProperties.tsx @@ -10,56 +10,73 @@ export const WellPhysicalPropertiesAccordion = ({ well }: { well?: IWell }) => { - - - - Casing Diameter: - - - {well?.well_casing_diameter?.toFixed(2) || 'N/A'} - {well?.well_casing_diameter - ? ` ${well?.well_casing_diameter_unit}` - : null} - - - - - Casing Depth: - - - {well?.well_casing_depth?.toFixed(2) || 'N/A'} - {well?.well_casing_depth - ? ` ${well?.well_casing_depth_unit}` - : null} - - - - - Casing Materials: - - - {well?.well_casing_materials?.join(', ') || 'N/A'} - - - - - Pump Type: - - - {well?.well_pump_type || 'N/A'} - - - - - Pump Depth: - - - {well?.well_pump_depth?.toFixed(2) || 'N/A'} - {well?.well_pump_depth ? ` ${well?.well_pump_depth_unit}` : null} - - - + + + + + + + ) } + +const FieldRow = ({ label, value }: { label: string; value: string }) => ( + + + {label} + + + {value} + + +) diff --git a/src/components/card/CoreWellInfo.tsx b/src/components/card/CoreWellInfo.tsx index 12e85316..c70f4564 100644 --- a/src/components/card/CoreWellInfo.tsx +++ b/src/components/card/CoreWellInfo.tsx @@ -107,12 +107,10 @@ export const CoreWellInfoCard = ({ well }: { well: IWell }) => { - + {label} - {value} + + {value} + + @@ -103,7 +105,10 @@ export const RecentWaterLevelObservationsCard = ({ const LoadingCard = () => { return ( - + From 18c6c012dd1877a802d8e4a6e172f33dbdf666e8 Mon Sep 17 00:00:00 2001 From: jross Date: Mon, 30 Mar 2026 15:18:37 -0600 Subject: [PATCH 2/4] refactor(ocotillo): Update dataset icon to use DatasetOutlined for consistency --- src/resources/ocotillo.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/ocotillo.tsx b/src/resources/ocotillo.tsx index 5380310d..4be21108 100644 --- a/src/resources/ocotillo.tsx +++ b/src/resources/ocotillo.tsx @@ -1,7 +1,7 @@ import { Apps, Construction, - DatasetLinked, + DatasetOutlined, Contacts, DynamicFormOutlined, Image, @@ -312,7 +312,7 @@ let ocotillo = [ list: '/ocotillo/collections', meta: { label: 'Datasets', - icon: , + icon: , }, }, ...tables, From 00789ba43126fb104697415b50701f7b1620b5f4 Mon Sep 17 00:00:00 2001 From: jross Date: Mon, 30 Mar 2026 15:22:18 -0600 Subject: [PATCH 3/4] refactor(core-well-info): Simplify InfoRow component usage for latitude and easting values --- src/components/card/CoreWellInfo.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/card/CoreWellInfo.tsx b/src/components/card/CoreWellInfo.tsx index c70f4564..511e2cba 100644 --- a/src/components/card/CoreWellInfo.tsx +++ b/src/components/card/CoreWellInfo.tsx @@ -104,14 +104,8 @@ export const CoreWellInfoCard = ({ well }: { well: IWell }) => { ) : null } > - - + + Date: Mon, 30 Mar 2026 15:27:27 -0600 Subject: [PATCH 4/4] refactor(equipment): Replace DetailRow with DetailField for improved layout consistency --- src/components/WellShow/Equipment.tsx | 61 +++++++++----- src/generated/types.gen.ts | 111 +++++++++++++++++++++++++- src/generated/zod.gen.ts | 52 ++++++++++++ 3 files changed, 201 insertions(+), 23 deletions(-) diff --git a/src/components/WellShow/Equipment.tsx b/src/components/WellShow/Equipment.tsx index 02915b39..2344f1a3 100644 --- a/src/components/WellShow/Equipment.tsx +++ b/src/components/WellShow/Equipment.tsx @@ -226,31 +226,31 @@ export const EquipmentAccordion = ({ }} > - - - - - - - - {selectedEquipment.notes && - selectedEquipment.notes !== '-' - ? selectedEquipment.notes - : 'N/A'} - + @@ -306,25 +309,41 @@ const DetailSection = ({ ) -const DetailRow = ({ label, value }: { label: string; value: string }) => ( +const DetailField = ({ label, value }: { label: string; value: string }) => ( - + {label} diff --git a/src/generated/types.gen.ts b/src/generated/types.gen.ts index f375ee84..e5591036 100644 --- a/src/generated/types.gen.ts +++ b/src/generated/types.gen.ts @@ -128,7 +128,7 @@ export type BodyBulkUploadGroundwaterLevelsObservationGroundwaterLevelBulkUpload /** * File */ - file: Blob | File; + file: string; }; /** @@ -138,7 +138,7 @@ export type BodyUploadAssetAssetUploadPost = { /** * File */ - file: Blob | File; + file: string; }; /** @@ -3243,6 +3243,53 @@ export type WaterLevelBulkUploadSummary = { validation_errors_or_warnings: number; }; +/** + * WellDetailsResponse + */ +export type WellDetailsResponse = { + well: WellResponse; + /** + * Contacts + */ + contacts?: Array; + /** + * Sensors + */ + sensors?: Array; + /** + * Deployments + */ + deployments?: Array; + /** + * Well Screens + */ + well_screens?: Array; + /** + * Recent Groundwater Level Observations + */ + recent_groundwater_level_observations?: Array; + latest_field_event_sample?: SampleResponse | null; +}; + +/** + * WellExportResponse + */ +export type WellExportResponse = { + well: WellResponse; + /** + * Contacts + */ + contacts?: Array; + /** + * Sensors + */ + sensors?: Array; + /** + * Deployments + */ + deployments?: Array; +}; + /** * WellResponse * @@ -6610,6 +6657,66 @@ export type UpdateWaterWellThingWaterWellThingIdPatchResponses = { export type UpdateWaterWellThingWaterWellThingIdPatchResponse = UpdateWaterWellThingWaterWellThingIdPatchResponses[keyof UpdateWaterWellThingWaterWellThingIdPatchResponses]; +export type GetWellDetailsThingWaterWellThingIdDetailsGetData = { + body?: never; + path: { + /** + * Thing Id + */ + thing_id: number; + }; + query?: never; + url: '/thing/water-well/{thing_id}/details'; +}; + +export type GetWellDetailsThingWaterWellThingIdDetailsGetErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetWellDetailsThingWaterWellThingIdDetailsGetError = GetWellDetailsThingWaterWellThingIdDetailsGetErrors[keyof GetWellDetailsThingWaterWellThingIdDetailsGetErrors]; + +export type GetWellDetailsThingWaterWellThingIdDetailsGetResponses = { + /** + * Successful Response + */ + 200: WellDetailsResponse; +}; + +export type GetWellDetailsThingWaterWellThingIdDetailsGetResponse = GetWellDetailsThingWaterWellThingIdDetailsGetResponses[keyof GetWellDetailsThingWaterWellThingIdDetailsGetResponses]; + +export type GetWellExportThingWaterWellThingIdExportGetData = { + body?: never; + path: { + /** + * Thing Id + */ + thing_id: number; + }; + query?: never; + url: '/thing/water-well/{thing_id}/export'; +}; + +export type GetWellExportThingWaterWellThingIdExportGetErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetWellExportThingWaterWellThingIdExportGetError = GetWellExportThingWaterWellThingIdExportGetErrors[keyof GetWellExportThingWaterWellThingIdExportGetErrors]; + +export type GetWellExportThingWaterWellThingIdExportGetResponses = { + /** + * Successful Response + */ + 200: WellExportResponse; +}; + +export type GetWellExportThingWaterWellThingIdExportGetResponse = GetWellExportThingWaterWellThingIdExportGetResponses[keyof GetWellExportThingWaterWellThingIdExportGetResponses]; + export type GetWellScreensByWellIdThingWaterWellThingIdWellScreenGetData = { body?: never; path: { diff --git a/src/generated/zod.gen.ts b/src/generated/zod.gen.ts index f316646b..4d82b0ce 100644 --- a/src/generated/zod.gen.ts +++ b/src/generated/zod.gen.ts @@ -3662,6 +3662,32 @@ export const zWaterLevelBulkUploadResponse = z.object({ validation_errors: z.array(z.string()) }); +/** + * WellDetailsResponse + */ +export const zWellDetailsResponse = z.object({ + well: zWellResponse, + contacts: z.optional(z.array(zContactResponse)), + sensors: z.optional(z.array(zSensorResponse)), + deployments: z.optional(z.array(zDeploymentResponse)), + well_screens: z.optional(z.array(zWellScreenResponse)), + recent_groundwater_level_observations: z.optional(z.array(zGroundwaterLevelObservationResponse)), + latest_field_event_sample: z.optional(z.union([ + zSampleResponse, + z.null() + ])) +}); + +/** + * WellExportResponse + */ +export const zWellExportResponse = z.object({ + well: zWellResponse, + contacts: z.optional(z.array(zContactResponse)), + sensors: z.optional(z.array(zSensorResponse)), + deployments: z.optional(z.array(zDeploymentResponse)) +}); + export const zUploadAssetAssetUploadPostData = z.object({ body: zBodyUploadAssetAssetUploadPost, path: z.optional(z.never()), @@ -4935,6 +4961,32 @@ export const zUpdateWaterWellThingWaterWellThingIdPatchData = z.object({ */ export const zUpdateWaterWellThingWaterWellThingIdPatchResponse = zWellResponse; +export const zGetWellDetailsThingWaterWellThingIdDetailsGetData = z.object({ + body: z.optional(z.never()), + path: z.object({ + thing_id: z.int() + }), + query: z.optional(z.never()) +}); + +/** + * Successful Response + */ +export const zGetWellDetailsThingWaterWellThingIdDetailsGetResponse = zWellDetailsResponse; + +export const zGetWellExportThingWaterWellThingIdExportGetData = z.object({ + body: z.optional(z.never()), + path: z.object({ + thing_id: z.int() + }), + query: z.optional(z.never()) +}); + +/** + * Successful Response + */ +export const zGetWellExportThingWaterWellThingIdExportGetResponse = zWellExportResponse; + export const zGetWellScreensByWellIdThingWaterWellThingIdWellScreenGetData = z.object({ body: z.optional(z.never()), path: z.object({