The resource isn't added to the lesson on the preview page after clicking on the "Add" button
Environment; Raspberry Pi 3B+ OS: Kolibri 0.14.3 tested on Mac mini (Mid 2011) macOS Sierra v 10.12.6 Browser: Google Chrome latest
Severity; critical
Preconditions; user is logged in as a coach, Class home page is opened; at least one lesson is created
Steps to reproduce;
- Proceed to the Reports>Lessons page
- Click on any lesson
- Click on the "Options" dropdown
- Click on the "Manage Resources" button
- Proceed to the preview page for the selected resource
- Click on the "Add" button
- Come back to the previous page
- Pay attention to the item which you added from the preview page
Actual result: The resource isn't added to the lesson on the preview page after clicking on the "Add" button Expected result: The resource should be added to the lesson on the preview page after clicking on the "Add" button
Attachment: http://e.pc.cd/pFbotalK
I had to update the OP, because a critical detail was inaccurate. I believe that when entering into this workflow from Plan > Lessons, things have been fixed recently. However, when entering into the workflow from Reports > Lessons (as in the attached video), adding a resource from the preview fails.
See this resource as an example.
Clicking "Add" does now does not navigate away from the page and you see this error in the console.
Uncaught (in promise) TypeError: Cannot read property '_normalized' of null
at normalizeLocation (vue-router.esm.js:967)
at Object.match (vue-router.esm.js:1489)
at VueRouter.match (vue-router.esm.js:2828)
at HashHistory.History.transitionTo (vue-router.esm.js:2124)
at HashHistory.push (vue-router.esm.js:2595)
at vue-router.esm.js:2913
at new Promise (<anonymous>)
at VueRouter.push (vue-router.esm.js:2912)
at Sub.handleAddResource (PlanLessonSelectionContentPreview.vue:98)
at invokeWithErrorHandling (vue.runtime.esm.js:1854)
at Sub.invoker (vue.runtime.esm.js:2179)
at invokeWithErrorHandling (vue.runtime.esm.js:1854)
at Sub.Vue.$emit (vue.runtime.esm.js:3888)
at Sub.addResource (index.vue:207)
at invokeWithErrorHandling (vue.runtime.esm.js:1854)
at Sub.invoker (vue.runtime.esm.js:2179)
at invokeWithErrorHandling (vue.runtime.esm.js:1854)
at Sub.Vue.$emit (vue.runtime.esm.js:3888)
at Sub.handleClick (KButton.vue:142)
at invokeWithErrorHandling (vue.runtime.esm.js:1854)
at HTMLButtonElement.invoker (vue.runtime.esm.js:2179)
at HTMLButtonElement.original._wrapper (vue.runtime.esm.js:6917)
at HTMLButtonElement.sentryWrapped (helpers.js:70)
The traceback points to PlanLessonSelectionContentPreview.vue:98 where a computed prop returnBackRoute is null

@jonboiser This still exists if you go from the Reports > Lessons > Learners tab and you press Manage Resources then you get ?last=ReportsLessonLearnerListPage. I think you should add a check for that also. :)
@alexMet Thanks for pointing that out. So I think I need to add another line to my hack in 255149d to handle that page.