-
Notifications
You must be signed in to change notification settings - Fork 0
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
Observations: Add indicators in Zones and Plots containing 25m sq plots #3307
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const has25mPlots = row.plantingSubzones | ||
?.flatMap((subzone: { monitoringPlots: any[] }) => subzone.monitoringPlots.flatMap((plot) => plot.sizeMeters)) | ||
.some((size: number) => size.toString() === '25'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should be a static util function that receives subzones? It seems to be duplicated 3 times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used twice for subzones, so I added a util for that. The other checks the zone.
@@ -134,6 +134,14 @@ export default function ObservationDetails(props: ObservationDetailsProps): JSX. | |||
} | |||
}, [zoneNames, searchProps.filtersProps]); | |||
|
|||
const has25mPlots = details?.plantingZones | |||
.flatMap((zone) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the has25mPlots
function here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one more suggestion for improvement but not absolutely necessary
Also added "Last observation: ... " in schedule observation modal