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.
This commit is contained in:
8
package-lock.json
generated
8
package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -85,6 +85,7 @@ const Course = ({
|
||||
isStaff={isStaff}
|
||||
courseId={courseId}
|
||||
contentToolsEnabled={course.showCalculator || course.notes.enabled}
|
||||
unitId={unitId}
|
||||
/>
|
||||
<SidebarTriggers />
|
||||
</>
|
||||
|
||||
@@ -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(
|
||||
<Xpert courseId={courseId} contentToolsEnabled={contentToolsEnabled} />,
|
||||
<Xpert courseId={courseId} contentToolsEnabled={contentToolsEnabled} unitId={unitId} />,
|
||||
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 = {
|
||||
|
||||
Reference in New Issue
Block a user