diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
index 255c5ebfd..28ab47943 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
@@ -50,12 +50,13 @@ import {
} from "react-router"
import { redirectWithSuccess } from "remix-toast"
import { ClientOnly } from "remix-utils/client-only"
-import { fdm } from "../lib/fdm.server"
+import { fdm } from "@/lib/fdm.server"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Kaart - Bedrijf toevoegen | MINAS2" },
+ { title: `Kaart - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx
index 5bb702baf..c52825a56 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx
@@ -1,9 +1,10 @@
import type { MetaFunction } from "react-router"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Vanggewas - Bouwplan - Bedrijf toevoegen | MINAS2" },
+ { title: `Vanggewas - Bouwplan - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx
index e3a83c2aa..454e9c449 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx
@@ -22,11 +22,12 @@ import {
useLoaderData,
} from "react-router"
import { dataWithSuccess } from "remix-toast"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Gewas- Bouwplan - Bedrijf toevoegen | MINAS2" },
+ { title: `Gewas- Bouwplan - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx
index 21a0a1ff2..67d82742f 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx
@@ -14,11 +14,12 @@ import {
data,
useLoaderData,
} from "react-router"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Oogst - Bouwplan - Bedrijf toevoegen | MINAS2" },
+ { title: `Oogst - Bouwplan - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content: "Bekijk en selecteer de oogst van een gewas uit je bouwplan.",
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx
index 8e7ff9e4f..ccc0774c7 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx
@@ -18,11 +18,12 @@ import {
data,
} from "react-router"
import { redirectWithSuccess } from "remix-toast"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Oogst- Bouwplan - Bedrijf toevoegen | MINAS2" },
+ { title: `Oogst- Bouwplan - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx
index aad034450..8445da5dc 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx
@@ -23,12 +23,13 @@ import {
useLocation,
} from "react-router"
import { dataWithSuccess } from "remix-toast"
-import { fdm } from "../lib/fdm.server"
+import { fdm } from "@/lib/fdm.server"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Bemesting - Bouwplan - Bedrijf toevoegen | MINAS2" },
+ { title: `Bemesting - Bouwplan - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content: "Bekijk en voeg bemestingen toe aan je bouwplan.",
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx
index 2726f1e06..621284707 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx
@@ -15,12 +15,13 @@ import {
useLocation,
} from "react-router"
import { useLoaderData } from "react-router"
-import { fdm } from "../lib/fdm.server"
+import { fdm } from "@/lib/fdm.server"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Bowupland - Bedrijf toevoegen | MINAS2" },
+ { title: `Bouwplan - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content: "Bekijk en selecteer een gewas uit je bouwplan.",
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx
index 00f8c3152..c96a45e4a 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx
@@ -7,11 +7,12 @@ import {
type MetaFunction,
redirect,
} from "react-router"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Bouwplan - Bedrijf toevoegen | MINAS2" },
+ { title: `Bouwplan - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content: "Bekijk en selecteer een gewas uit je bouwplan.",
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx
index 1ae2d0db1..43ad4fd26 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx
@@ -22,11 +22,12 @@ import {
data,
} from "react-router"
import { Outlet, useLoaderData } from "react-router"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Bowuplan - Bedrijf toevoegen | MINAS2" },
+ { title: `Bouwplan - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content: "Beheer de gewassen op je percelen.",
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
index 87dc4546d..7dc3f8ce4 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
@@ -53,13 +53,14 @@ import { RemixFormProvider, useRemixForm } from "remix-hook-form"
import { dataWithSuccess } from "remix-toast"
import { ClientOnly } from "remix-utils/client-only"
import { z } from "zod"
-import { fdm } from "../lib/fdm.server"
+import { fdm } from "@/lib/fdm.server"
import { useEffect } from "react"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Perceel bewerken - Bedrijf toevoegen | MINAS2" },
+ { title: `Perceel bewerken - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx
index 6c2ec2f52..d1123ff40 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx
@@ -7,11 +7,12 @@ import {
type MetaFunction,
redirect,
} from "react-router"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Percelen beheren - Bedrijf toevoegen | MINAS2" },
+ { title: `Percelen beheren - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx
index 306709416..4606e533c 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx
@@ -26,12 +26,13 @@ import {
data,
} from "react-router"
import { useLoaderData } from "react-router"
-import { fdm } from "../lib/fdm.server"
+import { fdm } from "@/lib/fdm.server"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Percelen beheren - Bedrijf toevoegen | MINAS2" },
+ { title: `Percelen beheren - Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create._index.tsx b/fdm-app/app/routes/farm.create._index.tsx
index 29fa9b58c..6dcbb59ce 100644
--- a/fdm-app/app/routes/farm.create._index.tsx
+++ b/fdm-app/app/routes/farm.create._index.tsx
@@ -26,16 +26,17 @@ import type {
import { useLoaderData } from "react-router"
import { redirectWithSuccess } from "remix-toast"
import { z } from "zod"
-import { fdm } from "../lib/fdm.server"
+import { fdm } from "@/lib/fdm.server"
+import config from "~/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: "Bedrijf toevoegen | MINAS2" },
+ { title: `Bedrijf toevoegen | ${config.name}` },
{
name: "description",
content:
- "Voeg een nieuw bedrijf toe aan MINAS2.",
+ "Voeg een nieuw bedrijf toe.",
},
]
}
diff --git a/fdm-app/app/routes/farm.tsx b/fdm-app/app/routes/farm.tsx
index aed21de22..ffc4b55e1 100644
--- a/fdm-app/app/routes/farm.tsx
+++ b/fdm-app/app/routes/farm.tsx
@@ -15,10 +15,11 @@ import WhatsNew from "./farm.whats-new"
import Account from "./farm.account"
import { SidebarInset } from "@/components/ui/sidebar"
import { Outlet } from "react-router-dom"
+import config from "~/fdm.config"
export const meta: MetaFunction = () => {
return [
- { title: "Dashboard | MINAS2" },
+ { title: `Dashboard | ${config.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.whats-new.tsx b/fdm-app/app/routes/farm.whats-new.tsx
index 57083a3d2..c16fd233e 100644
--- a/fdm-app/app/routes/farm.whats-new.tsx
+++ b/fdm-app/app/routes/farm.whats-new.tsx
@@ -1,6 +1,10 @@
import { getSession } from "@/lib/auth.server"
import { handleLoaderError } from "@/lib/error"
-import { type LoaderFunctionArgs, useLoaderData } from "react-router"
+import {
+ type LoaderFunctionArgs,
+ type MetaFunction,
+ useLoaderData,
+} from "react-router"
import { formatDistanceToNow } from "date-fns"
import { nl } from "date-fns/locale"
import { FarmTitle } from "@/components/custom/farm/farm-title"
@@ -16,6 +20,17 @@ import {
import { SidebarTrigger } from "@/components/ui/sidebar"
import ReactMarkdown from "react-markdown"
import remarkGfm from "remark-gfm"
+import config from "~/fdm.config"
+
+export const meta: MetaFunction = () => {
+ return [
+ { title: `Wat is er nieuw? | ${config.name}` },
+ {
+ name: "description",
+ content: `Blijf op de hoogte van de laatste ontwikkelingen en verbeteringen van ${config.name}.`,
+ },
+ ]
+}
// Define the structure for a single update post
export interface UpdatePost {
@@ -26,12 +41,12 @@ export interface UpdatePost {
isNew?: boolean
}
-// Sample data for update posts (replace with a database or CMS later)
+// Dta for update posts
export const updatePosts: UpdatePost[] = [
{
id: "update-1",
- title: "Lancering MINAS2 🎉",
- description: `MINAS2 is gelanceerd! Vanaf nu kun je bedrijven aanmaken, percelen toevoegen en bemestingen invullen.
+ title: `Lancering ${config.name} 🎉`,
+ description: `${config.name} is gelanceerd! Vanaf nu kun je bedrijven aanmaken, percelen toevoegen en bemestingen invullen.
**Nieuwe features:**
- Account aanmaken
diff --git a/fdm-app/app/routes/signin.tsx b/fdm-app/app/routes/signin.tsx
index c377a4fd8..bd5f23bda 100644
--- a/fdm-app/app/routes/signin.tsx
+++ b/fdm-app/app/routes/signin.tsx
@@ -17,6 +17,17 @@ import { redirect } from "react-router"
import { toast } from "sonner"
import type { MetaFunction } from "react-router"
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
+import config from "~/fdm.config"
+
+export const meta: MetaFunction = () => {
+ return [
+ { title: `Aanmelden | ${config.name}` },
+ {
+ name: "description",
+ content: `Meld je aan bij ${config.name} om toegang te krijgen tot je dashboard en je bedrijfsgegevens te beheren.`,
+ },
+ ]
+}
/**
* Checks for an existing user session and redirects authenticated users.
@@ -72,8 +83,8 @@ export default function SignIn() {
- {/* */}
-
MINAS2
+ {/* */}
+
${config.name}
Maak een account aan en krijg toegang tot:
@@ -148,8 +159,8 @@ export default function SignIn() {
- MINAS2 is nog in ontwikkeling. Functionaliteiten
- kunnen nog ontbreken of veranderen.
+ {`${config.name} is nog in ontwikkeling. Functionaliteiten
+ kunnen nog ontbreken of veranderen.`}
@@ -278,7 +289,7 @@ export default function SignIn() {
@@ -296,13 +307,3 @@ export default function SignIn() {
)
}
-
-export const meta: MetaFunction = () => {
- return [
- { title: "Aanmelden | MINAS2" },
- {
- name: "description",
- content: "Meld je aan bij MINAS2!",
- },
- ]
-}
diff --git a/fdm-app/fdm.config.ts b/fdm-app/fdm.config.ts
index 7fc448885..c1cd0640f 100644
--- a/fdm-app/fdm.config.ts
+++ b/fdm-app/fdm.config.ts
@@ -1,4 +1,4 @@
-export const config: Config = {
+const config: Config = {
// Site name
name: "FDM",
favicon: "/favicon.ico",
@@ -33,6 +33,7 @@ export const config: Config = {
},
}
+export default config
interface Config {
name: string
favicon: string
diff --git a/fdm-app/tsconfig.json b/fdm-app/tsconfig.json
index 145dff5ef..dfa503401 100644
--- a/fdm-app/tsconfig.json
+++ b/fdm-app/tsconfig.json
@@ -27,7 +27,7 @@
"baseUrl": ".",
"paths": {
"@/*": ["./app/*"],
- "~/*": ["./app/*"]
+ "~/*": ["./*"]
},
"rootDirs": [".", "./.react-router/types"],
From 9e18bf4b58781b6a2129e3aa7f0ba83bd999e74e Mon Sep 17 00:00:00 2001
From: Sven Verweij <37927107+SvenVw@users.noreply.github.com>
Date: Mon, 24 Mar 2025 13:05:42 +0100
Subject: [PATCH 08/35] Standardize use of of paths
---
fdm-app/app/components/blocks/farm.tsx | 9 +-
fdm-app/app/components/blocks/fields.tsx | 20 ++--
.../components/custom/atlas/atlas-panels.tsx | 10 +-
fdm-app/app/components/custom/combobox.tsx | 11 +--
.../components/custom/cultivation/form.tsx | 10 +-
.../components/custom/cultivation/list.tsx | 2 +-
.../components/custom/farm/farm-content.tsx | 2 +-
.../components/custom/farm/farm-header.tsx | 12 +--
.../custom/farm/farm-pagination.tsx | 2 +-
.../app/components/custom/farm/farm-title.tsx | 2 +-
.../custom/fertilizer-applications.tsx | 16 +--
.../custom/fertilizer-applications/cards.tsx | 6 +-
.../custom/fertilizer-applications/form.tsx | 12 +--
.../custom/fertilizer-applications/list.tsx | 2 +-
.../app/components/custom/harvest/form.tsx | 12 +--
.../app/components/custom/harvest/list.tsx | 2 +-
.../app/components/custom/loadingspinner.tsx | 2 +-
.../app/components/custom/multi-select.tsx | 10 +-
fdm-app/app/components/custom/sidebar-app.tsx | 17 ++--
.../app/components/custom/sidebar-page.tsx | 4 +-
fdm-app/app/entry.client.tsx | 98 ++++++++++---------
fdm-app/app/lib/auth.server.ts | 2 +-
fdm-app/app/root.tsx | 3 +-
fdm-app/app/routes/api.auth.$.tsx | 6 +-
.../farm.$b_id_farm.atlas.elevation.tsx | 12 +--
.../routes/farm.$b_id_farm.atlas.fields.tsx | 20 ++--
.../app/routes/farm.$b_id_farm.atlas.soil.tsx | 12 +--
fdm-app/app/routes/farm.$b_id_farm.atlas.tsx | 16 +--
.../farm.$b_id_farm.field.$b_id.atlas.tsx | 20 ++--
...m.field.$b_id.cultivation.$b_lu._index.tsx | 23 ++---
...ivation.$b_lu.harvest.$b_id_harvesting.tsx | 19 ++--
...$b_id.cultivation.$b_lu.harvest._index.tsx | 19 ++--
...id_farm.field.$b_id.cultivation._index.tsx | 18 ++--
...farm.$b_id_farm.field.$b_id.fertilizer.tsx | 20 ++--
.../farm.$b_id_farm.field.$b_id.norm.tsx | 10 +-
.../farm.$b_id_farm.field.$b_id.overview.tsx | 28 +++---
.../farm.$b_id_farm.field.$b_id.soil.tsx | 10 +-
.../routes/farm.$b_id_farm.field.$b_id.tsx | 16 +--
.../routes/farm.$b_id_farm.field._index.tsx | 22 ++---
.../farm.$b_id_farm.settings._index.tsx | 2 +-
.../farm.$b_id_farm.settings.access.tsx | 4 +-
.../farm.$b_id_farm.settings.delete.tsx | 4 +-
.../farm.$b_id_farm.settings.properties.tsx | 22 ++---
.../app/routes/farm.$b_id_farm.settings.tsx | 18 ++--
fdm-app/app/routes/farm.$b_id_farm.tsx | 6 +-
fdm-app/app/routes/farm._index.tsx | 22 ++---
fdm-app/app/routes/farm.account.tsx | 18 ++--
.../routes/farm.create.$b_id_farm.atlas.tsx | 30 +++---
...cultivations.$b_lu_catalogue.covercrop.tsx | 2 +-
...ltivations.$b_lu_catalogue.crop._index.tsx | 20 ++--
...atalogue.crop.harvest.$b_id_harvesting.tsx | 12 +--
...ns.$b_lu_catalogue.crop.harvest._index.tsx | 16 +--
...ltivations.$b_lu_catalogue.fertilizers.tsx | 20 ++--
...b_id_farm.cultivations.$b_lu_catalogue.tsx | 10 +-
....create.$b_id_farm.cultivations._index.tsx | 8 +-
.../farm.create.$b_id_farm.cultivations.tsx | 22 ++---
.../farm.create.$b_id_farm.fields.$b_id.tsx | 34 +++----
.../farm.create.$b_id_farm.fields._index.tsx | 8 +-
.../routes/farm.create.$b_id_farm.fields.tsx | 20 ++--
fdm-app/app/routes/farm.create._index.tsx | 18 ++--
fdm-app/app/routes/farm.tsx | 14 +--
fdm-app/app/routes/farm.whats-new.tsx | 16 +--
fdm-app/app/routes/signin.tsx | 16 +--
fdm-app/tsconfig.json | 9 +-
64 files changed, 455 insertions(+), 453 deletions(-)
diff --git a/fdm-app/app/components/blocks/farm.tsx b/fdm-app/app/components/blocks/farm.tsx
index e13c9cebb..87eaa4d19 100644
--- a/fdm-app/app/components/blocks/farm.tsx
+++ b/fdm-app/app/components/blocks/farm.tsx
@@ -2,8 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod"
import { Form } from "react-router"
import { RemixFormProvider, useRemixForm } from "remix-hook-form"
import type { z } from "zod"
-
-import { Button } from "@/components/ui/button"
+import { Button } from "~/components/ui/button"
import {
Card,
CardContent,
@@ -11,7 +10,7 @@ import {
CardFooter,
CardHeader,
CardTitle,
-} from "@/components/ui/card"
+} from "~/components/ui/card"
import {
FormControl,
FormDescription,
@@ -19,8 +18,8 @@ import {
FormItem,
FormLabel,
FormMessage,
-} from "@/components/ui/form"
-import { Input } from "@/components/ui/input"
+} from "~/components/ui/form"
+import { Input } from "~/components/ui/input"
import { LoadingSpinner } from "../custom/loadingspinner"
export interface fertilizersListType {
diff --git a/fdm-app/app/components/blocks/fields.tsx b/fdm-app/app/components/blocks/fields.tsx
index aa89c08f4..8e0bd5b53 100644
--- a/fdm-app/app/components/blocks/fields.tsx
+++ b/fdm-app/app/components/blocks/fields.tsx
@@ -1,10 +1,8 @@
import type { FeatureCollection } from "geojson"
import { useEffect, useState } from "react"
import { Form, useNavigation } from "react-router"
-
-import { FieldMap } from "@/components/blocks/field-map"
-// Components
-import { Button } from "@/components/ui/button"
+import { FieldMap } from "~/components/blocks/field-map"
+import { Button } from "~/components/ui/button"
import {
Card,
CardContent,
@@ -12,7 +10,7 @@ import {
CardFooter,
CardHeader,
CardTitle,
-} from "@/components/ui/card"
+} from "~/components/ui/card"
import {
Command,
CommandEmpty,
@@ -20,23 +18,23 @@ import {
CommandInput,
CommandItem,
CommandList,
-} from "@/components/ui/command"
-import { Input } from "@/components/ui/input"
-import { Label } from "@/components/ui/label"
+} from "~/components/ui/command"
+import { Input } from "~/components/ui/input"
+import { Label } from "~/components/ui/label"
import {
Popover,
PopoverContent,
PopoverTrigger,
-} from "@/components/ui/popover"
+} from "~/components/ui/popover"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
-} from "@/components/ui/select"
+} from "~/components/ui/select"
import { useToast } from "@/hooks/use-toast"
-import { cn } from "@/lib/utils"
+import { cn } from "~/lib/utils"
import { Check, ChevronsUpDown } from "lucide-react"
import { ClientOnly } from "remix-utils/client-only"
import { Skeleton } from "../ui/skeleton"
diff --git a/fdm-app/app/components/custom/atlas/atlas-panels.tsx b/fdm-app/app/components/custom/atlas/atlas-panels.tsx
index 950026f2f..99919bdff 100644
--- a/fdm-app/app/components/custom/atlas/atlas-panels.tsx
+++ b/fdm-app/app/components/custom/atlas/atlas-panels.tsx
@@ -1,6 +1,6 @@
-import { LoadingSpinner } from "@/components/custom/loadingspinner"
-import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
-import { Button } from "@/components/ui/button"
+import { LoadingSpinner } from "~/components/custom/loadingspinner"
+import { Alert, AlertDescription, AlertTitle } from "~/components/ui/alert"
+import { Button } from "~/components/ui/button"
import {
Card,
CardContent,
@@ -8,8 +8,8 @@ import {
CardFooter,
CardHeader,
CardTitle,
-} from "@/components/ui/card"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/card"
+import { cn } from "~/lib/utils"
import type { FeatureCollection } from "geojson"
import throttle from "lodash.throttle"
import { Check, Info } from "lucide-react"
diff --git a/fdm-app/app/components/custom/combobox.tsx b/fdm-app/app/components/custom/combobox.tsx
index e7b785297..b39eba614 100644
--- a/fdm-app/app/components/custom/combobox.tsx
+++ b/fdm-app/app/components/custom/combobox.tsx
@@ -1,6 +1,5 @@
import { type ReactNode, useMemo, useState } from "react"
-
-import { Button } from "@/components/ui/button"
+import { Button } from "~/components/ui/button"
import {
Command,
CommandEmpty,
@@ -8,7 +7,7 @@ import {
CommandInput,
CommandItem,
CommandList,
-} from "@/components/ui/command"
+} from "~/components/ui/command"
import {
FormControl,
FormDescription,
@@ -16,13 +15,13 @@ import {
FormItem,
FormLabel,
FormMessage,
-} from "@/components/ui/form"
+} from "~/components/ui/form"
import {
Popover,
PopoverContent,
PopoverTrigger,
-} from "@/components/ui/popover"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/popover"
+import { cn } from "~/lib/utils"
import { Check, ChevronsUpDown } from "lucide-react"
type optionType = {
diff --git a/fdm-app/app/components/custom/cultivation/form.tsx b/fdm-app/app/components/custom/cultivation/form.tsx
index c41c575f7..6ade23e4c 100644
--- a/fdm-app/app/components/custom/cultivation/form.tsx
+++ b/fdm-app/app/components/custom/cultivation/form.tsx
@@ -1,5 +1,5 @@
-import { Button } from "@/components/ui/button"
-import { Calendar } from "@/components/ui/calendar"
+import { Button } from "~/components/ui/button"
+import { Calendar } from "~/components/ui/calendar"
import {
FormControl,
FormDescription,
@@ -7,13 +7,13 @@ import {
FormItem,
FormLabel,
FormMessage,
-} from "@/components/ui/form"
+} from "~/components/ui/form"
import {
Popover,
PopoverContent,
PopoverTrigger,
-} from "@/components/ui/popover"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/popover"
+import { cn } from "~/lib/utils"
import { zodResolver } from "@hookform/resolvers/zod"
import { format } from "date-fns/format"
import { nl } from "date-fns/locale/nl"
diff --git a/fdm-app/app/components/custom/cultivation/list.tsx b/fdm-app/app/components/custom/cultivation/list.tsx
index 35ed9ce8a..67ed61463 100644
--- a/fdm-app/app/components/custom/cultivation/list.tsx
+++ b/fdm-app/app/components/custom/cultivation/list.tsx
@@ -1,4 +1,4 @@
-import { Button } from "@/components/ui/button"
+import { Button } from "~/components/ui/button"
import { format } from "date-fns/format"
import { Pencil, Trash2 } from "lucide-react"
import { NavLink, useFetcher } from "react-router"
diff --git a/fdm-app/app/components/custom/farm/farm-content.tsx b/fdm-app/app/components/custom/farm/farm-content.tsx
index 34acb31c5..18171b484 100644
--- a/fdm-app/app/components/custom/farm/farm-content.tsx
+++ b/fdm-app/app/components/custom/farm/farm-content.tsx
@@ -1,7 +1,7 @@
import {
SidebarPage,
type SidebarPageProps,
-} from "@/components/custom/sidebar-page"
+} from "~/components/custom/sidebar-page"
import type { ReactNode } from "react"
import { Outlet } from "react-router"
diff --git a/fdm-app/app/components/custom/farm/farm-header.tsx b/fdm-app/app/components/custom/farm/farm-header.tsx
index 9fdc249af..83461827c 100644
--- a/fdm-app/app/components/custom/farm/farm-header.tsx
+++ b/fdm-app/app/components/custom/farm/farm-header.tsx
@@ -4,18 +4,18 @@ import {
BreadcrumbLink,
BreadcrumbList,
BreadcrumbSeparator,
-} from "@/components/ui/breadcrumb"
-import { Separator } from "@/components/ui/separator"
-import { SidebarTrigger } from "@/components/ui/sidebar"
+} from "~/components/ui/breadcrumb"
+import { Separator } from "~/components/ui/separator"
+import { SidebarTrigger } from "~/components/ui/sidebar"
-import { Button } from "@/components/ui/button"
+import { Button } from "~/components/ui/button"
import {
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/dropdown-menu"
+import { cn } from "~/lib/utils"
import { ChevronDown } from "lucide-react"
import { NavLink } from "react-router"
import type {
diff --git a/fdm-app/app/components/custom/farm/farm-pagination.tsx b/fdm-app/app/components/custom/farm/farm-pagination.tsx
index bf34254e4..c8311d5b8 100644
--- a/fdm-app/app/components/custom/farm/farm-pagination.tsx
+++ b/fdm-app/app/components/custom/farm/farm-pagination.tsx
@@ -3,7 +3,7 @@ import {
PaginationContent,
PaginationItem,
PaginationLink,
-} from "@/components/ui/pagination"
+} from "~/components/ui/pagination"
import type { PaginationItems } from "./farm.d"
interface PaginationLayoutProps {
diff --git a/fdm-app/app/components/custom/farm/farm-title.tsx b/fdm-app/app/components/custom/farm/farm-title.tsx
index e4946e7d2..4dc581312 100644
--- a/fdm-app/app/components/custom/farm/farm-title.tsx
+++ b/fdm-app/app/components/custom/farm/farm-title.tsx
@@ -1,4 +1,4 @@
-import { Separator } from "@/components/ui/separator"
+import { Separator } from "~/components/ui/separator"
interface FarmTitleProps {
title: string
diff --git a/fdm-app/app/components/custom/fertilizer-applications.tsx b/fdm-app/app/components/custom/fertilizer-applications.tsx
index a104116a2..e87a779e7 100644
--- a/fdm-app/app/components/custom/fertilizer-applications.tsx
+++ b/fdm-app/app/components/custom/fertilizer-applications.tsx
@@ -1,6 +1,6 @@
-import { Combobox } from "@/components/custom/combobox"
-import { Button } from "@/components/ui/button"
-import { Calendar } from "@/components/ui/calendar"
+import { Combobox } from "~/components/custom/combobox"
+import { Button } from "~/components/ui/button"
+import { Calendar } from "~/components/ui/calendar"
import {
FormControl,
FormDescription,
@@ -8,15 +8,15 @@ import {
FormItem,
FormLabel,
FormMessage,
-} from "@/components/ui/form"
-import { Input } from "@/components/ui/input"
+} from "~/components/ui/form"
+import { Input } from "~/components/ui/input"
import {
Popover,
PopoverContent,
PopoverTrigger,
-} from "@/components/ui/popover"
-import { Separator } from "@/components/ui/separator"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/popover"
+import { Separator } from "~/components/ui/separator"
+import { cn } from "~/lib/utils"
import { zodResolver } from "@hookform/resolvers/zod"
import { format } from "date-fns"
import { CalendarIcon } from "lucide-react"
diff --git a/fdm-app/app/components/custom/fertilizer-applications/cards.tsx b/fdm-app/app/components/custom/fertilizer-applications/cards.tsx
index e828ad273..b0956fdee 100644
--- a/fdm-app/app/components/custom/fertilizer-applications/cards.tsx
+++ b/fdm-app/app/components/custom/fertilizer-applications/cards.tsx
@@ -1,11 +1,11 @@
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
+import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card"
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
-} from "@/components/ui/tooltip"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/tooltip"
+import { cn } from "~/lib/utils"
import type { Dose } from "@svenvw/fdm-calculator"
import { Lightbulb, Scale } from "lucide-react"
import type { FertilizerApplicationsCardProps } from "./types.d"
diff --git a/fdm-app/app/components/custom/fertilizer-applications/form.tsx b/fdm-app/app/components/custom/fertilizer-applications/form.tsx
index d87d42524..ef4b61c96 100644
--- a/fdm-app/app/components/custom/fertilizer-applications/form.tsx
+++ b/fdm-app/app/components/custom/fertilizer-applications/form.tsx
@@ -1,5 +1,5 @@
-import { Button } from "@/components/ui/button"
-import { Calendar } from "@/components/ui/calendar"
+import { Button } from "~/components/ui/button"
+import { Calendar } from "~/components/ui/calendar"
import {
FormControl,
FormDescription,
@@ -7,14 +7,14 @@ import {
FormItem,
FormLabel,
FormMessage,
-} from "@/components/ui/form"
-import { Input } from "@/components/ui/input"
+} from "~/components/ui/form"
+import { Input } from "~/components/ui/input"
import {
Popover,
PopoverContent,
PopoverTrigger,
-} from "@/components/ui/popover"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/popover"
+import { cn } from "~/lib/utils"
import { zodResolver } from "@hookform/resolvers/zod"
import { format } from "date-fns"
import { nl } from "date-fns/locale/nl"
diff --git a/fdm-app/app/components/custom/fertilizer-applications/list.tsx b/fdm-app/app/components/custom/fertilizer-applications/list.tsx
index 585002496..2b87e7b1d 100644
--- a/fdm-app/app/components/custom/fertilizer-applications/list.tsx
+++ b/fdm-app/app/components/custom/fertilizer-applications/list.tsx
@@ -1,4 +1,4 @@
-import { Button } from "@/components/ui/button"
+import { Button } from "~/components/ui/button"
import { format } from "date-fns"
import { LoadingSpinner } from "../loadingspinner"
import type { FertilizerApplication } from "./types.d"
diff --git a/fdm-app/app/components/custom/harvest/form.tsx b/fdm-app/app/components/custom/harvest/form.tsx
index 4bb6b6dfc..1fe7eaed9 100644
--- a/fdm-app/app/components/custom/harvest/form.tsx
+++ b/fdm-app/app/components/custom/harvest/form.tsx
@@ -1,5 +1,5 @@
-import { Button } from "@/components/ui/button"
-import { Calendar } from "@/components/ui/calendar"
+import { Button } from "~/components/ui/button"
+import { Calendar } from "~/components/ui/calendar"
import {
FormControl,
FormDescription,
@@ -7,14 +7,14 @@ import {
FormItem,
FormLabel,
FormMessage,
-} from "@/components/ui/form"
-import { Input } from "@/components/ui/input"
+} from "~/components/ui/form"
+import { Input } from "~/components/ui/input"
import {
Popover,
PopoverContent,
PopoverTrigger,
-} from "@/components/ui/popover"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/popover"
+import { cn } from "~/lib/utils"
import { zodResolver } from "@hookform/resolvers/zod"
import { format } from "date-fns/format"
import { nl } from "date-fns/locale/nl"
diff --git a/fdm-app/app/components/custom/harvest/list.tsx b/fdm-app/app/components/custom/harvest/list.tsx
index 60ca8524e..ed986540d 100644
--- a/fdm-app/app/components/custom/harvest/list.tsx
+++ b/fdm-app/app/components/custom/harvest/list.tsx
@@ -1,4 +1,4 @@
-import { Button } from "@/components/ui/button"
+import { Button } from "~/components/ui/button"
import { format } from "date-fns/format"
import { Eye, Trash2 } from "lucide-react"
import { NavLink, useFetcher } from "react-router"
diff --git a/fdm-app/app/components/custom/loadingspinner.tsx b/fdm-app/app/components/custom/loadingspinner.tsx
index 391ee3aae..ffc53039b 100644
--- a/fdm-app/app/components/custom/loadingspinner.tsx
+++ b/fdm-app/app/components/custom/loadingspinner.tsx
@@ -1,4 +1,4 @@
-import { cn } from "@/lib/utils"
+import { cn } from "~/lib/utils"
export interface ISVGProps extends React.SVGProps {
size?: number
diff --git a/fdm-app/app/components/custom/multi-select.tsx b/fdm-app/app/components/custom/multi-select.tsx
index 54bf98374..af4b12510 100644
--- a/fdm-app/app/components/custom/multi-select.tsx
+++ b/fdm-app/app/components/custom/multi-select.tsx
@@ -10,8 +10,8 @@ import {
} from "lucide-react"
import * as React from "react"
-import { Badge } from "@/components/ui/badge"
-import { Button } from "@/components/ui/button"
+import { Badge } from "~/components/ui/badge"
+import { Button } from "~/components/ui/button"
import {
Command,
CommandEmpty,
@@ -20,13 +20,13 @@ import {
CommandItem,
CommandList,
CommandSeparator,
-} from "@/components/ui/command"
+} from "~/components/ui/command"
import {
Popover,
PopoverContent,
PopoverTrigger,
-} from "@/components/ui/popover"
-import { Separator } from "@/components/ui/separator"
+} from "~/components/ui/popover"
+import { Separator } from "~/components/ui/separator"
import { cn } from "~/lib/utils"
/**
diff --git a/fdm-app/app/components/custom/sidebar-app.tsx b/fdm-app/app/components/custom/sidebar-app.tsx
index 3a79bab28..36c34bfb0 100644
--- a/fdm-app/app/components/custom/sidebar-app.tsx
+++ b/fdm-app/app/components/custom/sidebar-app.tsx
@@ -1,5 +1,5 @@
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
-import { Badge } from "@/components/ui/badge"
+import { Avatar, AvatarFallback, AvatarImage } from "~/components/ui/avatar"
+import { Badge } from "~/components/ui/badge"
import {
DropdownMenu,
DropdownMenuContent,
@@ -8,7 +8,7 @@ import {
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu"
+} from "~/components/ui/dropdown-menu"
import {
Sidebar,
SidebarContent,
@@ -21,7 +21,7 @@ import {
SidebarMenuBadge,
SidebarMenuButton,
SidebarMenuItem,
-} from "@/components/ui/sidebar"
+} from "~/components/ui/sidebar"
import * as Sentry from "@sentry/react"
import {
ArrowRightLeft,
@@ -40,14 +40,13 @@ import {
Sprout,
Square,
} from "lucide-react"
-
-import { Button } from "@/components/ui/button"
-import { useIsMobile } from "@/hooks/use-mobile"
+import { Button } from "~/components/ui/button"
+import { useIsMobile } from "~/hooks/use-mobile"
import { useEffect, useState } from "react"
import { Form, NavLink } from "react-router"
import { toast } from "sonner"
-import { useFarm } from "@/context/farm-context"
-import config from "~/fdm.config"
+import { useFarm } from "~/context/farm-context"
+import config from "@/fdm.config"
interface SideBarAppType {
user: {
diff --git a/fdm-app/app/components/custom/sidebar-page.tsx b/fdm-app/app/components/custom/sidebar-page.tsx
index 83b347403..df81a49ab 100644
--- a/fdm-app/app/components/custom/sidebar-page.tsx
+++ b/fdm-app/app/components/custom/sidebar-page.tsx
@@ -1,7 +1,7 @@
import { NavLink, useLocation } from "react-router"
-import { buttonVariants } from "@/components/ui/button"
-import { cn } from "@/lib/utils"
+import { buttonVariants } from "~/components/ui/button"
+import { cn } from "~/lib/utils"
export interface SidebarPageProps extends React.HTMLAttributes {
items: {
diff --git a/fdm-app/app/entry.client.tsx b/fdm-app/app/entry.client.tsx
index 86d4173bc..ae2a6c383 100644
--- a/fdm-app/app/entry.client.tsx
+++ b/fdm-app/app/entry.client.tsx
@@ -8,57 +8,61 @@ import * as Sentry from "@sentry/react"
import { StrictMode, startTransition } from "react"
import { hydrateRoot } from "react-dom/client"
import { HydratedRouter } from "react-router/dom"
+import config from "@/fdm.config"
-Sentry.init({
- dsn: import.meta.env.VITE_SENTRY_DSN,
- environment: import.meta.env.NODE_ENV,
- integrations: [
- Sentry.browserTracingIntegration(),
- Sentry.replayIntegration(),
- Sentry.feedbackIntegration({
- autoInject: false,
- colorScheme: "system",
- isNameRequired: true,
- isEmailRequired: true,
- enableScreenshot: true,
- showBranding: false,
- triggerLabel: "Geef feedback",
- formTitle: "Geef feedback",
- submitButtonLabel: "Verstuur",
- cancelButtonLabel: "Annuleer",
- confirmButtonLabel: "Bevestig",
- addScreenshotButtonLabel: "Voeg een screenshot toe",
- removeScreenshotButtonLabel: "Verwijder screenshot",
- nameLabel: "Naam",
- namePlaceholder: "Uw naam",
- emailLabel: "E-mailadres",
- emailPlaceholder: "Uw e-mailadres",
- isRequiredLabel: "(vereist)",
- messageLabel: "Beschrijving",
- messagePlaceholder:
- "Wat is uw feedback? Gaat er iets mis of zou u iets toegevoegd willen zien?",
- successMessageText: "Bedankt voor uw feedback!",
- useSentryUser: {
- name: "fullName",
- email: "email",
- },
- }),
- ],
- // beforeSend(event, hint) {
- // if (event.exception && event.event_id) {
- // Sentry.showReportDialog({ eventId: event.event_id, lang: "nl" })
- // }
- // return event
- // },
+if (config.sentry) {
+ Sentry.init({
+ dsn: import.meta.env.VITE_SENTRY_DSN,
+ environment: import.meta.env.NODE_ENV,
+ integrations: [
+ Sentry.browserTracingIntegration(),
+ Sentry.replayIntegration(),
+ Sentry.feedbackIntegration({
+ autoInject: false,
+ colorScheme: "system",
+ isNameRequired: true,
+ isEmailRequired: true,
+ enableScreenshot: true,
+ showBranding: false,
+ triggerLabel: "Geef feedback",
+ formTitle: "Geef feedback",
+ submitButtonLabel: "Verstuur",
+ cancelButtonLabel: "Annuleer",
+ confirmButtonLabel: "Bevestig",
+ addScreenshotButtonLabel: "Voeg een screenshot toe",
+ removeScreenshotButtonLabel: "Verwijder screenshot",
+ nameLabel: "Naam",
+ namePlaceholder: "Uw naam",
+ emailLabel: "E-mailadres",
+ emailPlaceholder: "Uw e-mailadres",
+ isRequiredLabel: "(vereist)",
+ messageLabel: "Beschrijving",
+ messagePlaceholder:
+ "Wat is uw feedback? Gaat er iets mis of zou u iets toegevoegd willen zien?",
+ successMessageText: "Bedankt voor uw feedback!",
+ useSentryUser: {
+ name: "fullName",
+ email: "email",
+ },
+ }),
+ ],
+ // beforeSend(event, hint) {
+ // if (event.exception && event.event_id) {
+ // Sentry.showReportDialog({ eventId: event.event_id, lang: "nl" })
+ // }
+ // return event
+ // },
- tracesSampleRate: import.meta.env.VITE_SENTRY_TRACE_SAMPLE_RATE,
+ tracesSampleRate: import.meta.env.VITE_SENTRY_TRACE_SAMPLE_RATE,
- tracePropagationTargets: ["localhost"],
+ tracePropagationTargets: [window.location.hostname],
- replaysSessionSampleRate: import.meta.env.VITE_SENTRY_REPLAY_SAMPLE_RATE,
- replaysOnErrorSampleRate: import.meta.env
- .VITE_SENTRY_REPLAY_SAMPLE_RATE_ON_ERROR,
-})
+ replaysSessionSampleRate: import.meta.env
+ .VITE_SENTRY_REPLAY_SAMPLE_RATE,
+ replaysOnErrorSampleRate: import.meta.env
+ .VITE_SENTRY_REPLAY_SAMPLE_RATE_ON_ERROR,
+ })
+}
startTransition(() => {
hydrateRoot(
diff --git a/fdm-app/app/lib/auth.server.ts b/fdm-app/app/lib/auth.server.ts
index 56616ac3b..91045f5ba 100644
--- a/fdm-app/app/lib/auth.server.ts
+++ b/fdm-app/app/lib/auth.server.ts
@@ -1,4 +1,4 @@
-import { fdm } from "@/lib/fdm.server"
+import { fdm } from "~/lib/fdm.server"
import { createFdmAuth } from "@svenvw/fdm-core"
import type { Session, User } from "better-auth"
diff --git a/fdm-app/app/root.tsx b/fdm-app/app/root.tsx
index 9635a3799..ef1990714 100644
--- a/fdm-app/app/root.tsx
+++ b/fdm-app/app/root.tsx
@@ -1,6 +1,6 @@
import * as Sentry from "@sentry/react"
-import { Toaster } from "@/components/ui/sonner"
+import { Toaster } from "~/components/ui/sonner"
import mapBoxStyle from "mapbox-gl/dist/mapbox-gl.css?url"
import { useEffect } from "react"
import {
@@ -59,7 +59,6 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
export function Layout() {
const loaderData = useLoaderData()
const toast = loaderData?.toast
- const location = useLocation()
// Hook to show the toasts
useEffect(() => {
diff --git a/fdm-app/app/routes/api.auth.$.tsx b/fdm-app/app/routes/api.auth.$.tsx
index 698521454..f402b7809 100644
--- a/fdm-app/app/routes/api.auth.$.tsx
+++ b/fdm-app/app/routes/api.auth.$.tsx
@@ -1,11 +1,11 @@
-import { auth } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
+import { auth } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
import type {
ActionFunctionArgs,
LoaderFunctionArgs,
MetaFunction,
} from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
export const meta: MetaFunction = () => {
return [
diff --git a/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx b/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx
index 20a36e159..eb775494c 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx
@@ -1,8 +1,8 @@
-import { getMapboxToken } from "@/components/custom/atlas/atlas-mapbox"
-import { Button } from "@/components/ui/button"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+import { getMapboxToken } from "~/components/custom/atlas/atlas-mapbox"
+import { Button } from "~/components/ui/button"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import { getFields } from "@svenvw/fdm-core"
import {
type LoaderFunctionArgs,
@@ -11,7 +11,7 @@ import {
data,
useLoaderData,
} from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx b/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx
index 657e47741..d688a8aef 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx
@@ -5,23 +5,23 @@ import {
NavigationControl,
} from "react-map-gl"
import "mapbox-gl/dist/mapbox-gl.css"
-import { ZOOM_LEVEL_FIELDS } from "@/components/custom/atlas/atlas"
+import { ZOOM_LEVEL_FIELDS } from "~/components/custom/atlas/atlas"
import {
getMapboxStyle,
getMapboxToken,
-} from "@/components/custom/atlas/atlas-mapbox"
-import { FieldsPanelHover } from "@/components/custom/atlas/atlas-panels"
-import { FieldsSourceNotClickable } from "@/components/custom/atlas/atlas-sources"
-import { getFieldsStyle } from "@/components/custom/atlas/atlas-styles"
-import { getViewState } from "@/components/custom/atlas/atlas-viewstate"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+} from "~/components/custom/atlas/atlas-mapbox"
+import { FieldsPanelHover } from "~/components/custom/atlas/atlas-panels"
+import { FieldsSourceNotClickable } from "~/components/custom/atlas/atlas-sources"
+import { getFieldsStyle } from "~/components/custom/atlas/atlas-styles"
+import { getViewState } from "~/components/custom/atlas/atlas-viewstate"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import { getFields } from "@svenvw/fdm-core"
import type { FeatureCollection } from "geojson"
import { type LoaderFunctionArgs, data, useLoaderData } from "react-router"
import type { MetaFunction } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
export const meta: MetaFunction = () => {
return [
diff --git a/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx b/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx
index e1af81476..561dfdae0 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx
@@ -1,8 +1,8 @@
-import { getMapboxToken } from "@/components/custom/atlas/atlas-mapbox"
-import { Button } from "@/components/ui/button"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+import { getMapboxToken } from "~/components/custom/atlas/atlas-mapbox"
+import { Button } from "~/components/ui/button"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import { getFields } from "@svenvw/fdm-core"
import {
type LoaderFunctionArgs,
@@ -11,7 +11,7 @@ import {
data,
useLoaderData,
} from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.atlas.tsx b/fdm-app/app/routes/farm.$b_id_farm.atlas.tsx
index ab672ce20..2e98909ce 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.atlas.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.atlas.tsx
@@ -1,10 +1,10 @@
-import { FarmHeader } from "@/components/custom/farm/farm-header"
-import { FarmTitle } from "@/components/custom/farm/farm-title"
-import { SidebarInset } from "@/components/ui/sidebar"
-import { Skeleton } from "@/components/ui/skeleton"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+import { FarmHeader } from "~/components/custom/farm/farm-header"
+import { FarmTitle } from "~/components/custom/farm/farm-title"
+import { SidebarInset } from "~/components/ui/sidebar"
+import { Skeleton } from "~/components/ui/skeleton"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import { getFarm, getFarms } from "@svenvw/fdm-core"
import {
type LoaderFunctionArgs,
@@ -16,7 +16,7 @@ import {
useLocation,
} from "react-router"
import { ClientOnly } from "remix-utils/client-only"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx
index 940ba1ff1..cff6ef5a4 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx
@@ -3,15 +3,15 @@ import "mapbox-gl/dist/mapbox-gl.css"
import {
getMapboxStyle,
getMapboxToken,
-} from "@/components/custom/atlas/atlas-mapbox"
-import { FieldsSourceNotClickable } from "@/components/custom/atlas/atlas-sources"
-import { getFieldsStyle } from "@/components/custom/atlas/atlas-styles"
-import { getViewState } from "@/components/custom/atlas/atlas-viewstate"
-import { Separator } from "@/components/ui/separator"
-import { Skeleton } from "@/components/ui/skeleton"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+} from "~/components/custom/atlas/atlas-mapbox"
+import { FieldsSourceNotClickable } from "~/components/custom/atlas/atlas-sources"
+import { getFieldsStyle } from "~/components/custom/atlas/atlas-styles"
+import { getViewState } from "~/components/custom/atlas/atlas-viewstate"
+import { Separator } from "~/components/ui/separator"
+import { Skeleton } from "~/components/ui/skeleton"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import { getField } from "@svenvw/fdm-core"
import type { FeatureCollection } from "geojson"
import {
@@ -22,7 +22,7 @@ import {
} from "react-router"
import { ClientOnly } from "remix-utils/client-only"
import type { MetaFunction } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
export const meta: MetaFunction = () => {
return [
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu._index.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu._index.tsx
index 21ff82606..36cdb0f87 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu._index.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu._index.tsx
@@ -1,13 +1,13 @@
-import { CultivationForm } from "@/components/custom/cultivation/form"
-import { FormSchema } from "@/components/custom/cultivation/schema"
-import { HarvestsList } from "@/components/custom/harvest/list"
-import type { HarvestableType } from "@/components/custom/harvest/types"
-import { Button } from "@/components/ui/button"
-import { Separator } from "@/components/ui/separator"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { extractFormValuesFromRequest } from "@/lib/form"
+import { CultivationForm } from "~/components/custom/cultivation/form"
+import { FormSchema } from "~/components/custom/cultivation/schema"
+import { HarvestsList } from "~/components/custom/harvest/list"
+import type { HarvestableType } from "~/components/custom/harvest/types"
+import { Button } from "~/components/ui/button"
+import { Separator } from "~/components/ui/separator"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { extractFormValuesFromRequest } from "~/lib/form"
import {
getCultivation,
getCultivationsFromCatalogue,
@@ -26,12 +26,13 @@ import {
useLoaderData,
} from "react-router"
import { dataWithError, dataWithSuccess } from "remix-toast"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
return [
{ title: `Gewas - Perceel | ${config.name}` },
+
{
name: "description",
content: "Bekijk en bewerk de gegevens van je gewas.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest.$b_id_harvesting.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest.$b_id_harvesting.tsx
index 8e2a9dfb7..aa45e1a3f 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest.$b_id_harvesting.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest.$b_id_harvesting.tsx
@@ -1,11 +1,11 @@
-import { HarvestForm } from "@/components/custom/harvest/form"
-import { FormSchema } from "@/components/custom/harvest/schema"
-import { Button } from "@/components/ui/button"
-import { Separator } from "@/components/ui/separator"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { extractFormValuesFromRequest } from "@/lib/form"
+import { HarvestForm } from "~/components/custom/harvest/form"
+import { FormSchema } from "~/components/custom/harvest/schema"
+import { Button } from "~/components/ui/button"
+import { Separator } from "~/components/ui/separator"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { extractFormValuesFromRequest } from "~/lib/form"
import { addHarvest, getCultivation, getHarvest } from "@svenvw/fdm-core"
import {
type ActionFunctionArgs,
@@ -16,7 +16,7 @@ import {
useLoaderData,
} from "react-router"
import { redirectWithSuccess } from "remix-toast"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
@@ -24,6 +24,7 @@ export const meta: MetaFunction = () => {
{ title: `Oogst - Gewas - Perceel | ${config.name}` },
{
name: "description",
+
content: "Bekijk en bewerk de oogst van je gewas.",
},
]
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest._index.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest._index.tsx
index c69d71f66..a47a4ec1d 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest._index.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest._index.tsx
@@ -1,11 +1,11 @@
-import { HarvestForm } from "@/components/custom/harvest/form"
-import { FormSchema } from "@/components/custom/harvest/schema"
-import { Button } from "@/components/ui/button"
-import { Separator } from "@/components/ui/separator"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { extractFormValuesFromRequest } from "@/lib/form"
+import { HarvestForm } from "~/components/custom/harvest/form"
+import { FormSchema } from "~/components/custom/harvest/schema"
+import { Button } from "~/components/ui/button"
+import { Separator } from "~/components/ui/separator"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { extractFormValuesFromRequest } from "~/lib/form"
import {
addHarvest,
getCultivation,
@@ -21,7 +21,7 @@ import {
useLoaderData,
} from "react-router"
import { redirectWithSuccess } from "remix-toast"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
@@ -32,6 +32,7 @@ export const meta: MetaFunction = () => {
content: "Bekijk en bewerk de oogsten van je gewas.",
},
]
+
}
/**
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation._index.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation._index.tsx
index fe776e2fc..2c387c1d3 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation._index.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation._index.tsx
@@ -1,11 +1,11 @@
-import { CultivationForm } from "@/components/custom/cultivation/form"
-import { CultivationList } from "@/components/custom/cultivation/list"
-import { FormSchema } from "@/components/custom/cultivation/schema"
-import { Separator } from "@/components/ui/separator"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { extractFormValuesFromRequest } from "@/lib/form"
+import { CultivationForm } from "~/components/custom/cultivation/form"
+import { CultivationList } from "~/components/custom/cultivation/list"
+import { FormSchema } from "~/components/custom/cultivation/schema"
+import { Separator } from "~/components/ui/separator"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { extractFormValuesFromRequest } from "~/lib/form"
import {
addCultivation,
getCultivations,
@@ -23,7 +23,7 @@ import {
useLocation,
} from "react-router"
import {dataWithSuccess } from "remix-toast"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.fertilizer.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.fertilizer.tsx
index 330a30f8d..839bf0832 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.fertilizer.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.fertilizer.tsx
@@ -1,12 +1,12 @@
-import { FertilizerApplicationsCards } from "@/components/custom/fertilizer-applications/cards"
-import { FertilizerApplicationForm } from "@/components/custom/fertilizer-applications/form"
-import { FormSchema } from "@/components/custom/fertilizer-applications/formschema"
-import { FertilizerApplicationsList } from "@/components/custom/fertilizer-applications/list"
-import { Separator } from "@/components/ui/separator"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { extractFormValuesFromRequest } from "@/lib/form"
+import { FertilizerApplicationsCards } from "~/components/custom/fertilizer-applications/cards"
+import { FertilizerApplicationForm } from "~/components/custom/fertilizer-applications/form"
+import { FormSchema } from "~/components/custom/fertilizer-applications/formschema"
+import { FertilizerApplicationsList } from "~/components/custom/fertilizer-applications/list"
+import { Separator } from "~/components/ui/separator"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { extractFormValuesFromRequest } from "~/lib/form"
import { calculateDose } from "@svenvw/fdm-calculator"
import {
addFertilizerApplication,
@@ -25,7 +25,7 @@ import {
useLocation,
} from "react-router"
import { dataWithError, dataWithSuccess } from "remix-toast"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.norm.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.norm.tsx
index 755c4f6af..e550c9ee0 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.norm.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.norm.tsx
@@ -1,10 +1,10 @@
-import { Separator } from "@/components/ui/separator"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+import { Separator } from "~/components/ui/separator"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import { getField } from "@svenvw/fdm-core"
import { type LoaderFunctionArgs, type MetaFunction, data, useLoaderData } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.overview.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.overview.tsx
index 7b6809fe5..24b792cb6 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.overview.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.overview.tsx
@@ -1,6 +1,6 @@
-import { LoadingSpinner } from "@/components/custom/loadingspinner"
-import { Button } from "@/components/ui/button"
-import { Calendar } from "@/components/ui/calendar"
+import { LoadingSpinner } from "~/components/custom/loadingspinner"
+import { Button } from "~/components/ui/button"
+import { Calendar } from "~/components/ui/calendar"
import {
FormControl,
FormDescription,
@@ -8,26 +8,26 @@ import {
FormItem,
FormLabel,
FormMessage,
-} from "@/components/ui/form"
-import { Input } from "@/components/ui/input"
+} from "~/components/ui/form"
+import { Input } from "~/components/ui/input"
import {
Popover,
PopoverContent,
PopoverTrigger,
-} from "@/components/ui/popover"
+} from "~/components/ui/popover"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
-} from "@/components/ui/select"
-import { Separator } from "@/components/ui/separator"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { extractFormValuesFromRequest } from "@/lib/form"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/select"
+import { Separator } from "~/components/ui/separator"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { extractFormValuesFromRequest } from "~/lib/form"
+import { cn } from "~/lib/utils"
import { zodResolver } from "@hookform/resolvers/zod"
import { getField, updateField } from "@svenvw/fdm-core"
import { format } from "date-fns"
@@ -44,7 +44,7 @@ import { RemixFormProvider, useRemixForm } from "remix-hook-form"
import { dataWithSuccess } from "remix-toast"
import { z } from "zod"
import type { MetaFunction } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
export const meta: MetaFunction = () => {
return [
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.soil.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.soil.tsx
index 12d6ea8dd..bd281eac5 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.soil.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.soil.tsx
@@ -1,11 +1,11 @@
-import { Separator } from "@/components/ui/separator"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+import { Separator } from "~/components/ui/separator"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import { getField } from "@svenvw/fdm-core"
import { type LoaderFunctionArgs, data, useLoaderData } from "react-router"
import type { MetaFunction } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
export const meta: MetaFunction = () => {
return [
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.tsx
index 984d7025c..0d73915db 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.tsx
@@ -1,10 +1,10 @@
-import { FarmContent } from "@/components/custom/farm/farm-content"
-import { FarmHeader } from "@/components/custom/farm/farm-header"
-import { FarmTitle } from "@/components/custom/farm/farm-title"
-import { SidebarInset } from "@/components/ui/sidebar"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+import { FarmContent } from "~/components/custom/farm/farm-content"
+import { FarmHeader } from "~/components/custom/farm/farm-header"
+import { FarmTitle } from "~/components/custom/farm/farm-title"
+import { SidebarInset } from "~/components/ui/sidebar"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import { getFarms, getField, getFields } from "@svenvw/fdm-core"
import {
type LoaderFunctionArgs,
@@ -14,7 +14,7 @@ import {
redirect,
useLoaderData,
} from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field._index.tsx b/fdm-app/app/routes/farm.$b_id_farm.field._index.tsx
index 910acc106..bdcba0718 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field._index.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field._index.tsx
@@ -1,19 +1,19 @@
-import { FarmHeader } from "@/components/custom/farm/farm-header"
-import { FarmTitle } from "@/components/custom/farm/farm-title"
-import { Button } from "@/components/ui/button"
+import { FarmHeader } from "~/components/custom/farm/farm-header"
+import { FarmTitle } from "~/components/custom/farm/farm-title"
+import { Button } from "~/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
-} from "@/components/ui/card"
-import { Separator } from "@/components/ui/separator"
-import { SidebarInset } from "@/components/ui/sidebar"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { getTimeBasedGreeting } from "@/lib/greetings"
+} from "~/components/ui/card"
+import { Separator } from "~/components/ui/separator"
+import { SidebarInset } from "~/components/ui/sidebar"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { getTimeBasedGreeting } from "~/lib/greetings"
import { getFarms, getFields } from "@svenvw/fdm-core"
import {
type LoaderFunctionArgs,
@@ -23,7 +23,7 @@ import {
useLoaderData,
} from "react-router"
import type { MetaFunction } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
export const meta: MetaFunction = () => {
return [
diff --git a/fdm-app/app/routes/farm.$b_id_farm.settings._index.tsx b/fdm-app/app/routes/farm.$b_id_farm.settings._index.tsx
index da6161308..2a8047c68 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.settings._index.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.settings._index.tsx
@@ -1,5 +1,5 @@
import { type MetaFunction, redirect } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.settings.access.tsx b/fdm-app/app/routes/farm.$b_id_farm.settings.access.tsx
index 3042b8a20..e93b39076 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.settings.access.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.settings.access.tsx
@@ -1,6 +1,6 @@
-import { Separator } from "@/components/ui/separator"
+import { Separator } from "~/components/ui/separator"
import type { MetaFunction } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.settings.delete.tsx b/fdm-app/app/routes/farm.$b_id_farm.settings.delete.tsx
index f972eb25c..2f56f4995 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.settings.delete.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.settings.delete.tsx
@@ -1,6 +1,6 @@
-import { Separator } from "@/components/ui/separator"
+import { Separator } from "~/components/ui/separator"
import type { MetaFunction } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.settings.properties.tsx b/fdm-app/app/routes/farm.$b_id_farm.settings.properties.tsx
index 8a6592de1..037546ad3 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.settings.properties.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.settings.properties.tsx
@@ -1,5 +1,5 @@
-import { LoadingSpinner } from "@/components/custom/loadingspinner"
-import { Button } from "@/components/ui/button"
+import { LoadingSpinner } from "~/components/custom/loadingspinner"
+import { Button } from "~/components/ui/button"
import {
FormControl,
FormDescription,
@@ -7,14 +7,14 @@ import {
FormItem,
FormLabel,
FormMessage,
-} from "@/components/ui/form"
-import { Input } from "@/components/ui/input"
-import { Separator } from "@/components/ui/separator"
-import { Textarea } from "@/components/ui/textarea"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { extractFormValuesFromRequest } from "@/lib/form"
+} from "~/components/ui/form"
+import { Input } from "~/components/ui/input"
+import { Separator } from "~/components/ui/separator"
+import { Textarea } from "~/components/ui/textarea"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { extractFormValuesFromRequest } from "~/lib/form"
import { zodResolver } from "@hookform/resolvers/zod"
import { getFarm, updateFarm } from "@svenvw/fdm-core"
import { useEffect } from "react"
@@ -31,7 +31,7 @@ import { dataWithSuccess } from "remix-toast"
import validator from "validator"
import { z } from "zod"
const { isPostalCode } = validator
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.settings.tsx b/fdm-app/app/routes/farm.$b_id_farm.settings.tsx
index 0a96abaf4..5d0e54852 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.settings.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.settings.tsx
@@ -1,11 +1,11 @@
-import { FarmContent } from "@/components/custom/farm/farm-content"
-import { FarmHeader } from "@/components/custom/farm/farm-header"
-import { FarmTitle } from "@/components/custom/farm/farm-title"
-import { SidebarInset } from "@/components/ui/sidebar"
-import { Toaster } from "@/components/ui/sonner"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+import { FarmContent } from "~/components/custom/farm/farm-content"
+import { FarmHeader } from "~/components/custom/farm/farm-header"
+import { FarmTitle } from "~/components/custom/farm/farm-title"
+import { SidebarInset } from "~/components/ui/sidebar"
+import { Toaster } from "~/components/ui/sonner"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import { getFarm, getFarms } from "@svenvw/fdm-core"
import {
type LoaderFunctionArgs,
@@ -14,7 +14,7 @@ import {
data,
useLoaderData,
} from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.$b_id_farm.tsx b/fdm-app/app/routes/farm.$b_id_farm.tsx
index f7974dfbc..8a166cd36 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.tsx
@@ -1,7 +1,7 @@
-import { getSession } from "@/lib/auth.server"
-import { handleActionError } from "@/lib/error"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError } from "~/lib/error"
import { type LoaderFunctionArgs, type MetaFunction, data } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm._index.tsx b/fdm-app/app/routes/farm._index.tsx
index bf0a3dcef..951312a0e 100644
--- a/fdm-app/app/routes/farm._index.tsx
+++ b/fdm-app/app/routes/farm._index.tsx
@@ -1,22 +1,22 @@
-import { FarmHeader } from "@/components/custom/farm/farm-header"
-import { FarmTitle } from "@/components/custom/farm/farm-title"
-import { Button } from "@/components/ui/button"
+import { FarmHeader } from "~/components/custom/farm/farm-header"
+import { FarmTitle } from "~/components/custom/farm/farm-title"
+import { Button } from "~/components/ui/button"
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
-} from "@/components/ui/card"
-import { Separator } from "@/components/ui/separator"
-import { SidebarInset } from "@/components/ui/sidebar"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { getTimeBasedGreeting } from "@/lib/greetings"
+} from "~/components/ui/card"
+import { Separator } from "~/components/ui/separator"
+import { SidebarInset } from "~/components/ui/sidebar"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { getTimeBasedGreeting } from "~/lib/greetings"
import { getFarms } from "@svenvw/fdm-core"
import { type LoaderFunctionArgs, type MetaFunction, NavLink, useLoaderData } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.account.tsx b/fdm-app/app/routes/farm.account.tsx
index b42f4bf9d..7436f791a 100644
--- a/fdm-app/app/routes/farm.account.tsx
+++ b/fdm-app/app/routes/farm.account.tsx
@@ -1,5 +1,5 @@
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
import { type LoaderFunctionArgs, type MetaFunction, useLoaderData } from "react-router"
import {
Card,
@@ -7,18 +7,18 @@ import {
CardDescription,
CardHeader,
CardTitle,
-} from "@/components/ui/card"
-import { Separator } from "@/components/ui/separator"
-import { SidebarTrigger } from "@/components/ui/sidebar"
+} from "~/components/ui/card"
+import { Separator } from "~/components/ui/separator"
+import { SidebarTrigger } from "~/components/ui/sidebar"
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
-} from "@/components/ui/breadcrumb"
-import { FarmTitle } from "@/components/custom/farm/farm-title"
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
-import config from "~/fdm.config"
+} from "~/components/ui/breadcrumb"
+import { FarmTitle } from "~/components/custom/farm/farm-title"
+import { Avatar, AvatarFallback, AvatarImage } from "~/components/ui/avatar"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
index 28ab47943..13e0e09a6 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
@@ -1,32 +1,32 @@
-import { ZOOM_LEVEL_FIELDS } from "@/components/custom/atlas/atlas"
-import { generateFeatureClass } from "@/components/custom/atlas/atlas-functions"
+import { ZOOM_LEVEL_FIELDS } from "~/components/custom/atlas/atlas"
+import { generateFeatureClass } from "~/components/custom/atlas/atlas-functions"
import {
getMapboxStyle,
getMapboxToken,
-} from "@/components/custom/atlas/atlas-mapbox"
+} from "~/components/custom/atlas/atlas-mapbox"
import {
FieldsPanelHover,
FieldsPanelSelection,
FieldsPanelZoom,
-} from "@/components/custom/atlas/atlas-panels"
+} from "~/components/custom/atlas/atlas-panels"
import {
FieldsSourceAvailable,
FieldsSourceSelected,
-} from "@/components/custom/atlas/atlas-sources"
-import { getFieldsStyle } from "@/components/custom/atlas/atlas-styles"
-import { getViewState } from "@/components/custom/atlas/atlas-viewstate"
+} from "~/components/custom/atlas/atlas-sources"
+import { getFieldsStyle } from "~/components/custom/atlas/atlas-styles"
+import { getViewState } from "~/components/custom/atlas/atlas-viewstate"
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbSeparator,
-} from "@/components/ui/breadcrumb"
-import { Separator } from "@/components/ui/separator"
-import { SidebarInset, SidebarTrigger } from "@/components/ui/sidebar"
-import { Skeleton } from "@/components/ui/skeleton"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
+} from "~/components/ui/breadcrumb"
+import { Separator } from "~/components/ui/separator"
+import { SidebarInset, SidebarTrigger } from "~/components/ui/sidebar"
+import { Skeleton } from "~/components/ui/skeleton"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
import {
addCultivation,
addField,
@@ -50,8 +50,8 @@ import {
} from "react-router"
import { redirectWithSuccess } from "remix-toast"
import { ClientOnly } from "remix-utils/client-only"
-import { fdm } from "@/lib/fdm.server"
-import config from "~/fdm.config"
+import { fdm } from "~/lib/fdm.server"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx
index c52825a56..4620a2027 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx
@@ -1,5 +1,5 @@
import type { MetaFunction } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx
index 454e9c449..51d49dcd2 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx
@@ -1,12 +1,12 @@
-import { CultivationForm } from "@/components/custom/cultivation/form"
-import { FormSchema } from "@/components/custom/cultivation/schema"
-import { HarvestsList } from "@/components/custom/harvest/list"
-import type { HarvestableType } from "@/components/custom/harvest/types"
-import { Separator } from "@/components/ui/separator"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { extractFormValuesFromRequest } from "@/lib/form"
+import { CultivationForm } from "~/components/custom/cultivation/form"
+import { FormSchema } from "~/components/custom/cultivation/schema"
+import { HarvestsList } from "~/components/custom/harvest/list"
+import type { HarvestableType } from "~/components/custom/harvest/types"
+import { Separator } from "~/components/ui/separator"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { extractFormValuesFromRequest } from "~/lib/form"
import {
getCultivationPlan,
getCultivationsFromCatalogue,
@@ -22,7 +22,7 @@ import {
useLoaderData,
} from "react-router"
import { dataWithSuccess } from "remix-toast"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx
index 67d82742f..ff4d21fad 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx
@@ -1,8 +1,8 @@
-import { HarvestForm } from "@/components/custom/harvest/form"
-import { Button } from "@/components/ui/button"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+import { HarvestForm } from "~/components/custom/harvest/form"
+import { Button } from "~/components/ui/button"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import {
getCultivationPlan,
getCultivationsFromCatalogue,
@@ -14,7 +14,7 @@ import {
data,
useLoaderData,
} from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx
index ccc0774c7..2a9761728 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx
@@ -1,10 +1,10 @@
-import { HarvestForm } from "@/components/custom/harvest/form"
-import { FormSchema } from "@/components/custom/harvest/schema"
-import { Button } from "@/components/ui/button"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { extractFormValuesFromRequest } from "@/lib/form"
+import { HarvestForm } from "~/components/custom/harvest/form"
+import { FormSchema } from "~/components/custom/harvest/schema"
+import { Button } from "~/components/ui/button"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { extractFormValuesFromRequest } from "~/lib/form"
import {
addHarvest,
getCultivationPlan,
@@ -18,7 +18,7 @@ import {
data,
} from "react-router"
import { redirectWithSuccess } from "remix-toast"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx
index 8445da5dc..d0c46bef0 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx
@@ -1,11 +1,11 @@
-import { FertilizerApplicationsCards } from "@/components/custom/fertilizer-applications/cards"
-import { FertilizerApplicationForm } from "@/components/custom/fertilizer-applications/form"
-import { FormSchema } from "@/components/custom/fertilizer-applications/formschema"
-import { FertilizerApplicationsList } from "@/components/custom/fertilizer-applications/list"
-import { Separator } from "@/components/ui/separator"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
-import { extractFormValuesFromRequest } from "@/lib/form"
+import { FertilizerApplicationsCards } from "~/components/custom/fertilizer-applications/cards"
+import { FertilizerApplicationForm } from "~/components/custom/fertilizer-applications/form"
+import { FormSchema } from "~/components/custom/fertilizer-applications/formschema"
+import { FertilizerApplicationsList } from "~/components/custom/fertilizer-applications/list"
+import { Separator } from "~/components/ui/separator"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
+import { extractFormValuesFromRequest } from "~/lib/form"
import { calculateDose } from "@svenvw/fdm-calculator"
import {
addFertilizerApplication,
@@ -23,8 +23,8 @@ import {
useLocation,
} from "react-router"
import { dataWithSuccess } from "remix-toast"
-import { fdm } from "@/lib/fdm.server"
-import config from "~/fdm.config"
+import { fdm } from "~/lib/fdm.server"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx
index 621284707..a4d0805cd 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx
@@ -3,9 +3,9 @@ import {
PaginationContent,
PaginationItem,
PaginationLink,
-} from "@/components/ui/pagination"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
+} from "~/components/ui/pagination"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
import { getCultivationPlan } from "@svenvw/fdm-core"
import {
type LoaderFunctionArgs,
@@ -15,8 +15,8 @@ import {
useLocation,
} from "react-router"
import { useLoaderData } from "react-router"
-import { fdm } from "@/lib/fdm.server"
-import config from "~/fdm.config"
+import { fdm } from "~/lib/fdm.server"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx
index c96a45e4a..719daf1b8 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx
@@ -1,13 +1,13 @@
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import { getCultivationPlan } from "@svenvw/fdm-core"
import {
type LoaderFunctionArgs,
type MetaFunction,
redirect,
} from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx
index 43ad4fd26..8336e9f8e 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx
@@ -1,19 +1,19 @@
-import { SidebarPage } from "@/components/custom/sidebar-page"
+import { SidebarPage } from "~/components/custom/sidebar-page"
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbSeparator,
-} from "@/components/ui/breadcrumb"
-import { Button } from "@/components/ui/button"
-import { Separator } from "@/components/ui/separator"
-import { SidebarInset, SidebarTrigger } from "@/components/ui/sidebar"
-import { Toaster } from "@/components/ui/sonner"
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/breadcrumb"
+import { Button } from "~/components/ui/button"
+import { Separator } from "~/components/ui/separator"
+import { SidebarInset, SidebarTrigger } from "~/components/ui/sidebar"
+import { Toaster } from "~/components/ui/sonner"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
+import { cn } from "~/lib/utils"
import { getCultivationPlan, getFarm } from "@svenvw/fdm-core"
import {
type LoaderFunctionArgs,
@@ -22,7 +22,7 @@ import {
data,
} from "react-router"
import { Outlet, useLoaderData } from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
index 7dc3f8ce4..930436be1 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
@@ -1,14 +1,14 @@
import {
getMapboxStyle,
getMapboxToken,
-} from "@/components/custom/atlas/atlas-mapbox"
-import { FieldsSourceNotClickable } from "@/components/custom/atlas/atlas-sources"
-import { getFieldsStyle } from "@/components/custom/atlas/atlas-styles"
-import { getViewState } from "@/components/custom/atlas/atlas-viewstate"
-import { Combobox } from "@/components/custom/combobox"
-import { LoadingSpinner } from "@/components/custom/loadingspinner"
-import { Button } from "@/components/ui/button"
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
+} from "~/components/custom/atlas/atlas-mapbox"
+import { FieldsSourceNotClickable } from "~/components/custom/atlas/atlas-sources"
+import { getFieldsStyle } from "~/components/custom/atlas/atlas-styles"
+import { getViewState } from "~/components/custom/atlas/atlas-viewstate"
+import { Combobox } from "~/components/custom/combobox"
+import { LoadingSpinner } from "~/components/custom/loadingspinner"
+import { Button } from "~/components/ui/button"
+import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card"
import {
FormControl,
FormDescription,
@@ -16,19 +16,19 @@ import {
FormItem,
FormLabel,
FormMessage,
-} from "@/components/ui/form"
-import { Input } from "@/components/ui/input"
+} from "~/components/ui/form"
+import { Input } from "~/components/ui/input"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
-} from "@/components/ui/select"
-import { Skeleton } from "@/components/ui/skeleton"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
-import { extractFormValuesFromRequest } from "@/lib/form"
+} from "~/components/ui/select"
+import { Skeleton } from "~/components/ui/skeleton"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
+import { extractFormValuesFromRequest } from "~/lib/form"
import { zodResolver } from "@hookform/resolvers/zod"
import {
addSoilAnalysis,
@@ -53,9 +53,9 @@ import { RemixFormProvider, useRemixForm } from "remix-hook-form"
import { dataWithSuccess } from "remix-toast"
import { ClientOnly } from "remix-utils/client-only"
import { z } from "zod"
-import { fdm } from "@/lib/fdm.server"
+import { fdm } from "~/lib/fdm.server"
import { useEffect } from "react"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx
index d1123ff40..0f094272f 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx
@@ -1,13 +1,13 @@
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { fdm } from "@/lib/fdm.server"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { fdm } from "~/lib/fdm.server"
import { getFields } from "@svenvw/fdm-core"
import {
type LoaderFunctionArgs,
type MetaFunction,
redirect,
} from "react-router"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx
index 4606e533c..555badd30 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx
@@ -1,17 +1,17 @@
-import { SidebarPage } from "@/components/custom/sidebar-page"
+import { SidebarPage } from "~/components/custom/sidebar-page"
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbSeparator,
-} from "@/components/ui/breadcrumb"
-import { Button } from "@/components/ui/button"
-import { Separator } from "@/components/ui/separator"
-import { SidebarInset, SidebarTrigger } from "@/components/ui/sidebar"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/breadcrumb"
+import { Button } from "~/components/ui/button"
+import { Separator } from "~/components/ui/separator"
+import { SidebarInset, SidebarTrigger } from "~/components/ui/sidebar"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
+import { cn } from "~/lib/utils"
import {
getCultivationsFromCatalogue,
getFarm,
@@ -26,8 +26,8 @@ import {
data,
} from "react-router"
import { useLoaderData } from "react-router"
-import { fdm } from "@/lib/fdm.server"
-import config from "~/fdm.config"
+import { fdm } from "~/lib/fdm.server"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.create._index.tsx b/fdm-app/app/routes/farm.create._index.tsx
index 6dcbb59ce..82a681fe8 100644
--- a/fdm-app/app/routes/farm.create._index.tsx
+++ b/fdm-app/app/routes/farm.create._index.tsx
@@ -1,16 +1,16 @@
-import { Farm } from "@/components/blocks/farm"
+import { Farm } from "~/components/blocks/farm"
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbSeparator,
-} from "@/components/ui/breadcrumb"
-import { Separator } from "@/components/ui/separator"
-import { SidebarInset, SidebarTrigger } from "@/components/ui/sidebar"
-import { getSession } from "@/lib/auth.server"
-import { handleActionError } from "@/lib/error"
-import { extractFormValuesFromRequest } from "@/lib/form"
+} from "~/components/ui/breadcrumb"
+import { Separator } from "~/components/ui/separator"
+import { SidebarInset, SidebarTrigger } from "~/components/ui/sidebar"
+import { getSession } from "~/lib/auth.server"
+import { handleActionError } from "~/lib/error"
+import { extractFormValuesFromRequest } from "~/lib/form"
import {
addFarm,
addFertilizer,
@@ -26,8 +26,8 @@ import type {
import { useLoaderData } from "react-router"
import { redirectWithSuccess } from "remix-toast"
import { z } from "zod"
-import { fdm } from "@/lib/fdm.server"
-import config from "~/fdm.config"
+import { fdm } from "~/lib/fdm.server"
+import config from "@/fdm.config"
// Meta
export const meta: MetaFunction = () => {
diff --git a/fdm-app/app/routes/farm.tsx b/fdm-app/app/routes/farm.tsx
index ffc4b55e1..90b5a8036 100644
--- a/fdm-app/app/routes/farm.tsx
+++ b/fdm-app/app/routes/farm.tsx
@@ -1,7 +1,7 @@
-import { SidebarApp } from "@/components/custom/sidebar-app"
-import { SidebarProvider } from "@/components/ui/sidebar"
-import { auth, getSession } from "@/lib/auth.server"
-import { handleActionError, handleLoaderError } from "@/lib/error"
+import { SidebarApp } from "~/components/custom/sidebar-app"
+import { SidebarProvider } from "~/components/ui/sidebar"
+import { auth, getSession } from "~/lib/auth.server"
+import { handleActionError, handleLoaderError } from "~/lib/error"
import type {
ActionFunctionArgs,
LoaderFunctionArgs,
@@ -9,13 +9,13 @@ import type {
} from "react-router"
import { redirect, useRoutes } from "react-router"
import { useLoaderData, useMatches } from "react-router"
-import { FarmContext } from "@/context/farm-context"
+import { FarmContext } from "~/context/farm-context"
import { useState, useEffect } from "react"
import WhatsNew from "./farm.whats-new"
import Account from "./farm.account"
-import { SidebarInset } from "@/components/ui/sidebar"
+import { SidebarInset } from "~/components/ui/sidebar"
import { Outlet } from "react-router-dom"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
export const meta: MetaFunction = () => {
return [
diff --git a/fdm-app/app/routes/farm.whats-new.tsx b/fdm-app/app/routes/farm.whats-new.tsx
index c16fd233e..bbaa6f6f3 100644
--- a/fdm-app/app/routes/farm.whats-new.tsx
+++ b/fdm-app/app/routes/farm.whats-new.tsx
@@ -1,5 +1,5 @@
-import { getSession } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
+import { getSession } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
import {
type LoaderFunctionArgs,
type MetaFunction,
@@ -7,20 +7,20 @@ import {
} from "react-router"
import { formatDistanceToNow } from "date-fns"
import { nl } from "date-fns/locale"
-import { FarmTitle } from "@/components/custom/farm/farm-title"
-import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
-import { Separator } from "@/components/ui/separator"
+import { FarmTitle } from "~/components/custom/farm/farm-title"
+import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card"
+import { Separator } from "~/components/ui/separator"
import { Sparkles } from "lucide-react"
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
-} from "@/components/ui/breadcrumb"
-import { SidebarTrigger } from "@/components/ui/sidebar"
+} from "~/components/ui/breadcrumb"
+import { SidebarTrigger } from "~/components/ui/sidebar"
import ReactMarkdown from "react-markdown"
import remarkGfm from "remark-gfm"
-import config from "~/fdm.config"
+import config from "@/fdm.config"
export const meta: MetaFunction = () => {
return [
diff --git a/fdm-app/app/routes/signin.tsx b/fdm-app/app/routes/signin.tsx
index bd5f23bda..21d5be478 100644
--- a/fdm-app/app/routes/signin.tsx
+++ b/fdm-app/app/routes/signin.tsx
@@ -1,4 +1,4 @@
-import { Button } from "@/components/ui/button"
+import { Button } from "~/components/ui/button"
import {
Card,
CardContent,
@@ -6,18 +6,18 @@ import {
CardFooter,
CardHeader,
CardTitle,
-} from "@/components/ui/card"
-import { signIn } from "@/lib/auth-client"
-import { auth } from "@/lib/auth.server"
-import { handleLoaderError } from "@/lib/error"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/card"
+import { signIn } from "~/lib/auth-client"
+import { auth } from "~/lib/auth.server"
+import { handleLoaderError } from "~/lib/error"
+import { cn } from "~/lib/utils"
import { Check, MoveDown, Info } from "lucide-react"
import type { LoaderFunctionArgs } from "react-router"
import { redirect } from "react-router"
import { toast } from "sonner"
import type { MetaFunction } from "react-router"
-import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
-import config from "~/fdm.config"
+import { Alert, AlertDescription, AlertTitle } from "~/components/ui/alert"
+import config from "@/fdm.config"
export const meta: MetaFunction = () => {
return [
diff --git a/fdm-app/tsconfig.json b/fdm-app/tsconfig.json
index dfa503401..7cb10fd38 100644
--- a/fdm-app/tsconfig.json
+++ b/fdm-app/tsconfig.json
@@ -8,8 +8,9 @@
"**/.client/**/*.tsx",
".react-router/types/**/*",
"app/routes/*.tsx",
- "app/components/**/*.tsx"
-, "app/lib/fdm-migrate.server.js" ],
+ "app/components/**/*.tsx",
+ "app/lib/fdm-migrate.server.js"
+ ],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"types": ["@react-router/node", "vite/client"],
@@ -26,8 +27,8 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
- "@/*": ["./app/*"],
- "~/*": ["./*"]
+ "@/*": ["./*"],
+ "~/*": ["./app/*"]
},
"rootDirs": [".", "./.react-router/types"],
From 3fbd91e5b205c8f3f3243eeb93bc25ffe84df233 Mon Sep 17 00:00:00 2001
From: Sven Verweij <37927107+SvenVw@users.noreply.github.com>
Date: Thu, 3 Apr 2025 13:35:11 +0200
Subject: [PATCH 09/35] Enable split between client and server config
---
fdm-app/app/lib/config.ts | 58 +++++++++++++++++++++++++++++++++++++++
fdm-app/fdm.config.ts | 40 ++++++---------------------
2 files changed, 67 insertions(+), 31 deletions(-)
create mode 100644 fdm-app/app/lib/config.ts
diff --git a/fdm-app/app/lib/config.ts b/fdm-app/app/lib/config.ts
new file mode 100644
index 000000000..1baf6edb2
--- /dev/null
+++ b/fdm-app/app/lib/config.ts
@@ -0,0 +1,58 @@
+import config from "@/fdm.config"
+
+// Export the full config for server-side use
+export const serverConfig = config
+
+// Create the client-safe config object
+export const clientConfig: ClientConfig = {
+ name: config.name,
+ favicon: config.favicon,
+ logo: config.logo,
+ analytics: {
+ sentry: config.analytics.sentry
+ ? { dsn: config.analytics.sentry.dsn }
+ : null,
+ },
+}
+
+export interface Config {
+ name: string
+ favicon: string
+ logo: string
+ auth: {
+ fdm_session_secret: string
+ better_auth_secret: string
+ google?: {
+ clientId: string
+ clientSecret: string
+ } | null
+ microsoft?: {
+ clientId: string
+ clientSecret: string
+ } | null
+ }
+ database: {
+ password: string
+ user: string
+ database: string
+ host: string
+ port: number
+ }
+ analytics: {
+ sentry?: {
+ dsn: string
+ } | null
+ }
+}
+
+// Define the structure for client-safe configuration
+interface ClientConfig {
+ name: string
+ favicon: string
+ logo: string
+ analytics: {
+ sentry?: {
+ dsn: string
+ } | null
+ }
+}
diff --git a/fdm-app/fdm.config.ts b/fdm-app/fdm.config.ts
index c1cd0640f..6e518ec97 100644
--- a/fdm-app/fdm.config.ts
+++ b/fdm-app/fdm.config.ts
@@ -1,8 +1,10 @@
+import type { Config } from "~/lib/config"
+
const config: Config = {
// Site name
name: "FDM",
favicon: "/favicon.ico",
- logo: "/logo.svg",
+ logo: "/logo.svg",
// Authentication
auth: {
@@ -27,37 +29,13 @@ const config: Config = {
port: Number(process.env.DB_PORT),
},
- // Sentry
- sentry: {
- dsn: String(process.env.SENTRY_DSN),
+ // Analytics
+ analytics: {
+ // Sentry
+ sentry: {
+ dsn: String(process.env.SENTRY_DSN),
+ },
},
}
export default config
-interface Config {
- name: string
- favicon: string
- logo: string
- auth: {
- fdm_session_secret: string
- better_auth_secret: string
- google?: {
- clientId: string
- clientSecret: string
- } | null
- microsoft?: {
- clientId: string
- clientSecret: string
- } | null
- }
- database: {
- password: string
- user: string
- database: string
- host: string
- port: number
- }
- sentry?: {
- dsn: string
- } | null
-}
From 07a63ce6631cecb1bc413fedab88d091ef5ebfd4 Mon Sep 17 00:00:00 2001
From: Sven Verweij <37927107+SvenVw@users.noreply.github.com>
Date: Thu, 3 Apr 2025 13:49:22 +0200
Subject: [PATCH 10/35] Update importing the config for meta
---
fdm-app/app/routes/api.auth.$.tsx | 4 ++--
.../app/routes/farm.$b_id_farm.atlas.elevation.tsx | 4 ++--
.../app/routes/farm.$b_id_farm.atlas.fields.tsx | 4 ++--
fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx | 4 ++--
fdm-app/app/routes/farm.$b_id_farm.atlas.tsx | 4 ++--
.../routes/farm.$b_id_farm.field.$b_id.atlas.tsx | 4 ++--
...d_farm.field.$b_id.cultivation.$b_lu._index.tsx | 4 ++--
....cultivation.$b_lu.harvest.$b_id_harvesting.tsx | 4 ++--
...ield.$b_id.cultivation.$b_lu.harvest._index.tsx | 4 ++--
...m.$b_id_farm.field.$b_id.cultivation._index.tsx | 4 ++--
.../farm.$b_id_farm.field.$b_id.fertilizer.tsx | 4 ++--
.../routes/farm.$b_id_farm.field.$b_id.norm.tsx | 4 ++--
.../farm.$b_id_farm.field.$b_id.overview.tsx | 4 ++--
.../routes/farm.$b_id_farm.field.$b_id.soil.tsx | 4 ++--
fdm-app/app/routes/farm.$b_id_farm.field.$b_id.tsx | 4 ++--
.../app/routes/farm.$b_id_farm.field._index.tsx | 4 ++--
.../app/routes/farm.$b_id_farm.settings._index.tsx | 4 ++--
.../app/routes/farm.$b_id_farm.settings.access.tsx | 4 ++--
.../app/routes/farm.$b_id_farm.settings.delete.tsx | 4 ++--
.../routes/farm.$b_id_farm.settings.properties.tsx | 4 ++--
fdm-app/app/routes/farm.$b_id_farm.settings.tsx | 4 ++--
fdm-app/app/routes/farm.$b_id_farm.tsx | 4 ++--
fdm-app/app/routes/farm._index.tsx | 4 ++--
fdm-app/app/routes/farm.account.tsx | 4 ++--
.../app/routes/farm.create.$b_id_farm.atlas.tsx | 4 ++--
...farm.cultivations.$b_lu_catalogue.covercrop.tsx | 4 ++--
...rm.cultivations.$b_lu_catalogue.crop._index.tsx | 4 ++--
..._lu_catalogue.crop.harvest.$b_id_harvesting.tsx | 4 ++--
...vations.$b_lu_catalogue.crop.harvest._index.tsx | 4 ++--
...rm.cultivations.$b_lu_catalogue.fertilizers.tsx | 4 ++--
...ate.$b_id_farm.cultivations.$b_lu_catalogue.tsx | 4 ++--
.../farm.create.$b_id_farm.cultivations._index.tsx | 4 ++--
.../routes/farm.create.$b_id_farm.cultivations.tsx | 4 ++--
.../routes/farm.create.$b_id_farm.fields.$b_id.tsx | 4 ++--
.../farm.create.$b_id_farm.fields._index.tsx | 4 ++--
.../app/routes/farm.create.$b_id_farm.fields.tsx | 4 ++--
fdm-app/app/routes/farm.create._index.tsx | 4 ++--
fdm-app/app/routes/farm.tsx | 4 ++--
fdm-app/app/routes/farm.whats-new.tsx | 10 +++++-----
fdm-app/app/routes/signin.tsx | 14 +++++++-------
fdm-app/fdm.config.ts | 3 ++-
41 files changed, 90 insertions(+), 89 deletions(-)
diff --git a/fdm-app/app/routes/api.auth.$.tsx b/fdm-app/app/routes/api.auth.$.tsx
index f402b7809..9bee8a89d 100644
--- a/fdm-app/app/routes/api.auth.$.tsx
+++ b/fdm-app/app/routes/api.auth.$.tsx
@@ -5,11 +5,11 @@ import type {
LoaderFunctionArgs,
MetaFunction,
} from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
export const meta: MetaFunction = () => {
return [
- { title: `Authenticatie | ${config.name}` },
+ { title: `Authenticatie | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx b/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx
index eb775494c..fd8d0cc8c 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx
@@ -11,12 +11,12 @@ import {
data,
useLoaderData,
} from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Hoogte - Kaart | ${config.name}` },
+ { title: `Hoogte - Kaart | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk hoogtegegevens op de kaart.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx b/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx
index d688a8aef..bf169b44c 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx
@@ -21,11 +21,11 @@ import { getFields } from "@svenvw/fdm-core"
import type { FeatureCollection } from "geojson"
import { type LoaderFunctionArgs, data, useLoaderData } from "react-router"
import type { MetaFunction } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
export const meta: MetaFunction = () => {
return [
- { title: `Percelen - Kaart | ${config.name}` },
+ { title: `Percelen - Kaart | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx b/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx
index 561dfdae0..e07b93d97 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx
@@ -11,12 +11,12 @@ import {
data,
useLoaderData,
} from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Bodem - Kaart | ${config.name}` },
+ { title: `Bodem - Kaart | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk bodemgegevens op de kaart.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.atlas.tsx b/fdm-app/app/routes/farm.$b_id_farm.atlas.tsx
index 2e98909ce..100e977d6 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.atlas.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.atlas.tsx
@@ -16,12 +16,12 @@ import {
useLocation,
} from "react-router"
import { ClientOnly } from "remix-utils/client-only"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Kaarten | ${config.name}` },
+ { title: `Kaarten | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk informatie op de kaart.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx
index cff6ef5a4..70876bc6a 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx
@@ -22,11 +22,11 @@ import {
} from "react-router"
import { ClientOnly } from "remix-utils/client-only"
import type { MetaFunction } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
export const meta: MetaFunction = () => {
return [
- { title: `Kaart - Perceel | ${config.name}` },
+ { title: `Kaart - Perceel | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu._index.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu._index.tsx
index 36cdb0f87..e3d38bb82 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu._index.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu._index.tsx
@@ -26,12 +26,12 @@ import {
useLoaderData,
} from "react-router"
import { dataWithError, dataWithSuccess } from "remix-toast"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Gewas - Perceel | ${config.name}` },
+ { title: `Gewas - Perceel | ${clientConfig.name}` },
{
name: "description",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest.$b_id_harvesting.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest.$b_id_harvesting.tsx
index aa45e1a3f..e352d7890 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest.$b_id_harvesting.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest.$b_id_harvesting.tsx
@@ -16,12 +16,12 @@ import {
useLoaderData,
} from "react-router"
import { redirectWithSuccess } from "remix-toast"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Oogst - Gewas - Perceel | ${config.name}` },
+ { title: `Oogst - Gewas - Perceel | ${clientConfig.name}` },
{
name: "description",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest._index.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest._index.tsx
index a47a4ec1d..71a1966cc 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest._index.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation.$b_lu.harvest._index.tsx
@@ -21,12 +21,12 @@ import {
useLoaderData,
} from "react-router"
import { redirectWithSuccess } from "remix-toast"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Oogsten - Gewas - Perceel | ${config.name}` },
+ { title: `Oogsten - Gewas - Perceel | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de oogsten van je gewas.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation._index.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation._index.tsx
index 2c387c1d3..b0e643a46 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation._index.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.cultivation._index.tsx
@@ -23,12 +23,12 @@ import {
useLocation,
} from "react-router"
import {dataWithSuccess } from "remix-toast"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Gewas - Perceel | ${config.name}` },
+ { title: `Gewas - Perceel | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de gewassen van je perceel.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.fertilizer.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.fertilizer.tsx
index 839bf0832..3595df399 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.fertilizer.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.fertilizer.tsx
@@ -25,12 +25,12 @@ import {
useLocation,
} from "react-router"
import { dataWithError, dataWithSuccess } from "remix-toast"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Bemesting - Perceel | ${config.name}` },
+ { title: `Bemesting - Perceel | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de bemestinggegevens van je perceel.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.norm.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.norm.tsx
index e550c9ee0..88272263e 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.norm.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.norm.tsx
@@ -4,12 +4,12 @@ import { handleLoaderError } from "~/lib/error"
import { fdm } from "~/lib/fdm.server"
import { getField } from "@svenvw/fdm-core"
import { type LoaderFunctionArgs, type MetaFunction, data, useLoaderData } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Gebruiksnormen - Perceel | ${config.name}` },
+ { title: `Gebruiksnormen - Perceel | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de gebruiksnormen van je perceel.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.overview.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.overview.tsx
index 24b792cb6..9a3b7d255 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.overview.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.overview.tsx
@@ -44,11 +44,11 @@ import { RemixFormProvider, useRemixForm } from "remix-hook-form"
import { dataWithSuccess } from "remix-toast"
import { z } from "zod"
import type { MetaFunction } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
export const meta: MetaFunction = () => {
return [
- { title: `Overzicht - Perceel | ${config.name}` },
+ { title: `Overzicht - Perceel | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.soil.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.soil.tsx
index bd281eac5..ff13699b1 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.soil.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.soil.tsx
@@ -5,11 +5,11 @@ import { fdm } from "~/lib/fdm.server"
import { getField } from "@svenvw/fdm-core"
import { type LoaderFunctionArgs, data, useLoaderData } from "react-router"
import type { MetaFunction } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
export const meta: MetaFunction = () => {
return [
- { title: `Bodemanalyse - Perceel | ${config.name}` },
+ { title: `Bodemanalyse - Perceel | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de bodemanalyses van je perceel.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.tsx
index 0d73915db..facdf9f3b 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.tsx
@@ -14,12 +14,12 @@ import {
redirect,
useLoaderData,
} from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Perceel | ${config.name}` },
+ { title: `Perceel | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de gegevens van je perceel.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field._index.tsx b/fdm-app/app/routes/farm.$b_id_farm.field._index.tsx
index bdcba0718..d2e2d5324 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field._index.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field._index.tsx
@@ -23,11 +23,11 @@ import {
useLoaderData,
} from "react-router"
import type { MetaFunction } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
export const meta: MetaFunction = () => {
return [
- { title: `Perceel | ${config.name}` },
+ { title: `Perceel | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.$b_id_farm.settings._index.tsx b/fdm-app/app/routes/farm.$b_id_farm.settings._index.tsx
index 2a8047c68..845f83212 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.settings._index.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.settings._index.tsx
@@ -1,10 +1,10 @@
import { type MetaFunction, redirect } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Instellingen - Bedrijf | ${config.name}` },
+ { title: `Instellingen - Bedrijf | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de instellingen van je bedrijf.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.settings.access.tsx b/fdm-app/app/routes/farm.$b_id_farm.settings.access.tsx
index e93b39076..046b8f327 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.settings.access.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.settings.access.tsx
@@ -1,11 +1,11 @@
import { Separator } from "~/components/ui/separator"
import type { MetaFunction } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Toegang - Instellingen - Bedrijf | ${config.name}` },
+ { title: `Toegang - Instellingen - Bedrijf | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de toegang tot je bedrijf.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.settings.delete.tsx b/fdm-app/app/routes/farm.$b_id_farm.settings.delete.tsx
index 2f56f4995..b3121a2d0 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.settings.delete.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.settings.delete.tsx
@@ -1,11 +1,11 @@
import { Separator } from "~/components/ui/separator"
import type { MetaFunction } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Verwijderen - Instellingen - Bedrijf | ${config.name}` },
+ { title: `Verwijderen - Instellingen - Bedrijf | ${clientConfig.name}` },
{
name: "description",
content: "Verwijder de gegevens van je bedrijf.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.settings.properties.tsx b/fdm-app/app/routes/farm.$b_id_farm.settings.properties.tsx
index 037546ad3..5f5663c73 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.settings.properties.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.settings.properties.tsx
@@ -31,12 +31,12 @@ import { dataWithSuccess } from "remix-toast"
import validator from "validator"
import { z } from "zod"
const { isPostalCode } = validator
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Eigenschappen - Instellingen - Bedrijf | ${config.name}` },
+ { title: `Eigenschappen - Instellingen - Bedrijf | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de eigenschappen van je bedrijf.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.settings.tsx b/fdm-app/app/routes/farm.$b_id_farm.settings.tsx
index 5d0e54852..fbeb4ae00 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.settings.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.settings.tsx
@@ -14,12 +14,12 @@ import {
data,
useLoaderData,
} from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Instellingen - Bedrijf | ${config.name}` },
+ { title: `Instellingen - Bedrijf | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de instellingen van je bedrijf.",
diff --git a/fdm-app/app/routes/farm.$b_id_farm.tsx b/fdm-app/app/routes/farm.$b_id_farm.tsx
index 8a166cd36..c4e08cb7d 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.tsx
@@ -1,12 +1,12 @@
import { getSession } from "~/lib/auth.server"
import { handleActionError } from "~/lib/error"
import { type LoaderFunctionArgs, type MetaFunction, data } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Bedrijf | ${config.name}` },
+ { title: `Bedrijf | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de gegevens van je bedrijf.",
diff --git a/fdm-app/app/routes/farm._index.tsx b/fdm-app/app/routes/farm._index.tsx
index 951312a0e..d156e89c8 100644
--- a/fdm-app/app/routes/farm._index.tsx
+++ b/fdm-app/app/routes/farm._index.tsx
@@ -16,12 +16,12 @@ import { fdm } from "~/lib/fdm.server"
import { getTimeBasedGreeting } from "~/lib/greetings"
import { getFarms } from "@svenvw/fdm-core"
import { type LoaderFunctionArgs, type MetaFunction, NavLink, useLoaderData } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Bedrijf | ${config.name}` },
+ { title: `Bedrijf | ${clientConfig.name}` },
{
name: "description",
content: "Selecteer een bedrijf.",
diff --git a/fdm-app/app/routes/farm.account.tsx b/fdm-app/app/routes/farm.account.tsx
index 7436f791a..02da518fe 100644
--- a/fdm-app/app/routes/farm.account.tsx
+++ b/fdm-app/app/routes/farm.account.tsx
@@ -18,12 +18,12 @@ import {
} from "~/components/ui/breadcrumb"
import { FarmTitle } from "~/components/custom/farm/farm-title"
import { Avatar, AvatarFallback, AvatarImage } from "~/components/ui/avatar"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Account | ${config.name}` },
+ { title: `Account | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en bewerk de gegevens van je account.",
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
index 13e0e09a6..695699069 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
@@ -51,12 +51,12 @@ import {
import { redirectWithSuccess } from "remix-toast"
import { ClientOnly } from "remix-utils/client-only"
import { fdm } from "~/lib/fdm.server"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Kaart - Bedrijf toevoegen | ${config.name}` },
+ { title: `Kaart - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx
index 4620a2027..b74da468c 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.covercrop.tsx
@@ -1,10 +1,10 @@
import type { MetaFunction } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Vanggewas - Bouwplan - Bedrijf toevoegen | ${config.name}` },
+ { title: `Vanggewas - Bouwplan - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx
index 51d49dcd2..57a239009 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop._index.tsx
@@ -22,12 +22,12 @@ import {
useLoaderData,
} from "react-router"
import { dataWithSuccess } from "remix-toast"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Gewas- Bouwplan - Bedrijf toevoegen | ${config.name}` },
+ { title: `Gewas- Bouwplan - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx
index ff4d21fad..fcbaa99b4 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest.$b_id_harvesting.tsx
@@ -14,12 +14,12 @@ import {
data,
useLoaderData,
} from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Oogst - Bouwplan - Bedrijf toevoegen | ${config.name}` },
+ { title: `Oogst - Bouwplan - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en selecteer de oogst van een gewas uit je bouwplan.",
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx
index 2a9761728..77d24ece4 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.crop.harvest._index.tsx
@@ -18,12 +18,12 @@ import {
data,
} from "react-router"
import { redirectWithSuccess } from "remix-toast"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Oogst- Bouwplan - Bedrijf toevoegen | ${config.name}` },
+ { title: `Oogst- Bouwplan - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx
index d0c46bef0..70318664a 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.fertilizers.tsx
@@ -24,12 +24,12 @@ import {
} from "react-router"
import { dataWithSuccess } from "remix-toast"
import { fdm } from "~/lib/fdm.server"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Bemesting - Bouwplan - Bedrijf toevoegen | ${config.name}` },
+ { title: `Bemesting - Bouwplan - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en voeg bemestingen toe aan je bouwplan.",
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx
index a4d0805cd..3d246f2af 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.$b_lu_catalogue.tsx
@@ -16,12 +16,12 @@ import {
} from "react-router"
import { useLoaderData } from "react-router"
import { fdm } from "~/lib/fdm.server"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Bouwplan - Bedrijf toevoegen | ${config.name}` },
+ { title: `Bouwplan - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en selecteer een gewas uit je bouwplan.",
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx
index 719daf1b8..e9a3cd1dd 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations._index.tsx
@@ -7,12 +7,12 @@ import {
type MetaFunction,
redirect,
} from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Bouwplan - Bedrijf toevoegen | ${config.name}` },
+ { title: `Bouwplan - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content: "Bekijk en selecteer een gewas uit je bouwplan.",
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx
index 8336e9f8e..bd2f2b150 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.cultivations.tsx
@@ -22,12 +22,12 @@ import {
data,
} from "react-router"
import { Outlet, useLoaderData } from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Bouwplan - Bedrijf toevoegen | ${config.name}` },
+ { title: `Bouwplan - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content: "Beheer de gewassen op je percelen.",
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
index 930436be1..cc2457664 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
@@ -55,12 +55,12 @@ import { ClientOnly } from "remix-utils/client-only"
import { z } from "zod"
import { fdm } from "~/lib/fdm.server"
import { useEffect } from "react"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Perceel bewerken - Bedrijf toevoegen | ${config.name}` },
+ { title: `Perceel bewerken - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx
index 0f094272f..1b2e2e0ff 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.fields._index.tsx
@@ -7,12 +7,12 @@ import {
type MetaFunction,
redirect,
} from "react-router"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Percelen beheren - Bedrijf toevoegen | ${config.name}` },
+ { title: `Percelen beheren - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx
index 555badd30..01c6d0cf2 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.fields.tsx
@@ -27,12 +27,12 @@ import {
} from "react-router"
import { useLoaderData } from "react-router"
import { fdm } from "~/lib/fdm.server"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Percelen beheren - Bedrijf toevoegen | ${config.name}` },
+ { title: `Percelen beheren - Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.create._index.tsx b/fdm-app/app/routes/farm.create._index.tsx
index 82a681fe8..6fb80053b 100644
--- a/fdm-app/app/routes/farm.create._index.tsx
+++ b/fdm-app/app/routes/farm.create._index.tsx
@@ -27,12 +27,12 @@ import { useLoaderData } from "react-router"
import { redirectWithSuccess } from "remix-toast"
import { z } from "zod"
import { fdm } from "~/lib/fdm.server"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Bedrijf toevoegen | ${config.name}` },
+ { title: `Bedrijf toevoegen | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.tsx b/fdm-app/app/routes/farm.tsx
index 90b5a8036..b2ee249a2 100644
--- a/fdm-app/app/routes/farm.tsx
+++ b/fdm-app/app/routes/farm.tsx
@@ -15,11 +15,11 @@ import WhatsNew from "./farm.whats-new"
import Account from "./farm.account"
import { SidebarInset } from "~/components/ui/sidebar"
import { Outlet } from "react-router-dom"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
export const meta: MetaFunction = () => {
return [
- { title: `Dashboard | ${config.name}` },
+ { title: `Dashboard | ${clientConfig.name}` },
{
name: "description",
content:
diff --git a/fdm-app/app/routes/farm.whats-new.tsx b/fdm-app/app/routes/farm.whats-new.tsx
index bbaa6f6f3..342c509ba 100644
--- a/fdm-app/app/routes/farm.whats-new.tsx
+++ b/fdm-app/app/routes/farm.whats-new.tsx
@@ -20,14 +20,14 @@ import {
import { SidebarTrigger } from "~/components/ui/sidebar"
import ReactMarkdown from "react-markdown"
import remarkGfm from "remark-gfm"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
export const meta: MetaFunction = () => {
return [
- { title: `Wat is er nieuw? | ${config.name}` },
+ { title: `Wat is er nieuw? | ${clientConfig.name}` },
{
name: "description",
- content: `Blijf op de hoogte van de laatste ontwikkelingen en verbeteringen van ${config.name}.`,
+ content: `Blijf op de hoogte van de laatste ontwikkelingen en verbeteringen van ${clientConfig.name}.`,
},
]
}
@@ -45,8 +45,8 @@ export interface UpdatePost {
export const updatePosts: UpdatePost[] = [
{
id: "update-1",
- title: `Lancering ${config.name} 🎉`,
- description: `${config.name} is gelanceerd! Vanaf nu kun je bedrijven aanmaken, percelen toevoegen en bemestingen invullen.
+ title: `Lancering ${clientConfig.name} 🎉`,
+ description: `${clientConfig.name} is gelanceerd! Vanaf nu kun je bedrijven aanmaken, percelen toevoegen en bemestingen invullen.
**Nieuwe features:**
- Account aanmaken
diff --git a/fdm-app/app/routes/signin.tsx b/fdm-app/app/routes/signin.tsx
index 21d5be478..b7761cf88 100644
--- a/fdm-app/app/routes/signin.tsx
+++ b/fdm-app/app/routes/signin.tsx
@@ -17,14 +17,14 @@ import { redirect } from "react-router"
import { toast } from "sonner"
import type { MetaFunction } from "react-router"
import { Alert, AlertDescription, AlertTitle } from "~/components/ui/alert"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
export const meta: MetaFunction = () => {
return [
- { title: `Aanmelden | ${config.name}` },
+ { title: `Aanmelden | ${clientConfig.name}` },
{
name: "description",
- content: `Meld je aan bij ${config.name} om toegang te krijgen tot je dashboard en je bedrijfsgegevens te beheren.`,
+ content: `Meld je aan bij ${clientConfig.name} om toegang te krijgen tot je dashboard en je bedrijfsgegevens te beheren.`,
},
]
}
@@ -83,8 +83,8 @@ export default function SignIn() {
- {/* */}
-
${config.name}
+ {/* */}
+
${clientConfig.name}
Maak een account aan en krijg toegang tot:
@@ -159,7 +159,7 @@ export default function SignIn() {
- {`${config.name} is nog in ontwikkeling. Functionaliteiten
+ {`${clientConfig.name} is nog in ontwikkeling. Functionaliteiten
kunnen nog ontbreken of veranderen.`}
@@ -289,7 +289,7 @@ export default function SignIn() {
diff --git a/fdm-app/fdm.config.ts b/fdm-app/fdm.config.ts
index 6e518ec97..ad79e9639 100644
--- a/fdm-app/fdm.config.ts
+++ b/fdm-app/fdm.config.ts
@@ -2,7 +2,8 @@ import type { Config } from "~/lib/config"
const config: Config = {
// Site name
- name: "FDM",
+ name: process.env.FDM_NAME || "FDM",
+ // Site logo
favicon: "/favicon.ico",
logo: "/logo.svg",
From 2b3e5502c208cc6f18f5da18676306b22c359bd8 Mon Sep 17 00:00:00 2001
From: Sven Verweij <37927107+SvenVw@users.noreply.github.com>
Date: Thu, 3 Apr 2025 14:06:00 +0200
Subject: [PATCH 11/35] Use config for Senty
---
fdm-app/app/entry.client.tsx | 15 +++++++--------
fdm-app/app/entry.server.tsx | 2 --
fdm-app/app/lib/cache.server.ts | 15 +++++++--------
fdm-app/app/lib/config.ts | 30 +++++++++++++++++++++++++++++-
fdm-app/fdm.config.ts | 15 +++++++++++++++
fdm-app/vite.config.ts | 20 +++++++++++---------
6 files changed, 69 insertions(+), 28 deletions(-)
diff --git a/fdm-app/app/entry.client.tsx b/fdm-app/app/entry.client.tsx
index ae2a6c383..7fb03467c 100644
--- a/fdm-app/app/entry.client.tsx
+++ b/fdm-app/app/entry.client.tsx
@@ -8,11 +8,12 @@ import * as Sentry from "@sentry/react"
import { StrictMode, startTransition } from "react"
import { hydrateRoot } from "react-dom/client"
import { HydratedRouter } from "react-router/dom"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
-if (config.sentry) {
+if (clientConfig.analytics.sentry) {
+ const sentryConfig = clientConfig.analytics.sentry
Sentry.init({
- dsn: import.meta.env.VITE_SENTRY_DSN,
+ dsn: sentryConfig.dsn,
environment: import.meta.env.NODE_ENV,
integrations: [
Sentry.browserTracingIntegration(),
@@ -53,14 +54,12 @@ if (config.sentry) {
// return event
// },
- tracesSampleRate: import.meta.env.VITE_SENTRY_TRACE_SAMPLE_RATE,
+ tracesSampleRate: sentryConfig.trace_sample_rate,
tracePropagationTargets: [window.location.hostname],
- replaysSessionSampleRate: import.meta.env
- .VITE_SENTRY_REPLAY_SAMPLE_RATE,
- replaysOnErrorSampleRate: import.meta.env
- .VITE_SENTRY_REPLAY_SAMPLE_RATE_ON_ERROR,
+ replaysSessionSampleRate: sentryConfig.replay_sample_rate,
+ replaysOnErrorSampleRate: sentryConfig.replay_sample_rate_on_error,
})
}
diff --git a/fdm-app/app/entry.server.tsx b/fdm-app/app/entry.server.tsx
index 1314a55a5..aa5be8a47 100644
--- a/fdm-app/app/entry.server.tsx
+++ b/fdm-app/app/entry.server.tsx
@@ -4,9 +4,7 @@
* For more information, see https://remix.run/file-conventions/entry.server
*/
import * as Sentry from "@sentry/node"
-
import { PassThrough } from "node:stream"
-
import { createReadableStreamFromReadable } from "@react-router/node"
import { isbot } from "isbot"
import { renderToPipeableStream } from "react-dom/server"
diff --git a/fdm-app/app/lib/cache.server.ts b/fdm-app/app/lib/cache.server.ts
index b1788e667..7073f512a 100644
--- a/fdm-app/app/lib/cache.server.ts
+++ b/fdm-app/app/lib/cache.server.ts
@@ -1,4 +1,5 @@
import type { EntryContext } from "react-router"
+import { clientConfig } from "./config"
type CacheControl = {
maxAge: number
@@ -123,11 +124,11 @@ export function getCacheControlHeaders(
* Add security headers to the response
*/
export function addSecurityHeaders(headers: Headers): Headers {
- const sentryReportUri = process.env.VITE_SENTRY_SECURITY_REPORT_URI
- if (!sentryReportUri) {
- throw new Error(
- "VITE_SENTRY_SECURITY_REPORT_URI environment variable is required",
- )
+ let reportUri = ""
+ if (clientConfig.analytics.sentry) {
+ reportUri = clientConfig.analytics.sentry.security_report_uri
+ .replace(/\s+/g, " ")
+ .trim()
}
headers.set(
@@ -145,9 +146,7 @@ export function addSecurityHeaders(headers: Headers): Headers {
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
- report-uri ${sentryReportUri}`
- .replace(/\s+/g, " ")
- .trim(),
+ report-uri ${reportUri};`,
)
headers.set("X-Content-Type-Options", "nosniff")
headers.set("X-Frame-Options", "DENY")
diff --git a/fdm-app/app/lib/config.ts b/fdm-app/app/lib/config.ts
index 1baf6edb2..e4f8926b9 100644
--- a/fdm-app/app/lib/config.ts
+++ b/fdm-app/app/lib/config.ts
@@ -10,7 +10,20 @@ export const clientConfig: ClientConfig = {
logo: config.logo,
analytics: {
sentry: config.analytics.sentry
- ? { dsn: config.analytics.sentry.dsn }
+ ? {
+ dsn: config.analytics.sentry.dsn,
+ organization: config.analytics.sentry.organization,
+ project: config.analytics.sentry.project,
+ trace_sample_rate: config.analytics.sentry.trace_sample_rate,
+ replay_sample_rate:
+ config.analytics.sentry.replay_sample_rate,
+ replay_sample_rate_on_error:
+ config.analytics.sentry.replay_sample_rate_on_error,
+ profile_sample_rate:
+ config.analytics.sentry.profile_sample_rate,
+ security_report_uri:
+ config.analytics.sentry.security_report_uri,
+ }
: null,
},
}
@@ -41,6 +54,14 @@ export interface Config {
analytics: {
sentry?: {
dsn: string
+ organization: string
+ project: string
+ auth_token: string
+ trace_sample_rate: number
+ replay_sample_rate: number
+ replay_sample_rate_on_error: number
+ profile_sample_rate: number
+ security_report_uri: string
} | null
}
}
@@ -53,6 +74,13 @@ interface ClientConfig {
analytics: {
sentry?: {
dsn: string
+ organization: string
+ project: string
+ trace_sample_rate: number
+ replay_sample_rate: number
+ replay_sample_rate_on_error: number
+ profile_sample_rate: number
+ security_report_uri: string
} | null
}
}
diff --git a/fdm-app/fdm.config.ts b/fdm-app/fdm.config.ts
index ad79e9639..4cbfeb488 100644
--- a/fdm-app/fdm.config.ts
+++ b/fdm-app/fdm.config.ts
@@ -35,6 +35,21 @@ const config: Config = {
// Sentry
sentry: {
dsn: String(process.env.SENTRY_DSN),
+ organization: String(process.env.VITE_SENTRY_ORG),
+ project: String(process.env.VITE_SENTRY_PROJECT),
+ auth_token: String(process.env.SENTRY_AUTH_TOKEN),
+ trace_sample_rate:
+ Number(process.env.VITE_SENTRY_TRACE_SAMPLE_RATE) || 1,
+ replay_sample_rate:
+ Number(process.env.VITE_SENTRY_REPLAY_SAMPLE_RATE) || 0,
+ replay_sample_rate_on_error:
+ Number(process.env.VITE_SENTRY_REPLAY_SAMPLE_RATE_ON_ERROR) ||
+ 1,
+ profile_sample_rate:
+ Number(process.env.VITE_SENTRY_PROFILE_SAMPLE_RATE) || 1,
+ security_report_uri: String(
+ process.env.VITE_SENTRY_SECURITY_REPORT_URI,
+ ),
},
},
}
diff --git a/fdm-app/vite.config.ts b/fdm-app/vite.config.ts
index 81b4c44b9..c31026bb8 100644
--- a/fdm-app/vite.config.ts
+++ b/fdm-app/vite.config.ts
@@ -2,17 +2,19 @@ import { reactRouter } from "@react-router/dev/vite"
import { sentryVitePlugin } from "@sentry/vite-plugin"
import { defineConfig } from "vite"
import tsconfigPaths from "vite-tsconfig-paths"
+import { serverConfig } from "~/lib/config"
+
+let pluginSentry: any
+if (serverConfig.analytics.sentry) {
+ pluginSentry = sentryVitePlugin({
+ org: serverConfig.analytics.sentry.organization,
+ authToken: serverConfig.analytics.sentry.auth_token,
+ project: serverConfig.analytics.sentry.project,
+ })
+}
export default defineConfig({
- plugins: [
- reactRouter(),
- tsconfigPaths(),
- sentryVitePlugin({
- org: process.env.SENTRY_ORG,
- authToken: process.env.SENTRY_AUTH_TOKEN,
- project: process.env.SENTRY_PROJECT,
- }),
- ],
+ plugins: [reactRouter(), tsconfigPaths(), pluginSentry],
define: {
global: {},
},
From 58822a2c867f534bf5ee06c09f8956199da20b41 Mon Sep 17 00:00:00 2001
From: Sven Verweij <37927107+SvenVw@users.noreply.github.com>
Date: Thu, 3 Apr 2025 14:15:25 +0200
Subject: [PATCH 12/35] Use config for db connection
---
fdm-app/app/lib/fdm-migrate.server.js | 12 +++++++-----
fdm-app/app/lib/fdm.server.tsx | 11 ++++++-----
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/fdm-app/app/lib/fdm-migrate.server.js b/fdm-app/app/lib/fdm-migrate.server.js
index a0a9ceaac..d1ced1218 100644
--- a/fdm-app/app/lib/fdm-migrate.server.js
+++ b/fdm-app/app/lib/fdm-migrate.server.js
@@ -5,33 +5,35 @@ import {
} from "@svenvw/fdm-core"
import { drizzle } from "drizzle-orm/postgres-js"
import postgres from "postgres"
+import { serverConfig } from "~/lib/config"
// Get credentials to connect to db
const host =
- process.env.POSTGRES_HOST ??
+ serverConfig.database.host ??
(() => {
throw new Error("POSTGRES_HOST environment variable is required")
})()
const port =
- Number(process.env.POSTGRES_PORT) ||
+ serverConfig.database.port ||
(() => {
throw new Error("POSTGRES_PORT environment variable is required")
})()
const user =
- process.env.POSTGRES_USER ??
+ serverConfig.database.user ??
(() => {
throw new Error("POSTGRES_USER environment variable is required")
})()
const password =
- process.env.POSTGRES_PASSWORD ??
+ serverConfig.database.password ??
(() => {
throw new Error("POSTGRES_PASSWORD environment variable is required")
})()
const database =
- process.env.POSTGRES_DB ??
+ serverConfig.database.database ??
(() => {
throw new Error("POSTGRES_DB environment variable is required")
})()
+
const migrationsFolderPath = "node_modules/@svenvw/fdm-core/dist/db/migrations"
const client = postgres({
diff --git a/fdm-app/app/lib/fdm.server.tsx b/fdm-app/app/lib/fdm.server.tsx
index a884271ac..b8faf312c 100644
--- a/fdm-app/app/lib/fdm.server.tsx
+++ b/fdm-app/app/lib/fdm.server.tsx
@@ -1,29 +1,30 @@
import { fdmSchema as schema } from "@svenvw/fdm-core"
import { drizzle } from "drizzle-orm/postgres-js"
+import { serverConfig } from "~/lib/config"
// Get credentials to connect to db
const host =
- process.env.POSTGRES_HOST ??
+ serverConfig.database.host ??
(() => {
throw new Error("POSTGRES_HOST environment variable is required")
})()
const port =
- Number(process.env.POSTGRES_PORT) ||
+ serverConfig.database.port ||
(() => {
throw new Error("POSTGRES_PORT environment variable is required")
})()
const user =
- process.env.POSTGRES_USER ??
+ serverConfig.database.user ??
(() => {
throw new Error("POSTGRES_USER environment variable is required")
})()
const password =
- process.env.POSTGRES_PASSWORD ??
+ serverConfig.database.password ??
(() => {
throw new Error("POSTGRES_PASSWORD environment variable is required")
})()
const database =
- process.env.POSTGRES_DB ??
+ serverConfig.database.database ??
(() => {
throw new Error("POSTGRES_DB environment variable is required")
})()
From 18f4436ea773028a5b057a901431c56a4f1c93a0 Mon Sep 17 00:00:00 2001
From: Sven Verweij <37927107+SvenVw@users.noreply.github.com>
Date: Thu, 3 Apr 2025 14:36:27 +0200
Subject: [PATCH 13/35] Convert mapbox into an integration
---
.../atlas/atlas-mapbox.tsx => integrations/mapbox.ts} | 4 +++-
fdm-app/app/lib/config.ts | 8 ++++++++
fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx | 2 +-
fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx | 5 +----
fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx | 2 +-
.../app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx | 5 +----
fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx | 5 +----
.../app/routes/farm.create.$b_id_farm.fields.$b_id.tsx | 9 ++++-----
fdm-app/fdm.config.ts | 10 ++++++++++
9 files changed, 30 insertions(+), 20 deletions(-)
rename fdm-app/app/{components/custom/atlas/atlas-mapbox.tsx => integrations/mapbox.ts} (70%)
diff --git a/fdm-app/app/components/custom/atlas/atlas-mapbox.tsx b/fdm-app/app/integrations/mapbox.ts
similarity index 70%
rename from fdm-app/app/components/custom/atlas/atlas-mapbox.tsx
rename to fdm-app/app/integrations/mapbox.ts
index b2cc52ae5..1cbb679fc 100644
--- a/fdm-app/app/components/custom/atlas/atlas-mapbox.tsx
+++ b/fdm-app/app/integrations/mapbox.ts
@@ -1,5 +1,7 @@
+import { serverConfig } from "@/app/lib/config"
+
export function getMapboxToken() {
- const mapboxToken = process.env.MAPBOX_TOKEN as string | undefined
+ const mapboxToken = serverConfig.integrations.mapbox.token
if (!mapboxToken || mapboxToken.length === 0) {
throw new Error("MAPBOX_TOKEN is not set")
}
diff --git a/fdm-app/app/lib/config.ts b/fdm-app/app/lib/config.ts
index e4f8926b9..2dcf279f2 100644
--- a/fdm-app/app/lib/config.ts
+++ b/fdm-app/app/lib/config.ts
@@ -51,6 +51,14 @@ export interface Config {
host: string
port: number
}
+ integrations: {
+ mapbox: {
+ token: string
+ }
+ nmi?: {
+ api_key: string
+ }
+ }
analytics: {
sentry?: {
dsn: string
diff --git a/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx b/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx
index fd8d0cc8c..317af0494 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.atlas.elevation.tsx
@@ -1,4 +1,4 @@
-import { getMapboxToken } from "~/components/custom/atlas/atlas-mapbox"
+import { getMapboxToken } from "@/app/integrations/mapbox"
import { Button } from "~/components/ui/button"
import { getSession } from "~/lib/auth.server"
import { handleLoaderError } from "~/lib/error"
diff --git a/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx b/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx
index bf169b44c..9addb4120 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.atlas.fields.tsx
@@ -6,10 +6,7 @@ import {
} from "react-map-gl"
import "mapbox-gl/dist/mapbox-gl.css"
import { ZOOM_LEVEL_FIELDS } from "~/components/custom/atlas/atlas"
-import {
- getMapboxStyle,
- getMapboxToken,
-} from "~/components/custom/atlas/atlas-mapbox"
+import { getMapboxStyle, getMapboxToken } from "@/app/integrations/mapbox"
import { FieldsPanelHover } from "~/components/custom/atlas/atlas-panels"
import { FieldsSourceNotClickable } from "~/components/custom/atlas/atlas-sources"
import { getFieldsStyle } from "~/components/custom/atlas/atlas-styles"
diff --git a/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx b/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx
index e07b93d97..df84d8628 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.atlas.soil.tsx
@@ -1,4 +1,4 @@
-import { getMapboxToken } from "~/components/custom/atlas/atlas-mapbox"
+import { getMapboxToken } from "@/app/integrations/mapbox"
import { Button } from "~/components/ui/button"
import { getSession } from "~/lib/auth.server"
import { handleLoaderError } from "~/lib/error"
diff --git a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx
index 70876bc6a..949528690 100644
--- a/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx
+++ b/fdm-app/app/routes/farm.$b_id_farm.field.$b_id.atlas.tsx
@@ -1,9 +1,6 @@
import { Layer, Map as MapGL } from "react-map-gl"
import "mapbox-gl/dist/mapbox-gl.css"
-import {
- getMapboxStyle,
- getMapboxToken,
-} from "~/components/custom/atlas/atlas-mapbox"
+import { getMapboxStyle, getMapboxToken } from "@/app/integrations/mapbox"
import { FieldsSourceNotClickable } from "~/components/custom/atlas/atlas-sources"
import { getFieldsStyle } from "~/components/custom/atlas/atlas-styles"
import { getViewState } from "~/components/custom/atlas/atlas-viewstate"
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
index 695699069..3c856543e 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
@@ -1,9 +1,6 @@
import { ZOOM_LEVEL_FIELDS } from "~/components/custom/atlas/atlas"
import { generateFeatureClass } from "~/components/custom/atlas/atlas-functions"
-import {
- getMapboxStyle,
- getMapboxToken,
-} from "~/components/custom/atlas/atlas-mapbox"
+import { getMapboxStyle, getMapboxToken } from "@/app/integrations/mapbox"
import {
FieldsPanelHover,
FieldsPanelSelection,
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
index cc2457664..3c833f4bc 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.fields.$b_id.tsx
@@ -1,7 +1,4 @@
-import {
- getMapboxStyle,
- getMapboxToken,
-} from "~/components/custom/atlas/atlas-mapbox"
+import { getMapboxStyle, getMapboxToken } from "@/app/integrations/mapbox"
import { FieldsSourceNotClickable } from "~/components/custom/atlas/atlas-sources"
import { getFieldsStyle } from "~/components/custom/atlas/atlas-styles"
import { getViewState } from "~/components/custom/atlas/atlas-viewstate"
@@ -60,7 +57,9 @@ import { clientConfig } from "~/lib/config"
// Meta
export const meta: MetaFunction = () => {
return [
- { title: `Perceel bewerken - Bedrijf toevoegen | ${clientConfig.name}` },
+ {
+ title: `Perceel bewerken - Bedrijf toevoegen | ${clientConfig.name}`,
+ },
{
name: "description",
content:
diff --git a/fdm-app/fdm.config.ts b/fdm-app/fdm.config.ts
index 4cbfeb488..970bc5ef8 100644
--- a/fdm-app/fdm.config.ts
+++ b/fdm-app/fdm.config.ts
@@ -30,6 +30,16 @@ const config: Config = {
port: Number(process.env.DB_PORT),
},
+ // Integrations
+ integrations: {
+ mapbox: {
+ token: String(process.env.MAPBOX_TOKEN)
+ },
+ nmi: {
+ api_key: String(process.env.NMI_API_KEY)
+ }
+ },
+
// Analytics
analytics: {
// Sentry
From f3e86159a1b6eb8b4137e39906c3401dce87432a Mon Sep 17 00:00:00 2001
From: Sven Verweij <37927107+SvenVw@users.noreply.github.com>
Date: Thu, 3 Apr 2025 14:49:34 +0200
Subject: [PATCH 14/35] Add integration with NMI API
---
fdm-app/app/integrations/nmi.ts | 58 +++++++++++++++++++
fdm-app/app/lib/nmi.ts | 0
.../routes/farm.create.$b_id_farm.atlas.tsx | 49 +++++-----------
3 files changed, 72 insertions(+), 35 deletions(-)
create mode 100644 fdm-app/app/integrations/nmi.ts
create mode 100644 fdm-app/app/lib/nmi.ts
diff --git a/fdm-app/app/integrations/nmi.ts b/fdm-app/app/integrations/nmi.ts
new file mode 100644
index 000000000..42c3f57c2
--- /dev/null
+++ b/fdm-app/app/integrations/nmi.ts
@@ -0,0 +1,58 @@
+import { serverConfig } from "@/app/lib/config"
+import centroid from "@turf/centroid"
+import type { Feature } from "geojson"
+
+export function getNmiApiKey() {
+ if (!serverConfig.integrations.nmi) {
+ return undefined
+ }
+
+ const nmiApiKey = serverConfig.integrations.nmi.api_key
+ return nmiApiKey
+}
+
+export async function getSoilParameterEstimates(
+ field: Feature,
+ nmiApiKey: string | undefined,
+): Promise<{
+ a_p_al: number
+ a_p_cc: number
+ a_som_loi: number
+ b_soiltype_agr: string
+ b_gwl_class: string
+ a_source: string
+ a_depth: number
+}> {
+ if (!nmiApiKey) {
+ throw new Error("Please provide a NMI API key")
+ }
+
+ const fieldCentroid = centroid(field.geometry)
+ const a_lon = fieldCentroid.geometry.coordinates[0]
+ const a_lat = fieldCentroid.geometry.coordinates[1]
+
+ const responseApi = await fetch(
+ `https://api.nmi-agro.nl/estimates?${new URLSearchParams({
+ a_lat: a_lat.toString(),
+ a_lon: a_lon.toString(),
+ })}`,
+ {
+ method: "GET",
+ headers: {
+ Authorization: `Bearer ${nmiApiKey}`,
+ },
+ },
+ )
+
+ if (!responseApi.ok) {
+ throw new Error("Request to NMI API failed")
+ }
+
+ const result = await responseApi.json()
+ const response = result.data
+
+ response.a_source = "NMI"
+ response.a_depth = 0.3
+
+ return response
+}
diff --git a/fdm-app/app/lib/nmi.ts b/fdm-app/app/lib/nmi.ts
new file mode 100644
index 000000000..e69de29bb
diff --git a/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx b/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
index 3c856543e..a40fd7dc5 100644
--- a/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
+++ b/fdm-app/app/routes/farm.create.$b_id_farm.atlas.tsx
@@ -49,6 +49,7 @@ import { redirectWithSuccess } from "remix-toast"
import { ClientOnly } from "remix-utils/client-only"
import { fdm } from "~/lib/fdm.server"
import { clientConfig } from "~/lib/config"
+import { getNmiApiKey, getSoilParameterEstimates } from "../integrations/nmi"
// Meta
export const meta: MetaFunction = () => {
@@ -261,6 +262,8 @@ export async function action({ request, params }: ActionFunctionArgs) {
// Get the session
const session = await getSession(request)
+ const nmiApiKey = getNmiApiKey()
+
const selectedFields = JSON.parse(
String(formData.get("selected_fields")),
)
@@ -300,50 +303,26 @@ export async function action({ request, params }: ActionFunctionArgs) {
b_lu_end,
)
- if (process.env.NMI_API_KEY) {
- const fieldCentroid = centroid(field.geometry)
- const a_lon = fieldCentroid.geometry.coordinates[0]
- const a_lat = fieldCentroid.geometry.coordinates[1]
-
- const responseApi = await fetch(
- `https://api.nmi-agro.nl/estimates?${new URLSearchParams(
- {
- a_lat: a_lat.toString(),
- a_lon: a_lon.toString(),
- },
- )}`,
- {
- method: "GET",
- headers: {
- Authorization: `Bearer ${process.env.NMI_API_KEY}`,
- },
- },
+ if (nmiApiKey) {
+ const estimates = await getSoilParameterEstimates(
+ field,
+ nmiApiKey,
)
- if (!responseApi.ok) {
- throw data(responseApi.statusText, {
- status: responseApi.status,
- statusText: responseApi.statusText,
- })
- }
-
- const result = await responseApi.json()
- const response = result.data
-
await addSoilAnalysis(
fdm,
session.principal_id,
defaultDate,
- "NMI",
+ estimates.a_source,
b_id,
- 30,
+ estimates.a_depth,
defaultDate,
{
- a_p_al: response.a_p_al,
- a_p_cc: response.a_p_cc,
- a_som_loi: response.a_som_loi,
- b_soiltype_agr: response.b_soiltype_agr,
- b_gwl_class: response.b_gwl_class,
+ a_p_al: estimates.a_p_al,
+ a_p_cc: estimates.a_p_cc,
+ a_som_loi: estimates.a_som_loi,
+ b_soiltype_agr: estimates.b_soiltype_agr,
+ b_gwl_class: estimates.b_gwl_class,
},
)
}
From b02af68de45995b9fb49c978f18ad5e0d7b8878a Mon Sep 17 00:00:00 2001
From: Sven Verweij <37927107+SvenVw@users.noreply.github.com>
Date: Thu, 3 Apr 2025 15:26:34 +0200
Subject: [PATCH 15/35] Various merge fixes
---
.../components/custom/atlas/atlas-panels.tsx | 2 +-
.../components/custom/atlas/atlas-sources.tsx | 4 +-
.../app/components/custom/atlas/atlas.d.tsx | 2 +-
fdm-app/app/components/custom/banner.tsx | 4 +-
.../components/custom/cultivation/form.tsx | 4 +-
.../components/custom/cultivation/list.tsx | 2 +-
fdm-app/app/components/custom/error.tsx | 2 +-
.../components/custom/farm/farm-header.tsx | 3 +-
.../custom/fertilizer-applications.tsx | 6 +-
.../custom/fertilizer/column-header.tsx | 7 +-
.../components/custom/fertilizer/columns.tsx | 4 +-
.../app/components/custom/fertilizer/form.tsx | 14 ++--
.../components/custom/fertilizer/table.tsx | 6 +-
fdm-app/app/components/custom/sidebar-app.tsx | 71 ++++++++++---------
.../app/components/custom/sidebar-page.tsx | 1 -
fdm-app/app/lib/cache.server.ts | 2 +-
fdm-app/app/root.tsx | 6 +-
...m.$b_id_farm.$calendar.atlas.elevation.tsx | 4 +-
...farm.$b_id_farm.$calendar.atlas.fields.tsx | 4 +-
.../farm.$b_id_farm.$calendar.atlas.soil.tsx | 4 +-
...$b_id_farm.$calendar.field.$b_id.atlas.tsx | 2 +-
...r.field.$b_id.cultivation.$b_lu._index.tsx | 2 +-
...alendar.field.$b_id.cultivation._index.tsx | 2 +-
..._farm.$calendar.field.$b_id.fertilizer.tsx | 2 +-
...farm.$calendar.field.$b_id.soil._index.tsx | 18 ++---
...lendar.field.$b_id.soil.analysis.$a_id.tsx | 16 ++---
...calendar.field.$b_id.soil.analysis.new.tsx | 16 ++---
.../farm.$b_id_farm.$calendar.field.$b_id.tsx | 4 +-
...farm.$b_id_farm.$calendar.field._index.tsx | 2 +-
.../farm.$b_id_farm.fertilizers.$p_id.tsx | 18 ++---
.../farm.$b_id_farm.fertilizers._index.tsx | 16 ++---
.../farm.$b_id_farm.fertilizers.new.tsx | 23 +++---
.../app/routes/farm.$b_id_farm.settings.tsx | 2 +-
fdm-app/app/routes/farm.account.tsx | 10 ++-
...farm.create.$b_id_farm.$calendar.atlas.tsx | 6 +-
...ltivations.$b_lu_catalogue.crop._index.tsx | 4 +-
...atalogue.crop.harvest.$b_id_harvesting.tsx | 2 +-
...ns.$b_lu_catalogue.crop.harvest._index.tsx | 3 +-
...ltivations.$b_lu_catalogue.fertilizers.tsx | 2 +-
...$calendar.cultivations.$b_lu_catalogue.tsx | 3 +-
..._id_farm.$calendar.cultivations._index.tsx | 2 +-
...eate.$b_id_farm.$calendar.cultivations.tsx | 2 +-
...eate.$b_id_farm.$calendar.fields.$b_id.tsx | 5 +-
...ate.$b_id_farm.$calendar.fields._index.tsx | 3 +-
...arm.create.$b_id_farm.$calendar.fields.tsx | 3 +-
....create.$b_id_farm.fields.$b_id._index.tsx | 35 +++++----
...e.$b_id_farm.fields.$b_id.new_analysis.tsx | 16 ++---
fdm-app/app/routes/farm.tsx | 6 +-
fdm-app/app/routes/farm.whats-new.tsx | 1 -
49 files changed, 182 insertions(+), 196 deletions(-)
diff --git a/fdm-app/app/components/custom/atlas/atlas-panels.tsx b/fdm-app/app/components/custom/atlas/atlas-panels.tsx
index 99919bdff..0806cccac 100644
--- a/fdm-app/app/components/custom/atlas/atlas-panels.tsx
+++ b/fdm-app/app/components/custom/atlas/atlas-panels.tsx
@@ -16,7 +16,7 @@ import { Check, Info } from "lucide-react"
import { useEffect, useState } from "react"
import { useMap } from "react-map-gl"
import type { MapBoxZoomEvent, MapEvent, MapMouseEvent } from "react-map-gl"
-import { useFetcher } from "react-router"
+import { data, useFetcher } from "react-router"
export function FieldsPanelHover({
zoomLevelFields,
diff --git a/fdm-app/app/components/custom/atlas/atlas-sources.tsx b/fdm-app/app/components/custom/atlas/atlas-sources.tsx
index fdefd63c1..333b6b160 100644
--- a/fdm-app/app/components/custom/atlas/atlas-sources.tsx
+++ b/fdm-app/app/components/custom/atlas/atlas-sources.tsx
@@ -4,7 +4,7 @@ import throttle from "lodash.throttle"
import { type Dispatch, type SetStateAction, useEffect, useState } from "react"
import { Source, useMap } from "react-map-gl"
import { generateFeatureClass } from "./atlas-functions"
-import type { fieldsAvailableUrlType } from "./atlas.d"
+import type { FieldsAvailableUrlType } from "./atlas.d"
export function FieldsSourceNotClickable({
id,
@@ -108,7 +108,7 @@ export function FieldsSourceAvailable({
children,
}: {
id: string
- url: fieldsAvailableUrlType
+ url: FieldsAvailableUrlType
zoomLevelFields: number
children: JSX.Element
}) {
diff --git a/fdm-app/app/components/custom/atlas/atlas.d.tsx b/fdm-app/app/components/custom/atlas/atlas.d.tsx
index f5a76b5c5..656643560 100644
--- a/fdm-app/app/components/custom/atlas/atlas.d.tsx
+++ b/fdm-app/app/components/custom/atlas/atlas.d.tsx
@@ -7,7 +7,7 @@ export interface MapFieldsProps {
mapboxToken: string
mapStyle: "mapbox://styles/mapbox/satellite-streets-v12"
fieldsSelected: FeatureCollection | null
- fieldsAvailableUrl: fieldsAvailableUrlType
+ fieldsAvailableUrl: FieldsAvailableUrlType
fieldsSaved: FeatureCollection | null
}
diff --git a/fdm-app/app/components/custom/banner.tsx b/fdm-app/app/components/custom/banner.tsx
index 10e5d6d14..863f4fc21 100644
--- a/fdm-app/app/components/custom/banner.tsx
+++ b/fdm-app/app/components/custom/banner.tsx
@@ -1,5 +1,5 @@
-import { Button } from "@/components/ui/button"
-import { Cookie, CookieIcon, X } from "lucide-react"
+import { Button } from "~/components/ui/button"
+import { Cookie, X } from "lucide-react"
import posthog from "posthog-js"
import { useEffect, useState } from "react"
diff --git a/fdm-app/app/components/custom/cultivation/form.tsx b/fdm-app/app/components/custom/cultivation/form.tsx
index 6ade23e4c..106c555de 100644
--- a/fdm-app/app/components/custom/cultivation/form.tsx
+++ b/fdm-app/app/components/custom/cultivation/form.tsx
@@ -22,8 +22,8 @@ import { useEffect } from "react"
import { Form } from "react-router"
import { RemixFormProvider, useRemixForm } from "remix-hook-form"
import type { z } from "zod"
-import { Combobox } from "../combobox"
-import { LoadingSpinner } from "../loadingspinner"
+import { Combobox } from "~/components/custom/combobox"
+import { LoadingSpinner } from "~/components/custom/loadingspinner"
import { FormSchema } from "./schema"
import type { CultivationsFormProps } from "./types"
diff --git a/fdm-app/app/components/custom/cultivation/list.tsx b/fdm-app/app/components/custom/cultivation/list.tsx
index 67ed61463..54f2b97aa 100644
--- a/fdm-app/app/components/custom/cultivation/list.tsx
+++ b/fdm-app/app/components/custom/cultivation/list.tsx
@@ -2,7 +2,7 @@ import { Button } from "~/components/ui/button"
import { format } from "date-fns/format"
import { Pencil, Trash2 } from "lucide-react"
import { NavLink, useFetcher } from "react-router"
-import { LoadingSpinner } from "../loadingspinner"
+import { LoadingSpinner } from "~/components/custom/loadingspinner"
import type { Cultivation } from "./types"
interface Harvest {
diff --git a/fdm-app/app/components/custom/error.tsx b/fdm-app/app/components/custom/error.tsx
index 871bb1a4a..4206dc1e9 100644
--- a/fdm-app/app/components/custom/error.tsx
+++ b/fdm-app/app/components/custom/error.tsx
@@ -1,7 +1,7 @@
import { ArrowLeft, Copy, Home } from "lucide-react"
import { useEffect, useState } from "react"
import { NavLink } from "react-router"
-import { Button } from "../ui/button"
+import { Button } from "~/components/ui/button"
/**
* Displays a full-screen error block with tailored messaging and navigation options.
diff --git a/fdm-app/app/components/custom/farm/farm-header.tsx b/fdm-app/app/components/custom/farm/farm-header.tsx
index b48e14bca..22a7196ce 100644
--- a/fdm-app/app/components/custom/farm/farm-header.tsx
+++ b/fdm-app/app/components/custom/farm/farm-header.tsx
@@ -7,7 +7,6 @@ import {
} from "~/components/ui/breadcrumb"
import { Separator } from "~/components/ui/separator"
import { SidebarTrigger } from "~/components/ui/sidebar"
-
import { Button } from "~/components/ui/button"
import {
DropdownMenu,
@@ -16,7 +15,7 @@ import {
DropdownMenuTrigger,
} from "~/components/ui/dropdown-menu"
import { cn } from "~/lib/utils"
-import { useCalendarStore } from "@/store/calendar"
+import { useCalendarStore } from "~/store/calendar"
import { ChevronDown } from "lucide-react"
import { NavLink } from "react-router"
import type {
diff --git a/fdm-app/app/components/custom/fertilizer-applications.tsx b/fdm-app/app/components/custom/fertilizer-applications.tsx
index e87a779e7..c7be93bec 100644
--- a/fdm-app/app/components/custom/fertilizer-applications.tsx
+++ b/fdm-app/app/components/custom/fertilizer-applications.tsx
@@ -24,9 +24,9 @@ import { useEffect } from "react"
import { Form, useFetcher } from "react-router"
import { RemixFormProvider, useRemixForm } from "remix-hook-form"
import type { z } from "zod"
-import { FormSchema } from "./fertilizer-applications/formschema"
-import type { FertilizerApplicationsFormProps } from "./fertilizer-applications/types.d"
-import { LoadingSpinner } from "./loadingspinner"
+import { FormSchema } from "~/components/custom/fertilizer-applications/formschema"
+import type { FertilizerApplicationsFormProps } from "~/components/custom/fertilizer-applications/types.d"
+import { LoadingSpinner } from "~/components/custom/loadingspinner"
export function FertilizerApplicationsForm(
props: FertilizerApplicationsFormProps,
diff --git a/fdm-app/app/components/custom/fertilizer/column-header.tsx b/fdm-app/app/components/custom/fertilizer/column-header.tsx
index dff88df81..27922207e 100644
--- a/fdm-app/app/components/custom/fertilizer/column-header.tsx
+++ b/fdm-app/app/components/custom/fertilizer/column-header.tsx
@@ -1,15 +1,14 @@
import type { Column } from "@tanstack/react-table"
import { ArrowDown, ArrowUp, ChevronsUpDown, EyeOff } from "lucide-react"
-
-import { Button } from "@/components/ui/button"
+import { Button } from "~/components/ui/button"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu"
-import { cn } from "@/lib/utils"
+} from "~/components/ui/dropdown-menu"
+import { cn } from "~/lib/utils"
interface DataTableColumnHeaderProps
extends React.HTMLAttributes {
diff --git a/fdm-app/app/components/custom/fertilizer/columns.tsx b/fdm-app/app/components/custom/fertilizer/columns.tsx
index 1d228c4d1..b3b8557c1 100644
--- a/fdm-app/app/components/custom/fertilizer/columns.tsx
+++ b/fdm-app/app/components/custom/fertilizer/columns.tsx
@@ -1,10 +1,10 @@
-import { Badge } from "@/components/ui/badge"
+import { Badge } from "~/components/ui/badge"
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
-} from "@/components/ui/tooltip"
+} from "~/components/ui/tooltip"
import type { ColumnDef } from "@tanstack/react-table"
import { ArrowRight, Pencil, SquareArrowOutUpRight } from "lucide-react"
import { NavLink } from "react-router-dom"
diff --git a/fdm-app/app/components/custom/fertilizer/form.tsx b/fdm-app/app/components/custom/fertilizer/form.tsx
index 09c63da16..e5614d517 100644
--- a/fdm-app/app/components/custom/fertilizer/form.tsx
+++ b/fdm-app/app/components/custom/fertilizer/form.tsx
@@ -1,6 +1,6 @@
-import { LoadingSpinner } from "@/components/custom/loadingspinner"
-import { Badge } from "@/components/ui/badge"
-import { Button } from "@/components/ui/button"
+import { LoadingSpinner } from "~/components/custom/loadingspinner"
+import { Badge } from "~/components/ui/badge"
+import { Button } from "~/components/ui/button"
import {
Card,
CardContent,
@@ -8,22 +8,22 @@ import {
CardFooter,
CardHeader,
CardTitle,
-} from "@/components/ui/card"
+} from "~/components/ui/card"
import {
FormControl,
FormDescription,
FormField,
FormItem,
FormMessage,
-} from "@/components/ui/form"
-import { Input } from "@/components/ui/input"
+} from "~/components/ui/form"
+import { Input } from "~/components/ui/input"
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
-} from "@/components/ui/select"
+} from "~/components/ui/select"
import type { UseFormReturn } from "react-hook-form"
import { Form } from "react-router"
import { RemixFormProvider } from "remix-hook-form"
diff --git a/fdm-app/app/components/custom/fertilizer/table.tsx b/fdm-app/app/components/custom/fertilizer/table.tsx
index b2c3752d8..9c82fd8f5 100644
--- a/fdm-app/app/components/custom/fertilizer/table.tsx
+++ b/fdm-app/app/components/custom/fertilizer/table.tsx
@@ -1,5 +1,5 @@
-import { Button } from "@/components/ui/button"
-import { Input } from "@/components/ui/input"
+import { Button } from "~/components/ui/button"
+import { Input } from "~/components/ui/input"
import {
Table,
TableBody,
@@ -7,7 +7,7 @@ import {
TableHead,
TableHeader,
TableRow,
-} from "@/components/ui/table"
+} from "~/components/ui/table"
import {
type ColumnDef,
type ColumnFiltersState,
diff --git a/fdm-app/app/components/custom/sidebar-app.tsx b/fdm-app/app/components/custom/sidebar-app.tsx
index f12fa1f63..becc89a6e 100644
--- a/fdm-app/app/components/custom/sidebar-app.tsx
+++ b/fdm-app/app/components/custom/sidebar-app.tsx
@@ -4,7 +4,7 @@ import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
-} from "@/components/ui/collapsible"
+} from "~/components/ui/collapsible"
import {
DropdownMenu,
DropdownMenuContent,
@@ -26,10 +26,13 @@ import {
SidebarMenuBadge,
SidebarMenuButton,
SidebarMenuItem,
+ SidebarMenuSub,
+ SidebarMenuSubButton,
+ SidebarMenuSubItem,
} from "~/components/ui/sidebar"
-import { useFarmStore } from "@/store/farm"
-import { useCalendarStore } from "@/store/calendar"
-import { getCalendarSelection } from "@/lib/calendar"
+import { useFarmStore } from "~/store/farm"
+import { useCalendarStore } from "~/store/calendar"
+import { getCalendarSelection } from "~/lib/calendar"
import * as Sentry from "@sentry/react"
import {
ArrowRightLeft,
@@ -50,7 +53,6 @@ import {
Settings,
Shapes,
Sparkles,
- Sprout,
Square,
} from "lucide-react"
import posthog from "posthog-js"
@@ -58,7 +60,8 @@ import { useIsMobile } from "~/hooks/use-mobile"
import { useEffect, useState } from "react"
import { Form, NavLink, useLocation } from "react-router"
import { toast } from "sonner"
-import config from "@/fdm.config"
+import { clientConfig } from "~/lib/config"
+import { Button } from "~/components/ui/button"
interface SideBarAppType {
user: {
@@ -137,26 +140,29 @@ export function SidebarApp(props: SideBarAppType) {
const omBalanceLink = undefined
const baatLink = undefined
- try {
- Sentry.setUser({
- fullName: user.name,
- email: user.email,
- })
- } catch (error) {
- Sentry.captureException(error)
+ if (clientConfig.analytics.sentry) {
+ try {
+ Sentry.setUser({
+ fullName: user.name,
+ email: user.email,
+ })
+ } catch (error) {
+ Sentry.captureException(error)
+ }
}
+
const [feedback, setFeedback] = useState()
const [isLoading, setIsLoading] = useState(true)
+ if (isLoading) {
+ return null
+ }
+
useEffect(() => {
setFeedback(Sentry.getFeedback())
setIsLoading(false)
}, [])
- if (isLoading) {
- return null
- }
-
const openFeedbackForm = async () => {
try {
const form = await feedback.createForm()
@@ -192,14 +198,13 @@ export function SidebarApp(props: SideBarAppType) {