@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,23 +1,23 @@
|
|
|
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
|
-
:
|
|
7
|
-
:
|
|
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
13
|
<v-textarea
|
|
14
|
+
id="block-settings-instructions"
|
|
13
15
|
v-model="block.metadata.config.instructions"
|
|
14
16
|
outlined
|
|
15
|
-
:
|
|
16
|
-
:
|
|
17
|
+
:rules="$Validation.getRule('block.instructions')"
|
|
18
|
+
:counter="$Validation.getLimit('block.instructions')"
|
|
17
19
|
:disabled="render"
|
|
18
|
-
:label="
|
|
19
|
-
$t('components.content.settings.base.instructions_optional')
|
|
20
|
-
"
|
|
20
|
+
:label="$t('components.content.settings.base.instructions')"
|
|
21
21
|
></v-textarea>
|
|
22
22
|
<v-switch
|
|
23
23
|
v-model="block.metadata.config.display_detailed"
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
<v-text-field
|
|
42
42
|
v-model="block.metadata.config.items[index].name"
|
|
43
43
|
:autofocus="true"
|
|
44
|
-
:
|
|
45
|
-
:
|
|
44
|
+
:rules="$Validation.getRule('shortInput')"
|
|
45
|
+
:counter="$Validation.getLimit('shortInput')"
|
|
46
46
|
outlined
|
|
47
47
|
:label="
|
|
48
48
|
$t(
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
><v-icon>mdi-plus</v-icon
|
|
82
82
|
>{{
|
|
83
83
|
$t(
|
|
84
|
-
'windward.core.components.settings.file_download.
|
|
84
|
+
'windward.core.components.settings.file_download.place_file'
|
|
85
85
|
)
|
|
86
86
|
}}</v-btn
|
|
87
87
|
>
|
|
@@ -100,26 +100,7 @@ export default {
|
|
|
100
100
|
extends: BaseContentSettings,
|
|
101
101
|
components: { TextEditor, SortableExpansionPanel },
|
|
102
102
|
data() {
|
|
103
|
-
return {
|
|
104
|
-
validation: {
|
|
105
|
-
shortInputRules: [
|
|
106
|
-
(v) =>
|
|
107
|
-
v.length <= 50 ||
|
|
108
|
-
this.$t(
|
|
109
|
-
'windward.core.shared.settings.errors.input_limitations',
|
|
110
|
-
[50]
|
|
111
|
-
),
|
|
112
|
-
],
|
|
113
|
-
instructionRule: [
|
|
114
|
-
(v) =>
|
|
115
|
-
v.length <= 255 ||
|
|
116
|
-
this.$t(
|
|
117
|
-
'windward.core.shared.settings.errors.input_limitations',
|
|
118
|
-
[255]
|
|
119
|
-
),
|
|
120
|
-
],
|
|
121
|
-
},
|
|
122
|
-
}
|
|
103
|
+
return {}
|
|
123
104
|
},
|
|
124
105
|
computed: {
|
|
125
106
|
filename() {
|
|
@@ -28,9 +28,6 @@ export default {
|
|
|
28
28
|
if (_.isEmpty(this.block.metadata.config)) {
|
|
29
29
|
this.block.metadata.config = {}
|
|
30
30
|
}
|
|
31
|
-
if (_.isEmpty(this.block.metadata.config)) {
|
|
32
|
-
this.block.metadata.config = {}
|
|
33
|
-
}
|
|
34
31
|
if (!_.isBoolean(this.block.metadata.config.dashed)) {
|
|
35
32
|
this.block.metadata.config.dashed = false
|
|
36
33
|
}
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
outlined
|
|
105
105
|
counter
|
|
106
106
|
maxlength="125"
|
|
107
|
-
:rules="
|
|
107
|
+
:rules="$Validation.getRule('exists')"
|
|
108
108
|
disabled
|
|
109
109
|
>
|
|
110
110
|
</v-text-field>
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
:label="
|
|
119
119
|
$t('windward.core.components.navigation.image.default_alt')
|
|
120
120
|
"
|
|
121
|
-
:rules="
|
|
121
|
+
:rules="$Validation.getRule('exists')"
|
|
122
122
|
:disabled="render"
|
|
123
123
|
>
|
|
124
124
|
<template #append>
|
|
@@ -245,13 +245,7 @@ export default {
|
|
|
245
245
|
}
|
|
246
246
|
},
|
|
247
247
|
data() {
|
|
248
|
-
return {
|
|
249
|
-
validation: {
|
|
250
|
-
textRules: [
|
|
251
|
-
(v) => !!v || this.$t('shared.forms.errors.required'),
|
|
252
|
-
],
|
|
253
|
-
},
|
|
254
|
-
}
|
|
248
|
+
return {}
|
|
255
249
|
},
|
|
256
250
|
watch: {},
|
|
257
251
|
mounted() {},
|
|
@@ -33,41 +33,31 @@
|
|
|
33
33
|
color="primary"
|
|
34
34
|
@change="onLinkedChange"
|
|
35
35
|
>
|
|
36
|
-
<
|
|
37
|
-
v-
|
|
38
|
-
:
|
|
39
|
-
|
|
36
|
+
<v-list-item
|
|
37
|
+
v-for="contentBlock in contentBlocks"
|
|
38
|
+
:key="contentBlock.block_id"
|
|
39
|
+
:value="contentBlock.block_id"
|
|
40
40
|
>
|
|
41
|
-
<
|
|
42
|
-
v-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<v-list-item-action>
|
|
62
|
-
<v-checkbox
|
|
63
|
-
:input-value="active"
|
|
64
|
-
color="primary"
|
|
65
|
-
:disabled="render"
|
|
66
|
-
></v-checkbox>
|
|
67
|
-
</v-list-item-action>
|
|
68
|
-
</template>
|
|
69
|
-
</v-list-item>
|
|
70
|
-
</draggable>
|
|
41
|
+
<template #default="{ active }">
|
|
42
|
+
<v-list-item-content>
|
|
43
|
+
<v-list-item-title>
|
|
44
|
+
{{
|
|
45
|
+
contentBlock.body.replace(
|
|
46
|
+
/<[^>]*>?/gm,
|
|
47
|
+
''
|
|
48
|
+
)
|
|
49
|
+
}}
|
|
50
|
+
</v-list-item-title>
|
|
51
|
+
</v-list-item-content>
|
|
52
|
+
<v-list-item-action>
|
|
53
|
+
<v-checkbox
|
|
54
|
+
:input-value="active"
|
|
55
|
+
color="primary"
|
|
56
|
+
:disabled="render"
|
|
57
|
+
></v-checkbox>
|
|
58
|
+
</v-list-item-action>
|
|
59
|
+
</template>
|
|
60
|
+
</v-list-item>
|
|
71
61
|
</v-list-item-group>
|
|
72
62
|
</v-list>
|
|
73
63
|
</v-form>
|
|
@@ -84,7 +74,7 @@ import ContentBlock from '~/models/ContentBlock'
|
|
|
84
74
|
import Course from '~/models/Course'
|
|
85
75
|
|
|
86
76
|
export default {
|
|
87
|
-
name: '
|
|
77
|
+
name: 'OpenResponseCollateSettings',
|
|
88
78
|
extends: BaseContentSettings,
|
|
89
79
|
components: { draggable, TextEditor },
|
|
90
80
|
props: {
|
|
@@ -117,6 +107,8 @@ export default {
|
|
|
117
107
|
)
|
|
118
108
|
.for(new Course({ id: this.course.id }))
|
|
119
109
|
.get()
|
|
110
|
+
|
|
111
|
+
this.sortContentBlocks(this.contentBlocks)
|
|
120
112
|
},
|
|
121
113
|
beforeMount() {
|
|
122
114
|
if (_.isEmpty(this.block)) {
|
|
@@ -141,34 +133,34 @@ export default {
|
|
|
141
133
|
if (!_.isBoolean(this.block.metadata.config.include_prompts)) {
|
|
142
134
|
this.block.metadata.config.include_prompts = false
|
|
143
135
|
}
|
|
144
|
-
|
|
145
136
|
this.linked = this.block.metadata.config.linked
|
|
146
137
|
},
|
|
147
138
|
watch: {},
|
|
148
139
|
mounted() {},
|
|
149
140
|
methods: {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
141
|
+
sortContentBlocks(contentBlocks) {
|
|
142
|
+
let contentBlocksByPage = []
|
|
143
|
+
const blockMap = []
|
|
144
|
+
// getting page order
|
|
145
|
+
const contentBlockTree = this.$ContentService.getFlatTree()
|
|
146
|
+
contentBlockTree.forEach(function (page, index) {
|
|
147
|
+
contentBlocks.forEach((block) => {
|
|
148
|
+
// If the block is on this page and it wasn't already used on a different page
|
|
149
|
+
if (
|
|
150
|
+
page.content_id === block.content_id &&
|
|
151
|
+
!blockMap.includes(block.block_id)
|
|
152
|
+
) {
|
|
153
|
+
contentBlocksByPage.push(block)
|
|
154
|
+
blockMap.push(block.block_id)
|
|
155
|
+
}
|
|
156
|
+
})
|
|
157
|
+
})
|
|
158
|
+
this.contentBlocks = contentBlocksByPage
|
|
153
159
|
},
|
|
154
160
|
// Called when blocks are added / removed
|
|
155
161
|
onLinkedChange() {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
setLinkedBlocks() {
|
|
159
|
-
const linkedBlockIds = []
|
|
160
|
-
|
|
161
|
-
// Loop over content blocks since they have the correct order we want to collate
|
|
162
|
-
this.contentBlocks.forEach((contentBlock) => {
|
|
163
|
-
// If the unsorted this.linked includes the block id, add it in the right order
|
|
164
|
-
if (this.linked.includes(contentBlock.block_id)) {
|
|
165
|
-
linkedBlockIds.push(contentBlock.block_id)
|
|
166
|
-
}
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
// Set the linked and also body for convenience
|
|
170
|
-
this.block.metadata.config.linked = linkedBlockIds
|
|
171
|
-
this.block.body = linkedBlockIds.join()
|
|
162
|
+
// update block with linked open response for download
|
|
163
|
+
this.block.metadata.config.linked = this.linked
|
|
172
164
|
},
|
|
173
165
|
},
|
|
174
166
|
}
|
|
@@ -1,43 +1,63 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-container>
|
|
3
|
-
<v-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
"
|
|
14
14
|
:disabled="render"
|
|
15
|
-
></
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<TextEditor
|
|
24
|
-
v-model="block.metadata.config.sample_response"
|
|
25
|
-
:height="200"
|
|
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')"
|
|
26
23
|
:disabled="render"
|
|
27
|
-
></
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
></v-textarea>
|
|
25
|
+
</v-row>
|
|
26
|
+
<p>
|
|
27
|
+
{{ $t('windward.core.components.settings.open_response.question') }}
|
|
28
|
+
</p>
|
|
29
|
+
<TextEditor
|
|
30
|
+
id="block-settings-body"
|
|
31
|
+
v-model="block.body"
|
|
32
|
+
:height="200"
|
|
33
|
+
:disabled="render"
|
|
34
|
+
></TextEditor>
|
|
35
|
+
<p class="pt-4">
|
|
36
|
+
{{
|
|
37
|
+
$t(
|
|
38
|
+
'windward.core.components.settings.open_response.sample_response'
|
|
39
|
+
)
|
|
40
|
+
}}
|
|
41
|
+
</p>
|
|
42
|
+
<TextEditor
|
|
43
|
+
id="block-settings-sample-response"
|
|
44
|
+
v-model="block.metadata.config.sample_response"
|
|
45
|
+
:height="200"
|
|
46
|
+
:disabled="render"
|
|
47
|
+
></TextEditor>
|
|
48
|
+
<p class="pt-4">
|
|
49
|
+
{{
|
|
50
|
+
$t(
|
|
51
|
+
'windward.core.components.settings.open_response.starting_text'
|
|
52
|
+
)
|
|
53
|
+
}}
|
|
54
|
+
</p>
|
|
55
|
+
<TextEditor
|
|
56
|
+
id="block-settings-starting-text"
|
|
57
|
+
v-model="block.metadata.config.starting_text"
|
|
58
|
+
:height="200"
|
|
59
|
+
:disabled="render"
|
|
60
|
+
></TextEditor>
|
|
41
61
|
</v-container>
|
|
42
62
|
</template>
|
|
43
63
|
|
|
@@ -67,6 +87,12 @@ export default {
|
|
|
67
87
|
if (_.isEmpty(this.block.metadata.config)) {
|
|
68
88
|
this.block.metadata.config = {}
|
|
69
89
|
}
|
|
90
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
91
|
+
this.block.metadata.config.title = ''
|
|
92
|
+
}
|
|
93
|
+
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
94
|
+
this.block.metadata.config.instructions = ''
|
|
95
|
+
}
|
|
70
96
|
if (_.isEmpty(this.block.metadata.config.sample_response)) {
|
|
71
97
|
this.block.metadata.config.sample_response = ''
|
|
72
98
|
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<v-container class="pa-0">
|
|
4
4
|
<v-col class="pa-0">
|
|
5
5
|
<v-text-field
|
|
6
|
+
id="block-settings-title"
|
|
6
7
|
v-model="block.metadata.config.title"
|
|
7
|
-
:rules="
|
|
8
|
-
:counter="
|
|
8
|
+
:rules="$Validation.getRule('block.title')"
|
|
9
|
+
:counter="$Validation.getLimit('block.title')"
|
|
9
10
|
outlined
|
|
10
|
-
id="title"
|
|
11
11
|
:label="
|
|
12
12
|
$t(
|
|
13
13
|
'windward.core.components.settings.scenario_choice.title'
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
:disabled="render"
|
|
17
17
|
></v-text-field>
|
|
18
18
|
<v-textarea
|
|
19
|
+
id="block-settings-instructions"
|
|
19
20
|
v-model="block.metadata.config.description"
|
|
20
|
-
|
|
21
|
-
:
|
|
22
|
-
:counter="255"
|
|
21
|
+
:rules="$Validation.getRule('block.instructions')"
|
|
22
|
+
:counter="$Validation.getLimit('block.instructions')"
|
|
23
23
|
outlined
|
|
24
24
|
:label="$t('components.content.settings.base.instructions')"
|
|
25
25
|
:disabled="render"
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
v-model="
|
|
78
78
|
block.metadata.config.items[index].title
|
|
79
79
|
"
|
|
80
|
-
:rules="
|
|
81
|
-
:counter="
|
|
80
|
+
:rules="$Validation.getRule('longInput')"
|
|
81
|
+
:counter="$Validation.getLimit('longInput')"
|
|
82
82
|
outlined
|
|
83
83
|
:id="'item-' + index + '-title'"
|
|
84
84
|
:label="
|
|
@@ -128,7 +128,11 @@
|
|
|
128
128
|
>
|
|
129
129
|
<v-icon>mdi-plus</v-icon>
|
|
130
130
|
<span v-if="block.metadata.config.items.length <= 26">
|
|
131
|
-
{{
|
|
131
|
+
{{
|
|
132
|
+
$t(
|
|
133
|
+
'windward.core.components.settings.scenario_choice.add_choice'
|
|
134
|
+
)
|
|
135
|
+
}}
|
|
132
136
|
</span>
|
|
133
137
|
<span v-else>
|
|
134
138
|
{{
|
|
@@ -205,6 +209,7 @@ import BaseContentSettings from '~/components/Content/Settings/BaseContentSettin
|
|
|
205
209
|
import TextEditor from '~/components/Text/TextEditor'
|
|
206
210
|
import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
|
|
207
211
|
import DialogBox from '~/components/Core/DialogBox.vue'
|
|
212
|
+
import Uuid from '~/helpers/Uuid'
|
|
208
213
|
|
|
209
214
|
export default {
|
|
210
215
|
name: 'ScenarioChoiceSettings',
|
|
@@ -248,24 +253,6 @@ export default {
|
|
|
248
253
|
value: 'number',
|
|
249
254
|
},
|
|
250
255
|
],
|
|
251
|
-
validation: {
|
|
252
|
-
shortInputRules: [
|
|
253
|
-
(v) =>
|
|
254
|
-
v.length <= 50 ||
|
|
255
|
-
this.$t(
|
|
256
|
-
'windward.core.shared.settings.errors.input_limitations',
|
|
257
|
-
[50]
|
|
258
|
-
),
|
|
259
|
-
],
|
|
260
|
-
instructionRule: [
|
|
261
|
-
(v) =>
|
|
262
|
-
v.length <= 255 ||
|
|
263
|
-
this.$t(
|
|
264
|
-
'windward.core.shared.settings.errors.input_limitations',
|
|
265
|
-
[255]
|
|
266
|
-
),
|
|
267
|
-
],
|
|
268
|
-
},
|
|
269
256
|
}
|
|
270
257
|
},
|
|
271
258
|
beforeMount() {
|
|
@@ -286,8 +273,14 @@ export default {
|
|
|
286
273
|
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
287
274
|
this.block.metadata.config.title = ''
|
|
288
275
|
}
|
|
289
|
-
if (
|
|
290
|
-
this.block.metadata.config.description
|
|
276
|
+
if (
|
|
277
|
+
_.isEmpty(this.block.metadata.config.description) &&
|
|
278
|
+
this.block.id &&
|
|
279
|
+
!Uuid.test(this.block.id)
|
|
280
|
+
) {
|
|
281
|
+
this.block.metadata.config.description = this.$t(
|
|
282
|
+
'windward.core.components.content.blocks.scenario_choice.information'
|
|
283
|
+
)
|
|
291
284
|
}
|
|
292
285
|
if (_.isEmpty(this.block.metadata.config.display_style)) {
|
|
293
286
|
this.block.metadata.config.display_style = 'letter'
|