diff --git a/src/components/WellShow/Equipment.tsx b/src/components/WellShow/Equipment.tsx index 02915b39..190ed5d1 100644 --- a/src/components/WellShow/Equipment.tsx +++ b/src/components/WellShow/Equipment.tsx @@ -114,10 +114,7 @@ export const EquipmentAccordion = ({ ( { + const locationNote = well?.current_location?.properties?.notes + ?.filter((note) => note.note_type === 'General') + .shift() + const allNotes = [ ...(well?.water_notes ?? []), ...(well?.measuring_notes ?? []), ...(well?.construction_notes ?? []), ...(well?.general_notes ?? []), - ...(well?.current_location?.properties?.notes ?? []), + // Exclude the specific location "General" note used in the map ("Directions to the site"). + // This prevents duplicate content between the map and Notes section. + ...(well?.current_location?.properties?.notes ?? []).filter( + (note) => note.id !== locationNote?.id + ), ...(well?.sampling_procedure_notes ?? []), ] @@ -24,7 +32,9 @@ export const NotesAccordion = ({ well }: { well?: IWell }) => { return ( - + Notes diff --git a/src/components/card/InteractiveSatelliteMap.tsx b/src/components/card/InteractiveSatelliteMap.tsx index bd197a08..ac54ff68 100644 --- a/src/components/card/InteractiveSatelliteMap.tsx +++ b/src/components/card/InteractiveSatelliteMap.tsx @@ -7,6 +7,7 @@ import { CardContent, CardHeader, Skeleton, + Typography, } from '@mui/material' import { Directions, Map } from '@mui/icons-material' import { Layer, MapRef, Source } from 'react-map-gl' @@ -144,6 +145,10 @@ export const InteractiveSatelliteMapCard = ({ well }: { well: IWell }) => { ? `https://www.google.com/maps/dir/?api=1&destination=${lat},${lon}` : null + const locationNote = well.current_location?.properties?.notes + ?.filter((note) => note.note_type === 'General') + .shift() + return ( { )} + {locationNote && ( + <> + + Directions to the site + + + {locationNote?.content} + + + )} ) @@ -234,8 +254,10 @@ const LoadingCard = () => { { height={MAP_HEIGHT} sx={{ borderRadius: '0.5rem' }} /> + + ) diff --git a/src/components/card/RecentWaterLevelObservations.tsx b/src/components/card/RecentWaterLevelObservations.tsx index c27c1513..7d31912a 100644 --- a/src/components/card/RecentWaterLevelObservations.tsx +++ b/src/components/card/RecentWaterLevelObservations.tsx @@ -46,8 +46,13 @@ export const RecentWaterLevelObservationsCard = ({ ] }, []) + const measuringNote = well?.measuring_notes?.shift() + return ( - + @@ -96,6 +101,21 @@ export const RecentWaterLevelObservationsCard = ({ }} /> )} + {measuringNote && ( + <> + + Measurement Note + + + {measuringNote?.content} + + + )} ) @@ -103,7 +123,10 @@ export const RecentWaterLevelObservationsCard = ({ const LoadingCard = () => { return ( - + diff --git a/src/pages/ocotillo/thing/well-show.tsx b/src/pages/ocotillo/thing/well-show.tsx index 56bbbae9..64ba8579 100644 --- a/src/pages/ocotillo/thing/well-show.tsx +++ b/src/pages/ocotillo/thing/well-show.tsx @@ -1,9 +1,5 @@ import { useMemo } from 'react' -import { - useDataProvider, - useList, - useResourceParams, -} from '@refinedev/core' +import { useDataProvider, useList, useResourceParams } from '@refinedev/core' import { useQuery } from '@tanstack/react-query' import { Show, useDataGrid } from '@refinedev/mui' import { AppBreadcrumb } from '@/components/AppBreadcrumb' @@ -308,10 +304,7 @@ export const WellShow = () => { {/* Right column: 2 cols */} - +