@edx/frontend-app-subscription-learner-dashboard 1.8.3 → 1.8.5
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/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/UpgradeButton/UpgradeAllButton.js +4 -7
- package/dist/containers/ProgramDashboard/ProgramProgress/UpgradeButton/UpgradeAllButton.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramsList/index.d.ts +2 -1
- package/dist/containers/ProgramDashboard/ProgramsList/index.js +4 -12
- package/dist/containers/ProgramDashboard/ProgramsList/index.js.map +1 -1
- package/dist/containers/ProgramsPanel/index.js +8 -4
- package/dist/containers/ProgramsPanel/index.js.map +1 -1
- package/dist/data/hooks/queryHooks.d.ts +2 -2
- package/dist/data/hooks/queryHooks.js +3 -3
- package/dist/data/hooks/queryHooks.js.map +1 -1
- package/dist/data/services/lms/api.d.ts +1 -2
- package/dist/data/services/lms/api.js +1 -6
- package/dist/data/services/lms/api.js.map +1 -1
- package/dist/data/services/lms/urls.d.ts +0 -1
- package/dist/data/services/lms/urls.js +0 -2
- package/dist/data/services/lms/urls.js.map +1 -1
- package/dist/data/services/subs/api.d.ts +1 -0
- package/dist/data/services/subs/api.js +11 -1
- package/dist/data/services/subs/api.js.map +1 -1
- package/dist/data/services/subs/index.d.ts +1 -1
- package/dist/data/services/subs/index.js +1 -1
- package/dist/data/services/subs/index.js.map +1 -1
- package/dist/data/services/subs/urls.d.ts +1 -0
- package/dist/data/services/subs/urls.js +2 -1
- package/dist/data/services/subs/urls.js.map +1 -1
- package/package.json +1 -1
|
@@ -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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,MAAM,WAAW,GAAG,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,mCAAI,EAAE,CAAC;IAC5C,MAAM,qBAAqB,GAAG,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,0CAAE,MAAM,KAAI,CAAC,CAAC;IAClE,MAAM,oBAAoB,GAAG,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,0CAAE,MAAM,KAAI,CAAC,CAAC;IACjE,MAAM,oBAAoB,GAAG,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,0CAAE,MAAM,KAAI,CAAC,CAAC;
|
|
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,GAA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AS,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,OAAO,aAClD,KAAC,qBAAqB,IACpB,YAAY,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,mCAAI,EAAE,EACtC,WAAW,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,mCAAI,EAAE,EACpC,sBAAsB,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,sBAAsB,GAC3D,EACF,KAAC,GAAG,cACF,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,aAChB,KAAC,mBAAmB,IAClB,mBAAmB,EAAE,mBAAmB,EACxC,qBAAqB,EAAE,qBAAqB,EAC5C,YAAY,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,mCAAI,EAAE,EACtC,YAAY,EAAE,YAAY,GAC1B,EACF,KAAC,mBAAmB,IAAC,MAAM,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE,SAAS,EAAE,oBAAoB,EAAE,SAAS,EAAE,oBAAoB,EAAE,EAAE,IAAI,EAAE,WAAW,GAAI,IACvJ,GACF,IACI,IACX,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FC } 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,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,mBAAmB,GAAuC,CAAC,EAC/D,mBAAmB,EAAE,qBAAqB,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"ProgramProgressInfo.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramProgress/ProgramProgressInfo.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,mBAAmB,GAAuC,CAAC,EAC/D,mBAAmB,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,EACvE,EAAE,EAAE;IACH,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,OAAO,CACL,cAAK,SAAS,EAAC,QAAQ,YACpB,mBAAmB;YAClB,CAAC,CAAC,CACE,8BACE,uBAAK,aAAa,CAAC,QAAQ,CAAC,6BAA6B,CAAC,GAAM,EAChE,sBAAI,aAAa,CAAC,QAAQ,CAAC,2BAA2B,EAAE,EAAE,YAAY,EAAE,CAAC,GAAK,IAC7E,CACJ;YACH,CAAC,CAAC,CACE,8BACE,aAAI,SAAS,EAAC,yCAAyC,YAAE,aAAa,CAAC,QAAQ,CAAC,+BAA+B,CAAC,GAAM,EACtH,YAAG,SAAS,EAAC,sBAAsB,iBAAa,8BAA8B,YAC3E,aAAa,CAAC,QAAQ,CAAC,6BAA6B,EAAE,EAAE,qBAAqB,EAAE,CAAC,GAC/E,EACH,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,KAAI,OAAO,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,YAAY,CAAA,KAAK,QAAQ,IAAI,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"]}
|
|
@@ -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,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;QACzD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,EACJ,QAAQ,EACR,yBAAyB,EACzB,YAAY,GACb,GAAG,YAAY,CAAC;QAEjB,OAAO,CACL,8BACE,eAAM,SAAS,EAAC,YAAY,YAC1B,KAAC,eAAe,IACd,KAAK,EAAE,yBAAyB,EAChC,KAAK,EAAC,UAAU,EAChB,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,CAAC,EACxB,qBAAqB,EAAE,CAAC,GACxB,GACG,EACP,yBACE,KAAC,eAAe,IACd,KAAK,EAAE,YAAY,EACnB,KAAK,EAAC,UAAU,EAChB,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,CAAC,EACxB,qBAAqB,EAAE,CAAC,GACxB,GACG,IACN,CACJ,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,MAAM,IACL,EAAE,EAAC,GAAG,EACN,SAAS,EAAC,oBAAoB,EAC9B,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC,YAAY,iBACnB,oBAAoB,EAChC,OAAO,EAAC,OAAO,aAEf,yBACG,aAAa,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"]}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useIntl, logError, getSiteConfig } from '@openedx/frontend-base';
|
|
2
|
+
import { Alert, CardGrid, Col, Row, Spinner, } from '@openedx/paragon';
|
|
3
|
+
import { useIntl, getSiteConfig } from '@openedx/frontend-base';
|
|
5
4
|
import appMessages from '../../../messages';
|
|
6
5
|
import ProgramListCard from './ProgramListCard';
|
|
7
6
|
import messages from './messages';
|
|
8
7
|
import './index.scss';
|
|
9
|
-
|
|
10
|
-
const ProgramsList = () => {
|
|
8
|
+
const ProgramsList = ({ programsData, isLoading, errorState }) => {
|
|
11
9
|
const { formatMessage } = useIntl();
|
|
12
|
-
const { data: programsData = [], isLoading, isError: errorState, error, } = useProgramsListData();
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (error) {
|
|
15
|
-
logError(error);
|
|
16
|
-
}
|
|
17
|
-
}, [error]);
|
|
18
10
|
const renderPrograms = () => {
|
|
19
11
|
if (isLoading) {
|
|
20
12
|
return (_jsx(Col, { sm: 12, className: "d-flex justify-content-center py-4", children: _jsx(Spinner, { animation: "border", screenReaderText: formatMessage(appMessages['subs-dash.loadingSR']) }) }));
|
|
@@ -30,7 +22,7 @@ const ProgramsList = () => {
|
|
|
30
22
|
contactSupportUrl: (_jsx(Alert.Link, { href: contactUrl, children: contactUrl })),
|
|
31
23
|
}) }));
|
|
32
24
|
};
|
|
33
|
-
return (_jsxs(
|
|
25
|
+
return (_jsxs("div", { children: [_jsx("p", { children: formatMessage(messages.programsListDescriptionText) }), _jsx(Row, { className: "py-3", children: errorState ? renderFailureAlert() : renderPrograms() })] }));
|
|
34
26
|
};
|
|
35
27
|
export default ProgramsList;
|
|
36
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramsList/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramsList/index.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,GACnC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,OAAO,cAAc,CAAC;AAEtB,MAAM,YAAY,GAA0B,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE;IACtF,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,CACL,KAAC,GAAG,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,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React from 'react';\nimport {\n Alert, CardGrid, Col, Row, Spinner,\n} from '@openedx/paragon';\nimport { useIntl, getSiteConfig } from '@openedx/frontend-base';\nimport appMessages from '../../../messages';\nimport ProgramListCard from './ProgramListCard';\nimport messages from './messages';\nimport { ProgramList } from '../data/types';\n\nimport './index.scss';\n\nconst ProgramsList: React.FC<ProgramList> = ({ programsData, isLoading, errorState }) => {\n const { formatMessage } = useIntl();\n\n const renderPrograms = () => {\n if (isLoading) {\n return (\n <Col sm={12} className=\"d-flex justify-content-center py-4\">\n <Spinner animation=\"border\" screenReaderText={formatMessage(appMessages['subs-dash.loadingSR'])} />\n </Col>\n );\n }\n if (programsData.length > 0) {\n return (\n <>\n <Col sm={12} md={12}>\n <CardGrid columnSizes={{ xs: 12, lg: 6 }}>\n {programsData.map(program => (\n <ProgramListCard\n key={program.uuid}\n program={program}\n />\n ))}\n </CardGrid>\n </Col>\n </>\n );\n }\n return null;\n };\n\n const renderFailureAlert = () => {\n const contactUrl = `${getSiteConfig().lmsBaseUrl}/contact`;\n return (\n <Alert className=\"mx-auto container-mw-md\" variant=\"danger\">\n {formatMessage(messages.errorLoadingProgramEnrollments, {\n contactSupportUrl: (\n <Alert.Link href={contactUrl}>\n {contactUrl}\n </Alert.Link>\n ),\n })}\n </Alert>\n );\n };\n\n return (\n <div>\n <p>\n {formatMessage(messages.programsListDescriptionText)}\n </p>\n <Row className=\"py-3\">\n {errorState ? renderFailureAlert() : renderPrograms()}\n </Row>\n </div>\n );\n};\n\nexport default ProgramsList;\n"]}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { useIntl } from '@openedx/frontend-base';
|
|
3
|
+
import { camelCaseObject, useIntl } from '@openedx/frontend-base';
|
|
4
4
|
import messages from './messages';
|
|
5
5
|
import NoProgramsView from './NoProgramsView';
|
|
6
6
|
import { ProgramsList } from '../ProgramDashboard';
|
|
7
7
|
import { useProgramsListData } from '../../data/hooks/queryHooks';
|
|
8
8
|
export const ProgramsPanel = () => {
|
|
9
9
|
const { formatMessage } = useIntl();
|
|
10
|
-
const { data
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
const { data, isLoading, isError: errorState } = useProgramsListData();
|
|
11
|
+
const programsData = useMemo(() => { var _a; return (_a = camelCaseObject(data === null || data === void 0 ? void 0 : data.programs)) !== null && _a !== void 0 ? _a : []; }, [data === null || data === void 0 ? void 0 : data.programs]);
|
|
12
|
+
const hasProgramsEnrollment = programsData.length > 0;
|
|
13
|
+
const shouldRenderNoProgramsView = !isLoading && !errorState && !hasProgramsEnrollment;
|
|
14
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: "programs-list-container mb-5", "data-testid": "programs-list", children: [_jsx("div", { className: "d-flex flex-row justify-content-between text-center", children: _jsx("h3", { className: "programs-list-title mb-3", children: formatMessage(messages.myPrograms) }) }), shouldRenderNoProgramsView
|
|
15
|
+
? _jsx(NoProgramsView, {})
|
|
16
|
+
: _jsx(ProgramsList, { programsData: programsData, isLoading: isLoading, errorState: errorState })] }) }));
|
|
13
17
|
};
|
|
14
18
|
export default ProgramsPanel;
|
|
15
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/ProgramsPanel/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/ProgramsPanel/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,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useIntl } from '@openedx/frontend-base';\nimport messages from './messages';\nimport NoProgramsView from './NoProgramsView';\nimport { ProgramsList } from '../ProgramDashboard';\nimport { useProgramsListData } from '@src/data/hooks/queryHooks';\n\nexport const ProgramsPanel: FC = () => {\n const { formatMessage } = useIntl();\n const { data, isLoading, isError: errorState } = useProgramsListData();\n const programsData = useMemo(() => camelCaseObject(data?.programs) ?? [], [data?.programs]);\n const hasProgramsEnrollment = programsData.length > 0;\n const shouldRenderNoProgramsView = !isLoading && !errorState && !hasProgramsEnrollment;\n\n return (\n <>\n <div className=\"programs-list-container mb-5\" data-testid=\"programs-list\">\n <div className=\"d-flex flex-row justify-content-between text-center\">\n <h3 className=\"programs-list-title mb-3\">{formatMessage(messages.myPrograms)}</h3>\n </div>\n {shouldRenderNoProgramsView\n ? <NoProgramsView />\n : <ProgramsList programsData={programsData} isLoading={isLoading} errorState={errorState} />}\n </div>\n </>\n );\n};\n\nexport default ProgramsPanel;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProgramListData, ProgramProgressData } from '@src/containers/ProgramDashboard/data/types';
|
|
2
2
|
declare const useInitializeLearnerHome: () => {
|
|
3
3
|
data: any;
|
|
4
4
|
error: any;
|
|
@@ -162,6 +162,6 @@ declare const useInitializeLearnerHome: () => {
|
|
|
162
162
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
163
163
|
promise: Promise<any>;
|
|
164
164
|
};
|
|
165
|
-
declare const useProgramsListData: () => import("@tanstack/react-query").UseQueryResult<
|
|
165
|
+
declare const useProgramsListData: () => import("@tanstack/react-query").UseQueryResult<ProgramListData, Error>;
|
|
166
166
|
declare const useProgramProgressData: (uuid: string) => import("@tanstack/react-query").UseQueryResult<ProgramProgressData, Error>;
|
|
167
167
|
export { useInitializeLearnerHome, useProgramProgressData, useProgramsListData, };
|
|
@@ -11,10 +11,10 @@ import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
|
11
11
|
import { useContext, useEffect } from 'react';
|
|
12
12
|
import { useMasquerade } from '../../data/context';
|
|
13
13
|
import GlobalDataContext from '../../data/contexts/GlobalDataContext';
|
|
14
|
-
import { initializeList,
|
|
14
|
+
import { initializeList, } from '../../data/services/lms/api';
|
|
15
15
|
import { getTransformedCourseDataObject } from '../../utils/dataTransformers';
|
|
16
16
|
import { learnerDashboardQueryKeys } from './queryKeys';
|
|
17
|
-
import { getProgramProgressData } from '../../data/services/subs';
|
|
17
|
+
import { getProgramProgressData, getProgramsListData } from '../../data/services/subs';
|
|
18
18
|
const useInitializeLearnerHome = () => {
|
|
19
19
|
const { masqueradeUser } = useMasquerade();
|
|
20
20
|
const queryClient = useQueryClient();
|
|
@@ -57,7 +57,7 @@ const useInitializeLearnerHome = () => {
|
|
|
57
57
|
const useProgramsListData = () => {
|
|
58
58
|
return useQuery({
|
|
59
59
|
queryKey: ['programsList'],
|
|
60
|
-
queryFn:
|
|
60
|
+
queryFn: getProgramsListData,
|
|
61
61
|
retry: false,
|
|
62
62
|
refetchOnWindowFocus: false,
|
|
63
63
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryHooks.js","sourceRoot":"","sources":["../../../src/data/hooks/queryHooks.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,iBAAiB,MAAM,sCAAsC,CAAC;AACrE,OAAO,EACL,cAAc,
|
|
1
|
+
{"version":3,"file":"queryHooks.js","sourceRoot":"","sources":["../../../src/data/hooks/queryHooks.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,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B,EAAE,IAAI,CAAC;QACnC,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC;QAC3C,OAAO,EAAE,CAAC,CAAC,IAAI;QACf,SAAS,EAAE,IAAI,GAAG,EAAE,GAAG,CAAC,EAAE,gBAAgB;QAC1C,KAAK,EAAE,CAAC;KACT,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,GACpB,CAAC","sourcesContent":["import { useQuery, useQueryClient } from '@tanstack/react-query';\nimport { useContext, useEffect } from 'react';\nimport { useMasquerade } from '@src/data/context';\nimport GlobalDataContext from '@src/data/contexts/GlobalDataContext';\nimport {\n initializeList,\n} from '@src/data/services/lms/api';\nimport { ProgramListData, ProgramProgressData } from '@src/containers/ProgramDashboard/data/types';\nimport { getTransformedCourseDataObject } from '@src/utils/dataTransformers';\nimport { learnerDashboardQueryKeys } from './queryKeys';\nimport { getProgramProgressData, getProgramsListData } from '@src/data/services/subs';\n\nconst useInitializeLearnerHome = () => {\n const { masqueradeUser } = useMasquerade();\n const queryClient = useQueryClient();\n const { setEmailConfirmation, setPlatformSettings } = useContext(GlobalDataContext);\n\n const query = useQuery({\n queryKey: learnerDashboardQueryKeys.initialize(masqueradeUser),\n queryFn: async () => {\n const data = await initializeList(masqueradeUser);\n return {\n ...data,\n coursesByCardId: getTransformedCourseDataObject(data?.courses || []),\n };\n },\n staleTime: 5 * 60 * 1000, // 5 minutes — dashboard data rarely changes while viewing\n retry: (failureCount, error: any) => {\n // Don't retry client errors (4xx) — they won't resolve on retry\n if (error?.response?.status >= 400 && error?.response?.status < 500) return false;\n return failureCount < 3;\n },\n retryOnMount: !masqueradeUser,\n refetchOnMount: !masqueradeUser,\n });\n\n // Populate shell-level GlobalDataProvider so header widgets can access this data\n useEffect(() => {\n if (query.data && !masqueradeUser) {\n if (query.data.emailConfirmation && setEmailConfirmation) {\n setEmailConfirmation(query.data.emailConfirmation);\n }\n if (query.data.platformSettings && setPlatformSettings) {\n setPlatformSettings(query.data.platformSettings);\n }\n }\n }, [masqueradeUser, query.data, setEmailConfirmation, setPlatformSettings]);\n\n // When masquerading fails, fall back to the normal user's cached data\n let { data } = query;\n if (masqueradeUser && query.isError) {\n data = queryClient.getQueryData(learnerDashboardQueryKeys.initialize(undefined));\n }\n\n return { ...query, data };\n};\n\nconst useProgramsListData = () => {\n return useQuery<ProgramListData>({\n queryKey: ['programsList'],\n queryFn: getProgramsListData,\n retry: false,\n refetchOnWindowFocus: false,\n });\n};\n\nconst useProgramProgressData = (uuid: string) => {\n return useQuery<ProgramProgressData>({\n queryKey: ['programProgress', uuid],\n queryFn: () => getProgramProgressData(uuid),\n enabled: !!uuid,\n staleTime: 1000 * 60 * 5, // 5 min caching\n retry: 2,\n });\n};\n\nexport {\n useInitializeLearnerHome,\n useProgramProgressData,\n useProgramsListData,\n};\n"]}
|
|
@@ -29,5 +29,4 @@ declare const createCreditRequest: ({ providerId, courseId, username }: {
|
|
|
29
29
|
username: any;
|
|
30
30
|
}) => Promise<any>;
|
|
31
31
|
declare const sendConfirmEmail: (sendEmailUrl: string) => Promise<any>;
|
|
32
|
-
|
|
33
|
-
export { initializeList, unenrollFromCourse, updateEntitlementEnrollment, deleteEntitlementEnrollment, updateEmailSettings, logEvent, logShare, createCreditRequest, sendConfirmEmail, fetchProgramsListData, };
|
|
32
|
+
export { initializeList, unenrollFromCourse, updateEntitlementEnrollment, deleteEntitlementEnrollment, updateEmailSettings, logEvent, logShare, createCreditRequest, sendConfirmEmail, };
|
|
@@ -76,10 +76,5 @@ const sendConfirmEmail = (sendEmailUrl) => __awaiter(void 0, void 0, void 0, fun
|
|
|
76
76
|
const response = yield getAuthenticatedHttpClient().post(sendEmailUrl);
|
|
77
77
|
return response;
|
|
78
78
|
});
|
|
79
|
-
|
|
80
|
-
const url = urls.programsApiUrl();
|
|
81
|
-
const { data } = yield getAuthenticatedHttpClient().get(url);
|
|
82
|
-
return data;
|
|
83
|
-
});
|
|
84
|
-
export { initializeList, unenrollFromCourse, updateEntitlementEnrollment, deleteEntitlementEnrollment, updateEmailSettings, logEvent, logShare, createCreditRequest, sendConfirmEmail, fetchProgramsListData, };
|
|
79
|
+
export { initializeList, unenrollFromCourse, updateEntitlementEnrollment, deleteEntitlementEnrollment, updateEmailSettings, logEvent, logShare, createCreditRequest, sendConfirmEmail, };
|
|
85
80
|
//# sourceMappingURL=api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../src/data/services/lms/api.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACnG,OAAO,IAAI,MAAM,6BAA6B,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAEjD,MAAM,cAAc,GAAG,CAAO,IAAI,EAAE,EAAE;IACpC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CACrD,YAAY,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAC7D,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC,CAAA,CAAC;AAEF,MAAM,kBAAkB,GAAG,KAAqB,EAAE,4CAAhB,EAAE,QAAQ,EAAE;IAC5C,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IAClC,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAA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E,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACnD,MAAM,QAAQ,GAAG,MAAM,0BAA0B,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACvE,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAO,YAAoB,EAAE,EAAE;IACtD,MAAM,QAAQ,GAAG,MAAM,0BAA0B,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACvE,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,EAC3B,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,GACjB,CAAC","sourcesContent":["import { getAuthenticatedHttpClient } from '@openedx/frontend-base';\nimport { apiKeys, enableEmailsAction, unenrollmentAction } from '@src/data/services/lms/constants';\nimport urls from '@src/data/services/lms/urls';\nimport { stringifyUrl } from '@src/data/services/lms/utils';\nimport eventNames from '@src/tracking/constants';\n\nconst initializeList = async (user) => {\n const { data } = await getAuthenticatedHttpClient().get(\n stringifyUrl(urls.getInitApiUrl(), { [apiKeys.user]: user }),\n );\n return data;\n};\n\nconst unenrollFromCourse = async ({ courseId }) => {\n const url = urls.courseUnenroll();\n const formData = new FormData();\n formData.append(apiKeys.courseId, courseId);\n Object.entries(unenrollmentAction).forEach(([key, value]) => {\n formData.append(key, value);\n });\n const response = await getAuthenticatedHttpClient().post(url, formData);\n return response;\n};\n\nconst updateEntitlementEnrollment = async ({ uuid, courseId }) => {\n const url = urls.entitlementEnrollment(uuid);\n const content = { [apiKeys.courseRunId]: courseId };\n const response = await getAuthenticatedHttpClient().post(url, content);\n return response;\n};\n\nconst deleteEntitlementEnrollment = async ({ uuid, isRefundable }) => {\n const url = stringifyUrl(\n urls.entitlementEnrollment(uuid),\n { [apiKeys.isRefund]: isRefundable },\n );\n const response = await getAuthenticatedHttpClient().delete(url);\n return response;\n};\n\nconst updateEmailSettings = async ({ courseId, enable }) => {\n const url = urls.updateEmailSettings();\n const content = { [apiKeys.courseId]: courseId, ...(enable && enableEmailsAction) };\n const response = await getAuthenticatedHttpClient().post(url, content);\n return response;\n};\n\nconst logEvent = async ({ eventName, data, courseId }) => {\n const url = urls.event();\n const content = {\n courserun_key: courseId,\n event_type: eventName,\n page: window.location.href,\n event: JSON.stringify(data),\n };\n const response = await getAuthenticatedHttpClient().post(url, content);\n return response;\n};\n\nconst logShare = ({ courseId, site }) => {\n const eventData = {\n eventName: eventNames.shareClicked,\n courseId,\n data: {\n course_id: courseId,\n social_media_site: site,\n location: 'dashboard',\n },\n };\n return logEvent(eventData);\n};\n\nconst createCreditRequest = async ({ providerId, courseId, username }) => {\n const url = urls.creditRequestUrl(providerId);\n const content = { course_key: courseId, username };\n const response = await getAuthenticatedHttpClient().post(url, content);\n return response;\n};\n\nconst sendConfirmEmail = async (sendEmailUrl: string) => {\n const response = await getAuthenticatedHttpClient().post(sendEmailUrl);\n return response;\n};\n\nexport {\n initializeList,\n unenrollFromCourse,\n updateEntitlementEnrollment,\n deleteEntitlementEnrollment,\n updateEmailSettings,\n logEvent,\n logShare,\n createCreditRequest,\n sendConfirmEmail,\n};\n"]}
|
|
@@ -4,6 +4,5 @@ export function baseAppUrl(url: any): any;
|
|
|
4
4
|
export function learningMfeUrl(url: any): any;
|
|
5
5
|
export function creditPurchaseUrl(courseId: any): string;
|
|
6
6
|
export function creditRequestUrl(providerId: any): string;
|
|
7
|
-
export function programsApiUrl(): string;
|
|
8
7
|
declare const _default: any;
|
|
9
8
|
export default _default;
|
|
@@ -21,7 +21,6 @@ export const creditPurchaseUrl = (courseId) => {
|
|
|
21
21
|
: `${config.ECOMMERCE_BASE_URL}/credit/checkout/${courseId}/`;
|
|
22
22
|
};
|
|
23
23
|
export const creditRequestUrl = (providerId) => `${getApiUrl()}/credit/v1/providers/${providerId}/request/`;
|
|
24
|
-
export const programsApiUrl = () => `${getApiUrl()}/dashboard/v0/programs/`;
|
|
25
24
|
export default StrictDict({
|
|
26
25
|
getApiUrl,
|
|
27
26
|
baseAppUrl,
|
|
@@ -34,6 +33,5 @@ export default StrictDict({
|
|
|
34
33
|
learningMfeUrl,
|
|
35
34
|
programsUrl,
|
|
36
35
|
updateEmailSettings,
|
|
37
|
-
programsApiUrl,
|
|
38
36
|
});
|
|
39
37
|
//# sourceMappingURL=urls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urls.js","sourceRoot":"","sources":["../../../../src/data/services/lms/urls.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAErE,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,UAAU,CAAC;AAEpD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC,UAAU,MAAM,CAAC,CAAC;AAErE,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAEjE,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,GAAG,UAAU,EAAE,QAAQ,CAAC;AAC5C,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,GAAG,UAAU,EAAE,oBAAoB,CAAC;AACjE,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,GAAG,SAAS,EAAE,wBAAwB,CAAC;AACzE,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,SAAS,EAAE,iCAAiC,IAAI,cAAc,CAAC;AAE1G,8CAA8C;AAC9C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,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AAU,CAAC,qBAAqB,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,EAAE;IAC5C,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,mBAAmB;QAC/B,CAAC,CAAC,GAAG,MAAM,CAAC,mBAAmB,IAAI,QAAQ,GAAG;QAC9C,CAAC,CAAC,GAAG,MAAM,CAAC,kBAAkB,oBAAoB,QAAQ,GAAG,CAAC;AAClE,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,SAAS,EAAE,wBAAwB,UAAU,WAAW,CAAC;AAE5G,eAAe,UAAU,CAAC;IACxB,SAAS;IACT,UAAU;IACV,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,qBAAqB;IACrB,KAAK;IACL,aAAa;IACb,cAAc;IACd,WAAW;IACX,mBAAmB;CACpB,CAAC,CAAC","sourcesContent":["import { appId } from '../../../constants';\nimport { StrictDict } from '../../../utils';\n\nimport { getAppConfig, getSiteConfig } from '@openedx/frontend-base';\n\nconst getBaseUrl = () => getSiteConfig().lmsBaseUrl;\n\nexport const getApiUrl = () => (`${getSiteConfig().lmsBaseUrl}/api`);\n\nconst getInitApiUrl = () => (`${getApiUrl()}/learner_home/init`);\n\nconst event = () => `${getBaseUrl()}/event`;\nconst courseUnenroll = () => `${getBaseUrl()}/change_enrollment`;\nconst updateEmailSettings = () => `${getApiUrl()}/change_email_settings`;\nconst entitlementEnrollment = (uuid) => `${getApiUrl()}/entitlements/v1/entitlements/${uuid}/enrollments`;\n\n// if url is null or absolute, return it as is\nexport const updateUrl = (base, url) => ((url == null || url.startsWith('http://') || url.startsWith('https://')) ? url : `${base}${url}`);\n\nexport const baseAppUrl = (url) => updateUrl(getBaseUrl(), url);\nexport const learningMfeUrl = (url) => updateUrl(getAppConfig(appId).LEARNING_BASE_URL, url);\n\n// static view url\nconst programsUrl = () => baseAppUrl('/dashboard/programs');\n\nexport const creditPurchaseUrl = (courseId) => {\n const config = getAppConfig(appId);\n return config.CREDIT_PURCHASE_URL\n ? `${config.CREDIT_PURCHASE_URL}/${courseId}/`\n : `${config.ECOMMERCE_BASE_URL}/credit/checkout/${courseId}/`;\n};\nexport const creditRequestUrl = (providerId) => `${getApiUrl()}/credit/v1/providers/${providerId}/request/`;\n\nexport default StrictDict({\n getApiUrl,\n baseAppUrl,\n courseUnenroll,\n creditPurchaseUrl,\n creditRequestUrl,\n entitlementEnrollment,\n event,\n getInitApiUrl,\n learningMfeUrl,\n programsUrl,\n updateEmailSettings,\n});\n"]}
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { getAuthenticatedHttpClient } from '@openedx/frontend-base';
|
|
11
|
-
import { programProgressUrl } from './urls';
|
|
11
|
+
import { programProgressUrl, programsApiUrl } from './urls';
|
|
12
12
|
const optimizedData = (data, size) => (data.length > size ? `${data.slice(0, size)}...` : data);
|
|
13
13
|
export const fetchRecommendedCourses = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
14
|
/* TODO [TEMP]: Replace with actual API call to fetch recommended courses data. For now, returning hardcoded data to simulate the API response. Also, built the test case for the same.
|
|
@@ -130,4 +130,14 @@ export const getProgramProgressData = (uuid) => __awaiter(void 0, void 0, void 0
|
|
|
130
130
|
throw error;
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
+
export const getProgramsListData = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
134
|
+
try {
|
|
135
|
+
const { data } = yield getAuthenticatedHttpClient().get(programsApiUrl());
|
|
136
|
+
return data;
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
console.error('Error fetching program list data:', error);
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
133
143
|
//# sourceMapping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,CAAA,CAAC","sourcesContent":["import { getAuthenticatedHttpClient } from '@openedx/frontend-base';\nimport { programProgressUrl } from './urls';\n\nconst optimizedData = (data: string, size: number) => (data.length > size ? `${data.slice(0, size)}...` : data);\n\nexport const fetchRecommendedCourses = async () => {\n /* TODO [TEMP]: Replace with actual API call to fetch recommended courses data. For now, returning hardcoded data to simulate the API response. Also, built the test case for the same.\n Reason: The API endpoint is not yet available and the data structure is still being finalized.\n Action: Revisit after endpoint is made available.\n */\n\n try {\n const finalData = [\n {\n id: 1,\n title: optimizedData('Essence Mascara Lash Princess', 30),\n body: optimizedData('The Essence Mascara Lash Princess is a popular mascara known for its volumizing and lengthening effects. Achieve dramatic lashes with this long-lasting and cruelty-free formula.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/essence-mascara-lash-princess/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/essence-mascara-lash-princess/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n },\n {\n id: 2,\n title: optimizedData('Eyeshadow Palette with Mirror', 30),\n body: optimizedData(\"The Eyeshadow Palette with Mirror offers a versatile range of eyeshadow shades for creating stunning eye looks. With a built-in mirror, it's convenient for on-the-go makeup application.\", 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/eyeshadow-palette-with-mirror/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/eyeshadow-palette-with-mirror/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n },\n {\n id: 3,\n title: optimizedData('Powder Canister', 30),\n body: optimizedData('The Powder Canister is a finely milled setting powder designed to set makeup and control shine. With a lightweight and translucent formula, it provides a smooth and matte finish.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/powder-canister/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/powder-canister/thumbnail.webp',\n isProgram: true, // TODO\n tagText: 'Professional Certificate',\n footerLabel: '2 Courses'\n },\n {\n id: 4,\n title: optimizedData('Red Lipstick', 30),\n body: optimizedData('The Red Lipstick is a classic and bold choice for adding a pop of color to your lips. With a creamy and pigmented formula, it provides a vibrant and long-lasting finish.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/red-lipstick/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/red-lipstick/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n }\n ];\n\n return finalData;\n } catch (error) {\n console.error('Error fetching cards data:', error);\n throw error;\n }\n};\n\nexport const fetchRecentlyViewedCoursesAndPrograms = async () => {\n /* TODO [TEMP]: Replace with actual API call to fetch recently viewed courses and programs data.\n Reason: The API endpoint is not yet available and the data structure is still being finalized.\n Action: Revisit after endpoint is made available.\n */\n\n try {\n const finalData = [\n {\n id: 1,\n title: optimizedData('Data Analytics Fundamentals', 30),\n body: optimizedData('Learn the core concepts of data analytics, including data cleaning, visualization, and basic statistical interpretation.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/essence-mascara-lash-princess/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/essence-mascara-lash-princess/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n },\n {\n id: 2,\n title: optimizedData('Product Management Essentials', 30),\n body: optimizedData('Review the workflows, tools, and communication patterns used by product managers to guide delivery across teams.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/eyeshadow-palette-with-mirror/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/eyeshadow-palette-with-mirror/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n },\n {\n id: 3,\n title: optimizedData('AI Product Strategy', 30),\n body: optimizedData('Continue a professional certificate covering AI roadmap planning, experimentation, and responsible product delivery.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/powder-canister/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/powder-canister/thumbnail.webp',\n isProgram: true,\n tagText: 'Professional Certificate',\n footerLabel: '3 Courses'\n },\n {\n id: 4,\n title: optimizedData('Red Lipstick', 30),\n body: optimizedData('The Red Lipstick is a classic and bold choice for adding a pop of color to your lips. With a creamy and pigmented formula, it provides a vibrant and long-lasting finish.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/red-lipstick/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/red-lipstick/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n }\n ];\n\n return finalData;\n } catch (error) {\n console.error('Error fetching recently viewed courses and programs data:', error);\n throw error;\n }\n};\n\nexport const getProgramProgressData = async (uuid: string) => {\n try {\n const { data } = await getAuthenticatedHttpClient().get(programProgressUrl(uuid));\n return data;\n } catch (error) {\n console.error('Error fetching program progress data:', error);\n throw error;\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../src/data/services/subs/api.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE5D,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAEhH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAS,EAAE;IAChD;;;QAGI;IAEJ,IAAI,CAAC;QACH,MAAM,SAAS,GAAG;YAChB;gBACE,EAAE,EAAE,CAAC;gBACL,KAAK,EAAE,aAAa,CAAC,+BAA+B,EAAE,EAAE,CAAC;gBACzD,IAAI,EAAE,aAAa,CAAC,mLAAmL,EAAE,GAAG,CAAC;gBAC7M,GAAG,EAAE,sFAAsF;gBAC3F,SAAS,EAAE,8F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f,OAAO,CAAC,KAAK,CAAC,2DAA2D,EAAE,KAAK,CAAC,CAAC;QAClF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAO,IAAY,EAAE,EAAE;IAC3D,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;QAClF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAS,EAAE;IAC5C,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;QAC1E,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;QAC1D,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAC","sourcesContent":["import { getAuthenticatedHttpClient } from '@openedx/frontend-base';\nimport { programProgressUrl, programsApiUrl } from './urls';\n\nconst optimizedData = (data: string, size: number) => (data.length > size ? `${data.slice(0, size)}...` : data);\n\nexport const fetchRecommendedCourses = async () => {\n /* TODO [TEMP]: Replace with actual API call to fetch recommended courses data. For now, returning hardcoded data to simulate the API response. Also, built the test case for the same.\n Reason: The API endpoint is not yet available and the data structure is still being finalized.\n Action: Revisit after endpoint is made available.\n */\n\n try {\n const finalData = [\n {\n id: 1,\n title: optimizedData('Essence Mascara Lash Princess', 30),\n body: optimizedData('The Essence Mascara Lash Princess is a popular mascara known for its volumizing and lengthening effects. Achieve dramatic lashes with this long-lasting and cruelty-free formula.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/essence-mascara-lash-princess/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/essence-mascara-lash-princess/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n },\n {\n id: 2,\n title: optimizedData('Eyeshadow Palette with Mirror', 30),\n body: optimizedData(\"The Eyeshadow Palette with Mirror offers a versatile range of eyeshadow shades for creating stunning eye looks. With a built-in mirror, it's convenient for on-the-go makeup application.\", 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/eyeshadow-palette-with-mirror/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/eyeshadow-palette-with-mirror/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n },\n {\n id: 3,\n title: optimizedData('Powder Canister', 30),\n body: optimizedData('The Powder Canister is a finely milled setting powder designed to set makeup and control shine. With a lightweight and translucent formula, it provides a smooth and matte finish.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/powder-canister/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/powder-canister/thumbnail.webp',\n isProgram: true, // TODO\n tagText: 'Professional Certificate',\n footerLabel: '2 Courses'\n },\n {\n id: 4,\n title: optimizedData('Red Lipstick', 30),\n body: optimizedData('The Red Lipstick is a classic and bold choice for adding a pop of color to your lips. With a creamy and pigmented formula, it provides a vibrant and long-lasting finish.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/red-lipstick/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/red-lipstick/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n }\n ];\n\n return finalData;\n } catch (error) {\n console.error('Error fetching cards data:', error);\n throw error;\n }\n};\n\nexport const fetchRecentlyViewedCoursesAndPrograms = async () => {\n /* TODO [TEMP]: Replace with actual API call to fetch recently viewed courses and programs data.\n Reason: The API endpoint is not yet available and the data structure is still being finalized.\n Action: Revisit after endpoint is made available.\n */\n\n try {\n const finalData = [\n {\n id: 1,\n title: optimizedData('Data Analytics Fundamentals', 30),\n body: optimizedData('Learn the core concepts of data analytics, including data cleaning, visualization, and basic statistical interpretation.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/essence-mascara-lash-princess/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/essence-mascara-lash-princess/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n },\n {\n id: 2,\n title: optimizedData('Product Management Essentials', 30),\n body: optimizedData('Review the workflows, tools, and communication patterns used by product managers to guide delivery across teams.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/eyeshadow-palette-with-mirror/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/eyeshadow-palette-with-mirror/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n },\n {\n id: 3,\n title: optimizedData('AI Product Strategy', 30),\n body: optimizedData('Continue a professional certificate covering AI roadmap planning, experimentation, and responsible product delivery.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/powder-canister/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/powder-canister/thumbnail.webp',\n isProgram: true,\n tagText: 'Professional Certificate',\n footerLabel: '3 Courses'\n },\n {\n id: 4,\n title: optimizedData('Red Lipstick', 30),\n body: optimizedData('The Red Lipstick is a classic and bold choice for adding a pop of color to your lips. With a creamy and pigmented formula, it provides a vibrant and long-lasting finish.', 100),\n url: 'https://cdn.dummyjson.com/product-images/beauty/red-lipstick/1.webp',\n thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/red-lipstick/thumbnail.webp',\n isProgram: false,\n tagText: '',\n footerLabel: 'Course'\n }\n ];\n\n return finalData;\n } catch (error) {\n console.error('Error fetching recently viewed courses and programs data:', error);\n throw error;\n }\n};\n\nexport const getProgramProgressData = async (uuid: string) => {\n try {\n const { data } = await getAuthenticatedHttpClient().get(programProgressUrl(uuid));\n return data;\n } catch (error) {\n console.error('Error fetching program progress data:', error);\n throw error;\n }\n};\n\nexport const getProgramsListData = async () => {\n try {\n const { data } = await getAuthenticatedHttpClient().get(programsApiUrl());\n return data;\n } catch (error) {\n console.error('Error fetching program list data:', error);\n throw error;\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { fetchRecommendedCourses, fetchRecentlyViewedCoursesAndPrograms, getProgramProgressData, } from './api';
|
|
1
|
+
export { fetchRecommendedCourses, fetchRecentlyViewedCoursesAndPrograms, getProgramProgressData, getProgramsListData, } from './api';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { fetchRecommendedCourses, fetchRecentlyViewedCoursesAndPrograms, getProgramProgressData, } from './api';
|
|
1
|
+
export { fetchRecommendedCourses, fetchRecentlyViewedCoursesAndPrograms, getProgramProgressData, getProgramsListData, } from './api';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data/services/subs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,qCAAqC,EACrC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data/services/subs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,qCAAqC,EACrC,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,OAAO,CAAC","sourcesContent":["export {\n fetchRecommendedCourses,\n fetchRecentlyViewedCoursesAndPrograms,\n getProgramProgressData,\n getProgramsListData,\n} from './api';\n"]}
|
|
@@ -1,4 +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
|
+
export const programsApiUrl = () => `${getApiUrl()}/subscription/programs/dashboard/`;
|
|
4
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"]}
|