<commit_before>const KolibriModule = require('kolibri_module');
const coreActions = require('kolibri.coreVue.vuex.actions');
const router = require('kolibri.coreVue.router');

const Vue = require('kolibri.lib.vue');

const RootVue = require('./views');
const actions = require('./state/actions/main');
const groupActions = require('./state/actions/group');
const reportsActions = require('./state/actions/reports');
const store = require('./state/store');
const PageNames = require('./constants').PageNames;

/*
const REPORTS_URL_PATTERN = [
  ':view_by_content_or_learners',
  ':channel_id',
  ':content_scope',
  ':content_scope_id',
  ':user_scope',
  ':user_scope_id',
  ':sort_column',
  ':sort_order',
].join('/');
*/

class CoachToolsModule extends KolibriModule {
  ready() {
    coreActions.getCurrentSession(store).then(() => {
      const routes = [
        {
          name: PageNames.CLASS_LIST,
          path: '/',
          handler: (toRoute, fromRoute) => {
            actions.showClassListPage(store);
          },
        },
        {
          name: PageNames.RECENT,
          path: '/:class_id/recent/:channel_id?',
          handler: (toRoute, fromRoute) => {
            reportsActions.showRecent(
              store,
              toRoute.params.class_id,
              toRoute.params.channel_id
            );
          },
        },
        {
          name: PageNames.TOPICS,
          // path: `/:class_id/topics/${REPORTS_URL_PATTERN}`,
          path: `/:class_id/topics`,
          handler: (toRoute, fromRoute) => {
            reportsActions.showTopics(store, toRoute.params);
          },
        },
        {
          name: PageNames.EXAMS,
          path: '/:class_id/exams',<commit_msg>Updating core store with channel list on coach plugin load<commit_after>const KolibriModule = require('kolibri_module');
const coreActions = require('kolibri.coreVue.vuex.actions');
const router = require('kolibri.coreVue.router');

const Vue = require('kolibri.lib.vue');

const RootVue = require('./views');
const actions = require('./state/actions/main');
const groupActions = require('./state/actions/group');
const reportsActions = require('./state/actions/reports');
const store = require('./state/store');
const PageNames = require('./constants').PageNames;

/*
const REPORTS_URL_PATTERN = [
  ':view_by_content_or_learners',
  ':channel_id',
  ':content_scope',
  ':content_scope_id',
  ':user_scope',
  ':user_scope_id',
  ':sort_column',
  ':sort_order',
].join('/');
*/

class CoachToolsModule extends KolibriModule {
  ready() {
    const coreStoreUpdates = [
      coreActions.getCurrentSession(store),
      coreActions.setChannelInfo,
    ];
    Promise.all(coreStoreUpdates).then(() => {
      const routes = [
        {
          name: PageNames.CLASS_LIST,
          path: '/',
          handler: (toRoute, fromRoute) => {
            actions.showClassListPage(store);
          },
        },
        {
          name: PageNames.RECENT,
          path: '/:class_id/recent/:channel_id?',
          handler: (toRoute, fromRoute) => {
            reportsActions.showRecent(
              store,
              toRoute.params.class_id,
              toRoute.params.channel_id
            );
          },
        },
        {
          name: PageNames.TOPICS,
          // path: `/:class_id/topics/${REPORTS_URL_PATTERN}`,
          path: `/:class_id/topics`,
          handler: (toRoute, fromRoute) => {
            reportsActions.showTopics(store, toRoute.params);
          },
        },
        {
          name: PageNames.EXAMS,
          path: '/:class_id/exams',
{'fraction_non_alphanumeric': 0.14855875831485588, 'fraction_numerical': 0.0, 'mean_word_length': 2.433872502378687, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2964247', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1096, 'n_words': 176}