Skip to content
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

Merged
merged 4 commits into from
Nov 1, 2024

Conversation

constanzauanini
Copy link
Contributor

Also added "Last observation: ... " in schedule observation modal

@constanzauanini constanzauanini requested a review from a team as a code owner October 30, 2024 15:36
Copy link

vercel bot commented Oct 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
terraware-web-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 2:50pm
tree-location-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 2:50pm

Comment on lines 17 to 20
const has25mPlots = row.plantingSubzones
?.flatMap((subzone: { monitoringPlots: any[] }) => subzone.monitoringPlots.flatMap((plot) => plot.sizeMeters))
.some((size: number) => size.toString() === '25');

Copy link
Contributor

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.

Copy link
Contributor Author

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) =>
Copy link
Contributor

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?

Copy link
Contributor

@nickgraz nickgraz left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants