Skip to content

Commit

Permalink
Merge pull request #12700 from rtibbles/renderer_suffix
Browse files Browse the repository at this point in the history
Move renderer suffix into core constants.
  • Loading branch information
rtibbles authored Oct 7, 2024
2 parents d9112f6 + 416cb49 commit a760dee
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions kolibri/core/assets/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,5 @@ export const Presets = Object.freeze({
export const MAX_QUESTIONS_PER_QUIZ_SECTION = 25;

export const DisconnectionErrorCodes = [0, 502, 504, 511];

export const RENDERER_SUFFIX = '_renderer';
2 changes: 1 addition & 1 deletion kolibri/core/assets/src/core-app/pluginMediator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue';
import scriptLoader from 'kolibri-common//utils/scriptLoader';
import { RENDERER_SUFFIX } from '../views/ContentRenderer/constants';
import { RENDERER_SUFFIX } from 'kolibri.coreVue.vuex.constants';
import contentRendererMixin from '../views/ContentRenderer/mixin';
import ContentRendererLoading from '../views/ContentRenderer/ContentRendererLoading';
import ContentRendererError from '../views/ContentRenderer/ContentRendererError';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Vue from 'vue';
import { render, screen } from '@testing-library/vue';
import useUser, { useUserMock } from 'kolibri.coreVue.composables.useUser';
import { RENDERER_SUFFIX } from 'kolibri.coreVue.vuex.constants';
import DownloadButton from '../DownloadButton.vue';
import { RENDERER_SUFFIX } from '../constants';

jest.mock('kolibri.coreVue.composables.useUser');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue';
import { RENDERER_SUFFIX } from 'kolibri.coreVue.vuex.constants';
import { canRenderContent, getRenderableFiles, getDefaultFile, getFilePreset } from '../utils';
import { RENDERER_SUFFIX } from '../constants';

// Add a component to the Vue instance that can be used to test the utility functions
const addRegisterableComponents = (...presets) => {
Expand Down
1 change: 0 additions & 1 deletion kolibri/core/assets/src/views/ContentRenderer/constants.js

This file was deleted.

2 changes: 1 addition & 1 deletion kolibri/core/assets/src/views/ContentRenderer/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RENDERER_SUFFIX } from './constants';
import { RENDERER_SUFFIX } from 'kolibri.coreVue.vuex.constants';
import ContentRendererError from './ContentRendererError';
import { canRenderContent, getRenderableFiles, getDefaultFile, getFilePreset } from './utils';

Expand Down
2 changes: 1 addition & 1 deletion kolibri/core/assets/src/views/ContentRenderer/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Vue from 'vue';
import { RENDERER_SUFFIX } from './constants';
import { RENDERER_SUFFIX } from 'kolibri.coreVue.vuex.constants';

export const canRenderContent = preset => Boolean(Vue.options.components[preset + RENDERER_SUFFIX]);

Expand Down

0 comments on commit a760dee

Please sign in to comment.