cityofaustin / atd-vz-data

The technology that powers the City of Austin's Vision Zero program
https://visionzero.austin.gov/viewer/
11 stars 2 forks source link

Ability to create temporary crashes in the new data model #1484

Closed roseeichelmann closed 3 weeks ago

roseeichelmann commented 1 month ago

Associated issues

Closes https://github.com/cityofaustin/atd-data-tech/issues/18039

Testing

URL to test: Local

Steps to test:

  1. Check out this branch and follow instructions in https://github.com/cityofaustin/atd-vz-data/pull/1440 to start the data model, apply migrations and run the CRIS import script
  2. Go to the create temp crash page under Tools in the sidebar
  3. Note that we now have a crash timestamp field and the address fields auto capitalize your input
  4. Test adding temp crashes with various combos of units and fatalities/injuries
  5. When your temp crash is successfully created, a banner will pop up at the top with a link to it
  6. Temp crashes will have a record_locator value of T<id> normal crashes will have a record_locator value of just their <id>
  7. This new record_locator field is what is now used for routing
  8. In the URL if ur lazy like me u dont need to uppercase the "T", the id will be converted to upper case before querying the database so "http://localhost:3000/#/crashes/t32449" for example will work
  9. Test going to the temp records crash details page, editing the units, people, etc. Make sure everything is working

Ship list

roseeichelmann commented 1 month ago

@johnclary thanks for your super helpful feedback, i think i addressed all of it except for the re-routing thing which im still happy to do if you think thats better than the green banner at the top that we currently have

johnclary commented 1 month ago

after discussion with Rose, i moved the alert banners to the bottom of the form 👍

chiaberry commented 1 month ago

I'm running into issues trying to delete a temp record

{
    "errors": [
        {
            "message": "invalid input syntax for type integer: \"T3\"",
            "extensions": {
                "path": "$",
                "code": "data-exception"
            }
        }
    ]
}

Also the "updated at" in this table doesn't seem to reflect when the record was updated, but rather when it was created.

Screenshot 2024-07-23 at 10 21 06 AM

I was trying different ways to break the form and I can input negative fatalities and serious injuries (you can in vze prod now too, well at least in staging) but the good news is in this new data model version, the fatalities cards at the top wont show negative numbers while in staging....

Screenshot 2024-07-23 at 10 23 19 AM
johnclary commented 3 weeks ago

i am merging this into the collector so that i can start resolving conflicts with this and the cris import family tree