-
Notifications
You must be signed in to change notification settings - Fork 4
Introduce explicit buffer strip field handling #422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
da3e50a
refactor: Replace at field the derived parameter `b_isproductive` wit…
SvenVw 4687738
feat: take buffer strips into account in calculations
SvenVw 39cca64
refactor: rename b_buffer to b_bufferstrip
SvenVw 3bc1020
refactor: remove not used code
SvenVw bcd3a32
feat: Set for existing fields the b_bufferstrip bases on the same log…
SvenVw 64b1d9c
fix: forgotten names
SvenVw 6839005
feat: enable to set if field is a bufferstrip and adjust calculated o…
SvenVw 35e799e
fix: error checking for balance
SvenVw 8006efc
refactor: improve form of field overvied and improve mobile and small…
SvenVw ccb279c
refactor: rearrange field delete button for more space of the map
SvenVw f788781
refactor: improve header on smaller screens
SvenVw 3169f0e
tests: fix missing b_bufferstrip
SvenVw df4f0df
docs: typo
SvenVw 67ca99a
fix: use width of parent
SvenVw 3f17ad2
refactor: Add a visible focus-visible ring to the dropdown trigger
SvenVw 130b2b2
refactor: remove not used console.log
SvenVw 4256066
refactor: prevent potential null with b_area
SvenVw 4dffe82
refactor: handle zero case
SvenVw 050afc1
nitpicks
SvenVw 16a1923
refactor: avoid nesting a button in a link
SvenVw 621f6c3
refactor: Guard against null/zero values in buffer heuristic
SvenVw 2b9611f
refactor: Guard nutrient advice progress when requirements are 0
SvenVw 3b6cf5f
nitpicks
SvenVw 441a1bb
fix: type error
SvenVw 5dbdd9c
test: fix
SvenVw b7e8dad
Merge branch 'development' into FDM419
SvenVw d1bdc24
Merge branch 'development' into FDM419
SvenVw 13a8a8f
fix: forgotten renaming
SvenVw c7a38e6
Update fdm-app/app/routes/farm.$b_id_farm.$calendar.rotation._index.tsx
SvenVw e01ccdb
fix: type
SvenVw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@svenvw/fdm-calculator": minor | ||
| --- | ||
|
|
||
| Exclude buffer strips from calculating farm balances and set field values to 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@svenvw/fdm-core": minor | ||
| --- | ||
|
|
||
| Replace the derived field parameter `b_isproductive` with the stored parameter `b_bufferstrip` so users can set it explicitly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@svenvw/fdm-core": minor | ||
| --- | ||
|
|
||
| Set for existing fields the b_bufferstrip based on the same logic as in determineIfFieldIsBuffer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| "fdm-app": patch | ||
| --- | ||
|
|
||
| Significant UI/UX and mobile responsiveness improvements across the application: | ||
| - Field Overview: Refactored to use a responsive Card layout and simplified labels for better mobile fit. | ||
| - Header: Optimized for small screens with flexible height, truncated labels, and streamlined breadcrumbs. | ||
| - Sidebar: Reduced width and internal spacing on medium screens to reclaim horizontal space for content. | ||
| - Fertilizer Dashboard: Redesigned with a stacked layout for better readability on laptops and added robust text truncation. | ||
| - Layout: Improved global padding and adjusted breakpoints (xl/2xl) to ensure a polished look across mobile, tablet, and desktop. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@svenvw/fdm-calculator": minor | ||
| --- | ||
|
|
||
| Do not provide nutrient advice for buffer strips by setting the output to 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@svenvw/fdm-app": minor | ||
| --- | ||
|
|
||
| Users can now indicate if a field is a buffer strip. Fields marked as buffer strips are excluded from nitrogen and organic matter balances at the farm level, and their nutrient advice and norms are automatically adjusted to zero. The UI now displays informative messages when calculations are skipped for these fields. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@svenvw/fdm-calculator": minor | ||
| --- | ||
|
|
||
| For buffer strips set the norm values to 0 as they have no 'plaatsingsruimte' |
30 changes: 30 additions & 0 deletions
30
fdm-app/app/components/blocks/balance/buffer-strip-info.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { PanelsRightBottom } from "lucide-react" | ||
| import { Button } from "~/components/ui/button" | ||
| import { | ||
| Tooltip, | ||
| TooltipContent, | ||
| TooltipProvider, | ||
| TooltipTrigger, | ||
| } from "~/components/ui/tooltip" | ||
|
|
||
| export function BufferStripInfo() { | ||
| return ( | ||
| <TooltipProvider> | ||
| <Tooltip> | ||
| <TooltipTrigger asChild> | ||
| <Button | ||
| variant="outline" | ||
| size="icon" | ||
| className="border cursor-default hover:bg-background" | ||
| aria-label="Bufferstroken info" | ||
| > | ||
| <PanelsRightBottom className="h-4 w-4 text-muted-foreground" /> | ||
| </Button> | ||
| </TooltipTrigger> | ||
| <TooltipContent> | ||
| <p>Bufferstroken zijn uitgesloten van de balansberekening</p> | ||
| </TooltipContent> | ||
| </Tooltip> | ||
| </TooltipProvider> | ||
| ) | ||
| } |
37 changes: 37 additions & 0 deletions
37
fdm-app/app/components/blocks/balance/buffer-strip-warning.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import { NavLink } from "react-router" | ||
| import { useCalendarStore } from "~/store/calendar" | ||
| import { Button } from "~/components/ui/button" | ||
| import { | ||
| Card, | ||
| CardContent, | ||
| CardFooter, | ||
| CardHeader, | ||
| CardTitle, | ||
| } from "~/components/ui/card" | ||
|
|
||
| export function BufferStripWarning({ b_id }: { b_id: string }) { | ||
| const calendar = useCalendarStore((state) => state.calendar) | ||
|
|
||
| return ( | ||
| <div className="flex items-center justify-center"> | ||
| <Card className="w-[350px]"> | ||
| <CardHeader> | ||
| <CardTitle>Bufferstrook: uitgesloten van balans</CardTitle> | ||
| </CardHeader> | ||
| <CardContent> | ||
| <div className="text-muted-foreground"> | ||
| <p> | ||
| Dit perceel is gemarkeerd als bufferstrook en wordt | ||
| daarom niet meegenomen in de balansberekening. | ||
| </p> | ||
| </div> | ||
| </CardContent> | ||
| <CardFooter> | ||
| <NavLink to={`../../${calendar}/field/${b_id}/overview`}> | ||
| <Button>Naar perceelsinstelling</Button> | ||
| </NavLink> | ||
| </CardFooter> | ||
| </Card> | ||
| </div> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.