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
6 changes: 6 additions & 0 deletions .changeset/goofy-nails-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@nmi-agro/fdm-core": patch
"@nmi-agro/fdm-app": patch
---

In case Microsoft does not provide an email address at sign-in, ask users to use the magic link instead
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.33.0
version: 10.33.2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.33.0
version: 10.33.2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.33.0
version: 10.33.2

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Setup pnpm 10
uses: pnpm/action-setup@v4
with:
version: 10.33.0
version: 10.33.2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
- name: Setup pnpm 10
uses: pnpm/action-setup@v4
with:
version: 10.33.0
version: 10.33.2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down Expand Up @@ -224,7 +224,7 @@ jobs:
- name: Setup pnpm 10
uses: pnpm/action-setup@v4
with:
version: 10.33.0
version: 10.33.2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down Expand Up @@ -301,7 +301,7 @@ jobs:
- name: Setup pnpm 10
uses: pnpm/action-setup@v4
with:
version: 10.33.0
version: 10.33.2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down Expand Up @@ -376,7 +376,7 @@ jobs:
- name: Setup pnpm 10
uses: pnpm/action-setup@v4
with:
version: 10.33.0
version: 10.33.2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup pnpm 10
uses: pnpm/action-setup@v4
with:
version: 10.33.0
version: 10.33.2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
sync-injected-deps-after-scripts[]=build
link-workspace-packages=true
public-hoist-pattern[]=*typedoc*
4 changes: 2 additions & 2 deletions fdm-agents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
},
"dependencies": {
"@google/adk": "^0.6.1",
"@google/genai": "^1.48.0",
"@google/genai": "^1.50.1",
"@nmi-agro/fdm-calculator": "workspace:^",
"@nmi-agro/fdm-core": "workspace:^",
"@nmi-agro/fdm-data": "workspace:^",
"posthog-node": "^5.29.0",
"posthog-node": "^5.30.6",
"zod": "^3.25.76"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Heading, Text } from "@react-email/components"
import { Heading, Text } from "react-email"
import BaseEmailLayout from "./layout"

interface FarmInvitationCancelledEmailProps {
Expand All @@ -18,7 +18,7 @@ export const FarmInvitationCancelledEmail = ({
appName,
appBaseUrl,
senderName,
logoFileName = "/fdm-high-resolution-logo-transparent.png",
logoFileName = "/fdm-high-resolution-logo-transparent-no-text.png",
}: FarmInvitationCancelledEmailProps) => {
const previewText = `Je uitnodiging voor ${farmName} is ingetrokken.`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Heading, Section, Text } from "@react-email/components"
import { Button, Heading, Section, Text } from "react-email"
import BaseEmailLayout from "./layout"

interface FarmInvitationRoleUpdatedEmailProps {
Expand Down Expand Up @@ -26,7 +26,7 @@ export const FarmInvitationRoleUpdatedEmail = ({
appName,
appBaseUrl,
senderName,
logoFileName = "/fdm-high-resolution-logo-transparent.png",
logoFileName = "/fdm-high-resolution-logo-transparent-no-text.png",
}: FarmInvitationRoleUpdatedEmailProps) => {
const roleLabel = roleLabels[newRole] ?? newRole
const previewText = `Je uitnodiging voor ${farmName} is bijgewerkt. Je nieuwe rol is ${roleLabel}.`
Expand Down
4 changes: 2 additions & 2 deletions fdm-app/app/components/blocks/email/farm-invitation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Heading, Link, Section, Text } from "@react-email/components"
import { Button, Heading, Link, Section, Text } from "react-email"
import BaseEmailLayout from "./layout"

interface FarmInvitationEmailProps {
Expand Down Expand Up @@ -28,7 +28,7 @@ export const FarmInvitationEmail = ({
appName,
appBaseUrl,
senderName,
logoFileName = "/fdm-high-resolution-logo-transparent.png",
logoFileName = "/fdm-high-resolution-logo-transparent-no-text.png",
isUnregistered = false,
}: FarmInvitationEmailProps) => {
const roleLabel = roleLabels[role] ?? role
Expand Down
4 changes: 2 additions & 2 deletions fdm-app/app/components/blocks/email/invitation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Heading, Link, Section, Text } from "@react-email/components"
import { Button, Heading, Link, Section, Text } from "react-email"
import BaseEmailLayout from "./layout"

interface InvitationEmailProps {
Expand All @@ -20,7 +20,7 @@ export const InvitationEmail = ({
appName,
appBaseUrl,
senderName,
logoFileName = "/fdm-high-resolution-logo-transparent.png",
logoFileName = "/fdm-high-resolution-logo-transparent-no-text.png",
}: InvitationEmailProps) => {
const previewText = `Accepteer de uitnodiging om samen te werken in ${organizationName}.`
const baseUrl = appBaseUrl.startsWith("http")
Expand Down
6 changes: 3 additions & 3 deletions fdm-app/app/components/blocks/email/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
Link,
Preview,
Section,
Tailwind,
Text,
} from "@react-email/components"
import { Tailwind } from "@react-email/tailwind"
} from "react-email"
import type * as React from "react"

interface BaseEmailLayoutProps {
Expand Down Expand Up @@ -50,7 +50,7 @@ export const BaseEmailLayout = ({
appName,
appBaseUrl = "",
senderName,
logoFileName = "/fdm-high-resolution-logo-transparent.png",
logoFileName = "/fdm-high-resolution-logo-transparent-no-text.png",
preview,
children,
showLogo = true,
Expand Down
2 changes: 1 addition & 1 deletion fdm-app/app/components/blocks/email/magic-link.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Heading, Section, Text } from "@react-email/components"
import { Button, Heading, Section, Text } from "react-email"
import BaseEmailLayout from "./layout"

interface MagicLinkEmailProps {
Expand Down
4 changes: 2 additions & 2 deletions fdm-app/app/components/blocks/email/welcome.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Heading, Hr, Section, Text } from "@react-email/components"
import { Button, Heading, Hr, Section, Text } from "react-email"
import BaseEmailLayout from "./layout"

interface WelcomeEmailProps {
Expand All @@ -16,7 +16,7 @@ export function WelcomeEmail({
appName,
appBaseUrl = "",
senderName,
logoFileName = "/fdm-high-resolution-logo-transparent.png",
logoFileName = "/fdm-high-resolution-logo-transparent-no-text.png",
}: WelcomeEmailProps) {
const previewText = "Ga aan de slag en krijg beter agronomisch inzicht."
const absoluteUrl = url.startsWith("http") ? url : `https://${url}`
Expand Down
2 changes: 1 addition & 1 deletion fdm-app/app/lib/email.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TZDate } from "@date-fns/tz"
import { render } from "@react-email/components"
import { render } from "react-email"
import type { User } from "better-auth"
import { format } from "date-fns"
import { nl } from "date-fns/locale"
Expand Down
9 changes: 9 additions & 0 deletions fdm-app/app/routes/signin._index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,15 @@ export default function SignIn() {
}
}, [rawRedirectTo, redirectTo, setSearchParams])

useEffect(() => {
const error = searchParams.get("error")
if (error === "microsoft_no_email") {
setSocialSignInError(
"Uw Microsoft-account deelt geen e-mailadres met ons. Vul alstublieft uw e-mailadres hieronder in om een aanmeldlink te ontvangen.",
)
}
}, [searchParams])

const socialProviderNewUserCallbackUrl = modifySearchParams(
"/welcome",
(searchParams) => searchParams.set("redirectTo", redirectTo),
Expand Down
70 changes: 35 additions & 35 deletions fdm-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,55 +26,55 @@
"@nmi-agro/fdm-core": "workspace:^",
"@nmi-agro/fdm-data": "workspace:*",
"@nmi-agro/fdm-rvo": "workspace:^",
"@react-email/components": "^1.0.11",
"@react-email/tailwind": "^2.0.7",
"@react-pdf/renderer": "^4.4.0",
"@react-router/node": "^7.14.0",
"@react-router/serve": "^7.14.0",
"@react-email/ui": "^6.0.1",
"@react-pdf/renderer": "^4.5.1",
"@react-router/node": "^7.14.2",
"@react-router/serve": "^7.14.2",
"@remix-run/file-storage": "^0.13.3",
"@remix-run/form-data-parser": "^0.15.0",
"@sentry/profiling-node": "^10.47.0",
"@sentry/react-router": "^10.47.0",
"@tailwindcss/vite": "^4.2.2",
"@remix-run/form-data-parser": "^0.16.0",
"@sentry/profiling-node": "^10.50.0",
"@sentry/react-router": "^10.50.0",
"@tailwindcss/vite": "^4.2.4",
"@tanstack/react-table": "^8.21.3",
"@turf/area": "^7.3.4",
"@turf/boolean-point-in-polygon": "^7.3.4",
"@turf/centroid": "^7.3.4",
"@turf/helpers": "^7.3.4",
"@turf/simplify": "^7.3.4",
"@turf/area": "^7.3.5",
"@turf/boolean-point-in-polygon": "^7.3.5",
"@turf/centroid": "^7.3.5",
"@turf/helpers": "^7.3.5",
"@turf/simplify": "^7.3.5",
"better-auth": "catalog:",
"chrono-node": "^2.9.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "1.1.1",
"date-fns": "^4.1.0",
"dompurify": "^3.4.0",
"dompurify": "^3.4.1",
"drizzle-orm": "catalog:",
"file-type": "^22.0.0",
"file-type": "^22.0.1",
"flatgeobuf": "^4.4.0",
"framer-motion": "^12.38.0",
"fuzzysort": "^3.1.0",
"input-otp": "^1.4.2",
"isbot": "^5.1.37",
"isbot": "^5.1.39",
"lodash.throttle": "^4.1.1",
"lucide-react": "^1.7.0",
"maplibre-gl": "^5.22.0",
"nanoid": "^5.1.7",
"lucide-react": "^1.11.0",
"maplibre-gl": "^5.24.0",
"nanoid": "^5.1.9",
"next-themes": "^0.4.6",
"postgres": "^3.4.9",
"posthog-js": "^1.365.0",
"posthog-node": "^5.29.0",
"posthog-js": "^1.372.3",
"posthog-node": "^5.30.6",
"postmark": "^4.0.7",
"proj4": "^2.20.8",
"radix-ui": "^1.4.3",
"react": "^19.2.4",
"react": "^19.2.5",
"react-day-picker": "9.14.0",
"react-dom": "^19.2.4",
"react-hook-form": "^7.72.1",
"react-map-gl": "^8.1.0",
"react-dom": "^19.2.5",
"react-email": "^6.0.1",
"react-hook-form": "^7.74.0",
"react-map-gl": "^8.1.1",
"react-markdown": "^10.1.0",
"react-router": "^7.14.0",
"react-router-dom": "^7.14.0",
"react-router": "^7.14.2",
"react-router-dom": "^7.14.2",
"recharts": "^3.8.1",
"remark-gfm": "^4.0.1",
"remix-hook-form": "7.1.1",
Expand All @@ -94,24 +94,24 @@
"@nmi-agro/fdm-core": "workspace:*",
"@nmi-agro/fdm-data": "workspace:*",
"@nmi-agro/fdm-rvo": "workspace:*",
"@react-router/dev": "^7.14.0",
"@react-router/fs-routes": "^7.14.0",
"@tailwindcss/postcss": "^4.2.2",
"@react-router/dev": "^7.14.2",
"@react-router/fs-routes": "^7.14.2",
"@tailwindcss/postcss": "^4.2.4",
"@types/geojson": "^7946.0.16",
"@types/lodash.throttle": "^4.1.9",
"@types/mapbox__geojson-extent": "^1.0.3",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@types/react-map-gl": "^6.1.8",
"@types/validator": "^13.15.10",
"postcss": "^8.5.8",
"tailwindcss": "^4.2.2",
"postcss": "^8.5.12",
"tailwindcss": "^4.2.4",
"typescript": "catalog:",
"vite": "^8.0.5",
"vite": "^8.0.10",
"vite-node": "^6.0.0"
},
"engines": {
"node": ">=24.0.0"
},
"packageManager": "pnpm@10.33.0"
"packageManager": "pnpm@10.33.2"
}
2 changes: 1 addition & 1 deletion fdm-calculator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"packageManager": "pnpm@10.33.0"
"packageManager": "pnpm@10.33.2"
}
3 changes: 1 addition & 2 deletions fdm-calculator/src/balance/nitrogen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function calculateNitrogenBalance(
* using `calculateNitrogenBalancesFieldToFarm`.
*
* @param fdm - The FDM instance for database access (caching).
* @param nitrogenBalanceInput - The input data for the nitrogen balance calculation, including all fields.
* @param inputs - The input data for the nitrogen balance calculation for multiple farms.
* @returns A promise that resolves an array where each item is the aggregated nitrogen balance of a farm,
* including the b_id_farm.
*/
Expand Down Expand Up @@ -328,7 +328,6 @@ export function calculateNitrogenBalanceField(
* same input. The cache is managed by `withCalculationCache` and uses the
* `pkg.calculatorVersion` as part of its cache key.
*
* @param nitrogenBalanceInput - The input data for the nitrogen balance calculation.
* @returns A promise that resolves with the calculated nitrogen balance, with numeric values as numbers.
*/
export const getNitrogenBalanceField = withCalculationCache(
Expand Down
3 changes: 1 addition & 2 deletions fdm-calculator/src/balance/organic-matter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function calculateOrganicMatterBalance(
* The final output is a numeric representation of the balance, suitable for display or further analysis.
*
* @param fdm - The FDM instance for database access (caching).
* @param organicMatterBalanceInput - The complete dataset required for the calculation, including all fields,
* @param inputs - The complete dataset required for the calculation, including all fields,
* fertilizer catalogues, and cultivation catalogues for the farm.
* @returns A promise that resolves to the aggregated `OrganicMatterBalanceNumeric` object for the farm.
* @throws {Error} Throws an error if the calculation process fails for any reason.
Expand Down Expand Up @@ -244,7 +244,6 @@ export function calculateOrganicMatterBalanceField(
* same input. The cache is managed by `withCalculationCache` and uses the
* `pkg.calculatorVersion` as part of its cache key.
*
* @param organicMatterBalanceFieldInput - The input data for the organic matter balance calculation for a single field.
* @returns A promise that resolves with the calculated organic matter balance, with numeric values as numbers.
*/
export const getOrganicMatterBalanceField = withCalculationCache(
Expand Down
5 changes: 3 additions & 2 deletions fdm-calculator/src/doses/calculate-dose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import type { Dose, NumericDoseKeys } from "./d"
*
* This function processes an array of fertilizer applications, matching each with its corresponding fertilizer definition to calculate the dose of each nutrient. The nutrient rates are converted from grams or milligrams per kilogram to kilograms per kilogram and then multiplied by the application amount to determine the dose in kg/ha.
*
* @param applications An array of fertilizer application objects, each specifying the fertilizer `p_id` and the applied amount `p_app_amount` in kg/ha.
* @param fertilizers An array of fertilizer objects, providing the nutrient rates for each fertilizer. Nutrient rates are expected to be non-negative.
* @param input - An object containing:
* - `applications`: An array of fertilizer application objects, each specifying the fertilizer `p_id` and the applied amount `p_app_amount` in kg/ha.
* - `fertilizers`: An array of fertilizer objects, providing the nutrient rates for each fertilizer. Nutrient rates are expected to be non-negative.
* @returns An object containing:
* - `dose`: An object with the total cumulative doses for all nutrients in kg/ha.
* - `applications`: An array of objects, each detailing the individual nutrient doses for each fertilizer application.
Expand Down
Loading
Loading