diff --git a/kolibri/plugins/coach/assets/src/app.js b/kolibri/plugins/coach/assets/src/app.js index b571a335502..8eaf764fbb7 100644 --- a/kolibri/plugins/coach/assets/src/app.js +++ b/kolibri/plugins/coach/assets/src/app.js @@ -10,6 +10,9 @@ import routes from './routes'; import pluginModule from './modules/pluginModule'; import { LessonsPageNames } from './constants/lessonsConstants'; import LessonEditDetailsPage from './views/plan/LessonEditDetailsPage'; +import GroupsPage from './views/plan/GroupsPage'; +import GroupMembersPage from './views/plan/GroupMembersPage'; +import GroupEnrollPage from './views/plan/GroupEnrollPage'; class CoachToolsModule extends KolibriApp { get stateSetters() { @@ -74,6 +77,9 @@ class CoachToolsModule extends KolibriApp { LessonsPageNames.LESSON_SELECTION_BOOKMARKS_MAIN, LessonsPageNames.SELECTION_CONTENT_PREVIEW, LessonsPageNames.RESOURCE_CONTENT_PREVIEW, + GroupsPage.name, + GroupMembersPage.name, + GroupEnrollPage.name, ].includes(to.name) ) { next(); diff --git a/kolibri/plugins/coach/assets/src/composables/useGroups.js b/kolibri/plugins/coach/assets/src/composables/useGroups.js index a8b863a3cb1..b382325b9fd 100644 --- a/kolibri/plugins/coach/assets/src/composables/useGroups.js +++ b/kolibri/plugins/coach/assets/src/composables/useGroups.js @@ -10,9 +10,14 @@ export function useGroups() { groupsAreLoading.value = loading; } - function showGroupsPage(store, classId) { - // On this page, handle loading state locally - // TODO: Open follow-up so that we don't need to do this + async function showGroupsPage(store, classId) { + const initClassInfoPromise = store.dispatch('initClassInfo', classId); + const getFacilitiesPromise = + store.getters.isSuperuser && store.state.core.facilities.length === 0 + ? store.dispatch('getFacilities').catch(() => {}) + : Promise.resolve(); + + await Promise.all([initClassInfoPromise, getFacilitiesPromise]); store.dispatch('notLoading'); setGroupsLoading(true);