Previously, we would inadvertently sort the apiaries in place, causing their order in the redux state to be different. This interfered with the marker assignment for new apiaries, a function that assumes that the list in redux state is sorted by the default order.
Since changing the ordering of the redux state was inadvertent, this is now fixed by making a deep copy and sorting that when a non-default sort order is specified.
Also fixes a small issue where the Header component's prop type check would fail because isStaff was undefined for non-logged-in users.
Connects #437
Demo
Notes
The third commit 69bab1e basically wipes out the first two, so they could've been dropped, but I've preserved them to show the process of thought.
Testing Instructions
Check out this branch
Add a few apiaries. Change the sort order so that the last one in the default sort is not at the bottom.
Add a new apiary. Ensure that it is assigned the correct marker.
Delete an apiary. Ensure the correct one is removed.
Overview
Previously, we would inadvertently sort the apiaries in place, causing their order in the redux state to be different. This interfered with the marker assignment for new apiaries, a function that assumes that the list in redux state is sorted by the default order.
Since changing the ordering of the redux state was inadvertent, this is now fixed by making a deep copy and sorting that when a non-default sort order is specified.
Also fixes a small issue where the Header component's prop type check would fail because
isStaff
wasundefined
for non-logged-in users.Connects #437
Demo
Notes
The third commit 69bab1e basically wipes out the first two, so they could've been dropped, but I've preserved them to show the process of thought.
Testing Instructions