diff --git a/frontend/app/(sidebar)/farms/[farmId]/crop-dialog.tsx b/frontend/app/(sidebar)/farms/[farmId]/crop-dialog.tsx index 108dd20..5173479 100644 --- a/frontend/app/(sidebar)/farms/[farmId]/crop-dialog.tsx +++ b/frontend/app/(sidebar)/farms/[farmId]/crop-dialog.tsx @@ -1,12 +1,14 @@ "use client"; import { useState } from "react"; -import { Dialog, DialogContent } from "@/components/ui/dialog"; +import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import { Check, MapPin } from "lucide-react"; import { cn } from "@/lib/utils"; import type { Crop } from "@/types"; +import { VisuallyHidden } from "@radix-ui/react-visually-hidden"; +import GoogleMapWithDrawing from "@/components/google-map-with-drawing"; interface Plant { id: string; @@ -61,6 +63,9 @@ export function CropDialog({ open, onOpenChange, onSubmit }: CropDialogProps) { return ( + + +
{/* Left side - Plant Selection */} @@ -97,9 +102,9 @@ export function CropDialog({ open, onOpenChange, onSubmit }: CropDialogProps) { {/* Right side - Map */}
- {/* Placeholder map - Replace with your map component */}
-
+ + {/*

Map placeholder @@ -108,7 +113,7 @@ export function CropDialog({ open, onOpenChange, onSubmit }: CropDialogProps) {
Lng: {location.lng.toFixed(4)}

-
+
*/}
diff --git a/frontend/app/(sidebar)/farms/[farmId]/crops/[cropId]/page.tsx b/frontend/app/(sidebar)/farms/[farmId]/crops/[cropId]/page.tsx index 7e94118..4ab720b 100644 --- a/frontend/app/(sidebar)/farms/[farmId]/crops/[cropId]/page.tsx +++ b/frontend/app/(sidebar)/farms/[farmId]/crops/[cropId]/page.tsx @@ -25,6 +25,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { ChatbotDialog } from "./chatbot-dialog"; import { AnalyticsDialog } from "./analytics-dialog"; import type { Crop, CropAnalytics } from "@/types"; +import GoogleMapWithDrawing from "@/components/google-map-with-drawing"; const getCropById = (id: string): Crop => { return { @@ -204,17 +205,18 @@ export default function CropDetailPage({ params }: { params: Promise<{ farmId: s
- + +
-
+ {/*

Map placeholder
Click to view full map

-
+
*/}
diff --git a/frontend/app/(sidebar)/setup/page.tsx b/frontend/app/(sidebar)/setup/page.tsx index 223ec01..e766fd0 100644 --- a/frontend/app/(sidebar)/setup/page.tsx +++ b/frontend/app/(sidebar)/setup/page.tsx @@ -1,7 +1,7 @@ import PlantingDetailsForm from "./planting-detail-form"; import HarvestDetailsForm from "./harvest-detail-form"; import { Separator } from "@/components/ui/separator"; -import GoogleMapWithDrawing from "./google-map-with-drawing"; +import GoogleMapWithDrawing from "@/components/google-map-with-drawing"; export default function SetupPage() { return ( diff --git a/frontend/app/(sidebar)/setup/google-map-with-drawing.tsx b/frontend/components/google-map-with-drawing.tsx similarity index 100% rename from frontend/app/(sidebar)/setup/google-map-with-drawing.tsx rename to frontend/components/google-map-with-drawing.tsx diff --git a/to_insert.sql b/to_insert.sql new file mode 100644 index 0000000..adcc6f7 --- /dev/null +++ b/to_insert.sql @@ -0,0 +1,71 @@ +INSERT INTO light_profiles (name) +VALUES + ('Full Sun'), + ('Partial Shade'), + ('Full Shade'); + +INSERT INTO soil_conditions (name) +VALUES + ('Loamy'), + ('Sandy'), + ('Clay'), + ('Silty'); + +INSERT INTO harvest_units (name) +VALUES + ('Kilograms'), + ('Pounds'), + ('Bushels'), + ('Tons'); + +INSERT INTO plants ( + uuid, name, variety, row_spacing, optimal_temp, planting_depth, average_height, + light_profile_id, soil_condition_id, planting_detail, is_perennial, days_to_emerge, + days_to_flower, days_to_maturity, harvest_window, ph_value, estimate_loss_rate, + estimate_revenue_per_hu, harvest_unit_id, water_needs +) +VALUES + ( + '450e8400-e29b-41d4-a716-446655440000', -- UUID + 'Tomato', -- Name + 'Cherry', -- Variety + 0.5, -- Row Spacing (meters) + 25.0, -- Optimal Temperature (°C) + 0.02, -- Planting Depth (meters) + 1.5, -- Average Height (meters) + 1, -- Light Profile ID (Full Sun) + 1, -- Soil Condition ID (Loamy) + 'Plant in well-drained soil.', -- Planting Detail + FALSE, -- Is Perennial + 7, -- Days to Emerge + 60, -- Days to Flower + 90, -- Days to Maturity + 14, -- Harvest Window (days) + 6.5, -- pH Value + 0.1, -- Estimate Loss Rate + 10.0, -- Estimate Revenue per Harvest Unit + 1, -- Harvest Unit ID (Kilograms) + 2.5 -- Water Needs (liters per day) + ), + ( + '550e8400-e29b-41d4-a716-446655440001', -- UUID + 'Corn', -- Name + 'Sweet', -- Variety + 0.75, -- Row Spacing (meters) + 30.0, -- Optimal Temperature (°C) + 0.05, -- Planting Depth (meters) + 2.0, -- Average Height (meters) + 1, -- Light Profile ID (Full Sun) + 2, -- Soil Condition ID (Sandy) + 'Plant in rows with adequate spacing.', -- Planting Detail + FALSE, -- Is Perennial + 10, -- Days to Emerge + 70, -- Days to Flower + 100, -- Days to Maturity + 21, -- Harvest Window (days) + 6.0, -- pH Value + 0.15, -- Estimate Loss Rate + 8.0, -- Estimate Revenue per Harvest Unit + 2, -- Harvest Unit ID (Pounds) + 3.0 -- Water Needs (liters per day) + ); \ No newline at end of file