@windward/core 0.6.0 → 0.7.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 +14 -0
- package/components/Content/Blocks/ClickableIcons.vue +9 -2
- package/components/Content/Blocks/Email.vue +11 -2
- package/components/Content/Blocks/GenerateAIQuestionButton.vue +14 -6
- package/components/Content/Blocks/HorizontalRule.vue +1 -4
- package/components/Content/Blocks/ScenarioChoice.vue +57 -32
- package/components/Content/Blocks/Tab.vue +5 -0
- package/components/Content/Blocks/UserUpload.vue +1 -8
- package/components/Content/Blocks/Video.vue +96 -8
- package/components/Settings/AccordionSettings.vue +61 -8
- package/components/Settings/BlockQuoteSettings.vue +20 -12
- package/components/Settings/ClickableIconsSettings.vue +48 -12
- package/components/Settings/EmailSettings.vue +20 -12
- package/components/Settings/FileDownloadSettings.vue +22 -16
- package/components/Settings/HorizontalRuleSettings.vue +0 -3
- package/components/Settings/ScenarioChoiceSettings.vue +29 -14
- package/components/Settings/TabSettings.vue +121 -78
- package/components/Settings/UserUploadSettings.vue +30 -32
- package/components/Settings/VideoSettings/SourcePicker.vue +222 -0
- package/components/Settings/VideoSettings.vue +139 -183
- package/components/utils/TinyMCEWrapper.vue +3 -2
- package/components/utils/assets/tinymce/content/global.scss +14 -0
- package/components/utils/glossary/CourseGlossary.vue +52 -27
- 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/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/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/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/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/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 +2 -1
- package/plugin.js +1 -1
- 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
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
[index + 1]
|
|
143
143
|
)
|
|
144
144
|
"
|
|
145
|
+
:rules="validation.iconRules"
|
|
145
146
|
:disabled="render"
|
|
146
147
|
></TextIconPicker>
|
|
147
148
|
|
|
@@ -238,20 +239,55 @@ export default {
|
|
|
238
239
|
return {
|
|
239
240
|
validation: {
|
|
240
241
|
shortInputRules: [
|
|
241
|
-
(v) =>
|
|
242
|
-
v
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
242
|
+
(v) => {
|
|
243
|
+
if (v) {
|
|
244
|
+
if (v.length <= 50) {
|
|
245
|
+
return true
|
|
246
|
+
} else {
|
|
247
|
+
return this.$t(
|
|
248
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
249
|
+
[50]
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
return true
|
|
254
|
+
}
|
|
255
|
+
},
|
|
247
256
|
],
|
|
248
257
|
instructionRule: [
|
|
249
|
-
(v) =>
|
|
250
|
-
v
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
258
|
+
(v) => {
|
|
259
|
+
if (v) {
|
|
260
|
+
if (v.length <= 255) {
|
|
261
|
+
return true
|
|
262
|
+
} else {
|
|
263
|
+
return this.$t(
|
|
264
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
265
|
+
[255]
|
|
266
|
+
)
|
|
267
|
+
}
|
|
268
|
+
} else {
|
|
269
|
+
return true
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
iconRules: [
|
|
274
|
+
(v) => {
|
|
275
|
+
if (v) {
|
|
276
|
+
const isMDI = v.startsWith('mdi')
|
|
277
|
+
if (isMDI) {
|
|
278
|
+
return true
|
|
279
|
+
} else if (v.length >= 5) {
|
|
280
|
+
return this.$t(
|
|
281
|
+
'shared.forms.errors.number_lt',
|
|
282
|
+
[4]
|
|
283
|
+
)
|
|
284
|
+
} else {
|
|
285
|
+
return true
|
|
286
|
+
}
|
|
287
|
+
} else {
|
|
288
|
+
return true
|
|
289
|
+
}
|
|
290
|
+
},
|
|
255
291
|
],
|
|
256
292
|
},
|
|
257
293
|
}
|
|
@@ -215,20 +215,28 @@ export default {
|
|
|
215
215
|
editingPanel: 0,
|
|
216
216
|
validation: {
|
|
217
217
|
shortInputRules: [
|
|
218
|
-
(v) =>
|
|
219
|
-
v.length
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
218
|
+
(v) => {
|
|
219
|
+
if (v && v.length >= 50) {
|
|
220
|
+
return this.$t(
|
|
221
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
222
|
+
[50]
|
|
223
|
+
)
|
|
224
|
+
} else {
|
|
225
|
+
return true
|
|
226
|
+
}
|
|
227
|
+
},
|
|
224
228
|
],
|
|
225
229
|
instructionRule: [
|
|
226
|
-
(v) =>
|
|
227
|
-
v.length
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
(v) => {
|
|
231
|
+
if (v && v.length >= 255) {
|
|
232
|
+
return this.$t(
|
|
233
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
234
|
+
[255]
|
|
235
|
+
)
|
|
236
|
+
} else {
|
|
237
|
+
return true
|
|
238
|
+
}
|
|
239
|
+
},
|
|
232
240
|
],
|
|
233
241
|
},
|
|
234
242
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:counter="50"
|
|
7
7
|
:rules="validation.shortInputRules"
|
|
8
8
|
:autofocus="true"
|
|
9
|
-
:label="$t('components.content.settings.base.
|
|
9
|
+
:label="$t('components.content.settings.base.title')"
|
|
10
10
|
:disabled="render"
|
|
11
11
|
></v-text-field>
|
|
12
12
|
<v-textarea
|
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
:counter="255"
|
|
16
16
|
:rules="validation.instructionRule"
|
|
17
17
|
:disabled="render"
|
|
18
|
-
:label="
|
|
19
|
-
$t('components.content.settings.base.instructions_optional')
|
|
20
|
-
"
|
|
18
|
+
:label="$t('components.content.settings.base.instructions')"
|
|
21
19
|
></v-textarea>
|
|
22
20
|
<v-switch
|
|
23
21
|
v-model="block.metadata.config.display_detailed"
|
|
@@ -103,20 +101,28 @@ export default {
|
|
|
103
101
|
return {
|
|
104
102
|
validation: {
|
|
105
103
|
shortInputRules: [
|
|
106
|
-
(v) =>
|
|
107
|
-
v.length
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
104
|
+
(v) => {
|
|
105
|
+
if (v && v.length >= 50) {
|
|
106
|
+
return this.$t(
|
|
107
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
108
|
+
[50]
|
|
109
|
+
)
|
|
110
|
+
} else {
|
|
111
|
+
return true
|
|
112
|
+
}
|
|
113
|
+
},
|
|
112
114
|
],
|
|
113
115
|
instructionRule: [
|
|
114
|
-
(v) =>
|
|
115
|
-
v.length
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
(v) => {
|
|
117
|
+
if (v && v.length >= 255) {
|
|
118
|
+
return this.$t(
|
|
119
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
120
|
+
[255]
|
|
121
|
+
)
|
|
122
|
+
} else {
|
|
123
|
+
return true
|
|
124
|
+
}
|
|
125
|
+
},
|
|
120
126
|
],
|
|
121
127
|
},
|
|
122
128
|
}
|
|
@@ -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
|
}
|
|
@@ -205,6 +205,7 @@ import BaseContentSettings from '~/components/Content/Settings/BaseContentSettin
|
|
|
205
205
|
import TextEditor from '~/components/Text/TextEditor'
|
|
206
206
|
import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
|
|
207
207
|
import DialogBox from '~/components/Core/DialogBox.vue'
|
|
208
|
+
import Uuid from '~/helpers/Uuid'
|
|
208
209
|
|
|
209
210
|
export default {
|
|
210
211
|
name: 'ScenarioChoiceSettings',
|
|
@@ -250,20 +251,28 @@ export default {
|
|
|
250
251
|
],
|
|
251
252
|
validation: {
|
|
252
253
|
shortInputRules: [
|
|
253
|
-
(v) =>
|
|
254
|
-
v.length
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
(v) => {
|
|
255
|
+
if (v && v.length >= 50) {
|
|
256
|
+
return this.$t(
|
|
257
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
258
|
+
[50]
|
|
259
|
+
)
|
|
260
|
+
} else {
|
|
261
|
+
return true
|
|
262
|
+
}
|
|
263
|
+
},
|
|
259
264
|
],
|
|
260
265
|
instructionRule: [
|
|
261
|
-
(v) =>
|
|
262
|
-
v.length
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
266
|
+
(v) => {
|
|
267
|
+
if (v && v.length >= 255) {
|
|
268
|
+
return this.$t(
|
|
269
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
270
|
+
[255]
|
|
271
|
+
)
|
|
272
|
+
} else {
|
|
273
|
+
return true
|
|
274
|
+
}
|
|
275
|
+
},
|
|
267
276
|
],
|
|
268
277
|
},
|
|
269
278
|
}
|
|
@@ -286,8 +295,14 @@ export default {
|
|
|
286
295
|
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
287
296
|
this.block.metadata.config.title = ''
|
|
288
297
|
}
|
|
289
|
-
if (
|
|
290
|
-
this.block.metadata.config.description
|
|
298
|
+
if (
|
|
299
|
+
_.isEmpty(this.block.metadata.config.description) &&
|
|
300
|
+
this.block.id &&
|
|
301
|
+
!Uuid.test(this.block.id)
|
|
302
|
+
) {
|
|
303
|
+
this.block.metadata.config.description = this.$t(
|
|
304
|
+
'windward.core.components.content.blocks.scenario_choice.information'
|
|
305
|
+
)
|
|
291
306
|
}
|
|
292
307
|
if (_.isEmpty(this.block.metadata.config.display_style)) {
|
|
293
308
|
this.block.metadata.config.display_style = 'letter'
|
|
@@ -1,78 +1,92 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
<v-row class="pl-3 pr-3">
|
|
4
|
+
<v-text-field
|
|
5
|
+
v-model="block.metadata.config.title"
|
|
6
|
+
:autofocus="true"
|
|
7
|
+
:rules="validation.shortInputRules"
|
|
8
|
+
:counter="50"
|
|
9
|
+
outlined
|
|
10
|
+
id="title"
|
|
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
|
+
v-model="block.metadata.config.instructions"
|
|
18
|
+
:rules="validation.instructionRule"
|
|
19
|
+
:counter="255"
|
|
20
|
+
outlined
|
|
21
|
+
:label="$t('components.content.settings.base.instructions')"
|
|
22
|
+
:disabled="render"
|
|
23
|
+
></v-textarea>
|
|
24
|
+
</v-row>
|
|
25
|
+
<v-divider class="my-4 primary"></v-divider>
|
|
26
|
+
<p>{{ $t('windward.core.components.settings.tab.tabs') }}</p>
|
|
27
|
+
<SortableExpansionPanel
|
|
28
|
+
v-model="block.metadata.config.items"
|
|
29
|
+
v-bind:currentPanel.sync="block.metadata.config.currentTab"
|
|
30
|
+
:disabled="render"
|
|
31
|
+
@change="onDragged"
|
|
32
|
+
@click:close="onRemoveElement($event)"
|
|
33
|
+
>
|
|
34
|
+
<template #header="{ item }">
|
|
35
|
+
{{ item.tabHeader !== '' ? item.tabHeader : 'No Header' }}
|
|
36
|
+
</template>
|
|
37
|
+
<template #body="{ item, index }">
|
|
38
|
+
<v-container :key="expansionPanelKey">
|
|
39
|
+
<p class="p-label">
|
|
40
|
+
{{ $t('windward.core.components.settings.tab.header') }}
|
|
41
|
+
</p>
|
|
42
|
+
<v-text-field
|
|
43
|
+
outlined
|
|
44
|
+
:autofocus="true"
|
|
45
|
+
v-model="block.metadata.config.items[index].tabHeader"
|
|
46
|
+
:counter="50"
|
|
47
|
+
:rules="validation.shortInputRules"
|
|
48
|
+
:label="'item ' + (index + 1)"
|
|
49
|
+
:disabled="render"
|
|
50
|
+
></v-text-field>
|
|
51
|
+
<v-btn
|
|
52
|
+
@click="onToggleExpand(index)"
|
|
53
|
+
text
|
|
54
|
+
elevation="0"
|
|
55
|
+
class="mb-3"
|
|
56
|
+
:disabled="render"
|
|
57
|
+
>
|
|
58
|
+
<v-icon
|
|
59
|
+
v-if="!block.metadata.config.items[index].expand"
|
|
60
|
+
color="primary"
|
|
61
|
+
>mdi-arrow-expand-all</v-icon
|
|
62
|
+
>
|
|
63
|
+
<v-icon
|
|
64
|
+
v-if="block.metadata.config.items[index].expand"
|
|
65
|
+
color="primary"
|
|
41
66
|
>
|
|
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>
|
|
67
|
+
mdi-arrow-collapse-all
|
|
68
|
+
</v-icon>
|
|
69
|
+
</v-btn>
|
|
70
|
+
<TextEditor
|
|
71
|
+
v-model="block.metadata.config.items[index].content"
|
|
72
|
+
v-if="!item.expand"
|
|
73
|
+
:key="textEditorUpdateKey"
|
|
74
|
+
:disabled="render"
|
|
75
|
+
></TextEditor>
|
|
76
|
+
</v-container>
|
|
77
|
+
</template>
|
|
78
|
+
</SortableExpansionPanel>
|
|
79
|
+
<v-row justify="center" class="my-4">
|
|
80
|
+
<v-btn
|
|
81
|
+
color="primary"
|
|
82
|
+
elevation="0"
|
|
83
|
+
:disabled="render"
|
|
84
|
+
@click="onAddElement"
|
|
85
|
+
>
|
|
86
|
+
<v-icon>mdi-plus</v-icon>
|
|
87
|
+
{{ $t('windward.core.components.settings.tab.add_tab') }}
|
|
88
|
+
</v-btn>
|
|
89
|
+
</v-row>
|
|
76
90
|
<div v-if="loading" class="text-center">
|
|
77
91
|
<v-progress-circular
|
|
78
92
|
:size="70"
|
|
@@ -90,6 +104,7 @@ import Crypto from '~/helpers/Crypto'
|
|
|
90
104
|
import TextEditor from '~/components/Text/TextEditor'
|
|
91
105
|
import BaseContentSettings from '~/components/Content/Settings/BaseContentSettings.js'
|
|
92
106
|
import SortableExpansionPanel from '~/components/Core/SortableExpansionPanel.vue'
|
|
107
|
+
import Uuid from '~/helpers/Uuid'
|
|
93
108
|
|
|
94
109
|
export default {
|
|
95
110
|
name: 'TabSettings',
|
|
@@ -110,6 +125,18 @@ export default {
|
|
|
110
125
|
if (_.isEmpty(this.block.metadata.config)) {
|
|
111
126
|
this.block.metadata.config = {}
|
|
112
127
|
}
|
|
128
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
129
|
+
this.block.metadata.config.title = ''
|
|
130
|
+
}
|
|
131
|
+
if (
|
|
132
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
133
|
+
this.block.id &&
|
|
134
|
+
!Uuid.test(this.block.id)
|
|
135
|
+
) {
|
|
136
|
+
this.block.metadata.config.instructions = this.$t(
|
|
137
|
+
'windward.core.components.settings.tab.instructions'
|
|
138
|
+
)
|
|
139
|
+
}
|
|
113
140
|
if (_.isEmpty(this.block.metadata.config.currentTab)) {
|
|
114
141
|
this.block.metadata.config.currentTab = 0
|
|
115
142
|
}
|
|
@@ -130,13 +157,29 @@ export default {
|
|
|
130
157
|
valid: true,
|
|
131
158
|
loading: false,
|
|
132
159
|
validation: {
|
|
133
|
-
|
|
134
|
-
(v) =>
|
|
135
|
-
v.length
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
160
|
+
shortInputRules: [
|
|
161
|
+
(v) => {
|
|
162
|
+
if (v && v.length >= 50) {
|
|
163
|
+
return this.$t(
|
|
164
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
165
|
+
[50]
|
|
166
|
+
)
|
|
167
|
+
} else {
|
|
168
|
+
return true
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
instructionRule: [
|
|
173
|
+
(v) => {
|
|
174
|
+
if (v && v.length >= 255) {
|
|
175
|
+
return this.$t(
|
|
176
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
177
|
+
[255]
|
|
178
|
+
)
|
|
179
|
+
} else {
|
|
180
|
+
return true
|
|
181
|
+
}
|
|
182
|
+
},
|
|
140
183
|
],
|
|
141
184
|
},
|
|
142
185
|
}
|
|
@@ -6,23 +6,9 @@
|
|
|
6
6
|
:rules="validation.titleRules"
|
|
7
7
|
:counter="50"
|
|
8
8
|
:autofocus="true"
|
|
9
|
-
:label="$t('components.content.settings.base.
|
|
9
|
+
:label="$t('components.content.settings.base.title')"
|
|
10
10
|
:disabled="render"
|
|
11
11
|
></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
12
|
<v-textarea
|
|
27
13
|
v-model="block.metadata.config.instructions"
|
|
28
14
|
:rules="validation.instructionRule"
|
|
@@ -60,6 +46,7 @@ import BaseContentSettings from '~/components/Content/Settings/BaseContentSettin
|
|
|
60
46
|
import Crypto from '~/helpers/Crypto'
|
|
61
47
|
import TextEditor from '~/components/Text/TextEditor'
|
|
62
48
|
import _ from 'lodash'
|
|
49
|
+
import Uuid from '~/helpers/Uuid'
|
|
63
50
|
|
|
64
51
|
export default {
|
|
65
52
|
name: 'UserUploadSettings',
|
|
@@ -70,9 +57,6 @@ export default {
|
|
|
70
57
|
this.block = {}
|
|
71
58
|
}
|
|
72
59
|
|
|
73
|
-
// Default the instructions to collapsed
|
|
74
|
-
this.block.__expandInstructions = false
|
|
75
|
-
|
|
76
60
|
if (_.isEmpty(this.block.body)) {
|
|
77
61
|
this.block.body = this.$t(
|
|
78
62
|
'windward.core.shared.content_blocks.title.user_upload'
|
|
@@ -87,8 +71,14 @@ export default {
|
|
|
87
71
|
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
88
72
|
this.block.metadata.config.title = ''
|
|
89
73
|
}
|
|
90
|
-
if (
|
|
91
|
-
this.block.metadata.config.instructions
|
|
74
|
+
if (
|
|
75
|
+
_.isEmpty(this.block.metadata.config.instructions) &&
|
|
76
|
+
this.block.id &&
|
|
77
|
+
!Uuid.test(this.block.id)
|
|
78
|
+
) {
|
|
79
|
+
this.block.metadata.config.instructions = this.$t(
|
|
80
|
+
'windward.core.components.settings.user_upload.instructions'
|
|
81
|
+
)
|
|
92
82
|
}
|
|
93
83
|
if (_.isEmpty(this.block.metadata.config.uploadSettings)) {
|
|
94
84
|
this.block.metadata.config.uploadSettings = {
|
|
@@ -141,20 +131,28 @@ export default {
|
|
|
141
131
|
},
|
|
142
132
|
validation: {
|
|
143
133
|
titleRules: [
|
|
144
|
-
(v) =>
|
|
145
|
-
v.length
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
134
|
+
(v) => {
|
|
135
|
+
if (v && v.length >= 50) {
|
|
136
|
+
return this.$t(
|
|
137
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
138
|
+
[50]
|
|
139
|
+
)
|
|
140
|
+
} else {
|
|
141
|
+
return true
|
|
142
|
+
}
|
|
143
|
+
},
|
|
150
144
|
],
|
|
151
145
|
instructionRule: [
|
|
152
|
-
(v) =>
|
|
153
|
-
v.length
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
146
|
+
(v) => {
|
|
147
|
+
if (v && v.length >= 255) {
|
|
148
|
+
return this.$t(
|
|
149
|
+
'windward.core.shared.settings.errors.input_limitations',
|
|
150
|
+
[255]
|
|
151
|
+
)
|
|
152
|
+
} else {
|
|
153
|
+
return true
|
|
154
|
+
}
|
|
155
|
+
},
|
|
158
156
|
],
|
|
159
157
|
},
|
|
160
158
|
}
|