@windward/core 0.1.0 → 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.
Files changed (43) hide show
  1. package/components/Content/Blocks/Accordion.vue +7 -2
  2. package/components/Content/Blocks/Email.vue +248 -0
  3. package/components/Content/Blocks/Image.vue +1 -1
  4. package/components/Content/Blocks/OpenResponse.vue +2 -2
  5. package/components/Content/Blocks/Tab.vue +7 -3
  6. package/components/Content/Blocks/UserUpload.vue +2 -2
  7. package/components/Settings/AccordionSettings.vue +9 -1
  8. package/components/Settings/EmailSettings.vue +216 -0
  9. package/components/Settings/ImageSettings.vue +1 -1
  10. package/components/Settings/OpenResponseCollateSettings.vue +1 -1
  11. package/components/Settings/OpenResponseSettings.vue +1 -1
  12. package/components/Settings/TabSettings.vue +7 -1
  13. package/components/Settings/TextEditorSettings.vue +1 -1
  14. package/components/Settings/UserUploadSettings.vue +1 -1
  15. package/components/utils/TinyMCEWrapper.vue +1 -1
  16. package/i18n/en-US/components/content/blocks/email.ts +12 -0
  17. package/i18n/en-US/components/content/blocks/index.ts +3 -1
  18. package/i18n/en-US/components/settings/email.ts +9 -0
  19. package/i18n/en-US/components/settings/index.ts +2 -0
  20. package/i18n/en-US/shared/content_blocks.ts +1 -1
  21. package/i18n/en-US/shared/settings.ts +3 -0
  22. package/i18n/es-ES/components/content/blocks/email.ts +12 -0
  23. package/i18n/es-ES/components/content/blocks/index.ts +3 -1
  24. package/i18n/es-ES/components/settings/email.ts +9 -0
  25. package/i18n/es-ES/components/settings/index.ts +3 -1
  26. package/i18n/es-ES/shared/content_blocks.ts +1 -1
  27. package/i18n/es-ES/shared/settings.ts +3 -0
  28. package/i18n/sv-SE/components/content/blocks/email.ts +12 -0
  29. package/i18n/sv-SE/components/content/blocks/index.ts +3 -1
  30. package/i18n/sv-SE/components/settings/email.ts +9 -0
  31. package/i18n/sv-SE/components/settings/index.ts +3 -1
  32. package/i18n/sv-SE/shared/content_blocks.ts +1 -1
  33. package/i18n/sv-SE/shared/settings.ts +3 -0
  34. package/package.json +1 -1
  35. package/plugin.js +21 -0
  36. package/test/Components/Content/Blocks/Accordion.spec.js +2 -0
  37. package/test/Components/Content/Blocks/BlockQuote.spec.js +2 -0
  38. package/test/Components/Content/Blocks/Email.spec.js +23 -0
  39. package/test/Components/Content/Blocks/Feedback.spec.js +1 -0
  40. package/test/Components/Content/Blocks/Math.spec.js +1 -0
  41. package/test/Components/Content/Blocks/Tab.spec.js +1 -0
  42. package/test/Components/Settings/EmailSettings.spec.js +45 -0
  43. package/test/__mocks__/componentsMock.js +6 -0
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div>
3
3
  <v-expansion-panels
4
+ v-model="block.metadata.config.currentAccordion"
4
5
  flat
5
6
  accordion
6
7
  focusable
@@ -43,8 +44,8 @@
43
44
  <script>
44
45
  import _ from 'lodash'
45
46
  import Crypto from '~/helpers/Crypto'
46
- import TextEditor from '~/components/Text/TextEditor.vue'
47
- import TextViewer from '~/components/Text/TextViewer.vue'
47
+ import TextEditor from '~/components/Text/TextEditor'
48
+ import TextViewer from '~/components/Text/TextViewer'
48
49
  import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
49
50
 
50
51
  export default {
@@ -73,6 +74,9 @@ export default {
73
74
  this.block.metadata.config.items = []
74
75
  this.block.metadata.config.items.push(defaultObject)
75
76
  }
77
+ if (_.isEmpty(this.block.metadata.config.currentAccordion)) {
78
+ this.block.metadata.config.currentAccordion = 0
79
+ }
76
80
  this.block.body = 'accordion'
77
81
  },
78
82
  data() {
@@ -114,6 +118,7 @@ export default {
114
118
  this.block.metadata.config.items.forEach((element) => {
115
119
  element.expand = false
116
120
  })
121
+ this.block.metadata.config.currentAccordion = null
117
122
  },
118
123
  },
119
124
  }
@@ -0,0 +1,248 @@
1
+ <template>
2
+ <v-container class="container-left-border">
3
+ <v-row
4
+ v-if="
5
+ block.metadata.config.title ||
6
+ block.metadata.config.instructions
7
+ "
8
+ >
9
+ <v-col cols="12" class="pa-0">
10
+ <h3 v-if="block.metadata.config.title">
11
+ {{ block.metadata.config.title }}
12
+ </h3>
13
+ <p v-if="block.metadata.config.instructions" class="pb-0 mb-0">
14
+ {{ block.metadata.config.instructions }}
15
+ </p>
16
+ </v-col>
17
+ </v-row>
18
+ <v-row>
19
+ <v-expansion-panels v-model="selectedPanels" accordion>
20
+ <v-container
21
+ class="pa-0 primary container-subject d-flex justify-center align-center"
22
+ >
23
+ <v-row class="d-flex pa-5">
24
+ <v-col cols="6">
25
+ {{
26
+ block.metadata.config.subject
27
+ ? block.metadata.config.subject
28
+ : 'Subject'
29
+ }}
30
+ </v-col>
31
+ <v-col
32
+ cols="6"
33
+ class="d-flex justify-end column-simulation"
34
+ >
35
+ {{
36
+ $t(
37
+ 'windward.core.components.content.blocks.email.simulation'
38
+ )
39
+ }}
40
+ </v-col>
41
+ </v-row>
42
+ </v-container>
43
+ <v-expansion-panel
44
+ v-for="(item, index) in block.metadata.config.emails"
45
+ :key="index"
46
+ elevation="0"
47
+ >
48
+ <v-expansion-panel-header>
49
+ <v-row>
50
+ <v-col class="pa-0 d-flex align-center">
51
+ <v-btn fab x-small class="primary" elevation="0"
52
+ >{{ item.initials ? item.initials : '' }}
53
+ </v-btn>
54
+ <v-icon
55
+ v-if="
56
+ block.metadata.config.emails.length !==
57
+ index + 1
58
+ "
59
+ >mdi-circle-medium</v-icon
60
+ >
61
+ <v-icon
62
+ v-if="
63
+ block.metadata.config.emails.length ===
64
+ index + 1
65
+ "
66
+ color="secondary"
67
+ >mdi-circle-medium</v-icon
68
+ >
69
+ <span class="span-details"
70
+ >{{ item.from ? item.from : 'From' }}
71
+ </span>
72
+ </v-col>
73
+ <v-col> </v-col>
74
+ </v-row>
75
+ </v-expansion-panel-header>
76
+ <v-expansion-panel-content>
77
+ <v-container class="pa-0 container-details">
78
+ <v-row>
79
+ <v-col cols="1"></v-col>
80
+ <v-col class="pa-0 div-details">
81
+ <div class="div-details-to pl-4">
82
+ {{
83
+ $t(
84
+ 'windward.core.components.content.blocks.email.to'
85
+ )
86
+ }}: {{ item.to }}
87
+ </div>
88
+ <div class="div-details-cc pl-4">
89
+ {{
90
+ $t(
91
+ 'windward.core.components.content.blocks.email.cc'
92
+ )
93
+ }}: {{ item.cc }}
94
+ </div>
95
+ </v-col>
96
+ </v-row>
97
+ <v-row>
98
+ <v-col cols="1"></v-col>
99
+ <v-col class="pl-4">
100
+ <TextViewer
101
+ v-if="!item.expand"
102
+ v-model="item.body"
103
+ text-viewer
104
+ ></TextViewer>
105
+ <TextEditor
106
+ v-if="!render && item.expand"
107
+ v-model="
108
+ block.metadata.config.emails[index]
109
+ .body
110
+ "
111
+ ></TextEditor>
112
+ </v-col>
113
+ </v-row>
114
+ </v-container>
115
+ <v-container
116
+ v-if="
117
+ block.metadata.config.emails.length ===
118
+ index + 1
119
+ "
120
+ >
121
+ <v-row class="pt-4">
122
+ <v-col cols="10" class="pa-0">
123
+ <v-btn color="primary" outlined>
124
+ <v-icon>mdi-reply</v-icon>
125
+ {{
126
+ $t(
127
+ 'windward.core.components.content.blocks.email.reply'
128
+ )
129
+ }}</v-btn
130
+ >
131
+ <v-btn color="primary" outlined>
132
+ <v-icon>mdi-reply-all</v-icon>
133
+ {{
134
+ $t(
135
+ 'windward.core.components.content.blocks.email.reply_all'
136
+ )
137
+ }}</v-btn
138
+ >
139
+ <v-btn color="primary" outlined>
140
+ <v-icon>mdi-share</v-icon>
141
+ {{
142
+ $t(
143
+ 'windward.core.components.content.blocks.email.forward'
144
+ )
145
+ }}</v-btn
146
+ >
147
+ </v-col>
148
+ <v-col cols="2" class="pa-0 d-flex justify-end">
149
+ <v-btn color="primary" outlined>
150
+ {{
151
+ $t(
152
+ 'windward.core.components.content.blocks.email.reset'
153
+ )
154
+ }}
155
+ </v-btn>
156
+ </v-col>
157
+ </v-row>
158
+ </v-container>
159
+ </v-expansion-panel-content>
160
+ </v-expansion-panel>
161
+ </v-expansion-panels>
162
+ </v-row>
163
+ </v-container>
164
+ </template>
165
+ <script>
166
+ import _ from 'lodash'
167
+ import TextEditor from '~/components/Text/TextEditor'
168
+ import TextViewer from '~/components/Text/TextViewer'
169
+ import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
170
+ export default {
171
+ name: 'ContentBlockEmail',
172
+ extends: BaseContentBlock,
173
+ components: {
174
+ TextEditor,
175
+ TextViewer,
176
+ },
177
+ beforeMount() {
178
+ if (_.isEmpty(this.block)) {
179
+ this.block = {}
180
+ }
181
+ if (_.isEmpty(this.block.metadata)) {
182
+ this.block.metadata = {}
183
+ }
184
+ if (_.isEmpty(this.block.metadata.config)) {
185
+ this.block.metadata.config = {}
186
+ }
187
+ if (_.isEmpty(this.block.metadata.config.title)) {
188
+ this.block.metadata.config.title = ''
189
+ }
190
+ if (_.isEmpty(this.block.metadata.config.instructions)) {
191
+ this.block.metadata.config.instructions = ''
192
+ }
193
+ if (_.isEmpty(this.block.metadata.config.emails)) {
194
+ this.block.metadata.config.emails = []
195
+ }
196
+ if (_.isEmpty(this.block.metadata.config.activeEmail)) {
197
+ this.block.metadata.config.activeEmail = 0
198
+ }
199
+ this.block.body = 'emails'
200
+ },
201
+ data() {
202
+ return {
203
+ expansionPanelKey: 0,
204
+ selectedPanels: 0,
205
+ }
206
+ },
207
+ watch: {
208
+ render() {
209
+ if (this.render) {
210
+ this.block.metadata.config.emails.forEach((element) => {
211
+ element.expand = false
212
+ })
213
+ this.selectedPanels =
214
+ this.block.metadata.config.emails.length - 1
215
+ }
216
+ },
217
+ },
218
+ mounted() {
219
+ this.selectedPanels = this.block.metadata.config.emails.length - 1
220
+ },
221
+ methods: {},
222
+ }
223
+ </script>
224
+ <style scoped>
225
+ .container-subject {
226
+ height: 40px;
227
+ }
228
+ .column-simulation {
229
+ font-size: 12px;
230
+ }
231
+ .container-details {
232
+ font-size: 10px;
233
+ margin-top: -26px;
234
+ }
235
+ .div-details {
236
+ color: grey;
237
+ }
238
+ .div-details-cc {
239
+ margin-top: -9px;
240
+ }
241
+ .span-details {
242
+ font-weight: bold;
243
+ font-size: 14px;
244
+ }
245
+ .v-expansion-panel {
246
+ border: 1px solid var(--v-primary-base);
247
+ }
248
+ </style>
@@ -45,7 +45,7 @@
45
45
 
46
46
  <script>
47
47
  import _ from 'lodash'
48
- import TextViewer from '~/components/Text/TextViewer.vue'
48
+ import TextViewer from '~/components/Text/TextViewer'
49
49
  import Crypto from '~/helpers/Crypto'
50
50
  import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
51
51
 
@@ -76,8 +76,8 @@
76
76
  <script>
77
77
  import _ from 'lodash'
78
78
  import { mapGetters } from 'vuex'
79
- import TextViewer from '~/components/Text/TextViewer.vue'
80
- import TextEditor from '~/components/Text/TextEditor.vue'
79
+ import TextViewer from '~/components/Text/TextViewer'
80
+ import TextEditor from '~/components/Text/TextEditor'
81
81
  import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
82
82
  import UserContentBlockState from '~/models/UserContentBlockState'
83
83
 
@@ -3,7 +3,7 @@
3
3
  <v-container>
4
4
  <v-tabs
5
5
  background-color="primary"
6
- v-model="block.metadata.config.tab"
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.vue'
44
- import TextViewer from '~/components/Text/TextViewer.vue'
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.vue'
96
- import TextEditor from '~/components/Text/TextEditor.vue'
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
- 'plugin.games.components.settings.bucket_game.form.enter_text'
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,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.vue'
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.vue'
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'
@@ -37,7 +37,7 @@
37
37
 
38
38
  <script>
39
39
  import _ from 'lodash'
40
- import TextEditor from '~/components/Text/TextEditor.vue'
40
+ import TextEditor from '~/components/Text/TextEditor'
41
41
  import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
42
42
  import ContentBlockAsset from '~/components/Content/ContentBlockAsset.vue'
43
43
 
@@ -5,6 +5,7 @@
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"
8
9
  @change="onDragged"
9
10
  @click:close="onRemoveElement($event)"
10
11
  >
@@ -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.vue'
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: '',
@@ -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)
@@ -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.vue'
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.vue'
53
+ import TextEditor from '~/components/Text/TextEditor'
54
54
  import _ from 'lodash'
55
55
 
56
56
  export default {
@@ -231,7 +231,7 @@ export default {
231
231
  ],
232
232
  style_formats_merge: true,
233
233
  placeholder: this.$t(
234
- 'windward.core.shared.content_blocks.grouping.placeholder'
234
+ 'windward.core.shared.settings.title.placeholder'
235
235
  ),
236
236
  //required as it will be displayed as inline style in tinymce renderer
237
237
 
@@ -0,0 +1,12 @@
1
+ export default {
2
+ title: 'Email Block',
3
+ from: 'From',
4
+ to: 'To',
5
+ cc: 'CC',
6
+ body: 'Email Body',
7
+ simulation: 'Email Simulation',
8
+ reply: 'Reply',
9
+ reply_all: 'Reply All',
10
+ forward: 'Forward',
11
+ reset: 'Reset',
12
+ }
@@ -6,6 +6,7 @@ import feedback from './feedback'
6
6
  import open_response from './open_response'
7
7
  import open_response_collate from './open_response_collate'
8
8
  import scenarioChoice from './scenario_choice'
9
+ import email from './email'
9
10
  import block_quote from './block_quote'
10
11
 
11
12
  export default {
@@ -17,5 +18,6 @@ export default {
17
18
  open_response,
18
19
  open_response_collate,
19
20
  scenario_choice: scenarioChoice,
20
- block_quote
21
+ email,
22
+ block_quote,
21
23
  }
@@ -0,0 +1,9 @@
1
+ export default {
2
+ items: 'Email Items',
3
+ add: 'Add Email',
4
+ subject: 'Subject',
5
+ from: 'From',
6
+ to: 'To',
7
+ cc: 'CC',
8
+ body: 'Email Body',
9
+ }
@@ -8,6 +8,7 @@ import open_response_collate from './open_response_collate'
8
8
  import scenarioChoice from './scenario_choice'
9
9
  import accordion from './accordion'
10
10
  import tab from './tab'
11
+ import email from './email'
11
12
  import block_quote from './block_quote'
12
13
 
13
14
  export default {
@@ -21,5 +22,6 @@ export default {
21
22
  open_response,
22
23
  open_response_collate,
23
24
  scenario_choice: scenarioChoice,
25
+ email,
24
26
  block_quote,
25
27
  }
@@ -14,11 +14,11 @@ export default {
14
14
  clickable_icons: 'Clickable Icons',
15
15
  scenario_choice: 'Scenario Choice',
16
16
  feedback: 'Feedback',
17
+ email: 'Email',
17
18
  block_quote: 'Block Quote',
18
19
  },
19
20
  grouping: {
20
21
  basic: 'Basic Components',
21
22
  multimedia: 'Multimedia Files',
22
- placeholder: 'Enter text here',
23
23
  },
24
24
  }
@@ -14,8 +14,11 @@ export default {
14
14
  table: 'Table Settings',
15
15
  math: 'Math Settings',
16
16
  feedback: 'Feedback Settings',
17
+ email: 'Ajustes del correo electrónico',
18
+ click_to_enter: 'Click here to enter text',
17
19
  block_quote: 'Block Quote Settings',
18
20
  title: 'Title',
19
21
  instructions: 'Instructions',
22
+ placeholder: 'Enter text here',
20
23
  },
21
24
  }
@@ -0,0 +1,12 @@
1
+ export default {
2
+ title: 'Bloqueo de correo electrónico',
3
+ from: 'De',
4
+ to: 'Para',
5
+ cc: 'CC',
6
+ body: 'Cuerpo del correo electrónico',
7
+ simulation: 'Simulación de correo electrónico',
8
+ reply: 'Responder',
9
+ reply_all: 'Responder a todos',
10
+ forward: 'Adelante',
11
+ reset: 'reiniciar',
12
+ }
@@ -7,6 +7,7 @@ import open_response from './open_response'
7
7
  import open_response_collate from './open_response_collate'
8
8
  import scenarioChoice from './scenario_choice'
9
9
  import block_quote from './block_quote'
10
+ import email from './email'
10
11
 
11
12
  export default {
12
13
  user_upload,
@@ -17,5 +18,6 @@ export default {
17
18
  open_response,
18
19
  open_response_collate,
19
20
  scenario_choice: scenarioChoice,
20
- block_quote
21
+ block_quote,
22
+ email,
21
23
  }
@@ -0,0 +1,9 @@
1
+ export default {
2
+ items: 'Elementos de correo electrónico',
3
+ add: 'Agregar correo electrónico',
4
+ subject: 'Asunto',
5
+ from: 'De',
6
+ to: 'Para',
7
+ cc: 'CC',
8
+ body: 'Cuerpo del correo electrónico',
9
+ }
@@ -9,6 +9,7 @@ import scenarioChoice from './scenario_choice'
9
9
  import accordion from './accordion'
10
10
  import tab from './tab'
11
11
  import block_quote from './block_quote'
12
+ import email from './email'
12
13
 
13
14
  export default {
14
15
  accordion,
@@ -21,5 +22,6 @@ export default {
21
22
  open_response,
22
23
  open_response_collate,
23
24
  scenario_choice: scenarioChoice,
24
- block_quote
25
+ block_quote,
26
+ email,
25
27
  }
@@ -14,11 +14,11 @@ export default {
14
14
  clickable_icons: 'Iconos en los que se puede hacer clic',
15
15
  scenario_choice: 'Elección de escenario',
16
16
  feedback: 'Comentarios',
17
+ email: 'Correo Electrónico',
17
18
  block_quote: 'Cotización en bloque',
18
19
  },
19
20
  grouping: {
20
21
  basic: 'Componentes básicos',
21
22
  multimedia: 'Archivos multimedia',
22
- placeholder: 'Ingrese texto aquí',
23
23
  },
24
24
  }
@@ -16,8 +16,11 @@ export default {
16
16
  table: 'Configuración de la tabla',
17
17
  math: 'Configuración matemática',
18
18
  feedback: 'Configuración de comentarios',
19
+ email: 'Ajustes del correo electrónico',
20
+ click_to_enter: 'Haga clic para ingresar texto',
19
21
  block_quote: 'Configuración de cotización en bloque',
20
22
  title: 'Título',
21
23
  instructions: 'Instrucciones',
24
+ placeholder: 'Ingrese texto aquí',
22
25
  },
23
26
  }
@@ -0,0 +1,12 @@
1
+ export default {
2
+ title: 'E-postblockering',
3
+ from: 'Från',
4
+ to: 'Till',
5
+ cc: 'CC',
6
+ body: 'E-posttext',
7
+ simulation: 'E-postsimulering',
8
+ reply: 'Svar',
9
+ reply_all: 'Svara alla',
10
+ forward: 'Fram',
11
+ reset: 'Återställa',
12
+ }
@@ -7,6 +7,7 @@ import open_response from './open_response'
7
7
  import open_response_collate from './open_response_collate'
8
8
  import scenarioChoice from './scenario_choice'
9
9
  import block_quote from './block_quote'
10
+ import email from './email'
10
11
 
11
12
  export default {
12
13
  user_upload,
@@ -17,5 +18,6 @@ export default {
17
18
  open_response,
18
19
  open_response_collate,
19
20
  scenario_choice: scenarioChoice,
20
- block_quote
21
+ block_quote,
22
+ email,
21
23
  }
@@ -0,0 +1,9 @@
1
+ export default {
2
+ items: 'E-postobjekt',
3
+ add: 'Lägg till e-post',
4
+ subject: 'Ämne',
5
+ from: 'Från',
6
+ to: 'Till',
7
+ cc: 'CC',
8
+ body: 'E-posttext',
9
+ }
@@ -9,6 +9,7 @@ import scenarioChoice from './scenario_choice'
9
9
  import accordion from './accordion'
10
10
  import tab from './tab'
11
11
  import block_quote from './block_quote'
12
+ import email from './email'
12
13
 
13
14
  export default {
14
15
  accordion,
@@ -21,5 +22,6 @@ export default {
21
22
  open_response,
22
23
  open_response_collate,
23
24
  scenario_choice: scenarioChoice,
24
- block_quote
25
+ block_quote,
26
+ email,
25
27
  }
@@ -14,11 +14,11 @@ export default {
14
14
  clickable_icons: 'Klickbara ikoner',
15
15
  scenario_choice: 'Scenarioval',
16
16
  feedback: 'Feedback',
17
+ email: 'E-Post',
17
18
  block_quote: 'Block citat',
18
19
  },
19
20
  grouping: {
20
21
  basic: 'Basic Components',
21
22
  multimedia: 'Multimedia Files',
22
- placeholder: 'Skriv in text här',
23
23
  },
24
24
  }
@@ -14,8 +14,11 @@ export default {
14
14
  table: 'Tabellinställningar',
15
15
  math: 'Matematiska inställningar',
16
16
  feedback: 'Feedback-inställningar',
17
+ email: 'E-postinställningar',
18
+ click_to_enter: 'Klicka för att skriva in text',
17
19
  block_quote: 'Blockera offertinställningar',
18
20
  title: 'Titel',
19
21
  instructions: 'Instruktioner',
22
+ placeholder: 'Skriv in text här',
20
23
  },
21
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windward/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Windward UI Core Plugins",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
package/plugin.js CHANGED
@@ -9,6 +9,7 @@ import Accordion from './components/Content/Blocks/Accordion'
9
9
  import Feedback from './components/Content/Blocks/Feedback.vue'
10
10
  import ClickableIcons from './components/Content/Blocks/ClickableIcons'
11
11
  import ScenarioChoice from './components/Content/Blocks/ScenarioChoice'
12
+ import Email from './components/Content/Blocks/Email'
12
13
  import BlockQuote from './components/Content/Blocks/BlockQuote.vue'
13
14
 
14
15
  import UserUploadNav from './components/Navigation/Items/UserUploadNav.vue'
@@ -34,6 +35,7 @@ import VideoSettings from './components/Settings/VideoSettings.vue'
34
35
  import AccordionSettings from './components/Settings/AccordionSettings.vue'
35
36
  import TabSettings from './components/Settings/TabSettings.vue'
36
37
  import FeedbackSettings from './components/Settings/FeedbackSettings.vue'
38
+ import EmailSettings from './components/Settings/EmailSettings.vue'
37
39
  import BlockQuoteSettigns from './components/Settings/BlockQuoteSettings.vue'
38
40
 
39
41
  import UserUploadPage from './pages/userUpload.vue'
@@ -253,6 +255,16 @@ export default {
253
255
  'windward.core.shared.content_blocks.grouping.basic',
254
256
  },
255
257
  },
258
+ {
259
+ tag: 'core-email',
260
+ template: Email,
261
+ metadata: {
262
+ icon: 'mdi-email',
263
+ name: 'windward.core.shared.content_blocks.title.email',
264
+ grouping:
265
+ 'windward.core.shared.content_blocks.grouping.basic',
266
+ },
267
+ },
256
268
  {
257
269
  tag: 'core-block-quote',
258
270
  template: BlockQuote,
@@ -382,6 +394,15 @@ export default {
382
394
  name: 'windward.core.shared.settings.title.feedback',
383
395
  },
384
396
  },
397
+ {
398
+ tag: 'core-email-settings',
399
+ template: EmailSettings,
400
+ context: ['block.core-email'],
401
+ metadata: {
402
+ icon: 'mdi-notebook-outline',
403
+ name: 'windward.core.shared.settings.title.email',
404
+ },
405
+ },
385
406
  {
386
407
  tag: 'core-block-quote-settings',
387
408
  template: BlockQuoteSettigns,
@@ -9,6 +9,8 @@ Vue.use(Vuetify)
9
9
  describe('Accordion', () => {
10
10
  test('is a Vue instance', () => {
11
11
  const wrapper = shallowMount(Accordion, {
12
+ vuetify: new Vuetify(),
13
+ mocks: defaultMocks,
12
14
  propsData: {
13
15
  value: {
14
16
  body: 'accordion',
@@ -9,6 +9,8 @@ Vue.use(Vuetify)
9
9
  describe('BlockQuote', () => {
10
10
  test('is a Vue instance', () => {
11
11
  const wrapper = shallowMount(BlockQuote, {
12
+ vuetify: new Vuetify(),
13
+ mocks: defaultMocks,
12
14
  propsData: {
13
15
  value: {
14
16
  body: 'block quote',
@@ -0,0 +1,23 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import Vuetify from 'vuetify'
3
+ import Vue from 'vue'
4
+ import { defaultMocks } from '@/test/mocks'
5
+ import Email from '@/components/Content/Blocks/Email'
6
+
7
+ Vue.use(Vuetify)
8
+
9
+ describe('Email', () => {
10
+ test('is a Vue instance', () => {
11
+ const wrapper = shallowMount(Email, {
12
+ vuetify: new Vuetify(),
13
+ mocks: defaultMocks,
14
+ propsData: {
15
+ value: {
16
+ body: 'email',
17
+ metadata: { config: {} },
18
+ },
19
+ },
20
+ })
21
+ expect(wrapper.vm).toBeTruthy()
22
+ })
23
+ })
@@ -10,6 +10,7 @@ describe('Feedback', () => {
10
10
  test('is a Vue instance', () => {
11
11
  const wrapper = shallowMount(Feedback, {
12
12
  vuetify: new Vuetify(),
13
+ mocks: defaultMocks,
13
14
  propsData: {
14
15
  value: {
15
16
  body: 'feedback',
@@ -19,6 +19,7 @@ describe('ContentMathEditor component', () => {
19
19
  test('is a Vue instance', () => {
20
20
  const wrapper = shallowMount(CoreMath, {
21
21
  vuetify: new Vuetify(),
22
+ mocks: defaultMocks,
22
23
  propsData: {
23
24
  value: {
24
25
  id: '00000000-0000-0000-0000-000000000000',
@@ -10,6 +10,7 @@ Vue.use(Vuetify)
10
10
  describe('Tab', () => {
11
11
  test('is a Vue instance', () => {
12
12
  const wrapper = shallowMount(Tab, {
13
+ vuetify: new Vuetify(),
13
14
  propsData: {
14
15
  value: { body: 'tab', metadata: { config: {} } },
15
16
  },
@@ -0,0 +1,45 @@
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import Vuetify from 'vuetify'
3
+ import Vue from 'vue'
4
+
5
+ import { defaultMocks } from '@/test/mocks'
6
+ import EmailSettings from '@/components/Settings/EmailSettings'
7
+
8
+ Vue.use(Vuetify)
9
+
10
+ describe('EmailSettings', () => {
11
+ test('is a Vue instance', () => {
12
+ const wrapper = shallowMount(EmailSettings, {
13
+ propsData: {
14
+ tag: 'core-email-settings',
15
+ },
16
+ mocks: defaultMocks,
17
+ })
18
+ expect(wrapper.vm).toBeTruthy()
19
+ })
20
+
21
+ test('can add an email', () => {
22
+ const wrapper = shallowMount(EmailSettings, {
23
+ propsData: {
24
+ tag: 'core-email-settings',
25
+ },
26
+ mocks: defaultMocks,
27
+ })
28
+ wrapper.vm.onAddElement()
29
+ expect(wrapper.vm.$data.block.metadata.config.emails).toEqual([
30
+ { from: '', to: '', cc: '', body: '', expand: false },
31
+ { from: '', to: '', cc: '', body: '', expand: false },
32
+ ])
33
+ })
34
+
35
+ test('can remove an email', () => {
36
+ const wrapper = shallowMount(EmailSettings, {
37
+ propsData: {
38
+ tag: 'core-email-settings',
39
+ },
40
+ mocks: defaultMocks,
41
+ })
42
+ wrapper.vm.onRemoveElement(0)
43
+ expect(wrapper.vm.$data.block.metadata.config.emails).toEqual([])
44
+ })
45
+ })
@@ -77,6 +77,9 @@ jest.mock(
77
77
  props: {},
78
78
  computed: {},
79
79
  methods: {},
80
+ data() {
81
+ return { validation: {} }
82
+ },
80
83
  }
81
84
  },
82
85
  { virtual: true }
@@ -89,6 +92,9 @@ jest.mock(
89
92
  props: {},
90
93
  computed: {},
91
94
  methods: {},
95
+ data() {
96
+ return { validation: {} }
97
+ },
92
98
  }
93
99
  },
94
100
  { virtual: true }