The multiselect live_component was refactored to handle its own state (as suggested in the docs) which ended up cleaning the code of the Insights liveview (that had many handle_info callbacks and private functions to manage the multiselect interaction).
The muliselect now shows the selected options, and allows the user to remove any selected option by pressing the "X".
The router was improved to avoid passing through the page_controller and then rendering the liveview. Now we directly mount the Insights liveview. (some comments were left a long time ago about this in the router).
Other bugs found and fixed
Multiselect filter persistence
When some sections were filtered in the multiselect and then the resource criteria (by activity, by page or by objectives) was changed, those filtered sections weren't correctly being used to filter the results (they were ignored)
Other notes
With the current implementation, only resources of the current project will be shown while combining the filter options in the Insights page.
For example, imagine an instructor creates an "Elixir 2.0" course from the corresponding Elixir project and then remixes its content to add a page, let's say, the "Learn how to sum" page that belongs to the Maths project. In this case, when the author visits the Elixir project Insights, all the metrics corresponding to the attempts made in the "Learn how to sum" page from that "Elixir 2.0" course will NOT be shown there, since this insights page is supposed to show metrics about the Elixir project.
On the other hand, if the author visits the Maths project Insights, then metrics about how that "Learn how to sum" page will be taken into account since that page belongs to the current project (although it was added to an Elixir course)
This PR finishes the work done in a series of PRs (PR1, PR2, PR3, PR4), by fixing the latest bugs reported in the ticket
Before
https://github.com/Simon-Initiative/oli-torus/assets/74839302/1a92b036-0c15-49eb-901a-04897ed7383f
After
https://github.com/Simon-Initiative/oli-torus/assets/74839302/eb779bc2-ab97-49ee-bf43-c0f0a09d5174
Other Improvements
live_component
was refactored to handle its own state (as suggested in the docs) which ended up cleaning the code of the Insights liveview (that had many handle_info callbacks and private functions to manage the multiselect interaction).Other bugs found and fixed
Multiselect filter persistence
When some sections were filtered in the multiselect and then the resource criteria (by activity, by page or by objectives) was changed, those filtered sections weren't correctly being used to filter the results (they were ignored)
Other notes
With the current implementation, only resources of the current project will be shown while combining the filter options in the Insights page. For example, imagine an instructor creates an "Elixir 2.0" course from the corresponding Elixir project and then remixes its content to add a page, let's say, the "Learn how to sum" page that belongs to the Maths project. In this case, when the author visits the Elixir project Insights, all the metrics corresponding to the attempts made in the "Learn how to sum" page from that "Elixir 2.0" course will NOT be shown there, since this insights page is supposed to show metrics about the Elixir project. On the other hand, if the author visits the Maths project Insights, then metrics about how that "Learn how to sum" page will be taken into account since that page belongs to the current project (although it was added to an Elixir course)
https://github.com/Simon-Initiative/oli-torus/assets/74839302/975c3f9e-b309-4ca4-a46f-a7eb3dc71ac0