diff --git a/package-lock.json b/package-lock.json index 1b6ae6a1ba..ad29ef1795 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39406,6 +39406,11 @@ "dev": true, "optional": true }, + "iframe-resizer": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/iframe-resizer/-/iframe-resizer-4.3.2.tgz", + "integrity": "sha512-gOWo2hmdPjMQsQ+zTKbses08mDfDEMh4NneGQNP4qwePYujY1lguqP6gnbeJkf154gojWlBhIltlgnMfYjGHWA==" + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", diff --git a/package.json b/package.json index bfc4454874..442b2c2ad3 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,10 @@ "@reduxjs/toolkit": "1.8.1", "classnames": "2.3.1", "core-js": "3.21.1", + "iframe-resizer": "^4.3.2", "js-cookie": "3.0.1", "lodash.camelcase": "4.3.0", + "lodash.snakecase": "^4.1.1", "mime-types": "^2.1.34", "moment": "^2.29.1", "moment-timezone": "^0.5.34", diff --git a/src/course-home/badges-tab/BadgeProgressTab.jsx b/src/course-home/badges-tab/BadgeProgressTab.jsx index f9ba1c8711..0992459954 100644 --- a/src/course-home/badges-tab/BadgeProgressTab.jsx +++ b/src/course-home/badges-tab/BadgeProgressTab.jsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react'; // import PropTypes from 'prop-types'; +import snakeCase from 'lodash.snakecase'; import { useSelector } from 'react-redux'; import { injectIntl, intlShape } from '@edx/frontend-platform/i18n'; import { StatusAlert } from '@edx/paragon'; @@ -94,9 +95,13 @@ const renderBadgeProgress = () => {
{progress && (
- {progress.map(learnerProgress => ( - - ))} + {progress.map(learnerProgress => { + const itemKey = snakeCase(`card ${learnerProgress.blockDisplayName} ${username}`); + return ( + + ) + } + )}
)}
diff --git a/src/course-home/badges-tab/badge-header/BadgeTabsNavigation.jsx b/src/course-home/badges-tab/badge-header/BadgeTabsNavigation.jsx index 143ccb86d3..66a44787a0 100644 --- a/src/course-home/badges-tab/badge-header/BadgeTabsNavigation.jsx +++ b/src/course-home/badges-tab/badge-header/BadgeTabsNavigation.jsx @@ -38,13 +38,13 @@ function BadgeTabsNavigation({ className="badge-nav-tabs" aria-label={intl.formatMessage(messages['learn.navigation.badge.tabs.label'])} > - + /> */} {tabs.map(({ url, title, slug, disabled, }) => ( diff --git a/src/course-home/badges-tab/badge-progress/banner/BadgeProgressBanner.jsx b/src/course-home/badges-tab/badge-progress/banner/BadgeProgressBanner.jsx index 56affcfb10..63945ac5dc 100644 --- a/src/course-home/badges-tab/badge-progress/banner/BadgeProgressBanner.jsx +++ b/src/course-home/badges-tab/badge-progress/banner/BadgeProgressBanner.jsx @@ -13,21 +13,21 @@ import React from 'react'; : "Here is your progress through the badges available for this course. Click each badge to learn more or to save and share badges you've earned." ); - // d-flex justify-content-left - return ( -
- { hasProgress && ( - <> -
-

{getPathTitle()}

-
-
-

- {getPathSubHeading()} -

-
- - )} + // d-flex justify-content-left + return ( +
+ { hasProgress && ( + <> +
+

{getPathTitle()}

+
+
+

+ {getPathSubHeading()} +

+
+ + )} { !hasProgress && (

This course either has no learner progress or is not setup for badging.

diff --git a/src/course-home/data/api.js b/src/course-home/data/api.js index 183db7eb55..d36df230b9 100644 --- a/src/course-home/data/api.js +++ b/src/course-home/data/api.js @@ -131,6 +131,7 @@ export function normalizeOutlineBlocks(courseId, blocks) { case 'chapter': models.sections[block.id] = { + badgeProgress: block.badge_progress, complete: block.complete, id: block.id, title: block.display_name, diff --git a/src/course-home/outline-tab/OutlineTab.jsx b/src/course-home/outline-tab/OutlineTab.jsx index f83b4a86df..41dd3dcd8d 100644 --- a/src/course-home/outline-tab/OutlineTab.jsx +++ b/src/course-home/outline-tab/OutlineTab.jsx @@ -163,6 +163,7 @@ function OutlineTab({ intl }) { {courses[rootCourseId].sectionIds.map((sectionId) => (
@@ -66,6 +70,19 @@ function Section({ , {intl.formatMessage(complete ? messages.completedSection : messages.incompleteSection)} + {badgeProgress ? ( + <> + {badgeProgressUrl && ( + + + + )} + + ) : ( + <> + )}
);