From 4dc4725ba12f4cd67231be81bee6b1683db5cd17 Mon Sep 17 00:00:00 2001 From: Michael Roytman Date: Fri, 5 Jan 2024 09:08:55 -0500 Subject: [PATCH] feat: pass unitId as a prop through to Xpert component (#1256) 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. --- package-lock.json | 8 ++++---- package.json | 2 +- src/courseware/course/Course.jsx | 1 + src/courseware/course/chat/Chat.jsx | 4 +++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc4ed2088e..16165393dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@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-learning-assistant": "^1.19.0", "@edx/frontend-lib-special-exams": "2.26.0", "@edx/frontend-platform": "5.5.2", "@edx/paragon": "20.46.0", @@ -3460,9 +3460,9 @@ } }, "node_modules/@edx/frontend-lib-learning-assistant": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/@edx/frontend-lib-learning-assistant/-/frontend-lib-learning-assistant-1.18.0.tgz", - "integrity": "sha512-XLcj70YEij+JnvTJjuJd8eyxVI9gOY0q76tRBE+leldsnjKAWi6NknEjLJTI8ncwIwGLDVF7yTUk45Yec6rOlA==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@edx/frontend-lib-learning-assistant/-/frontend-lib-learning-assistant-1.19.0.tgz", + "integrity": "sha512-wBdeQladtvXmS3RA/LOXVNpmEwtG5zAYtu7E7Dh9N8sN2p12ptWCEEdPa92ViK6d5bmqo2NA9ZhnZeEmqs+oRg==", "dependencies": { "@edx/brand": "npm:@edx/brand-openedx@1.2.0", "@fortawesome/fontawesome-svg-core": "1.2.36", diff --git a/package.json b/package.json index 65089d2313..f67f011c43 100644 --- a/package.json +++ b/package.json @@ -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/react-unit-test-utils@1.7.0", diff --git a/src/courseware/course/Course.jsx b/src/courseware/course/Course.jsx index 459d76bee0..0ebc75e8bd 100644 --- a/src/courseware/course/Course.jsx +++ b/src/courseware/course/Course.jsx @@ -85,6 +85,7 @@ const Course = ({ isStaff={isStaff} courseId={courseId} contentToolsEnabled={course.showCalculator || course.notes.enabled} + unitId={unitId} /> diff --git a/src/courseware/course/chat/Chat.jsx b/src/courseware/course/chat/Chat.jsx index 59585a60b7..0ff59c31ae 100644 --- a/src/courseware/course/chat/Chat.jsx +++ b/src/courseware/course/chat/Chat.jsx @@ -10,6 +10,7 @@ const Chat = ({ isStaff, courseId, contentToolsEnabled, + unitId, }) => { const VERIFIED_MODES = [ 'professional', @@ -44,7 +45,7 @@ const Chat = ({ <> {/* Use a portal to ensure that component overlay does not compete with learning MFE styles. */} {shouldDisplayChat && (createPortal( - , + , document.body, ))} @@ -57,6 +58,7 @@ Chat.propTypes = { enrollmentMode: PropTypes.string, courseId: PropTypes.string.isRequired, contentToolsEnabled: PropTypes.bool.isRequired, + unitId: PropTypes.string.isRequired, }; Chat.defaultProps = {