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

Add area indicators and country code #73

Merged
merged 7 commits into from
Oct 17, 2024
Merged

Add area indicators and country code #73

merged 7 commits into from
Oct 17, 2024

Conversation

vgeorge
Copy link
Collaborator

@vgeorge vgeorge commented Oct 2, 2024

Contributes to: #65, #43, #20

Changes:

  • Reverted the upgrade of npm-run-path from v5.3.0 to v6.0.0 introduced in chore: Migrate to MapboxGL #62, as it was breaking the ingest script
  • Pinned Prisma to v5.20.0.
  • Added a new meta JSON property to the Area model to store indicators, country codes, and other metadata
  • Updated the seed script to populate the meta property
  • Connected the indicator data to the area panel
  • Added country codes to the area label on the area panel

How to Test:

  • Set up the local server to use the database global-food-twin-dev-db
  • Navigate to an area page; indicators should be displayed correctly in the side panel

Known Issues:

Screen capture

Screenshot 2024-10-02 at 21 40 26

@oliverroick this is ready for review.

cc @wrynearson @faustoperez

@vgeorge vgeorge requested a review from oliverroick October 2, 2024 20:44
Copy link
Collaborator

@oliverroick oliverroick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good for the most part.

I noticed, the total population number is a bit odd, with the .0288 humans. For can round the number, if feels like this should be done at data ingest.

src/app/(home)/area/[areaId]/page.tsx Outdated Show resolved Hide resolved
src/app/components/page-section.tsx Outdated Show resolved Hide resolved
@vgeorge vgeorge requested a review from oliverroick October 15, 2024 13:39
@vgeorge
Copy link
Collaborator Author

vgeorge commented Oct 15, 2024

@oliverroick I made some updates following your feedback, this is ready for another review.

The indicators section should look like this:

Screenshot 2024-10-15 at 19 13 47

The changes introduced are:

  • Styles: indicator label is fixed at the top of the row and the indicator value is aligned vertically
  • Formatting: I borrowed a number formatting function we used in GEP to help us handle rounding and the diffence in scale of the indicators of an area. We are deviating a little from the designs but with this approach we can handle better indicators that can be counted in thousand, millions or billions
  • Types: I added a interface in the seed script for the area indicator to enhance type declarations and make it consistent with the component. It doesn't look like the ideal place to put it, we can move it elsewhere later

cc @faustoperez @wrynearson

Copy link
Collaborator

@oliverroick oliverroick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are looking good!

# Conflicts:
#	src/app/(home)/area/[areaId]/page.tsx
@vgeorge vgeorge merged commit 1037bd1 into develop Oct 17, 2024
@vgeorge vgeorge deleted the fix/areas branch October 17, 2024 05:37
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