From 4d6273ebc5c0f7991723226e86213ed323ffb6dd Mon Sep 17 00:00:00 2001 From: Stephanie Smith Date: Wed, 28 Aug 2024 12:53:31 -0700 Subject: [PATCH] revising data model for EDU Lesson procedures (#579) * revising data model for EDU Lesson procedures * Update packages/vue/src/templates/edu/PageEduLesson/PageEduLesson.stories.js Co-authored-by: Scott Cranfill * cleanup after code review * fixing build errors --------- Co-authored-by: Scott Cranfill --- .../PageEduLesson/PageEduLesson.stories.js | 43 +++++- .../edu/PageEduLesson/PageEduLesson.vue | 1 - .../PageEduLesson/PageEduLessonSection.vue | 126 +++++++++++++----- 3 files changed, 133 insertions(+), 37 deletions(-) diff --git a/packages/vue/src/templates/edu/PageEduLesson/PageEduLesson.stories.js b/packages/vue/src/templates/edu/PageEduLesson/PageEduLesson.stories.js index 18fd27d5..af701e5b 100644 --- a/packages/vue/src/templates/edu/PageEduLesson/PageEduLesson.stories.js +++ b/packages/vue/src/templates/edu/PageEduLesson/PageEduLesson.stories.js @@ -169,17 +169,52 @@ export const BaseStory = { procedures: [ { - blocks: BlockStreamfieldMinimalData.body + sectionHeading: 'Section Heading 1', + stepsNumbering: true, + steps: [ + { + blocks: BlockStreamfieldMinimalData.body + }, + { + blocks: BlockStreamfieldMinimalData.body + }, + { + blocks: BlockStreamfieldMinimalData.body + } + ] }, { - blocks: BlockStreamfieldMinimalData.body + // sectionHeading: 'Section Heading 2', + stepsNumbering: true, + steps: [ + { + blocks: BlockStreamfieldMinimalData.body + }, + { + blocks: BlockStreamfieldMinimalData.body + }, + { + blocks: BlockStreamfieldMinimalData.body + } + ] }, { - blocks: BlockStreamfieldMinimalData.body + sectionHeading: 'Section Heading 3', + stepsNumbering: false, + steps: [ + { + blocks: BlockStreamfieldMinimalData.body + }, + { + blocks: BlockStreamfieldMinimalData.body + }, + { + blocks: BlockStreamfieldMinimalData.body + } + ] } ], proceduresHeading: 'Procedures heading', - proceduresStepsNumbering: true, discussion: BlockStreamfieldMinimalData.body, discussionHeading: 'Discussion heading', diff --git a/packages/vue/src/templates/edu/PageEduLesson/PageEduLesson.vue b/packages/vue/src/templates/edu/PageEduLesson/PageEduLesson.vue index c04eb69a..407a01dc 100644 --- a/packages/vue/src/templates/edu/PageEduLesson/PageEduLesson.vue +++ b/packages/vue/src/templates/edu/PageEduLesson/PageEduLesson.vue @@ -342,7 +342,6 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => { :heading="value.heading" :blocks="value.blocks" :procedures="value.procedures" - :procedure-steps="value.procedureSteps" :text="value.text" :image="value.image" /> diff --git a/packages/vue/src/templates/edu/PageEduLesson/PageEduLessonSection.vue b/packages/vue/src/templates/edu/PageEduLesson/PageEduLessonSection.vue index e707715e..cf704009 100644 --- a/packages/vue/src/templates/edu/PageEduLesson/PageEduLessonSection.vue +++ b/packages/vue/src/templates/edu/PageEduLesson/PageEduLessonSection.vue @@ -15,9 +15,12 @@ export interface PageEduLessonSectionProps { heading: BlockHeadingObject blocks?: StreamfieldBlockData[] procedures?: { - blocks: StreamfieldBlockData[] + sectionHeading: string + stepsNumbering: boolean + steps: { + blocks: StreamfieldBlockData[] + }[] }[] - procedureSteps?: boolean text?: string image?: ImageObject } @@ -26,7 +29,6 @@ const props = withDefaults(defineProps(), { heading: undefined, blocks: undefined, procedures: undefined, - procedureSteps: false, text: undefined, image: undefined }) @@ -68,23 +70,51 @@ const anchorId = computed(() => { /> @@ -98,23 +128,55 @@ const anchorId = computed(() => {