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 142 comparison portal #135

Merged

Conversation

bohdangarchu
Copy link
Collaborator

@bohdangarchu bohdangarchu commented Dec 14, 2024

Comparison Portal

Features

  • country selection query parameters
  • error handling using snackbar
  • error handling for individual charts
  • fixed linechart - didn't react on input data change
  • hooks for multiple queries
  • fixed some type definitions

To-Do

  • button to reset selection
  • initially remove disabled countries from selection
  • disable country after error
  • transparent charts
  • increase chart height - will be done in f-183

Issues

Copy link

netlify bot commented Dec 14, 2024

Deploy Preview for wfp-hungermap ready!

Name Link
🔨 Latest commit 6df6f8a
🔍 Latest deploy log https://app.netlify.com/sites/wfp-hungermap/deploys/67608dda7ded4d0008589167
😎 Deploy Preview https://deploy-preview-135--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.

Awesome functionality job! Just few small things needd to be changed! Great job overall!

src/app/comparison-portal/layout.tsx Show resolved Hide resolved
src/app/comparison-portal/layout.tsx Outdated Show resolved Hide resolved
src/app/comparison-portal/page.tsx Outdated Show resolved Hide resolved
src/app/comparison-portal/page.tsx Show resolved Hide resolved
src/components/ComparisonPortal/NoDataHint.tsx Outdated Show resolved Hide resolved
@Tschonti
Copy link
Collaborator

@Tschonti pls check added hooks

hooks LGTM, nice work

some things I noticed:

  • some graphs (especially bar charts) only have 0 and 1 as labels on the X-axis
  • maybe we could remove the disabled countries from the selection, it's hard to find a selectable country this way
  • maybe there could be a button to deselect all the countries quickly
  • when there's an error while fetching the data for a country, we should deselect it
  • if you select a country, get an error, deselect it, then select it again, you don't get the error again. I know this happens because of the caching of useQuery, but still a bit weird for the user. Not sure what can be done about this, maybe disable the country after it had an error before????

@bohdangarchu
Copy link
Collaborator Author

  • some graphs (especially bar charts) only have 0 and 1 as labels on the X-axis

This will change when we integrate bar chart.

  • maybe we could remove the disabled countries from the selection, it's hard to find a selectable country this way

True, @marinovl7 what do you think?

  • maybe there could be a button to deselect all the countries quickly

Good idea, will look into that

  • when there's an error while fetching the data for a country, we should deselect it

Good catch

  • if you select a country, get an error, deselect it, then select it again, you don't get the error again. I know this happens because of the caching of useQuery, but still a bit weird for the user. Not sure what can be done about this, maybe disable the country after it had an error before????

Yes, good idea

@bohdangarchu
Copy link
Collaborator Author

@Tschonti we added all features discussed above and also a hook (useSelectedCountries) that syncs selected countries and query params. @marinovl7 your comments are fixed as well

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.

@bohdangarchu @jschoedl crazy feature! Thanks a lot for the perfect implementation! The customers will love it and request additional comparison possibilities. Thanks for also thinking about the query params! This way we could send links to the direct comparison of some countries. Awesome!

@marinovl7 marinovl7 merged commit 0689a93 into main Dec 18, 2024
5 checks passed
@marinovl7 marinovl7 deleted the feature/f-143-comparison-of-multiple-countries-for-fcs-until branch December 18, 2024 14: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.

6 participants