-
Notifications
You must be signed in to change notification settings - Fork 355
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
Import custom case counts #381
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/covid19-scenarios/covid19-scenarios/4bb7fa4tf |
Thanks @whiver. this doesn't seem to work atm for me, but the general direction is good I think. The main aim of the feature will be to allow individuals hospitals, counties, cities etc to upload their own case counts. It is therefore not so much the simulation output that we want to upload again, but custom case counts (the dots on the graph). The format of the files should be like those that we download though. |
Thanks for the confirmation :) |
Hi @rneher, @ivan-aksamentov , I now have a first working version! I got a couple of questions too:
I wanted to make sure that I was heading to the right direction. Thanks in advance for the feedback :) |
Codecov Report
@@ Coverage Diff @@
## master #381 +/- ##
==========================================
- Coverage 25.91% 24.61% -1.31%
==========================================
Files 120 127 +7
Lines 2616 2759 +143
Branches 370 391 +21
==========================================
+ Hits 678 679 +1
- Misses 1938 2080 +142
|
@nnoll I updated the PR to move the import button to the population section. The UI is not awesome, but tweaking this part involves creating a custom form field, so I'd prefer to improve the design in a separate PR, except if you think it's really needed. I updated the import schema to follow existing cases data files from the data folder. You can test importing for example I still need to find out why on the environment deployed by Now, when you import a file in the popup, its name/size are missing (it displays (NaNKb)), while in local env it works correctly. I would also add an explanation in the import popup about the expected import format. Feel free to test and tell me what you think! 😃 |
@whiver If you rebase on (or merge) master, with #591 you should be able to debug the production deployments in Chromium-based browsers as follows:
Don't hesitate to commit with |
Thanks @ivan-aksamentov, I fixed the issue in prod. I don't exactly understand why, but It should be working now, tell me what do you think of it :) |
Code Climate has analyzed commit 20ceb74 and detected 0 issues on this pull request. View more on Code Climate. |
@whiver Hi William Sorry for the delay. Have been busy on other stuff. |
Related issues and PRs
Description
The goal is to allow the user to import a custom data file instead of the predefined data in the "Confirmed cases" field.
This allows to compare simulated data with real world ones, specific to each organization.
Impacted Areas in the application
Mainly the population card, where the "confirmed cases" dropdown now has a button to display the import popup.
The imported file is stored in the sessionStorage for now to avoid keeping the whole file in the state, and to keep the file between subsequent page refresh, without keeping it forever.
Testing
Create a tsv file with these values for example:
4/24/2020 100 10 50 5 15