@windward/core 0.6.0 → 0.8.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/CHANGELOG.md +8 -1
- package/components/Content/Blocks/Accordion.vue +22 -0
- package/components/Content/Blocks/BlockQuote.vue +6 -2
- package/components/Content/Blocks/ClickableIcons.vue +19 -4
- package/components/Content/Blocks/Email.vue +12 -3
- package/components/Content/Blocks/GenerateAIQuestionButton.vue +14 -6
- package/components/Content/Blocks/HorizontalRule.vue +3 -4
- package/components/Content/Blocks/OpenResponse.vue +25 -0
- package/components/Content/Blocks/OpenResponseCollate.vue +13 -12
- package/components/Content/Blocks/ScenarioChoice.vue +66 -33
- package/components/Content/Blocks/Tab.vue +19 -0
- package/components/Content/Blocks/UserUpload.vue +5 -10
- package/components/Content/Blocks/Video.vue +129 -15
- package/components/Settings/AccordionSettings.vue +52 -13
- package/components/Settings/BlockQuoteSettings.vue +17 -33
- package/components/Settings/ClickableIconsSettings.vue +37 -23
- package/components/Settings/EmailSettings.vue +12 -30
- package/components/Settings/FileDownloadSettings.vue +12 -31
- package/components/Settings/HorizontalRuleSettings.vue +0 -3
- package/components/Settings/ImageSettings.vue +3 -9
- package/components/Settings/OpenResponseCollateSettings.vue +47 -55
- package/components/Settings/OpenResponseSettings.vue +62 -36
- package/components/Settings/ScenarioChoiceSettings.vue +22 -29
- package/components/Settings/TabSettings.vue +99 -81
- package/components/Settings/UserUploadSettings.vue +16 -42
- package/components/Settings/VideoSettings/SourcePicker.vue +223 -0
- package/components/Settings/VideoSettings.vue +115 -195
- package/components/utils/TinyMCEWrapper.vue +9 -5
- package/components/utils/assets/tinymce/content/global.scss +14 -0
- package/components/utils/glossary/CourseGlossary.vue +52 -27
- package/helpers/GlossaryHelper.ts +12 -2
- package/helpers/tinymce/WindwardPlugins.ts +59 -10
- package/i18n/en-US/components/content/blocks/generate_questions.ts +2 -1
- package/i18n/en-US/components/content/blocks/video.ts +2 -51
- package/i18n/en-US/components/settings/accordion.ts +1 -0
- package/i18n/en-US/components/settings/open_response_collate.ts +1 -1
- package/i18n/en-US/components/settings/scenario_choice.ts +3 -2
- package/i18n/en-US/components/settings/tab.ts +1 -0
- package/i18n/en-US/components/settings/user_upload.ts +1 -0
- package/i18n/en-US/components/settings/video.ts +51 -0
- package/i18n/en-US/components/utils/tiny_mce_wrapper.ts +9 -1
- package/i18n/en-US/shared/settings.ts +1 -1
- package/i18n/es-ES/components/content/blocks/generate_questions.ts +2 -1
- package/i18n/es-ES/components/content/blocks/video.ts +3 -53
- package/i18n/es-ES/components/settings/accordion.ts +1 -0
- package/i18n/es-ES/components/settings/open_response_collate.ts +1 -1
- package/i18n/es-ES/components/settings/scenario_choice.ts +3 -2
- package/i18n/es-ES/components/settings/tab.ts +2 -0
- package/i18n/es-ES/components/settings/user_upload.ts +1 -0
- package/i18n/es-ES/components/settings/video.ts +53 -0
- package/i18n/es-ES/components/utils/tiny_mce_wrapper.ts +9 -0
- package/i18n/es-ES/shared/settings.ts +1 -1
- package/i18n/sv-SE/components/content/blocks/generate_questions.ts +2 -1
- package/i18n/sv-SE/components/content/blocks/video.ts +2 -51
- package/i18n/sv-SE/components/settings/accordion.ts +2 -0
- package/i18n/sv-SE/components/settings/open_response_collate.ts +1 -1
- package/i18n/sv-SE/components/settings/scenario_choice.ts +3 -2
- package/i18n/sv-SE/components/settings/tab.ts +1 -0
- package/i18n/sv-SE/components/settings/user_upload.ts +1 -0
- package/i18n/sv-SE/components/settings/video.ts +51 -0
- package/i18n/sv-SE/components/utils/tiny_mce_wrapper.ts +8 -0
- package/package.json +3 -2
- package/plugin.js +1 -1
- package/test/__mocks__/modelMock.js +1 -1
- package/test/helpers/GlossaryHelper.spec.js +22 -3
- package/test/mocks.js +8 -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/config/menu.config.json +0 -475
- 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
|
@@ -1,78 +1,93 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
v-model="block.metadata.config.
|
|
7
|
-
|
|
3
|
+
<v-row class="pl-3 pr-3">
|
|
4
|
+
<v-text-field
|
|
5
|
+
id="block-settings-title"
|
|
6
|
+
v-model="block.metadata.config.title"
|
|
7
|
+
:autofocus="true"
|
|
8
|
+
:rules="$Validation.getRule('block.title')"
|
|
9
|
+
:counter="$Validation.getLimit('block.title')"
|
|
10
|
+
outlined
|
|
11
|
+
:label="
|
|
12
|
+
$t('windward.core.components.settings.clickable_icon.title')
|
|
13
|
+
"
|
|
8
14
|
:disabled="render"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
15
|
+
></v-text-field>
|
|
16
|
+
<v-textarea
|
|
17
|
+
id="block-settings-instructions"
|
|
18
|
+
v-model="block.metadata.config.instructions"
|
|
19
|
+
:rules="$Validation.getRule('block.instructions')"
|
|
20
|
+
:counter="$Validation.getLimit('block.instructions')"
|
|
21
|
+
outlined
|
|
22
|
+
:label="$t('components.content.settings.base.instructions')"
|
|
23
|
+
:disabled="render"
|
|
24
|
+
></v-textarea>
|
|
25
|
+
</v-row>
|
|
26
|
+
<v-divider class="my-4 primary"></v-divider>
|
|
27
|
+
<p>{{ $t('windward.core.components.settings.tab.tabs') }}</p>
|
|
28
|
+
<SortableExpansionPanel
|
|
29
|
+
v-model="block.metadata.config.items"
|
|
30
|
+
v-bind:currentPanel.sync="block.metadata.config.currentTab"
|
|
31
|
+
:disabled="render"
|
|
32
|
+
@change="onDragged"
|
|
33
|
+
@click:close="onRemoveElement($event)"
|
|
34
|
+
>
|
|
35
|
+
<template #header="{ item }">
|
|
36
|
+
{{ item.tabHeader !== '' ? item.tabHeader : 'No Header' }}
|
|
37
|
+
</template>
|
|
38
|
+
<template #body="{ item, index }">
|
|
39
|
+
<v-container :key="expansionPanelKey">
|
|
40
|
+
<p class="p-label">
|
|
41
|
+
{{ $t('windward.core.components.settings.tab.header') }}
|
|
42
|
+
</p>
|
|
43
|
+
<v-text-field
|
|
44
|
+
outlined
|
|
45
|
+
:autofocus="true"
|
|
46
|
+
v-model="block.metadata.config.items[index].tabHeader"
|
|
47
|
+
:rules="$Validation.getRule('shortInput')"
|
|
48
|
+
:counter="$Validation.getLimit('shortInput')"
|
|
49
|
+
:label="'item ' + (index + 1)"
|
|
50
|
+
:disabled="render"
|
|
51
|
+
></v-text-field>
|
|
52
|
+
<v-btn
|
|
53
|
+
@click="onToggleExpand(index)"
|
|
54
|
+
text
|
|
55
|
+
elevation="0"
|
|
56
|
+
class="mb-3"
|
|
57
|
+
:disabled="render"
|
|
58
|
+
>
|
|
59
|
+
<v-icon
|
|
60
|
+
v-if="!block.metadata.config.items[index].expand"
|
|
61
|
+
color="primary"
|
|
62
|
+
>mdi-arrow-expand-all</v-icon
|
|
63
|
+
>
|
|
64
|
+
<v-icon
|
|
65
|
+
v-if="block.metadata.config.items[index].expand"
|
|
66
|
+
color="primary"
|
|
41
67
|
>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<v-row justify="center" class="my-4">
|
|
66
|
-
<v-btn
|
|
67
|
-
color="primary"
|
|
68
|
-
elevation="0"
|
|
69
|
-
:disabled="render"
|
|
70
|
-
@click="onAddElement"
|
|
71
|
-
>
|
|
72
|
-
<v-icon>mdi-plus</v-icon>
|
|
73
|
-
{{ $t('windward.core.components.settings.tab.add_tab') }}
|
|
74
|
-
</v-btn>
|
|
75
|
-
</v-row>
|
|
68
|
+
mdi-arrow-collapse-all
|
|
69
|
+
</v-icon>
|
|
70
|
+
</v-btn>
|
|
71
|
+
<TextEditor
|
|
72
|
+
v-model="block.metadata.config.items[index].content"
|
|
73
|
+
v-if="!item.expand"
|
|
74
|
+
:key="textEditorUpdateKey"
|
|
75
|
+
:disabled="render"
|
|
76
|
+
></TextEditor>
|
|
77
|
+
</v-container>
|
|
78
|
+
</template>
|
|
79
|
+
</SortableExpansionPanel>
|
|
80
|
+
<v-row justify="center" class="my-4">
|
|
81
|
+
<v-btn
|
|
82
|
+
color="primary"
|
|
83
|
+
elevation="0"
|
|
84
|
+
:disabled="render"
|
|
85
|
+
@click="onAddElement"
|
|
86
|
+
>
|
|
87
|
+
<v-icon>mdi-plus</v-icon>
|
|
88
|
+
{{ $t('windward.core.components.settings.tab.add_tab') }}
|
|
89
|
+
</v-btn>
|
|
90
|
+
</v-row>
|
|
76
91
|
<div v-if="loading" class="text-center">
|
|
77
92
|
<v-progress-circular
|
|
78
93
|
:size="70"
|
|
@@ -90,6 +105,7 @@ import Crypto from '~/helpers/Crypto'
|
|
|
90
105
|
import TextEditor from '~/components/Text/TextEditor'
|
|
91
106
|
import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
|
|
92
107
|
import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
|
|
108
|
+
import Uuid from '~/helpers/Uuid'
|
|
93
109
|
|
|
94
110
|
export default {
|
|
95
111
|
name: 'TabSettings',
|
|
@@ -110,6 +126,18 @@ export default {
|
|
|
110
126
|
if (_.isEmpty(this.block.metadata.config)) {
|
|
111
127
|
this.block.metadata.config = {}
|
|
112
128
|
}
|
|
129
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
130
|
+
this.block.metadata.config.title = ''
|
|
131
|
+
}
|
|
132
|
+
if (
|
|
133
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
134
|
+
this.block.id &&
|
|
135
|
+
!Uuid.test(this.block.id)
|
|
136
|
+
) {
|
|
137
|
+
this.block.metadata.config.instructions = this.$t(
|
|
138
|
+
'windward.core.components.settings.tab.instructions'
|
|
139
|
+
)
|
|
140
|
+
}
|
|
113
141
|
if (_.isEmpty(this.block.metadata.config.currentTab)) {
|
|
114
142
|
this.block.metadata.config.currentTab = 0
|
|
115
143
|
}
|
|
@@ -129,16 +157,6 @@ export default {
|
|
|
129
157
|
textEditorUpdateKey: Crypto.id(),
|
|
130
158
|
valid: true,
|
|
131
159
|
loading: false,
|
|
132
|
-
validation: {
|
|
133
|
-
headerRule: [
|
|
134
|
-
(v) =>
|
|
135
|
-
v.length <= 50 ||
|
|
136
|
-
this.$t(
|
|
137
|
-
'windward.core.shared.settings.errors.input_limitations',
|
|
138
|
-
[50]
|
|
139
|
-
),
|
|
140
|
-
],
|
|
141
|
-
},
|
|
142
160
|
}
|
|
143
161
|
},
|
|
144
162
|
mounted() {
|
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<v-text-field
|
|
4
|
+
id="block-settings-title"
|
|
4
5
|
v-model="block.metadata.config.title"
|
|
5
6
|
outlined
|
|
6
|
-
:rules="
|
|
7
|
-
:counter="
|
|
7
|
+
:rules="$Validation.getRule('block.title')"
|
|
8
|
+
:counter="$Validation.getLimit('block.title')"
|
|
8
9
|
:autofocus="true"
|
|
9
|
-
:label="$t('components.content.settings.base.
|
|
10
|
+
:label="$t('components.content.settings.base.title')"
|
|
10
11
|
:disabled="render"
|
|
11
12
|
></v-text-field>
|
|
12
|
-
<v-btn
|
|
13
|
-
elevation="0"
|
|
14
|
-
text
|
|
15
|
-
class="mb-4"
|
|
16
|
-
:disabled="render"
|
|
17
|
-
@click="block.__expandInstructions = !block.__expandInstructions"
|
|
18
|
-
>
|
|
19
|
-
<v-icon v-if="!block.__expandInstructions" color="primary"
|
|
20
|
-
>mdi-arrow-expand-all</v-icon
|
|
21
|
-
>
|
|
22
|
-
<v-icon v-if="block.__expandInstructions" color="primary">
|
|
23
|
-
mdi-arrow-collapse-all
|
|
24
|
-
</v-icon>
|
|
25
|
-
</v-btn>
|
|
26
13
|
<v-textarea
|
|
14
|
+
id="block-settings-instructions"
|
|
27
15
|
v-model="block.metadata.config.instructions"
|
|
28
|
-
:rules="
|
|
29
|
-
:counter="
|
|
16
|
+
:rules="$Validation.getRule('block.instructions')"
|
|
17
|
+
:counter="$Validation.getLimit('block.instructions')"
|
|
30
18
|
outlined
|
|
31
19
|
:label="$t('components.content.settings.base.instructions')"
|
|
32
20
|
:disabled="render"
|
|
@@ -60,6 +48,7 @@ import BaseContentSettings from '~/components/Content/Settings/BaseContentSettin
|
|
|
60
48
|
import Crypto from '~/helpers/Crypto'
|
|
61
49
|
import TextEditor from '~/components/Text/TextEditor'
|
|
62
50
|
import _ from 'lodash'
|
|
51
|
+
import Uuid from '~/helpers/Uuid'
|
|
63
52
|
|
|
64
53
|
export default {
|
|
65
54
|
name: 'UserUploadSettings',
|
|
@@ -70,9 +59,6 @@ export default {
|
|
|
70
59
|
this.block = {}
|
|
71
60
|
}
|
|
72
61
|
|
|
73
|
-
// Default the instructions to collapsed
|
|
74
|
-
this.block.__expandInstructions = false
|
|
75
|
-
|
|
76
62
|
if (_.isEmpty(this.block.body)) {
|
|
77
63
|
this.block.body = this.$t(
|
|
78
64
|
'windward.core.shared.content_blocks.title.user_upload'
|
|
@@ -87,8 +73,14 @@ export default {
|
|
|
87
73
|
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
88
74
|
this.block.metadata.config.title = ''
|
|
89
75
|
}
|
|
90
|
-
if (
|
|
91
|
-
this.block.metadata.config.instructions
|
|
76
|
+
if (
|
|
77
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
78
|
+
this.block.id &&
|
|
79
|
+
!Uuid.test(this.block.id)
|
|
80
|
+
) {
|
|
81
|
+
this.block.metadata.config.instructions = this.$t(
|
|
82
|
+
'windward.core.components.settings.user_upload.instructions'
|
|
83
|
+
)
|
|
92
84
|
}
|
|
93
85
|
if (_.isEmpty(this.block.metadata.config.uploadSettings)) {
|
|
94
86
|
this.block.metadata.config.uploadSettings = {
|
|
@@ -139,24 +131,6 @@ export default {
|
|
|
139
131
|
boilerplate: true,
|
|
140
132
|
elevation: 0,
|
|
141
133
|
},
|
|
142
|
-
validation: {
|
|
143
|
-
titleRules: [
|
|
144
|
-
(v) =>
|
|
145
|
-
v.length <= 50 ||
|
|
146
|
-
this.$t(
|
|
147
|
-
'windward.core.shared.settings.errors.input_limitations',
|
|
148
|
-
[50]
|
|
149
|
-
),
|
|
150
|
-
],
|
|
151
|
-
instructionRule: [
|
|
152
|
-
(v) =>
|
|
153
|
-
v.length <= 255 ||
|
|
154
|
-
this.$t(
|
|
155
|
-
'windward.core.shared.settings.errors.input_limitations',
|
|
156
|
-
[255]
|
|
157
|
-
),
|
|
158
|
-
],
|
|
159
|
-
},
|
|
160
134
|
}
|
|
161
135
|
},
|
|
162
136
|
mounted() {},
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<ContentBlockAsset
|
|
4
|
+
:value="source"
|
|
5
|
+
:assets="assets"
|
|
6
|
+
mimes="video/mp4,video/webm,video/youtube,audio/mpeg,audio/ogg,audio/webm,audio/wav"
|
|
7
|
+
allow-url
|
|
8
|
+
class="mb-4"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
@input="$emit('update:source', $event)"
|
|
11
|
+
@change="onSourceChange"
|
|
12
|
+
@update:assets="onUpdateAssets"
|
|
13
|
+
>
|
|
14
|
+
<template #title>
|
|
15
|
+
{{
|
|
16
|
+
sourceLabel ||
|
|
17
|
+
$t('windward.core.components.settings.video.place_source')
|
|
18
|
+
}}
|
|
19
|
+
</template>
|
|
20
|
+
<template #description>
|
|
21
|
+
{{
|
|
22
|
+
sourceDescription ||
|
|
23
|
+
$t(
|
|
24
|
+
'windward.core.components.settings.video.video.configure_blurb'
|
|
25
|
+
)
|
|
26
|
+
}}
|
|
27
|
+
</template>
|
|
28
|
+
</ContentBlockAsset>
|
|
29
|
+
|
|
30
|
+
<v-tooltip
|
|
31
|
+
v-if="
|
|
32
|
+
$PermissionService.userHasAccessTo(
|
|
33
|
+
'windward.global.file',
|
|
34
|
+
'writable'
|
|
35
|
+
)
|
|
36
|
+
"
|
|
37
|
+
top
|
|
38
|
+
color="primary"
|
|
39
|
+
>
|
|
40
|
+
<template #activator="{ on, attrs }">
|
|
41
|
+
<v-switch
|
|
42
|
+
v-model="sourceInherit"
|
|
43
|
+
:disabled="disabled || !source"
|
|
44
|
+
>
|
|
45
|
+
<template #label>
|
|
46
|
+
<span v-bind="attrs" v-on="on">
|
|
47
|
+
{{
|
|
48
|
+
$t(
|
|
49
|
+
'windward.core.components.settings.video.inherit_captions'
|
|
50
|
+
)
|
|
51
|
+
}}
|
|
52
|
+
<v-icon x-small class="help-offset-icon">
|
|
53
|
+
mdi-help
|
|
54
|
+
</v-icon>
|
|
55
|
+
</span>
|
|
56
|
+
</template>
|
|
57
|
+
</v-switch>
|
|
58
|
+
</template>
|
|
59
|
+
<span class="span-description">{{
|
|
60
|
+
$t(
|
|
61
|
+
'windward.core.components.settings.video.inherit_global_toggle_description'
|
|
62
|
+
)
|
|
63
|
+
}}</span>
|
|
64
|
+
</v-tooltip>
|
|
65
|
+
|
|
66
|
+
<v-alert v-if="sourceInherit && !hasLinkedCaptions" type="warning">
|
|
67
|
+
{{
|
|
68
|
+
$t(
|
|
69
|
+
'windward.core.components.settings.video.inherit_missing_captions'
|
|
70
|
+
)
|
|
71
|
+
}}
|
|
72
|
+
</v-alert>
|
|
73
|
+
|
|
74
|
+
<ContentBlockAsset
|
|
75
|
+
v-if="sourceInherit && hasLinkedCaptions"
|
|
76
|
+
:value="linkedCaptions"
|
|
77
|
+
:assets="assets"
|
|
78
|
+
disabled
|
|
79
|
+
></ContentBlockAsset>
|
|
80
|
+
|
|
81
|
+
<ContentBlockAsset
|
|
82
|
+
v-if="!sourceInherit"
|
|
83
|
+
:value="track"
|
|
84
|
+
:assets="assets"
|
|
85
|
+
mimes="text/vtt,text/xml"
|
|
86
|
+
allow-url
|
|
87
|
+
outlined
|
|
88
|
+
class="mb-4"
|
|
89
|
+
:disabled="disabled || sourceInherit || !source"
|
|
90
|
+
@input="$emit('update:track', $event)"
|
|
91
|
+
@change="onTrackChange"
|
|
92
|
+
@update:assets="$emit('update:assets', $event)"
|
|
93
|
+
>
|
|
94
|
+
<template #title>
|
|
95
|
+
{{
|
|
96
|
+
trackLabel ||
|
|
97
|
+
$t('windward.core.components.settings.video.caption.title')
|
|
98
|
+
}}
|
|
99
|
+
</template>
|
|
100
|
+
<template #description>
|
|
101
|
+
{{
|
|
102
|
+
trackDescription ||
|
|
103
|
+
$t(
|
|
104
|
+
'windward.core.components.settings.video.caption.configure_blurb'
|
|
105
|
+
)
|
|
106
|
+
}}
|
|
107
|
+
</template>
|
|
108
|
+
</ContentBlockAsset>
|
|
109
|
+
</div>
|
|
110
|
+
</template>
|
|
111
|
+
<script>
|
|
112
|
+
import _ from 'lodash'
|
|
113
|
+
import ContentBlockAsset from '~/components/Content/ContentBlockAsset.vue'
|
|
114
|
+
|
|
115
|
+
export default {
|
|
116
|
+
name: 'VideoSettingsSourcePicker',
|
|
117
|
+
components: { ContentBlockAsset },
|
|
118
|
+
props: {
|
|
119
|
+
source: {
|
|
120
|
+
type: Object,
|
|
121
|
+
required: false,
|
|
122
|
+
default: () => {
|
|
123
|
+
return {}
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
track: {
|
|
127
|
+
type: Object,
|
|
128
|
+
required: false,
|
|
129
|
+
default: () => {
|
|
130
|
+
return {}
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
assets: {
|
|
134
|
+
type: Array,
|
|
135
|
+
required: false,
|
|
136
|
+
default: () => {
|
|
137
|
+
return []
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
sourceLabel: {
|
|
141
|
+
type: String,
|
|
142
|
+
required: false,
|
|
143
|
+
default: '',
|
|
144
|
+
},
|
|
145
|
+
trackLabel: {
|
|
146
|
+
type: String,
|
|
147
|
+
required: false,
|
|
148
|
+
default: '',
|
|
149
|
+
},
|
|
150
|
+
sourceDescription: {
|
|
151
|
+
type: String,
|
|
152
|
+
required: false,
|
|
153
|
+
default: '',
|
|
154
|
+
},
|
|
155
|
+
trackDescription: {
|
|
156
|
+
type: String,
|
|
157
|
+
required: false,
|
|
158
|
+
default: '',
|
|
159
|
+
},
|
|
160
|
+
disabled: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
required: false,
|
|
163
|
+
default: false,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
data() {
|
|
167
|
+
return {
|
|
168
|
+
sourceInherit: true,
|
|
169
|
+
linkedCaptions: null,
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
computed: {
|
|
173
|
+
hasLinkedCaptions() {
|
|
174
|
+
return this.linkedCaptions !== null
|
|
175
|
+
},
|
|
176
|
+
linkedCaptionsName() {
|
|
177
|
+
return _.get(
|
|
178
|
+
this.linkedCaptions,
|
|
179
|
+
'asset.name',
|
|
180
|
+
_.get(this.linkedCaptions, 'asset.public_url', '???')
|
|
181
|
+
)
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
watch: {},
|
|
185
|
+
beforeMount() {},
|
|
186
|
+
mounted() {
|
|
187
|
+
this.linkedCaptions = this.getLinkedCaptions(this.source)
|
|
188
|
+
// Turn inherit switch on if there's a source and no tracks are enabled
|
|
189
|
+
this.sourceInherit = this.source && !this.track
|
|
190
|
+
},
|
|
191
|
+
methods: {
|
|
192
|
+
onSourceChange(file, rawFile) {
|
|
193
|
+
this.linkedCaptions = this.getLinkedCaptions(rawFile)
|
|
194
|
+
this.sourceInherit = this.linkedCaptions !== null
|
|
195
|
+
|
|
196
|
+
this.$emit('change:source', file, rawFile)
|
|
197
|
+
},
|
|
198
|
+
onTrackChange(file, rawFile) {
|
|
199
|
+
if (!file && this.hasLinkedCaptions) {
|
|
200
|
+
this.sourceInherit = true
|
|
201
|
+
}
|
|
202
|
+
this.$emit('change:track', file, rawFile)
|
|
203
|
+
},
|
|
204
|
+
onUpdateAssets(assets) {
|
|
205
|
+
this.$emit('update:assets', assets)
|
|
206
|
+
},
|
|
207
|
+
getLinkedCaptions(file) {
|
|
208
|
+
if (!file) {
|
|
209
|
+
return null
|
|
210
|
+
}
|
|
211
|
+
// Check to see if the video source has a linked asset and it's a vtt file
|
|
212
|
+
const linkedCaption = _.find(
|
|
213
|
+
_.get(file, 'asset.linked_assets', []),
|
|
214
|
+
function (f) {
|
|
215
|
+
return _.get(f, 'asset.metadata.extension', '') === 'vtt'
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
return linkedCaption || null
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
}
|
|
223
|
+
</script>
|