kolibri
kolibri copied to clipboard
Lesson Resource Preview page action button is "Add" when resource is already in Lesson
Observed behavior
"Pim's Mother" video is already in the Lesson:

But when you look into the preview, the action button says "Add"

And clicking the "button" seems to re-add the the resource to the Lesson. Because unselecting it via checkbox will say something like "Removed 3 resources" if you e.g. clicked "Add" twice.
cc @MisRob if you have any insights on what's causing this.
Expected behavior
- If resource is in lesson, then the button in the preview says "Remove" and causes a remove action when clicked.
User-facing consequences
Errors and logs
…
Steps to reproduce
- Add a resource to a lesson
- Go to that resources' preview in the Manage Resources workflow
- See the wrong button ("Add") on the top corner
Context
0.14.1
The is another issue because of this bug. When you reload the preview page, the correct remove button shows up and then if you go back to the list, nothing shows up.

The above pull request fixes that also.