Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA fixes for EDU Lesson Page #580

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vue/src/components/BlockHeading/BlockHeading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default defineComponent({
&:target {
@apply scroll-mt-14;
@screen lg {
@apply scroll-mt-20;
@apply scroll-mt-[8rem];
}
}
}
Expand Down
29 changes: 15 additions & 14 deletions packages/vue/src/templates/edu/PageEduLesson/PageEduLesson.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => {
: undefined,
blocks: section !== 'materials' && section !== 'procedures' ? data[section] : undefined,
text: section === 'materials' ? data[section] : undefined,
procedures: section === 'procedures' ? data[section] : undefined,
procedureSteps: section === 'procedures' ? data.proceduresStepsNumbering : false
procedures: section === 'procedures' ? data[section] : undefined
})
}
// include custom "after_" sections
Expand Down Expand Up @@ -333,18 +332,20 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => {
v-for="(value, _key) in consolidatedSections"
:key="_key"
>
<BlockStreamfield
v-if="value.type === 'streamfield'"
:data="value.blocks"
/>
<PageEduLessonSection
v-else
:heading="value.heading"
:blocks="value.blocks"
:procedures="value.procedures"
:text="value.text"
:image="value.image"
/>
<template v-if="value.blocks?.length || value.procedures?.length">
<BlockStreamfield
v-if="value.type === 'streamfield'"
:data="value.blocks"
/>
<PageEduLessonSection
v-else
:heading="value.heading"
:blocks="value.blocks"
:procedures="value.procedures"
:text="value.text"
:image="value.image"
/>
</template>
</template>

<!-- streamfield blocks -->
Expand Down
26 changes: 14 additions & 12 deletions packages/vue/src/utils/mixins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,21 @@ export const mixinHighlightPrimary = (value: boolean) => {
Useful for dropdown toggles.
*/
export const mixinIsActivePath = (itemPath: string): Boolean => {
const route = useRoute()
const currentPath = route ? route.path : false
const path = itemPath.startsWith('http') ? itemPath.replace(/^.*\/\/[^/]+/, '') : itemPath
const ancestorPath = path ? (path.endsWith('/') ? path : path + '/') : false
if (itemPath) {
const route = useRoute()
const currentPath = route ? route.path : false
const path = itemPath.startsWith('http') ? itemPath.replace(/^.*\/\/[^/]+/, '') : itemPath
const ancestorPath = path ? (path.endsWith('/') ? path : path + '/') : false

if (currentPath && path && ancestorPath) {
if (currentPath === path) {
return true
} else if (currentPath.startsWith('/edu/events')) {
// special treatment since EDU combines News & Events in the main nav
return path.startsWith('/edu/news')
} else {
return currentPath.startsWith(ancestorPath)
if (currentPath && path && ancestorPath) {
if (currentPath === path) {
return true
} else if (currentPath.startsWith('/edu/events')) {
// special treatment since EDU combines News & Events in the main nav
return path.startsWith('/edu/news')
} else {
return currentPath.startsWith(ancestorPath)
}
}
}
return false
Expand Down
Loading