@windward/core 0.0.9 → 0.1.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 +7 -2
- package/components/Content/Blocks/BlockQuote.vue +191 -0
- package/components/Content/Blocks/Email.vue +248 -0
- package/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionLikert.vue +25 -14
- package/components/Content/Blocks/FeedbackTemplates/FeedbackQuestionTrueFalse.vue +3 -7
- package/components/Content/Blocks/Image.vue +1 -1
- package/components/Content/Blocks/OpenResponse.vue +22 -16
- package/components/Content/Blocks/Tab.vue +7 -3
- package/components/Content/Blocks/UserUpload.vue +2 -2
- package/components/Settings/AccordionSettings.vue +9 -1
- package/components/Settings/BlockQuoteSettings.vue +143 -0
- package/components/Settings/EmailSettings.vue +216 -0
- package/components/Settings/ImageSettings.vue +1 -1
- package/components/Settings/OpenResponseCollateSettings.vue +1 -1
- package/components/Settings/OpenResponseSettings.vue +7 -9
- package/components/Settings/TabSettings.vue +14 -5
- package/components/Settings/TextEditorSettings.vue +1 -1
- package/components/Settings/UserUploadSettings.vue +1 -1
- package/components/utils/MathExpressionEditor.vue +30 -15
- package/components/utils/TinyMCEWrapper.vue +3 -1
- package/i18n/en-US/components/content/blocks/block_quote.ts +3 -0
- package/i18n/en-US/components/content/blocks/email.ts +12 -0
- package/i18n/en-US/components/content/blocks/index.ts +4 -0
- package/i18n/en-US/components/settings/block_quote.ts +9 -0
- package/i18n/en-US/components/settings/email.ts +9 -0
- package/i18n/en-US/components/settings/index.ts +4 -0
- package/i18n/en-US/components/utils/index.ts +2 -0
- package/i18n/en-US/components/utils/math_expression_editor.ts +3 -0
- package/i18n/en-US/shared/content_blocks.ts +2 -1
- package/i18n/en-US/shared/settings.ts +5 -0
- package/i18n/es-ES/components/content/blocks/block_quote.ts +3 -0
- package/i18n/es-ES/components/content/blocks/email.ts +12 -0
- package/i18n/es-ES/components/content/blocks/index.ts +4 -0
- package/i18n/es-ES/components/settings/block_quote.ts +9 -0
- package/i18n/es-ES/components/settings/email.ts +9 -0
- package/i18n/es-ES/components/settings/index.ts +4 -0
- package/i18n/es-ES/components/utils/index.ts +2 -1
- package/i18n/es-ES/components/utils/math_expression_editor.ts +3 -0
- package/i18n/es-ES/shared/content_blocks.ts +2 -1
- package/i18n/es-ES/shared/settings.ts +5 -0
- package/i18n/sv-SE/components/content/blocks/block_quote.ts +3 -0
- package/i18n/sv-SE/components/content/blocks/email.ts +12 -0
- package/i18n/sv-SE/components/content/blocks/index.ts +4 -0
- package/i18n/sv-SE/components/settings/block_quote.ts +9 -0
- package/i18n/sv-SE/components/settings/email.ts +9 -0
- package/i18n/sv-SE/components/settings/index.ts +4 -0
- package/i18n/sv-SE/components/utils/index.ts +2 -1
- package/i18n/sv-SE/components/utils/math_expression_editor.ts +3 -0
- package/i18n/sv-SE/shared/content_blocks.ts +2 -1
- package/i18n/sv-SE/shared/settings.ts +5 -0
- package/package.json +4 -4
- package/plugin.js +42 -0
- package/test/Components/Content/Blocks/Accordion.spec.js +2 -0
- package/test/Components/Content/Blocks/BlockQuote.spec.js +23 -0
- package/test/Components/Content/Blocks/Email.spec.js +23 -0
- package/test/Components/Content/Blocks/Feedback.spec.js +1 -0
- package/test/Components/Content/Blocks/Math.spec.js +1 -0
- package/test/Components/Content/Blocks/Tab.spec.js +1 -0
- package/test/Components/Settings/BlockQuoteSettings.spec.js +20 -0
- package/test/Components/Settings/EmailSettings.spec.js +45 -0
- package/test/__mocks__/componentsMock.js +6 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<v-container>
|
|
4
4
|
<v-tabs
|
|
5
5
|
background-color="primary"
|
|
6
|
-
v-model="block.metadata.config.
|
|
6
|
+
v-model="block.metadata.config.currentTab"
|
|
7
7
|
>
|
|
8
8
|
<v-tabs-slider></v-tabs-slider>
|
|
9
9
|
<v-tab
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
|
|
41
41
|
<script>
|
|
42
42
|
import _ from 'lodash'
|
|
43
|
-
import TextEditor from '~/components/Text/TextEditor
|
|
44
|
-
import TextViewer from '~/components/Text/TextViewer
|
|
43
|
+
import TextEditor from '~/components/Text/TextEditor'
|
|
44
|
+
import TextViewer from '~/components/Text/TextViewer'
|
|
45
45
|
import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
|
|
46
46
|
|
|
47
47
|
export default {
|
|
@@ -74,6 +74,9 @@ export default {
|
|
|
74
74
|
}
|
|
75
75
|
})
|
|
76
76
|
}
|
|
77
|
+
if (_.isEmpty(this.block.metadata.config.currentTab)) {
|
|
78
|
+
this.block.metadata.config.currentTab = 0
|
|
79
|
+
}
|
|
77
80
|
},
|
|
78
81
|
data() {
|
|
79
82
|
return {}
|
|
@@ -83,6 +86,7 @@ export default {
|
|
|
83
86
|
this.block.metadata.config.items.forEach((element) => {
|
|
84
87
|
element.expand = false
|
|
85
88
|
})
|
|
89
|
+
this.block.metadata.config.currentTab = null
|
|
86
90
|
},
|
|
87
91
|
},
|
|
88
92
|
}
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
<script>
|
|
93
93
|
import _ from 'lodash'
|
|
94
94
|
import { mapGetters } from 'vuex'
|
|
95
|
-
import TextViewer from '~/components/Text/TextViewer
|
|
96
|
-
import TextEditor from '~/components/Text/TextEditor
|
|
95
|
+
import TextViewer from '~/components/Text/TextViewer'
|
|
96
|
+
import TextEditor from '~/components/Text/TextEditor'
|
|
97
97
|
import Uuid from '~/helpers/Uuid'
|
|
98
98
|
import Download from '~/helpers/Download'
|
|
99
99
|
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
</p>
|
|
11
11
|
<SortableExpansionPanel
|
|
12
12
|
v-model="block.metadata.config.items"
|
|
13
|
+
v-bind:currentPanel.sync="
|
|
14
|
+
block.metadata.config.currentAccordion
|
|
15
|
+
"
|
|
13
16
|
@click:close="onRemoveElement($event)"
|
|
14
17
|
@change="onDragged"
|
|
15
18
|
>
|
|
@@ -17,7 +20,7 @@
|
|
|
17
20
|
item.header
|
|
18
21
|
? item.header
|
|
19
22
|
: $t(
|
|
20
|
-
'
|
|
23
|
+
'windward.core.shared.settings.title.placeholder'
|
|
21
24
|
)
|
|
22
25
|
}}</template>
|
|
23
26
|
<template #body="{ index }">
|
|
@@ -128,6 +131,9 @@ export default {
|
|
|
128
131
|
this.block.metadata.config.items = []
|
|
129
132
|
this.block.metadata.config.items.push(defaultObject)
|
|
130
133
|
}
|
|
134
|
+
if (_.isEmpty(this.block.metadata.config.currentAccordion)) {
|
|
135
|
+
this.block.metadata.config.currentAccordion = 0
|
|
136
|
+
}
|
|
131
137
|
this.block.body = this.$t(
|
|
132
138
|
'windward.core.components.settings.accordion.accordion'
|
|
133
139
|
)
|
|
@@ -153,6 +159,8 @@ export default {
|
|
|
153
159
|
content: '',
|
|
154
160
|
}
|
|
155
161
|
this.block.metadata.config.items.push(default_item)
|
|
162
|
+
this.block.metadata.config.currentAccordion =
|
|
163
|
+
this.block.metadata.config.items.length - 1
|
|
156
164
|
},
|
|
157
165
|
onRemoveElement(index) {
|
|
158
166
|
this.block.metadata.config.items.splice(index, 1)
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<v-form ref="form" v-model="valid" v-if="!loading"> </v-form>
|
|
4
|
+
<v-container class="pa-0">
|
|
5
|
+
<v-text-field
|
|
6
|
+
v-model="block.metadata.config.title"
|
|
7
|
+
outlined
|
|
8
|
+
:counter="50"
|
|
9
|
+
:autofocus="true"
|
|
10
|
+
:label="$t('windward.core.shared.settings.title.title')"
|
|
11
|
+
ref="title"
|
|
12
|
+
></v-text-field>
|
|
13
|
+
<v-textarea
|
|
14
|
+
v-model="block.metadata.config.instructions"
|
|
15
|
+
outlined
|
|
16
|
+
auto-grow
|
|
17
|
+
:counter="255"
|
|
18
|
+
:label="$t('windward.core.shared.settings.title.instructions')"
|
|
19
|
+
></v-textarea>
|
|
20
|
+
</v-container>
|
|
21
|
+
<v-divider class="my-4 primary"></v-divider>
|
|
22
|
+
<v-container class="pa-0">
|
|
23
|
+
<v-textarea
|
|
24
|
+
v-model="block.metadata.config.block_quote.quote"
|
|
25
|
+
outlined
|
|
26
|
+
auto-grow
|
|
27
|
+
:counter="255"
|
|
28
|
+
:label="
|
|
29
|
+
$t('windward.core.components.settings.block_quote.body')
|
|
30
|
+
"
|
|
31
|
+
></v-textarea>
|
|
32
|
+
</v-container>
|
|
33
|
+
<v-divider class="my-4 primary"></v-divider>
|
|
34
|
+
<v-container class="pa-0">
|
|
35
|
+
<v-text-field
|
|
36
|
+
v-model="block.metadata.config.block_quote.author"
|
|
37
|
+
outlined
|
|
38
|
+
auto-grow
|
|
39
|
+
:label="
|
|
40
|
+
$t('windward.core.components.settings.block_quote.name')
|
|
41
|
+
"
|
|
42
|
+
></v-text-field>
|
|
43
|
+
<v-text-field
|
|
44
|
+
v-model="block.metadata.config.block_quote.author_title"
|
|
45
|
+
outlined
|
|
46
|
+
auto-grow
|
|
47
|
+
:label="
|
|
48
|
+
$t('windward.core.components.settings.block_quote.title')
|
|
49
|
+
"
|
|
50
|
+
></v-text-field>
|
|
51
|
+
<v-text-field
|
|
52
|
+
v-model="block.metadata.config.block_quote.organization"
|
|
53
|
+
outlined
|
|
54
|
+
auto-grow
|
|
55
|
+
:label="$t('windward.core.components.settings.block_quote.org')"
|
|
56
|
+
></v-text-field>
|
|
57
|
+
<v-text-field
|
|
58
|
+
v-model="block.metadata.config.block_quote.source_title"
|
|
59
|
+
outlined
|
|
60
|
+
auto-grow
|
|
61
|
+
:label="
|
|
62
|
+
$t(
|
|
63
|
+
'windward.core.components.settings.block_quote.source_title'
|
|
64
|
+
)
|
|
65
|
+
"
|
|
66
|
+
></v-text-field>
|
|
67
|
+
<v-select
|
|
68
|
+
v-model="block.metadata.config.block_quote.source_type"
|
|
69
|
+
:items="sourceTypes"
|
|
70
|
+
outlined
|
|
71
|
+
:label="
|
|
72
|
+
$t('windward.core.components.settings.block_quote.type')
|
|
73
|
+
"
|
|
74
|
+
></v-select>
|
|
75
|
+
</v-container>
|
|
76
|
+
<div v-if="loading" class="text-center">
|
|
77
|
+
<v-progress-circular
|
|
78
|
+
:size="70"
|
|
79
|
+
:width="7"
|
|
80
|
+
color="primary"
|
|
81
|
+
indeterminate
|
|
82
|
+
></v-progress-circular>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
<script>
|
|
87
|
+
import _ from 'lodash'
|
|
88
|
+
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
89
|
+
|
|
90
|
+
export default {
|
|
91
|
+
name: 'BlockQuoteSettings',
|
|
92
|
+
extends: BaseContentSettings,
|
|
93
|
+
beforeMount() {
|
|
94
|
+
if (_.isEmpty(this.block)) {
|
|
95
|
+
this.block = {}
|
|
96
|
+
}
|
|
97
|
+
if (_.isEmpty(this.block.metadata)) {
|
|
98
|
+
this.block.metadata = {}
|
|
99
|
+
}
|
|
100
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
101
|
+
this.block.metadata.config = {}
|
|
102
|
+
}
|
|
103
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
104
|
+
this.block.metadata.config.title = ''
|
|
105
|
+
}
|
|
106
|
+
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
107
|
+
this.block.metadata.config.instructions = ''
|
|
108
|
+
}
|
|
109
|
+
if (_.isEmpty(this.block.metadata.config.block_quote)) {
|
|
110
|
+
this.block.metadata.config.block_quote = {
|
|
111
|
+
quote: '',
|
|
112
|
+
author: '',
|
|
113
|
+
author_title: '',
|
|
114
|
+
organization: '',
|
|
115
|
+
source_title: '',
|
|
116
|
+
source_type: '',
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
this.block.body = this.$t(
|
|
120
|
+
'windward.core.shared.settings.title.block_quote'
|
|
121
|
+
)
|
|
122
|
+
},
|
|
123
|
+
data() {
|
|
124
|
+
return {
|
|
125
|
+
valid: true,
|
|
126
|
+
loading: false,
|
|
127
|
+
sourceTypes: ['None', 'Book', 'Online Journal'],
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
beforeDestroy() {
|
|
131
|
+
if (this.debouncer) {
|
|
132
|
+
clearTimeout(this.debouncer)
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
methods: {},
|
|
137
|
+
}
|
|
138
|
+
</script>
|
|
139
|
+
<style scoped>
|
|
140
|
+
.v-progress-circular {
|
|
141
|
+
margin: 1rem;
|
|
142
|
+
}
|
|
143
|
+
</style>
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<v-form ref="form" v-model="valid" v-if="!loading"> </v-form>
|
|
4
|
+
<v-container class="pa-0">
|
|
5
|
+
<v-text-field
|
|
6
|
+
v-model="block.metadata.config.title"
|
|
7
|
+
outlined
|
|
8
|
+
:counter="50"
|
|
9
|
+
:autofocus="true"
|
|
10
|
+
:label="$t('windward.core.shared.settings.title.title')"
|
|
11
|
+
ref="title"
|
|
12
|
+
></v-text-field>
|
|
13
|
+
<v-textarea
|
|
14
|
+
v-model="block.metadata.config.instructions"
|
|
15
|
+
outlined
|
|
16
|
+
auto-grow
|
|
17
|
+
:counter="255"
|
|
18
|
+
:label="$t('windward.core.shared.settings.title.instructions')"
|
|
19
|
+
></v-textarea>
|
|
20
|
+
</v-container>
|
|
21
|
+
<v-container class="pa-0">
|
|
22
|
+
<v-text-field
|
|
23
|
+
v-model="block.metadata.config.subject"
|
|
24
|
+
outlined
|
|
25
|
+
:label="$t('windward.core.components.settings.email.subject')"
|
|
26
|
+
></v-text-field>
|
|
27
|
+
</v-container>
|
|
28
|
+
<v-divider class="my-4 primary"></v-divider>
|
|
29
|
+
<v-container class="pa-0">
|
|
30
|
+
<p>Email Items</p>
|
|
31
|
+
<SortableExpansionPanel
|
|
32
|
+
v-model="block.metadata.config.emails"
|
|
33
|
+
@click:close="onRemoveElement($event)"
|
|
34
|
+
@change="onDragged"
|
|
35
|
+
>
|
|
36
|
+
<template #header="{ item }">{{
|
|
37
|
+
item.from
|
|
38
|
+
? item.from
|
|
39
|
+
: $t(
|
|
40
|
+
'windward.core.shared.settings.title.click_to_enter'
|
|
41
|
+
)
|
|
42
|
+
}}</template>
|
|
43
|
+
<template #body="{ item, index }">
|
|
44
|
+
<v-container :key="expansionPanelKey">
|
|
45
|
+
<v-text-field
|
|
46
|
+
v-model="block.metadata.config.emails[index].from"
|
|
47
|
+
:autofocus="true"
|
|
48
|
+
outlined
|
|
49
|
+
:label="
|
|
50
|
+
$t(
|
|
51
|
+
'windward.core.components.settings.email.from'
|
|
52
|
+
)
|
|
53
|
+
"
|
|
54
|
+
></v-text-field>
|
|
55
|
+
<v-text-field
|
|
56
|
+
v-model="block.metadata.config.emails[index].to"
|
|
57
|
+
outlined
|
|
58
|
+
:label="
|
|
59
|
+
$t('windward.core.components.settings.email.to')
|
|
60
|
+
"
|
|
61
|
+
></v-text-field>
|
|
62
|
+
<v-text-field
|
|
63
|
+
v-model="block.metadata.config.emails[index].cc"
|
|
64
|
+
outlined
|
|
65
|
+
:label="
|
|
66
|
+
$t('windward.core.components.settings.email.cc')
|
|
67
|
+
"
|
|
68
|
+
></v-text-field>
|
|
69
|
+
<v-btn
|
|
70
|
+
@click="
|
|
71
|
+
onToggleExpand(
|
|
72
|
+
block.metadata.config.emails[index],
|
|
73
|
+
index
|
|
74
|
+
)
|
|
75
|
+
"
|
|
76
|
+
>
|
|
77
|
+
<v-icon
|
|
78
|
+
v-if="
|
|
79
|
+
!block.metadata.config.emails[index].expand
|
|
80
|
+
"
|
|
81
|
+
>mdi-arrow-expand-all</v-icon
|
|
82
|
+
>
|
|
83
|
+
<v-icon
|
|
84
|
+
v-if="
|
|
85
|
+
block.metadata.config.emails[index].expand
|
|
86
|
+
"
|
|
87
|
+
>
|
|
88
|
+
mdi-arrow-collapse-all
|
|
89
|
+
</v-icon>
|
|
90
|
+
</v-btn>
|
|
91
|
+
<TextEditor
|
|
92
|
+
v-show="!block.metadata.config.emails[index].expand"
|
|
93
|
+
v-model="block.metadata.config.emails[index].body"
|
|
94
|
+
></TextEditor>
|
|
95
|
+
</v-container>
|
|
96
|
+
</template>
|
|
97
|
+
</SortableExpansionPanel>
|
|
98
|
+
</v-container>
|
|
99
|
+
<v-container class="pa-0">
|
|
100
|
+
<v-row justify="center" class="my-4">
|
|
101
|
+
<v-btn color="primary" @click="onAddElement"
|
|
102
|
+
><v-icon>mdi-plus</v-icon
|
|
103
|
+
>{{
|
|
104
|
+
$t('windward.core.components.settings.accordion.add')
|
|
105
|
+
}}</v-btn
|
|
106
|
+
>
|
|
107
|
+
</v-row>
|
|
108
|
+
</v-container>
|
|
109
|
+
<div v-if="loading" class="text-center">
|
|
110
|
+
<v-progress-circular
|
|
111
|
+
:size="70"
|
|
112
|
+
:width="7"
|
|
113
|
+
color="primary"
|
|
114
|
+
indeterminate
|
|
115
|
+
></v-progress-circular>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</template>
|
|
119
|
+
<script>
|
|
120
|
+
import _ from 'lodash'
|
|
121
|
+
import Crypto from '~/helpers/Crypto'
|
|
122
|
+
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
123
|
+
import TextEditor from '~/components/Text/TextEditor'
|
|
124
|
+
import SortableExpansionPanel from '~/components/SortableExpansionPanel.vue'
|
|
125
|
+
|
|
126
|
+
export default {
|
|
127
|
+
name: 'EmailSettings',
|
|
128
|
+
components: {
|
|
129
|
+
SortableExpansionPanel,
|
|
130
|
+
TextEditor,
|
|
131
|
+
},
|
|
132
|
+
extends: BaseContentSettings,
|
|
133
|
+
beforeMount() {
|
|
134
|
+
if (_.isEmpty(this.block)) {
|
|
135
|
+
this.block = {}
|
|
136
|
+
}
|
|
137
|
+
if (_.isEmpty(this.block.metadata)) {
|
|
138
|
+
this.block.metadata = {}
|
|
139
|
+
}
|
|
140
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
141
|
+
this.block.metadata.config = {}
|
|
142
|
+
}
|
|
143
|
+
if (_.isEmpty(this.block.metadata.config.title)) {
|
|
144
|
+
this.block.metadata.config.title = ''
|
|
145
|
+
}
|
|
146
|
+
if (_.isEmpty(this.block.metadata.config.instructions)) {
|
|
147
|
+
this.block.metadata.config.instructions = ''
|
|
148
|
+
}
|
|
149
|
+
if (_.isEmpty(this.block.metadata.config.subject)) {
|
|
150
|
+
this.block.metadata.config.subject = ''
|
|
151
|
+
}
|
|
152
|
+
if (_.isEmpty(this.block.metadata.config.emails)) {
|
|
153
|
+
this.block.metadata.config.emails = []
|
|
154
|
+
const defaultObject = {
|
|
155
|
+
from: '',
|
|
156
|
+
to: '',
|
|
157
|
+
cc: '',
|
|
158
|
+
body: '',
|
|
159
|
+
expand: false,
|
|
160
|
+
initials: '',
|
|
161
|
+
}
|
|
162
|
+
this.block.metadata.config.emails.push(defaultObject)
|
|
163
|
+
}
|
|
164
|
+
this.block.body = 'emails'
|
|
165
|
+
},
|
|
166
|
+
data() {
|
|
167
|
+
return {
|
|
168
|
+
valid: true,
|
|
169
|
+
loading: false,
|
|
170
|
+
expansionPanelKey: 0,
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
beforeDestroy() {
|
|
174
|
+
if (this.debouncer) {
|
|
175
|
+
clearTimeout(this.debouncer)
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
methods: {
|
|
179
|
+
onBeforeSave() {
|
|
180
|
+
this.block.metadata.config.emails.forEach((element) => {
|
|
181
|
+
let matches = element.from.match(/\b(\w)/g)
|
|
182
|
+
element.initials = matches.join('')
|
|
183
|
+
element.expand = false
|
|
184
|
+
})
|
|
185
|
+
},
|
|
186
|
+
onRemoveElement(event) {
|
|
187
|
+
this.block.metadata.config.emails.splice(event, 1)
|
|
188
|
+
this.expansionPanelKey = Crypto.id()
|
|
189
|
+
},
|
|
190
|
+
onAddElement() {
|
|
191
|
+
const defaultObject = {
|
|
192
|
+
from: '',
|
|
193
|
+
to: '',
|
|
194
|
+
cc: '',
|
|
195
|
+
body: '',
|
|
196
|
+
expand: false,
|
|
197
|
+
initials: '',
|
|
198
|
+
}
|
|
199
|
+
this.block.metadata.config.emails.push(defaultObject)
|
|
200
|
+
},
|
|
201
|
+
onToggleExpand(item, index) {
|
|
202
|
+
this.expansionPanelKey = Crypto.id()
|
|
203
|
+
return (item.expand = !item.expand)
|
|
204
|
+
},
|
|
205
|
+
onDragged() {
|
|
206
|
+
// need to remount body after dragged to update the content body on the element
|
|
207
|
+
this.expansionPanelKey = Crypto.id()
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
}
|
|
211
|
+
</script>
|
|
212
|
+
<style scoped>
|
|
213
|
+
.v-progress-circular {
|
|
214
|
+
margin: 1rem;
|
|
215
|
+
}
|
|
216
|
+
</style>
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
<script>
|
|
50
50
|
import _ from 'lodash'
|
|
51
|
-
import TextEditor from '~/components/Text/TextEditor
|
|
51
|
+
import TextEditor from '~/components/Text/TextEditor'
|
|
52
52
|
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
53
53
|
import ContentBlockAsset from '~/components/Content/ContentBlockAsset.vue'
|
|
54
54
|
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
import _ from 'lodash'
|
|
76
76
|
import { mapGetters } from 'vuex'
|
|
77
77
|
import draggable from 'vuedraggable'
|
|
78
|
-
import TextEditor from '~/components/Text/TextEditor
|
|
78
|
+
import TextEditor from '~/components/Text/TextEditor'
|
|
79
79
|
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
80
80
|
import ContentBlock from '~/models/ContentBlock'
|
|
81
81
|
import Course from '~/models/Course'
|
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-container>
|
|
3
3
|
<v-form>
|
|
4
|
-
<
|
|
4
|
+
<p>
|
|
5
5
|
{{
|
|
6
6
|
$t(
|
|
7
7
|
'windward.core.components.settings.open_response.question'
|
|
8
8
|
)
|
|
9
9
|
}}
|
|
10
|
-
</
|
|
10
|
+
</p>
|
|
11
11
|
<TextEditor v-model="block.body" :height="200"></TextEditor>
|
|
12
|
-
|
|
13
|
-
<h3 class="pb-2">
|
|
12
|
+
<p class="pt-4">
|
|
14
13
|
{{
|
|
15
14
|
$t(
|
|
16
15
|
'windward.core.components.settings.open_response.sample_response'
|
|
17
16
|
)
|
|
18
17
|
}}
|
|
19
|
-
</
|
|
18
|
+
</p>
|
|
20
19
|
<TextEditor
|
|
21
20
|
v-model="block.metadata.config.sample_response"
|
|
22
21
|
:height="200"
|
|
23
22
|
></TextEditor>
|
|
24
|
-
|
|
25
|
-
<h3 class="pb-2">
|
|
23
|
+
<p class="pt-4">
|
|
26
24
|
{{
|
|
27
25
|
$t(
|
|
28
26
|
'windward.core.components.settings.open_response.starting_text'
|
|
29
27
|
)
|
|
30
28
|
}}
|
|
31
|
-
</
|
|
29
|
+
</p>
|
|
32
30
|
<TextEditor
|
|
33
31
|
v-model="block.metadata.config.starting_text"
|
|
34
32
|
:height="200"
|
|
@@ -39,7 +37,7 @@
|
|
|
39
37
|
|
|
40
38
|
<script>
|
|
41
39
|
import _ from 'lodash'
|
|
42
|
-
import TextEditor from '~/components/Text/TextEditor
|
|
40
|
+
import TextEditor from '~/components/Text/TextEditor'
|
|
43
41
|
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
44
42
|
import ContentBlockAsset from '~/components/Content/ContentBlockAsset.vue'
|
|
45
43
|
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
<p>{{ $t('windward.core.components.settings.tab.tabs') }}</p>
|
|
6
6
|
<SortableExpansionPanel
|
|
7
7
|
v-model="block.metadata.config.items"
|
|
8
|
+
v-bind:currentPanel.sync="block.metadata.config.currentTab"
|
|
9
|
+
@change="onDragged"
|
|
8
10
|
@click:close="onRemoveElement($event)"
|
|
9
|
-
:copy="false"
|
|
10
11
|
>
|
|
11
|
-
<template #header="{ item
|
|
12
|
+
<template #header="{ item }">
|
|
12
13
|
{{ item.tabHeader !== '' ? item.tabHeader : 'No Header' }}
|
|
13
14
|
</template>
|
|
14
15
|
<template #body="{ item, index }">
|
|
@@ -42,9 +43,9 @@
|
|
|
42
43
|
</v-icon>
|
|
43
44
|
</v-btn>
|
|
44
45
|
<TextEditor
|
|
45
|
-
:api_key="api_key"
|
|
46
46
|
v-model="block.metadata.config.items[index].content"
|
|
47
47
|
v-if="!item.expand"
|
|
48
|
+
:key="textEditorUpdateKey"
|
|
48
49
|
></TextEditor>
|
|
49
50
|
</v-container>
|
|
50
51
|
</template>
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
<script>
|
|
71
72
|
import _, { get } from 'lodash'
|
|
72
73
|
import Crypto from '~/helpers/Crypto'
|
|
73
|
-
import TextEditor from '~/components/Text/TextEditor
|
|
74
|
+
import TextEditor from '~/components/Text/TextEditor'
|
|
74
75
|
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
75
76
|
import SortableExpansionPanel from '~/components/SortableExpansionPanel.vue'
|
|
76
77
|
|
|
@@ -96,6 +97,9 @@ export default {
|
|
|
96
97
|
if (_.isEmpty(this.block.metadata.config.tab)) {
|
|
97
98
|
this.block.metadata.config.tab = 0
|
|
98
99
|
}
|
|
100
|
+
if (_.isEmpty(this.block.metadata.config.currentTab)) {
|
|
101
|
+
this.block.metadata.config.currentTab = 0
|
|
102
|
+
}
|
|
99
103
|
if (_.isEmpty(this.block.metadata.config.items)) {
|
|
100
104
|
const defaultObject = {
|
|
101
105
|
tabHeader: '',
|
|
@@ -109,7 +113,7 @@ export default {
|
|
|
109
113
|
data() {
|
|
110
114
|
return {
|
|
111
115
|
expansionPanelKey: '0',
|
|
112
|
-
|
|
116
|
+
textEditorUpdateKey: Crypto.id(),
|
|
113
117
|
valid: true,
|
|
114
118
|
loading: false,
|
|
115
119
|
}
|
|
@@ -132,6 +136,8 @@ export default {
|
|
|
132
136
|
content: '',
|
|
133
137
|
}
|
|
134
138
|
this.block.metadata.config.items.push(defaultObject)
|
|
139
|
+
this.block.metadata.config.currentTab =
|
|
140
|
+
this.block.metadata.config.items.length - 1
|
|
135
141
|
},
|
|
136
142
|
onRemoveElement(index) {
|
|
137
143
|
this.block.metadata.config.items.splice(index, 1)
|
|
@@ -142,6 +148,9 @@ export default {
|
|
|
142
148
|
return (this.block.metadata.config.items[index].expand =
|
|
143
149
|
!this.block.metadata.config.items[index].expand)
|
|
144
150
|
},
|
|
151
|
+
onDragged() {
|
|
152
|
+
this.textEditorUpdateKey = Crypto.id()
|
|
153
|
+
},
|
|
145
154
|
},
|
|
146
155
|
}
|
|
147
156
|
</script>
|
|
@@ -138,7 +138,7 @@ import { mapGetters, mapMutations } from 'vuex'
|
|
|
138
138
|
import GlossaryHelper from '../../helpers/GlossaryHelper'
|
|
139
139
|
import Course from '~/models/Course'
|
|
140
140
|
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
141
|
-
import TextEditor from '~/components/Text/TextEditor
|
|
141
|
+
import TextEditor from '~/components/Text/TextEditor'
|
|
142
142
|
import CourseGlossaryForm from '../utils/glossary/CourseGlossaryForm.vue'
|
|
143
143
|
export default {
|
|
144
144
|
name: 'TextEditorSettings',
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
<script>
|
|
51
51
|
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
52
52
|
import Crypto from '~/helpers/Crypto'
|
|
53
|
-
import TextEditor from '~/components/Text/TextEditor
|
|
53
|
+
import TextEditor from '~/components/Text/TextEditor'
|
|
54
54
|
import _ from 'lodash'
|
|
55
55
|
|
|
56
56
|
export default {
|