-
Notifications
You must be signed in to change notification settings - Fork 4
Add page to add a single field #116
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
35 commits
Select commit
Hold shift + click to select a range
a85e7a3
Setup first draft of page for adding new field
SvenVw f30f2aa
Remove not needing lines
SvenVw 3e667ce
Fix layers
SvenVw 2036e01
Fix type
SvenVw aac6434
Open dialog on click
SvenVw ecf5533
Improve accessibility of combobox
SvenVw 04d8a12
Enable submitting a new field
SvenVw e754082
Add submitting stage to button
SvenVw 9a2821d
Fix displaying on small screen
SvenVw 9e4dee3
Remove not needed validation
SvenVw f2a4124
Improve colors of layers
SvenVw 5611acf
Improve boxes
SvenVw 4b3169f
Improve types
SvenVw 16508ce
Fix viewState if no fields are present
SvenVw f7e8b09
Remove whiteline
SvenVw 795718b
Fix form submission handling
SvenVw d0c5db3
Update dependencies
SvenVw 0ab60a3
Fix submitting geometry
SvenVw 9e43fa5
Fixes
SvenVw 34113b1
Add changeset
SvenVw 7d59071
Remove duplicate useEffect
SvenVw 19f75c8
Fix submitting new field
SvenVw 4de2785
Fixes
SvenVw d693cdb
Fix that soil data without sampling date is not excluded
SvenVw fbdf30c
Merge branch 'development' into add-field
SvenVw 61a5157
fix lock file
SvenVw 2ab7ffd
Various fixes due to merge with development
SvenVw faa950f
Fix imports
SvenVw 98d8500
Remove duplicate code
SvenVw 8928e95
Extend type
SvenVw 3633d37
Add simple validation for nmi api response
SvenVw 7019fa1
Merge branch 'development' into add-field
SvenVw 829cd12
Match full return type
SvenVw c42f54b
Improve error handling
SvenVw a131122
Fix lockfile
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-app": minor | ||
| --- | ||
|
|
||
| Add page to add a field to a farm |
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": patch | ||
| --- | ||
|
|
||
| Fix that soil data without sampling date is not excluded |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,47 @@ | ||
| import type { LayerProps } from "react-map-gl" | ||
| import type { | ||
| FillLayerSpecification, | ||
| LayerProps, | ||
| SymbolLayerSpecification, | ||
| } from "react-map-gl" | ||
|
|
||
| export function getFieldsStyle(layerId: string): LayerProps & { | ||
| id: string | ||
| type: string | ||
| paint: { | ||
| "fill-color": string | ||
| "fill-opacity": number | ||
| "fill-outline-color": string | ||
| } | ||
| } { | ||
| const fieldsStyle = { | ||
| id: layerId, | ||
| export function getFieldsStyle( | ||
| layerId: string, | ||
| ): LayerProps & | ||
| ( | ||
| | ({ | ||
| id: string | ||
| type: "fill" | ||
| paint: FillLayerSpecification["paint"] | ||
| }) | ||
| | { | ||
| id: string | ||
| type: "symbol" | ||
| layout: SymbolLayerSpecification["layout"] | ||
| paint: SymbolLayerSpecification["paint"] | ||
| } | ||
| ) { | ||
| const baseFieldsStyle: Omit<FillLayerSpecification, "id" | "source"> = { | ||
| type: "fill", | ||
| paint: { | ||
| "fill-color": "#93c5fd", | ||
| "fill-color": "#60a5fa", | ||
| "fill-opacity": 0.5, | ||
| "fill-outline-color": "#1e3a8a", | ||
| }, | ||
| } | ||
| } as FillLayerSpecification // Cast to FillLayerSpecification to allow modification of paint | ||
|
|
||
| const fieldsStyle = { | ||
| ...baseFieldsStyle, | ||
| id: layerId, | ||
| } as LayerProps & FillLayerSpecification // Cast to FillLayerSpecification to allow modification of paint | ||
|
|
||
| if (layerId === "fieldsSelected") { | ||
| fieldsStyle.paint["fill-color"] = "#fca5a5" | ||
| fieldsStyle.paint["fill-color"] = "#f43f5e" | ||
| fieldsStyle.paint["fill-opacity"] = 0.8 | ||
| } | ||
| if (layerId === "fieldsSaved") { | ||
| fieldsStyle.paint["fill-color"] = "#10b981" | ||
| fieldsStyle.paint["fill-opacity"] = 0.8 | ||
| } | ||
|
|
||
| return fieldsStyle | ||
| } |
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.