@explorer-1/vue 0.2.44 → 0.2.45
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/package.json
CHANGED
|
@@ -130,13 +130,16 @@ const sectionOrder = [
|
|
|
130
130
|
const staticSectionHeadings = computed((): { [key: string]: BlockHeadingObject } | undefined => {
|
|
131
131
|
if (data) {
|
|
132
132
|
const result = sectionOrder.reduce<Record<string, BlockHeadingObject>>((acc, section) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
133
|
+
// only include the heading if the section has content
|
|
134
|
+
if (data[section]?.length) {
|
|
135
|
+
const headingText =
|
|
136
|
+
section === 'techAddons'
|
|
137
|
+
? 'Tech Add-ons'
|
|
138
|
+
: section.charAt(0).toUpperCase() + section.slice(1)
|
|
139
|
+
acc[section] = stringAsHeadingBlockData(
|
|
140
|
+
(data[`${section}Heading`] as HeadingLevel) || headingText
|
|
141
|
+
)
|
|
142
|
+
}
|
|
140
143
|
return acc
|
|
141
144
|
}, {})
|
|
142
145
|
return result
|
|
@@ -243,7 +246,7 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => {
|
|
|
243
246
|
sections.push({ type: 'streamfield', blocks: keyedCustomSections.value['bottom'] })
|
|
244
247
|
}
|
|
245
248
|
const filteredSections = sections.filter(
|
|
246
|
-
(item) => item.text
|
|
249
|
+
(item) => item.text || item.blocks?.length || item.procedures?.length
|
|
247
250
|
)
|
|
248
251
|
|
|
249
252
|
return filteredSections
|
|
@@ -335,20 +338,18 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => {
|
|
|
335
338
|
v-for="(value, _key) in consolidatedSections"
|
|
336
339
|
:key="_key"
|
|
337
340
|
>
|
|
338
|
-
<
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
/>
|
|
351
|
-
</template>
|
|
341
|
+
<BlockStreamfield
|
|
342
|
+
v-if="value.type === 'streamfield'"
|
|
343
|
+
:data="value.blocks"
|
|
344
|
+
/>
|
|
345
|
+
<PageEduLessonSection
|
|
346
|
+
v-else
|
|
347
|
+
:heading="value.heading"
|
|
348
|
+
:blocks="value.blocks"
|
|
349
|
+
:procedures="value.procedures"
|
|
350
|
+
:text="value.text"
|
|
351
|
+
:image="value.image"
|
|
352
|
+
/>
|
|
352
353
|
</template>
|
|
353
354
|
|
|
354
355
|
<!-- streamfield blocks -->
|