diff --git a/eq-author/src/App/introduction/Design/IntroductionEditor/__snapshots__/index.test.js.snap b/eq-author/src/App/introduction/Design/IntroductionEditor/__snapshots__/index.test.js.snap index 55e02ee5fd..2a54fe0262 100644 --- a/eq-author/src/App/introduction/Design/IntroductionEditor/__snapshots__/index.test.js.snap +++ b/eq-author/src/App/introduction/Design/IntroductionEditor/__snapshots__/index.test.js.snap @@ -37,6 +37,7 @@ exports[`IntroductionEditor should render 1`] = ` multiline={true} name="title" onUpdate={[Function]} + pageType="Introduction" placeholder="" size="large" testSelector="txt-intro-title" @@ -190,6 +191,7 @@ exports[`IntroductionEditor should render 1`] = ` multiline={true} name="description" onUpdate={[Function]} + pageType="Introduction" placeholder="" testSelector="txt-intro-description" value="description" @@ -290,6 +292,7 @@ exports[`IntroductionEditor should render 1`] = ` multiline={false} name="secondaryTitle" onUpdate={[Function]} + pageType="Introduction" placeholder="" size="large" testSelector="txt-intro-secondary-title" @@ -313,6 +316,7 @@ exports[`IntroductionEditor should render 1`] = ` multiline={true} name="secondaryDescription" onUpdate={[Function]} + pageType="Introduction" placeholder="" testSelector="txt-intro-secondary-description" value="secondary description" @@ -355,6 +359,7 @@ exports[`IntroductionEditor should render 1`] = ` multiline={false} name="tertiaryTitle" onUpdate={[Function]} + pageType="Introduction" placeholder="" size="large" testSelector="txt-intro-tertiary-title" @@ -378,6 +383,7 @@ exports[`IntroductionEditor should render 1`] = ` multiline={true} name="tertiaryDescription" onUpdate={[Function]} + pageType="Introduction" placeholder="" testSelector="txt-intro-tertiary-description" value="tertiary description" diff --git a/eq-author/src/App/introduction/Design/IntroductionEditor/index.js b/eq-author/src/App/introduction/Design/IntroductionEditor/index.js index 94c626a339..28761ce7a2 100644 --- a/eq-author/src/App/introduction/Design/IntroductionEditor/index.js +++ b/eq-author/src/App/introduction/Design/IntroductionEditor/index.js @@ -147,6 +147,7 @@ const IntroductionEditor = ({ introduction, history }) => { id="intro-title" name="title" label="Title" + pageType="Introduction" multiline value={title} size="large" @@ -305,6 +306,7 @@ const IntroductionEditor = ({ introduction, history }) => { @@ -331,6 +333,7 @@ const IntroductionEditor = ({ introduction, history }) => { id="intro-description" name="description" label="Description" + pageType="Introduction" multiline value={description} controls={descriptionControls} @@ -424,6 +427,7 @@ const IntroductionEditor = ({ introduction, history }) => { id="secondary-title" name="secondaryTitle" label="Title" + pageType="Introduction" value={secondaryTitle} controls={titleControls} size="large" @@ -442,6 +446,7 @@ const IntroductionEditor = ({ introduction, history }) => { id="secondary-description" name="secondaryDescription" label="Description" + pageType="Introduction" multiline value={secondaryDescription} controls={descriptionControls} @@ -472,6 +477,7 @@ const IntroductionEditor = ({ introduction, history }) => { id="tertiary-title" name="tertiaryTitle" label="Title" + pageType="Introduction" value={tertiaryTitle} controls={titleControls} size="large" @@ -490,6 +496,7 @@ const IntroductionEditor = ({ introduction, history }) => { id="tertiary-description" name="tertiaryDescription" label="Description" + pageType="Introduction" multiline value={tertiaryDescription} controls={descriptionControls} diff --git a/eq-author/src/components/RichTextEditor/PipingMenu.js b/eq-author/src/components/RichTextEditor/PipingMenu.js index 21a787ddef..c26b61a90f 100644 --- a/eq-author/src/components/RichTextEditor/PipingMenu.js +++ b/eq-author/src/components/RichTextEditor/PipingMenu.js @@ -117,17 +117,25 @@ const PipingMenu = ({ const listAllAnswers = [...listAnswers, ...listCollectorFollowUpAnswers]; - const supplementaryData = - questionnaire?.supplementaryData?.data - .filter((list) => list.listName === "" || list.id === listId) - .flatMap((list) => { - return list.schemaFields.map((schemaField) => { - return { - listName: list.listName, - ...schemaField, - }; - }); - }) || []; + let allSupplementaryData = questionnaire?.supplementaryData?.data || []; + + if ( + allSupplementaryData && + !(pageType === "Introduction" && questionnaire.sections[0].repeatingSection) + ) { + allSupplementaryData = allSupplementaryData.filter( + (list) => list.listName === "" || list.id === listId + ); + } + + const supplementaryData = allSupplementaryData.flatMap((list) => { + return list.schemaFields.map((schemaField) => { + return { + listName: list.listName, + ...schemaField, + }; + }); + }); const handlePickerContent = (contentType) => { switch (contentType) {