@edx/frontend-app-subscription-learner-dashboard 1.8.4 → 1.9.0
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/containers/ProgramDashboard/ProgramProgress/CompletedTabData/CompletedRecordBanner/index.d.ts +3 -0
- package/dist/containers/ProgramDashboard/ProgramProgress/CompletedTabData/CompletedRecordBanner/index.js +11 -0
- package/dist/containers/ProgramDashboard/ProgramProgress/CompletedTabData/CompletedRecordBanner/index.js.map +1 -0
- package/dist/containers/ProgramDashboard/ProgramProgress/CompletedTabData/CompletedRecordBanner/index.scss +3 -0
- package/dist/containers/ProgramDashboard/ProgramProgress/CompletedTabData/index.d.ts +2 -0
- package/dist/containers/ProgramDashboard/ProgramProgress/CompletedTabData/index.js +27 -0
- package/dist/containers/ProgramDashboard/ProgramProgress/CompletedTabData/index.js.map +1 -0
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgramProgress.js +2 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgramProgress.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgramProgressInfo.js +2 -2
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgramProgressInfo.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgramProgressTabs/index.js +2 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgramProgressTabs/index.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCard/index.js +9 -13
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCard/index.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/ProgressCardButton.d.ts +3 -0
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/ProgressCardButton.js +9 -0
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/ProgressCardButton.js.map +1 -0
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/index.d.ts +2 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/index.js +9 -5
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/index.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/RemainingTabData/index.js +13 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/RemainingTabData/index.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/UpgradeButton/UpgradeAllButton.js +4 -7
- package/dist/containers/ProgramDashboard/ProgramProgress/UpgradeButton/UpgradeAllButton.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/messages.d.ts +37 -2
- package/dist/containers/ProgramDashboard/ProgramProgress/messages.js +43 -8
- package/dist/containers/ProgramDashboard/ProgramProgress/messages.js.map +1 -1
- package/dist/data/services/subs/urls.js +1 -1
- package/dist/data/services/subs/urls.js.map +1 -1
- package/dist/utils/dateFormatter.d.ts +1 -1
- package/dist/utils/dateFormatter.js +2 -2
- package/dist/utils/dateFormatter.js.map +1 -1
- package/package.json +2 -2
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/ViewCourseDetailButton.d.ts +0 -2
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/ViewCourseDetailButton.js +0 -9
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/ViewCourseDetailButton.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
3
|
+
import { Card, Button, Row, Col, Icon } from '@openedx/paragon';
|
|
4
|
+
import { OpenInNew } from '@openedx/paragon/icons';
|
|
5
|
+
import messages from '../../messages';
|
|
6
|
+
import './index.scss';
|
|
7
|
+
export const CompletedRecordBanner = () => {
|
|
8
|
+
const { formatMessage } = useIntl();
|
|
9
|
+
return (_jsx(Card, { className: "mb-3 mt-4 completed-banner-card", "data-testid": "completed-banner-card", children: _jsxs(Card.Section, { className: "pt-3 pb-3 px-4 border-top", children: [_jsx(Row, { children: _jsxs(Col, { xs: 12, children: [_jsx("h5", { className: "mb-1 font-weight-bold", children: formatMessage(messages.programProgressCompletedBannerTitle) }), _jsx("div", { className: "text-muted", children: formatMessage(messages.programProgressCompletedBannerDescription) })] }) }), _jsx(Row, { className: "mt-3", children: _jsxs(Col, { xs: 12, className: "d-flex justify-content-end", children: [_jsxs(Button, { variant: "outline-primary", className: "mr-2 d-flex align-items-center", children: [formatMessage(messages.programProgressCompletedBannerHelpCenterButton), _jsx(Icon, { src: OpenInNew, className: "ml-1" })] }), _jsx(Button, { variant: "primary", children: formatMessage(messages.programProgressCompletedBannerMyProgramRecordsButton) })] }) })] }) }));
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/containers/ProgramDashboard/ProgramProgress/CompletedTabData/CompletedRecordBanner/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,qBAAqB,GAAO,GAAG,EAAE;IAC5C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,KAAC,IAAI,IAAC,SAAS,EAAC,iCAAiC,iBAAa,uBAAuB,YACnF,MAAC,IAAI,CAAC,OAAO,IAAC,SAAS,EAAC,2BAA2B,aACjD,KAAC,GAAG,cACF,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,aACT,aAAI,SAAS,EAAC,uBAAuB,YAAE,aAAa,CAAC,QAAQ,CAAC,mCAAmC,CAAC,GAAM,EACxG,cAAK,SAAS,EAAC,YAAY,YACxB,aAAa,CAAC,QAAQ,CAAC,yCAAyC,CAAC,GAC9D,IACF,GACF,EAEN,KAAC,GAAG,IAAC,SAAS,EAAC,MAAM,YACnB,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,4BAA4B,aAKjD,MAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,SAAS,EAAC,gCAAgC,aACzE,aAAa,CAAC,QAAQ,CAAC,8CAA8C,CAAC,EACvE,KAAC,IAAI,IAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,GAAG,IAClC,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,YAAE,aAAa,CAAC,QAAQ,CAAC,oDAAoD,CAAC,GAAU,IAC7G,GACF,IACO,GACV,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport { Card, Button, Row, Col, Icon } from '@openedx/paragon';\nimport { OpenInNew } from '@openedx/paragon/icons';\n\nimport messages from '../../messages';\nimport './index.scss';\n\nexport const CompletedRecordBanner: FC = () => {\n const { formatMessage } = useIntl();\n\n return (\n <Card className=\"mb-3 mt-4 completed-banner-card\" data-testid=\"completed-banner-card\">\n <Card.Section className=\"pt-3 pb-3 px-4 border-top\">\n <Row>\n <Col xs={12}>\n <h5 className=\"mb-1 font-weight-bold\">{formatMessage(messages.programProgressCompletedBannerTitle)}</h5>\n <div className=\"text-muted\">\n {formatMessage(messages.programProgressCompletedBannerDescription)}\n </div>\n </Col>\n </Row>\n\n <Row className=\"mt-3\">\n <Col xs={12} className=\"d-flex justify-content-end\">\n {/**\n * TODO: The buttons shown here do not do anything at the moment but are meant to link to the help center and the program records page respectively.\n * ACTION ITEM: Wire these buttons to the Help Center and Program Records URLs once they are available.\n */}\n <Button variant=\"outline-primary\" className=\"mr-2 d-flex align-items-center\">\n {formatMessage(messages.programProgressCompletedBannerHelpCenterButton)}\n <Icon src={OpenInNew} className=\"ml-1\" />\n </Button>\n <Button variant=\"primary\">{formatMessage(messages.programProgressCompletedBannerMyProgramRecordsButton)}</Button>\n </Col>\n </Row>\n </Card.Section>\n </Card>\n );\n};\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useProgressData } from '../../../../hooks';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import { ProgressCard } from '../ProgressCard';
|
|
5
|
+
import messages from '../messages';
|
|
6
|
+
import { CompletedRecordBanner } from './CompletedRecordBanner';
|
|
7
|
+
export const CompletedTabData = () => {
|
|
8
|
+
const { programProgressData, isLoading } = useProgressData();
|
|
9
|
+
const { formatMessage } = useIntl();
|
|
10
|
+
const courseData = programProgressData === null || programProgressData === void 0 ? void 0 : programProgressData.courseData;
|
|
11
|
+
const completedData = (courseData === null || courseData === void 0 ? void 0 : courseData.completed) || [];
|
|
12
|
+
const buildProgressCard = () => (completedData.map((course) => {
|
|
13
|
+
const courseRuns = course.courseRuns || [];
|
|
14
|
+
const [{ pacingType = '', start = '', end = '', certificateUrl = '', courseUrl = '' } = {}] = Array.isArray(courseRuns) ? courseRuns : [];
|
|
15
|
+
const progressCardData = {
|
|
16
|
+
title: course.title,
|
|
17
|
+
start: start,
|
|
18
|
+
end: end || '',
|
|
19
|
+
pacingType: pacingType,
|
|
20
|
+
certificateUrl: certificateUrl || '',
|
|
21
|
+
courseUrl: courseUrl || '',
|
|
22
|
+
};
|
|
23
|
+
return (_jsx(ProgressCard, { progressCardData: progressCardData, isLoading: isLoading, tabType: formatMessage(messages.programProgressCompletedTab).toLowerCase() }, course.id));
|
|
24
|
+
}));
|
|
25
|
+
return (_jsxs("div", { children: [_jsx("h5", { children: formatMessage(messages.programProgressCompletedCourse) }), completedData.length > 0 ? (buildProgressCard()) : (_jsx("p", { children: formatMessage(messages.programProgressCompletedTabNoCourse) })), _jsx(CompletedRecordBanner, {})] }));
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/CompletedTabData/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,CAAC,MAAM,gBAAgB,GAAO,GAAG,EAAE;IACvC,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,eAAe,EAAE,CAAC;IAC7D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,UAAU,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,UAAU,CAAC;IACnD,MAAM,aAAa,GAAG,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,KAAI,EAAE,CAAC;IAElD,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,CAC9B,aAAa,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC3B,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QAC3C,MAAM,CAAC,EAAE,UAAU,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,cAAc,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QAE1I,MAAM,gBAAgB,GAAG;YACvB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,KAAK;YACZ,GAAG,EAAE,GAAG,IAAI,EAAE;YACd,UAAU,EAAE,UAAU;YACtB,cAAc,EAAE,cAAc,IAAI,EAAE;YACpC,SAAS,EAAE,SAAS,IAAI,EAAE;SAC3B,CAAC;QAEF,OAAO,CACL,KAAC,YAAY,IAAiB,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC,WAAW,EAAE,IAA/I,MAAM,CAAC,EAAE,CAA0I,CACvK,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,CACL,0BACE,uBAAK,aAAa,CAAC,QAAQ,CAAC,8BAA8B,CAAC,GAAM,EAChE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC1B,iBAAiB,EAAE,CACpB,CAAC,CAAC,CAAC,CACF,sBAAI,aAAa,CAAC,QAAQ,CAAC,mCAAmC,CAAC,GAAK,CACrE,EAED,KAAC,qBAAqB,KAAG,IACrB,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { useProgressData } from '@src/hooks';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { ProgressCard } from '../ProgressCard';\nimport messages from '../messages';\nimport { CompletedRecordBanner } from './CompletedRecordBanner';\n\nexport const CompletedTabData: FC = () => {\n const { programProgressData, isLoading } = useProgressData();\n const { formatMessage } = useIntl();\n\n const courseData = programProgressData?.courseData;\n const completedData = courseData?.completed || [];\n\n const buildProgressCard = () => (\n completedData.map((course) => {\n const courseRuns = course.courseRuns || [];\n const [{ pacingType = '', start = '', end = '', certificateUrl = '', courseUrl = '' } = {}] = Array.isArray(courseRuns) ? courseRuns : [];\n\n const progressCardData = {\n title: course.title,\n start: start,\n end: end || '',\n pacingType: pacingType,\n certificateUrl: certificateUrl || '',\n courseUrl: courseUrl || '',\n };\n\n return (\n <ProgressCard key={course.id} progressCardData={progressCardData} isLoading={isLoading} tabType={formatMessage(messages.programProgressCompletedTab).toLowerCase()} />\n );\n })\n );\n\n return (\n <div>\n <h5>{formatMessage(messages.programProgressCompletedCourse)}</h5>\n {completedData.length > 0 ? (\n buildProgressCard()\n ) : (\n <p>{formatMessage(messages.programProgressCompletedTabNoCourse)}</p>\n )}\n\n <CompletedRecordBanner />\n </div>\n );\n};\n"]}
|
|
@@ -30,7 +30,8 @@ const ProgramProgress = () => {
|
|
|
30
30
|
const inProgressCourseCount = ((_h = courseData === null || courseData === void 0 ? void 0 : courseData.inProgress) === null || _h === void 0 ? void 0 : _h.length) || 0;
|
|
31
31
|
const remainingCourseCount = ((_j = courseData === null || courseData === void 0 ? void 0 : courseData.notStarted) === null || _j === void 0 ? void 0 : _j.length) || 0;
|
|
32
32
|
const completedCourseCount = ((_k = courseData === null || courseData === void 0 ? void 0 : courseData.completed) === null || _k === void 0 ? void 0 : _k.length) || 0;
|
|
33
|
-
|
|
33
|
+
const discountData = programData === null || programData === void 0 ? void 0 : programData.discountData;
|
|
34
|
+
return (_jsxs(_Fragment, { children: [_jsx(Helmet, { title: `${programData === null || programData === void 0 ? void 0 : programData.title}` }), _jsxs(Container, { fluid: false, size: "xl", className: "p-4.5", children: [_jsx(ProgramProgressHeader, { programTitle: (_l = programData === null || programData === void 0 ? void 0 : programData.title) !== null && _l !== void 0 ? _l : '', programType: (_m = programData === null || programData === void 0 ? void 0 : programData.type) !== null && _m !== void 0 ? _m : '', authoringOrganizations: programData === null || programData === void 0 ? void 0 : programData.authoringOrganizations }), _jsx(Row, { children: _jsxs(Col, { sm: 12, md: 8, children: [_jsx(ProgramProgressInfo, { allCoursesCompleted: allCoursesCompleted, totalCoursesInProgram: totalCoursesInProgram, programTitle: (_o = programData === null || programData === void 0 ? void 0 : programData.title) !== null && _o !== void 0 ? _o : '', discountData: discountData }), _jsx(ProgramProgressTabs, { counts: { inProgress: inProgressCourseCount, remaining: remainingCourseCount, completed: completedCourseCount }, type: programType })] }) })] })] }));
|
|
34
35
|
};
|
|
35
36
|
export default ProgramProgress;
|
|
36
37
|
//# sourceMappingURL=ProgramProgress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgramProgress.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramProgress/ProgramProgress.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,eAAe,GAAO,GAAG,EAAE;;IAC/B,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,eAAe,EAAE,CAAC;IAEpE,IAAI,mBAAmB,KAAK,IAAI,EAAE,CAAC;QACjC,OAAO,wCAAsB,CAAC;IAChC,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,uCAAqB,CAAC;IAC/B,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,2CAAyB,CAAC;IACnC,CAAC;IAED,MAAM,WAAW,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,WAAW,CAAC;IACrD,MAAM,UAAU,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,UAAU,CAAC;IAEnD,MAAM,qBAAqB,GAAG,CAAC,CAAA,MAAA,UAAU,CAAC,UAAU,0CAA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C } from 'react';\nimport { Helmet } from 'react-helmet';\nimport { Col, Container, Row } from '@openedx/paragon';\n\nimport './index.scss';\nimport { useProgressData } from '@src/hooks';\nimport ProgramProgressHeader from './ProgramProgressHeader';\nimport ProgramProgressInfo from './ProgramProgressInfo';\nimport { ProgramProgressTabs } from './ProgramProgressTabs';\n\nconst ProgramProgress: FC = () => {\n const { programProgressData, isLoading, error } = useProgressData();\n\n if (programProgressData === null) {\n return <div>Invalid URL</div>;\n }\n\n if (isLoading) {\n return <div>Loading...</div>;\n }\n\n if (error) {\n return <div>Error occurred</div>;\n }\n\n const programData = programProgressData?.programData;\n const courseData = programProgressData?.courseData;\n\n const totalCoursesInProgram = (courseData.notStarted?.length || 0)\n + (courseData.completed?.length || 0)\n + (courseData.inProgress?.length || 0);\n\n const allCoursesCompleted = !courseData.notStarted?.length\n && !courseData.inProgress?.length\n && courseData.completed?.length;\n\n const programType = programData?.type ?? '';\n const inProgressCourseCount = courseData?.inProgress?.length || 0;\n const remainingCourseCount = courseData?.notStarted?.length || 0;\n const completedCourseCount = courseData?.completed?.length || 0;\n const discountData = programData?.discountData;\n\n return (\n <>\n <Helmet title={`${programData?.title}`} />\n <Container fluid={false} size=\"xl\" className=\"p-4.5\">\n <ProgramProgressHeader\n programTitle={programData?.title ?? ''}\n programType={programData?.type ?? ''}\n authoringOrganizations={programData?.authoringOrganizations}\n />\n <Row>\n <Col sm={12} md={8}>\n <ProgramProgressInfo\n allCoursesCompleted={allCoursesCompleted}\n totalCoursesInProgram={totalCoursesInProgram}\n programTitle={programData?.title ?? ''}\n discountData={discountData}\n />\n <ProgramProgressTabs counts={{ inProgress: inProgressCourseCount, remaining: remainingCourseCount, completed: completedCourseCount }} type={programType} />\n </Col>\n </Row>\n </Container>\n </>\n );\n};\n\nexport default ProgramProgress;\n"]}
|
|
@@ -2,11 +2,11 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useIntl } from '@openedx/frontend-base';
|
|
3
3
|
import messages from './messages';
|
|
4
4
|
import { UpgradeAllButton } from './UpgradeButton';
|
|
5
|
-
const ProgramProgressInfo = ({ allCoursesCompleted, totalCoursesInProgram, programTitle, }) => {
|
|
5
|
+
const ProgramProgressInfo = ({ allCoursesCompleted, totalCoursesInProgram, programTitle, discountData }) => {
|
|
6
6
|
const { formatMessage } = useIntl();
|
|
7
7
|
return (_jsx("div", { className: "pb-4.5", children: allCoursesCompleted
|
|
8
8
|
? (_jsxs(_Fragment, { children: [_jsx("h3", { children: formatMessage(messages.programProgressCompleteHeader) }), _jsx("p", { children: formatMessage(messages.programProgressCompleteText, { programTitle }) })] }))
|
|
9
|
-
: (_jsxs(_Fragment, { children: [_jsx("h3", { className: "program-journey-header font-weight-bold", children: formatMessage(messages.programProgressIncompleteHeader) }), _jsx("p", { className: "program-journey-text", "data-testid": "program-incomplete-info-text", children: formatMessage(messages.programProgressIncompleteText, { totalCoursesInProgram }) }), _jsx(UpgradeAllButton, {})] })) }));
|
|
9
|
+
: (_jsxs(_Fragment, { children: [_jsx("h3", { className: "program-journey-header font-weight-bold", children: formatMessage(messages.programProgressIncompleteHeader) }), _jsx("p", { className: "program-journey-text", "data-testid": "program-incomplete-info-text", children: formatMessage(messages.programProgressIncompleteText, { totalCoursesInProgram }) }), (discountData === null || discountData === void 0 ? void 0 : discountData.currency) && typeof (discountData === null || discountData === void 0 ? void 0 : discountData.totalInclTax) === 'number' && typeof (discountData === null || discountData === void 0 ? void 0 : discountData.totalInclTaxExclDiscounts) === 'number' && (_jsx(UpgradeAllButton, {}))] })) }));
|
|
10
10
|
};
|
|
11
11
|
export default ProgramProgressInfo;
|
|
12
12
|
//# sourceMappingURL=ProgramProgressInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgramProgressInfo.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramProgress/ProgramProgressInfo.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO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,OAAO,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,yBAAyB,CAAA,KAAK,QAAQ,IAAI,CAC1I,KAAC,gBAAgB,KAAG,CACrB,IACA,CACJ,GACD,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import React from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport { ProgramProgressInfoProps } from '../data/types';\nimport messages from './messages';\n\nimport { UpgradeAllButton } from './UpgradeButton';\n\nconst ProgramProgressInfo: React.FC<ProgramProgressInfoProps> = ({\n allCoursesCompleted, totalCoursesInProgram, programTitle, discountData\n}) => {\n const { formatMessage } = useIntl();\n return (\n <div className=\"pb-4.5\">\n {allCoursesCompleted\n ? (\n <>\n <h3>{formatMessage(messages.programProgressCompleteHeader)}</h3>\n <p>{formatMessage(messages.programProgressCompleteText, { programTitle })}</p>\n </>\n )\n : (\n <>\n <h3 className=\"program-journey-header font-weight-bold\">{formatMessage(messages.programProgressIncompleteHeader)}</h3>\n <p className=\"program-journey-text\" data-testid=\"program-incomplete-info-text\">\n {formatMessage(messages.programProgressIncompleteText, { totalCoursesInProgram })}\n </p>\n {discountData?.currency && typeof discountData?.totalInclTax === 'number' && typeof discountData?.totalInclTaxExclDiscounts === 'number' && (\n <UpgradeAllButton />\n )}\n </>\n )}\n </div>\n );\n};\n\nexport default ProgramProgressInfo;\n"]}
|
|
@@ -4,6 +4,7 @@ import { Tabs, Tab } from '@openedx/paragon';
|
|
|
4
4
|
import { useIntl } from '@openedx/frontend-base';
|
|
5
5
|
import messages from '../messages';
|
|
6
6
|
import { RemainingTabData } from '../RemainingTabData';
|
|
7
|
+
import { CompletedTabData } from '../CompletedTabData';
|
|
7
8
|
export const ProgramProgressTabs = ({ type, counts }) => {
|
|
8
9
|
const { inProgress, remaining, completed } = counts;
|
|
9
10
|
const { formatMessage } = useIntl();
|
|
@@ -24,7 +25,7 @@ export const ProgramProgressTabs = ({ type, counts }) => {
|
|
|
24
25
|
key: 'completed',
|
|
25
26
|
title: formatMessage(messages.programProgressCompletedTab),
|
|
26
27
|
count: completed,
|
|
27
|
-
panel: _jsx(
|
|
28
|
+
panel: _jsx(CompletedTabData, {}),
|
|
28
29
|
},
|
|
29
30
|
...((type === null || type === void 0 ? void 0 : type.toLowerCase()) === 'micromasters'
|
|
30
31
|
? [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/ProgramProgressTabs/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,CAAC,MAAM,mBAAmB,GAAiC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;IACpF,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IACpD,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,QAAQ,GAA8B;QAC1C;YACE,GAAG,EAAE,aAAa;YAClB,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,4BAA4B,CAAC;YAC3D,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,0EAAyD;SACjE;QACD;YACE,GAAG,EAAE,WAAW;YAChB,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YAC1D,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,KAAC,gBAAgB,KAAG;SAC5B;QACD;YACE,GAAG,EAAE,WAAW;YAChB,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YAC1D,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/ProgramProgressTabs/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,CAAC,MAAM,mBAAmB,GAAiC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;IACpF,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IACpD,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,QAAQ,GAA8B;QAC1C;YACE,GAAG,EAAE,aAAa;YAClB,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,4BAA4B,CAAC;YAC3D,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,0EAAyD;SACjE;QACD;YACE,GAAG,EAAE,WAAW;YAChB,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YAC1D,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,KAAC,gBAAgB,KAAG;SAC5B;QACD;YACE,GAAG,EAAE,WAAW;YAChB,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YAC1D,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,KAAC,gBAAgB,KAAG;SAC5B;QACD,GAAG,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,EAAE,MAAK,cAAc;YACxC,CAAC,CAAC,CAAC;oBACC,GAAG,EAAE,UAAU;oBACf,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,0BAA0B,CAAC;oBACzD,KAAK,EAAE,uEAAsD;iBAC9D,CAAC;YACJ,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;IAEF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAS,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAEpE,MAAM,eAAe,GAAG,CAAC,MAAqB,EAAE,EAAE;QAChD,IAAI,MAAM;YAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,IAAI,IACH,EAAE,EAAC,uBAAuB,EAC1B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAC,MAAM,EAChB,YAAY,kBAEX,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CACnB,KAAC,GAAG,IAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,EAAgB,KAAK,EAAE,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,YAC7G,GAAG,CAAC,KAAK,IADiB,GAAG,CAAC,GAAG,CAE9B,CACP,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC, useState } from 'react';\nimport { Tabs, Tab } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { ProgramProgressTabsProps, ProgramProgressTabItems } from '../../data/types';\nimport messages from '../messages';\nimport { RemainingTabData } from '../RemainingTabData';\nimport { CompletedTabData } from '../CompletedTabData';\n\nexport const ProgramProgressTabs: FC<ProgramProgressTabsProps> = ({ type, counts }) => {\n const { inProgress, remaining, completed } = counts;\n const { formatMessage } = useIntl();\n\n const tabsData: ProgramProgressTabItems[] = [\n {\n key: 'in-progress',\n title: formatMessage(messages.programProgressInProgressTab),\n count: inProgress,\n panel: <span>In progress tab data will be available soon.</span>,\n },\n {\n key: 'remaining',\n title: formatMessage(messages.programProgressRemainingTab),\n count: remaining,\n panel: <RemainingTabData />,\n },\n {\n key: 'completed',\n title: formatMessage(messages.programProgressCompletedTab),\n count: completed,\n panel: <CompletedTabData />,\n },\n ...(type?.toLowerCase() === 'micromasters'\n ? [{\n key: 'pathways',\n title: formatMessage(messages.programProgressPathwaysTab),\n panel: <span>Pathways tab data will be available soon.</span>,\n }]\n : []),\n ];\n\n const [activeTab, setActiveTab] = useState<string>(tabsData[0].key);\n\n const handleTabSelect = (tabKey: string | null) => {\n if (tabKey) setActiveTab(tabKey);\n };\n\n return (\n <Tabs\n id=\"program-progress-tabs\"\n activeKey={activeTab}\n onSelect={handleTabSelect}\n className=\"mb-4\"\n mountOnEnter\n >\n {tabsData.map(tab => (\n <Tab eventKey={tab.key} key={tab.key} title={tab.count !== undefined ? `${tab.title} (${tab.count})` : tab.title}>\n {tab.panel}\n </Tab>\n ))}\n </Tabs>\n );\n};\n"]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card,
|
|
2
|
+
import { Card, Row, Col } from '@openedx/paragon';
|
|
3
3
|
import { useIntl } from '@openedx/frontend-base';
|
|
4
4
|
import messages from '../messages';
|
|
5
5
|
import './index.scss';
|
|
6
6
|
import { ProgressCardActions } from '../ProgressCardActions';
|
|
7
|
+
import { dateFormatter } from '../../../../utils/dateFormatter';
|
|
8
|
+
import { ProgressCardButton } from '../ProgressCardActions/ProgressCardButton';
|
|
7
9
|
export const ProgressCard = ({ progressCardData, isLoading, tabType }) => {
|
|
8
|
-
const { formatMessage } = useIntl();
|
|
9
|
-
const { title,
|
|
10
|
-
const [{ pacingType = '', start = '' } = {}] = Array.isArray(courseRuns) ? courseRuns : [];
|
|
10
|
+
const { formatMessage, formatDate } = useIntl();
|
|
11
|
+
const { title, pacingType, start, end, certificateUrl, courseUrl } = progressCardData;
|
|
11
12
|
/*
|
|
12
13
|
- Formatting pacing type safely
|
|
13
14
|
- replace underscores with spaces
|
|
@@ -24,18 +25,13 @@ export const ProgressCard = ({ progressCardData, isLoading, tabType }) => {
|
|
|
24
25
|
}
|
|
25
26
|
// add start date if exists
|
|
26
27
|
if (start) {
|
|
27
|
-
const startDate =
|
|
28
|
-
month: 'short',
|
|
29
|
-
day: 'numeric',
|
|
30
|
-
year: 'numeric'
|
|
31
|
-
});
|
|
28
|
+
const startDate = dateFormatter(formatDate, start, 'short');
|
|
32
29
|
enrollmentInfo = enrollmentInfo
|
|
33
30
|
? `${enrollmentInfo} ${formatMessage(messages.programProgressCardStartText)} ${startDate}`
|
|
34
31
|
: `${formatMessage(messages.programProgressCardStartText)} ${startDate}`;
|
|
35
32
|
}
|
|
36
|
-
return (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}) }) }), _jsx(Col, { xs: 12, md: 3, className: "d-flex justify-content-md-end", children: _jsx(Button, { variant: "outline-brand", children: formatMessage(messages.programProgressCardUpgradeButton) }) })] }) }))] }));
|
|
33
|
+
return (_jsx(Card, { className: "progress-card mb-3", "data-testid": "progress-card", isLoading: isLoading, children: _jsxs(Card.Section, { className: "pt-3 pb-2 px-4", children: [_jsxs(Row, { className: "mb-2", children: [_jsxs(Col, { xs: 12, children: [_jsx("h4", { className: "mb-1 font-weight-bold", children: title }), _jsx("div", { className: "text-muted", children: enrollmentInfo })] }), _jsx(ProgressCardActions, { tabType: tabType, redirectUrl: courseUrl })] }), tabType === (formatMessage(messages.programProgressCompletedTab).toLowerCase()) && (_jsx(Row, { className: "pt-3 pb-2 px-2 border-top border-2 border-muted mb-2 align-items-center", children: _jsxs(Col, { xs: 12, className: "d-flex justify-content-between align-items-center px-0", children: [_jsx("span", { className: "text-start", children: end && (formatMessage(messages.programProgressCardCompletedCertificateText, {
|
|
34
|
+
certificateDate: (end ? dateFormatter(formatDate, end, 'short') : ''),
|
|
35
|
+
})) }), _jsx(ProgressCardButton, { variant: "brand", redirectUrl: certificateUrl || '', buttonText: formatMessage(messages.programProgressCardCompletedCertificateButton) })] }) }))] }) }));
|
|
40
36
|
};
|
|
41
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/ProgressCard/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/ProgressCard/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAE/E,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;IAC9F,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,CAAC;IAEhD,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,gBAAgB,CAAC;IAEtF;;;;;MAKE;IACF,MAAM,eAAe,GAAG,UAAU;QAChC,CAAC,CAAC,UAAU,CAAC,OA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AQ,CAAC,2BAA2B,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,CACnF,KAAC,GAAG,IAAC,SAAS,EAAC,yEAAyE,YACtF,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,wDAAwD,aAC7E,eAAM,SAAS,EAAC,YAAY,YACzB,GAAG,IAAI,CACN,aAAa,CAAC,QAAQ,CAAC,2CAA2C,EAAE;oCAClE,eAAe,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;iCACtE,CAAC,CACH,GACI,EAEP,KAAC,kBAAkB,IAAC,OAAO,EAAC,OAAO,EAAC,WAAW,EAAE,cAAc,IAAI,EAAE,EAAE,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC,6CAA6C,CAAC,GAAI,IACxJ,GACF,CACP,IACY,GACV,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { Card, Row, Col } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { ProgressCardProps } from '../../data/types';\nimport messages from '../messages';\nimport './index.scss';\nimport { ProgressCardActions } from '../ProgressCardActions';\nimport { dateFormatter } from '@src/utils/dateFormatter';\nimport { ProgressCardButton } from '../ProgressCardActions/ProgressCardButton';\n\nexport const ProgressCard: FC<ProgressCardProps> = ({ progressCardData, isLoading, tabType }) => {\n const { formatMessage, formatDate } = useIntl();\n\n const { title, pacingType, start, end, certificateUrl, courseUrl } = progressCardData;\n\n /*\n - Formatting pacing type safely\n - replace underscores with spaces\n - capitalize first letter of each word\n - example: 'self_paced' -> 'Self Paced'\n */\n const formattedPacing = pacingType\n ? pacingType.replace(/_/g, ' ').replace(/\\b\\w/g, c => c.toUpperCase())\n : '';\n\n // base string\n let enrollmentInfo = tabType !== 'remaining' ? formatMessage(messages.programProgressCardEnrollText) : '';\n\n if (formattedPacing) {\n enrollmentInfo += `${enrollmentInfo ? ' ' : ''}(${formattedPacing})`;\n }\n\n // add start date if exists\n if (start) {\n const startDate = dateFormatter(formatDate, start, 'short');\n\n enrollmentInfo = enrollmentInfo\n ? `${enrollmentInfo} ${formatMessage(messages.programProgressCardStartText)} ${startDate}`\n : `${formatMessage(messages.programProgressCardStartText)} ${startDate}`;\n }\n\n return (\n <Card className=\"progress-card mb-3\" data-testid=\"progress-card\" isLoading={isLoading}>\n <Card.Section className=\"pt-3 pb-2 px-4\">\n <Row className=\"mb-2\">\n <Col xs={12}>\n <h4 className=\"mb-1 font-weight-bold\">{title}</h4>\n <div className=\"text-muted\">\n {enrollmentInfo}\n </div>\n </Col>\n <ProgressCardActions tabType={tabType} redirectUrl={courseUrl} />\n </Row>\n\n { tabType === (formatMessage(messages.programProgressCompletedTab).toLowerCase()) && (\n <Row className=\"pt-3 pb-2 px-2 border-top border-2 border-muted mb-2 align-items-center\">\n <Col xs={12} className=\"d-flex justify-content-between align-items-center px-0\">\n <span className=\"text-start\">\n {end && (\n formatMessage(messages.programProgressCardCompletedCertificateText, {\n certificateDate: (end ? dateFormatter(formatDate, end, 'short') : ''),\n })\n )}\n </span>\n\n <ProgressCardButton variant=\"brand\" redirectUrl={certificateUrl || ''} buttonText={formatMessage(messages.programProgressCardCompletedCertificateButton)} />\n </Col>\n </Row>\n )}\n </Card.Section>\n </Card>\n );\n};\n"]}
|
package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/ProgressCardButton.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@openedx/paragon';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
4
|
+
export const ProgressCardButton = ({ variant, redirectUrl, buttonText }) => {
|
|
5
|
+
return (redirectUrl
|
|
6
|
+
? (_jsx(Button, { variant: variant, as: Link, to: redirectUrl, children: buttonText }))
|
|
7
|
+
: (_jsx(Button, { variant: variant, children: buttonText })));
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=ProgressCardButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressCardButton.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/ProgressCardButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAIxC,MAAM,CAAC,MAAM,kBAAkB,GAAgC,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,EAAE;IACtG,OAAO,CACL,WAAW;QACT,CAAC,CAAC,CACE,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,YAChD,UAAU,GACJ,CACV;QACH,CAAC,CAAC,CACE,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,YACrB,UAAU,GACJ,CACV,CACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { Button } from '@openedx/paragon';\nimport { Link } from 'react-router-dom';\n\nimport { ProgressCardButtonProps } from '../../data/types';\n\nexport const ProgressCardButton: FC<ProgressCardButtonProps> = ({ variant, redirectUrl, buttonText }) => {\n return (\n redirectUrl\n ? (\n <Button variant={variant} as={Link} to={redirectUrl}>\n {buttonText}\n </Button>\n )\n : (\n <Button variant={variant}>\n {buttonText}\n </Button>\n )\n );\n};\n"]}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Col } from '@openedx/paragon';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
3
4
|
import { useProgressData } from '../../../../hooks';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { ProgressCardButton } from './ProgressCardButton';
|
|
6
|
+
import messages from '../messages';
|
|
7
|
+
export const ProgressCardActions = ({ tabType, redirectUrl }) => {
|
|
8
|
+
var _a, _b;
|
|
7
9
|
const { programProgressData } = useProgressData();
|
|
10
|
+
const { formatMessage } = useIntl();
|
|
8
11
|
const courseData = (programProgressData === null || programProgressData === void 0 ? void 0 : programProgressData.courseData) || {};
|
|
9
12
|
const remainingCourseCount = ((_a = courseData === null || courseData === void 0 ? void 0 : courseData.notStarted) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
10
|
-
|
|
13
|
+
const completedCourseCount = ((_b = courseData === null || courseData === void 0 ? void 0 : courseData.completed) === null || _b === void 0 ? void 0 : _b.length) || 0;
|
|
14
|
+
return (_jsxs(Col, { xs: 12, className: "d-flex justify-content-md-end align-items-start mb-2", children: [tabType === formatMessage(messages.programProgressRemainingTab).toLowerCase() && remainingCourseCount > 0 && (_jsx(ProgressCardButton, { variant: "outline-primary", redirectUrl: redirectUrl || '', buttonText: formatMessage(messages.programProgressCardViewCourseDetailButton) })), tabType === formatMessage(messages.programProgressCompletedTab).toLowerCase() && completedCourseCount > 0 && (_jsx(ProgressCardButton, { variant: "primary", redirectUrl: redirectUrl || '', buttonText: formatMessage(messages.programProgressCardResumeCourseButton) }))] }));
|
|
11
15
|
};
|
|
12
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,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,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC,qCAAqC,CAAC,GAAI,CACpJ,IACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { Col } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { useProgressData } from '@src/hooks';\nimport { ProgressCardActionsProps } from '../../data/types';\nimport { ProgressCardButton } from './ProgressCardButton';\nimport messages from '../messages';\n\nexport const ProgressCardActions: FC<ProgressCardActionsProps> = ({ tabType, redirectUrl }) => {\n const { programProgressData } = useProgressData();\n const { formatMessage } = useIntl();\n\n const courseData = programProgressData?.courseData || {};\n const remainingCourseCount = courseData?.notStarted?.length || 0;\n const completedCourseCount = courseData?.completed?.length || 0;\n\n return (\n <Col xs={12} className=\"d-flex justify-content-md-end align-items-start mb-2\">\n {/** View course details button */}\n { tabType === formatMessage(messages.programProgressRemainingTab).toLowerCase() && remainingCourseCount > 0 && (\n <ProgressCardButton variant=\"outline-primary\" redirectUrl={redirectUrl || ''} buttonText={formatMessage(messages.programProgressCardViewCourseDetailButton)} />\n )}\n\n {/** Resume course button */}\n { tabType === formatMessage(messages.programProgressCompletedTab).toLowerCase() && completedCourseCount > 0 && (\n <ProgressCardButton variant=\"primary\" redirectUrl={redirectUrl || ''} buttonText={formatMessage(messages.programProgressCardResumeCourseButton)} />\n )}\n </Col>\n );\n};\n"]}
|
|
@@ -8,6 +8,18 @@ export const RemainingTabData = () => {
|
|
|
8
8
|
const { formatMessage } = useIntl();
|
|
9
9
|
const courseData = programProgressData === null || programProgressData === void 0 ? void 0 : programProgressData.courseData;
|
|
10
10
|
const remainingData = (courseData === null || courseData === void 0 ? void 0 : courseData.notStarted) || [];
|
|
11
|
-
|
|
11
|
+
const buildProgressCard = () => (remainingData.map((course) => {
|
|
12
|
+
const courseRuns = course.courseRuns || [];
|
|
13
|
+
const [{ pacingType = '', start = '', end = '', courseUrl = '' } = {}] = Array.isArray(courseRuns) ? courseRuns : [];
|
|
14
|
+
const progressCardData = {
|
|
15
|
+
title: course.title,
|
|
16
|
+
start: start,
|
|
17
|
+
end: end || '',
|
|
18
|
+
pacingType: pacingType,
|
|
19
|
+
courseUrl: courseUrl || '',
|
|
20
|
+
};
|
|
21
|
+
return (_jsx(ProgressCard, { progressCardData: progressCardData, isLoading: isLoading, tabType: formatMessage(messages.programProgressRemainingTab).toLowerCase() }, course.id));
|
|
22
|
+
}));
|
|
23
|
+
return (_jsxs("div", { children: [_jsx("h5", { children: formatMessage(messages.programProgressRemainingCourse) }), remainingData.length > 0 ? (buildProgressCard()) : (_jsx("p", { children: formatMessage(messages.programProgressRemainingTabNoCourse) }))] }));
|
|
12
24
|
};
|
|
13
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/RemainingTabData/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,gBAAgB,GAAO,GAAG,EAAE;IACvC,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,eAAe,EAAE,CAAC;IAC7D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,UAAU,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,UAAU,CAAC;IACnD,MAAM,aAAa,GAAG,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,KAAI,EAAE,CAAC;IAEnD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/RemainingTabData/index.tsx"],"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E,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC,WAAW,EAAE,IAA/I,MAAM,CAAC,EAAE,CAA0I,CACvK,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,CACL,0BACE,uBAAK,aAAa,CAAC,QAAQ,CAAC,8BAA8B,CAAC,GAAM,EAChE,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC1B,iBAAiB,EAAE,CACpB,CAAC,CAAC,CAAC,CACF,sBAAI,aAAa,CAAC,QAAQ,CAAC,mCAAmC,CAAC,GAAK,CACrE,IACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { useProgressData } from '@src/hooks';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { ProgressCard } from '../ProgressCard';\nimport messages from '../messages';\n\nexport const RemainingTabData: FC = () => {\n const { programProgressData, isLoading } = useProgressData();\n const { formatMessage } = useIntl();\n\n const courseData = programProgressData?.courseData;\n const remainingData = courseData?.notStarted || [];\n\n const buildProgressCard = () => (\n remainingData.map((course) => {\n const courseRuns = course.courseRuns || [];\n const [{ pacingType = '', start = '', end = '', courseUrl = '' } = {}] = Array.isArray(courseRuns) ? courseRuns : [];\n\n const progressCardData = {\n title: course.title,\n start: start,\n end: end || '',\n pacingType: pacingType,\n courseUrl: courseUrl || '',\n };\n\n return (\n <ProgressCard key={course.id} progressCardData={progressCardData} isLoading={isLoading} tabType={formatMessage(messages.programProgressRemainingTab).toLowerCase()} />\n );\n })\n );\n\n return (\n <div>\n <h5>{formatMessage(messages.programProgressRemainingCourse)}</h5>\n {remainingData.length > 0 ? (\n buildProgressCard()\n ) : (\n <p>{formatMessage(messages.programProgressRemainingTabNoCourse)}</p>\n )}\n </div>\n );\n};\n"]}
|
|
@@ -16,14 +16,11 @@ const UpgradeAllButton = () => {
|
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
18
|
const { discountData } = programProgressData.programData;
|
|
19
|
-
if (discountData) {
|
|
20
|
-
|
|
21
|
-
if (isDiscounted) {
|
|
22
|
-
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "list-price", children: _jsx(FormattedNumber, { value: totalInclTaxExclDiscounts, style: "currency", currency: currency, maximumFractionDigits: 2, minimumFractionDigits: 2 }) }), _jsx("span", { children: _jsx(FormattedNumber, { value: totalInclTax, style: "currency", currency: currency, maximumFractionDigits: 2, minimumFractionDigits: 2 }) })] }));
|
|
23
|
-
}
|
|
24
|
-
return (_jsx("span", { children: _jsx(FormattedNumber, { value: totalInclTax, style: "currency", currency: currency, maximumFractionDigits: 2, minimumFractionDigits: 2 }) }));
|
|
19
|
+
if (!discountData) {
|
|
20
|
+
return null;
|
|
25
21
|
}
|
|
26
|
-
|
|
22
|
+
const { currency, totalInclTaxExclDiscounts, totalInclTax, } = discountData;
|
|
23
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { className: "list-price", children: _jsx(FormattedNumber, { value: totalInclTaxExclDiscounts, style: "currency", currency: currency, maximumFractionDigits: 2, minimumFractionDigits: 2 }) }), _jsx("span", { children: _jsx(FormattedNumber, { value: totalInclTax, style: "currency", currency: currency, maximumFractionDigits: 2, minimumFractionDigits: 2 }) })] }));
|
|
27
24
|
};
|
|
28
25
|
return (_jsxs(Button, { as: "a", className: "upgrade-all-button", href: urls && urls.buyButtonUrl, "data-testid": "upgrade-all-button", variant: "brand", children: [_jsx("span", { children: formatMessage(messages.upgradeAllRemainingCoursesButtonText) }), getAllRemainingCoursesPrice() && (_jsx("span", { className: "all-remaining-courses-price", children: getAllRemainingCoursesPrice() }))] }));
|
|
29
26
|
};
|
package/dist/containers/ProgramDashboard/ProgramProgress/UpgradeButton/UpgradeAllButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpgradeAllButton.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/UpgradeButton/UpgradeAllButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,cAAc,CAAC;AACtB,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,gBAAgB,GAAO,GAAG,EAAE;IAChC,MAAM,EAAE,IAAI,EAAE,GAAG,SAAS,EAAsB,CAAC;IAEjD,MAAM,EAAE,IAAI,EAAE,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,mBAAmB,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAElD,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,IAAI,EAAE,GAAG,mBAAmB,CAAC;IAErC,MAAM,2BAA2B,GAAG,GAAG,EAAE;QACvC,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,EAAE,YAAY,EAAE,GAAG,mBAAmB,CAAC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"UpgradeAllButton.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/UpgradeButton/UpgradeAllButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,cAAc,CAAC;AACtB,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MA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CAAC,QAAQ,CAAC,oCAAoC,CAAC,GACxD,EACN,2BAA2B,EAAE,IAAI,CAChC,eAAM,SAAS,EAAC,6BAA6B,YAC1C,2BAA2B,EAAE,GACzB,CACR,IACM,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import { FC } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { Button } from '@openedx/paragon';\nimport { FormattedNumber, useIntl, camelCaseObject } from '@openedx/frontend-base';\n\nimport { useProgramProgressData } from '@src/data/hooks/queryHooks';\nimport './index.scss';\nimport messages from './messages';\n\nconst UpgradeAllButton: FC = () => {\n const { uuid } = useParams() as { uuid: string };\n\n const { data } = useProgramProgressData(uuid);\n const programProgressData = camelCaseObject(data);\n\n const { formatMessage } = useIntl();\n const { urls } = programProgressData;\n\n const getAllRemainingCoursesPrice = () => {\n if (!programProgressData.programData) {\n return null;\n }\n const { discountData } = programProgressData.programData;\n if (!discountData) {\n return null;\n }\n\n const {\n currency,\n totalInclTaxExclDiscounts,\n totalInclTax,\n } = discountData;\n\n return (\n <>\n <span className=\"list-price\">\n <FormattedNumber\n value={totalInclTaxExclDiscounts}\n style=\"currency\"\n currency={currency}\n maximumFractionDigits={2}\n minimumFractionDigits={2}\n />\n </span>\n <span>\n <FormattedNumber\n value={totalInclTax}\n style=\"currency\"\n currency={currency}\n maximumFractionDigits={2}\n minimumFractionDigits={2}\n />\n </span>\n </>\n );\n };\n\n return (\n <Button\n as=\"a\"\n className=\"upgrade-all-button\"\n href={urls && urls.buyButtonUrl}\n data-testid=\"upgrade-all-button\"\n variant=\"brand\"\n >\n <span>\n {formatMessage(messages.upgradeAllRemainingCoursesButtonText)}\n </span>\n {getAllRemainingCoursesPrice() && (\n <span className=\"all-remaining-courses-price\">\n {getAllRemainingCoursesPrice()}\n </span>\n )}\n </Button>\n );\n};\n\nexport default UpgradeAllButton;\n"]}
|
|
@@ -29,12 +29,12 @@ declare const messages: {
|
|
|
29
29
|
id: string;
|
|
30
30
|
description: string;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
programProgressCardCompletedCertificateText: {
|
|
33
33
|
defaultMessage: string;
|
|
34
34
|
id: string;
|
|
35
35
|
description: string;
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
programProgressCardCompletedCertificateButton: {
|
|
38
38
|
defaultMessage: string;
|
|
39
39
|
id: string;
|
|
40
40
|
description: string;
|
|
@@ -44,6 +44,11 @@ declare const messages: {
|
|
|
44
44
|
id: string;
|
|
45
45
|
description: string;
|
|
46
46
|
};
|
|
47
|
+
programProgressCardResumeCourseButton: {
|
|
48
|
+
defaultMessage: string;
|
|
49
|
+
id: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
47
52
|
programProgressCardUpgradeButton: {
|
|
48
53
|
defaultMessage: string;
|
|
49
54
|
id: string;
|
|
@@ -89,5 +94,35 @@ declare const messages: {
|
|
|
89
94
|
id: string;
|
|
90
95
|
description: string;
|
|
91
96
|
};
|
|
97
|
+
programProgressCompletedCourse: {
|
|
98
|
+
defaultMessage: string;
|
|
99
|
+
id: string;
|
|
100
|
+
description: string;
|
|
101
|
+
};
|
|
102
|
+
programProgressCompletedTabNoCourse: {
|
|
103
|
+
defaultMessage: string;
|
|
104
|
+
id: string;
|
|
105
|
+
description: string;
|
|
106
|
+
};
|
|
107
|
+
programProgressCompletedBannerTitle: {
|
|
108
|
+
defaultMessage: string;
|
|
109
|
+
id: string;
|
|
110
|
+
description: string;
|
|
111
|
+
};
|
|
112
|
+
programProgressCompletedBannerDescription: {
|
|
113
|
+
defaultMessage: string;
|
|
114
|
+
id: string;
|
|
115
|
+
description: string;
|
|
116
|
+
};
|
|
117
|
+
programProgressCompletedBannerHelpCenterButton: {
|
|
118
|
+
defaultMessage: string;
|
|
119
|
+
id: string;
|
|
120
|
+
description: string;
|
|
121
|
+
};
|
|
122
|
+
programProgressCompletedBannerMyProgramRecordsButton: {
|
|
123
|
+
defaultMessage: string;
|
|
124
|
+
id: string;
|
|
125
|
+
description: string;
|
|
126
|
+
};
|
|
92
127
|
};
|
|
93
128
|
export default messages;
|
|
@@ -30,21 +30,26 @@ const messages = defineMessages({
|
|
|
30
30
|
id: 'program.progress.incomplete.text',
|
|
31
31
|
description: 'text to display when a user has not completed all of the courses for a program',
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
defaultMessage: '
|
|
35
|
-
id: 'program.progress.card.certificate.text',
|
|
36
|
-
description: 'text to display on the progress card related to the certificate status for the course',
|
|
33
|
+
programProgressCardCompletedCertificateText: {
|
|
34
|
+
defaultMessage: 'You earned the certificate on {certificateDate}',
|
|
35
|
+
id: 'program.progress.card.completed.certificate.text',
|
|
36
|
+
description: 'text to display on the progress card completed tab related to the certificate status for the course',
|
|
37
37
|
},
|
|
38
|
-
|
|
39
|
-
defaultMessage: '
|
|
40
|
-
id: 'program.progress.card.
|
|
41
|
-
description: 'text to display on the progress card
|
|
38
|
+
programProgressCardCompletedCertificateButton: {
|
|
39
|
+
defaultMessage: 'View certificate',
|
|
40
|
+
id: 'program.progress.card.completed.certificate.button.text',
|
|
41
|
+
description: 'text to display on the progress card on certificate button for completed courses',
|
|
42
42
|
},
|
|
43
43
|
programProgressCardViewCourseDetailButton: {
|
|
44
44
|
defaultMessage: 'View course details',
|
|
45
45
|
id: 'program.progress.card.view.course.detail.button.text',
|
|
46
46
|
description: 'text to display on the progress card for the view course details button',
|
|
47
47
|
},
|
|
48
|
+
programProgressCardResumeCourseButton: {
|
|
49
|
+
defaultMessage: 'Resume course',
|
|
50
|
+
id: 'program.progress.card.resume.course.button.text',
|
|
51
|
+
description: 'text to display on the progress card for the resume course button',
|
|
52
|
+
},
|
|
48
53
|
programProgressCardUpgradeButton: {
|
|
49
54
|
defaultMessage: 'Upgrade with your subscription',
|
|
50
55
|
id: 'program.progress.card.upgrade.button.text',
|
|
@@ -90,6 +95,36 @@ const messages = defineMessages({
|
|
|
90
95
|
id: 'program.progress.remaining.tab.no.course',
|
|
91
96
|
description: 'Text to display on the Remaining tab of the program progress page when there is no course remaining for the user',
|
|
92
97
|
},
|
|
98
|
+
programProgressCompletedCourse: {
|
|
99
|
+
defaultMessage: 'Completed courses',
|
|
100
|
+
id: 'program.progress.completed.course',
|
|
101
|
+
description: 'Header text to be displayed inside the Completed tab of the program progress page.',
|
|
102
|
+
},
|
|
103
|
+
programProgressCompletedTabNoCourse: {
|
|
104
|
+
defaultMessage: 'As you complete courses, you will see them listed here.',
|
|
105
|
+
id: 'program.progress.completed.tab.no.course',
|
|
106
|
+
description: 'Text to display on the Completed tab of the program progress page when no course is completed for the user',
|
|
107
|
+
},
|
|
108
|
+
programProgressCompletedBannerTitle: {
|
|
109
|
+
defaultMessage: 'Earning a program record',
|
|
110
|
+
id: 'program.progress.completed.banner.title',
|
|
111
|
+
description: 'Title text for the banner displayed on the Completed tab of the program progress page.',
|
|
112
|
+
},
|
|
113
|
+
programProgressCompletedBannerDescription: {
|
|
114
|
+
defaultMessage: 'Once you meet all course and program requirements, you will receive a program record and your professional certificate.',
|
|
115
|
+
id: 'program.progress.completed.banner.description',
|
|
116
|
+
description: 'Description text for the banner displayed on the Completed tab of the program progress page.',
|
|
117
|
+
},
|
|
118
|
+
programProgressCompletedBannerHelpCenterButton: {
|
|
119
|
+
defaultMessage: 'Help center',
|
|
120
|
+
id: 'program.progress.completed.banner.help.center.button',
|
|
121
|
+
description: 'Text for the Help Center button displayed on the banner in the Completed tab of the program progress page.',
|
|
122
|
+
},
|
|
123
|
+
programProgressCompletedBannerMyProgramRecordsButton: {
|
|
124
|
+
defaultMessage: 'My program records',
|
|
125
|
+
id: 'program.progress.completed.banner.my.program.records.button',
|
|
126
|
+
description: 'Text for the My Program Records button displayed on the banner in the Completed tab of the program progress page.',
|
|
127
|
+
}
|
|
93
128
|
});
|
|
94
129
|
export default messages;
|
|
95
130
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramProgress/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,2BAA2B,EAAE;QAC3B,cAAc,EAAE,cAAc;QAC9B,EAAE,EAAE,+BAA+B;QACnC,WAAW,EAAE,yCAAyC;KACvD;IACD,gBAAgB,EAAE;QAChB,cAAc,EAAE,uBAAuB;QACvC,EAAE,EAAE,qCAAqC;QACzC,WAAW,EAAE,qGAAqG;KACnH;IACD,6BAA6B,EAAE;QAC7B,cAAc,EAAE,kBAAkB;QAClC,EAAE,EAAE,kCAAkC;QACtC,WAAW,EAAE,yEAAyE;KACvF;IACD,2BAA2B,EAAE;QAC3B,cAAc,EAAE,0EAA0E;QAC1F,EAAE,EAAE,gCAAgC;QACpC,WAAW,EAAE,8EAA8E;KAC5F;IACD,+BAA+B,EAAE;QAC/B,cAAc,EAAE,sBAAsB;QACtC,EAAE,EAAE,oCAAoC;QACxC,WAAW,EAAE,sFAAsF;KACpG;IACD,6BAA6B,EAAE;QAC7B,cAAc,EAAE,0KAA0K;QAC1L,EAAE,EAAE,kCAAkC;QACtC,WAAW,EAAE,gFAAgF;KAC9F;IACD,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramProgress/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,2BAA2B,EAAE;QAC3B,cAAc,EAAE,cAAc;QAC9B,EAAE,EAAE,+BAA+B;QACnC,WAAW,EAAE,yCAAyC;KACvD;IACD,gBAAgB,EAAE;QAChB,cAAc,EAAE,uBAAuB;QACvC,EAAE,EAAE,qCAAqC;QACzC,WAAW,EAAE,qGAAqG;KACnH;IACD,6BAA6B,EAAE;QAC7B,cAAc,EAAE,kBAAkB;QAClC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n\nconst messages = defineMessages({\n programProgressInstitutions: {\n defaultMessage: 'Institutions',\n id: 'program.progress.institutions',\n description: 'Label text for organization image logos',\n },\n programTypeLabel: {\n defaultMessage: '{programType} program',\n id: 'program.progress.program.type.label',\n description: 'Label displaying the program type (e.g. \"MicroMasters program\", \"Professional Certificate program\")',\n },\n programProgressCompleteHeader: {\n defaultMessage: 'Congratulations!',\n id: 'program.progress.complete.header',\n description: 'header text for the program progress page when all courses are complete',\n },\n programProgressCompleteText: {\n defaultMessage: 'You have successfully completed all the requirements for {programTitle}.',\n id: 'program.progress.complete.text',\n description: 'text to display when a user has completed all of the courses for the program',\n },\n programProgressIncompleteHeader: {\n defaultMessage: 'Your Program Journey',\n id: 'program.progress.incomplete.header',\n description: 'header text to display when the user has remaining incomplete courses in the program',\n },\n programProgressIncompleteText: {\n defaultMessage: 'Track and plan your progress through the {totalCoursesInProgram} courses in this program. To complete the program, you must earn a verified certificate for each course.',\n id: 'program.progress.incomplete.text',\n description: 'text to display when a user has not completed all of the courses for a program',\n },\n programProgressCardCompletedCertificateText: {\n defaultMessage: 'You earned the certificate on {certificateDate}',\n id: 'program.progress.card.completed.certificate.text',\n description: 'text to display on the progress card completed tab related to the certificate status for the course',\n },\n programProgressCardCompletedCertificateButton: {\n defaultMessage: 'View certificate',\n id: 'program.progress.card.completed.certificate.button.text',\n description: 'text to display on the progress card on certificate button for completed courses',\n },\n programProgressCardViewCourseDetailButton: {\n defaultMessage: 'View course details',\n id: 'program.progress.card.view.course.detail.button.text',\n description: 'text to display on the progress card for the view course details button',\n },\n programProgressCardResumeCourseButton: {\n defaultMessage: 'Resume course',\n id: 'program.progress.card.resume.course.button.text',\n description: 'text to display on the progress card for the resume course button',\n },\n programProgressCardUpgradeButton: {\n defaultMessage: 'Upgrade with your subscription',\n id: 'program.progress.card.upgrade.button.text',\n description: 'text to display on the progress card for the upgrade button',\n },\n programProgressCardEnrollText: {\n defaultMessage: 'Enrolled:',\n id: 'program.progress.card.enroll.text',\n description: 'text to display on the progress card for the enrolled status of the course',\n },\n programProgressCardStartText: {\n defaultMessage: 'Started',\n id: 'program.progress.card.start.text',\n description: 'text to display on the progress card for the start date of the course',\n },\n programProgressInProgressTab: {\n defaultMessage: 'In progress',\n id: 'program.progress.in.progress.tab',\n description: 'Label for the \"In progress\" tab on the program progress page, which lists courses that the user has started but not yet completed.',\n },\n programProgressRemainingTab: {\n defaultMessage: 'Remaining',\n id: 'program.progress.remaining.tab',\n description: 'Label for the \"Remaining\" tab on the program progress page, which lists courses that the user has not yet started.',\n },\n programProgressCompletedTab: {\n defaultMessage: 'Completed',\n id: 'program.progress.completed.tab',\n description: 'Label for the \"Completed\" tab on the program progress page, which lists courses that the user has completed.',\n },\n programProgressPathwaysTab: {\n defaultMessage: 'Pathways',\n id: 'program.progress.pathways.tab',\n description: 'Label for the \"Pathways\" tab on the program progress page, which gives details of how the program can be used to further the learners education. This tab is only shown for MicroMasters programs.',\n },\n programProgressRemainingCourse: {\n defaultMessage: 'Remaining Courses',\n id: 'program.progress.remaining.course',\n description: 'Header text to be displayed inside the Remaining tab of the program progress page.',\n },\n programProgressRemainingTabNoCourse: {\n defaultMessage: \"You have enrolled in all of this program's courses.\",\n id: 'program.progress.remaining.tab.no.course',\n description: 'Text to display on the Remaining tab of the program progress page when there is no course remaining for the user',\n },\n programProgressCompletedCourse: {\n defaultMessage: 'Completed courses',\n id: 'program.progress.completed.course',\n description: 'Header text to be displayed inside the Completed tab of the program progress page.',\n },\n programProgressCompletedTabNoCourse: {\n defaultMessage: 'As you complete courses, you will see them listed here.',\n id: 'program.progress.completed.tab.no.course',\n description: 'Text to display on the Completed tab of the program progress page when no course is completed for the user',\n },\n programProgressCompletedBannerTitle: {\n defaultMessage: 'Earning a program record',\n id: 'program.progress.completed.banner.title',\n description: 'Title text for the banner displayed on the Completed tab of the program progress page.',\n },\n programProgressCompletedBannerDescription: {\n defaultMessage: 'Once you meet all course and program requirements, you will receive a program record and your professional certificate.',\n id: 'program.progress.completed.banner.description',\n description: 'Description text for the banner displayed on the Completed tab of the program progress page.',\n },\n programProgressCompletedBannerHelpCenterButton: {\n defaultMessage: 'Help center',\n id: 'program.progress.completed.banner.help.center.button',\n description: 'Text for the Help Center button displayed on the banner in the Completed tab of the program progress page.',\n },\n programProgressCompletedBannerMyProgramRecordsButton: {\n defaultMessage: 'My program records',\n id: 'program.progress.completed.banner.my.program.records.button',\n description: 'Text for the My Program Records button displayed on the banner in the Completed tab of the program progress page.',\n }\n});\n\nexport default messages;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSiteConfig } from '@openedx/frontend-base';
|
|
2
2
|
export const getApiUrl = () => (`${getSiteConfig().lmsBaseUrl}/api`);
|
|
3
|
-
export const programProgressUrl = (uuid) => `${getApiUrl()}/
|
|
3
|
+
export const programProgressUrl = (uuid) => `${getApiUrl()}/subscription/programs/${encodeURIComponent(uuid)}/`;
|
|
4
4
|
export const programsApiUrl = () => `${getApiUrl()}/subscription/programs/dashboard/`;
|
|
5
5
|
//# sourceMappingURL=urls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urls.js","sourceRoot":"","sources":["../../../../src/data/services/subs/urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC,UAAU,MAAM,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,GAAG,SAAS,EAAE,0BAA0B,kBAAkB,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"urls.js","sourceRoot":"","sources":["../../../../src/data/services/subs/urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC,UAAU,MAAM,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,GAAG,SAAS,EAAE,0BAA0B,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC;AACxH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,GAAG,SAAS,EAAE,mCAAmC,CAAC","sourcesContent":["import { getSiteConfig } from '@openedx/frontend-base';\n\nexport const getApiUrl = () => (`${getSiteConfig().lmsBaseUrl}/api`);\n\nexport const programProgressUrl = (uuid: string) => `${getApiUrl()}/subscription/programs/${encodeURIComponent(uuid)}/`;\nexport const programsApiUrl = () => `${getApiUrl()}/subscription/programs/dashboard/`;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function dateFormatter(formatDate: any, date: any): any;
|
|
1
|
+
export function dateFormatter(formatDate: any, date: any, monthFormat?: string): any;
|
|
2
2
|
export default dateFormatter;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import moment from 'moment';
|
|
2
|
-
export const dateFormatter = (formatDate, date) => formatDate(moment(date).toDate(), {
|
|
2
|
+
export const dateFormatter = (formatDate, date, monthFormat = 'long') => formatDate(moment(date).toDate(), {
|
|
3
3
|
year: 'numeric',
|
|
4
|
-
month:
|
|
4
|
+
month: monthFormat,
|
|
5
5
|
day: 'numeric',
|
|
6
6
|
});
|
|
7
7
|
export default dateFormatter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateFormatter.js","sourceRoot":"","sources":["../../src/utils/dateFormatter.js"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"dateFormatter.js","sourceRoot":"","sources":["../../src/utils/dateFormatter.js"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;IACzG,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,WAAW;IAClB,GAAG,EAAE,SAAS;CACf,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC","sourcesContent":["import moment from 'moment';\n\nexport const dateFormatter = (formatDate, date, monthFormat = 'long') => formatDate(moment(date).toDate(), {\n year: 'numeric',\n month: monthFormat,\n day: 'numeric',\n});\n\nexport default dateFormatter;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edx/frontend-app-subscription-learner-dashboard",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "make build",
|
|
24
24
|
"clean": "make clean",
|
|
25
|
-
"dev": "PORT=
|
|
25
|
+
"dev": "PORT=5000 PUBLIC_PATH=/subscription-learner-dashboard openedx dev",
|
|
26
26
|
"i18n_extract": "openedx formatjs extract",
|
|
27
27
|
"lint": "openedx lint .",
|
|
28
28
|
"lint:fix": "openedx lint --fix .",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from '@openedx/paragon';
|
|
3
|
-
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
-
import messages from '../messages';
|
|
5
|
-
export const ViewCourseDetailButton = () => {
|
|
6
|
-
const { formatMessage } = useIntl();
|
|
7
|
-
return (_jsx(Button, { variant: "outline-primary", children: formatMessage(messages.programProgressCardViewCourseDetailButton) }));
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=ViewCourseDetailButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ViewCourseDetailButton.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/ViewCourseDetailButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,sBAAsB,GAAO,GAAG,EAAE;IAC7C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,YAC9B,aAAa,CAAC,QAAQ,CAAC,yCAAyC,CAAC,GAC3D,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { Button } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport messages from '../messages';\n\nexport const ViewCourseDetailButton: FC = () => {\n const { formatMessage } = useIntl();\n\n return (\n <Button variant=\"outline-primary\">\n {formatMessage(messages.programProgressCardViewCourseDetailButton)}\n </Button>\n );\n};\n"]}
|