diff --git a/backend/src/routes/equipment.js b/backend/src/routes/equipment.js index fa8b333..1681376 100644 --- a/backend/src/routes/equipment.js +++ b/backend/src/routes/equipment.js @@ -376,7 +376,15 @@ router.post('/', async (req, res, next) => { // General fields purchaseDate, purchasePrice, - notes + notes, + // Sprinkler specific fields + sprinklerMount, + sprinklerHeadType, + sprinklerGpm, + sprinklerThrowFeet, + sprinklerDegrees, + sprinklerLengthFeet, + sprinklerWidthFeet } = req.body; // Validate required fields diff --git a/frontend/src/components/Layout/Layout.js b/frontend/src/components/Layout/Layout.js index 48a7159..ced7025 100644 --- a/frontend/src/components/Layout/Layout.js +++ b/frontend/src/components/Layout/Layout.js @@ -90,12 +90,6 @@ const Layout = ({ children }) => { icon: CloudIcon, iconSolid: CloudIconSolid, }, - { - name: 'Watering', - href: '/watering', - icon: CloudIcon, - iconSolid: CloudIconSolid, - }, ]; const adminNavigation = [ diff --git a/frontend/src/pages/Watering/Watering.js b/frontend/src/pages/Watering/Watering.js index dcc172a..48088a0 100644 --- a/frontend/src/pages/Watering/Watering.js +++ b/frontend/src/pages/Watering/Watering.js @@ -1,5 +1,5 @@ import React, { useEffect, useMemo, useState } from 'react'; -import { MapContainer, TileLayer, Polygon, Marker, Circle, Rectangle, useMapEvents } from 'react-leaflet'; +import { MapContainer, TileLayer, Polygon, Marker, Circle, Rectangle, useMapEvents, useMap } from 'react-leaflet'; import 'leaflet/dist/leaflet.css'; import { propertiesAPI, wateringAPI, equipmentAPI } from '../../services/api'; import toast from 'react-hot-toast'; @@ -112,6 +112,12 @@ const Watering = () => { return [39.8,-98.6]; }, [selectedProperty, sections]); + const CenterOnChange = ({ center }) => { + const map = useMap(); + useEffect(() => { if (center && Array.isArray(center)) map.setView(center); }, [center, map]); + return null; + }; + const startGuidance = () => { if (points.length === 0) { toast.error('Add at least one point'); return; } if (!navigator.geolocation) { toast.error('GPS not available'); return; } @@ -274,6 +280,7 @@ const Watering = () => { + {sections.map((s)=> (