Recidiviz / justice-counts-components

A set of React components powering a web app for exploring centralized, standardized metrics on the performance of justice systems across the United States
GNU General Public License v3.0
1 stars 0 forks source link

[Corrections] Handle no data for state #60

Closed colincadams closed 3 years ago

colincadams commented 3 years ago

Describe the bug

There are two states that we don't expect there to be data for at least in the near term, UT and WY. We should handle this case.

To Reproduce Steps to reproduce the behavior:

  1. Set stateCode to US_WY
  2. Observe 'undefined' and 'Infinity' throughout

Expected behavior

@hobuobi to define.

Most of the components handle no data gracefully, but when there is no data at all for a state then we can't define the default time range (e.g. November 2020 -- compared to November 2019). The easiest thing is likely to come up with alternative text for each place that this is displayed.

Alternatively, we could have a separate treatment for the whole page, e.g. no public data sources were found for [state].

Screenshots

Screen Shot 2021-02-12 at 10 43 27 AM

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

hobuobi commented 3 years ago

Behavior should be as shown below! Suppress all components other than the header and description, and replace the description text with the following:

No data was publicly available for this state. If you are a representative of this state and would like to contribute your data to this site, please contact us.

Webpage (1)

colincadams commented 3 years ago

@hobuobi it looks like the "Stay In Touch" page only allows you to subscribe. Probably fine as a placeholder for now, but eventually should we replace this link?

colincadams commented 3 years ago

@Wmaileq I think we can proceed with the link as is for now, and look at replacing it in the future