@windward/core 0.1.3 → 0.1.4
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/.idea/codeStyles/Project.xml +58 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/php-docker-settings.xml +24 -0
- package/.idea/php.xml +19 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/watcherTasks.xml +4 -0
- package/.idea/windward-ui-plugin-core.iml +8 -0
- package/components/Content/Blocks/Email.vue +62 -12
- package/components/Content/Blocks/HorizontalRule.vue +52 -0
- package/components/Content/Blocks/UserUpload.vue +48 -12
- package/components/Settings/HorizontalRuleSettings.vue +42 -0
- package/components/utils/assets/tinymce/css/content.scss +2 -2
- package/coverage/clover.xml +223 -0
- package/coverage/coverage-final.json +16 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/components/Content/Blocks/Accordion.vue.html +430 -0
- package/coverage/lcov-report/components/Content/Blocks/Image.vue.html +394 -0
- package/coverage/lcov-report/components/Content/Blocks/Math.vue.html +262 -0
- package/coverage/lcov-report/components/Content/Blocks/RichText.vue.html +295 -0
- package/coverage/lcov-report/components/Content/Blocks/Tab.vue.html +415 -0
- package/coverage/lcov-report/components/Content/Blocks/Table.vue.html +667 -0
- package/coverage/lcov-report/components/Content/Blocks/Video.vue.html +2275 -0
- package/coverage/lcov-report/components/Content/Blocks/index.html +206 -0
- package/coverage/lcov-report/components/utils/ContentViewer.vue.html +199 -0
- package/coverage/lcov-report/components/utils/MathExpressionEditor.vue.html +919 -0
- package/coverage/lcov-report/components/utils/MathLiveWrapper.vue.html +343 -0
- package/coverage/lcov-report/components/utils/TinyMCEWrapper.vue.html +271 -0
- package/coverage/lcov-report/components/utils/index.html +161 -0
- package/coverage/lcov-report/config/index.html +116 -0
- package/coverage/lcov-report/config/tinymce.config.js.html +493 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/helpers/MathHelper.ts.html +793 -0
- package/coverage/lcov-report/helpers/index.html +116 -0
- package/coverage/lcov-report/helpers/tinymce/index.html +116 -0
- package/coverage/lcov-report/helpers/tinymce/plugin.ts.html +334 -0
- package/coverage/lcov-report/index.html +191 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/test/index.html +116 -0
- package/coverage/lcov-report/test/mocks.js.html +457 -0
- package/coverage/lcov.info +403 -0
- package/i18n/en-US/components/content/blocks/feedback.ts +2 -2
- package/i18n/en-US/components/settings/horizontal_rule.ts +3 -0
- package/i18n/en-US/components/settings/index.ts +2 -0
- package/i18n/en-US/shared/content_blocks.ts +1 -0
- package/i18n/en-US/shared/settings.ts +1 -0
- package/i18n/es-ES/components/settings/horizontal_rule.ts +3 -0
- package/i18n/es-ES/components/settings/index.ts +2 -0
- package/i18n/es-ES/shared/content_blocks.ts +1 -0
- package/i18n/es-ES/shared/settings.ts +1 -0
- package/i18n/sv-SE/components/settings/horizontal_rule.ts +3 -0
- package/i18n/sv-SE/components/settings/index.ts +2 -0
- package/i18n/sv-SE/shared/content_blocks.ts +1 -0
- package/i18n/sv-SE/shared/settings.ts +1 -0
- package/lib/helpers/GlossaryHelper.d.ts +9 -0
- package/lib/helpers/GlossaryHelper.js +118 -0
- package/lib/helpers/GlossaryTerm.d.ts +10 -0
- package/lib/helpers/GlossaryTerm.js +22 -0
- package/lib/helpers/MathHelper.d.ts +99 -0
- package/lib/helpers/MathHelper.js +194 -0
- package/lib/helpers/tinymce/plugin.d.ts +2 -0
- package/lib/helpers/tinymce/plugin.js +86 -0
- package/lib/i18n/en-US/components/content/blocks/image.d.ts +6 -0
- package/lib/i18n/en-US/components/content/blocks/image.js +7 -0
- package/lib/i18n/en-US/components/content/blocks/index.d.ts +75 -0
- package/lib/i18n/en-US/components/content/blocks/index.js +14 -0
- package/lib/i18n/en-US/components/content/blocks/tab.d.ts +5 -0
- package/lib/i18n/en-US/components/content/blocks/tab.js +6 -0
- package/lib/i18n/en-US/components/content/blocks/table.d.ts +5 -0
- package/lib/i18n/en-US/components/content/blocks/table.js +6 -0
- package/lib/i18n/en-US/components/content/blocks/user_upload.d.ts +13 -0
- package/lib/i18n/en-US/components/content/blocks/user_upload.js +14 -0
- package/lib/i18n/en-US/components/content/blocks/video.d.ts +48 -0
- package/lib/i18n/en-US/components/content/blocks/video.js +49 -0
- package/lib/i18n/en-US/components/content/index.d.ts +77 -0
- package/lib/i18n/en-US/components/content/index.js +6 -0
- package/lib/i18n/en-US/components/index.d.ts +140 -0
- package/lib/i18n/en-US/components/index.js +12 -0
- package/lib/i18n/en-US/components/navigation/image.d.ts +5 -0
- package/lib/i18n/en-US/components/navigation/image.js +6 -0
- package/lib/i18n/en-US/components/navigation/index.d.ts +10 -0
- package/lib/i18n/en-US/components/navigation/index.js +8 -0
- package/lib/i18n/en-US/components/navigation/user_upload.d.ts +4 -0
- package/lib/i18n/en-US/components/navigation/user_upload.js +5 -0
- package/lib/i18n/en-US/components/settings/clickable_icon.d.ts +6 -0
- package/lib/i18n/en-US/components/settings/clickable_icon.js +7 -0
- package/lib/i18n/en-US/components/settings/image.d.ts +2 -0
- package/lib/i18n/en-US/components/settings/image.js +3 -0
- package/lib/i18n/en-US/components/settings/index.d.ts +39 -0
- package/lib/i18n/en-US/components/settings/index.js +14 -0
- package/lib/i18n/en-US/components/settings/text_editor.d.ts +8 -0
- package/lib/i18n/en-US/components/settings/text_editor.js +9 -0
- package/lib/i18n/en-US/components/settings/user_upload.d.ts +12 -0
- package/lib/i18n/en-US/components/settings/user_upload.js +13 -0
- package/lib/i18n/en-US/components/settings/video.d.ts +13 -0
- package/lib/i18n/en-US/components/settings/video.js +14 -0
- package/lib/i18n/en-US/components/utils/index.d.ts +15 -0
- package/lib/i18n/en-US/components/utils/index.js +6 -0
- package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.d.ts +13 -0
- package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.js +14 -0
- package/lib/i18n/en-US/index.d.ts +197 -0
- package/lib/i18n/en-US/index.js +16 -0
- package/lib/i18n/en-US/modules/index.d.ts +2 -0
- package/lib/i18n/en-US/modules/index.js +6 -0
- package/lib/i18n/en-US/pages/glossary.d.ts +8 -0
- package/lib/i18n/en-US/pages/glossary.js +9 -0
- package/lib/i18n/en-US/pages/index.d.ts +13 -0
- package/lib/i18n/en-US/pages/index.js +8 -0
- package/lib/i18n/en-US/pages/user_upload.d.ts +4 -0
- package/lib/i18n/en-US/pages/user_upload.js +5 -0
- package/lib/i18n/en-US/shared/content_blocks.d.ts +20 -0
- package/lib/i18n/en-US/shared/content_blocks.js +21 -0
- package/lib/i18n/en-US/shared/index.d.ts +39 -0
- package/lib/i18n/en-US/shared/index.js +10 -0
- package/lib/i18n/en-US/shared/menu.d.ts +4 -0
- package/lib/i18n/en-US/shared/menu.js +5 -0
- package/lib/i18n/en-US/shared/settings.d.ts +15 -0
- package/lib/i18n/en-US/shared/settings.js +16 -0
- package/lib/i18n/en-US.d.ts +197 -0
- package/lib/i18n/en-US.js +15 -0
- package/lib/models/UserFileAsset.d.ts +5 -0
- package/lib/models/UserFileAsset.js +37 -0
- package/package.json +1 -1
- package/plugin.js +21 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
+
<code_scheme name="Project" version="173">
|
|
3
|
+
<HTMLCodeStyleSettings>
|
|
4
|
+
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
+
<option name="HTML_ENFORCE_QUOTES" value="true" />
|
|
6
|
+
</HTMLCodeStyleSettings>
|
|
7
|
+
<JSCodeStyleSettings version="0">
|
|
8
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
9
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
10
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
+
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
|
|
12
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
+
</JSCodeStyleSettings>
|
|
15
|
+
<TypeScriptCodeStyleSettings version="0">
|
|
16
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
17
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
18
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
19
|
+
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
|
|
20
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
21
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
22
|
+
</TypeScriptCodeStyleSettings>
|
|
23
|
+
<VueCodeStyleSettings>
|
|
24
|
+
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
25
|
+
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
26
|
+
</VueCodeStyleSettings>
|
|
27
|
+
<codeStyleSettings language="HTML">
|
|
28
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
29
|
+
<indentOptions>
|
|
30
|
+
<option name="INDENT_SIZE" value="2" />
|
|
31
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
32
|
+
<option name="TAB_SIZE" value="2" />
|
|
33
|
+
</indentOptions>
|
|
34
|
+
</codeStyleSettings>
|
|
35
|
+
<codeStyleSettings language="JavaScript">
|
|
36
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
37
|
+
<indentOptions>
|
|
38
|
+
<option name="INDENT_SIZE" value="2" />
|
|
39
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
40
|
+
<option name="TAB_SIZE" value="2" />
|
|
41
|
+
</indentOptions>
|
|
42
|
+
</codeStyleSettings>
|
|
43
|
+
<codeStyleSettings language="TypeScript">
|
|
44
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
45
|
+
<indentOptions>
|
|
46
|
+
<option name="INDENT_SIZE" value="2" />
|
|
47
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
48
|
+
<option name="TAB_SIZE" value="2" />
|
|
49
|
+
</indentOptions>
|
|
50
|
+
</codeStyleSettings>
|
|
51
|
+
<codeStyleSettings language="Vue">
|
|
52
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
53
|
+
<indentOptions>
|
|
54
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
55
|
+
</indentOptions>
|
|
56
|
+
</codeStyleSettings>
|
|
57
|
+
</code_scheme>
|
|
58
|
+
</component>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/windward-ui-plugin-core.iml" filepath="$PROJECT_DIR$/.idea/windward-ui-plugin-core.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="PhpDockerContainerSettings">
|
|
4
|
+
<list>
|
|
5
|
+
<map>
|
|
6
|
+
<entry key="79d59a8f-c56c-4789-b96c-e55a326ab125">
|
|
7
|
+
<value>
|
|
8
|
+
<DockerContainerSettings>
|
|
9
|
+
<option name="version" value="1" />
|
|
10
|
+
<option name="volumeBindings">
|
|
11
|
+
<list>
|
|
12
|
+
<DockerVolumeBindingImpl>
|
|
13
|
+
<option name="containerPath" value="/opt/project" />
|
|
14
|
+
<option name="hostPath" value="$PROJECT_DIR$" />
|
|
15
|
+
</DockerVolumeBindingImpl>
|
|
16
|
+
</list>
|
|
17
|
+
</option>
|
|
18
|
+
</DockerContainerSettings>
|
|
19
|
+
</value>
|
|
20
|
+
</entry>
|
|
21
|
+
</map>
|
|
22
|
+
</list>
|
|
23
|
+
</component>
|
|
24
|
+
</project>
|
package/.idea/php.xml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="MessDetectorOptionsConfiguration">
|
|
4
|
+
<option name="transferred" value="true" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="PHPCSFixerOptionsConfiguration">
|
|
7
|
+
<option name="transferred" value="true" />
|
|
8
|
+
</component>
|
|
9
|
+
<component name="PHPCodeSnifferOptionsConfiguration">
|
|
10
|
+
<option name="highlightLevel" value="WARNING" />
|
|
11
|
+
<option name="transferred" value="true" />
|
|
12
|
+
</component>
|
|
13
|
+
<component name="PhpStanOptionsConfiguration">
|
|
14
|
+
<option name="transferred" value="true" />
|
|
15
|
+
</component>
|
|
16
|
+
<component name="PsalmOptionsConfiguration">
|
|
17
|
+
<option name="transferred" value="true" />
|
|
18
|
+
</component>
|
|
19
|
+
</project>
|
package/.idea/vcs.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$" />
|
|
5
|
+
<orderEntry type="inheritedJdk" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
</component>
|
|
8
|
+
</module>
|
|
@@ -46,8 +46,15 @@
|
|
|
46
46
|
elevation="0"
|
|
47
47
|
>
|
|
48
48
|
<v-expansion-panel-header>
|
|
49
|
-
<v-row>
|
|
50
|
-
<v-col
|
|
49
|
+
<v-row class="container-header">
|
|
50
|
+
<v-col
|
|
51
|
+
xl="1"
|
|
52
|
+
lg="1"
|
|
53
|
+
md="1"
|
|
54
|
+
sm="2"
|
|
55
|
+
xs="2"
|
|
56
|
+
class="pa-0 d-flex align-center"
|
|
57
|
+
>
|
|
51
58
|
<v-btn fab x-small class="primary" elevation="0"
|
|
52
59
|
>{{ item.initials ? item.initials : '' }}
|
|
53
60
|
</v-btn>
|
|
@@ -66,28 +73,54 @@
|
|
|
66
73
|
color="secondary"
|
|
67
74
|
>mdi-circle-medium</v-icon
|
|
68
75
|
>
|
|
76
|
+
</v-col>
|
|
77
|
+
<v-col
|
|
78
|
+
xl="1"
|
|
79
|
+
lg="3"
|
|
80
|
+
md="11"
|
|
81
|
+
sm="10"
|
|
82
|
+
xs="10"
|
|
83
|
+
class="d-flex align-center"
|
|
84
|
+
>
|
|
69
85
|
<span class="span-details"
|
|
70
86
|
>{{ item.from ? item.from : 'From' }}
|
|
71
87
|
</span>
|
|
72
88
|
</v-col>
|
|
89
|
+
<v-col
|
|
90
|
+
v-if="selectedPanels !== index"
|
|
91
|
+
xl="10"
|
|
92
|
+
lg="8"
|
|
93
|
+
class="d-flex align-center container-body-preview"
|
|
94
|
+
>
|
|
95
|
+
<div class="div-preview">
|
|
96
|
+
{{ onRemoveTags(item.body) }}
|
|
97
|
+
</div>
|
|
98
|
+
</v-col>
|
|
73
99
|
</v-row>
|
|
74
100
|
</v-expansion-panel-header>
|
|
75
101
|
<v-expansion-panel-content>
|
|
76
|
-
<v-container class="pa-0
|
|
102
|
+
<v-container class="pa-0">
|
|
77
103
|
<v-row>
|
|
78
|
-
<v-col cols="1"></v-col>
|
|
79
104
|
<v-col
|
|
80
|
-
|
|
105
|
+
cols="1"
|
|
106
|
+
xl="1"
|
|
107
|
+
lg="1"
|
|
108
|
+
md="1"
|
|
109
|
+
sm="2"
|
|
110
|
+
xs="2"
|
|
111
|
+
></v-col>
|
|
112
|
+
<v-col
|
|
113
|
+
class="div-details"
|
|
81
114
|
v-if="item.to || item.cc"
|
|
82
115
|
>
|
|
83
|
-
<div class="div-details-to
|
|
116
|
+
<div class="div-details-to">
|
|
84
117
|
{{
|
|
85
118
|
$t(
|
|
86
119
|
'windward.core.components.content.blocks.email.to'
|
|
87
120
|
)
|
|
88
121
|
}}: {{ item.to }}
|
|
89
122
|
</div>
|
|
90
|
-
<div class="div-details-cc
|
|
123
|
+
<div class="div-details-cc">
|
|
91
124
|
{{
|
|
92
125
|
$t(
|
|
93
126
|
'windward.core.components.content.blocks.email.cc'
|
|
@@ -220,7 +253,11 @@ export default {
|
|
|
220
253
|
mounted() {
|
|
221
254
|
this.selectedPanels = this.block.metadata.config.emails.length - 1
|
|
222
255
|
},
|
|
223
|
-
methods: {
|
|
256
|
+
methods: {
|
|
257
|
+
onRemoveTags(body) {
|
|
258
|
+
return body.replace(/(<([^>]+)>)/gi, '')
|
|
259
|
+
},
|
|
260
|
+
},
|
|
224
261
|
}
|
|
225
262
|
</script>
|
|
226
263
|
<style scoped>
|
|
@@ -230,12 +267,10 @@ export default {
|
|
|
230
267
|
.column-simulation {
|
|
231
268
|
font-size: 12px;
|
|
232
269
|
}
|
|
233
|
-
.container-details {
|
|
234
|
-
font-size: 10px;
|
|
235
|
-
margin-top: -26px;
|
|
236
|
-
}
|
|
237
270
|
.div-details {
|
|
238
271
|
color: grey;
|
|
272
|
+
font-size: 10px;
|
|
273
|
+
margin-top: -25px;
|
|
239
274
|
}
|
|
240
275
|
.div-details-cc {
|
|
241
276
|
margin-top: -9px;
|
|
@@ -247,4 +282,19 @@ export default {
|
|
|
247
282
|
.v-expansion-panel {
|
|
248
283
|
border: 1px solid var(--v-primary-base);
|
|
249
284
|
}
|
|
285
|
+
@media only screen and (max-width: 1264px) {
|
|
286
|
+
.container-body-preview {
|
|
287
|
+
display: none !important;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
.div-preview {
|
|
291
|
+
overflow: hidden;
|
|
292
|
+
text-overflow: ellipsis;
|
|
293
|
+
white-space: nowrap;
|
|
294
|
+
margin-top: auto;
|
|
295
|
+
margin-bottom: auto;
|
|
296
|
+
}
|
|
297
|
+
.container-header {
|
|
298
|
+
width: 100%;
|
|
299
|
+
}
|
|
250
300
|
</style>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<hr :class="isDashed" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
import _ from 'lodash'
|
|
8
|
+
import BaseContentBlock from '~/components/Content/Blocks/BaseContentBlock'
|
|
9
|
+
export default {
|
|
10
|
+
name: 'HorizontalRule',
|
|
11
|
+
extends: BaseContentBlock,
|
|
12
|
+
beforeMount() {
|
|
13
|
+
if (_.isEmpty(this.block)) {
|
|
14
|
+
this.block = {}
|
|
15
|
+
}
|
|
16
|
+
if (_.isEmpty(this.block.metadata)) {
|
|
17
|
+
this.block.metadata = {}
|
|
18
|
+
}
|
|
19
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
20
|
+
this.block.metadata.config = {}
|
|
21
|
+
}
|
|
22
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
23
|
+
this.block.metadata.config = {}
|
|
24
|
+
}
|
|
25
|
+
if (_.isEmpty(this.block.metadata.config.dashed)) {
|
|
26
|
+
this.block.metadata.config.dashed = false
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
isDashed: 'solid',
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
watch: {
|
|
35
|
+
value(newValue) {
|
|
36
|
+
if (newValue.metadata.config.dashed) {
|
|
37
|
+
this.isDashed = 'dashed'
|
|
38
|
+
} else if (newValue.metadata.config.dashed === false) {
|
|
39
|
+
this.isDashed = 'solid'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
<style>
|
|
46
|
+
.solid {
|
|
47
|
+
border-bottom: solid 1px var(--v-primary-base);
|
|
48
|
+
}
|
|
49
|
+
.dashed {
|
|
50
|
+
border-bottom: dashed 1px var(--v-primary-base);
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
:enrollment="enrollment"
|
|
39
39
|
></DisplayUserFilesTable>
|
|
40
40
|
</v-col>
|
|
41
|
-
<v-col cols="12">
|
|
41
|
+
<v-col cols="12" v-if="showUpload">
|
|
42
42
|
<div v-if="blockExists">
|
|
43
43
|
<v-form
|
|
44
44
|
ref="form"
|
|
@@ -149,6 +149,7 @@ export default {
|
|
|
149
149
|
uploadFiles: [],
|
|
150
150
|
userFileAsset: {},
|
|
151
151
|
studentUpload: null,
|
|
152
|
+
maxFileLimit: 10,
|
|
152
153
|
}
|
|
153
154
|
},
|
|
154
155
|
computed: {
|
|
@@ -160,17 +161,27 @@ export default {
|
|
|
160
161
|
},
|
|
161
162
|
canUpload() {
|
|
162
163
|
if (this.valid) {
|
|
164
|
+
const currentFiles = _.get(
|
|
165
|
+
this.userFileAsset,
|
|
166
|
+
'file_assets',
|
|
167
|
+
[]
|
|
168
|
+
)
|
|
169
|
+
|
|
163
170
|
// Multiple disabled, single file selected
|
|
164
171
|
if (
|
|
165
172
|
!Array.isArray(this.uploadFiles) &&
|
|
166
173
|
!this.block.metadata.config.uploadSettings.multiple &&
|
|
167
|
-
this.uploadFiles
|
|
174
|
+
this.uploadFiles &&
|
|
175
|
+
currentFiles.length === 0
|
|
168
176
|
) {
|
|
169
177
|
return true
|
|
170
178
|
} else if (
|
|
171
179
|
// Multi enabled, one or more files selected
|
|
180
|
+
this.block.metadata.config.uploadSettings.multiple &&
|
|
172
181
|
Array.isArray(this.uploadFiles) &&
|
|
173
|
-
this.uploadFiles.length > 0
|
|
182
|
+
this.uploadFiles.length > 0 &&
|
|
183
|
+
this.uploadFiles.length + currentFiles.length <=
|
|
184
|
+
this.maxFileLimit
|
|
174
185
|
) {
|
|
175
186
|
return true
|
|
176
187
|
} else {
|
|
@@ -180,6 +191,26 @@ export default {
|
|
|
180
191
|
}
|
|
181
192
|
return false
|
|
182
193
|
},
|
|
194
|
+
showUpload() {
|
|
195
|
+
const currentFiles = _.get(this.userFileAsset, 'file_assets', [])
|
|
196
|
+
|
|
197
|
+
// Multiple disabled, confirm there's no current files
|
|
198
|
+
if (
|
|
199
|
+
!this.block.metadata.config.uploadSettings.multiple &&
|
|
200
|
+
currentFiles.length === 0
|
|
201
|
+
) {
|
|
202
|
+
return true
|
|
203
|
+
} else if (
|
|
204
|
+
// Multi enabled, make sure we're not over our max limit
|
|
205
|
+
this.block.metadata.config.uploadSettings.multiple &&
|
|
206
|
+
currentFiles.length < this.maxFileLimit
|
|
207
|
+
) {
|
|
208
|
+
return true
|
|
209
|
+
} else {
|
|
210
|
+
// Hide the uploader
|
|
211
|
+
return false
|
|
212
|
+
}
|
|
213
|
+
},
|
|
183
214
|
},
|
|
184
215
|
mounted() {
|
|
185
216
|
if (this.blockExists) {
|
|
@@ -202,19 +233,24 @@ export default {
|
|
|
202
233
|
}
|
|
203
234
|
|
|
204
235
|
// Create a new UserFileAsset if we don't have an instance yet
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
236
|
+
let userFileAssetRequest = new UserFileAsset({
|
|
237
|
+
file: uploadFiles,
|
|
238
|
+
}).for(
|
|
239
|
+
new Enrollment(this.enrollment),
|
|
240
|
+
new ContentBlock({ id: this.block.id })
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
// Apply the existing id if we already have an instance
|
|
244
|
+
if (Uuid.test(this.userFileAsset.id)) {
|
|
245
|
+
userFileAssetRequest.id = this.userFileAsset.id
|
|
212
246
|
}
|
|
213
247
|
|
|
214
|
-
|
|
248
|
+
// Add our files to upload
|
|
249
|
+
userFileAssetRequest.file = uploadFiles
|
|
215
250
|
|
|
216
251
|
try {
|
|
217
|
-
|
|
252
|
+
// Apply the response back to the reactive this.userFileAsset
|
|
253
|
+
this.userFileAsset = await userFileAssetRequest.save()
|
|
218
254
|
} catch (e) {
|
|
219
255
|
this.$toast.error(this.$t('shared.forms.errors.unknown'))
|
|
220
256
|
console.log(e)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<v-switch
|
|
4
|
+
v-model="block.metadata.config.dashed"
|
|
5
|
+
:label="
|
|
6
|
+
$t('windward.core.components.settings.horizontal_rule.dashed')
|
|
7
|
+
"
|
|
8
|
+
></v-switch>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import _ from 'lodash'
|
|
14
|
+
import BaseContentSettings from '~/components/Content/Tool/BaseContentSettings.js'
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'HorizontalRuleSettings',
|
|
18
|
+
extends: BaseContentSettings,
|
|
19
|
+
components: {},
|
|
20
|
+
beforeMount() {
|
|
21
|
+
if (_.isEmpty(this.block)) {
|
|
22
|
+
this.block = {}
|
|
23
|
+
}
|
|
24
|
+
if (_.isEmpty(this.block.metadata)) {
|
|
25
|
+
this.block.metadata = {}
|
|
26
|
+
}
|
|
27
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
28
|
+
this.block.metadata.config = {}
|
|
29
|
+
}
|
|
30
|
+
if (_.isEmpty(this.block.metadata.config)) {
|
|
31
|
+
this.block.metadata.config = {}
|
|
32
|
+
}
|
|
33
|
+
if (!_.isBoolean(this.block.metadata.config.dashed)) {
|
|
34
|
+
this.block.metadata.config.dashed = false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
data() {
|
|
38
|
+
return {}
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
<style></style>
|