Skip to content

Commit

Permalink
AA-722: Progress Tab (openedx#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carla Duarte authored Mar 31, 2021
1 parent 162f0ce commit 6a376b2
Show file tree
Hide file tree
Showing 27 changed files with 746 additions and 603 deletions.
63 changes: 39 additions & 24 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 @@ -39,7 +39,7 @@
"@edx/frontend-component-footer": "10.1.4",
"@edx/frontend-enterprise": "4.2.3",
"@edx/frontend-platform": "1.8.4",
"@edx/paragon": "13.16.0",
"@edx/paragon": "13.17.3",
"@fortawesome/fontawesome-svg-core": "1.2.34",
"@fortawesome/free-brands-svg-icons": "5.13.1",
"@fortawesome/free-regular-svg-icons": "5.13.1",
Expand Down
26 changes: 12 additions & 14 deletions src/course-home/data/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,18 @@ export async function getDatesTabData(courseId) {
}

export async function getProgressTabData(courseId) {
global.location.replace(`${getConfig().LMS_BASE_URL}/courses/${courseId}/progress`);
// TODO: (AA-213) update once flag is in place
// const url = `${getConfig().LMS_BASE_URL}/api/course_home/v1/progress/${courseId}`;
// try {
// const { data } = await getAuthenticatedHttpClient().get(url);
// return camelCaseObject(data);
// } catch (error) {
// const { httpErrorStatus } = error && error.customAttributes;
// if (httpErrorStatus === 404) {
// global.location.replace(`${getConfig().LMS_BASE_URL}/courses/${courseId}/progress`);
// return {};
// }
// throw error;
// }
const url = `${getConfig().LMS_BASE_URL}/api/course_home/v1/progress/${courseId}`;
try {
const { data } = await getAuthenticatedHttpClient().get(url);
return camelCaseObject(data);
} catch (error) {
const { httpErrorStatus } = error && error.customAttributes;
if (httpErrorStatus === 404) {
global.location.replace(`${getConfig().LMS_BASE_URL}/courses/${courseId}/progress`);
return {};
}
throw error;
}
}

export async function getProctoringInfoData(courseId) {
Expand Down
74 changes: 0 additions & 74 deletions src/course-home/progress-tab/CertificateBanner.jsx

This file was deleted.

36 changes: 0 additions & 36 deletions src/course-home/progress-tab/Chapter.jsx

This file was deleted.

Loading

0 comments on commit 6a376b2

Please sign in to comment.