vkoves / electrify-chicago

Learn about Chicago's most polluting buildings, and what they can do to clean up their act!
http://electrifychicago.net
9 stars 5 forks source link

Fix Buildings With Old Stats (like United Center) Not Rendering #59

Closed alexkcode closed 7 months ago

alexkcode commented 7 months ago

Description

This adds conditions to StatTile component to fix the issue where Vue was trying to render statistics like the median Greenhouse Gas Intensity but did not have the data to actually do the computation. Instead of computing those statistics, it will check whether the relevant building data is actually available for the computation.

Fixes issue #53.

Testing Instructions

To test the case where the render was throwing issues initially, check the United Center page (building/united-airlines-reservation-center/) or the Art Institute of Chicago page (building/the-art-institute-of-chicago/), which is a different year but has data to compute medians. Any other building page should show all the median and ranking statistics underneath the various numbers for usage.

Checklist:

*I don't think I saw any explicit style guidelines but maybe there's JS/TS/Vue style guidelines that apply

netlify[bot] commented 7 months ago

Deploy Preview for radiant-cucurucho-d09bae ready!

Name Link
Latest commit 319c60ab16b3efe9e06912723ab5b431162afab3
Latest deploy log https://app.netlify.com/sites/radiant-cucurucho-d09bae/deploys/6566a26ac91d1b0008a09609
Deploy Preview https://deploy-preview-59--radiant-cucurucho-d09bae.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.

vkoves commented 7 months ago
  1. Associate this with the GitHub issue (say in the description "Resolves #X" which will auto close the issue)
  2. Provide testing instructions