diff --git a/src/courseware/course/sequence/Unit/__snapshots__/index.test.jsx.snap b/src/courseware/course/sequence/Unit/__snapshots__/index.test.jsx.snap index 2249c87122..63b0fb5a11 100644 --- a/src/courseware/course/sequence/Unit/__snapshots__/index.test.jsx.snap +++ b/src/courseware/course/sequence/Unit/__snapshots__/index.test.jsx.snap @@ -31,6 +31,7 @@ exports[`Unit component output snapshot: not bookmarked, do not show content 1`]

{unit.title}

- +

{formatMessage(messages.headerPlaceholder)}

` elements. +The following `env.config.jsx` will render the `course_id`, `unit_id` and `unitTitle` of the course as `

` elements. ![Screenshot of Content added after the Unit Title](./images/post_unit_title.png) @@ -28,10 +29,11 @@ const config = { widget: { id: 'custom_unit_title_content', type: DIRECT_PLUGIN, - RenderWidget: ({courseId, unitId}) => ( + RenderWidget: ({courseId, unitId, unitTitle}) => ( <>

📚: {courseId}

📙: {unitId}

+

📙: {unitTitle}

), }, diff --git a/src/plugin-slots/UnitTitleSlot/index.jsx b/src/plugin-slots/UnitTitleSlot/index.jsx index 40f449cf97..23d501a079 100644 --- a/src/plugin-slots/UnitTitleSlot/index.jsx +++ b/src/plugin-slots/UnitTitleSlot/index.jsx @@ -1,12 +1,13 @@ import PropTypes from 'prop-types'; import { PluginSlot } from '@openedx/frontend-plugin-framework'; -const UnitTitleSlot = ({ courseId, unitId }) => ( +const UnitTitleSlot = ({ courseId, unitId, unitTitle }) => ( ); @@ -14,6 +15,7 @@ const UnitTitleSlot = ({ courseId, unitId }) => ( UnitTitleSlot.propTypes = { courseId: PropTypes.string.isRequired, unitId: PropTypes.string.isRequired, + unitTitle: PropTypes.string.isRequired, }; export default UnitTitleSlot;