Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Add Closure to CSV Download #1249

Merged
merged 1 commit into from Feb 18, 2021
Merged

Add Closure to CSV Download #1249

merged 1 commit into from Feb 18, 2021

Conversation

TaiWilkin
Copy link
Contributor

Overview

Add the facility closure status to the CSV downloads in the case that
the report_a_facility switch is on.

Connects #1248

Demo

Screen Shot 2021-02-17 at 3 10 53 PM

Testing Instructions

  • Run ./scripts/server
  • Turn off the Reports switch and download the facilities CSV
    • It should not have an 'is_closed' column
  • Turn on the Reports switch and download the facilities CSV
    • It should have an 'is_closed' column with appropriate data

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

Copy link
Contributor

@jwalgran jwalgran left a comment

Choose a reason for hiding this comment

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

Nice, clear, correct implementation. I like seeing a new JS test.

While this does match the spec of the feature as listed in the issue, when I take a look at the CSV after closing a facility and reopening one I see an opportunity to make this a little friendlier to less technical users

Screen Shot 2021-02-17 at 8 14 05 PM

An alternate formatting I came up with is to output the string "CLOSED" in the is_closed column if Facility.is_closed is True, otherwise leave the column blank. This reduces the number of possible states from 3 to 2 and avoids some of the "double negativeness" of having True representing closed. I'm interested in what you think about this alternate formatting, if you have another suggestion, or think it is more appropriate to keep it as is currently implemented.

@@ -38,6 +38,7 @@ export function logDownload() {

const vectorTileFlagIsActive = get(featureFlags, 'flags.vector_tile', false);
const ppeIsActive = get(featureFlags, 'flags.ppe', false);
const reportsAreActive = get(featureFlags, 'flags.report_a_facility', false);
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Nice integration with our new switch

Base automatically changed from tw/add-report-waffle-switch to develop February 18, 2021 14:40
@TaiWilkin
Copy link
Contributor Author

I agree that 'CLOSED' is going to be clearer for non-technical users. I've updated the code to use 'CLOSED' when True and otherwise display nothing, and updated the test to check for handling both True and False.

Add the facility closure status to the CSV downloads in the case that
the report_a_facility switch is on.
@TaiWilkin TaiWilkin merged commit 889a8ad into develop Feb 18, 2021
@TaiWilkin TaiWilkin deleted the tw/add-is-closed-csv branch February 18, 2021 17:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants