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

Feature/f 52 current food consumption country view #48

Merged
merged 23 commits into from
Nov 22, 2024

Conversation

bohdangarchu
Copy link
Collaborator

Copy link

netlify bot commented Nov 20, 2024

Deploy Preview for wfp-hungermap ready!

Name Link
🔨 Latest commit 4d1acf0
🔍 Latest deploy log https://app.netlify.com/sites/wfp-hungermap/deploys/674093782437cb00089789ee
😎 Deploy Preview https://deploy-preview-48--wfp-hungermap.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@marinovl7 marinovl7 left a comment

Choose a reason for hiding this comment

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

LGTM! Some functionality feedback still to come + some code style issues, but just a few. Generally I noticed a bug where if I click on egypt then Lybia then Egypt again there are no tooltips shown instead when I click on a region the loading animation is shown in the accordion. Also if we have alerts activated we should deactivate them, so not only the active map layer, but also the alerts.

Small note, selectCountryId could be reworked in the future.

Comment on lines 12 to 13
const deltaOneMonth = countryData?.fcsMinus1 ? countryData.fcs - countryData.fcsMinus1 : undefined;
const deltaThreeMonth = countryData?.fcsMinus3 ? countryData.fcs - countryData.fcsMinus3 : undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

useMemo here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

can we avoid using useMemo for simple number subtraction?

src/components/Map/FcsChoropleth.tsx Outdated Show resolved Hide resolved
src/components/Map/FcsRegionTooltip.tsx Outdated Show resolved Hide resolved
src/components/Map/Map.tsx Outdated Show resolved Hide resolved
src/components/Map/Map.tsx Outdated Show resolved Hide resolved
@bohdangarchu
Copy link
Collaborator Author

New changes:

  • fix code style issues
  • fix bug with going back from country to country
  • deactivate alerts and current map layer - @Tschonti I created a new context for map visibility, please check
  • deactivate country view and reactivate current map layer on zoom out
  • display a corresponding text in accordion when no data is available

@bohdangarchu
Copy link
Collaborator Author

hmm I still see the bug with going back from country to country in the preview, although locally everything works... not sure why this can happen but I'll look into it

@Tschonti
Copy link
Collaborator

the context looks good to me, a few questions/findings:

  • there's no hover animation on the countries, regions in this version, though this might be because of an older master, there were a few changes with the mapbox map recently
  • on a few countries (for example Niger), there's no popover, is that intentional? Is the data missing there?

@bohdangarchu
Copy link
Collaborator Author

hmm I still see the bug with going back from country to country in the preview, although locally everything works... not sure why this can happen but I'll look into it

should be fixed now

@bohdangarchu
Copy link
Collaborator Author

  • there's no hover animation on the countries, regions in this version, though this might be because of an older master, there were a few changes with the mapbox map recently

should be fixed now

  • on a few countries (for example Niger), there's no popover, is that intentional? Is the data missing there?

should be also fixed now, I filter out countries without fcs data

Comment on lines +50 to +53
countries.features
.filter((countryData) => countryData.properties.interactive)
.filter((countryData) => countryData.properties.fcs !== null)
.map((countryData) => (
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe not the scope of this task, but we should use this condition on the global map to display countries as interactive or disabled. Maybe we could look into whether we can change which countries are clickable on each map, because I assume it will be different on the IPC map for example

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, we could do this as a separate task, once for all map types. Here is the link

@Tschonti
Copy link
Collaborator

oh and please merge main again to resolve the conflicts

@marinovl7 marinovl7 merged commit 77c36d3 into main Nov 22, 2024
5 checks passed
@marinovl7 marinovl7 deleted the feature/f-52-current-food-consumption-country-view branch November 22, 2024 14:29
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.

3 participants