Code Monkey home page Code Monkey logo

bridge-uof's People

Contributors

alexnisnevich avatar money avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bridge-uof's Issues

Backup/restore functionality for DB

Ideally we would perform automated backups every day just in case.

At the very least, we should backup the DB before running any migrations on prod, because migrations are a relatively untested feature and could potentially mess things up.

Bulk uploaded incidents don't create reverse relations (same for fake-generated incidents)

When incidents are bulk uploaded, the sub-models (screener, general_info, involved_civilian, involved_officer) do not have a field linking back to the incident (incident_ids) that should be there (and is there in manually created incidents). It seems that mostly this doesn't matter, but in one case it does. Since general_info's "incident_id" is delegated to its linked incident, on the review page, incident id does not show up for these incidents. To reproduce:

  1. Bulk upload test.json
  2. Go to "View" one of the incidents
  3. You'll see the incident ID is missing.
  4. If you edit the general info, you'll see that it comes back, as saving it creates the link correctly.

Sub-model objects are still created on failed bulk upload

I tried to upload an old test.json file by accident, which still had the sworn_type field for officers. The app correctly threw an error to that effect and did not create the incidents. However, under the hood, it DID create dangling screener, general_info, and involved_civilian objects.

School incident changes

If the incident has the "occured on a K-12 campus" box checked, then for every CIVILIAN, ask a mandatory multiple choice question:
"Since this incident happened on a K-12 campus, was this civilian:
( ) A student
( ) A school employee
( ) Neither"

App should fail on start if ORI setup is incomplete

Tried creating an instance, but I forgot to do steps 3 and 4 of installation:

3.
cp data/ori.csv.example data/ori.csv
4.
docker-compose build data
docker-compose run data

When I built the instance and ran it, the app splash page (for example) loaded fine. When I went to the dashboard, I got an "Ooops" page. The app's logs showed:

NameError (uninitialized constant Constants::CONTRACTING_ORIS):
  app/models/user.rb:77:in `contracting_oris'
  app/models/user.rb:81:in `allowed_oris'
  app/queries/get_all_incidents_query.rb:10:in `perform_query'
  app/queries/query.rb:6:in `run'
  app/queries/dashboard_incidents_query.rb:8:in `perform_query'
  app/queries/query.rb:6:in `run'
  app/controllers/incidents_controller.rb:155:in `set_incidents'

It took me some head scratching to figure this out. Instead, there should be an initializer function that throws a fit when the app boots, with an informative message, and the app should never start.

Copy Changes

  1. On State Submission Tab, change “When ALL of your state's incidents for 2015 are fully ready …” to “When ALL of your jurisdiction’s incidents for 2015 are fully ready …”
  2. On General Info, change “Number of officers involved” to “Number of officers involved from [agency name].”
  3. On civilian page, on "civilian arrested and/or in custody" question, change "In custody" to two options -- "In custody (W&I section 5150)" (which does NOT ask for a charge code) and "In custody (other)" (which DOES ask for a charge code).
  4. On civilian page, change "resistance" to "active resistance" on both question and hover
  5. On civ&officer pages in injury section, change "injury caused by pre-existing condition" to "medical aid received due to pre-existing condition", and hide this question if no medical aid received
  6. On officer page, change "to effect arrest" to "to effect arrest or take into custody"

Voluntary reporting items on state submission

When "submit to state" is clicked, pop up a modal (or direct to another page) with several optional questions:

  • Total number of K-9 officers in [year] that were seriously injured or killed
  • Total number of non-sworn uniformed employees or volunteers in [year] that were seriously injured or killed
  • Total number of non-sworn uniformed employees or volunteers in [year] that used force on a civilian, resulting in seriously injured or death to the civilian.

Validation of incident consistency

For example, a user can state in the screener that an officer was hurt, but then say they weren't hurt in subsequent pages.

Exactly how comprehensive this validation is and how it is to be implemented is open-ended.

Duplicate record entry

It has been determined that either thru direct entry or thru the bulk upload process it is possible to end up with duplicate records in file.
There needs to be a way to not allow this to happen.

FBI badge does not render on Review page

Probably something simple with url changes, but the little icons don't load. Console shows:

Failed to load resource: the server responded with a status of 404 (Not Found)    https://demo-ursus.bayesimpact.org/assets/fbi-bw-large.png

Maintenance mode toggle of some kind

We should try to only push changes to prod (especially ones requiring a DB migrations) during some kind of maintenance window, to prevent state from getting messed up in any way.

How this maintenance mode is implemented is pretty open-ended. There could be an environment variable for it, or a flag inside the DB itself, or a pre-configured schedule.

plural issue on /dashboard/approved

"You (or another administrator) have reviewed and approved these incidents. It will be included in your annual state submission. You may still edit and make changes if necessary."

should read "They will be included"

Regular backups

Now that we have a way to backup dynamodb (#47), we should have regular (daily?) backups of our production DB.

In the long run, it would also be good to port the backup/restore code from the iPython notebook into rake tasks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.