When an observer switches students on the classic dashboard, we let
the planner know by calling `reloadPlannerForObserver` (from
DashboardHeader.js). The planner handles saving the new state
internally and makes requests to get new data. We don't need to call
`loadPlannerDashboard` after a switch (unless it hasn't been loaded
yet) since this will cause duplicate requests; in this case, the
first request didn't yet contain the correct context code data for the
selected student and was resulting in 401s.
Additionally, clear the loading state when resetting for a new observee;
this could contain bookmarks to fetch more items that are only
applicable to the previous observee.
closes LS-3213
flag = observer_picker
Test plan:
- Enable observer_picker flag
- Visit dashboard (planner view) as an observer with at least 2
students, each of which is enrolled in different courses
- Switch from one student to another in the picker
- Expect everything to load smoothly
- Make sure the planner still works for students in classic and k5
mode
Change-Id: I0e1c7fe0213558863b357be5f0f47c38fad9bf83
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293565
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Ed Schiebel <eschiebel@instructure.com>
QA-Review: Ed Schiebel <eschiebel@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>