@edx/frontend-app-subscription-learner-dashboard 1.6.0 → 1.7.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/ProgramsList/index.js +1 -1
- package/dist/containers/ProgramDashboard/ProgramsList/index.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramsList/messages.d.ts +0 -5
- package/dist/containers/ProgramDashboard/ProgramsList/messages.js +0 -5
- package/dist/containers/ProgramDashboard/ProgramsList/messages.js.map +1 -1
- package/dist/containers/ProgramsPanel/index.js +6 -3
- package/dist/containers/ProgramsPanel/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ const ProgramsList = () => {
|
|
|
30
30
|
contactSupportUrl: (_jsx(Alert.Link, { href: contactUrl, children: contactUrl })),
|
|
31
31
|
}) }));
|
|
32
32
|
};
|
|
33
|
-
return (_jsxs(Container, { size: "lg", children: [_jsx("
|
|
33
|
+
return (_jsxs(Container, { size: "lg", children: [_jsx("p", { children: formatMessage(messages.programsListDescriptionText) }), _jsx(Row, { className: "py-3", children: errorState ? renderFailureAlert() : renderPrograms() })] }));
|
|
34
34
|
};
|
|
35
35
|
export default ProgramsList;
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramsList/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,GAC9C,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,eAAe,MAAM,mBAAmB,CA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AC,SAAS,IAAC,IAAI,EAAC,IAAI,aAClB,sBACG,aAAa,CAAC,QAAQ,CAAC,2BAA2B,CAAC,GAClD,EACJ,KAAC,GAAG,IAAC,SAAS,EAAC,MAAM,YAClB,UAAU,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,GACjD,IACI,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React, { useEffect } from 'react';\nimport {\n Alert, CardGrid, Col, Container, Row, Spinner,\n} from '@openedx/paragon';\nimport { useIntl, logError, getSiteConfig } from '@openedx/frontend-base';\nimport appMessages from '../../../messages';\nimport ProgramListCard from './ProgramListCard';\nimport messages from './messages';\n\nimport './index.scss';\nimport { useProgramsListData } from '@src/data/hooks';\n\nconst ProgramsList: React.FC = () => {\n const { formatMessage } = useIntl();\n\n const {\n data: programsData = [],\n isLoading,\n isError: errorState,\n error,\n } = useProgramsListData();\n\n useEffect(() => {\n if (error) {\n logError(error);\n }\n }, [error]);\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 <Container size=\"lg\">\n <p>\n {formatMessage(messages.programsListDescriptionText)}\n </p>\n <Row className=\"py-3\">\n {errorState ? renderFailureAlert() : renderPrograms()}\n </Row>\n </Container>\n );\n};\n\nexport default ProgramsList;\n"]}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { defineMessages } from '@openedx/frontend-base';
|
|
2
2
|
const messages = defineMessages({
|
|
3
|
-
programsListHeaderText: {
|
|
4
|
-
defaultMessage: 'Programs',
|
|
5
|
-
id: 'programs.list.header.text',
|
|
6
|
-
description: 'Header text for the programs list',
|
|
7
|
-
},
|
|
8
3
|
programsListDescriptionText: {
|
|
9
4
|
defaultMessage: 'When you enroll in a course associated with a program — professional certificate or MicroMasters — the program will be displayed here',
|
|
10
5
|
id: 'programs.list.description.text',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramsList/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramsList/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,2BAA2B,EAAE;QAC3B,cAAc,EAAE,uIAAuI;QACvJ,EAAE,EAAE,gCAAgC;QACpC,WAAW,EAAE,wCAAwC;KACtD;IACD,gCAAgC,EAAE;QAChC,EAAE,EAAE,iEAAiE;QACrE,cAAc,EAAE,WAAW;QAC3B,WAAW,EAAE,mDAAmD;KACjE;IACD,iCAAiC,EAAE;QACjC,EAAE,EAAE,kEAAkE;QACtE,cAAc,EAAE,aAAa;QAC7B,WAAW,EAAE,qDAAqD;KACnE;IACD,8BAA8B,EAAE;QAC9B,EAAE,EAAE,iEAAiE;QACrE,cAAc,EAAE,WAAW;QAC3B,WAAW,EAAE,mDAAmD;KACjE;IACD,8BAA8B,EAAE;QAC9B,EAAE,EAAE,yCAAyC;QAC7C,cAAc,EAAE,wKAAwK;QACxL,WAAW,EAAE,uDAAuD;KACrE;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n programsListDescriptionText: {\n defaultMessage: 'When you enroll in a course associated with a program — professional certificate or MicroMasters — the program will be displayed here',\n id: 'programs.list.description.text',\n description: 'Description text for the programs list',\n },\n progressCategoryBubblesRemaining: {\n id: 'dashboard.programs.program.listing.card.remaining.courses.count',\n defaultMessage: 'Remaining',\n description: 'Label for remaining courses count on program card',\n },\n progressCategoryBubblesInProgress: {\n id: 'dashboard.programs.program.listing.card.inProgress.courses.count',\n defaultMessage: 'In Progress',\n description: 'Label for in progress courses count on program card',\n },\n progressCategoryBubblesSuccess: {\n id: 'dashboard.programs.program.listing.card.completed.courses.count',\n defaultMessage: 'Completed',\n description: 'Label for completed courses count on program card',\n },\n errorLoadingProgramEnrollments: {\n id: 'alert.error.loading.program.enrollments',\n defaultMessage: 'An error occurred while attempting to retrieve program enrollments. Try refreshing the page. If that doesn\\'t solve the issue, contact support at {contactSupportUrl}.',\n description: 'Alert message for failure to load program enrollments',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
3
|
import { useIntl } from '@openedx/frontend-base';
|
|
4
4
|
import messages from './messages';
|
|
5
5
|
import NoProgramsView from './NoProgramsView';
|
|
6
|
+
import { ProgramsList } from '../ProgramDashboard';
|
|
7
|
+
import { useProgramsListData } from '../../data/hooks/queryHooks';
|
|
6
8
|
export const ProgramsPanel = () => {
|
|
7
9
|
const { formatMessage } = useIntl();
|
|
8
|
-
const [
|
|
9
|
-
|
|
10
|
+
const { data: programsData = [] } = useProgramsListData();
|
|
11
|
+
const hasProgramsEnrollment = useMemo(() => (programsData === null || programsData === void 0 ? void 0 : programsData.length) > 0, [programsData]);
|
|
12
|
+
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) }) }), !hasProgramsEnrollment ? _jsx(NoProgramsView, {}) : _jsx(ProgramsList, {})] }) }));
|
|
10
13
|
};
|
|
11
14
|
export default ProgramsPanel;
|
|
12
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/ProgramsPanel/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,
|
|
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;AACjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,CAAC,MAAM,aAAa,GAAO,GAAG,EAAE;IACpC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAC1D,MAAM,qBAAqB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM,IAAG,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtF,OAAO,CACL,4BACE,eAAK,SAAS,EAAC,8BAA8B,iBAAa,eAAe,aACvE,cAAK,SAAS,EAAC,qDAAqD,YAClE,aAAI,SAAS,EAAC,0BAA0B,YAAE,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAM,GAC9E,EACL,CAAC,qBAAqB,CAAC,CAAC,CAAC,KAAC,cAAc,KAAG,CAAC,CAAC,CAAC,KAAC,YAAY,KAAG,IAC3D,GACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { FC, useMemo } from 'react';\nimport { 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: programsData = [] } = useProgramsListData();\n const hasProgramsEnrollment = useMemo(() => programsData?.length > 0, [programsData]);\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 {!hasProgramsEnrollment ? <NoProgramsView /> : <ProgramsList />}\n </div>\n </>\n );\n};\n\nexport default ProgramsPanel;\n"]}
|