cityofaustin / atd-mobile-signals-work-orders

Mobile Signals Work Orders app using React UI with Knack API
https://mobile-signals.austintexas.io
Other
3 stars 1 forks source link

Redirect to work order view upon successfully adding a new inventory item or edit existing item #247

Closed mddilley closed 4 years ago

mddilley commented 4 years ago

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

This PR addresses the problem of users not being redirected to the Work Order Details view after adding or editing an inventory item. In order to solve this, I changed the views render to keep all inventory item transactions within the accordion on the Work Order Details view. The view that renders within the accordion tab is now controlled by state in the WorkOrderDetails component. After completing the add or edit form, the view rendered is switched back to the inventory table and data is refetched to update the records in the view.

This also address the issue with users not returning to the Work Order Details view with the same accordion open that was open when they initiated an item add or edit. Since all transactions are handled in the Work Orders view, the accordion never closes during view the table, adding items, or editing items.

I added cancel buttons to the "Add" and "Edit" forms so that the user isn't trapped in these views, and I also updated the "Cancel" confirmation "Yes" and "No" buttons to take half of the width of the view each.

Add form in accordion

Screen Shot 2020-01-27 at 2 18 11 PM

Edit form in accordion

Screen Shot 2020-01-27 at 2 19 08 PM

New cancel confirmation button widths

Screen Shot 2020-01-27 at 1 50 42 PM