@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.
Files changed (129) hide show
  1. package/.idea/codeStyles/Project.xml +58 -0
  2. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  3. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/php-docker-settings.xml +24 -0
  6. package/.idea/php.xml +19 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/.idea/watcherTasks.xml +4 -0
  9. package/.idea/windward-ui-plugin-core.iml +8 -0
  10. package/components/Content/Blocks/Email.vue +62 -12
  11. package/components/Content/Blocks/HorizontalRule.vue +52 -0
  12. package/components/Content/Blocks/UserUpload.vue +48 -12
  13. package/components/Settings/HorizontalRuleSettings.vue +42 -0
  14. package/components/utils/assets/tinymce/css/content.scss +2 -2
  15. package/coverage/clover.xml +223 -0
  16. package/coverage/coverage-final.json +16 -0
  17. package/coverage/lcov-report/base.css +224 -0
  18. package/coverage/lcov-report/block-navigation.js +87 -0
  19. package/coverage/lcov-report/components/Content/Blocks/Accordion.vue.html +430 -0
  20. package/coverage/lcov-report/components/Content/Blocks/Image.vue.html +394 -0
  21. package/coverage/lcov-report/components/Content/Blocks/Math.vue.html +262 -0
  22. package/coverage/lcov-report/components/Content/Blocks/RichText.vue.html +295 -0
  23. package/coverage/lcov-report/components/Content/Blocks/Tab.vue.html +415 -0
  24. package/coverage/lcov-report/components/Content/Blocks/Table.vue.html +667 -0
  25. package/coverage/lcov-report/components/Content/Blocks/Video.vue.html +2275 -0
  26. package/coverage/lcov-report/components/Content/Blocks/index.html +206 -0
  27. package/coverage/lcov-report/components/utils/ContentViewer.vue.html +199 -0
  28. package/coverage/lcov-report/components/utils/MathExpressionEditor.vue.html +919 -0
  29. package/coverage/lcov-report/components/utils/MathLiveWrapper.vue.html +343 -0
  30. package/coverage/lcov-report/components/utils/TinyMCEWrapper.vue.html +271 -0
  31. package/coverage/lcov-report/components/utils/index.html +161 -0
  32. package/coverage/lcov-report/config/index.html +116 -0
  33. package/coverage/lcov-report/config/tinymce.config.js.html +493 -0
  34. package/coverage/lcov-report/favicon.png +0 -0
  35. package/coverage/lcov-report/helpers/MathHelper.ts.html +793 -0
  36. package/coverage/lcov-report/helpers/index.html +116 -0
  37. package/coverage/lcov-report/helpers/tinymce/index.html +116 -0
  38. package/coverage/lcov-report/helpers/tinymce/plugin.ts.html +334 -0
  39. package/coverage/lcov-report/index.html +191 -0
  40. package/coverage/lcov-report/prettify.css +1 -0
  41. package/coverage/lcov-report/prettify.js +2 -0
  42. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  43. package/coverage/lcov-report/sorter.js +196 -0
  44. package/coverage/lcov-report/test/index.html +116 -0
  45. package/coverage/lcov-report/test/mocks.js.html +457 -0
  46. package/coverage/lcov.info +403 -0
  47. package/i18n/en-US/components/content/blocks/feedback.ts +2 -2
  48. package/i18n/en-US/components/settings/horizontal_rule.ts +3 -0
  49. package/i18n/en-US/components/settings/index.ts +2 -0
  50. package/i18n/en-US/shared/content_blocks.ts +1 -0
  51. package/i18n/en-US/shared/settings.ts +1 -0
  52. package/i18n/es-ES/components/settings/horizontal_rule.ts +3 -0
  53. package/i18n/es-ES/components/settings/index.ts +2 -0
  54. package/i18n/es-ES/shared/content_blocks.ts +1 -0
  55. package/i18n/es-ES/shared/settings.ts +1 -0
  56. package/i18n/sv-SE/components/settings/horizontal_rule.ts +3 -0
  57. package/i18n/sv-SE/components/settings/index.ts +2 -0
  58. package/i18n/sv-SE/shared/content_blocks.ts +1 -0
  59. package/i18n/sv-SE/shared/settings.ts +1 -0
  60. package/lib/helpers/GlossaryHelper.d.ts +9 -0
  61. package/lib/helpers/GlossaryHelper.js +118 -0
  62. package/lib/helpers/GlossaryTerm.d.ts +10 -0
  63. package/lib/helpers/GlossaryTerm.js +22 -0
  64. package/lib/helpers/MathHelper.d.ts +99 -0
  65. package/lib/helpers/MathHelper.js +194 -0
  66. package/lib/helpers/tinymce/plugin.d.ts +2 -0
  67. package/lib/helpers/tinymce/plugin.js +86 -0
  68. package/lib/i18n/en-US/components/content/blocks/image.d.ts +6 -0
  69. package/lib/i18n/en-US/components/content/blocks/image.js +7 -0
  70. package/lib/i18n/en-US/components/content/blocks/index.d.ts +75 -0
  71. package/lib/i18n/en-US/components/content/blocks/index.js +14 -0
  72. package/lib/i18n/en-US/components/content/blocks/tab.d.ts +5 -0
  73. package/lib/i18n/en-US/components/content/blocks/tab.js +6 -0
  74. package/lib/i18n/en-US/components/content/blocks/table.d.ts +5 -0
  75. package/lib/i18n/en-US/components/content/blocks/table.js +6 -0
  76. package/lib/i18n/en-US/components/content/blocks/user_upload.d.ts +13 -0
  77. package/lib/i18n/en-US/components/content/blocks/user_upload.js +14 -0
  78. package/lib/i18n/en-US/components/content/blocks/video.d.ts +48 -0
  79. package/lib/i18n/en-US/components/content/blocks/video.js +49 -0
  80. package/lib/i18n/en-US/components/content/index.d.ts +77 -0
  81. package/lib/i18n/en-US/components/content/index.js +6 -0
  82. package/lib/i18n/en-US/components/index.d.ts +140 -0
  83. package/lib/i18n/en-US/components/index.js +12 -0
  84. package/lib/i18n/en-US/components/navigation/image.d.ts +5 -0
  85. package/lib/i18n/en-US/components/navigation/image.js +6 -0
  86. package/lib/i18n/en-US/components/navigation/index.d.ts +10 -0
  87. package/lib/i18n/en-US/components/navigation/index.js +8 -0
  88. package/lib/i18n/en-US/components/navigation/user_upload.d.ts +4 -0
  89. package/lib/i18n/en-US/components/navigation/user_upload.js +5 -0
  90. package/lib/i18n/en-US/components/settings/clickable_icon.d.ts +6 -0
  91. package/lib/i18n/en-US/components/settings/clickable_icon.js +7 -0
  92. package/lib/i18n/en-US/components/settings/image.d.ts +2 -0
  93. package/lib/i18n/en-US/components/settings/image.js +3 -0
  94. package/lib/i18n/en-US/components/settings/index.d.ts +39 -0
  95. package/lib/i18n/en-US/components/settings/index.js +14 -0
  96. package/lib/i18n/en-US/components/settings/text_editor.d.ts +8 -0
  97. package/lib/i18n/en-US/components/settings/text_editor.js +9 -0
  98. package/lib/i18n/en-US/components/settings/user_upload.d.ts +12 -0
  99. package/lib/i18n/en-US/components/settings/user_upload.js +13 -0
  100. package/lib/i18n/en-US/components/settings/video.d.ts +13 -0
  101. package/lib/i18n/en-US/components/settings/video.js +14 -0
  102. package/lib/i18n/en-US/components/utils/index.d.ts +15 -0
  103. package/lib/i18n/en-US/components/utils/index.js +6 -0
  104. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.d.ts +13 -0
  105. package/lib/i18n/en-US/components/utils/tiny_mce_wrapper.js +14 -0
  106. package/lib/i18n/en-US/index.d.ts +197 -0
  107. package/lib/i18n/en-US/index.js +16 -0
  108. package/lib/i18n/en-US/modules/index.d.ts +2 -0
  109. package/lib/i18n/en-US/modules/index.js +6 -0
  110. package/lib/i18n/en-US/pages/glossary.d.ts +8 -0
  111. package/lib/i18n/en-US/pages/glossary.js +9 -0
  112. package/lib/i18n/en-US/pages/index.d.ts +13 -0
  113. package/lib/i18n/en-US/pages/index.js +8 -0
  114. package/lib/i18n/en-US/pages/user_upload.d.ts +4 -0
  115. package/lib/i18n/en-US/pages/user_upload.js +5 -0
  116. package/lib/i18n/en-US/shared/content_blocks.d.ts +20 -0
  117. package/lib/i18n/en-US/shared/content_blocks.js +21 -0
  118. package/lib/i18n/en-US/shared/index.d.ts +39 -0
  119. package/lib/i18n/en-US/shared/index.js +10 -0
  120. package/lib/i18n/en-US/shared/menu.d.ts +4 -0
  121. package/lib/i18n/en-US/shared/menu.js +5 -0
  122. package/lib/i18n/en-US/shared/settings.d.ts +15 -0
  123. package/lib/i18n/en-US/shared/settings.js +16 -0
  124. package/lib/i18n/en-US.d.ts +197 -0
  125. package/lib/i18n/en-US.js +15 -0
  126. package/lib/models/UserFileAsset.d.ts +5 -0
  127. package/lib/models/UserFileAsset.js +37 -0
  128. package/package.json +1 -1
  129. 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,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ </profile>
6
+ </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,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectTasksOptions" suppressed-tasks="SCSS" />
4
+ </project>
@@ -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 class="pa-0 d-flex align-center">
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 container-details">
102
+ <v-container class="pa-0">
77
103
  <v-row>
78
- <v-col cols="1"></v-col>
79
104
  <v-col
80
- class="pa-0 div-details"
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 pl-4">
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 pl-4">
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
- if (!Uuid.test(this.userFileAsset.id)) {
206
- this.userFileAsset = new UserFileAsset({
207
- file: uploadFiles,
208
- }).for(
209
- new Enrollment(this.enrollment),
210
- new ContentBlock({ id: this.block.id })
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
- this.userFileAsset.file = uploadFiles
248
+ // Add our files to upload
249
+ userFileAssetRequest.file = uploadFiles
215
250
 
216
251
  try {
217
- this.userFileAsset = await this.userFileAsset.save()
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>
@@ -1,11 +1,11 @@
1
1
 
2
2
  table {
3
3
  max-width: 100%;
4
- border: 1px solid black;
4
+ border: 1px solid var(--v-primary-base) !important;
5
5
  border-spacing: 0;
6
6
 
7
7
  th, td {
8
- border: 1px solid black;
8
+ border: 1px solid var(--v-primary-base) !important;
9
9
  padding: 3px;
10
10
  }
11
11