learningequality / kolibri

Kolibri Learning Platform: the offline app for universal education
https://learningequality.org/kolibri/
MIT License
810 stars 684 forks source link

Coach Quiz Side Panels need refactoring #12840

Open nucleogenesis opened 1 week ago

nucleogenesis commented 1 week ago

Overview

In Quiz Creation there is a SectionSidePanel component which wraps a SidePanelModal around the <router-view /> into which the "side panel components" render. This results in clobbering our ability to handle each route individually and complicates routing by putting the onus for some routing decisions on that SectionSidePanel component.

Description and outcomes

We should instead simply leverage VueRouter and it's guards and keep the logic of "where do I go and why" up to the individual "side panel components" (ie, ResourceSelection, ReplaceQuestions, SectionEditor, etc).

By removing SectionSidePanel each of those components then can render as a SidePanelModal themselves. Then, the <router-view /> where those components render can live in the CreateExamPage/index component.

Then these components can be shown/hidden depending on whether or not the user is on a "side panel" route or not -- in this case, the only non-side-panel route is the EXAM_CREATION_ROOT page component. If we opted to have others, then this display logic can be updated more easily than it is currently.

Acceptance criteria