Skip to content

Commit

Permalink
feat: pass unitId as a prop through to Xpert component (#1256)
Browse files Browse the repository at this point in the history
This commit modifies the Course component to pass the unitId prop, which presents the unit usage key in which the Xpert is being rendered, to the Chat component. The Chat component passes this unit ID as a prop to the Xpert component.
  • Loading branch information
MichaelRoytman authored Jan 5, 2024
1 parent 600f5b4 commit 4dc4725
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
"@edx/frontend-component-footer": "12.2.1",
"@edx/frontend-component-header": "4.6.0",
"@edx/frontend-lib-learning-assistant": "^1.18.0",
"@edx/frontend-lib-special-exams": "2.26.0",
"@edx/frontend-lib-learning-assistant": "^1.19.0",
"@edx/frontend-platform": "5.5.2",
"@edx/paragon": "20.46.0",
"@edx/react-unit-test-utils": "npm:@edx/[email protected]",
Expand Down
1 change: 1 addition & 0 deletions src/courseware/course/Course.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const Course = ({
isStaff={isStaff}
courseId={courseId}
contentToolsEnabled={course.showCalculator || course.notes.enabled}
unitId={unitId}
/>
<SidebarTriggers />
</>
Expand Down
4 changes: 3 additions & 1 deletion src/courseware/course/chat/Chat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const Chat = ({
isStaff,
courseId,
contentToolsEnabled,
unitId,
}) => {
const VERIFIED_MODES = [
'professional',
Expand Down Expand Up @@ -44,7 +45,7 @@ const Chat = ({
<>
{/* Use a portal to ensure that component overlay does not compete with learning MFE styles. */}
{shouldDisplayChat && (createPortal(
<Xpert courseId={courseId} contentToolsEnabled={contentToolsEnabled} />,
<Xpert courseId={courseId} contentToolsEnabled={contentToolsEnabled} unitId={unitId} />,
document.body,
))}
</>
Expand All @@ -57,6 +58,7 @@ Chat.propTypes = {
enrollmentMode: PropTypes.string,
courseId: PropTypes.string.isRequired,
contentToolsEnabled: PropTypes.bool.isRequired,
unitId: PropTypes.string.isRequired,
};

Chat.defaultProps = {
Expand Down

0 comments on commit 4dc4725

Please sign in to comment.