@windward/core 0.3.0 → 0.4.1
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/components/Content/Blocks/Accordion.vue +37 -0
- package/components/Content/Blocks/BlockQuote.vue +2 -2
- package/components/Content/Blocks/ClickableIcons.vue +108 -21
- package/components/Content/Blocks/Email.vue +19 -6
- package/components/Content/Blocks/Feedback.vue +12 -5
- package/components/Content/Blocks/Image.vue +47 -19
- package/components/Content/Blocks/OpenResponse.vue +7 -3
- package/components/Content/Blocks/OpenResponseCollate.vue +1 -1
- package/components/Content/Blocks/ScenarioChoice.vue +2 -2
- package/components/Content/Blocks/UserUpload/DisplayUserFilesTable.vue +2 -0
- package/components/Content/Blocks/UserUpload.vue +1 -0
- package/components/Content/Blocks/Video.vue +82 -11
- package/components/Navigation/Items/AskTheExpert.vue +1 -0
- package/components/Settings/AccordionSettings.vue +55 -0
- package/components/Settings/ClickableIconsSettings.vue +89 -8
- package/components/Settings/EmailSettings.vue +6 -10
- package/components/Settings/FeedbackSettings.vue +1 -0
- package/components/Settings/ImageSettings.vue +142 -39
- package/components/Settings/MathSettings.vue +1 -1
- package/components/Settings/OpenResponseSettings.vue +1 -2
- package/components/Settings/ScenarioChoiceSettings.vue +1 -0
- package/components/Settings/TabSettings.vue +7 -1
- package/components/Settings/TextEditorSettings.vue +3 -2
- package/components/Settings/UserUploadSettings.vue +1 -1
- package/components/Settings/VideoSettings.vue +102 -63
- package/components/utils/ContentViewer.vue +6 -1
- package/components/utils/FillInBlank/FillInBlankInput.vue +3 -0
- package/components/utils/MathExpressionEditor.vue +37 -11
- package/components/utils/MathLiveWrapper.vue +47 -25
- package/components/utils/TinyMCEWrapper.vue +214 -34
- package/components/utils/assets/tinymce/content/dark/content.scss +4 -0
- package/components/utils/assets/tinymce/{css/content.scss → content/global.scss} +38 -37
- package/components/utils/assets/tinymce/content/light/content.scss +4 -0
- package/components/utils/assets/tinymce/ui/dark/content.scss +803 -0
- package/components/utils/assets/tinymce/ui/dark/skin.scss +4727 -0
- package/components/utils/assets/tinymce/ui/global.scss +19 -0
- package/components/utils/assets/tinymce/ui/light/content.scss +822 -0
- package/components/utils/assets/tinymce/ui/light/skin.scss +4731 -0
- package/components/utils/glossary/CourseGlossary.vue +3 -1
- package/config/tinymce.config.ts +32 -20
- package/helpers/FillInBlankHelper.ts +34 -28
- package/helpers/GlossaryHelper.ts +90 -73
- package/helpers/MathHelper.ts +108 -28
- package/helpers/tinymce/WindwardPlugins.ts +335 -0
- package/i18n/en-US/components/settings/clickable_icon.ts +2 -0
- package/i18n/en-US/components/settings/image.ts +6 -1
- package/i18n/en-US/components/utils/tiny_mce_wrapper.ts +1 -0
- package/i18n/en-US/shared/settings.ts +3 -0
- package/i18n/es-ES/components/settings/clickable_icon.ts +2 -0
- package/i18n/es-ES/components/settings/image.ts +8 -1
- package/i18n/es-ES/components/utils/tiny_mce_wrapper.ts +1 -0
- package/i18n/es-ES/shared/settings.ts +3 -0
- package/i18n/sv-SE/components/settings/clickable_icon.ts +2 -0
- package/i18n/sv-SE/components/settings/image.ts +6 -1
- package/i18n/sv-SE/components/utils/tiny_mce_wrapper.ts +1 -0
- package/i18n/sv-SE/shared/settings.ts +3 -0
- package/package.json +6 -4
- package/test/Components/Settings/AccordionSettings.spec.js +16 -2
- package/test/__mocks__/contentBlockMock.js +6 -0
- package/test/__mocks__/contentSettingsMock.js +6 -0
- package/test/helpers/MathHelper.spec.js +36 -4
- package/tsconfig.json +4 -0
- package/helpers/tinymce/plugin.ts +0 -208
|
@@ -38,6 +38,27 @@
|
|
|
38
38
|
"
|
|
39
39
|
></TextEditor>
|
|
40
40
|
</v-container>
|
|
41
|
+
<v-container>
|
|
42
|
+
<v-img
|
|
43
|
+
v-if="block.metadata.config.items[itemIndex].file"
|
|
44
|
+
:aria-describedby="
|
|
45
|
+
block.metadata.config.items[itemIndex]
|
|
46
|
+
.ariaDescribedBy
|
|
47
|
+
"
|
|
48
|
+
:alt="
|
|
49
|
+
getImageAlt(
|
|
50
|
+
block.metadata.config.items[itemIndex].file,
|
|
51
|
+
block.metadata.config.items[itemIndex]
|
|
52
|
+
.altText
|
|
53
|
+
)
|
|
54
|
+
"
|
|
55
|
+
:src="
|
|
56
|
+
getImagePublicUrl(
|
|
57
|
+
block.metadata.config.items[itemIndex].file
|
|
58
|
+
)
|
|
59
|
+
"
|
|
60
|
+
></v-img>
|
|
61
|
+
</v-container>
|
|
41
62
|
</v-expansion-panel-content>
|
|
42
63
|
</v-expansion-panel>
|
|
43
64
|
</v-expansion-panels>
|
|
@@ -73,6 +94,9 @@ export default {
|
|
|
73
94
|
header: '',
|
|
74
95
|
expand: false,
|
|
75
96
|
content: '',
|
|
97
|
+
file: null,
|
|
98
|
+
altText: '',
|
|
99
|
+
ariaDescribedBy: '',
|
|
76
100
|
}
|
|
77
101
|
this.block.metadata.config.items = []
|
|
78
102
|
this.block.metadata.config.items.push(defaultObject)
|
|
@@ -129,6 +153,19 @@ export default {
|
|
|
129
153
|
},
|
|
130
154
|
},
|
|
131
155
|
methods: {
|
|
156
|
+
getImagePublicUrl(asset) {
|
|
157
|
+
const foundAsset = this.resolveAsset(asset)
|
|
158
|
+
|
|
159
|
+
return _.get(foundAsset, 'asset.public_url', null)
|
|
160
|
+
},
|
|
161
|
+
getImageAlt(asset, defaultText = '') {
|
|
162
|
+
// If a default / override was defined
|
|
163
|
+
if (defaultText) {
|
|
164
|
+
return defaultText
|
|
165
|
+
}
|
|
166
|
+
const foundAsset = this.resolveAsset(asset)
|
|
167
|
+
return _.get(foundAsset, 'asset.metadata.props.alt', null)
|
|
168
|
+
},
|
|
132
169
|
async onBeforeSave() {
|
|
133
170
|
this.block.metadata.config.items.forEach((element) => {
|
|
134
171
|
element.expand = false
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"
|
|
8
8
|
>
|
|
9
9
|
<v-col cols="12" class="pb-0">
|
|
10
|
-
<
|
|
10
|
+
<h2 v-if="block.metadata.config.title">
|
|
11
11
|
{{ block.metadata.config.title }}
|
|
12
|
-
</
|
|
12
|
+
</h2>
|
|
13
13
|
<p v-if="block.metadata.config.instructions" class="pb-0 mb-0">
|
|
14
14
|
{{ block.metadata.config.instructions }}
|
|
15
15
|
</p>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<v-container>
|
|
4
|
-
<
|
|
4
|
+
<h2>{{ block.metadata.config.title }}</h2>
|
|
5
5
|
|
|
6
6
|
<h4>{{ block.metadata.config.description }}</h4>
|
|
7
7
|
|
|
@@ -20,23 +20,34 @@
|
|
|
20
20
|
no-gutters
|
|
21
21
|
:class="rowClass(itemIndex)"
|
|
22
22
|
>
|
|
23
|
-
<v-col cols="12"
|
|
24
|
-
<
|
|
25
|
-
class="
|
|
26
|
-
:color="itemColor(itemIndex)"
|
|
27
|
-
:fab="block.metadata.config.display.round_icon"
|
|
28
|
-
outlined
|
|
23
|
+
<v-col cols="12" v-bind="iconColumnAttrs" class="pa-4">
|
|
24
|
+
<button
|
|
25
|
+
:class="activatorButtonClass(itemIndex)"
|
|
29
26
|
@click="item.active = !item.active"
|
|
30
27
|
>
|
|
31
|
-
<v-
|
|
32
|
-
item.icon
|
|
33
|
-
|
|
28
|
+
<v-avatar
|
|
29
|
+
v-if="item.iconImage && item.icon"
|
|
30
|
+
class="clickable--image"
|
|
31
|
+
:rounded="
|
|
32
|
+
block.metadata.config.display.round_icon
|
|
33
|
+
? '100%'
|
|
34
|
+
: '0'
|
|
35
|
+
"
|
|
36
|
+
size="100%"
|
|
37
|
+
>
|
|
38
|
+
<v-img :src="getImagePublicUrl(item.iconAsset)" />
|
|
39
|
+
</v-avatar>
|
|
40
|
+
<v-icon
|
|
41
|
+
v-else-if="isIcon(item.icon)"
|
|
42
|
+
class="clickable--icon black--text"
|
|
43
|
+
>{{ item.icon }}</v-icon
|
|
44
|
+
>
|
|
34
45
|
<span v-else :class="iconClass + ' black--text'">{{
|
|
35
46
|
decode(item.icon)
|
|
36
47
|
}}</span>
|
|
37
|
-
</
|
|
48
|
+
</button>
|
|
38
49
|
</v-col>
|
|
39
|
-
<v-col cols="12"
|
|
50
|
+
<v-col cols="12" v-bind="bodyColumnAttrs">
|
|
40
51
|
<h4
|
|
41
52
|
v-if="
|
|
42
53
|
block.metadata.config.display.show_title ||
|
|
@@ -62,6 +73,7 @@
|
|
|
62
73
|
<script>
|
|
63
74
|
import _ from 'lodash'
|
|
64
75
|
import he from 'he'
|
|
76
|
+
import Uuid from '~/helpers/Uuid'
|
|
65
77
|
import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
|
|
66
78
|
import TextViewer from '~/components/Text/TextViewer'
|
|
67
79
|
|
|
@@ -111,7 +123,7 @@ export default {
|
|
|
111
123
|
},
|
|
112
124
|
rowClass() {
|
|
113
125
|
return (itemIndex) => {
|
|
114
|
-
let classes = 'option-container
|
|
126
|
+
let classes = 'option-container pa-1'
|
|
115
127
|
// If show background is enabled and the item has a color
|
|
116
128
|
// Otherwise we do NOT want to apply the `black--text` class since there's no color
|
|
117
129
|
// And things will look bad in dark mode
|
|
@@ -128,8 +140,42 @@ export default {
|
|
|
128
140
|
return classes
|
|
129
141
|
}
|
|
130
142
|
},
|
|
143
|
+
iconColumnAttrs() {
|
|
144
|
+
if (this.block.metadata.config.display.large_icon) {
|
|
145
|
+
return {
|
|
146
|
+
xl: '3',
|
|
147
|
+
lg: '4',
|
|
148
|
+
md: '4',
|
|
149
|
+
sm: '4',
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
return {
|
|
153
|
+
xl: '2',
|
|
154
|
+
lg: '3',
|
|
155
|
+
md: '3',
|
|
156
|
+
sm: '3',
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
bodyColumnAttrs() {
|
|
161
|
+
if (this.block.metadata.config.display.large_icon) {
|
|
162
|
+
return {
|
|
163
|
+
xl: '9',
|
|
164
|
+
lg: '8',
|
|
165
|
+
md: '8',
|
|
166
|
+
sm: '8',
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
return {
|
|
170
|
+
xl: '10',
|
|
171
|
+
lg: '9',
|
|
172
|
+
md: '9',
|
|
173
|
+
sm: '9',
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
131
177
|
iconClass() {
|
|
132
|
-
let classes = 'text
|
|
178
|
+
let classes = 'clickable--text'
|
|
133
179
|
if (
|
|
134
180
|
_.get(this.block, 'metadata.config.display.italic_icon', false)
|
|
135
181
|
) {
|
|
@@ -137,6 +183,22 @@ export default {
|
|
|
137
183
|
}
|
|
138
184
|
return classes
|
|
139
185
|
},
|
|
186
|
+
activatorButtonClass() {
|
|
187
|
+
return (itemIndex) => {
|
|
188
|
+
let classes =
|
|
189
|
+
'button-icon button-icon--outline pa-1 ' +
|
|
190
|
+
this.itemColor(itemIndex)
|
|
191
|
+
if (this.block.metadata.config.display.large_icon) {
|
|
192
|
+
classes += ' button-icon--large'
|
|
193
|
+
} else {
|
|
194
|
+
classes += ' button-icon--normal'
|
|
195
|
+
}
|
|
196
|
+
if (this.block.metadata.config.display.round_icon) {
|
|
197
|
+
classes += ' button-icon--rounded'
|
|
198
|
+
}
|
|
199
|
+
return classes
|
|
200
|
+
}
|
|
201
|
+
},
|
|
140
202
|
itemColor() {
|
|
141
203
|
return (itemIndex) => {
|
|
142
204
|
// If autocolor is enabled then calculate the color on the index
|
|
@@ -179,20 +241,45 @@ export default {
|
|
|
179
241
|
isIcon(str) {
|
|
180
242
|
return str && _.isString(str) && str.indexOf('mdi-') === 0
|
|
181
243
|
},
|
|
244
|
+
getImagePublicUrl(asset) {
|
|
245
|
+
const foundAsset = this.resolveAsset(asset)
|
|
246
|
+
|
|
247
|
+
return _.get(foundAsset, 'asset.public_url', null)
|
|
248
|
+
},
|
|
182
249
|
},
|
|
183
250
|
}
|
|
184
251
|
</script>
|
|
185
|
-
<style scoped>
|
|
252
|
+
<style lang="scss" scoped>
|
|
186
253
|
.option-container {
|
|
187
254
|
border-radius: 1rem;
|
|
188
255
|
}
|
|
189
|
-
.button-icon {
|
|
256
|
+
button.button-icon {
|
|
257
|
+
border-width: 4px;
|
|
258
|
+
width: 100% !important;
|
|
259
|
+
height: auto !important;
|
|
260
|
+
aspect-ratio: 1 / 1;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
button.button-icon.button-icon--outline {
|
|
264
|
+
background-color: #fff !important;
|
|
190
265
|
border-width: 4px;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
266
|
+
border-style: solid;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
button.button-icon.button-icon--rounded {
|
|
270
|
+
border-radius: 100%;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.button-icon--normal {
|
|
274
|
+
.clickable--icon,
|
|
275
|
+
.clickable--text {
|
|
276
|
+
font-size: 1.5rem;
|
|
277
|
+
}
|
|
194
278
|
}
|
|
195
|
-
.
|
|
196
|
-
|
|
279
|
+
.button-icon--large {
|
|
280
|
+
.clickable--icon,
|
|
281
|
+
.clickable--text {
|
|
282
|
+
font-size: 2.5rem;
|
|
283
|
+
}
|
|
197
284
|
}
|
|
198
285
|
</style>
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"
|
|
8
8
|
>
|
|
9
9
|
<v-col cols="12" class="pa-0">
|
|
10
|
-
<
|
|
10
|
+
<h2 v-if="block.metadata.config.title">
|
|
11
11
|
{{ block.metadata.config.title }}
|
|
12
|
-
</
|
|
12
|
+
</h2>
|
|
13
13
|
<p v-if="block.metadata.config.instructions" class="pb-0 mb-0">
|
|
14
14
|
{{ block.metadata.config.instructions }}
|
|
15
15
|
</p>
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
>
|
|
171
171
|
<v-row class="pt-4">
|
|
172
172
|
<v-col cols="10" class="pa-0">
|
|
173
|
-
<v-btn color="primary" text>
|
|
173
|
+
<v-btn elevation="0" color="primary" text>
|
|
174
174
|
<v-icon>mdi-reply</v-icon>
|
|
175
175
|
{{
|
|
176
176
|
$t(
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
)
|
|
179
179
|
}}</v-btn
|
|
180
180
|
>
|
|
181
|
-
<v-btn color="primary" text>
|
|
181
|
+
<v-btn elevation="0" color="primary" text>
|
|
182
182
|
<v-icon>mdi-reply-all</v-icon>
|
|
183
183
|
{{
|
|
184
184
|
$t(
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
)
|
|
187
187
|
}}</v-btn
|
|
188
188
|
>
|
|
189
|
-
<v-btn color="primary" text>
|
|
189
|
+
<v-btn elevation="0" color="primary" text>
|
|
190
190
|
<v-icon>mdi-share</v-icon>
|
|
191
191
|
{{
|
|
192
192
|
$t(
|
|
@@ -196,7 +196,11 @@
|
|
|
196
196
|
>
|
|
197
197
|
</v-col>
|
|
198
198
|
<v-col cols="2" class="pa-0 d-flex justify-end">
|
|
199
|
-
<v-btn
|
|
199
|
+
<v-btn
|
|
200
|
+
elevation="0"
|
|
201
|
+
color="primary"
|
|
202
|
+
outlined
|
|
203
|
+
>
|
|
200
204
|
{{
|
|
201
205
|
$t(
|
|
202
206
|
'windward.core.components.content.blocks.email.reset'
|
|
@@ -294,6 +298,15 @@ export default {
|
|
|
294
298
|
onRemoveTags(body) {
|
|
295
299
|
return body.replace(/(<([^>]+)>)/gi, '')
|
|
296
300
|
},
|
|
301
|
+
async onBeforeSave() {
|
|
302
|
+
this.block.metadata.config.emails.forEach((element) => {
|
|
303
|
+
if (element.from) {
|
|
304
|
+
let matches = element.from.match(/\b(\w)/g)
|
|
305
|
+
element.initials = matches.join('')
|
|
306
|
+
}
|
|
307
|
+
element.tinymce_expand = false
|
|
308
|
+
})
|
|
309
|
+
},
|
|
297
310
|
},
|
|
298
311
|
}
|
|
299
312
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<v-container>
|
|
3
3
|
<v-container v-if="!doesFeedbackExist">
|
|
4
4
|
<v-row>
|
|
5
|
-
<
|
|
5
|
+
<h2>
|
|
6
6
|
{{
|
|
7
7
|
block.metadata.config.definition.name
|
|
8
8
|
? block.metadata.config.definition.name
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
'windward.core.components.content.blocks.feedback.feedback'
|
|
11
11
|
)
|
|
12
12
|
}}
|
|
13
|
-
</
|
|
13
|
+
</h2>
|
|
14
14
|
</v-row>
|
|
15
15
|
<v-row class="pt-2">
|
|
16
16
|
<p>
|
|
@@ -92,15 +92,22 @@
|
|
|
92
92
|
<v-btn
|
|
93
93
|
color="primary"
|
|
94
94
|
outlined
|
|
95
|
+
elevation="0"
|
|
95
96
|
class="text-center mt-4 mr-2"
|
|
96
97
|
@click="onReset()"
|
|
97
98
|
>{{
|
|
98
99
|
$t('windward.core.components.content.blocks.feedback.reset')
|
|
99
100
|
}}</v-btn
|
|
100
101
|
>
|
|
101
|
-
<v-btn
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
<v-btn
|
|
103
|
+
elevation="0"
|
|
104
|
+
color="success"
|
|
105
|
+
class="text-center mt-4"
|
|
106
|
+
@click="validate"
|
|
107
|
+
>{{
|
|
108
|
+
$t('windward.core.components.content.blocks.feedback.save')
|
|
109
|
+
}}</v-btn
|
|
110
|
+
>
|
|
104
111
|
</v-row>
|
|
105
112
|
<v-form
|
|
106
113
|
ref="form"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<v-container class="pa-0 ma-0">
|
|
4
|
-
<div v-if="!
|
|
4
|
+
<div v-if="!imageUrl" class="img-holder">
|
|
5
5
|
<v-skeleton-loader
|
|
6
6
|
height="300px"
|
|
7
7
|
:elevation="2"
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
<v-responsive :aspect-ratio="aspectRatio">
|
|
21
21
|
<v-img
|
|
22
|
-
v-if="
|
|
23
|
-
:alt="
|
|
24
|
-
:aria-describedby="
|
|
22
|
+
v-if="imageUrl"
|
|
23
|
+
:alt="altText"
|
|
24
|
+
:aria-describedby="describedByText"
|
|
25
25
|
:class="imageClass"
|
|
26
|
-
:src="
|
|
26
|
+
:src="imageUrl"
|
|
27
27
|
contain
|
|
28
28
|
@click="onHandleModal"
|
|
29
29
|
>
|
|
@@ -52,13 +52,11 @@
|
|
|
52
52
|
v-on="on"
|
|
53
53
|
>
|
|
54
54
|
<v-img
|
|
55
|
-
v-if="
|
|
56
|
-
:alt="
|
|
57
|
-
:aria-describedby="
|
|
58
|
-
block.metadata.config.aria_described_by
|
|
59
|
-
"
|
|
55
|
+
v-if="imageUrl"
|
|
56
|
+
:alt="altText"
|
|
57
|
+
:aria-describedby="describedByText"
|
|
60
58
|
:class="imageClass"
|
|
61
|
-
:src="
|
|
59
|
+
:src="imageUrl"
|
|
62
60
|
contain
|
|
63
61
|
@click="onHandleModal"
|
|
64
62
|
>
|
|
@@ -104,27 +102,57 @@ export default {
|
|
|
104
102
|
if (_.isEmpty(this.block.metadata.config.alt)) {
|
|
105
103
|
this.block.metadata.config.alt = ''
|
|
106
104
|
}
|
|
107
|
-
if (!_.isBoolean(this.block.metadata.config.
|
|
108
|
-
this.block.metadata.config.
|
|
105
|
+
if (!_.isBoolean(this.block.metadata.config.hideBackground)) {
|
|
106
|
+
this.block.metadata.config.hideBackground = false
|
|
109
107
|
}
|
|
110
108
|
if (!_.isBoolean(this.block.metadata.config.modal)) {
|
|
111
109
|
this.block.metadata.config.modal = false
|
|
112
110
|
}
|
|
113
|
-
if (_.isEmpty(this.block.metadata.config.
|
|
114
|
-
this.block.metadata.config.
|
|
111
|
+
if (_.isEmpty(this.block.metadata.config.ariaDescribedBy)) {
|
|
112
|
+
this.block.metadata.config.ariaDescribedBy = ''
|
|
115
113
|
}
|
|
116
114
|
},
|
|
117
115
|
computed: {
|
|
118
116
|
describedById() {
|
|
119
117
|
// If there's a described by
|
|
120
|
-
if (
|
|
118
|
+
if (this.describedByText) {
|
|
121
119
|
return this.id
|
|
122
120
|
} else {
|
|
123
121
|
return null
|
|
124
122
|
}
|
|
125
123
|
},
|
|
124
|
+
altText() {
|
|
125
|
+
// Get the asset info first and fallback to the block metadata if inherit is set to false
|
|
126
|
+
if (_.get(this.block.metadata, 'config.inherit', true)) {
|
|
127
|
+
return _.get(this.fileAsset, 'metadata.props.alt', null)
|
|
128
|
+
} else {
|
|
129
|
+
return _.get(this.block.metadata, 'config.alt', null)
|
|
130
|
+
}
|
|
131
|
+
},
|
|
126
132
|
describedByText() {
|
|
127
|
-
|
|
133
|
+
// Get the asset info first and fallback to the block metadata if inherit is set to false
|
|
134
|
+
if (_.get(this.block.metadata, 'config.inherit', true)) {
|
|
135
|
+
return _.get(
|
|
136
|
+
this.fileAsset,
|
|
137
|
+
'metadata.props.aria_describedby',
|
|
138
|
+
null
|
|
139
|
+
)
|
|
140
|
+
} else {
|
|
141
|
+
return _.get(
|
|
142
|
+
this.block.metadata,
|
|
143
|
+
'config.ariaDescribedBy',
|
|
144
|
+
null
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
fileAsset() {
|
|
149
|
+
return this.resolveAsset(
|
|
150
|
+
_.get(this.block, 'metadata.config.asset', null)
|
|
151
|
+
)
|
|
152
|
+
},
|
|
153
|
+
imageUrl() {
|
|
154
|
+
// Get the image public url and fallback to the block body
|
|
155
|
+
return _.get(this.fileAsset, 'asset.public_url', this.block.body)
|
|
128
156
|
},
|
|
129
157
|
imageClass() {
|
|
130
158
|
let imageClass = ''
|
|
@@ -133,7 +161,7 @@ export default {
|
|
|
133
161
|
imageClass += ' container-pointer'
|
|
134
162
|
}
|
|
135
163
|
// If NOT hide background, inclide the extra class
|
|
136
|
-
if (!_.get(this.block.metadata, 'config.
|
|
164
|
+
if (!_.get(this.block.metadata, 'config.hideBackground', false)) {
|
|
137
165
|
imageClass += ' img-white'
|
|
138
166
|
}
|
|
139
167
|
return 'img-display' + imageClass
|
|
@@ -164,7 +192,7 @@ export default {
|
|
|
164
192
|
}
|
|
165
193
|
</script>
|
|
166
194
|
|
|
167
|
-
<style scoped>
|
|
195
|
+
<style lang="scss" scoped>
|
|
168
196
|
.img-display {
|
|
169
197
|
border-radius: 3px;
|
|
170
198
|
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<p class="pa-3 text-center blue-grey lighten-5">
|
|
12
12
|
<v-btn
|
|
13
13
|
color="primary"
|
|
14
|
+
elevation="0"
|
|
14
15
|
:disabled="!canSubmit"
|
|
15
16
|
@click="onSubmit"
|
|
16
17
|
>
|
|
@@ -47,9 +48,12 @@
|
|
|
47
48
|
</v-alert>
|
|
48
49
|
</div>
|
|
49
50
|
<p class="pa-3 text-center blue-grey lighten-5">
|
|
50
|
-
<v-btn
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
<v-btn
|
|
52
|
+
elevation="0"
|
|
53
|
+
color="primary"
|
|
54
|
+
@click="submitted = false"
|
|
55
|
+
>{{ $t('shared.forms.edit') }}</v-btn
|
|
56
|
+
>
|
|
53
57
|
</p>
|
|
54
58
|
</div>
|
|
55
59
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<v-container>
|
|
4
|
-
<
|
|
4
|
+
<h2>{{ block.metadata.config.title }}</h2>
|
|
5
5
|
<h4>{{ block.metadata.config.description }}</h4>
|
|
6
6
|
<p>
|
|
7
7
|
{{
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
v-if="choiceIndex !== null && block.metadata.config.show_reset"
|
|
15
15
|
class="text-right"
|
|
16
16
|
>
|
|
17
|
-
<v-btn color="primary" outlined @click="onClickReset">
|
|
17
|
+
<v-btn elevation="0" color="primary" outlined @click="onClickReset">
|
|
18
18
|
{{
|
|
19
19
|
$t(
|
|
20
20
|
'windward.core.components.content.blocks.scenario_choice.try_again'
|