Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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/good-peaches-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nmi-agro/fdm-app": minor
---

Importing fields from RVO with eHerkenning sign-in is now available to all users
38 changes: 1 addition & 37 deletions fdm-app/app/routes/farm.$b_id_farm.$calendar.rvo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import {
type UserChoiceMap,
} from "@nmi-agro/fdm-rvo/types"
import { getItemId } from "@nmi-agro/fdm-rvo/utils"
import { AlertTriangle, CloudDownload, Loader2 } from "lucide-react"
import { useFeatureFlagEnabled } from "posthog-js/react"
import { AlertTriangle, Loader2 } from "lucide-react"
import { useEffect, useState } from "react"
import {
type ActionFunctionArgs,
Expand Down Expand Up @@ -225,8 +224,6 @@ export default function RvoImportReviewPage() {
const navigation = useNavigation()
const location = useLocation()

const isRvoEnabled = useFeatureFlagEnabled("rvo")

const isImporting =
navigation.state === "submitting" &&
navigation.formData?.get("intent") === "start_import"
Expand Down Expand Up @@ -298,39 +295,6 @@ export default function RvoImportReviewPage() {
)
const hasChanges = Object.values(changes).some((count) => count > 0)

if (isRvoEnabled === false) {
return (
<SidebarInset>
<Header
action={{
to: `/farm/${b_id_farm}`,
label: "Terug naar bedrijf",
disabled: false,
}}
>
<HeaderFarm b_id_farm={b_id_farm} farmOptions={farms} />
</Header>
<FarmContent>
<div className="max-w-2xl mx-auto mt-20 text-center space-y-6">
<div className="bg-primary/10 border border-primary/20 p-8 rounded-xl">
<CloudDownload className="w-12 h-12 text-primary mx-auto mb-4" />
<h2 className="text-2xl font-bold text-foreground mb-2">
Percelen ophalen bij RVO is nog niet beschikbaar
voor je.
</h2>
<p className="text-muted-foreground mb-6">
Deze functionaliteit is momenteel in
ontwikkeling en is nog niet voor iedereen
beschikbaar. Neem contact op met Ondersteuning
als je hier vragen over hebt.
</p>
</div>
</div>
</FarmContent>
</SidebarInset>
)
}

if (error) {
return (
<SidebarInset>
Expand Down
8 changes: 2 additions & 6 deletions fdm-app/app/routes/farm.$b_id_farm._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
Trash2,
UserRoundCheck,
} from "lucide-react"
import { useFeatureFlagEnabled } from "posthog-js/react"
import { useState } from "react"
import {
data,
Expand Down Expand Up @@ -156,7 +155,6 @@ export async function loader({ request, params }: LoaderFunctionArgs) {

export default function FarmDashboardIndex() {
const loaderData = useLoaderData<typeof loader>()
const isRvoEnabled = useFeatureFlagEnabled("rvo")

const calendar = useCalendarStore((state) => state.calendar)
const setCalendar = useCalendarStore((state) => state.setCalendar)
Expand Down Expand Up @@ -451,10 +449,8 @@ export default function FarmDashboardIndex() {
</CardHeader>
</Card>
</NavLink>
{loaderData.isRvoConfigured &&
isRvoEnabled !== false && (
<NavLink
to={`${calendar}/rvo`}
{loaderData.isRvoConfigured && (
<NavLink to={`${calendar}/rvo`}
className={cn(
!loaderData.farmWritePermission &&
"pointer-events-none opacity-50",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { getFarm } from "@nmi-agro/fdm-core"
import { DownloadCloud, Map as MapIcon, UploadCloud } from "lucide-react"
import { useFeatureFlagEnabled } from "posthog-js/react"
import type { LoaderFunctionArgs, MetaFunction } from "react-router"
import { data, NavLink, useLoaderData } from "react-router"
import { Header } from "~/components/blocks/header/base"
Expand Down Expand Up @@ -64,8 +63,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) {

export default function ChooseFieldImportMethod() {
const { farm, isRvoConfigured } = useLoaderData<typeof loader>()
const isRvoEnabled = useFeatureFlagEnabled("rvo")
const showRvoOption = isRvoConfigured && isRvoEnabled !== false
const showRvoOption = isRvoConfigured

return (
<SidebarInset>
Expand Down
34 changes: 2 additions & 32 deletions fdm-app/app/routes/farm.create.$b_id_farm.$calendar.rvo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import type {
UserChoiceMap,
} from "@nmi-agro/fdm-rvo/types"
import { getItemId } from "@nmi-agro/fdm-rvo/utils"
import { AlertTriangle, CloudDownload, Loader2 } from "lucide-react"
import { useFeatureFlagEnabled } from "posthog-js/react"
import { AlertTriangle, Loader2 } from "lucide-react"
import { useEffect, useState } from "react"
import {
type ActionFunctionArgs,
Expand Down Expand Up @@ -198,8 +197,6 @@ export default function RvoImportCreatePage() {
const navigation = useNavigation()
const location = useLocation()

const isRvoEnabled = useFeatureFlagEnabled("rvo")

const isImporting =
navigation.state === "submitting" &&
navigation.formData?.get("intent") === "start_import"
Expand Down Expand Up @@ -249,33 +246,6 @@ export default function RvoImportCreatePage() {
setUserChoices((prev: UserChoiceMap) => ({ ...prev, [id]: action }))
}

if (isRvoEnabled === false) {
return (
<SidebarInset>
<Header action={undefined}>
<HeaderFarmCreate b_name_farm={b_name_farm} />
</Header>
<FarmContent>
<div className="max-w-2xl mx-auto mt-20 text-center space-y-6">
<div className="bg-primary/10 border border-primary/20 p-8 rounded-xl">
<CloudDownload className="w-12 h-12 text-primary mx-auto mb-4" />
<h2 className="text-2xl font-bold text-foreground mb-2">
Percelen ophalen bij RVO is nog niet beschikbaar
voor je.
</h2>
<p className="text-muted-foreground mb-6">
Deze functionaliteit is momenteel in
ontwikkeling en is nog niet voor iedereen
beschikbaar. Neem contact op met Ondersteuning
als je hier vragen over hebt.
</p>
</div>
</div>
</FarmContent>
</SidebarInset>
)
}

if (error) {
return (
<SidebarInset>
Expand Down Expand Up @@ -350,7 +320,7 @@ export default function RvoImportCreatePage() {
<AlertDescription>
De RVO koppeling is nog niet ingesteld op deze
server. Neem contact op met de beheerder om de
RVO toeggangegevens toe te voegen.
RVO toegangsgegevens toe te voegen.
</AlertDescription>
</Alert>
</div>
Expand Down
13 changes: 5 additions & 8 deletions fdm-app/app/routes/signin._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1296,14 +1296,11 @@ export default function SignIn() {
</h3>
<p className="text-muted-foreground">
Start direct door uw percelen in te lezen
via een RVO shapefile. Uw percelen staan
binnen enkele seconden correct op de kaart,
inclusief het gewas.
</p>
<p className="text-muted-foreground text-sm">
Binnenkort heeft u ook de mogelijkheid
direct vanuit RVO percelen te importeren met
behulp van eHerkenning.
via een RVO shapefile of direct te
importeren vanuit RVO met behulp van
eHerkenning. Uw percelen staan daarmee
direct goed in de applicatie, inclusief het
gewas.
</p>
</div>

Expand Down
Loading