cityofaustin / atd-vz-data

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

Multiple NO DATA options in Body Style edit drop down #1435

Closed roseeichelmann closed 4 months ago

roseeichelmann commented 5 months ago

Associated issues

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

Realized that the real weirdness here is that we had added a custom lookup value to atd_txdot__veh_body_styl_lkp at some point with id = -1 and desc = 'NO DATA'. (I'm positive its a custom value, i checked and double checked the extracts and it was the only one without eff beg and end dates) This is confusing bc for the rest of the Related Records table 'NO DATA' on the front end means null on the back end. I removed this custom lookup value and created a permanent NO DATA option on all the editable drop down fields which just maps to null so users can null out any values. I think this makes the most sense as a fix, it seems like we were trying to create a custom lookup value that means null instead of just using null.

Testing

URL to test: Local

Steps to test:

  1. Check out this branch locally, apply the up migration.
  2. Start up VZE, go to a crash and observe that now all of the editable fields in the Related Records table have a NO DATA option which really just means null in the database. Also observe that if you select NO DATA for body style and click on the edit tool again, you wont see two NO DATA options in the drop down anymore.
  3. Test selecting the NO DATA option for all the diff values in the related records table and double check in the database that the value is null
  4. Test down migration

Ship list

johnclary commented 4 months ago

if any other parts of the app are ill-equipped to handle a null in some of these related record columns. I don't think so because I nulled out everything possible, but I wanted to say it out loud.

thanks @mddilley — i also tested this and double-checked the column definitions and i also think we're good.

roseeichelmann commented 4 months ago

@johnclary yeah definitely will need to revisit this with the new data model, and i agree something like this could provide the functionality to nullify the vze edit and "revert" to a cris value.