@windward/core 0.4.2 → 0.5.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/.idea/codeStyles/Project.xml +58 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/php-docker-settings.xml +24 -0
- package/.idea/php.xml +19 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/watcherTasks.xml +4 -0
- package/.idea/windward-ui-plugin-core.iml +8 -0
- package/bitbucket-pipelines.yml +14 -0
- package/components/Content/Blocks/Accordion.vue +10 -6
- package/components/Content/Blocks/ClickableIcons.vue +6 -5
- package/components/Content/Blocks/Feedback.vue +1 -1
- package/components/Content/Blocks/FileDownload/FileLinks.vue +82 -0
- package/components/Content/Blocks/FileDownload/FileTable.vue +106 -0
- package/components/Content/Blocks/FileDownload.vue +145 -0
- package/components/Content/Blocks/GenerateAIQuestionButton.vue +61 -0
- package/components/Content/Blocks/ScenarioChoice.vue +2 -2
- package/components/Content/Blocks/UserUpload.vue +15 -36
- package/components/Content/Blocks/Video.vue +2 -57
- package/components/Settings/AccordionSettings.vue +3 -6
- package/components/Settings/BlockQuoteSettings.vue +2 -2
- package/components/Settings/EmailSettings.vue +2 -2
- package/components/Settings/FileDownloadSettings.vue +168 -0
- package/components/Settings/UserUploadSettings.vue +36 -39
- package/components/utils/ContentViewer.vue +1 -0
- package/components/utils/TinyMCEWrapper.vue +18 -7
- package/components/utils/assets/tinymce/content/global.scss +10 -0
- package/config/menu.config.json +475 -0
- package/coverage/clover.xml +223 -0
- package/coverage/coverage-final.json +16 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/components/Content/Blocks/Accordion.vue.html +430 -0
- package/coverage/lcov-report/components/Content/Blocks/Image.vue.html +394 -0
- package/coverage/lcov-report/components/Content/Blocks/Math.vue.html +262 -0
- package/coverage/lcov-report/components/Content/Blocks/RichText.vue.html +295 -0
- package/coverage/lcov-report/components/Content/Blocks/Tab.vue.html +415 -0
- package/coverage/lcov-report/components/Content/Blocks/Table.vue.html +667 -0
- package/coverage/lcov-report/components/Content/Blocks/Video.vue.html +2275 -0
- package/coverage/lcov-report/components/Content/Blocks/index.html +206 -0
- package/coverage/lcov-report/components/utils/ContentViewer.vue.html +199 -0
- package/coverage/lcov-report/components/utils/MathExpressionEditor.vue.html +919 -0
- package/coverage/lcov-report/components/utils/MathLiveWrapper.vue.html +343 -0
- package/coverage/lcov-report/components/utils/TinyMCEWrapper.vue.html +271 -0
- package/coverage/lcov-report/components/utils/index.html +161 -0
- package/coverage/lcov-report/config/index.html +116 -0
- package/coverage/lcov-report/config/tinymce.config.js.html +493 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/helpers/MathHelper.ts.html +793 -0
- package/coverage/lcov-report/helpers/index.html +116 -0
- package/coverage/lcov-report/helpers/tinymce/index.html +116 -0
- package/coverage/lcov-report/helpers/tinymce/plugin.ts.html +334 -0
- package/coverage/lcov-report/index.html +191 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/test/index.html +116 -0
- package/coverage/lcov-report/test/mocks.js.html +457 -0
- package/coverage/lcov.info +403 -0
- package/i18n/en-US/components/content/blocks/file_download.ts +5 -0
- package/i18n/en-US/components/content/blocks/generate_questions.ts +3 -0
- package/i18n/en-US/components/content/blocks/index.ts +4 -0
- package/i18n/en-US/components/content/blocks/user_upload.ts +0 -2
- package/i18n/en-US/components/settings/file_download.ts +8 -0
- package/i18n/en-US/components/settings/index.ts +2 -0
- package/i18n/en-US/shared/content_blocks.ts +1 -0
- package/i18n/en-US/shared/settings.ts +1 -3
- package/i18n/es-ES/components/content/blocks/file_download.ts +5 -0
- package/i18n/es-ES/components/content/blocks/generate_questions.ts +3 -0
- package/i18n/es-ES/components/content/blocks/index.ts +6 -2
- package/i18n/es-ES/components/content/blocks/user_upload.ts +0 -2
- package/i18n/es-ES/components/settings/file_download.ts +8 -0
- package/i18n/es-ES/components/settings/index.ts +4 -2
- package/i18n/es-ES/shared/content_blocks.ts +1 -0
- package/i18n/es-ES/shared/settings.ts +1 -3
- package/i18n/sv-SE/components/content/blocks/file_download.ts +5 -0
- package/i18n/sv-SE/components/content/blocks/generate_questions.ts +3 -0
- package/i18n/sv-SE/components/content/blocks/index.ts +4 -0
- package/i18n/sv-SE/components/content/blocks/user_upload.ts +0 -2
- package/i18n/sv-SE/components/settings/file_download.ts +8 -0
- package/i18n/sv-SE/components/settings/index.ts +4 -2
- package/i18n/sv-SE/shared/content_blocks.ts +1 -0
- package/i18n/sv-SE/shared/settings.ts +2 -4
- package/lib/helpers/GlossaryHelper.d.ts +9 -0
- package/lib/helpers/GlossaryHelper.js +118 -0
- package/lib/helpers/GlossaryTerm.d.ts +10 -0
- package/lib/helpers/GlossaryTerm.js +22 -0
- package/lib/helpers/MathHelper.d.ts +99 -0
- package/lib/helpers/MathHelper.js +194 -0
- package/lib/helpers/tinymce/plugin.d.ts +2 -0
- package/lib/helpers/tinymce/plugin.js +86 -0
- package/lib/i18n/en-US/components/content/blocks/image.d.ts +6 -0
- package/lib/i18n/en-US/components/content/blocks/image.js +7 -0
- package/lib/i18n/en-US/components/content/blocks/index.d.ts +75 -0
- package/lib/i18n/en-US/components/content/blocks/index.js +14 -0
- package/lib/i18n/en-US/components/content/blocks/tab.d.ts +5 -0
- package/lib/i18n/en-US/components/content/blocks/tab.js +6 -0
- package/lib/i18n/en-US/components/content/blocks/table.d.ts +5 -0
- package/lib/i18n/en-US/components/content/blocks/table.js +6 -0
- package/lib/i18n/en-US/components/content/blocks/user_upload.d.ts +13 -0
- package/lib/i18n/en-US/components/content/blocks/user_upload.js +14 -0
- package/lib/i18n/en-US/components/content/blocks/video.d.ts +48 -0
- package/lib/i18n/en-US/components/content/blocks/video.js +49 -0
- package/lib/i18n/en-US/components/content/index.d.ts +77 -0
- package/lib/i18n/en-US/components/content/index.js +6 -0
- package/lib/i18n/en-US/components/index.d.ts +140 -0
- package/lib/i18n/en-US/components/index.js +12 -0
- package/lib/i18n/en-US/components/navigation/image.d.ts +5 -0
- package/lib/i18n/en-US/components/navigation/image.js +6 -0
- package/lib/i18n/en-US/components/navigation/index.d.ts +10 -0
- package/lib/i18n/en-US/components/navigation/index.js +8 -0
- package/lib/i18n/en-US/components/navigation/user_upload.d.ts +4 -0
- package/lib/i18n/en-US/components/navigation/user_upload.js +5 -0
- package/lib/i18n/en-US/components/settings/clickable_icon.d.ts +6 -0
- package/lib/i18n/en-US/components/settings/clickable_icon.js +7 -0
- package/lib/i18n/en-US/components/settings/image.d.ts +2 -0
- package/lib/i18n/en-US/components/settings/image.js +3 -0
- package/lib/i18n/en-US/components/settings/index.d.ts +39 -0
- package/lib/i18n/en-US/components/settings/index.js +14 -0
- package/lib/i18n/en-US/components/settings/text_editor.d.ts +8 -0
- package/lib/i18n/en-US/components/settings/text_editor.js +9 -0
- package/lib/i18n/en-US/components/settings/user_upload.d.ts +12 -0
- package/lib/i18n/en-US/components/settings/user_upload.js +13 -0
- package/lib/i18n/en-US/components/settings/video.d.ts +13 -0
- package/lib/i18n/en-US/components/settings/video.js +14 -0
- package/lib/i18n/en-US/components/utils/index.d.ts +15 -0
- package/lib/i18n/en-US/components/utils/index.js +6 -0
- package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.d.ts +13 -0
- package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.js +14 -0
- package/lib/i18n/en-US/index.d.ts +197 -0
- package/lib/i18n/en-US/index.js +16 -0
- package/lib/i18n/en-US/modules/index.d.ts +2 -0
- package/lib/i18n/en-US/modules/index.js +6 -0
- package/lib/i18n/en-US/pages/glossary.d.ts +8 -0
- package/lib/i18n/en-US/pages/glossary.js +9 -0
- package/lib/i18n/en-US/pages/index.d.ts +13 -0
- package/lib/i18n/en-US/pages/index.js +8 -0
- package/lib/i18n/en-US/pages/user_upload.d.ts +4 -0
- package/lib/i18n/en-US/pages/user_upload.js +5 -0
- package/lib/i18n/en-US/shared/content_blocks.d.ts +20 -0
- package/lib/i18n/en-US/shared/content_blocks.js +21 -0
- package/lib/i18n/en-US/shared/index.d.ts +39 -0
- package/lib/i18n/en-US/shared/index.js +10 -0
- package/lib/i18n/en-US/shared/menu.d.ts +4 -0
- package/lib/i18n/en-US/shared/menu.js +5 -0
- package/lib/i18n/en-US/shared/settings.d.ts +15 -0
- package/lib/i18n/en-US/shared/settings.js +16 -0
- package/lib/i18n/en-US.d.ts +197 -0
- package/lib/i18n/en-US.js +15 -0
- package/lib/models/UserFileAsset.d.ts +5 -0
- package/lib/models/UserFileAsset.js +37 -0
- package/package.json +2 -2
- package/plugin.js +20 -0
- package/test/Components/Content/Blocks/FileDownload.spec.js +25 -0
- package/test/Components/Content/Blocks/Video.spec.js +0 -22
- package/test/Components/Settings/FileDownloadSettings.spec.js +20 -0
- package/test/Components/Settings/UserUploadSettings.spec.js +1 -1
- package/utils/index.js +2 -0
|
@@ -0,0 +1,58 @@
|
|
|
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>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/windward-ui-plugin-core.iml" filepath="$PROJECT_DIR$/.idea/windward-ui-plugin-core.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="PhpDockerContainerSettings">
|
|
4
|
+
<list>
|
|
5
|
+
<map>
|
|
6
|
+
<entry key="79d59a8f-c56c-4789-b96c-e55a326ab125">
|
|
7
|
+
<value>
|
|
8
|
+
<DockerContainerSettings>
|
|
9
|
+
<option name="version" value="1" />
|
|
10
|
+
<option name="volumeBindings">
|
|
11
|
+
<list>
|
|
12
|
+
<DockerVolumeBindingImpl>
|
|
13
|
+
<option name="containerPath" value="/opt/project" />
|
|
14
|
+
<option name="hostPath" value="$PROJECT_DIR$" />
|
|
15
|
+
</DockerVolumeBindingImpl>
|
|
16
|
+
</list>
|
|
17
|
+
</option>
|
|
18
|
+
</DockerContainerSettings>
|
|
19
|
+
</value>
|
|
20
|
+
</entry>
|
|
21
|
+
</map>
|
|
22
|
+
</list>
|
|
23
|
+
</component>
|
|
24
|
+
</project>
|
package/.idea/php.xml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="MessDetectorOptionsConfiguration">
|
|
4
|
+
<option name="transferred" value="true" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="PHPCSFixerOptionsConfiguration">
|
|
7
|
+
<option name="transferred" value="true" />
|
|
8
|
+
</component>
|
|
9
|
+
<component name="PHPCodeSnifferOptionsConfiguration">
|
|
10
|
+
<option name="highlightLevel" value="WARNING" />
|
|
11
|
+
<option name="transferred" value="true" />
|
|
12
|
+
</component>
|
|
13
|
+
<component name="PhpStanOptionsConfiguration">
|
|
14
|
+
<option name="transferred" value="true" />
|
|
15
|
+
</component>
|
|
16
|
+
<component name="PsalmOptionsConfiguration">
|
|
17
|
+
<option name="transferred" value="true" />
|
|
18
|
+
</component>
|
|
19
|
+
</project>
|
package/.idea/vcs.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$" />
|
|
5
|
+
<orderEntry type="inheritedJdk" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
</component>
|
|
8
|
+
</module>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
image: atlassian/default-image:3
|
|
2
|
+
|
|
3
|
+
pipelines:
|
|
4
|
+
custom:
|
|
5
|
+
create-release:
|
|
6
|
+
import: infrastructure-automation:master:create-release
|
|
7
|
+
publish-release:
|
|
8
|
+
import: infrastructure-automation:master:publish-release
|
|
9
|
+
|
|
10
|
+
branches:
|
|
11
|
+
"release/*":
|
|
12
|
+
import: infrastructure-automation:master:auto-update
|
|
13
|
+
"hotfix/*":
|
|
14
|
+
import: infrastructure-automation:master:auto-update
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<v-expansion-panels
|
|
4
|
-
|
|
4
|
+
:value="selectedPanels"
|
|
5
5
|
flat
|
|
6
6
|
accordion
|
|
7
7
|
focusable
|
|
@@ -101,9 +101,6 @@ export default {
|
|
|
101
101
|
this.block.metadata.config.items = []
|
|
102
102
|
this.block.metadata.config.items.push(defaultObject)
|
|
103
103
|
}
|
|
104
|
-
if (_.isEmpty(this.block.metadata.config.selectedPanels)) {
|
|
105
|
-
this.block.metadata.config.selectedPanels = 0
|
|
106
|
-
}
|
|
107
104
|
this.block.body = this.$t(
|
|
108
105
|
'windward.core.shared.content_blocks.title.accordion'
|
|
109
106
|
)
|
|
@@ -112,7 +109,7 @@ export default {
|
|
|
112
109
|
return {
|
|
113
110
|
expansionPanelKey: '0',
|
|
114
111
|
editingInContentItem: false,
|
|
115
|
-
selectedPanels:
|
|
112
|
+
selectedPanels: null,
|
|
116
113
|
}
|
|
117
114
|
},
|
|
118
115
|
watch: {
|
|
@@ -125,6 +122,7 @@ export default {
|
|
|
125
122
|
this.selectedPanels = newValue.metadata.config.selectedPanels
|
|
126
123
|
this.expansionPanelKey = Crypto.id()
|
|
127
124
|
}
|
|
125
|
+
|
|
128
126
|
const length = newValue.metadata.config.items.length
|
|
129
127
|
let counter = 0
|
|
130
128
|
newValue.metadata.config.items.forEach((element) => {
|
|
@@ -148,10 +146,16 @@ export default {
|
|
|
148
146
|
this.block.metadata.config.items.forEach((element) => {
|
|
149
147
|
element.expand = false
|
|
150
148
|
})
|
|
151
|
-
this.selectedPanels =
|
|
149
|
+
this.selectedPanels = null
|
|
152
150
|
}
|
|
153
151
|
},
|
|
154
152
|
},
|
|
153
|
+
mounted() {
|
|
154
|
+
if (this.render) {
|
|
155
|
+
// ensure panels are always loaded closed
|
|
156
|
+
this.selectedPanels = null
|
|
157
|
+
}
|
|
158
|
+
},
|
|
155
159
|
methods: {
|
|
156
160
|
getImagePublicUrl(asset) {
|
|
157
161
|
const foundAsset = this.resolveAsset(asset)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<v-container>
|
|
3
|
+
<v-container class="pa-0">
|
|
4
4
|
<h2>{{ block.metadata.config.title }}</h2>
|
|
5
5
|
|
|
6
6
|
<h4>{{ block.metadata.config.description }}</h4>
|
|
@@ -13,14 +13,15 @@
|
|
|
13
13
|
}}
|
|
14
14
|
</p>
|
|
15
15
|
</v-container>
|
|
16
|
-
<v-container>
|
|
16
|
+
<v-container class="pa-0">
|
|
17
17
|
<v-row
|
|
18
18
|
v-for="(item, itemIndex) in block.metadata.config.items"
|
|
19
19
|
:key="itemIndex"
|
|
20
20
|
no-gutters
|
|
21
21
|
:class="rowClass(itemIndex)"
|
|
22
|
+
class="pa-0"
|
|
22
23
|
>
|
|
23
|
-
<v-col cols="12" v-bind="iconColumnAttrs"
|
|
24
|
+
<v-col cols="12" v-bind="iconColumnAttrs">
|
|
24
25
|
<button
|
|
25
26
|
:class="activatorButtonClass(itemIndex)"
|
|
26
27
|
@click="item.active = !item.active"
|
|
@@ -144,14 +145,14 @@ export default {
|
|
|
144
145
|
if (this.block.metadata.config.display.large_icon) {
|
|
145
146
|
return {
|
|
146
147
|
xl: '3',
|
|
147
|
-
lg: '
|
|
148
|
+
lg: '3',
|
|
148
149
|
md: '4',
|
|
149
150
|
sm: '4',
|
|
150
151
|
}
|
|
151
152
|
} else {
|
|
152
153
|
return {
|
|
153
154
|
xl: '2',
|
|
154
|
-
lg: '
|
|
155
|
+
lg: '2',
|
|
155
156
|
md: '3',
|
|
156
157
|
sm: '3',
|
|
157
158
|
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-list>
|
|
3
|
+
<v-list-item
|
|
4
|
+
v-for="(item, index) in value"
|
|
5
|
+
:key="item.file.id + '-' + index"
|
|
6
|
+
:data-activator="'file-link-item-' + index"
|
|
7
|
+
class="pa-0"
|
|
8
|
+
dense
|
|
9
|
+
@click="onClickFile(item)"
|
|
10
|
+
>
|
|
11
|
+
<v-list-item-icon class="mx-3">
|
|
12
|
+
<v-icon>mdi-file-download</v-icon>
|
|
13
|
+
</v-list-item-icon>
|
|
14
|
+
|
|
15
|
+
<v-list-item-content class="text-link py-0"
|
|
16
|
+
>{{ filename(item) }}
|
|
17
|
+
</v-list-item-content>
|
|
18
|
+
|
|
19
|
+
<v-tooltip
|
|
20
|
+
left
|
|
21
|
+
eager
|
|
22
|
+
:activator="'[data-activator=file-link-item-' + index + ']'"
|
|
23
|
+
>
|
|
24
|
+
<span>{{ item.file.asset.metadata.size | humanFilesize }}</span>
|
|
25
|
+
</v-tooltip>
|
|
26
|
+
</v-list-item>
|
|
27
|
+
</v-list>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import _ from 'lodash'
|
|
32
|
+
import Download from '~/helpers/Download'
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
name: 'DisplayFileLinks',
|
|
36
|
+
components: {},
|
|
37
|
+
props: {
|
|
38
|
+
value: {
|
|
39
|
+
type: Array,
|
|
40
|
+
required: false,
|
|
41
|
+
default: () => {
|
|
42
|
+
return []
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
data() {
|
|
47
|
+
return {
|
|
48
|
+
Download,
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
filename() {
|
|
53
|
+
return (item) => {
|
|
54
|
+
const extension = _.get(
|
|
55
|
+
item,
|
|
56
|
+
'file.asset.metadata.extension',
|
|
57
|
+
''
|
|
58
|
+
)
|
|
59
|
+
let filename = ''
|
|
60
|
+
// Resolve the filename from either the user defined or from the fileasset itself
|
|
61
|
+
if (item.name) {
|
|
62
|
+
// If we're defining a custom name make sure the file has the extension on it so users know what it is
|
|
63
|
+
filename = item.name
|
|
64
|
+
filename =
|
|
65
|
+
filename.replace(new RegExp(extension + '$'), '') +
|
|
66
|
+
'.' +
|
|
67
|
+
extension
|
|
68
|
+
} else {
|
|
69
|
+
filename = item.file.name || item.file.asset.name
|
|
70
|
+
}
|
|
71
|
+
return filename
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
mounted() {},
|
|
76
|
+
methods: {
|
|
77
|
+
onClickFile(item) {
|
|
78
|
+
Download.url(item.file.asset.public_url, this.filename(item))
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
}
|
|
82
|
+
</script>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-card>
|
|
3
|
+
<v-card-text>
|
|
4
|
+
<v-simple-table>
|
|
5
|
+
<template #default>
|
|
6
|
+
<thead>
|
|
7
|
+
<tr>
|
|
8
|
+
<th>
|
|
9
|
+
{{ $t('shared.file.name') }}
|
|
10
|
+
</th>
|
|
11
|
+
<th>
|
|
12
|
+
{{ $t('shared.file.size') }}
|
|
13
|
+
</th>
|
|
14
|
+
<th>
|
|
15
|
+
{{ $t('shared.file.download') }}
|
|
16
|
+
</th>
|
|
17
|
+
</tr>
|
|
18
|
+
</thead>
|
|
19
|
+
<tbody>
|
|
20
|
+
<tr
|
|
21
|
+
v-for="(item, index) in value"
|
|
22
|
+
:key="item.file.id + '-' + index"
|
|
23
|
+
>
|
|
24
|
+
<td>
|
|
25
|
+
{{ filename(item) }}
|
|
26
|
+
</td>
|
|
27
|
+
<td>
|
|
28
|
+
{{
|
|
29
|
+
item.file.asset.metadata.size
|
|
30
|
+
| humanFilesize
|
|
31
|
+
}}
|
|
32
|
+
</td>
|
|
33
|
+
<td>
|
|
34
|
+
<v-btn
|
|
35
|
+
link
|
|
36
|
+
elevation="0"
|
|
37
|
+
@click="
|
|
38
|
+
Download.url(
|
|
39
|
+
item.file.asset.public_url,
|
|
40
|
+
item.file.name
|
|
41
|
+
)
|
|
42
|
+
"
|
|
43
|
+
>
|
|
44
|
+
<v-icon>mdi-download</v-icon>
|
|
45
|
+
<span class="sr-only">
|
|
46
|
+
{{ $t('shared.file.download') }}
|
|
47
|
+
</span>
|
|
48
|
+
</v-btn>
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
</tbody>
|
|
52
|
+
</template>
|
|
53
|
+
</v-simple-table>
|
|
54
|
+
</v-card-text>
|
|
55
|
+
</v-card>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script>
|
|
59
|
+
import _ from 'lodash'
|
|
60
|
+
import Download from '~/helpers/Download'
|
|
61
|
+
|
|
62
|
+
export default {
|
|
63
|
+
name: 'DisplayFilesTable',
|
|
64
|
+
components: {},
|
|
65
|
+
props: {
|
|
66
|
+
value: {
|
|
67
|
+
type: Array,
|
|
68
|
+
required: false,
|
|
69
|
+
default: () => {
|
|
70
|
+
return []
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
data() {
|
|
75
|
+
return {
|
|
76
|
+
Download,
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
computed: {
|
|
80
|
+
filename() {
|
|
81
|
+
return (item) => {
|
|
82
|
+
const extension = _.get(
|
|
83
|
+
item,
|
|
84
|
+
'file.asset.metadata.extension',
|
|
85
|
+
''
|
|
86
|
+
)
|
|
87
|
+
let filename = ''
|
|
88
|
+
// Resolve the filename from either the user defined or from the fileasset itself
|
|
89
|
+
if (item.name) {
|
|
90
|
+
// If we're defining a custom name make sure the file has the extension on it so users know what it is
|
|
91
|
+
filename = item.name
|
|
92
|
+
filename =
|
|
93
|
+
filename.replace(new RegExp(extension + '$'), '') +
|
|
94
|
+
'.' +
|
|
95
|
+
extension
|
|
96
|
+
} else {
|
|
97
|
+
filename = item.file.name || item.file.asset.name
|
|
98
|
+
}
|
|
99
|
+
return filename
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
mounted() {},
|
|
104
|
+
methods: {},
|
|
105
|
+
}
|
|
106
|
+
</script>
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container>
|
|
3
|
+
<h2>
|
|
4
|
+
{{
|
|
5
|
+
block.metadata.config.title ||
|
|
6
|
+
$t(
|
|
7
|
+
'windward.core.components.content.blocks.file_download.default_title'
|
|
8
|
+
)
|
|
9
|
+
}}
|
|
10
|
+
</h2>
|
|
11
|
+
<p v-if="!block.metadata.config.instructions">
|
|
12
|
+
{{
|
|
13
|
+
$t(
|
|
14
|
+
'windward.core.components.content.blocks.file_download.default_instructions'
|
|
15
|
+
)
|
|
16
|
+
}}
|
|
17
|
+
</p>
|
|
18
|
+
<TextViewer
|
|
19
|
+
v-if="block.metadata.config.instructions"
|
|
20
|
+
:value="block.metadata.config.instructions"
|
|
21
|
+
/>
|
|
22
|
+
<v-alert
|
|
23
|
+
v-if="
|
|
24
|
+
!block.metadata.config.items ||
|
|
25
|
+
block.metadata.config.items.length === 0
|
|
26
|
+
"
|
|
27
|
+
type="warning"
|
|
28
|
+
>
|
|
29
|
+
{{
|
|
30
|
+
$t(
|
|
31
|
+
'windward.core.components.content.blocks.file_download.no_files'
|
|
32
|
+
)
|
|
33
|
+
}}
|
|
34
|
+
</v-alert>
|
|
35
|
+
<FileTable
|
|
36
|
+
v-if="
|
|
37
|
+
block.metadata.config.display_detailed &&
|
|
38
|
+
block.metadata.config.items &&
|
|
39
|
+
block.metadata.config.items.length !== 0
|
|
40
|
+
"
|
|
41
|
+
:value="resolvedItemAssets"
|
|
42
|
+
></FileTable>
|
|
43
|
+
<FileLinks
|
|
44
|
+
v-if="
|
|
45
|
+
!block.metadata.config.display_detailed &&
|
|
46
|
+
block.metadata.config.items &&
|
|
47
|
+
block.metadata.config.items.length !== 0
|
|
48
|
+
"
|
|
49
|
+
:value="resolvedItemAssets"
|
|
50
|
+
></FileLinks>
|
|
51
|
+
</v-container>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script>
|
|
55
|
+
import _ from 'lodash'
|
|
56
|
+
import { mapGetters } from 'vuex'
|
|
57
|
+
import TextViewer from '~/components/Text/TextViewer'
|
|
58
|
+
import TextEditor from '~/components/Text/TextEditor'
|
|
59
|
+
import Download from '~/helpers/Download'
|
|
60
|
+
|
|
61
|
+
import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
|
|
62
|
+
import FileTable from './FileDownload/FileTable.vue'
|
|
63
|
+
import FileLinks from './FileDownload/FileLinks.vue'
|
|
64
|
+
|
|
65
|
+
export default {
|
|
66
|
+
name: 'FileDownloadBlock',
|
|
67
|
+
components: {
|
|
68
|
+
TextEditor,
|
|
69
|
+
TextViewer,
|
|
70
|
+
FileTable,
|
|
71
|
+
FileLinks,
|
|
72
|
+
},
|
|
73
|
+
extends: BaseContentBlock,
|
|
74
|
+
data() {
|
|
75
|
+
return {
|
|
76
|
+
Download,
|
|
77
|
+
saveState: false, // Override the base block to disable state saving
|
|
78
|
+
valid: true,
|
|
79
|
+
loading: false,
|
|
80
|
+
uploadFiles: [],
|
|
81
|
+
userFileAsset: {},
|
|
82
|
+
studentUpload: null,
|
|
83
|
+
maxFileLimit: 10,
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
computed: {
|
|
87
|
+
...mapGetters({
|
|
88
|
+
enrollment: 'enrollment/get',
|
|
89
|
+
}),
|
|
90
|
+
resolvedItemAssets() {
|
|
91
|
+
const items = []
|
|
92
|
+
for (const index in this.block.metadata.config.items) {
|
|
93
|
+
// Skip items missing a file since we're probably adding a new one in the settings
|
|
94
|
+
if (_.isEmpty(this.block.metadata.config.items[index].file)) {
|
|
95
|
+
continue
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const item = {
|
|
99
|
+
name: this.block.metadata.config.items[index].name,
|
|
100
|
+
file: this.resolveAsset(
|
|
101
|
+
this.block.metadata.config.items[index].file
|
|
102
|
+
),
|
|
103
|
+
}
|
|
104
|
+
items.push(item)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return items
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
beforeMount() {
|
|
111
|
+
if (_.isEmpty(this.block)) {
|
|
112
|
+
this.block = {}
|
|
113
|
+
}
|
|
114
|
+
if (_.isEmpty(this.block.body)) {
|
|
115
|
+
this.block.body = this.$t(
|
|
116
|
+
'windward.core.shared.content_blocks.title.file_download'
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
if (_.isEmpty(this.block.metadata)) {
|
|
120
|
+
this.block.metadata = {}
|
|
121
|
+
}
|
|
122
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
123
|
+
this.block.metadata.config = {}
|
|
124
|
+
}
|
|
125
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
126
|
+
this.block.metadata.config.title = this.$t(
|
|
127
|
+
'windward.core.components.content.blocks.file_download.default_title'
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
131
|
+
this.block.metadata.config.instructions = this.$t(
|
|
132
|
+
'windward.core.components.content.blocks.file_download.default_instructions'
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
if (!_.isBoolean(this.block.metadata.config.display_detailed)) {
|
|
136
|
+
this.block.metadata.config.display_detailed = false
|
|
137
|
+
}
|
|
138
|
+
if (_.isEmpty(this.block.metadata.config.items)) {
|
|
139
|
+
this.block.metadata.config.items = []
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
mounted() {},
|
|
143
|
+
methods: {},
|
|
144
|
+
}
|
|
145
|
+
</script>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-btn
|
|
3
|
+
elevation="0"
|
|
4
|
+
color="primary"
|
|
5
|
+
icon
|
|
6
|
+
@click="generateAIQuestion"
|
|
7
|
+
:loading="isLoading"
|
|
8
|
+
:disabled="isLoading"
|
|
9
|
+
>
|
|
10
|
+
<v-icon v-if="!isLoading">mdi-magic-staff</v-icon>
|
|
11
|
+
<template v-slot:loader>
|
|
12
|
+
<v-progress-circular indeterminate size="23"></v-progress-circular>
|
|
13
|
+
</template>
|
|
14
|
+
</v-btn>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import AssessmentQuestion from '~/models/AssessmentQuestion'
|
|
19
|
+
import Course from '~/models/Course'
|
|
20
|
+
import Assessment from '~/models/Assessment'
|
|
21
|
+
import Content from '~/models/Content'
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
name: 'GenerateAIQuestionButton',
|
|
25
|
+
props: {
|
|
26
|
+
course: { type: Object, required: true },
|
|
27
|
+
content: { type: Object, required: true },
|
|
28
|
+
block: { type: Object, required: true },
|
|
29
|
+
questionType: { type: String, required: true },
|
|
30
|
+
},
|
|
31
|
+
data() {
|
|
32
|
+
return {
|
|
33
|
+
isLoading: false,
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
async generateAIQuestion() {
|
|
38
|
+
this.isLoading = true
|
|
39
|
+
try {
|
|
40
|
+
const response = await AssessmentQuestion.custom(
|
|
41
|
+
new Course(this.course),
|
|
42
|
+
new Content(this.content),
|
|
43
|
+
new Assessment({ id: this.block.id }),
|
|
44
|
+
new AssessmentQuestion(),
|
|
45
|
+
`suggest/${this.questionType}`
|
|
46
|
+
).get()
|
|
47
|
+
|
|
48
|
+
if (response && response.length > 0) {
|
|
49
|
+
const generatedQuestion = response[0]
|
|
50
|
+
this.$emit('click:generate', generatedQuestion)
|
|
51
|
+
}
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.error(error)
|
|
54
|
+
this.$dialog.error(this.$t('windward.core.components.content.blocks.generate_questions.error'))
|
|
55
|
+
} finally {
|
|
56
|
+
this.isLoading = false
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
</script>
|