@windward/core 0.2.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel.config.js +1 -1
- package/components/Content/Blocks/Accordion.vue +37 -0
- package/components/Content/Blocks/ClickableIcons.vue +107 -20
- package/components/Content/Blocks/Email.vue +9 -0
- package/components/Content/Blocks/Image.vue +48 -20
- package/components/Content/Blocks/UserUpload/ManageDataTableUserFiles.vue +1 -1
- package/components/Content/Blocks/UserUpload.vue +1 -1
- package/components/Content/Blocks/Video.vue +80 -9
- package/components/Navigation/Items/AskTheExpert.vue +2 -1
- package/components/Navigation/Items/CourseGlossaryToolNav.vue +2 -1
- package/components/Settings/AccordionSettings.vue +64 -4
- package/components/Settings/BlockQuoteSettings.vue +9 -1
- package/components/Settings/ClickableIconsSettings.vue +104 -13
- package/components/Settings/EmailSettings.vue +13 -13
- package/components/Settings/FeedbackSettings.vue +2 -1
- package/components/Settings/HorizontalRuleSettings.vue +2 -1
- package/components/Settings/ImageSettings.vue +148 -39
- package/components/Settings/MathSettings.vue +6 -5
- package/components/Settings/OpenResponseCollateSettings.vue +5 -1
- package/components/Settings/OpenResponseSettings.vue +9 -4
- package/components/Settings/ScenarioChoiceSettings.vue +15 -4
- package/components/Settings/TabSettings.vue +12 -4
- package/components/Settings/TextEditorSettings.vue +14 -7
- package/components/Settings/UserUploadSettings.vue +11 -4
- package/components/Settings/VideoSettings.vue +121 -66
- package/components/utils/ContentViewer.vue +6 -1
- package/components/utils/MathExpressionEditor.vue +10 -5
- package/components/utils/TinyMCEWrapper.vue +120 -19
- package/components/utils/assets/tinymce/content/dark/content.scss +4 -0
- package/components/utils/assets/tinymce/{css/content.scss → content/global.scss} +38 -37
- package/components/utils/assets/tinymce/content/light/content.scss +4 -0
- package/components/utils/assets/tinymce/ui/dark/content.scss +803 -0
- package/components/utils/assets/tinymce/ui/dark/skin.scss +4727 -0
- package/components/utils/assets/tinymce/ui/global.scss +19 -0
- package/components/utils/assets/tinymce/ui/light/content.scss +822 -0
- package/components/utils/assets/tinymce/ui/light/skin.scss +4731 -0
- package/components/utils/glossary/CourseGlossary.vue +4 -3
- package/components/utils/glossary/CourseGlossaryForm.vue +1 -1
- package/config/tinymce.config.ts +22 -14
- package/helpers/FillInBlankHelper.ts +34 -28
- package/helpers/GlossaryHelper.ts +90 -73
- package/helpers/MathHelper.ts +49 -28
- package/helpers/tinymce/plugin.ts +9 -7
- package/i18n/en-US/components/content/blocks/image.ts +1 -1
- package/i18n/en-US/components/settings/clickable_icon.ts +2 -0
- package/i18n/en-US/components/settings/image.ts +6 -1
- package/i18n/en-US/shared/settings.ts +3 -0
- package/i18n/es-ES/components/content/blocks/image.ts +1 -1
- package/i18n/es-ES/components/settings/clickable_icon.ts +2 -0
- package/i18n/es-ES/components/settings/image.ts +8 -1
- package/i18n/es-ES/shared/settings.ts +3 -0
- package/i18n/sv-SE/components/content/blocks/image.ts +1 -1
- package/i18n/sv-SE/components/settings/clickable_icon.ts +2 -0
- package/i18n/sv-SE/components/settings/image.ts +6 -1
- package/i18n/sv-SE/shared/settings.ts +3 -0
- package/package.json +4 -3
- package/test/Components/Settings/AccordionSettings.spec.js +16 -2
- package/test/__mocks__/componentsMock.js +57 -97
- package/test/__mocks__/contentBlockMock.js +7 -1
- package/test/__mocks__/contentSettingsMock.js +8 -1
- package/test/__mocks__/helpersMock.js +9 -0
- package/test/__mocks__/modelMock.js +101 -31
- package/test/helpers/MathHelper.spec.js +22 -3
- package/tsconfig.json +1 -0
- package/.idea/codeStyles/Project.xml +0 -58
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/php-docker-settings.xml +0 -24
- package/.idea/php.xml +0 -19
- package/.idea/vcs.xml +0 -6
- package/.idea/watcherTasks.xml +0 -4
- package/.idea/windward-ui-plugin-core.iml +0 -8
- package/coverage/clover.xml +0 -223
- package/coverage/coverage-final.json +0 -16
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/components/Content/Blocks/Accordion.vue.html +0 -430
- package/coverage/lcov-report/components/Content/Blocks/Image.vue.html +0 -394
- package/coverage/lcov-report/components/Content/Blocks/Math.vue.html +0 -262
- package/coverage/lcov-report/components/Content/Blocks/RichText.vue.html +0 -295
- package/coverage/lcov-report/components/Content/Blocks/Tab.vue.html +0 -415
- package/coverage/lcov-report/components/Content/Blocks/Table.vue.html +0 -667
- package/coverage/lcov-report/components/Content/Blocks/Video.vue.html +0 -2275
- package/coverage/lcov-report/components/Content/Blocks/index.html +0 -206
- package/coverage/lcov-report/components/utils/ContentViewer.vue.html +0 -199
- package/coverage/lcov-report/components/utils/MathExpressionEditor.vue.html +0 -919
- package/coverage/lcov-report/components/utils/MathLiveWrapper.vue.html +0 -343
- package/coverage/lcov-report/components/utils/TinyMCEWrapper.vue.html +0 -271
- package/coverage/lcov-report/components/utils/index.html +0 -161
- package/coverage/lcov-report/config/index.html +0 -116
- package/coverage/lcov-report/config/tinymce.config.js.html +0 -493
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/helpers/MathHelper.ts.html +0 -793
- package/coverage/lcov-report/helpers/index.html +0 -116
- package/coverage/lcov-report/helpers/tinymce/index.html +0 -116
- package/coverage/lcov-report/helpers/tinymce/plugin.ts.html +0 -334
- package/coverage/lcov-report/index.html +0 -191
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/test/index.html +0 -116
- package/coverage/lcov-report/test/mocks.js.html +0 -457
- package/coverage/lcov.info +0 -403
- package/lib/helpers/GlossaryHelper.d.ts +0 -9
- package/lib/helpers/GlossaryHelper.js +0 -118
- package/lib/helpers/GlossaryTerm.d.ts +0 -10
- package/lib/helpers/GlossaryTerm.js +0 -22
- package/lib/helpers/MathHelper.d.ts +0 -99
- package/lib/helpers/MathHelper.js +0 -194
- package/lib/helpers/tinymce/plugin.d.ts +0 -2
- package/lib/helpers/tinymce/plugin.js +0 -86
- package/lib/i18n/en-US/components/content/blocks/image.d.ts +0 -6
- package/lib/i18n/en-US/components/content/blocks/image.js +0 -7
- package/lib/i18n/en-US/components/content/blocks/index.d.ts +0 -75
- package/lib/i18n/en-US/components/content/blocks/index.js +0 -14
- package/lib/i18n/en-US/components/content/blocks/tab.d.ts +0 -5
- package/lib/i18n/en-US/components/content/blocks/tab.js +0 -6
- package/lib/i18n/en-US/components/content/blocks/table.d.ts +0 -5
- package/lib/i18n/en-US/components/content/blocks/table.js +0 -6
- package/lib/i18n/en-US/components/content/blocks/user_upload.d.ts +0 -13
- package/lib/i18n/en-US/components/content/blocks/user_upload.js +0 -14
- package/lib/i18n/en-US/components/content/blocks/video.d.ts +0 -48
- package/lib/i18n/en-US/components/content/blocks/video.js +0 -49
- package/lib/i18n/en-US/components/content/index.d.ts +0 -77
- package/lib/i18n/en-US/components/content/index.js +0 -6
- package/lib/i18n/en-US/components/index.d.ts +0 -140
- package/lib/i18n/en-US/components/index.js +0 -12
- package/lib/i18n/en-US/components/navigation/image.d.ts +0 -5
- package/lib/i18n/en-US/components/navigation/image.js +0 -6
- package/lib/i18n/en-US/components/navigation/index.d.ts +0 -10
- package/lib/i18n/en-US/components/navigation/index.js +0 -8
- package/lib/i18n/en-US/components/navigation/user_upload.d.ts +0 -4
- package/lib/i18n/en-US/components/navigation/user_upload.js +0 -5
- package/lib/i18n/en-US/components/settings/clickable_icon.d.ts +0 -6
- package/lib/i18n/en-US/components/settings/clickable_icon.js +0 -7
- package/lib/i18n/en-US/components/settings/image.d.ts +0 -2
- package/lib/i18n/en-US/components/settings/image.js +0 -3
- package/lib/i18n/en-US/components/settings/index.d.ts +0 -39
- package/lib/i18n/en-US/components/settings/index.js +0 -14
- package/lib/i18n/en-US/components/settings/text_editor.d.ts +0 -8
- package/lib/i18n/en-US/components/settings/text_editor.js +0 -9
- package/lib/i18n/en-US/components/settings/user_upload.d.ts +0 -12
- package/lib/i18n/en-US/components/settings/user_upload.js +0 -13
- package/lib/i18n/en-US/components/settings/video.d.ts +0 -13
- package/lib/i18n/en-US/components/settings/video.js +0 -14
- package/lib/i18n/en-US/components/utils/index.d.ts +0 -15
- package/lib/i18n/en-US/components/utils/index.js +0 -6
- package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.d.ts +0 -13
- package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.js +0 -14
- package/lib/i18n/en-US/index.d.ts +0 -197
- package/lib/i18n/en-US/index.js +0 -16
- package/lib/i18n/en-US/modules/index.d.ts +0 -2
- package/lib/i18n/en-US/modules/index.js +0 -6
- package/lib/i18n/en-US/pages/glossary.d.ts +0 -8
- package/lib/i18n/en-US/pages/glossary.js +0 -9
- package/lib/i18n/en-US/pages/index.d.ts +0 -13
- package/lib/i18n/en-US/pages/index.js +0 -8
- package/lib/i18n/en-US/pages/user_upload.d.ts +0 -4
- package/lib/i18n/en-US/pages/user_upload.js +0 -5
- package/lib/i18n/en-US/shared/content_blocks.d.ts +0 -20
- package/lib/i18n/en-US/shared/content_blocks.js +0 -21
- package/lib/i18n/en-US/shared/index.d.ts +0 -39
- package/lib/i18n/en-US/shared/index.js +0 -10
- package/lib/i18n/en-US/shared/menu.d.ts +0 -4
- package/lib/i18n/en-US/shared/menu.js +0 -5
- package/lib/i18n/en-US/shared/settings.d.ts +0 -15
- package/lib/i18n/en-US/shared/settings.js +0 -16
- package/lib/i18n/en-US.d.ts +0 -197
- package/lib/i18n/en-US.js +0 -15
- package/lib/models/UserFileAsset.d.ts +0 -5
- package/lib/models/UserFileAsset.js +0 -37
|
@@ -9,10 +9,12 @@ export default {
|
|
|
9
9
|
item_color: 'Color del artículo',
|
|
10
10
|
item_text: 'Texto del elemento',
|
|
11
11
|
autocolor: 'Opciones de color automático',
|
|
12
|
+
icon_image: 'Usar imagen como ícono',
|
|
12
13
|
display: {
|
|
13
14
|
show_title: 'Mostrar siempre el título',
|
|
14
15
|
show_background: 'Mostrar fondo',
|
|
15
16
|
round_icon: 'Iconos redondos',
|
|
16
17
|
italic_icon: 'Iconos en cursiva',
|
|
18
|
+
large_icon: 'Iconos grandes',
|
|
17
19
|
},
|
|
18
20
|
}
|
|
@@ -2,11 +2,18 @@ export default {
|
|
|
2
2
|
hide_background: 'Ocultar fondo',
|
|
3
3
|
modal: 'Haga clic para abrir en modal',
|
|
4
4
|
decorative: 'Imagen decorativa',
|
|
5
|
-
|
|
5
|
+
decorative_toggle_description:
|
|
6
6
|
'Para cumplir con los estándares de accesibilidad, se requiere texto alternativo para todas las imágenes, excepto para las imágenes puramente decorativas. Esta configuración agregará el texto alternativo y el texto del lector de pantalla adecuados para los estudiantes.',
|
|
7
|
+
inherit_global_toggle_description:
|
|
8
|
+
'Cuando está habilitado, la imagen seleccionada utilizará texto alternativo y texto del lector de pantalla almacenado en el archivo, administrado en el administrador de archivos. Cuando está deshabilitada, la imagen seleccionada tendrá su propio texto alternativo y texto de lector de pantalla que no se comparte globalmente en el archivo.',
|
|
7
9
|
alt_description:
|
|
8
10
|
'El texto alternativo es un texto descriptivo que transmite el significado y el contexto de un elemento visual en un entorno digital, destinado a usuarios con discapacidad visual o que no pueden identificar visualmente una imagen. Esto debe ser breve y claro.',
|
|
9
11
|
screenreader: 'Texto del lector de pantalla',
|
|
10
12
|
screenreader_description:
|
|
11
13
|
'Se puede agregar texto al lector de pantalla para brindarle al usuario que utiliza tecnología de asistencia más información sobre los elementos de la página',
|
|
14
|
+
inherit: 'Heredar configuración global',
|
|
15
|
+
inherit_no_alt:
|
|
16
|
+
'No hay texto alternativo global disponible para el archivo',
|
|
17
|
+
inherit_no_aria:
|
|
18
|
+
'No hay texto de lector de pantalla global disponible para el archivo',
|
|
12
19
|
}
|
|
@@ -9,10 +9,12 @@ export default {
|
|
|
9
9
|
item_color: 'Artikelfärg',
|
|
10
10
|
item_text: 'Artikeltext',
|
|
11
11
|
autocolor: 'Auto-färgalternativ',
|
|
12
|
+
icon_image: 'Använd bild för ikon',
|
|
12
13
|
display: {
|
|
13
14
|
show_title: 'Visa alltid titel',
|
|
14
15
|
show_background: 'Visa bakgrund',
|
|
15
16
|
round_icon: 'Runda ikoner',
|
|
16
17
|
italic_icon: 'Kursiva ikoner',
|
|
18
|
+
large_icon: 'Stora ikoner',
|
|
17
19
|
},
|
|
18
20
|
}
|
|
@@ -2,11 +2,16 @@ export default {
|
|
|
2
2
|
hide_background: 'Dölj bakgrund',
|
|
3
3
|
modal: 'Klicka för att öppna i modal',
|
|
4
4
|
decorative: 'Dekorativ bild',
|
|
5
|
-
|
|
5
|
+
decorative_toggle_description:
|
|
6
6
|
'För att uppfylla tillgänglighetsstandarder krävs alt-text för alla bilder utom för rent dekorativa bilder. Den här inställningen kommer att lägga till rätt alt-text och skärmläsartext för eleverna.',
|
|
7
|
+
inherit_global_toggle_description:
|
|
8
|
+
'När den är aktiverad kommer den valda bilden att använda alt-text och skärmläsartext lagrad i filen, hanterad i filhanteraren. När den är inaktiverad kommer den valda bilden att ha sin egen unika alt-text och skärmläsartext som inte delas globalt på filen.',
|
|
7
9
|
alt_description:
|
|
8
10
|
'Alternativ text är beskrivande text som förmedlar innebörden och sammanhanget av ett visuellt föremål i en digital miljö, avsedd för användare som är synskadade eller på annat sätt oförmögna att visuellt identifiera en bild. Detta ska vara kort och tydligt.',
|
|
9
11
|
screenreader: 'Skärmläsartext',
|
|
10
12
|
screenreader_description:
|
|
11
13
|
'Skärmläsartext kan läggas till för att ge en användare som använder hjälpmedel mer information om elementen på sidan',
|
|
14
|
+
inherit: 'Ärva globala inställningar',
|
|
15
|
+
inherit_no_alt: 'Ingen global alt-text tillgänglig för filen',
|
|
16
|
+
inherit_no_aria: 'Ingen global skärmläsartext tillgänglig för filen',
|
|
12
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windward/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Windward UI Core Plugins",
|
|
5
5
|
"main": "plugin.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,9 +27,10 @@
|
|
|
27
27
|
"he": "^1.2.0",
|
|
28
28
|
"lodash": "^4.17.21",
|
|
29
29
|
"mathlive": "^0.75.0",
|
|
30
|
-
"mathml-to-latex": "^1.
|
|
30
|
+
"mathml-to-latex": "^1.4.0",
|
|
31
31
|
"prettier": "^2.6.0",
|
|
32
|
-
"raw-loader": "^4.0.2"
|
|
32
|
+
"raw-loader": "^4.0.2",
|
|
33
|
+
"tinymce": "^7.1.0"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@babel/preset-env": "^7.16.11",
|
|
@@ -27,8 +27,22 @@ describe('AccordionSettings', () => {
|
|
|
27
27
|
})
|
|
28
28
|
wrapper.vm.onAddElement()
|
|
29
29
|
expect(wrapper.vm.$data.block.metadata.config.items).toEqual([
|
|
30
|
-
{
|
|
31
|
-
|
|
30
|
+
{
|
|
31
|
+
header: '',
|
|
32
|
+
expand: false,
|
|
33
|
+
content: '',
|
|
34
|
+
file: null,
|
|
35
|
+
altText: '',
|
|
36
|
+
ariaDescribedBy: '',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
header: '',
|
|
40
|
+
expand: false,
|
|
41
|
+
content: '',
|
|
42
|
+
file: null,
|
|
43
|
+
altText: '',
|
|
44
|
+
ariaDescribedBy: '',
|
|
45
|
+
},
|
|
32
46
|
])
|
|
33
47
|
})
|
|
34
48
|
|
|
@@ -1,101 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
'~/components/
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
|
|
1
|
+
const shallowMocks = [
|
|
2
|
+
{ path: '~/components/Core/AuditLogList' },
|
|
3
|
+
{ path: '~/components/Core/AvatarUpload' },
|
|
4
|
+
{ path: '~/components/Core/Breadcrumbs' },
|
|
5
|
+
{ path: '~/components/Core/ColorPicker' },
|
|
6
|
+
{ path: '~/components/Core/ContextMenu' },
|
|
7
|
+
{ path: '~/components/Core/DialogBox' },
|
|
8
|
+
{ path: '~/components/Core/DragDirection' },
|
|
9
|
+
{ path: '~/components/Core/FileDropZone' },
|
|
10
|
+
{ path: '~/components/Core/FormButtons' },
|
|
11
|
+
{ path: '~/components/Core/Form', data: { validation: {} } },
|
|
12
|
+
{ path: '~/components/Core/PageTopActionArea' },
|
|
13
|
+
{ path: '~/components/Core/PluginRef' },
|
|
14
|
+
{ path: '~/components/Core/SearchField' },
|
|
15
|
+
{ path: '~/components/Core/SortableExpansionPanel' },
|
|
16
|
+
{ path: '~/components/Core/SpeedDial' },
|
|
17
|
+
{ path: '~/components/Core/TextIconPicker' },
|
|
18
|
+
{ path: '~/components/Core/UserAvatar' },
|
|
19
|
+
{ path: '~/components/Text/TextViewer' },
|
|
20
|
+
{ path: '~/components/Text/TextEditor' },
|
|
21
|
+
]
|
|
12
22
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
computed: {},
|
|
19
|
-
methods: {},
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{ virtual: true }
|
|
23
|
-
)
|
|
23
|
+
for (const index in shallowMocks) {
|
|
24
|
+
const mockData = shallowMocks[index].data || {}
|
|
25
|
+
const mockProps = shallowMocks[index].props || {}
|
|
26
|
+
const mockComputed = shallowMocks[index].computed || {}
|
|
27
|
+
const mockMethods = shallowMocks[index].methods || {}
|
|
24
28
|
|
|
25
|
-
jest.mock(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
jest.mock(
|
|
30
|
+
shallowMocks[index].path,
|
|
31
|
+
() => {
|
|
32
|
+
return {
|
|
33
|
+
data() {
|
|
34
|
+
return { ...mockData }
|
|
35
|
+
},
|
|
36
|
+
props: mockProps,
|
|
37
|
+
computed: mockComputed,
|
|
38
|
+
methods: mockMethods,
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{ virtual: true }
|
|
42
|
+
)
|
|
36
43
|
|
|
37
|
-
|
|
38
|
-
'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
'~/components/Text/TextEditor',
|
|
51
|
-
() => {
|
|
52
|
-
return {
|
|
53
|
-
props: {},
|
|
54
|
-
computed: {},
|
|
55
|
-
methods: {},
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{ virtual: true }
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
jest.mock(
|
|
62
|
-
'~/components/Form',
|
|
63
|
-
() => {
|
|
64
|
-
return {
|
|
65
|
-
props: {},
|
|
66
|
-
computed: {},
|
|
67
|
-
methods: {},
|
|
68
|
-
data() {
|
|
69
|
-
return { validation: {} }
|
|
44
|
+
// If the path does not include .vue then stub that out too
|
|
45
|
+
if (!shallowMocks[index].path.includes('.vue')) {
|
|
46
|
+
jest.mock(
|
|
47
|
+
shallowMocks[index].path + '.vue',
|
|
48
|
+
() => {
|
|
49
|
+
return {
|
|
50
|
+
data() {
|
|
51
|
+
return { ...mockData }
|
|
52
|
+
},
|
|
53
|
+
props: mockProps,
|
|
54
|
+
computed: mockComputed,
|
|
55
|
+
methods: mockMethods,
|
|
56
|
+
}
|
|
70
57
|
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
jest.mock(
|
|
77
|
-
'~/components/Form.vue',
|
|
78
|
-
() => {
|
|
79
|
-
return {
|
|
80
|
-
props: {},
|
|
81
|
-
computed: {},
|
|
82
|
-
methods: {},
|
|
83
|
-
data() {
|
|
84
|
-
return { validation: {} }
|
|
85
|
-
},
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{ virtual: true }
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
jest.mock(
|
|
92
|
-
'~/components/ColorPicker.vue',
|
|
93
|
-
() => {
|
|
94
|
-
return {
|
|
95
|
-
props: {},
|
|
96
|
-
computed: {},
|
|
97
|
-
methods: {},
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
{ virtual: true }
|
|
101
|
-
)
|
|
58
|
+
{ virtual: true }
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -59,6 +59,12 @@ jest.mock(
|
|
|
59
59
|
resolve(true)
|
|
60
60
|
})
|
|
61
61
|
},
|
|
62
|
+
getAssetByFileAssetId(fileAssetId) {
|
|
63
|
+
return null
|
|
64
|
+
},
|
|
65
|
+
resolveAsset(file) {
|
|
66
|
+
return file
|
|
67
|
+
},
|
|
62
68
|
},
|
|
63
69
|
}
|
|
64
70
|
},
|
|
@@ -101,7 +107,7 @@ jest.mock(
|
|
|
101
107
|
)
|
|
102
108
|
|
|
103
109
|
jest.mock(
|
|
104
|
-
'~/components/FileDropZone.vue',
|
|
110
|
+
'~/components/Core/FileDropZone.vue',
|
|
105
111
|
() => {
|
|
106
112
|
return {
|
|
107
113
|
props: {},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
// Mock the base settings
|
|
1
2
|
jest.mock(
|
|
2
|
-
'~/components/Content/
|
|
3
|
+
'~/components/Content/Settings/BaseContentSettings.js',
|
|
3
4
|
() => {
|
|
4
5
|
return {
|
|
5
6
|
props: {
|
|
@@ -47,6 +48,12 @@ jest.mock(
|
|
|
47
48
|
resolve(true)
|
|
48
49
|
})
|
|
49
50
|
},
|
|
51
|
+
getAssetByFileAssetId(fileAssetId) {
|
|
52
|
+
return null
|
|
53
|
+
},
|
|
54
|
+
resolveAsset(file) {
|
|
55
|
+
return file
|
|
56
|
+
},
|
|
50
57
|
},
|
|
51
58
|
}
|
|
52
59
|
},
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
jest.mock(
|
|
2
|
+
'!raw-loader!sass-loader!./assets/tinymce/css/content.scss',
|
|
3
|
+
() => {
|
|
4
|
+
return ''
|
|
5
|
+
},
|
|
6
|
+
{ virtual: true }
|
|
7
|
+
)
|
|
8
|
+
|
|
1
9
|
jest.mock(
|
|
2
10
|
'~/helpers/Uuid',
|
|
3
11
|
() => {
|
|
@@ -9,6 +17,7 @@ jest.mock(
|
|
|
9
17
|
},
|
|
10
18
|
{ virtual: true }
|
|
11
19
|
)
|
|
20
|
+
|
|
12
21
|
jest.mock(
|
|
13
22
|
'~/helpers/Download',
|
|
14
23
|
() => {
|
|
@@ -8,15 +8,50 @@ jest.mock('axios')
|
|
|
8
8
|
|
|
9
9
|
// Define any new model mocks here. The imports / mocks will be auto-generated below
|
|
10
10
|
const mockVirtualModels = [
|
|
11
|
+
{ path: '~/models/AskTheExpert', resource: 'user-tools/ask-the-expert' },
|
|
12
|
+
{ path: '~/models/AssessmentQuestion', resource: 'questions' },
|
|
11
13
|
{
|
|
12
|
-
path: '~/models/
|
|
13
|
-
resource: '
|
|
14
|
+
path: '~/models/AssessmentQuestionType',
|
|
15
|
+
resource: 'assessments/questions/types',
|
|
14
16
|
},
|
|
15
|
-
{ path: '~/models/
|
|
17
|
+
{ path: '~/models/AssessmentResult', resource: 'assessment-results' },
|
|
18
|
+
{ path: '~/models/Assessment', resource: 'assessments' },
|
|
19
|
+
{ path: '~/models/ContactSupport', resource: 'user-tools/contact-support' },
|
|
16
20
|
{ path: '~/models/ContentBlock', resource: 'blocks' },
|
|
17
|
-
{ path: '~/models/
|
|
18
|
-
{ path: '~/models/
|
|
21
|
+
{ path: '~/models/Content', resource: 'content' },
|
|
22
|
+
{ path: '~/models/CourseSection', resource: 'sections' },
|
|
19
23
|
{ path: '~/models/Course', resource: 'courses' },
|
|
24
|
+
{ path: '~/models/CourseUserTrack', resource: 'track' },
|
|
25
|
+
{ path: '~/models/Enrollment', resource: 'enrollments' },
|
|
26
|
+
{ path: '~/models/FileAssetNamespace', resource: 'file-namespaces' },
|
|
27
|
+
{ path: '~/models/FileAsset', resource: 'files' },
|
|
28
|
+
{ path: '~/models/GradeMap', resource: 'maps' },
|
|
29
|
+
{ path: '~/models/Grade', resource: 'grades' },
|
|
30
|
+
{ path: '~/models/GradeType', resource: 'grades/types' },
|
|
31
|
+
{ path: '~/models/Locale', resource: 'locales' },
|
|
32
|
+
{ path: '~/models/Note', resource: 'notes' },
|
|
33
|
+
{ path: '~/models/NotificationEvent', resource: 'notifications/events' },
|
|
34
|
+
{ path: '~/models/NotificationTemplate', resource: 'notifications' },
|
|
35
|
+
{ path: '~/models/NotificationType', resource: 'notifications/types' },
|
|
36
|
+
{
|
|
37
|
+
path: '~/models/OrganizationNotification',
|
|
38
|
+
resource: 'organization-notifications',
|
|
39
|
+
},
|
|
40
|
+
{ path: '~/models/Organization', resource: 'organizations' },
|
|
41
|
+
{ path: '~/models/Permission', resource: 'permissions' },
|
|
42
|
+
{ path: '~/models/PermissionType', resource: 'permissions/types' },
|
|
43
|
+
{ path: '~/models/Plugin', resource: 'plugins' },
|
|
44
|
+
{ path: '~/models/repositories/AuthUserRepository', resource: 'users' },
|
|
45
|
+
{ path: '~/models/Role', resource: 'roles' },
|
|
46
|
+
{ path: '~/models/Rubric', resource: 'rubrics' },
|
|
47
|
+
{ path: '~/models/ServiceStatus', resource: 'status' },
|
|
48
|
+
{ path: '~/models/Tenant', resource: 'tenant' },
|
|
49
|
+
{
|
|
50
|
+
path: '~/models/UserContentBlockState',
|
|
51
|
+
resource: 'user-content-block-state',
|
|
52
|
+
},
|
|
53
|
+
{ path: '~/models/UserGrade', resource: 'user-grades' },
|
|
54
|
+
{ path: '~/models/UserNotification', resource: 'notifications' },
|
|
20
55
|
]
|
|
21
56
|
|
|
22
57
|
const mockModels = [
|
|
@@ -24,12 +59,7 @@ const mockModels = [
|
|
|
24
59
|
]
|
|
25
60
|
|
|
26
61
|
// DO NOT ALTER THE BELOW CODE
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
__esModule: true,
|
|
30
|
-
default: class Model {},
|
|
31
|
-
}
|
|
32
|
-
})
|
|
62
|
+
|
|
33
63
|
class mockBaseModel extends mockModel {
|
|
34
64
|
baseURL() {
|
|
35
65
|
return 'http://windwardapi.local'
|
|
@@ -39,6 +69,34 @@ class mockBaseModel extends mockModel {
|
|
|
39
69
|
resolve({ data: {} })
|
|
40
70
|
})
|
|
41
71
|
}
|
|
72
|
+
|
|
73
|
+
integrations() {
|
|
74
|
+
return this
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
where() {
|
|
78
|
+
return this
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
include() {
|
|
82
|
+
return this
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
with() {
|
|
86
|
+
return this
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
for() {
|
|
90
|
+
return this
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
get() {
|
|
94
|
+
return []
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
first() {
|
|
98
|
+
return {}
|
|
99
|
+
}
|
|
42
100
|
}
|
|
43
101
|
|
|
44
102
|
jest.mock(
|
|
@@ -52,35 +110,47 @@ jest.mock(
|
|
|
52
110
|
{ virtual: true }
|
|
53
111
|
)
|
|
54
112
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
113
|
+
const registerVirtualModels = function (mockVirtualModelsParam) {
|
|
114
|
+
for (let mockI = 0; mockI < mockVirtualModelsParam.length; mockI++) {
|
|
115
|
+
jest.mock(
|
|
116
|
+
mockVirtualModelsParam[mockI].path,
|
|
117
|
+
() => {
|
|
118
|
+
return {
|
|
119
|
+
__esModule: true,
|
|
120
|
+
default: class Model extends mockBaseModel {
|
|
121
|
+
resource() {
|
|
122
|
+
return (
|
|
123
|
+
mockVirtualModelsParam[mockI].resource ||
|
|
124
|
+
this.constructor.name
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{ virtual: true }
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const registerModels = function (mockModelsParam) {
|
|
136
|
+
for (let mockJ = 0; mockJ < mockModelsParam.length; mockJ++) {
|
|
137
|
+
jest.mock(mockModelsParam[mockJ].path, () => {
|
|
59
138
|
return {
|
|
60
139
|
__esModule: true,
|
|
61
140
|
default: class Model extends mockBaseModel {
|
|
62
141
|
resource() {
|
|
63
142
|
return (
|
|
64
|
-
|
|
143
|
+
mockModelsParam[mockJ].resource ||
|
|
65
144
|
this.constructor.name
|
|
66
145
|
)
|
|
67
146
|
}
|
|
68
147
|
},
|
|
69
148
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
)
|
|
149
|
+
})
|
|
150
|
+
}
|
|
73
151
|
}
|
|
74
152
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
default: class Model extends mockBaseModel {
|
|
80
|
-
resource() {
|
|
81
|
-
return mockModels[mockJ].resource || this.constructor.name
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
}
|
|
153
|
+
registerVirtualModels(mockVirtualModels)
|
|
154
|
+
registerModels(mockModels)
|
|
155
|
+
|
|
156
|
+
export { registerVirtualModels, registerModels }
|
|
@@ -98,7 +98,7 @@ describe('MahtHelper ', () => {
|
|
|
98
98
|
test('detects content wrapped for tinymce', () => {
|
|
99
99
|
expect(
|
|
100
100
|
MathHelper.checkMathContentWrappedForTMCE(
|
|
101
|
-
`<span class
|
|
101
|
+
`<span class='windward-math-content'>` +
|
|
102
102
|
srEnhancedlatex +
|
|
103
103
|
`</span>` +
|
|
104
104
|
text +
|
|
@@ -111,7 +111,7 @@ describe('MahtHelper ', () => {
|
|
|
111
111
|
expect(MathHelper.wrapMathContentForTinyMCE(srEnhancedlatex)).toEqual(
|
|
112
112
|
`<span class ='windward-math-content'>` +
|
|
113
113
|
srEnhancedlatex +
|
|
114
|
-
`</span
|
|
114
|
+
`</span> `
|
|
115
115
|
)
|
|
116
116
|
})
|
|
117
117
|
test('can wrap latexContent in math span for tinymce', () => {
|
|
@@ -122,7 +122,26 @@ describe('MahtHelper ', () => {
|
|
|
122
122
|
'$$' +
|
|
123
123
|
latexContent +
|
|
124
124
|
'$$' +
|
|
125
|
-
`</span
|
|
125
|
+
`</span> `
|
|
126
|
+
)
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
test('can wrap latexContent in math span for tinymce only once', () => {
|
|
130
|
+
expect(
|
|
131
|
+
MathHelper.wrapMathContentForTinyMCE(
|
|
132
|
+
'$$' + latexContent + '$$' + '$$' + latexContent + '$$'
|
|
133
|
+
)
|
|
134
|
+
).toEqual(
|
|
135
|
+
`<span class ='windward-math-content'>` +
|
|
136
|
+
'$$' +
|
|
137
|
+
latexContent +
|
|
138
|
+
'$$' +
|
|
139
|
+
`</span> ` +
|
|
140
|
+
`<span class ='windward-math-content'>` +
|
|
141
|
+
'$$' +
|
|
142
|
+
latexContent +
|
|
143
|
+
'$$' +
|
|
144
|
+
`</span> `
|
|
126
145
|
)
|
|
127
146
|
})
|
|
128
147
|
})
|
package/tsconfig.json
CHANGED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
-
<code_scheme name="Project" version="173">
|
|
3
|
-
<HTMLCodeStyleSettings>
|
|
4
|
-
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
-
<option name="HTML_ENFORCE_QUOTES" value="true" />
|
|
6
|
-
</HTMLCodeStyleSettings>
|
|
7
|
-
<JSCodeStyleSettings version="0">
|
|
8
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
9
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
10
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
-
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
|
|
12
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
-
</JSCodeStyleSettings>
|
|
15
|
-
<TypeScriptCodeStyleSettings version="0">
|
|
16
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
17
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
18
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
19
|
-
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
|
|
20
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
21
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
22
|
-
</TypeScriptCodeStyleSettings>
|
|
23
|
-
<VueCodeStyleSettings>
|
|
24
|
-
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
25
|
-
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
26
|
-
</VueCodeStyleSettings>
|
|
27
|
-
<codeStyleSettings language="HTML">
|
|
28
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
29
|
-
<indentOptions>
|
|
30
|
-
<option name="INDENT_SIZE" value="2" />
|
|
31
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
32
|
-
<option name="TAB_SIZE" value="2" />
|
|
33
|
-
</indentOptions>
|
|
34
|
-
</codeStyleSettings>
|
|
35
|
-
<codeStyleSettings language="JavaScript">
|
|
36
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
37
|
-
<indentOptions>
|
|
38
|
-
<option name="INDENT_SIZE" value="2" />
|
|
39
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
40
|
-
<option name="TAB_SIZE" value="2" />
|
|
41
|
-
</indentOptions>
|
|
42
|
-
</codeStyleSettings>
|
|
43
|
-
<codeStyleSettings language="TypeScript">
|
|
44
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
45
|
-
<indentOptions>
|
|
46
|
-
<option name="INDENT_SIZE" value="2" />
|
|
47
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
48
|
-
<option name="TAB_SIZE" value="2" />
|
|
49
|
-
</indentOptions>
|
|
50
|
-
</codeStyleSettings>
|
|
51
|
-
<codeStyleSettings language="Vue">
|
|
52
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
53
|
-
<indentOptions>
|
|
54
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
55
|
-
</indentOptions>
|
|
56
|
-
</codeStyleSettings>
|
|
57
|
-
</code_scheme>
|
|
58
|
-
</component>
|