Aldaviva / floorplan

🗺️ Floorplan, seating chart, and employee directory for Blue Jeans.
167 stars 58 forks source link

Cannot add first person to database due to sorted element insertion logic not handling empty collection #36

Closed Aldaviva closed 7 years ago

Aldaviva commented 7 years ago

When you save your first person, the list of people on the left tries to add a row for them. However the row insertion logic relies on there already being an existing person row in that list so it can insert the new person either before or after them. When the collection only contains one item, the new person you are trying to insert, there is no existing person to use while inserting, so the DOM insertion fails and the API call to persist the new person is never sent.

Aldaviva commented 7 years ago

Added special case for inserting person row when it's the only row in the list.