cityofaustin / atd-moped

A comprehensive mobility project tracking platform for Austin, Texas.
https://mobility.austin.gov/moped/
4 stars 3 forks source link

Fix work types not showing as options with Project Extent - Generic #1423

Closed mddilley closed 1 month ago

mddilley commented 1 month ago

Associated issues

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

This PR patches a small bug where we fell into the JS truthiness trap. 🪤 A 0 id was being evaluated as false and prevented the UI from displaying work types associated with the Project Extent - Generic component.

Testing

URL to test:

https://deploy-preview-1423--atd-moped-main.netlify.app/ or local

Steps to test:

  1. Create a new component and choose the Project Extent - Generic component type
  2. Try to select a work type and you should see three options - New, Maintenance / Repair, and Modification
  3. Try the same in staging and you should see that no options show up in the work type dropdown
  4. Create/update a component like Bike Lane - Buffered that has subcomponents to make sure they still work as expected too

Ship list

mddilley commented 1 month ago

Added the version bump in here so it makes its way into main. Merging!

@johnclary I agree that would be some good tech debt to address someday and remove the yuckiness. We have a few other lookup tables where we inserted 0 ids through migrations long ago too. Just added to my list of issues to create. 🙏