Skip to content

Commit f710d7d

Browse files
arbrandesclaude
andcommitted
fix: remove @edx/frontend-lib-learning-assistant dependency
It has been fully deprecated and is now being removed. Fixes #1798 Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d77f39f commit f710d7d

File tree

12 files changed

+1072
-1209
lines changed

12 files changed

+1072
-1209
lines changed

.env.development

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ TWITTER_HASHTAG='myedxjourney'
4949
TWITTER_URL='https://twitter.com/edXOnline'
5050
USER_INFO_COOKIE_NAME='edx-user-info'
5151
SESSION_COOKIE_DOMAIN='localhost'
52-
CHAT_RESPONSE_URL='http://localhost:18000/api/learning_assistant/v1/course_id'
5352
PRIVACY_POLICY_URL='http://localhost:18000/privacy'
5453
OPTIMIZELY_FULL_STACK_SDK_KEY=''
5554
SHOW_UNGRADED_ASSIGNMENT_PROGRESS=''

package-lock.json

Lines changed: 1060 additions & 1148 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"@edx/browserslist-config": "1.5.1",
3737
"@edx/frontend-component-footer": "^14.6.0",
3838
"@edx/frontend-component-header": "^8.0.0",
39-
"@edx/frontend-lib-learning-assistant": "^2.24.0",
4039
"@edx/frontend-lib-special-exams": "^4.0.0",
4140
"@edx/frontend-platform": "^8.4.0",
4241
"@edx/openedx-atlas": "^0.7.0",

src/course-home/data/redux.test.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,6 @@ describe('Data layer integration tests', () => {
116116

117117
const state = store.getState();
118118
expect(state.courseHome.courseStatus).toEqual('loaded');
119-
expect(state).toEqual(expect.objectContaining({
120-
// The Xpert chatbot (frontend-lib-learning-assistant) generates a unique UUID
121-
// to keep track of conversations. This UUID is generated on each run.
122-
// Instead, we use an asymmetric matcher here.
123-
learningAssistant: expect.objectContaining({
124-
conversationId: expect.any(String),
125-
}),
126-
}));
127119
});
128120

129121
it.each([401, 403, 404])(
@@ -163,14 +155,6 @@ describe('Data layer integration tests', () => {
163155

164156
const state = store.getState();
165157
expect(state.courseHome.courseStatus).toEqual('loaded');
166-
expect(state).toEqual(expect.objectContaining({
167-
// The Xpert chatbot (frontend-lib-learning-assistant) generates a unique UUID
168-
// to keep track of conversations. This UUID is generated on each run.
169-
// Instead, we use an asymmetric matcher here.
170-
learningAssistant: expect.objectContaining({
171-
conversationId: expect.any(String),
172-
}),
173-
}));
174158
});
175159

176160
it.each([401, 403, 404])(
@@ -211,14 +195,6 @@ describe('Data layer integration tests', () => {
211195

212196
const state = store.getState();
213197
expect(state.courseHome.courseStatus).toEqual('loaded');
214-
expect(state).toEqual(expect.objectContaining({
215-
// The Xpert chatbot (frontend-lib-learning-assistant) generates a unique UUID
216-
// to keep track of conversations. This UUID is generated on each run.
217-
// Instead, we use an asymmetric matcher here.
218-
learningAssistant: expect.objectContaining({
219-
conversationId: expect.any(String),
220-
}),
221-
}));
222198
});
223199

224200
it('Should handle the url including a targetUserId', async () => {

src/courseware/course/content-tools/ContentTools.jsx

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,23 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import { useSelector } from 'react-redux';
43

54
import Calculator from './calculator';
65
import NotesVisibility from './notes-visibility';
76

87
const ContentTools = ({
98
course,
10-
}) => {
11-
const {
12-
sidebarIsOpen,
13-
} = useSelector(state => state.learningAssistant);
14-
15-
return (
16-
!sidebarIsOpen && (
17-
<div className="content-tools">
18-
<div className="d-flex justify-content-end align-items-end m-0">
19-
{course.showCalculator && (
20-
<Calculator />
21-
)}
22-
{course.notes.enabled && (
23-
<NotesVisibility course={course} />
24-
)}
25-
</div>
26-
</div>
27-
)
28-
);
29-
};
9+
}) => (
10+
<div className="content-tools">
11+
<div className="d-flex justify-content-end align-items-end m-0">
12+
{course.showCalculator && (
13+
<Calculator />
14+
)}
15+
{course.notes.enabled && (
16+
<NotesVisibility course={course} />
17+
)}
18+
</div>
19+
</div>
20+
);
3021

3122
ContentTools.propTypes = {
3223
course: PropTypes.shape({

src/courseware/data/__factories__/courseMetadata.factory.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,4 @@ Factory.define('courseMetadata')
5959
related_programs: null,
6060
user_needs_integrity_signature: false,
6161
recommendations: null,
62-
learning_assistant_enabled: null,
6362
});

src/courseware/data/pact-tests/lmsPact.test.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ describe('Courseware Service', () => {
227227
linkedinAddToProfileUrl: null,
228228
relatedPrograms: null,
229229
userNeedsIntegritySignature: false,
230-
learningAssistantEnabled: false,
231230
};
232231
setTimeout(() => {
233232
provider.addInteraction({
@@ -332,7 +331,6 @@ describe('Courseware Service', () => {
332331
verification_status: string('none'),
333332
linkedin_add_to_profile_url: null,
334333
user_needs_integrity_signature: boolean(false),
335-
learning_assistant_enabled: boolean(false),
336334
language: string('en'),
337335
whole_course_translation_enabled: boolean(false),
338336
},

src/courseware/data/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export function normalizeMetadata(metadata) {
102102
relatedPrograms: camelCaseObject(data.related_programs),
103103
userNeedsIntegritySignature: data.user_needs_integrity_signature,
104104
canAccessProctoredExams: data.can_access_proctored_exams,
105-
learningAssistantEnabled: data.learning_assistant_enabled,
106105
};
107106
}
108107

src/index.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,8 @@ initialize({
192192
EXAMS_BASE_URL: process.env.EXAMS_BASE_URL || null,
193193
PROCTORED_EXAM_FAQ_URL: process.env.PROCTORED_EXAM_FAQ_URL || null,
194194
PROCTORED_EXAM_RULES_URL: process.env.PROCTORED_EXAM_RULES_URL || null,
195-
CHAT_RESPONSE_URL: process.env.CHAT_RESPONSE_URL || null,
196195
PRIVACY_POLICY_URL: process.env.PRIVACY_POLICY_URL || null,
197196
SHOW_UNGRADED_ASSIGNMENT_PROGRESS: process.env.SHOW_UNGRADED_ASSIGNMENT_PROGRESS || false,
198-
ENABLE_XPERT_AUDIT: process.env.ENABLE_XPERT_AUDIT || false,
199197
}, 'LearnerAppConfig');
200198
},
201199
},

src/pacts/frontend-app-learning-lms.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@
306306
"verification_status": "none",
307307
"linkedin_add_to_profile_url": null,
308308
"user_needs_integrity_signature": false,
309-
"learning_assistant_enabled": false,
310309
"language": "en",
311310
"whole_course_translation_enabled": false
312311
},
@@ -444,9 +443,6 @@
444443
"$.body.user_needs_integrity_signature": {
445444
"match": "type"
446445
},
447-
"$.body.learning_assistant_enabled": {
448-
"match": "type"
449-
},
450446
"$.body.whole_course_translation_enabled": {
451447
"match": "type"
452448
}

0 commit comments

Comments
 (0)