Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
f76e542
refactor: Redesign fields at Atlas to show all fields and redirect to…
SvenVw Aug 6, 2025
7132f45
refactor: use centroid of field to get same results back
SvenVw Aug 6, 2025
df82c95
feat: collect first set of data for details page
SvenVw Aug 6, 2025
70d4246
Merge remote-tracking branch 'origin/development' into FDM220
SvenVw Aug 7, 2025
af9b222
feat: add at Atlas Fields that when a field is clicked, details about…
SvenVw Aug 7, 2025
72c4275
refactor: add suspense for page loading with field details
SvenVw Aug 7, 2025
e00c507
feat: when clicking terug button or reloading page use latest viewsta…
SvenVw Aug 8, 2025
6cb6b65
refactor: move the "terug" button in the header of Atlas at details page
SvenVw Aug 8, 2025
d74620f
Merge branch 'development' into FDM220
SvenVw Aug 8, 2025
34c5a33
feat: add card with field details
SvenVw Aug 8, 2025
0db0bd4
feat: add note to footer that the areas are for 2025
SvenVw Aug 8, 2025
12dbc4c
feat: Export the function getRegion, isFieldInNVGebied, isFieldInGWGB…
SvenVw Aug 8, 2025
ef90a9b
feat: replace mocks with real values for region data
SvenVw Aug 8, 2025
be4b779
refactor: improve the page for mobile layout
SvenVw Aug 8, 2025
8cef9df
fix: typo
SvenVw Aug 8, 2025
d933985
refactor: move info text to card description from footer
SvenVw Aug 8, 2025
753e2ac
fix: whitespace between the rows
SvenVw Aug 8, 2025
c94c59e
feat: add query for area
SvenVw Aug 8, 2025
ea8adad
fix: ordering ordering of the cards
SvenVw Aug 8, 2025
34ce6df
feat: add b_lu_rest_oravib and new BRP 2025 crops to BRP cultivation …
SvenVw Aug 8, 2025
714bb03
feat: add `b_lu_rest_oravib` as parameter to cultivationCatalogue.
SvenVw Aug 8, 2025
b89d321
Merge remote-tracking branch 'origin/development' into FDM220
SvenVw Aug 8, 2025
59b22b0
feat: add badge to indicate rustgewassen
SvenVw Aug 8, 2025
827f67d
fix: typo's
SvenVw Aug 8, 2025
cb2b139
feat: atlas is now also available without selecting a farm first
SvenVw Aug 11, 2025
5c51ccb
feat: Redesign the landing page after signin with cards that show new…
SvenVw Aug 11, 2025
b9106ba
feat: add hover panel to show cultivation of field
SvenVw Aug 11, 2025
a65c95a
Merge remote-tracking branch 'origin/development' into FDM220
SvenVw Aug 11, 2025
58054c8
refactor: add type for fieldDetails
SvenVw Aug 11, 2025
621cd75
fix: incorrect tailwind class
SvenVw Aug 11, 2025
8f41c21
refactor: move getAvailableFieldsUrl into tryCatch
SvenVw Aug 11, 2025
eb9b0dc
refactor: Enhance bbox tolerance and verify actual point containment
SvenVw Aug 11, 2025
55e2925
refactor: prevent memory leak
SvenVw Aug 11, 2025
27fa364
refactor: add error handling for centroid calculation
SvenVw Aug 11, 2025
39e33cb
refactor: improve fallback
SvenVw Aug 11, 2025
3665d4d
fix: duplicate key
SvenVw Aug 11, 2025
1942c31
fix: import path
SvenVw Aug 11, 2025
fffd091
refactor: Add validation for centroid coordinate parsing
SvenVw Aug 11, 2025
b7c1d50
refactor: improve type loading
SvenVw Aug 11, 2025
ddf1907
refactor: simplify async data processing pattern
SvenVw Aug 11, 2025
9048e61
refactor: improve year comparison robustness
SvenVw Aug 11, 2025
60ac4a7
fix: inconsistent naming of groundwater
SvenVw Aug 11, 2025
10076c5
refactor: improve type safety
SvenVw Aug 11, 2025
fb79d6d
fix: missing useEffect dependency
SvenVw Aug 11, 2025
e92ca18
fix: missing type import
SvenVw Aug 11, 2025
57160f4
fix: add undefined as input type
SvenVw Aug 11, 2025
b61ba93
refactor: Avoid array index as key (Biome lint error) in Skeleton list
SvenVw Aug 11, 2025
01ec68b
refactor: move json parse into tryCatch
SvenVw Aug 11, 2025
cafc2c2
fix: card layout of skeleton
SvenVw Aug 11, 2025
928edb9
refactor: use more robust method for checking if on field details page
SvenVw Aug 11, 2025
a759c03
refactor: use consistent coloring
SvenVw Aug 11, 2025
cd15066
fix: links
SvenVw Aug 11, 2025
309eba0
fix: array index
SvenVw Aug 11, 2025
ba8cf4a
refactor: update the welcome email with more information about the fu…
SvenVw Aug 11, 2025
0447ae5
fix: typo in email subject
SvenVw Aug 11, 2025
8ce568d
fix: use html component for list in email
SvenVw Aug 11, 2025
5019e38
fix: styling of button and make sure the url of button is correct
SvenVw Aug 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chilly-pants-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svenvw/fdm-app": minor
---

Redesign fields at Atlas to show all fields and redirect to details page when clicked
5 changes: 5 additions & 0 deletions .changeset/chubby-parks-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svenvw/fdm-data": minor
---

Add the new BRP 2025 crops to the brp cultivation dataset
5 changes: 5 additions & 0 deletions .changeset/lucky-suns-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svenvw/fdm-calculator": minor
---

Export the function getRegion, isFieldInNVGebied, isFieldInGWGBGebie and isFieldInNatura2000Gebied
5 changes: 5 additions & 0 deletions .changeset/petite-dogs-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svenvw/fdm-app": minor
---

Add at Atlas Fields that when a field is clicked, details about that field, like cultivation history and soil texture are shown on fields details page
5 changes: 5 additions & 0 deletions .changeset/polite-waves-like.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svenvw/fdm-app": minor
---

Atlas is now also available without selecting a farm first
5 changes: 5 additions & 0 deletions .changeset/puny-ravens-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svenvw/fdm-data": minor
---

Add the `b_lu_rest_oravib` property to the BRP cultivation dataset
5 changes: 5 additions & 0 deletions .changeset/puny-rockets-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svenvw/fdm-app": minor
---

Add `b_lu_rest_oravib` as parameter to cultivationCatalogue. This boolean parameter specifies if the cultivation is classified as 'rustgewas'.
5 changes: 5 additions & 0 deletions .changeset/social-papers-fall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@svenvw/fdm-app": minor
---

Redesign the landing page after signin with cards that show new farm and atlas. When first logged in show 2 detailed cards with the background information about the farm and atlas tool
116 changes: 116 additions & 0 deletions fdm-app/app/components/blocks/atlas-fields/cultivation-history.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "~/components/ui/card"
import { Skeleton } from "~/components/ui/skeleton"
import { Badge } from "~/components/ui/badge"
import { getCultivationColor } from "~/components/custom/cultivation-colors"

type CultivationHistory = {
year: number
b_lu_catalogue: string
b_lu_name?: string
b_lu_croprotation?: string
b_lu_rest_oravib?: boolean
}

export function CultivationHistoryCard({
cultivationHistory,
}: {
cultivationHistory: CultivationHistory[]
}) {
return (
<Card className="col-span-1 lg:row-span-2">
Comment thread
SvenVw marked this conversation as resolved.
<CardHeader>
<CardTitle>Gewashistorie</CardTitle>
<CardDescription>
De gewassen van de afgelopen jaren op dit perceel volgens
Basisregistratie Gewaspercelen.
</CardDescription>
</CardHeader>
<CardContent className="pt-6 text-sm">
<div className="relative pl-1">
{cultivationHistory.map((cultivation, index) => (
<div
key={cultivation.year}
Comment thread
SvenVw marked this conversation as resolved.
className="flex items-start space-x-4 pb-6"
>
<div className="relative flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full">
<span
className="absolute h-full w-full rounded-full"
style={{
backgroundColor: getCultivationColor(
cultivation.b_lu_croprotation,
),
opacity: 0.2,
}}
/>
<span
className="relative h-5 w-5 rounded-full"
style={{
backgroundColor: getCultivationColor(
cultivation.b_lu_croprotation,
),
}}
/>
{index !== cultivationHistory.length - 1 && (
<div className="absolute left-1/2 top-full h-6 w-0.5 -translate-x-1/2 transform bg-gray-200" />
)}
</div>
<div className="min-w-0 flex-1">
<p className="font-medium text-gray-900">
{cultivation.b_lu_name}
</p>
<p className="text-sm text-gray-500">
{cultivation.year}
</p>
</div>
<div>
{cultivation.b_lu_rest_oravib === true ? (
<Badge variant={"secondary"}>
Rustgewas
</Badge>
) : null}
</div>
</div>
))}
</div>
</CardContent>
</Card>
)
}

export function CultivationHistorySkeleton() {
const SKELETON_KEYS = ["sk-1", "sk-2", "sk-3"] as const

return (
<Card className="col-span-1 lg:row-span-2">
<CardHeader>
<CardTitle>Gewashistorie</CardTitle>
<CardDescription>
De gewassen van de afgelopen jaren op dit perceel volgens
Basisregistratie Gewaspercelen.
</CardDescription>
</CardHeader>
<CardContent className="pt-6 text-sm">
<div className="relative pl-1">
{SKELETON_KEYS.map((key) => (
<div
key={key}
className="flex items-start space-x-4 pb-6"
>
<Skeleton className="h-10 w-10 rounded-full" />
<div className="min-w-0 flex-1 space-y-2">
<Skeleton className="h-4 w-3/4" />
<Skeleton className="h-3 w-1/2" />
</div>
</div>
))}
</div>
</CardContent>
</Card>
)
}
192 changes: 192 additions & 0 deletions fdm-app/app/components/blocks/atlas-fields/field-details.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
import { Info } from "lucide-react"
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "~/components/ui/card"
import { Skeleton } from "~/components/ui/skeleton"

export function FieldDetailsCard({
fieldDetails,
}: {
fieldDetails: {
b_area: number
regionTable2?: "klei" | "veen" | "loess" | "zand_nwc" | "zand_zuid"
isNvGebied?: boolean
isGWBGGebied?: boolean
isNatura2000Area?: boolean
}
}) {
return (
<Card>
<CardHeader>
<CardTitle>Perceeldetails</CardTitle>
<CardDescription className="flex items-center justify-start space-x-2 text-sm text-muted-foreground">
<Info className="h-4" />
<p>De gebieden gelden voor 2025</p>
</CardDescription>
Comment thread
SvenVw marked this conversation as resolved.
</CardHeader>
<CardContent className="grid lg:grid-cols-2 gap-4">
<div className="grid lg:grid-cols-2 col-span-2 gap-4">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2 space-x-2">
<CardTitle className="text-sm font-medium">
Oppervlakte
</CardTitle>
</CardHeader>
<CardContent className="space-y-2">
<div className="flex items-baseline space-x-2">
<div className="text-2xl font-bold">
{fieldDetails.b_area}
</div>
<div className="text-sm text-muted-foreground">
ha
</div>
</div>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2 space-x-2">
<CardTitle className="text-sm font-medium">
Regio (RVO Tabel 2)
</CardTitle>
</CardHeader>
<CardContent className="space-y-2">
<div className="flex items-baseline space-x-2">
<div className="text-2xl font-bold">
{fieldDetails.regionTable2 === "klei"
? "Klei"
: fieldDetails.regionTable2 === "veen"
? "Veen"
: fieldDetails.regionTable2 ===
"loess"
? "Löss"
: fieldDetails.regionTable2 ===
"zand_nwc"
? "Noordelijk, westelijk, en centraal zand"
: fieldDetails.regionTable2 ===
"zand_zuid"
? "Zuidelijk zand"
: "Onbekend"}
Comment thread
SvenVw marked this conversation as resolved.
Comment thread
SvenVw marked this conversation as resolved.
</div>
</div>
</CardContent>
</Card>
</div>
<div className="grid lg:grid-cols-3 col-span-2 gap-4">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2 space-x-2">
<CardTitle className="text-sm font-medium">
NV-Gebied
</CardTitle>
</CardHeader>
<CardContent className="space-y-2">
<div className="flex items-baseline space-x-2">
<div className="text-2xl font-bold">
{fieldDetails.isNvGebied ? "Ja" : "Nee"}
</div>
</div>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2 space-x-2">
<CardTitle className="text-sm font-medium break-all">
Grondwaterbeschermingsgebied
</CardTitle>
</CardHeader>
<CardContent className="space-y-2">
<div className="flex items-baseline space-x-2">
<div className="text-2xl font-bold">
{fieldDetails.isGWBGGebied ? "Ja" : "Nee"}
</div>
</div>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2 space-x-2">
<CardTitle className="text-sm font-medium">
Natura 2000
</CardTitle>
</CardHeader>
<CardContent className="space-y-2">
<div className="flex items-baseline space-x-2">
<div className="text-2xl font-bold">
{fieldDetails.isNatura2000Area
? "Ja"
: "Nee"}
</div>
</div>
</CardContent>
</Card>
</div>
</CardContent>
</Card>
)
}

export function FieldDetailsSkeleton() {
return (
<Card>
<CardHeader>
<CardTitle>Perceeldetails</CardTitle>
<CardDescription className="flex items-center justify-start space-x-2 text-sm text-muted-foreground">
<Info className="h-4" />
<p>De gebieden gelden voor 2025</p>
</CardDescription>
</CardHeader>
<CardContent className="grid lg:grid-cols-2 gap-4">
<div className="grid lg:grid-cols-2 col-span-2 gap-4">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2 space-x-2">
<Skeleton className="h-4 w-1/4" />
</CardHeader>
<CardContent className="space-y-2">
<Skeleton className="h-6 w-1/2" />
<Skeleton className="h-3 w-1/4" />
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2 space-x-2">
<Skeleton className="h-4 w-1/4" />
</CardHeader>
<CardContent className="space-y-2">
<Skeleton className="h-6 w-1/2" />
<Skeleton className="h-3 w-1/4" />
</CardContent>
</Card>
<div className="grid lg:grid-cols-3 col-span-2 gap-4">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2 space-x-2">
<Skeleton className="h-4 w-1/4" />
</CardHeader>
<CardContent className="space-y-2">
<Skeleton className="h-6 w-1/2" />
<Skeleton className="h-3 w-1/4" />
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2 space-x-2">
<Skeleton className="h-4 w-1/4" />
</CardHeader>
<CardContent className="space-y-2">
<Skeleton className="h-6 w-1/2" />
<Skeleton className="h-3 w-1/4" />
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2 space-x-2">
<Skeleton className="h-4 w-1/4" />
</CardHeader>
<CardContent className="space-y-2">
<Skeleton className="h-6 w-1/2" />
<Skeleton className="h-3 w-1/4" />
</CardContent>
</Card>
</div>
</div>
</CardContent>
</Card>
)
}
Loading