@edx/frontend-app-subscription-learner-dashboard 1.52.1 → 1.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ConfirmCourseUpgradeActionModal.d.ts +5 -1
- package/dist/components/ConfirmCourseUpgradeActionModal.js +5 -2
- package/dist/components/ConfirmCourseUpgradeActionModal.js.map +1 -1
- package/dist/containers/CourseCard/components/CourseCardBanners/CourseUpgradeButton.d.ts +6 -0
- package/dist/containers/CourseCard/components/CourseCardBanners/CourseUpgradeButton.js +24 -0
- package/dist/containers/CourseCard/components/CourseCardBanners/CourseUpgradeButton.js.map +1 -0
- package/dist/containers/CourseCard/components/CourseCardBanners/UpgradeBanner.d.ts +5 -3
- package/dist/containers/CourseCard/components/CourseCardBanners/UpgradeBanner.js +6 -4
- package/dist/containers/CourseCard/components/CourseCardBanners/UpgradeBanner.js.map +1 -1
- package/dist/containers/CourseCard/components/CourseCardBanners/index.d.ts +1 -1
- package/dist/containers/CourseCard/components/CourseCardBanners/index.js +25 -25
- package/dist/containers/CourseCard/components/CourseCardBanners/index.js.map +1 -1
- package/dist/containers/CourseCard/components/CourseCardBanners/messages.d.ts +32 -0
- package/dist/containers/CourseCard/components/CourseCardBanners/messages.js +22 -2
- package/dist/containers/CourseCard/components/CourseCardBanners/messages.js.map +1 -1
- package/dist/containers/Dashboard/LoadingView.d.ts +4 -1
- package/dist/containers/Dashboard/LoadingView.js +2 -3
- package/dist/containers/Dashboard/LoadingView.js.map +1 -1
- package/dist/containers/ProductCard/index.js +3 -2
- package/dist/containers/ProductCard/index.js.map +1 -1
- package/dist/containers/ProductCard/messages.d.ts +5 -0
- package/dist/containers/ProductCard/messages.js +5 -0
- package/dist/containers/ProductCard/messages.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramsList/ProgramListCard.js +2 -2
- package/dist/containers/ProgramDashboard/ProgramsList/ProgramListCard.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramsList/index.scss +5 -18
- package/dist/hooks/usePopularCoursesAndPrograms.js +3 -2
- package/dist/hooks/usePopularCoursesAndPrograms.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default ConfirmCourseUpgradeActionModal;
|
|
2
|
-
declare function ConfirmCourseUpgradeActionModal({ isOpen, title, body, navigateLabel, reloadLabel, onSuccess, onReload, navigateTo, }: {
|
|
2
|
+
declare function ConfirmCourseUpgradeActionModal({ isOpen, title, body, navigateLabel, reloadLabel, onSuccess, onReload, navigateTo, isLoading, loadingTitle, }: {
|
|
3
3
|
isOpen: any;
|
|
4
4
|
title: any;
|
|
5
5
|
body: any;
|
|
@@ -8,6 +8,8 @@ declare function ConfirmCourseUpgradeActionModal({ isOpen, title, body, navigate
|
|
|
8
8
|
onSuccess: any;
|
|
9
9
|
onReload: any;
|
|
10
10
|
navigateTo: any;
|
|
11
|
+
isLoading?: boolean | undefined;
|
|
12
|
+
loadingTitle?: string | undefined;
|
|
11
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
declare namespace ConfirmCourseUpgradeActionModal {
|
|
13
15
|
namespace propTypes {
|
|
@@ -19,6 +21,8 @@ declare namespace ConfirmCourseUpgradeActionModal {
|
|
|
19
21
|
let onSuccess: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
22
|
let onReload: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
23
|
let navigateTo: PropTypes.Requireable<string>;
|
|
24
|
+
let isLoading: PropTypes.Validator<boolean>;
|
|
25
|
+
let loadingTitle: PropTypes.Requireable<string>;
|
|
22
26
|
}
|
|
23
27
|
namespace defaultProps {
|
|
24
28
|
let title_1: null;
|
|
@@ -2,8 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ModalDialog, ActionRow, Button } from '@openedx/paragon';
|
|
4
4
|
import { Link } from 'react-router-dom';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import LoadingView from '../containers/Dashboard/LoadingView';
|
|
6
|
+
const ConfirmCourseUpgradeActionModal = ({ isOpen, title, body, navigateLabel, reloadLabel, onSuccess, onReload, navigateTo, isLoading = false, loadingTitle = '', }) => {
|
|
7
|
+
return (_jsxs(ModalDialog, { isOpen: isOpen, title: title, hasCloseButton: false, isBlocking: true, children: [title && (_jsx(ModalDialog.Header, { children: _jsx(ModalDialog.Title, { style: { fontSize: '22px', lineHeight: '1.2' }, children: isLoading ? loadingTitle : title }) })), _jsxs(ModalDialog.Body, { children: [_jsx("div", { className: "d-flex justify-content-center align-items-center", children: isLoading && _jsx(LoadingView, { variant: "primary" }) }), !isLoading && body && _jsx("p", { children: body })] }), _jsx(ModalDialog.Footer, { children: !isLoading && (_jsxs(ActionRow, { children: [_jsx(Button, { variant: "tertiary", onClick: onReload, children: reloadLabel }), _jsx(Button, { variant: "primary", as: Link, to: navigateTo, children: navigateLabel })] })) })] }));
|
|
7
8
|
};
|
|
8
9
|
ConfirmCourseUpgradeActionModal.propTypes = {
|
|
9
10
|
isOpen: PropTypes.bool.isRequired,
|
|
@@ -14,6 +15,8 @@ ConfirmCourseUpgradeActionModal.propTypes = {
|
|
|
14
15
|
onSuccess: PropTypes.func,
|
|
15
16
|
onReload: PropTypes.func,
|
|
16
17
|
navigateTo: PropTypes.string,
|
|
18
|
+
isLoading: PropTypes.bool.isRequired,
|
|
19
|
+
loadingTitle: PropTypes.string,
|
|
17
20
|
};
|
|
18
21
|
ConfirmCourseUpgradeActionModal.defaultProps = {
|
|
19
22
|
title: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmCourseUpgradeActionModal.js","sourceRoot":"","sources":["../../src/components/ConfirmCourseUpgradeActionModal.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfirmCourseUpgradeActionModal.js","sourceRoot":"","sources":["../../src/components/ConfirmCourseUpgradeActionModal.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,WAAW,MAAM,uCAAuC,CAAC;AAEhE,MAAM,+BAA+B,GAAG,CAAC,EACvC,MAAM,EACN,KAAK,EACL,IAAI,EACJ,aAAa,EACb,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,SAAS,GAAG,KAAK,EACjB,YAAY,GAAG,EAAE,GAClB,EAAE,EAAE;IACH,OAAO,CACL,MAAC,WAAW,IACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,KAAK,EACrB,UAAU,mBAET,KAAK,IAAI,CACR,KAAC,WAAW,CAAC,MAAM,cACjB,KAAC,WAAW,CAAC,KAAK,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,YAC9D,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,GACf,GACD,CACtB,EAED,MAAC,WAAW,CAAC,IAAI,eACf,cAAK,SAAS,EAAC,kDAAkD,YAC9D,SAAS,IAAI,KAAC,WAAW,IAAC,OAAO,EAAC,SAAS,GAAG,GAC3C,EACL,CAAC,SAAS,IAAI,IAAI,IAAI,sBAAI,IAAI,GAAK,IACnB,EAEnB,KAAC,WAAW,CAAC,MAAM,cAChB,CAAC,SAAS,IAAI,CACb,MAAC,SAAS,eACR,KAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,OAAO,EAAE,QAAQ,YACzC,WAAW,GACL,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,YAC/C,aAAa,GACP,IACC,CACb,GACkB,IACT,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,+BAA+B,CAAC,SAAS,GAAG;IAC1C,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACjC,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,IAAI,EAAE,SAAS,CAAC,MAAM;IACtB,aAAa,EAAE,SAAS,CAAC,MAAM;IAC/B,WAAW,EAAE,SAAS,CAAC,MAAM;IAC7B,SAAS,EAAE,SAAS,CAAC,IAAI;IACzB,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,UAAU,EAAE,SAAS,CAAC,MAAM;IAC5B,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACpC,YAAY,EAAE,SAAS,CAAC,MAAM;CAC/B,CAAC;AAEF,+BAA+B,CAAC,YAAY,GAAG;IAC7C,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,OAAO;IACpB,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;IACnB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,UAAU,EAAE,EAAE;CACf,CAAC;AAEF,eAAe,+BAA+B,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { ModalDialog, ActionRow, Button } from '@openedx/paragon';\nimport { Link } from 'react-router-dom';\nimport LoadingView from '@src/containers/Dashboard/LoadingView';\n\nconst ConfirmCourseUpgradeActionModal = ({\n isOpen,\n title,\n body,\n navigateLabel,\n reloadLabel,\n onSuccess,\n onReload,\n navigateTo,\n isLoading = false,\n loadingTitle = '',\n}) => {\n return (\n <ModalDialog\n isOpen={isOpen}\n title={title}\n hasCloseButton={false}\n isBlocking\n >\n {title && (\n <ModalDialog.Header>\n <ModalDialog.Title style={{ fontSize: '22px', lineHeight: '1.2' }}>\n {isLoading ? loadingTitle : title}\n </ModalDialog.Title>\n </ModalDialog.Header>\n )}\n\n <ModalDialog.Body>\n <div className=\"d-flex justify-content-center align-items-center\">\n {isLoading && <LoadingView variant=\"primary\" />}\n </div>\n {!isLoading && body && <p>{body}</p>}\n </ModalDialog.Body>\n\n <ModalDialog.Footer>\n {!isLoading && (\n <ActionRow>\n <Button variant=\"tertiary\" onClick={onReload}>\n {reloadLabel}\n </Button>\n <Button variant=\"primary\" as={Link} to={navigateTo}>\n {navigateLabel}\n </Button>\n </ActionRow>\n )}\n </ModalDialog.Footer>\n </ModalDialog>\n );\n};\n\nConfirmCourseUpgradeActionModal.propTypes = {\n isOpen: PropTypes.bool.isRequired,\n title: PropTypes.string,\n body: PropTypes.string,\n navigateLabel: PropTypes.string,\n reloadLabel: PropTypes.string,\n onSuccess: PropTypes.func,\n onReload: PropTypes.func,\n navigateTo: PropTypes.string,\n isLoading: PropTypes.bool.isRequired,\n loadingTitle: PropTypes.string,\n};\n\nConfirmCourseUpgradeActionModal.defaultProps = {\n title: null,\n body: null,\n navigateLabel: 'Resume Course',\n reloadLabel: 'Close',\n onSuccess: () => {},\n onReload: () => {},\n navigateTo: '',\n};\n\nexport default ConfirmCourseUpgradeActionModal;\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { Button } from '@openedx/paragon';
|
|
4
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
5
|
+
import { useUpgradeCourseEnrollment } from '../../../../data/hooks/mutationHooks';
|
|
6
|
+
import { useActionWithModal } from '../../../../hooks';
|
|
7
|
+
import { learnerDashboardQueryKeys } from '../../../../data/hooks/queryKeys';
|
|
8
|
+
import messages from './messages';
|
|
9
|
+
import ConfirmCourseUpgradeActionModal from '../../../../components/ConfirmCourseUpgradeActionModal';
|
|
10
|
+
export default function CourseUpgradeButton({ title, courseId, }) {
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
12
|
+
const queryClient = useQueryClient();
|
|
13
|
+
const { mutateAsync, isPending } = useUpgradeCourseEnrollment();
|
|
14
|
+
const { isTriggering, trigger, handleCancelAction, isModalOpen } = useActionWithModal(() => mutateAsync({ courseRunKey: courseId }), {
|
|
15
|
+
shouldOpenModal: (response) => (response === null || response === void 0 ? void 0 : response.success) === true,
|
|
16
|
+
onCancel: () => queryClient.invalidateQueries({
|
|
17
|
+
queryKey: learnerDashboardQueryKeys.initializeSubsCourseDashboard(),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline-dark", size: "md", onClick: trigger, disabled: !courseId || isTriggering || isPending, children: formatMessage(messages.upgradeAction) }), _jsx(ConfirmCourseUpgradeActionModal, { isLoading: isTriggering, isOpen: isModalOpen || isTriggering, title: formatMessage(messages.upgradeCourseCompleteText, {
|
|
21
|
+
title,
|
|
22
|
+
}), loadingTitle: formatMessage(messages.upgradeCourseloadingText), onReload: handleCancelAction, reloadLabel: formatMessage(messages.closeAction), navigateLabel: "Resume Course", navigateTo: `/courses/${courseId}` })] }));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=CourseUpgradeButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CourseUpgradeButton.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardBanners/CourseUpgradeButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM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AAC,EAC9D,QAAQ,EAAE,kBAAkB,EAC5B,WAAW,EAAE,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,EAChD,aAAa,EAAC,eAAe,EAC7B,UAAU,EAAE,YAAY,QAAQ,EAAE,GAClC,IACD,CACJ,CAAC;AACJ,CAAC","sourcesContent":["import { useQueryClient } from '@tanstack/react-query';\nimport { Button } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { useUpgradeCourseEnrollment } from '@src/data/hooks/mutationHooks';\nimport { useActionWithModal } from '@src/hooks';\nimport { learnerDashboardQueryKeys } from '@src/data/hooks/queryKeys';\nimport messages from './messages';\nimport ConfirmCourseUpgradeActionModal from '@src/components/ConfirmCourseUpgradeActionModal';\n\ninterface CourseUpgradeButtonProps {\n title: string,\n courseId: string,\n}\n\nexport default function CourseUpgradeButton({\n title,\n courseId,\n}: CourseUpgradeButtonProps) {\n const { formatMessage } = useIntl();\n const queryClient = useQueryClient();\n const { mutateAsync, isPending } = useUpgradeCourseEnrollment();\n\n const { isTriggering, trigger, handleCancelAction, isModalOpen } = useActionWithModal(\n () => mutateAsync({ courseRunKey: courseId }),\n {\n shouldOpenModal: (response) => response?.success === true,\n onCancel: () =>\n queryClient.invalidateQueries({\n queryKey: learnerDashboardQueryKeys.initializeSubsCourseDashboard(),\n }),\n },\n );\n\n return (\n <>\n <Button\n variant=\"outline-dark\"\n size=\"md\"\n onClick={trigger}\n disabled={!courseId || isTriggering || isPending}\n >\n {formatMessage(messages.upgradeAction)}\n </Button>\n\n <ConfirmCourseUpgradeActionModal\n isLoading={isTriggering}\n isOpen={isModalOpen || isTriggering}\n title={formatMessage(messages.upgradeCourseCompleteText, {\n title,\n })}\n loadingTitle={formatMessage(messages.upgradeCourseloadingText)}\n onReload={handleCancelAction}\n reloadLabel={formatMessage(messages.closeAction)}\n navigateLabel=\"Resume Course\"\n navigateTo={`/courses/${courseId}`}\n />\n </>\n );\n}\n"]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export default UpgradeBanner;
|
|
2
|
-
declare function UpgradeBanner({
|
|
3
|
-
|
|
2
|
+
declare function UpgradeBanner({ title, courseId }: {
|
|
3
|
+
title: any;
|
|
4
|
+
courseId: any;
|
|
4
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
declare namespace UpgradeBanner {
|
|
6
7
|
namespace propTypes {
|
|
7
|
-
let
|
|
8
|
+
let title: PropTypes.Requireable<string>;
|
|
9
|
+
let courseId: PropTypes.Requireable<string>;
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
import PropTypes from 'prop-types';
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
-
import {
|
|
4
|
+
import { Card, Col, Row } from '@openedx/paragon';
|
|
5
5
|
import messages from './messages';
|
|
6
|
-
|
|
6
|
+
import CourseUpgradeButton from './CourseUpgradeButton';
|
|
7
|
+
const UpgradeBanner = ({ title, courseId }) => {
|
|
7
8
|
const { formatMessage } = useIntl();
|
|
8
|
-
return (_jsx(Card.Status, { variant: "warning", className: "bg-light-200", "data-testid": "subscription-upgrade-banner", children: _jsxs(Row, { className: "align-items-center mt-1", children: [_jsx(Col, { xs: 12, lg: 8, className: "pe-lg-3", children: _jsx("p", { className: "mb-0 font-weight-semi-bold", children: formatMessage(messages.subscriptionUpgradeBannerText) }) }), _jsx(Col, { xs: 12, sm: 4, className: "d-flex justify-content-end mt-2 mt-lg-0", children: _jsx(
|
|
9
|
+
return (_jsx(Card.Status, { variant: "warning", className: "bg-light-200", "data-testid": "subscription-upgrade-banner", children: _jsxs(Row, { className: "align-items-center mt-1", children: [_jsx(Col, { xs: 12, lg: 8, className: "pe-lg-3", children: _jsx("p", { className: "mb-0 font-weight-semi-bold", children: formatMessage(messages.subscriptionUpgradeBannerText) }) }), _jsx(Col, { xs: 12, sm: 4, className: "d-flex justify-content-end mt-2 mt-lg-0", children: _jsx(CourseUpgradeButton, { courseId: courseId, title: title }) })] }) }));
|
|
9
10
|
};
|
|
10
11
|
UpgradeBanner.propTypes = {
|
|
11
|
-
|
|
12
|
+
title: PropTypes.string,
|
|
13
|
+
courseId: PropTypes.string,
|
|
12
14
|
};
|
|
13
15
|
export default UpgradeBanner;
|
|
14
16
|
//# sourceMappingURL=UpgradeBanner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpgradeBanner.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardBanners/UpgradeBanner.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"UpgradeBanner.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardBanners/UpgradeBanner.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC5C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,KAAC,IAAI,CAAC,MAAM,IACV,OAAO,EAAC,SAAS,EACjB,SAAS,EAAC,cAAc,iBACZ,6BAA6B,YAEzC,MAAC,GAAG,IAAC,SAAS,EAAC,yBAAyB,aACtC,KAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAC,SAAS,YACrC,YAAG,SAAS,EAAC,4BAA4B,YACtC,aAAa,CAAC,QAAQ,CAAC,6BAA6B,CAAC,GACpD,GACA,EACN,KAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAC,yCAAyC,YACrE,KAAC,mBAAmB,IAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAI,GACrD,IACF,GACM,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,SAAS,GAAG;IACxB,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,QAAQ,EAAE,SAAS,CAAC,MAAM;CAC3B,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useIntl } from '@openedx/frontend-base';\nimport { Card, Col, Row } from '@openedx/paragon';\n\nimport messages from './messages';\nimport CourseUpgradeButton from './CourseUpgradeButton';\n\nconst UpgradeBanner = ({ title, courseId }) => {\n const { formatMessage } = useIntl();\n\n return (\n <Card.Status\n variant=\"warning\"\n className=\"bg-light-200\"\n data-testid=\"subscription-upgrade-banner\"\n >\n <Row className=\"align-items-center mt-1\">\n <Col xs={12} lg={8} className=\"pe-lg-3\">\n <p className=\"mb-0 font-weight-semi-bold\">\n {formatMessage(messages.subscriptionUpgradeBannerText)}\n </p>\n </Col>\n <Col xs={12} sm={4} className=\"d-flex justify-content-end mt-2 mt-lg-0\">\n <CourseUpgradeButton courseId={courseId} title={title} />\n </Col>\n </Row>\n </Card.Status>\n );\n};\n\nUpgradeBanner.propTypes = {\n title: PropTypes.string,\n courseId: PropTypes.string,\n};\n\nexport default UpgradeBanner;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function CourseCardBanners({ cardId, verifiedCourse, isHistoryTab, isAudit, isAuditAccessExpired, canUpgrade }: {
|
|
1
|
+
export function CourseCardBanners({ cardId, verifiedCourse, isHistoryTab, isAudit, isAuditAccessExpired, canUpgrade, }: {
|
|
2
2
|
cardId: any;
|
|
3
3
|
verifiedCourse: any;
|
|
4
4
|
isHistoryTab: any;
|
|
@@ -6,36 +6,36 @@ import UpgradeBanner from './UpgradeBanner';
|
|
|
6
6
|
import ViewCertificateBanner from './ViewCertificateBanner';
|
|
7
7
|
import ViewGradesBanner from './ViewGradesBanner';
|
|
8
8
|
import ViewCourseDetailBanner from './ViewCourseDetailBanner';
|
|
9
|
-
export const CourseCardBanners = ({ cardId, verifiedCourse, isHistoryTab, isAudit, isAuditAccessExpired, canUpgrade }) => {
|
|
10
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9
|
+
export const CourseCardBanners = ({ cardId, verifiedCourse, isHistoryTab, isAudit, isAuditAccessExpired, canUpgrade, }) => {
|
|
10
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
11
11
|
const courseData = useCourseData(cardId);
|
|
12
12
|
if (!courseData) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const courseId = (_b = (_a = courseData === null || courseData === void 0 ? void 0 : courseData.courseRun) === null || _a === void 0 ? void 0 : _a.courseId) !== null && _b !== void 0 ? _b : '';
|
|
16
|
+
const title = (_d = (_c = courseData === null || courseData === void 0 ? void 0 : courseData.course) === null || _c === void 0 ? void 0 : _c.courseName) !== null && _d !== void 0 ? _d : '';
|
|
17
|
+
const upgradeUrl = (_f = (_e = courseData === null || courseData === void 0 ? void 0 : courseData.courseRun) === null || _e === void 0 ? void 0 : _e.marketingUrl) !== null && _f !== void 0 ? _f : '';
|
|
16
18
|
const findCourseUrl = '/subscription-search';
|
|
17
|
-
const showFindCourseBanner =
|
|
18
|
-
&&
|
|
19
|
-
&&
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const showViewCourseDetailBanner =
|
|
23
|
-
&&
|
|
24
|
-
&&
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const showUpgradeBanner =
|
|
28
|
-
&&
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const isDownloadable = ((
|
|
32
|
-
const isCompletedButNotPassed = !!((
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const homeUrl = (
|
|
36
|
-
return (_jsxs("div", { className: "course-card-banners", "data-testid": "CourseCardBanners", children: [showUpgradeBanner && (_jsx(UpgradeBanner, { upgradeUrl: upgradeUrl })), isDownloadable &&
|
|
37
|
-
_jsx(ViewCertificateBanner, { cardId: cardId }), isCompletedButNotPassed &&
|
|
38
|
-
_jsx(ViewGradesBanner, { cardId: cardId }), showFindCourseBanner && (_jsx(FindCourseBanner, { findCourseUrl: findCourseUrl })), showViewCourseDetailBanner && (_jsx(ViewCourseDetailBanner, { viewCourseDetailUrl: homeUrl }))] }));
|
|
19
|
+
const showFindCourseBanner = isHistoryTab &&
|
|
20
|
+
isAuditAccessExpired &&
|
|
21
|
+
isAudit &&
|
|
22
|
+
((_g = courseData === null || courseData === void 0 ? void 0 : courseData.courseRun) === null || _g === void 0 ? void 0 : _g.isArchived) &&
|
|
23
|
+
!(courseData === null || courseData === void 0 ? void 0 : courseData.isFromNonUpgradeableCourses);
|
|
24
|
+
const showViewCourseDetailBanner = isHistoryTab &&
|
|
25
|
+
isAudit &&
|
|
26
|
+
isAuditAccessExpired &&
|
|
27
|
+
!canUpgrade &&
|
|
28
|
+
!(courseData === null || courseData === void 0 ? void 0 : courseData.isFromNonUpgradeableCourses);
|
|
29
|
+
const showUpgradeBanner = isAudit &&
|
|
30
|
+
canUpgrade &&
|
|
31
|
+
!(courseData === null || courseData === void 0 ? void 0 : courseData.isFromNonUpgradeableCourses) &&
|
|
32
|
+
(!isHistoryTab || isAuditAccessExpired);
|
|
33
|
+
const isDownloadable = ((_h = courseData === null || courseData === void 0 ? void 0 : courseData.certificate) === null || _h === void 0 ? void 0 : _h.isDownloadable) || false;
|
|
34
|
+
const isCompletedButNotPassed = !!((_j = courseData === null || courseData === void 0 ? void 0 : courseData.courseRun) === null || _j === void 0 ? void 0 : _j.isArchived) &&
|
|
35
|
+
((_k = courseData === null || courseData === void 0 ? void 0 : courseData.gradeData) === null || _k === void 0 ? void 0 : _k.isPassing) === false &&
|
|
36
|
+
!((_l = courseData === null || courseData === void 0 ? void 0 : courseData.certificate) === null || _l === void 0 ? void 0 : _l.isEarned);
|
|
37
|
+
const homeUrl = (_m = courseData === null || courseData === void 0 ? void 0 : courseData.courseRun) === null || _m === void 0 ? void 0 : _m.homeUrl;
|
|
38
|
+
return (_jsxs("div", { className: "course-card-banners", "data-testid": "CourseCardBanners", children: [showUpgradeBanner && (_jsx(UpgradeBanner, { courseId: courseId, title: title, upgradeUrl: upgradeUrl })), isDownloadable && _jsx(ViewCertificateBanner, { cardId: cardId }), isCompletedButNotPassed && _jsx(ViewGradesBanner, { cardId: cardId }), showFindCourseBanner && (_jsx(FindCourseBanner, { findCourseUrl: findCourseUrl })), showViewCourseDetailBanner && (_jsx(ViewCourseDetailBanner, { viewCourseDetailUrl: homeUrl }))] }));
|
|
39
39
|
};
|
|
40
40
|
CourseCardBanners.propTypes = {
|
|
41
41
|
cardId: PropTypes.string.isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardBanners/index.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAE9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/C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AAC;AACJ,CAAC,CAAC;AACF,iBAAiB,CAAC,SAAS,GAAG;IAC5B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACnC,cAAc,EAAE,SAAS,CAAC,IAAI;IAC9B,YAAY,EAAE,SAAS,CAAC,IAAI;IAC5B,OAAO,EAAE,SAAS,CAAC,IAAI;IACvB,oBAAoB,EAAE,SAAS,CAAC,IAAI;IACpC,UAAU,EAAE,SAAS,CAAC,IAAI;CAC3B,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport FindCourseBanner from './FindCourseBanner';\nimport { useCourseData } from '@src/hooks';\nimport UpgradeBanner from './UpgradeBanner';\nimport ViewCertificateBanner from './ViewCertificateBanner';\nimport ViewGradesBanner from './ViewGradesBanner';\nimport ViewCourseDetailBanner from './ViewCourseDetailBanner';\n\nexport const CourseCardBanners = ({\n cardId,\n verifiedCourse,\n isHistoryTab,\n isAudit,\n isAuditAccessExpired,\n canUpgrade,\n}) => {\n const courseData = useCourseData(cardId);\n if (!courseData) {\n return null;\n }\n\n const courseId = courseData?.courseRun?.courseId ?? '';\n const title = courseData?.course?.courseName ?? '';\n\n const upgradeUrl = courseData?.courseRun?.marketingUrl ?? '';\n const findCourseUrl = '/subscription-search';\n const showFindCourseBanner =\n isHistoryTab &&\n isAuditAccessExpired &&\n isAudit &&\n courseData?.courseRun?.isArchived &&\n !courseData?.isFromNonUpgradeableCourses;\n const showViewCourseDetailBanner =\n isHistoryTab &&\n isAudit &&\n isAuditAccessExpired &&\n !canUpgrade &&\n !courseData?.isFromNonUpgradeableCourses;\n const showUpgradeBanner =\n isAudit &&\n canUpgrade &&\n !courseData?.isFromNonUpgradeableCourses &&\n (!isHistoryTab || isAuditAccessExpired);\n const isDownloadable = courseData?.certificate?.isDownloadable || false;\n const isCompletedButNotPassed =\n !!courseData?.courseRun?.isArchived &&\n courseData?.gradeData?.isPassing === false &&\n !courseData?.certificate?.isEarned;\n const homeUrl = courseData?.courseRun?.homeUrl;\n\n return (\n <div className=\"course-card-banners\" data-testid=\"CourseCardBanners\">\n {showUpgradeBanner && (\n <UpgradeBanner\n courseId={courseId}\n title={title}\n upgradeUrl={upgradeUrl}\n />\n )}\n {isDownloadable && <ViewCertificateBanner cardId={cardId} />}\n {isCompletedButNotPassed && <ViewGradesBanner cardId={cardId} />}\n {showFindCourseBanner && (\n <FindCourseBanner findCourseUrl={findCourseUrl} />\n )}\n {showViewCourseDetailBanner && (\n <ViewCourseDetailBanner viewCourseDetailUrl={homeUrl} />\n )}\n </div>\n );\n};\nCourseCardBanners.propTypes = {\n cardId: PropTypes.string.isRequired,\n verifiedCourse: PropTypes.bool,\n isHistoryTab: PropTypes.bool,\n isAudit: PropTypes.bool,\n isAuditAccessExpired: PropTypes.bool,\n canUpgrade: PropTypes.bool,\n};\n\nexport default CourseCardBanners;\n"]}
|
|
@@ -261,4 +261,36 @@ declare namespace messages {
|
|
|
261
261
|
let defaultMessage_32: string;
|
|
262
262
|
export { defaultMessage_32 as defaultMessage };
|
|
263
263
|
}
|
|
264
|
+
namespace upgradeCourseCompleteText {
|
|
265
|
+
let defaultMessage_33: string;
|
|
266
|
+
export { defaultMessage_33 as defaultMessage };
|
|
267
|
+
let id_33: string;
|
|
268
|
+
export { id_33 as id };
|
|
269
|
+
let description_33: string;
|
|
270
|
+
export { description_33 as description };
|
|
271
|
+
}
|
|
272
|
+
namespace upgradeCourseloadingText {
|
|
273
|
+
let defaultMessage_34: string;
|
|
274
|
+
export { defaultMessage_34 as defaultMessage };
|
|
275
|
+
let id_34: string;
|
|
276
|
+
export { id_34 as id };
|
|
277
|
+
let description_34: string;
|
|
278
|
+
export { description_34 as description };
|
|
279
|
+
}
|
|
280
|
+
namespace closeAction {
|
|
281
|
+
let id_35: string;
|
|
282
|
+
export { id_35 as id };
|
|
283
|
+
let description_35: string;
|
|
284
|
+
export { description_35 as description };
|
|
285
|
+
let defaultMessage_35: string;
|
|
286
|
+
export { defaultMessage_35 as defaultMessage };
|
|
287
|
+
}
|
|
288
|
+
namespace resumeCourseAction {
|
|
289
|
+
let id_36: string;
|
|
290
|
+
export { id_36 as id };
|
|
291
|
+
let description_36: string;
|
|
292
|
+
export { description_36 as description };
|
|
293
|
+
let defaultMessage_36: string;
|
|
294
|
+
export { defaultMessage_36 as defaultMessage };
|
|
295
|
+
}
|
|
264
296
|
}
|
|
@@ -93,12 +93,12 @@ const messages = defineMessages({
|
|
|
93
93
|
prerequisitesNotMet: {
|
|
94
94
|
id: 'learner-dash.courseCard.banners.prerequisitesNotMet',
|
|
95
95
|
description: 'Message to learners with unmet prerequisites',
|
|
96
|
-
defaultMessage:
|
|
96
|
+
defaultMessage: "You can't access this course just yet because you have not met the pre-requisites.",
|
|
97
97
|
},
|
|
98
98
|
courseHasNotStarted: {
|
|
99
99
|
id: 'learner-dash.courseCard.banners.courseHasNotStarted',
|
|
100
100
|
description: 'Course has not started message',
|
|
101
|
-
defaultMessage:
|
|
101
|
+
defaultMessage: "You can't access this course just yet because the course hasn't started yet. The course will start on {startDate}.",
|
|
102
102
|
},
|
|
103
103
|
redeem: {
|
|
104
104
|
id: 'learner-dash.courseCard.banners.redeem',
|
|
@@ -165,6 +165,26 @@ const messages = defineMessages({
|
|
|
165
165
|
description: 'Find course action link text for verified courses',
|
|
166
166
|
defaultMessage: 'Find a course',
|
|
167
167
|
},
|
|
168
|
+
upgradeCourseCompleteText: {
|
|
169
|
+
defaultMessage: 'You now have full course access to {title}',
|
|
170
|
+
id: 'learner-dash.courseCard.banners.upgrade.complete.text',
|
|
171
|
+
description: 'text to display when a user has upgraded a course',
|
|
172
|
+
},
|
|
173
|
+
upgradeCourseloadingText: {
|
|
174
|
+
defaultMessage: 'We are upgrading your course to the verified track.',
|
|
175
|
+
id: 'learner-dash.courseCard.banners.upgrade.loading.text',
|
|
176
|
+
description: 'text to display when a user is upgrading a course',
|
|
177
|
+
},
|
|
178
|
+
closeAction: {
|
|
179
|
+
id: 'learner-dash.courseCard.banners.closeModal',
|
|
180
|
+
description: 'Close button text for closing upgrade modal',
|
|
181
|
+
defaultMessage: 'Close',
|
|
182
|
+
},
|
|
183
|
+
resumeCourseAction: {
|
|
184
|
+
id: 'learner-dash.courseCard.banners.ResumeCourse',
|
|
185
|
+
description: 'Resume button text for resume course modal',
|
|
186
|
+
defaultMessage: 'Resume Course',
|
|
187
|
+
},
|
|
168
188
|
});
|
|
169
189
|
export default messages;
|
|
170
190
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardBanners/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,kBAAkB,EAAE;QAClB,EAAE,EAAE,oDAAoD;QACxD,WAAW,EAAE,wCAAwC;QACrD,cAAc,EAAE,+CAA+C;KAChE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,mDAAmD;QACvD,WAAW,EAAE,qDAAqD;QAClE,cAAc,EAAE,qBAAqB;KACtC;IACD,cAAc,EAAE;QACd,EAAE,EAAE,uDAAuD;QAC3D,WAAW,EAAE,wCAAwC;QACrD,cAAc,EAAE,+UAA+U;KAChW;IACD,qBAAqB,EAAE;QACrB,EAAE,EAAE,8DAA8D;QAClE,WAAW,EAAE,wCAAwC;QACrD,cAAc,EAAE,kTAAkT;KACnU;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,iEAAiE;QACrE,WAAW,EAAE,gEAAgE;QAC7E,cAAc,EAAE,kHAAkH;KACnI;IACD,+BAA+B,EAAE;QAC/B,EAAE,EAAE,wEAAwE;QAC5E,WAAW,EAAE,gEAAgE;QAC7E,cAAc,EAAE,mFAAmF;KACpG;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,8CAA8C;QAClD,WAAW,EAAE,+DAA+D;QAC5E,cAAc,EAAE,6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C5D,WAAW,EAAE,0DAA0D;QACvE,cAAc,EAAE,qBAAqB;KACtC;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,sDAAsD;QAC1D,WAAW,EAAE,8CAA8C;QAC3D,cAAc,EAAE,oFAAoF;KACrG;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,kDAAkD;QACtD,WAAW,EAAE,mDAAmD;QAChE,cAAc,EAAE,eAAe;KAChC;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n auditAccessExpired: {\n id: 'learner-dash.courseCard.banners.auditAccessExpired',\n description: 'Audit access expiration banner message',\n defaultMessage: 'Your audit access to this course has expired.',\n },\n findAnotherCourse: {\n id: 'learner-dash.courseCard.banners.findAnotherCourse',\n description: 'Action prompt taking learners to course exploration',\n defaultMessage: 'Find another course',\n },\n certRestricted: {\n id: 'learner-dash.courseCard.banners.certificateRestricted',\n description: 'Restricted certificate warning message',\n defaultMessage: 'Your Certificate of Achievement is being held pending confirmation that the issuance of your Certificate is in compliance with strict U.S. embargoes on Iran, Cuba, Syria, and Sudan. If you think our system has mistakenly identified you as being connected with one of those countries, please let us know by contacting {supportEmail}.',\n },\n certRestrictedNoEmail: {\n id: 'learner-dash.courseCard.banners.certificateRestrictedNoEmail',\n description: 'Restricted certificate warning message',\n defaultMessage: 'Your Certificate of Achievement is being held pending confirmation that the issuance of your Certificate is in compliance with strict U.S. embargoes on Iran, Cuba, Syria, and Sudan. If you think our system has mistakenly identified you as being connected with one of those countries, please let us know.',\n },\n certRefundContactBilling: {\n id: 'learner-dash.courseCard.banners.certificateRefundContactBilling',\n description: 'Message to learners to contact billing for certificate refunds',\n defaultMessage: 'If you would like a refund on your Certificate of Achievement, please contact our billing address {billingEmail}',\n },\n certRefundContactBillingNoEmail: {\n id: 'learner-dash.courseCard.banners.certificateRefundContactBillingNoEmail',\n description: 'Message to learners to contact billing for certificate refunds',\n defaultMessage: 'If you would like a refund on your Certificate of Achievement, please contact us.',\n },\n passingGrade: {\n id: 'learner-dash.courseCard.banners.passingGrade',\n description: 'Message to learners with minimum passing grade for the course',\n defaultMessage: 'Grade required to pass the course: {minPassingGrade}\\u200f%',\n },\n notEligibleForCert: {\n id: 'learner-dash.courseCard.banners.notEligibleForCert',\n description: 'Certificate inelligibility message',\n defaultMessage: 'You are not eligible for a certificate.',\n },\n viewGrades: {\n id: 'learner-dash.courseCard.banners.viewGrades',\n description: 'Gradses link text',\n defaultMessage: 'View grades.',\n },\n certReady: {\n id: 'learner-dash.courseCard.banners.certReady',\n description: 'Certificate ready message',\n defaultMessage: 'Congratulations. Your certificate is ready.',\n },\n viewCertificate: {\n id: 'learner-dash.courseCard.banners.viewCertificate',\n description: 'Certificate link text',\n defaultMessage: 'View certificate',\n },\n certMinGrade: {\n id: 'learner-dash.courseCard.banners.certMinGrade',\n description: 'Passing grade requirement message',\n defaultMessage: 'Grade required for a certificate: {minPassingGrade}\\u200f%',\n },\n downloadCertificate: {\n id: 'learner-dash.courseCard.banners.downloadCertificate',\n description: 'Certificate download link text',\n defaultMessage: 'Download Certificate.',\n },\n gradeAndCertReadyAfter: {\n id: 'learner-dash.courseCard.banners.gradseAndCertReadyAfter',\n description: 'Grade and certificate availability date message',\n defaultMessage: 'Your grade and certificate will be ready after {availableDate}.',\n },\n entitlementUnavailable: {\n id: 'learner-dash.courseCard.banners.entitlementUnavailable',\n description: 'Entitlement course message when no sessions are available',\n defaultMessage: 'There are no sessions available at the moment. The course team will create new sessions soon. If no sessions appear, please contact {emailLink} for information.',\n },\n entitlementExpiringSoon: {\n id: 'learner-dash.courseCard.banners.entitlementExpiringSoon',\n description: 'Entitlement course message when the entitlement is expiring soon.',\n defaultMessage: 'You must {selectSessionButton} by {changeDeadline} to access the course.',\n },\n entitlementExpired: {\n id: 'learner-dash.courseCard.banners.entitlementExpired',\n description: 'Entitlement course message when the entitlement is expired.',\n defaultMessage: 'You can no longer change sessions.',\n },\n selectSession: {\n id: 'learner-dash.courseCard.banners.selectSession',\n description: 'Entitlement session selection link text',\n defaultMessage: 'select a session',\n },\n prerequisitesNotMet: {\n id: 'learner-dash.courseCard.banners.prerequisitesNotMet',\n description: 'Message to learners with unmet prerequisites',\n defaultMessage: 'You can\\'t access this course just yet because you have not met the pre-requisites.',\n },\n courseHasNotStarted: {\n id: 'learner-dash.courseCard.banners.courseHasNotStarted',\n description: 'Course has not started message',\n defaultMessage: 'You can\\'t access this course just yet because the course hasn\\'t started yet. The course will start on {startDate}.',\n },\n redeem: {\n id: 'learner-dash.courseCard.banners.redeem',\n description: 'Redeem link text',\n defaultMessage: 'Redeem',\n },\n subscriptionUpgradeBannerText: {\n id: 'learner-dash.courseCard.banners.subscriptionUpgradeBannerText',\n description: 'Banner text for subscription courses where audit access has expired',\n defaultMessage: 'This course is included in your subscription. Upgrade to get full course access.',\n },\n subscriptionRedeemBannerText: {\n id: 'learner-dash.courseCard.banners.subscriptionRedeemBannerText',\n description: 'Banner text for subscription courses where audit access has expired',\n defaultMessage: 'This course is included in your subscription. Redeem to get full course access.',\n },\n upgradeAction: {\n id: 'learner-dash.courseCard.banners.upgradeAction',\n description: 'Upgrade button text for subscription upgrade banner',\n defaultMessage: 'Upgrade',\n },\n verifiedBannerText: {\n id: 'learner-dash.courseCard.banners.verifiedBannerText',\n description: 'Banner text for verified courses',\n defaultMessage: 'You passed this course on {date} and earned a verified certificate.',\n },\n completedAndPassedBannerText: {\n id: 'learner-dash.courseCard.banners.completedAndPassedBannerText',\n description: 'Banner text for completed and passed courses',\n defaultMessage: 'You completed and passed this course on {date}.',\n },\n congratulationsText: {\n id: 'learner-dash.courseCard.banners.congratulationsText',\n description: 'Congratulations text for verified courses',\n defaultMessage: 'Congratulations!',\n },\n courseCompletedBannerText: {\n id: 'learner-dash.courseCard.banners.courseCompletedBannerText',\n description: 'Course completed banner text for verified courses',\n defaultMessage: 'You completed this course on {date}.',\n },\n viewGradesText: {\n id: 'learner-dash.courseCard.banners.viewGradesText',\n description: 'View grades link text for verified courses',\n defaultMessage: 'View grades',\n },\n viewCourseDetailBannerText: {\n id: 'learner-dash.courseCard.banners.viewCourseDetailBannerText',\n description: 'View course detail banner text for verified courses',\n defaultMessage: 'Enroll in a new course-run with your subscription.',\n },\n viewCourseDetailAction: {\n id: 'learner-dash.courseCard.banners.viewCourseDetailAction',\n description: 'View course detail action link text for verified courses',\n defaultMessage: 'View course details',\n },\n findCourseBannerText: {\n id: 'learner-dash.courseCard.banners.findCourseBannerText',\n description: 'Find course banner text for verified courses',\n defaultMessage: 'This course-run is no longer available. Enroll in a new session or similar course.',\n },\n findCourseAction: {\n id: 'learner-dash.courseCard.banners.findCourseAction',\n description: 'Find course action link text for verified courses',\n defaultMessage: 'Find a course',\n },\n});\n\nexport default messages;\n"]}
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardBanners/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,kBAAkB,EAAE;QAClB,EAAE,EAAE,oDAAoD;QACxD,WAAW,EAAE,wCAAwC;QACrD,cAAc,EAAE,+CAA+C;KAChE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,mDAAmD;QACvD,WAAW,EAAE,qDAAqD;QAClE,cAAc,EAAE,qBAAqB;KACtC;IACD,cAAc,EAAE;QACd,EAAE,EAAE,uDAAuD;QAC3D,WAAW,EAAE,wCAAwC;QACrD,cAAc,EACZ,+UAA+U;KAClV;IACD,qBAAqB,EAAE;QACrB,EAAE,EAAE,8DAA8D;QAClE,WAAW,EAAE,wCAAwC;QACrD,cAAc,EACZ,kTAAkT;KACrT;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,iEAAiE;QACrE,WAAW,EACT,gEAAgE;QAClE,cAAc,EACZ,kHAAkH;KACrH;IACD,+BAA+B,EAAE;Q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,aAAa;KAC9B;IACD,0BAA0B,EAAE;QAC1B,EAAE,EAAE,4DAA4D;QAChE,WAAW,EAAE,qDAAqD;QAClE,cAAc,EAAE,oDAAoD;KACrE;IACD,sBAAsB,EAAE;QACtB,EAAE,EAAE,wDAAwD;QAC5D,WAAW,EAAE,0DAA0D;QACvE,cAAc,EAAE,qBAAqB;KACtC;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,sDAAsD;QAC1D,WAAW,EAAE,8CAA8C;QAC3D,cAAc,EACZ,oFAAoF;KACvF;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,kDAAkD;QACtD,WAAW,EAAE,mDAAmD;QAChE,cAAc,EAAE,eAAe;KAChC;IACD,yBAAyB,EAAE;QACzB,cAAc,EAAE,4CAA4C;QAC5D,EAAE,EAAE,uDAAuD;QAC3D,WAAW,EAAE,mDAAmD;KACjE;IACD,wBAAwB,EAAE;QACxB,cAAc,EAAE,qDAAqD;QACrE,EAAE,EAAE,sDAAsD;QAC1D,WAAW,EAAE,mDAAmD;KACjE;IACD,WAAW,EAAE;QACX,EAAE,EAAE,4CAA4C;QAChD,WAAW,EAAE,6CAA6C;QAC1D,cAAc,EAAE,OAAO;KACxB;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,8CAA8C;QAClD,WAAW,EAAE,4CAA4C;QACzD,cAAc,EAAE,eAAe;KAChC;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n auditAccessExpired: {\n id: 'learner-dash.courseCard.banners.auditAccessExpired',\n description: 'Audit access expiration banner message',\n defaultMessage: 'Your audit access to this course has expired.',\n },\n findAnotherCourse: {\n id: 'learner-dash.courseCard.banners.findAnotherCourse',\n description: 'Action prompt taking learners to course exploration',\n defaultMessage: 'Find another course',\n },\n certRestricted: {\n id: 'learner-dash.courseCard.banners.certificateRestricted',\n description: 'Restricted certificate warning message',\n defaultMessage:\n 'Your Certificate of Achievement is being held pending confirmation that the issuance of your Certificate is in compliance with strict U.S. embargoes on Iran, Cuba, Syria, and Sudan. If you think our system has mistakenly identified you as being connected with one of those countries, please let us know by contacting {supportEmail}.',\n },\n certRestrictedNoEmail: {\n id: 'learner-dash.courseCard.banners.certificateRestrictedNoEmail',\n description: 'Restricted certificate warning message',\n defaultMessage:\n 'Your Certificate of Achievement is being held pending confirmation that the issuance of your Certificate is in compliance with strict U.S. embargoes on Iran, Cuba, Syria, and Sudan. If you think our system has mistakenly identified you as being connected with one of those countries, please let us know.',\n },\n certRefundContactBilling: {\n id: 'learner-dash.courseCard.banners.certificateRefundContactBilling',\n description:\n 'Message to learners to contact billing for certificate refunds',\n defaultMessage:\n 'If you would like a refund on your Certificate of Achievement, please contact our billing address {billingEmail}',\n },\n certRefundContactBillingNoEmail: {\n id: 'learner-dash.courseCard.banners.certificateRefundContactBillingNoEmail',\n description:\n 'Message to learners to contact billing for certificate refunds',\n defaultMessage:\n 'If you would like a refund on your Certificate of Achievement, please contact us.',\n },\n passingGrade: {\n id: 'learner-dash.courseCard.banners.passingGrade',\n description:\n 'Message to learners with minimum passing grade for the course',\n defaultMessage:\n 'Grade required to pass the course: {minPassingGrade}\\u200f%',\n },\n notEligibleForCert: {\n id: 'learner-dash.courseCard.banners.notEligibleForCert',\n description: 'Certificate inelligibility message',\n defaultMessage: 'You are not eligible for a certificate.',\n },\n viewGrades: {\n id: 'learner-dash.courseCard.banners.viewGrades',\n description: 'Gradses link text',\n defaultMessage: 'View grades.',\n },\n certReady: {\n id: 'learner-dash.courseCard.banners.certReady',\n description: 'Certificate ready message',\n defaultMessage: 'Congratulations. Your certificate is ready.',\n },\n viewCertificate: {\n id: 'learner-dash.courseCard.banners.viewCertificate',\n description: 'Certificate link text',\n defaultMessage: 'View certificate',\n },\n certMinGrade: {\n id: 'learner-dash.courseCard.banners.certMinGrade',\n description: 'Passing grade requirement message',\n defaultMessage:\n 'Grade required for a certificate: {minPassingGrade}\\u200f%',\n },\n downloadCertificate: {\n id: 'learner-dash.courseCard.banners.downloadCertificate',\n description: 'Certificate download link text',\n defaultMessage: 'Download Certificate.',\n },\n gradeAndCertReadyAfter: {\n id: 'learner-dash.courseCard.banners.gradseAndCertReadyAfter',\n description: 'Grade and certificate availability date message',\n defaultMessage:\n 'Your grade and certificate will be ready after {availableDate}.',\n },\n entitlementUnavailable: {\n id: 'learner-dash.courseCard.banners.entitlementUnavailable',\n description: 'Entitlement course message when no sessions are available',\n defaultMessage:\n 'There are no sessions available at the moment. The course team will create new sessions soon. If no sessions appear, please contact {emailLink} for information.',\n },\n entitlementExpiringSoon: {\n id: 'learner-dash.courseCard.banners.entitlementExpiringSoon',\n description:\n 'Entitlement course message when the entitlement is expiring soon.',\n defaultMessage:\n 'You must {selectSessionButton} by {changeDeadline} to access the course.',\n },\n entitlementExpired: {\n id: 'learner-dash.courseCard.banners.entitlementExpired',\n description: 'Entitlement course message when the entitlement is expired.',\n defaultMessage: 'You can no longer change sessions.',\n },\n selectSession: {\n id: 'learner-dash.courseCard.banners.selectSession',\n description: 'Entitlement session selection link text',\n defaultMessage: 'select a session',\n },\n prerequisitesNotMet: {\n id: 'learner-dash.courseCard.banners.prerequisitesNotMet',\n description: 'Message to learners with unmet prerequisites',\n defaultMessage:\n \"You can't access this course just yet because you have not met the pre-requisites.\",\n },\n courseHasNotStarted: {\n id: 'learner-dash.courseCard.banners.courseHasNotStarted',\n description: 'Course has not started message',\n defaultMessage:\n \"You can't access this course just yet because the course hasn't started yet. The course will start on {startDate}.\",\n },\n redeem: {\n id: 'learner-dash.courseCard.banners.redeem',\n description: 'Redeem link text',\n defaultMessage: 'Redeem',\n },\n subscriptionUpgradeBannerText: {\n id: 'learner-dash.courseCard.banners.subscriptionUpgradeBannerText',\n description:\n 'Banner text for subscription courses where audit access has expired',\n defaultMessage:\n 'This course is included in your subscription. Upgrade to get full course access.',\n },\n subscriptionRedeemBannerText: {\n id: 'learner-dash.courseCard.banners.subscriptionRedeemBannerText',\n description:\n 'Banner text for subscription courses where audit access has expired',\n defaultMessage:\n 'This course is included in your subscription. Redeem to get full course access.',\n },\n upgradeAction: {\n id: 'learner-dash.courseCard.banners.upgradeAction',\n description: 'Upgrade button text for subscription upgrade banner',\n defaultMessage: 'Upgrade',\n },\n verifiedBannerText: {\n id: 'learner-dash.courseCard.banners.verifiedBannerText',\n description: 'Banner text for verified courses',\n defaultMessage:\n 'You passed this course on {date} and earned a verified certificate.',\n },\n completedAndPassedBannerText: {\n id: 'learner-dash.courseCard.banners.completedAndPassedBannerText',\n description: 'Banner text for completed and passed courses',\n defaultMessage: 'You completed and passed this course on {date}.',\n },\n congratulationsText: {\n id: 'learner-dash.courseCard.banners.congratulationsText',\n description: 'Congratulations text for verified courses',\n defaultMessage: 'Congratulations!',\n },\n courseCompletedBannerText: {\n id: 'learner-dash.courseCard.banners.courseCompletedBannerText',\n description: 'Course completed banner text for verified courses',\n defaultMessage: 'You completed this course on {date}.',\n },\n viewGradesText: {\n id: 'learner-dash.courseCard.banners.viewGradesText',\n description: 'View grades link text for verified courses',\n defaultMessage: 'View grades',\n },\n viewCourseDetailBannerText: {\n id: 'learner-dash.courseCard.banners.viewCourseDetailBannerText',\n description: 'View course detail banner text for verified courses',\n defaultMessage: 'Enroll in a new course-run with your subscription.',\n },\n viewCourseDetailAction: {\n id: 'learner-dash.courseCard.banners.viewCourseDetailAction',\n description: 'View course detail action link text for verified courses',\n defaultMessage: 'View course details',\n },\n findCourseBannerText: {\n id: 'learner-dash.courseCard.banners.findCourseBannerText',\n description: 'Find course banner text for verified courses',\n defaultMessage:\n 'This course-run is no longer available. Enroll in a new session or similar course.',\n },\n findCourseAction: {\n id: 'learner-dash.courseCard.banners.findCourseAction',\n description: 'Find course action link text for verified courses',\n defaultMessage: 'Find a course',\n },\n upgradeCourseCompleteText: {\n defaultMessage: 'You now have full course access to {title}',\n id: 'learner-dash.courseCard.banners.upgrade.complete.text',\n description: 'text to display when a user has upgraded a course',\n },\n upgradeCourseloadingText: {\n defaultMessage: 'We are upgrading your course to the verified track.',\n id: 'learner-dash.courseCard.banners.upgrade.loading.text',\n description: 'text to display when a user is upgrading a course',\n },\n closeAction: {\n id: 'learner-dash.courseCard.banners.closeModal',\n description: 'Close button text for closing upgrade modal',\n defaultMessage: 'Close',\n },\n resumeCourseAction: {\n id: 'learner-dash.courseCard.banners.ResumeCourse',\n description: 'Resume button text for resume course modal',\n defaultMessage: 'Resume Course',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { Spinner } from '@openedx/paragon';
|
|
4
3
|
import hooks from './hooks';
|
|
5
|
-
export const LoadingView = () => {
|
|
4
|
+
export const LoadingView = ({ variant }) => {
|
|
6
5
|
const { spinnerScreenReaderText } = hooks.useDashboardMessages();
|
|
7
|
-
return (_jsx("div", { className: "course-list-loading", children: _jsx(Spinner, { animation: "border", className: "mie-3", screenReaderText: spinnerScreenReaderText }) }));
|
|
6
|
+
return (_jsx("div", { className: "course-list-loading", children: _jsx(Spinner, { variant: variant, animation: "border", className: "mie-3", screenReaderText: spinnerScreenReaderText }) }));
|
|
8
7
|
};
|
|
9
8
|
export default LoadingView;
|
|
10
9
|
//# sourceMappingURL=LoadingView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingView.js","sourceRoot":"","sources":["../../../src/containers/Dashboard/LoadingView.
|
|
1
|
+
{"version":3,"file":"LoadingView.js","sourceRoot":"","sources":["../../../src/containers/Dashboard/LoadingView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,MAAM,SAAS,CAAC;AAM5B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,OAAO,EAAoB,EAAE,EAAE;IAC3D,MAAM,EAAE,uBAAuB,EAAE,GAAG,KAAK,CAAC,oBAAoB,EAAE,CAAC;IAEjE,OAAO,CACL,cAAK,SAAS,EAAC,qBAAqB,YAClC,KAAC,OAAO,IACN,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,QAAQ,EAClB,SAAS,EAAC,OAAO,EACjB,gBAAgB,EAAE,uBAAuB,GACzC,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { Spinner } from '@openedx/paragon';\nimport hooks from './hooks';\n\ninterface LoadingViewProps {\n variant?: string,\n}\n\nexport const LoadingView = ({ variant }: LoadingViewProps) => {\n const { spinnerScreenReaderText } = hooks.useDashboardMessages();\n\n return (\n <div className=\"course-list-loading\">\n <Spinner\n variant={variant}\n animation=\"border\"\n className=\"mie-3\"\n screenReaderText={spinnerScreenReaderText}\n />\n </div>\n );\n};\n\nexport default LoadingView;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useIntl } from '@openedx/frontend-base';
|
|
3
3
|
import { Card, Hyperlink, Icon } from '@openedx/paragon';
|
|
4
|
-
import { Timelapse, Speed } from '@openedx/paragon/icons';
|
|
4
|
+
import { Timelapse, Speed, FormatListNumbered } from '@openedx/paragon/icons';
|
|
5
5
|
import './index.scss';
|
|
6
6
|
import cardFallbackImg from '@openedx/brand-openedx/paragon/images/card-imagecap-fallback.png';
|
|
7
7
|
import messages from './messages';
|
|
@@ -20,6 +20,7 @@ const getIdentifyingUrlPath = (marketingUrl) => {
|
|
|
20
20
|
export const ProductCard = ({ item, isLoading }) => {
|
|
21
21
|
const { formatMessage } = useIntl();
|
|
22
22
|
const identifyingUrlPath = getIdentifyingUrlPath(item.marketing_url);
|
|
23
|
-
|
|
23
|
+
const totalProgramCourses = item.product === 'program' && item.subject && item.subject.length ? item.subject.length : 0;
|
|
24
|
+
return (_jsxs(Card, { className: "shadow-sm d-flex flex-column rounded w-100 overflow-hidden align-items-stretch card-container", variant: "light", "data-testid": "product-card", isLoading: isLoading, as: identifyingUrlPath ? Hyperlink : 'div', destination: identifyingUrlPath ? `/subscription-enroll/${identifyingUrlPath}` : undefined, children: [_jsx(Card.Header, { title: item.product === 'program' ? `${item.content_type}` : 'Course', className: "pb-2 pt-2 bg-light-500 text-primary-500 content-type", size: "xs" }), _jsx("div", { className: "position-relative image-container", children: _jsx(Card.ImageCap, { src: item.url || cardFallbackImg, srcAlt: `${item.title} main-image`, "data-testid": "product-card-image", logoSrc: item.thumbnail || '', logoAlt: `${item.title} thumbnail-image` }) }), _jsx(Card.Header, { title: item.title, subtitle: item.partner, size: "sm", className: "product-card-title" }), _jsxs(Card.Section, { className: "d-flex flex-column flex-grow-1 overflow-hidden mt-5", children: [totalProgramCourses > 0 ? (_jsxs("span", { className: "d-flex align-items-center mb-2", children: [_jsx(Icon, { src: FormatListNumbered, className: "mr-2" }), _jsx("span", { children: formatMessage(messages.courses, { count: totalProgramCourses }) })] })) : null, typeof item.weeks_to_complete === 'number' && (_jsxs("span", { className: "d-flex align-items-center mb-2", children: [_jsx(Icon, { src: Timelapse, className: "mr-2" }), _jsx("span", { children: formatMessage(messages.weeksToComplete, { count: item.weeks_to_complete }) })] })), item.level ? (_jsxs("span", { className: `d-flex align-items-center${typeof item.weeks_to_complete === 'number' ? ' mt-3' : ''}`, children: [_jsx(Icon, { src: Speed, className: "mr-2" }), _jsx("span", { children: formatMessage(messages.level, { level: item.level }) })] })) : null] })] }));
|
|
24
25
|
};
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/ProductCard/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE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,GAAQ,IACzE,CACR,CAAC,CAAC,CAAC,IAAI,EACP,OAAO,IAAI,CAAC,iBAAiB,KAAK,QAAQ,IAAI,CAC7C,gBAAM,SAAS,EAAC,gCAAgC,aAC9C,KAAC,IAAI,IAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,GAAG,EACzC,yBAAO,aAAa,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,GAAQ,IACpF,CACR,EACA,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACZ,gBAAM,SAAS,EAAE,4BAA4B,OAAO,IAAI,CAAC,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,aACtG,KAAC,IAAI,IAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,MAAM,GAAG,EACrC,yBAAO,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,GAAQ,IAC9D,CACR,CAAC,CAAC,CAAC,IAAI,IACK,IAEV,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport { Card, Hyperlink, Icon } from '@openedx/paragon';\nimport { Timelapse, Speed, FormatListNumbered } from '@openedx/paragon/icons';\nimport './index.scss';\nimport cardFallbackImg from '@openedx/brand-openedx/paragon/images/card-imagecap-fallback.png';\nimport { ProductCardProps } from './data/types';\nimport messages from './messages';\n\nconst getIdentifyingUrlPath = (marketingUrl: string): string | null => {\n if (!marketingUrl) {\n return null;\n }\n try {\n const path = new URL(marketingUrl, window.location.origin).pathname.replace(/^\\//, '');\n return path || null;\n } catch {\n return null;\n }\n};\n\nexport const ProductCard: FC<ProductCardProps> = ({ item, isLoading }) => {\n const { formatMessage } = useIntl();\n const identifyingUrlPath = getIdentifyingUrlPath(item.marketing_url);\n const totalProgramCourses = item.product === 'program' && item.subject && item.subject.length ? item.subject.length : 0;\n\n return (\n <Card\n className=\"shadow-sm d-flex flex-column rounded w-100 overflow-hidden align-items-stretch card-container\"\n variant=\"light\"\n data-testid=\"product-card\"\n isLoading={isLoading}\n as={identifyingUrlPath ? Hyperlink : 'div'}\n destination={identifyingUrlPath ? `/subscription-enroll/${identifyingUrlPath}` : undefined}\n >\n <Card.Header title={item.product === 'program' ? `${item.content_type}` : 'Course'} className=\"pb-2 pt-2 bg-light-500 text-primary-500 content-type\" size=\"xs\" />\n\n <div className=\"position-relative image-container\">\n <Card.ImageCap\n src={item.url || cardFallbackImg}\n srcAlt={`${item.title} main-image`}\n data-testid=\"product-card-image\"\n logoSrc={item.thumbnail || ''}\n logoAlt={`${item.title} thumbnail-image`}\n />\n </div>\n\n <Card.Header title={item.title} subtitle={item.partner} size=\"sm\" className=\"product-card-title\" />\n\n <Card.Section className=\"d-flex flex-column flex-grow-1 overflow-hidden mt-5\">\n {totalProgramCourses > 0 ? (\n <span className=\"d-flex align-items-center mb-2\">\n <Icon src={FormatListNumbered} className=\"mr-2\" />\n <span>{formatMessage(messages.courses, { count: totalProgramCourses })}</span>\n </span>\n ) : null}\n {typeof item.weeks_to_complete === 'number' && (\n <span className=\"d-flex align-items-center mb-2\">\n <Icon src={Timelapse} className=\"mr-2\" />\n <span>{formatMessage(messages.weeksToComplete, { count: item.weeks_to_complete })}</span>\n </span>\n )}\n {item.level ? (\n <span className={`d-flex align-items-center${typeof item.weeks_to_complete === 'number' ? ' mt-3' : ''}`}>\n <Icon src={Speed} className=\"mr-2\" />\n <span>{formatMessage(messages.level, { level: item.level })}</span>\n </span>\n ) : null}\n </Card.Section>\n\n </Card>\n );\n};\n"]}
|
|
@@ -10,6 +10,11 @@ const messages = defineMessages({
|
|
|
10
10
|
defaultMessage: '{level} level',
|
|
11
11
|
description: 'Label for the level field',
|
|
12
12
|
},
|
|
13
|
+
courses: {
|
|
14
|
+
id: 'subs-dash.courses.label',
|
|
15
|
+
defaultMessage: '{count, plural, one {# course} other {# courses}}',
|
|
16
|
+
description: 'Label for the courses field',
|
|
17
|
+
},
|
|
13
18
|
});
|
|
14
19
|
export default messages;
|
|
15
20
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/containers/ProductCard/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,eAAe,EAAE;QACf,EAAE,EAAE,iCAAiC;QACrC,cAAc,EAAE,uEAAuE;QACvF,WAAW,EAAE,uCAAuC;KACrD;IACD,KAAK,EAAE;QACL,EAAE,EAAE,uBAAuB;QAC3B,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,2BAA2B;KACzC;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n weeksToComplete: {\n id: 'subs-dash.weeksToComplete.label',\n defaultMessage: '{count, plural, one {# week to complete} other {# weeks to complete}}',\n description: 'Label for the weeks to complete field',\n },\n level: {\n id: 'subs-dash.level.label',\n defaultMessage: '{level} level',\n description: 'Label for the level field',\n },\n});\n\nexport default messages;\n"]}
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/containers/ProductCard/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,eAAe,EAAE;QACf,EAAE,EAAE,iCAAiC;QACrC,cAAc,EAAE,uEAAuE;QACvF,WAAW,EAAE,uCAAuC;KACrD;IACD,KAAK,EAAE;QACL,EAAE,EAAE,uBAAuB;QAC3B,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,2BAA2B;KACzC;IACD,OAAO,EAAE;QACP,EAAE,EAAE,yBAAyB;QAC7B,cAAc,EAAE,mDAAmD;QACnE,WAAW,EAAE,6BAA6B;KAC3C;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n weeksToComplete: {\n id: 'subs-dash.weeksToComplete.label',\n defaultMessage: '{count, plural, one {# week to complete} other {# weeks to complete}}',\n description: 'Label for the weeks to complete field',\n },\n level: {\n id: 'subs-dash.level.label',\n defaultMessage: '{level} level',\n description: 'Label for the level field',\n },\n courses: {\n id: 'subs-dash.courses.label',\n defaultMessage: '{count, plural, one {# course} other {# courses}}',\n description: 'Label for the courses field',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Link } from 'react-router-dom';
|
|
3
|
-
import { breakpoints, useWindowSize, Card,
|
|
3
|
+
import { breakpoints, useWindowSize, Card, } from '@openedx/paragon';
|
|
4
4
|
import programCardFallbackImage from '../assets/program-card-fallback.svg';
|
|
5
5
|
import ProgressCategoryBubbles from './ProgressCategoryBubbles';
|
|
6
6
|
const ProgramListCard = ({ program, }) => {
|
|
@@ -36,7 +36,7 @@ const ProgramListCard = ({ program, }) => {
|
|
|
36
36
|
}
|
|
37
37
|
return '';
|
|
38
38
|
};
|
|
39
|
-
return (_jsxs(Card, { className: "program-list-card mb-4 mr-4", isClickable: true, as: Link, to: `/subscription-program-progress/${program.uuid}`, "data-testid": "program-list-card", children: [_jsx(Card.ImageCap, { src: getBannerImageURL() || programCardFallbackImage, srcAlt: `program card image for ${program.title}`, logoSrc: getOrgImageUrl(), logoAlt: program.authoringOrganizations && ((_a = program.authoringOrganizations[0]) === null || _a === void 0 ? void 0 : _a.key), className: "banner-image" }), _jsx(Card.Section, { className: "pb-0
|
|
39
|
+
return (_jsxs(Card, { className: "program-list-card mb-4 mr-4", isClickable: true, as: Link, to: `/subscription-program-progress/${program.uuid}`, "data-testid": "program-list-card", children: [_jsx(Card.ImageCap, { src: getBannerImageURL() || programCardFallbackImage, srcAlt: `program card image for ${program.title}`, logoSrc: getOrgImageUrl(), logoAlt: program.authoringOrganizations && ((_a = program.authoringOrganizations[0]) === null || _a === void 0 ? void 0 : _a.key), className: "banner-image" }), _jsx(Card.Section, { className: "pb-0", children: _jsx("h3", { children: program.title }) }), _jsxs(Card.Section, { className: "d-flex flex-column flex-grow-1 overflow-hidden", children: [program.authoringOrganizations && (_jsx("span", { className: "d-flex align-items-center mb-1", children: program.authoringOrganizations.map(org => org.key).join(', ') })), _jsx("span", { className: "d-flex align-items-center program-type", children: program.type })] }), _jsx(Card.Section, { className: "pt-0", children: _jsx(ProgressCategoryBubbles, { inProgress: program.progress.inProgress, notStarted: program.progress.notStarted, completed: program.progress.completed }) })] }));
|
|
40
40
|
};
|
|
41
41
|
export default ProgramListCard;
|
|
42
42
|
//# sourceMappingURL=ProgramListCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgramListCard.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramsList/ProgramListCard.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EACL,WAAW,EACX,aAAa,EACb,IAAI,
|
|
1
|
+
{"version":3,"file":"ProgramListCard.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramsList/ProgramListCard.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EACL,WAAW,EACX,aAAa,EACb,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,wBAAwB,MAAM,qCAAqC,CAAC;AAE3E,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAEhE,MAAM,eAAe,GAA+B,CAAC,EACnD,OAAO,GACR,EAAE,E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vC,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,UAAU,EACvC,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,SAAS,GACrC,GACW,IACV,CACR,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,eAAe,CAAC","sourcesContent":["import React from 'react';\nimport { Link } from 'react-router-dom';\nimport {\n breakpoints,\n useWindowSize,\n Card,\n} from '@openedx/paragon';\nimport programCardFallbackImage from '../assets/program-card-fallback.svg';\nimport { ProgramCardProps } from '../data/types';\nimport ProgressCategoryBubbles from './ProgressCategoryBubbles';\n\nconst ProgramListCard: React.FC<ProgramCardProps> = ({\n program,\n}) => {\n const { width: windowWidth } = useWindowSize();\n\n const getBannerImageURL = (): string => {\n let imageURL = '';\n // We need to check that the breakpoint value exists before using it\n // Otherwise TypeScript will flag it as it can potentially be undefined in Paragon\n if (program.bannerImage && Object.keys(program.bannerImage).length > 0) {\n if (!windowWidth) {\n return program.bannerImage.medium.url;\n }\n\n if (typeof breakpoints.large.minWidth === 'number' && windowWidth >= breakpoints.large.minWidth) {\n imageURL = program.bannerImage.large.url;\n } else if (typeof breakpoints.medium.minWidth === 'number' && windowWidth >= breakpoints.medium.minWidth) {\n imageURL = program.bannerImage.medium.url;\n } else if (typeof breakpoints.small.minWidth === 'number' && windowWidth >= breakpoints.small.minWidth) {\n imageURL = program.bannerImage.small.url;\n } else {\n imageURL = program.bannerImage.xSmall.url;\n }\n }\n return imageURL;\n };\n\n const getOrgImageUrl = (): string => {\n if (program.authoringOrganizations?.length === 1 && program.authoringOrganizations[0].logoImageUrl) {\n return program.authoringOrganizations[0].logoImageUrl;\n }\n return '';\n };\n\n return (\n <Card\n className=\"program-list-card mb-4 mr-4\"\n isClickable\n as={Link}\n to={`/subscription-program-progress/${program.uuid}`}\n data-testid=\"program-list-card\"\n >\n <Card.ImageCap\n src={getBannerImageURL() || programCardFallbackImage}\n srcAlt={`program card image for ${program.title}`}\n logoSrc={getOrgImageUrl()}\n logoAlt={program.authoringOrganizations && program.authoringOrganizations[0]?.key}\n className=\"banner-image\"\n />\n <Card.Section className=\"pb-0\">\n <h3>{program.title}</h3>\n </Card.Section>\n <Card.Section className=\"d-flex flex-column flex-grow-1 overflow-hidden\">\n {program.authoringOrganizations && (\n <span className=\"d-flex align-items-center mb-1\">\n {program.authoringOrganizations.map(org => org.key).join(', ')}\n </span>\n )}\n <span className=\"d-flex align-items-center program-type\">\n {program.type}\n </span>\n </Card.Section>\n <Card.Section className=\"pt-0\">\n <ProgressCategoryBubbles\n inProgress={program.progress.inProgress}\n notStarted={program.progress.notStarted}\n completed={program.progress.completed}\n />\n </Card.Section>\n </Card>\n );\n};\nexport default ProgramListCard;\n"]}
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
// The current Truncate component in Paragon is deprecated and soon to be removed
|
|
2
|
-
// See https://github.com/openedx/paragon/issues/3311 for developments on this issue
|
|
3
|
-
|
|
4
|
-
.truncate-text-1 {
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
display: -webkit-box;
|
|
7
|
-
-webkit-box-orient: vertical;
|
|
8
|
-
-webkit-line-clamp: 1;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.truncate-text-2 {
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
display: -webkit-box;
|
|
14
|
-
-webkit-box-orient: vertical;
|
|
15
|
-
-webkit-line-clamp: 2;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
1
|
.banner-image > .pgn__card-logo-cap {
|
|
19
2
|
width: 12rem;
|
|
20
3
|
height: 4.7rem;
|
|
21
|
-
}
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.program-type {
|
|
7
|
+
font-size: 0.75rem;
|
|
8
|
+
}
|
|
@@ -23,7 +23,7 @@ export const usePopularCoursesAndProgramsData = (searchClient, enabled, productT
|
|
|
23
23
|
queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
24
|
const hits = yield fetchPopularProducts(searchClient, productType, 4);
|
|
25
25
|
return hits.map((hit) => {
|
|
26
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
27
27
|
const hitDetails = hit;
|
|
28
28
|
return {
|
|
29
29
|
objectID: hit.objectID,
|
|
@@ -32,11 +32,12 @@ export const usePopularCoursesAndProgramsData = (searchClient, enabled, productT
|
|
|
32
32
|
url: (_g = (_f = hitDetails.card_image_url) !== null && _f !== void 0 ? _f : hitDetails.image_url) !== null && _g !== void 0 ? _g : '',
|
|
33
33
|
marketing_url: (_h = hitDetails.marketing_url) !== null && _h !== void 0 ? _h : '',
|
|
34
34
|
thumbnail: (_j = hitDetails.organization_logo_override) !== null && _j !== void 0 ? _j : '',
|
|
35
|
-
content_type: (_l = (_k = hitDetails.
|
|
35
|
+
content_type: (_l = (_k = hitDetails.program_type) !== null && _k !== void 0 ? _k : hitDetails.product) !== null && _l !== void 0 ? _l : 'Course',
|
|
36
36
|
product: productType,
|
|
37
37
|
partner: (_m = hitDetails.partner) !== null && _m !== void 0 ? _m : '',
|
|
38
38
|
weeks_to_complete: (_o = hitDetails.weeks_to_complete) !== null && _o !== void 0 ? _o : undefined,
|
|
39
39
|
level: (_p = hitDetails.level) !== null && _p !== void 0 ? _p : undefined,
|
|
40
|
+
subject: (_q = hitDetails.subject) !== null && _q !== void 0 ? _q : undefined,
|
|
40
41
|
};
|
|
41
42
|
});
|
|
42
43
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopularCoursesAndPrograms.js","sourceRoot":"","sources":["../../src/hooks/usePopularCoursesAndPrograms.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AA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c,mCAAI,UAAU,CAAC,SAAS,mCAAI,EAAE;gBAC5D,aAAa,EAAE,MAAA,UAAU,CAAC,aAAa,mCAAI,EAAE;gBAC7C,SAAS,EAAE,MAAA,UAAU,CAAC,0BAA0B,mCAAI,EAAE;gBACtD,YAAY,EAAE,MAAA,MAAA,UAAU,CAAC,YAAY,mCAAI,UAAU,CAAC,OAAO,mCAAI,QAAQ;gBACvE,OAAO,EAAE,WAAW;gBACpB,OAAO,EAAE,MAAA,UAAU,CAAC,OAAO,mCAAI,EAAE;gBACjC,iBAAiB,EAAE,MAAA,UAAU,CAAC,iBAAiB,mCAAI,SAAS;gBAC5D,KAAK,EAAE,MAAA,UAAU,CAAC,KAAK,mCAAI,SAAS;gBACpC,OAAO,EAAE,MAAA,UAAU,CAAC,OAAO,mCAAI,SAAS;aACzC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAA;IACD,OAAO,EAAE,CAAC,CAAC,YAAY,IAAI,OAAO;IAClC,SAAS,EAAE,IAAI,GAAG,EAAE,GAAG,EAAE;CAC1B,CAAC,CAAC","sourcesContent":["import { useQuery, UseQueryResult } from '@tanstack/react-query';\nimport { SearchClient } from 'algoliasearch';\nimport { ProductType } from '@src/types/types';\nimport { PRODUCT_TYPE_COURSE } from '@src/constants';\nimport { fetchPopularProducts } from '@src/utils/algoliaUtils';\nimport { ProductCardItem } from '@src/containers/ProductCard/data/types';\n\n// ─── Query key factories ──────────────────────────────────────────────────────\n// Centralised so cache invalidation is never a typo\n\nexport const searchKeys = {\n all: ['search'] as const,\n programs: (query: string, tags: string[]) =>\n [...searchKeys.all, 'programs', query, tags] as const,\n courses: (query: string, tags: string[], page: number) =>\n [...searchKeys.all, 'courses', query, tags, page] as const,\n popular: (productType: ProductType, limit: number) =>\n [...searchKeys.all, 'popular', productType, limit] as const,\n};\n\nexport const usePopularCoursesAndProgramsData = (\n searchClient: SearchClient | null,\n enabled: boolean,\n productType: ProductType = PRODUCT_TYPE_COURSE\n): UseQueryResult<ProductCardItem[]> =>\n useQuery({\n queryKey: searchKeys.popular(productType, 4),\n queryFn: async () => {\n const hits = await fetchPopularProducts(searchClient!, productType, 4);\n return hits.map((hit): ProductCardItem => {\n const hitDetails = hit as {\n short_description?: string,\n primary_description?: string,\n description?: string,\n marketing_url?: string,\n image_url?: string,\n card_image_url?: string,\n organization_logo_override?: string,\n content_type?: string,\n program_type?: string,\n product?: string,\n partner?: string,\n weeks_to_complete?: number,\n level?: string,\n subject?: string,\n };\n\n return {\n objectID: hit.objectID,\n title: hit.title ?? hit.name ?? 'Untitled',\n primary_description: hitDetails.primary_description ?? hitDetails.short_description ?? hitDetails.description ?? '',\n url: hitDetails.card_image_url ?? hitDetails.image_url ?? '',\n marketing_url: hitDetails.marketing_url ?? '',\n thumbnail: hitDetails.organization_logo_override ?? '',\n content_type: hitDetails.program_type ?? hitDetails.product ?? 'Course',\n product: productType,\n partner: hitDetails.partner ?? '',\n weeks_to_complete: hitDetails.weeks_to_complete ?? undefined,\n level: hitDetails.level ?? undefined,\n subject: hitDetails.subject ?? undefined,\n };\n });\n },\n enabled: !!searchClient && enabled,\n staleTime: 1000 * 60 * 10,\n });\n"]}
|