@edx/frontend-app-subscription-learner-dashboard 1.4.0 → 1.5.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/Main.js +3 -2
- package/dist/Main.js.map +1 -1
- package/dist/containers/Dashboard/DashboardTabs.js +3 -2
- package/dist/containers/Dashboard/DashboardTabs.js.map +1 -1
- package/dist/containers/ProgramsPanel/NoProgramsView/index.d.ts +3 -0
- package/dist/containers/ProgramsPanel/NoProgramsView/index.js +13 -0
- package/dist/containers/ProgramsPanel/NoProgramsView/index.js.map +1 -0
- package/dist/containers/ProgramsPanel/NoProgramsView/messages.d.ts +13 -0
- package/dist/containers/ProgramsPanel/NoProgramsView/messages.js +15 -0
- package/dist/containers/ProgramsPanel/NoProgramsView/messages.js.map +1 -0
- package/dist/containers/ProgramsPanel/index.d.ts +3 -0
- package/dist/containers/ProgramsPanel/index.js +12 -0
- package/dist/containers/ProgramsPanel/index.js.map +1 -0
- package/dist/containers/ProgramsPanel/messages.d.ts +23 -0
- package/dist/containers/ProgramsPanel/messages.js +25 -0
- package/dist/containers/ProgramsPanel/messages.js.map +1 -0
- package/dist/containers/SubscriptionInformation/components/SubscriptionInformation.d.ts +2 -0
- package/dist/containers/SubscriptionInformation/components/SubscriptionInformation.js +32 -0
- package/dist/containers/SubscriptionInformation/components/SubscriptionInformation.js.map +1 -0
- package/dist/containers/SubscriptionInformation/index.d.ts +1 -0
- package/dist/containers/SubscriptionInformation/index.js +2 -0
- package/dist/containers/SubscriptionInformation/index.js.map +1 -0
- package/dist/containers/SubscriptionInformation/messages.d.ts +28 -0
- package/dist/containers/SubscriptionInformation/messages.js +30 -0
- package/dist/containers/SubscriptionInformation/messages.js.map +1 -0
- package/dist/data/constants/app.d.ts +3 -1
- package/dist/data/constants/app.js +3 -1
- package/dist/data/constants/app.js.map +1 -1
- package/package.json +1 -1
package/dist/Main.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CurrentAppProvider, PageWrap } from '@openedx/frontend-base';
|
|
3
3
|
import { appId } from './constants';
|
|
4
4
|
import ContextProviders from './data/context';
|
|
5
5
|
import Dashboard from './containers/Dashboard';
|
|
6
|
+
import { SubscriptionInformation } from './containers/SubscriptionInformation';
|
|
6
7
|
import './style.scss';
|
|
7
|
-
const Main = () => (_jsx(CurrentAppProvider, { appId: appId, children: _jsx(ContextProviders, { children:
|
|
8
|
+
const Main = () => (_jsx(CurrentAppProvider, { appId: appId, children: _jsx(ContextProviders, { children: _jsxs(PageWrap, { children: [_jsx(Dashboard, {}), _jsx(SubscriptionInformation, {})] }) }) }));
|
|
8
9
|
export default Main;
|
|
9
10
|
//# sourceMappingURL=Main.js.map
|
package/dist/Main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../src/Main.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,gBAAgB,MAAM,gBAAgB,CAAC;AAC9C,OAAO,SAAS,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../src/Main.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,gBAAgB,MAAM,gBAAgB,CAAC;AAC9C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,cAAc,CAAC;AAEtB,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,CACjB,KAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,YAC9B,KAAC,gBAAgB,cACf,MAAC,QAAQ,eACP,KAAC,SAAS,KAAG,EACb,KAAC,uBAAuB,KAAG,IAClB,GACM,GACA,CACtB,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { CurrentAppProvider, PageWrap } from '@openedx/frontend-base';\n\nimport { appId } from './constants';\nimport ContextProviders from './data/context';\nimport Dashboard from './containers/Dashboard';\nimport { SubscriptionInformation } from './containers/SubscriptionInformation';\n\nimport './style.scss';\n\nconst Main = () => (\n <CurrentAppProvider appId={appId}>\n <ContextProviders>\n <PageWrap>\n <Dashboard />\n <SubscriptionInformation />\n </PageWrap>\n </ContextProviders>\n </CurrentAppProvider>\n);\n\nexport default Main;\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState, useCallback } from 'react';
|
|
3
3
|
import { Tabs, Tab } from '@openedx/paragon';
|
|
4
|
-
import CoursesPanel from '
|
|
4
|
+
import CoursesPanel from '../CoursesPanel';
|
|
5
|
+
import ProgramsPanel from '../ProgramsPanel';
|
|
5
6
|
const DashboardTabs = () => {
|
|
6
7
|
var _a;
|
|
7
8
|
// Defining the tabs here
|
|
@@ -14,7 +15,7 @@ const DashboardTabs = () => {
|
|
|
14
15
|
{
|
|
15
16
|
key: 'programs',
|
|
16
17
|
title: 'Programs',
|
|
17
|
-
panel: _jsx(
|
|
18
|
+
panel: _jsx(ProgramsPanel, {}),
|
|
18
19
|
},
|
|
19
20
|
{
|
|
20
21
|
key: 'history',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardTabs.js","sourceRoot":"","sources":["../../../src/containers/Dashboard/DashboardTabs.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAA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,EACpB,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAC,MAAM,EAChB,YAAY,kBAEX,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CACxB,KAAC,GAAG,IAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,YACrC,GAAG,CAAC,KAAK,IADmC,GAAG,CAAC,GAAG,CAEhD,CACP,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import React, { useMemo, useState, useCallback } from 'react';\nimport { Tabs, Tab } from '@openedx/paragon';\nimport CoursesPanel from '../CoursesPanel';\nimport ProgramsPanel from '../ProgramsPanel';\n\nconst DashboardTabs = () => {\n // Defining the tabs here\n const dashboardTabs = useMemo(() => ([\n {\n key: 'courses',\n title: 'Courses',\n panel: <CoursesPanel />,\n },\n {\n key: 'programs',\n title: 'Programs',\n panel: <ProgramsPanel />,\n },\n {\n key: 'history',\n title: 'History',\n panel: <span>History tab will be available soon.</span>,\n },\n ]), []);\n\n const [activeTab, setActiveTab] = useState(dashboardTabs[0].key);\n const handleTabSelect = useCallback((tabKey) => {\n if (tabKey) {\n setActiveTab(tabKey);\n }\n }, []);\n\n return (\n <Tabs\n id=\"subscription-dashboard-tabs\"\n defaultActiveKey={dashboardTabs[0]?.key}\n activeKey={activeTab}\n onSelect={handleTabSelect}\n className=\"mb-4\"\n mountOnEnter\n >\n {dashboardTabs.map(tab => (\n <Tab eventKey={tab.key} title={tab.title} key={tab.key}>\n {tab.panel}\n </Tab>\n ))}\n </Tabs>\n );\n};\n\nexport default DashboardTabs;\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
3
|
+
import messages from './messages';
|
|
4
|
+
import { Button } from '@openedx/paragon';
|
|
5
|
+
import { Search } from '@openedx/paragon/icons';
|
|
6
|
+
import { baseAppUrl } from '../../../data/services/lms/urls';
|
|
7
|
+
import { exploreProgramsUrl } from '../../../data/constants/app';
|
|
8
|
+
export const NoProgramsView = () => {
|
|
9
|
+
const { formatMessage } = useIntl();
|
|
10
|
+
return (_jsxs("div", { className: "no-programs-content-view", children: [_jsx("p", { children: formatMessage(messages.inProgressProgramsPrompt) }), _jsx(Button, { variant: "brand", as: "a", href: baseAppUrl(exploreProgramsUrl), iconBefore: Search, children: formatMessage(messages.findProgramsButton) })] }));
|
|
11
|
+
};
|
|
12
|
+
export default NoProgramsView;
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/ProgramsPanel/NoProgramsView/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,CAAC,MAAM,cAAc,GAAO,GAAG,EAAE;IACrC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,eAAK,SAAS,EAAC,0BAA0B,aACvC,sBAAI,aAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,GAAK,EACzD,KAAC,MAAM,IACL,OAAO,EAAC,OAAO,EACf,EAAE,EAAC,GAAG,EACN,IAAI,EAAE,UAAU,CAAC,kBAAkB,CAAC,EACpC,UAAU,EAAE,MAAM,YAEjB,aAAa,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GACpC,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FC } from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport messages from './messages';\nimport { Button } from '@openedx/paragon';\nimport { Search } from '@openedx/paragon/icons';\nimport { baseAppUrl } from '@src/data/services/lms/urls';\nimport { exploreProgramsUrl } from '@src/data/constants/app';\n\nexport const NoProgramsView: FC = () => {\n const { formatMessage } = useIntl();\n\n return (\n <div className=\"no-programs-content-view\">\n <p>{formatMessage(messages.inProgressProgramsPrompt)}</p>\n <Button\n variant=\"brand\"\n as=\"a\"\n href={baseAppUrl(exploreProgramsUrl)}\n iconBefore={Search}\n >\n {formatMessage(messages.findProgramsButton)}\n </Button>\n </div>\n );\n};\n\nexport default NoProgramsView;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
inProgressProgramsPrompt: {
|
|
4
|
+
id: 'Dashboard.NoProgramsView.inProgressProgramsPrompt',
|
|
5
|
+
defaultMessage: 'In-progress professional certificate programs will be found here.',
|
|
6
|
+
description: 'Placeholder text for in-progress programs section',
|
|
7
|
+
},
|
|
8
|
+
findProgramsButton: {
|
|
9
|
+
id: 'Dashboard.NoProgramsView.findProgramsButton',
|
|
10
|
+
defaultMessage: 'Find a program',
|
|
11
|
+
description: 'Button to find more programs',
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
export default messages;
|
|
15
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/containers/ProgramsPanel/NoProgramsView/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,wBAAwB,EAAE;QACxB,EAAE,EAAE,mDAAmD;QACvD,cAAc,EAAE,mEAAmE;QACnF,WAAW,EAAE,mDAAmD;KACjE;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,6CAA6C;QACjD,cAAc,EAAE,gBAAgB;QAChC,WAAW,EAAE,8BAA8B;KAC5C;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n inProgressProgramsPrompt: {\n id: 'Dashboard.NoProgramsView.inProgressProgramsPrompt',\n defaultMessage: 'In-progress professional certificate programs will be found here.',\n description: 'Placeholder text for in-progress programs section',\n },\n findProgramsButton: {\n id: 'Dashboard.NoProgramsView.findProgramsButton',\n defaultMessage: 'Find a program',\n description: 'Button to find more programs',\n }\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import messages from './messages';
|
|
5
|
+
import NoProgramsView from './NoProgramsView';
|
|
6
|
+
export const ProgramsPanel = () => {
|
|
7
|
+
const { formatMessage } = useIntl();
|
|
8
|
+
const [hasProgramsEnrollment] = useState(false);
|
|
9
|
+
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, {})] }) }));
|
|
10
|
+
};
|
|
11
|
+
export default ProgramsPanel;
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/ProgramsPanel/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAO,GAAG,EAAE;IACpC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,CAAC,qBAAqB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhD,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,IAAI,KAAC,cAAc,KAAG,IACzC,GACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { FC, useState } from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport messages from './messages';\nimport NoProgramsView from './NoProgramsView';\n\nexport const ProgramsPanel: FC = () => {\n const { formatMessage } = useIntl();\n const [hasProgramsEnrollment] = useState(false);\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 />}\n </div>\n </>\n );\n};\n\nexport default ProgramsPanel;\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
myPrograms: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
emptyProgramsMessage: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
explorePrograms: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
exploreProgramsCTAMessage: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default messages;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
myPrograms: {
|
|
4
|
+
id: 'dashboard.myPrograms',
|
|
5
|
+
defaultMessage: 'Programs',
|
|
6
|
+
description: 'Label for Programs belonging to a user\'s active subscription',
|
|
7
|
+
},
|
|
8
|
+
emptyProgramsMessage: {
|
|
9
|
+
id: 'subs.emptyProgramsMessage',
|
|
10
|
+
defaultMessage: 'In-progress professional certificate programs will be found here.',
|
|
11
|
+
description: 'Message shown in the Programs tab of the learner dashboard',
|
|
12
|
+
},
|
|
13
|
+
explorePrograms: {
|
|
14
|
+
id: 'subs.explorePrograms',
|
|
15
|
+
defaultMessage: 'Explore programs',
|
|
16
|
+
description: 'Message shown in the explore programs button in the Programs tab of the learner dashboard',
|
|
17
|
+
},
|
|
18
|
+
exploreProgramsCTAMessage: {
|
|
19
|
+
id: 'subs.exploreProgramsCTAMessage',
|
|
20
|
+
defaultMessage: 'Advance your learning by exploring a program curriculum.',
|
|
21
|
+
description: 'Message shown in the explore programs button in the Programs tab of the learner dashboard',
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export default messages;
|
|
25
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/containers/ProgramsPanel/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,UAAU,EAAE;QACV,EAAE,EAAE,sBAAsB;QAC1B,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,+DAA+D;KAC7E;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,2BAA2B;QAC/B,cAAc,EAAE,mEAAmE;QACnF,WAAW,EAAE,4DAA4D;KAC1E;IACD,eAAe,EAAE;QACf,EAAE,EAAE,sBAAsB;QAC1B,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,2FAA2F;KACzG;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,gCAAgC;QACpC,cAAc,EAAE,0DAA0D;QAC1E,WAAW,EAAE,2FAA2F;KACzG;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n myPrograms: {\n id: 'dashboard.myPrograms',\n defaultMessage: 'Programs',\n description: 'Label for Programs belonging to a user\\'s active subscription',\n },\n emptyProgramsMessage: {\n id: 'subs.emptyProgramsMessage',\n defaultMessage: 'In-progress professional certificate programs will be found here.',\n description: 'Message shown in the Programs tab of the learner dashboard',\n },\n explorePrograms: {\n id: 'subs.explorePrograms',\n defaultMessage: 'Explore programs',\n description: 'Message shown in the explore programs button in the Programs tab of the learner dashboard',\n },\n exploreProgramsCTAMessage: {\n id: 'subs.exploreProgramsCTAMessage',\n defaultMessage: 'Advance your learning by exploring a program curriculum.',\n description: 'Message shown in the explore programs button in the Programs tab of the learner dashboard',\n }\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Alert, Button, Image } from '@openedx/paragon';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import { utilHooks } from '../../../hooks';
|
|
5
|
+
import messages from '../messages';
|
|
6
|
+
import { manageSubscriptionURL } from '../../../data/constants/app';
|
|
7
|
+
// TODO: We can replace the below hardcoded subscriptionInformationData with the actual data from the API once we have the API ready.
|
|
8
|
+
// For now, we can use this hardcoded data to test the SubscriptionInformation component.
|
|
9
|
+
const subscriptionInformationData = {
|
|
10
|
+
isSubscribed: true,
|
|
11
|
+
subscriptionStatus: 'cancelled', // can be 'active', 'cancelled', 'expired'
|
|
12
|
+
subscriptionStartDate: '05/22/25',
|
|
13
|
+
subscriptionEndDate: '05/22/26',
|
|
14
|
+
subscriptionRenewalDate: '05/22/26',
|
|
15
|
+
subscriptionRenewalPrice: '$36',
|
|
16
|
+
numberOfCoursesEnrolled: 5,
|
|
17
|
+
totalSavings: '$120',
|
|
18
|
+
};
|
|
19
|
+
export const SubscriptionInformation = () => {
|
|
20
|
+
const { formatMessage } = useIntl();
|
|
21
|
+
const formatDate = utilHooks.useFormatDate();
|
|
22
|
+
const subscriptionActions = [
|
|
23
|
+
_jsx(Button, { variant: "outline-brand", "data-testid": "manage-button", href: manageSubscriptionURL, target: "_blank", rel: "noopener noreferrer", role: "link", children: formatMessage(messages.manageSubscriptionMessage) }, "manage-subscription"),
|
|
24
|
+
];
|
|
25
|
+
return (_jsxs("div", { className: "container subscription-information p-3\\.5", children: [_jsx(Image, { className: "mr-2", src: "https://www.edx.org/trademark-logos/edx-logo-elm.svg", rounded: true, alt: "edX Logo", width: 40, height: 60 }), subscriptionInformationData.subscriptionStatus === 'cancelled' && (_jsx("h3", { children: formatMessage(messages.cancelledMessage, { totalSavings: subscriptionInformationData.totalSavings }) })), _jsx("p", { children: formatMessage(messages.coursesEnrollmentMessage, {
|
|
26
|
+
numberOfCoursesEnrolled: subscriptionInformationData.numberOfCoursesEnrolled,
|
|
27
|
+
totalSavings: subscriptionInformationData.totalSavings,
|
|
28
|
+
}) }), _jsxs(Alert, { dismissible: false, show: true, actions: subscriptionActions, className: "subscription-status-alert bg-light-200", children: [_jsx(Alert.Heading, { children: formatMessage(messages.statusMessage) }), _jsx("p", { children: formatMessage(messages.renewalMessage, {
|
|
29
|
+
subscriptionRenewalDate: formatDate(subscriptionInformationData.subscriptionRenewalDate),
|
|
30
|
+
}) })] })] }));
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=SubscriptionInformation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionInformation.js","sourceRoot":"","sources":["../../../../src/containers/SubscriptionInformation/components/SubscriptionInformation.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,qIAAqI;AACrI,yFAAyF;AACzF,MAAM,2BAA2B,GAAG;IAClC,YAAY,EAAE,IAAI;IAClB,kBAAkB,EAAE,WAAW,EAAE,0CAA0C;IAC3E,qBAAqB,EAAE,UAAU;IACjC,mBAAmB,EAAE,UAAU;IAC/B,uBAAuB,EAAE,UAAU;IACnC,wBAAwB,EAAE,KAAK;IAC/B,uBAAuB,EAAE,CAAC;IAC1B,YAAY,EAAE,MAAM;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAO,GAAG,EAAE;IAC9C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,SAAS,CAAC,aAAa,EAAE,CAAC;IAE7C,MAAM,mBAAmB,GAAG;QAC1B,KAAC,MAAM,IAEL,OAAO,EAAC,eAAe,iBACX,eAAe,EAC3B,IAAI,EAAE,qBAAqB,EAC3B,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,IAAI,EAAC,MAAM,YAEV,aAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC,IAR9C,qBAAqB,CASlB;KACV,CAAC;IAEF,OAAO,CACL,eAAK,SAAS,EAAC,4CAA2C,aACxD,KAAC,KAAK,IACJ,SAAS,EAAC,MAAM,EAChB,GAAG,EAAC,sDAAsD,EAC1D,OAAO,QACP,GAAG,EAAC,UAAU,EACd,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACV,EACD,2BAA2B,CAAC,kBAAkB,KAAK,WAAW,IAAI,CACjE,uBAAK,aAAa,CAAC,QAAQ,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,2BAA2B,CAAC,YAAY,EAAE,CAAC,GAAM,CAChH,EACD,sBACG,aAAa,CAAC,QAAQ,CAAC,wBAAwB,EAAE;oBAChD,uBAAuB,EAAE,2BAA2B,CAAC,uBAAuB;oBAC5E,YAAY,EAAE,2BAA2B,CAAC,YAAY;iBACvD,CAAC,GACA,EACJ,MAAC,KAAK,IACJ,WAAW,EAAE,KAAK,EAClB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAC,wCAAwC,aAElD,KAAC,KAAK,CAAC,OAAO,cAAE,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAiB,EACtE,sBACG,aAAa,CAAC,QAAQ,CAAC,cAAc,EAAE;4BACtC,uBAAuB,EAAE,UAAU,CAAC,2BAA2B,CAAC,uBAAuB,CAAC;yBACzF,CAAC,GACA,IACE,IACJ,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { Alert, Button, Image } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport { utilHooks } from '@src/hooks';\nimport messages from '../messages';\nimport { manageSubscriptionURL } from '@src/data/constants/app';\n\n// TODO: We can replace the below hardcoded subscriptionInformationData with the actual data from the API once we have the API ready.\n// For now, we can use this hardcoded data to test the SubscriptionInformation component.\nconst subscriptionInformationData = {\n isSubscribed: true,\n subscriptionStatus: 'cancelled', // can be 'active', 'cancelled', 'expired'\n subscriptionStartDate: '05/22/25',\n subscriptionEndDate: '05/22/26',\n subscriptionRenewalDate: '05/22/26',\n subscriptionRenewalPrice: '$36',\n numberOfCoursesEnrolled: 5,\n totalSavings: '$120',\n};\n\nexport const SubscriptionInformation: FC = () => {\n const { formatMessage } = useIntl();\n const formatDate = utilHooks.useFormatDate();\n\n const subscriptionActions = [\n <Button\n key=\"manage-subscription\"\n variant=\"outline-brand\"\n data-testid=\"manage-button\"\n href={manageSubscriptionURL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n role=\"link\"\n >\n {formatMessage(messages.manageSubscriptionMessage)}\n </Button>,\n ];\n\n return (\n <div className=\"container subscription-information p-3\\.5\">\n <Image\n className=\"mr-2\"\n src=\"https://www.edx.org/trademark-logos/edx-logo-elm.svg\"\n rounded\n alt=\"edX Logo\"\n width={40}\n height={60}\n />\n {subscriptionInformationData.subscriptionStatus === 'cancelled' && (\n <h3>{formatMessage(messages.cancelledMessage, { totalSavings: subscriptionInformationData.totalSavings })}</h3>\n )}\n <p>\n {formatMessage(messages.coursesEnrollmentMessage, {\n numberOfCoursesEnrolled: subscriptionInformationData.numberOfCoursesEnrolled,\n totalSavings: subscriptionInformationData.totalSavings,\n })}\n </p>\n <Alert\n dismissible={false}\n show={true}\n actions={subscriptionActions}\n className=\"subscription-status-alert bg-light-200\"\n >\n <Alert.Heading>{formatMessage(messages.statusMessage)}</Alert.Heading>\n <p>\n {formatMessage(messages.renewalMessage, {\n subscriptionRenewalDate: formatDate(subscriptionInformationData.subscriptionRenewalDate),\n })}\n </p>\n </Alert>\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SubscriptionInformation } from "./components/SubscriptionInformation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/SubscriptionInformation/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC","sourcesContent":["export { SubscriptionInformation } from './components/SubscriptionInformation';\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
statusMessage: {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
};
|
|
7
|
+
cancelledMessage: {
|
|
8
|
+
id: string;
|
|
9
|
+
description: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
};
|
|
12
|
+
coursesEnrollmentMessage: {
|
|
13
|
+
id: string;
|
|
14
|
+
description: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
};
|
|
17
|
+
renewalMessage: {
|
|
18
|
+
id: string;
|
|
19
|
+
description: string;
|
|
20
|
+
defaultMessage: string;
|
|
21
|
+
};
|
|
22
|
+
manageSubscriptionMessage: {
|
|
23
|
+
id: string;
|
|
24
|
+
description: string;
|
|
25
|
+
defaultMessage: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export default messages;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
statusMessage: {
|
|
4
|
+
id: 'learner-dash.subscriptionInformation.information.subscriptionStatus',
|
|
5
|
+
description: 'Status Message',
|
|
6
|
+
defaultMessage: 'Subscription Status',
|
|
7
|
+
},
|
|
8
|
+
cancelledMessage: {
|
|
9
|
+
id: 'learner-dash.subscriptionInformation.information.courseInformation',
|
|
10
|
+
description: 'Information of courses enrolled and savings',
|
|
11
|
+
defaultMessage: `You have saved {totalSavings} with your subscription so far!`,
|
|
12
|
+
},
|
|
13
|
+
coursesEnrollmentMessage: {
|
|
14
|
+
id: 'learner-dash.subscriptionInformation.information.enrollmentInformation',
|
|
15
|
+
description: 'Information of courses enrolled and savings',
|
|
16
|
+
defaultMessage: `As a subscriber, you've enrolled in {numberOfCoursesEnrolled} courses and saved {totalSavings}.`,
|
|
17
|
+
},
|
|
18
|
+
renewalMessage: {
|
|
19
|
+
id: 'learner-dash.subscriptionInformation.information.subscriptionSchedule',
|
|
20
|
+
description: 'Subscription Schedule',
|
|
21
|
+
defaultMessage: 'Subscription payment scheduled for {subscriptionRenewalDate}.',
|
|
22
|
+
},
|
|
23
|
+
manageSubscriptionMessage: {
|
|
24
|
+
id: 'learner-dash.subscriptionInformation.information.manageSubscription',
|
|
25
|
+
description: 'Manage Subscription',
|
|
26
|
+
defaultMessage: 'Manage my subscription',
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
export default messages;
|
|
30
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/containers/SubscriptionInformation/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,aAAa,EAAE;QACb,EAAE,EAAE,qEAAqE;QACzE,WAAW,EAAE,gBAAgB;QAC7B,cAAc,EAAE,qBAAqB;KACtC;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,oEAAoE;QACxE,WAAW,EAAE,6CAA6C;QAC1D,cAAc,EAAE,8DAA8D;KAC/E;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,wEAAwE;QAC5E,WAAW,EAAE,6CAA6C;QAC1D,cAAc,EAAE,iGAAiG;KAClH;IACD,cAAc,EAAE;QACd,EAAE,EAAE,uEAAuE;QAC3E,WAAW,EAAE,uBAAuB;QACpC,cAAc,EAAE,+DAA+D;KAChF;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,qEAAqE;QACzE,WAAW,EAAE,qBAAqB;QAClC,cAAc,EAAE,wBAAwB;KACzC;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n statusMessage: {\n id: 'learner-dash.subscriptionInformation.information.subscriptionStatus',\n description: 'Status Message',\n defaultMessage: 'Subscription Status',\n },\n cancelledMessage: {\n id: 'learner-dash.subscriptionInformation.information.courseInformation',\n description: 'Information of courses enrolled and savings',\n defaultMessage: `You have saved {totalSavings} with your subscription so far!`,\n },\n coursesEnrollmentMessage: {\n id: 'learner-dash.subscriptionInformation.information.enrollmentInformation',\n description: 'Information of courses enrolled and savings',\n defaultMessage: `As a subscriber, you've enrolled in {numberOfCoursesEnrolled} courses and saved {totalSavings}.`,\n },\n renewalMessage: {\n id: 'learner-dash.subscriptionInformation.information.subscriptionSchedule',\n description: 'Subscription Schedule',\n defaultMessage: 'Subscription payment scheduled for {subscriptionRenewalDate}.',\n },\n manageSubscriptionMessage: {\n id: 'learner-dash.subscriptionInformation.information.manageSubscription',\n description: 'Manage Subscription',\n defaultMessage: 'Manage my subscription',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -2,4 +2,6 @@ export const locationId: string;
|
|
|
2
2
|
export const SortKeys: any;
|
|
3
3
|
export const FilterKeys: any;
|
|
4
4
|
export const ListPageSize: 25;
|
|
5
|
-
export const subscriptionRenewalURL: "https://courses.edx.org/
|
|
5
|
+
export const subscriptionRenewalURL: "https://courses.edx.org/manage-subscription";
|
|
6
|
+
export const exploreProgramsUrl: "/explore-programs";
|
|
7
|
+
export const manageSubscriptionURL: "/manage-subscription";
|
|
@@ -13,5 +13,7 @@ export const FilterKeys = StrictDict({
|
|
|
13
13
|
});
|
|
14
14
|
export const ListPageSize = 25;
|
|
15
15
|
// TODO : Below URL is temporary and will be removed once the subscription renewal flow is implemented in the app.
|
|
16
|
-
export const subscriptionRenewalURL = 'https://courses.edx.org/
|
|
16
|
+
export const subscriptionRenewalURL = 'https://courses.edx.org/manage-subscription';
|
|
17
|
+
export const exploreProgramsUrl = '/explore-programs';
|
|
18
|
+
export const manageSubscriptionURL = '/manage-subscription';
|
|
17
19
|
//# sourceMappingURL=app.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/data/constants/app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ACpF,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AACtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,sBAAsB,CAAC","sourcesContent":["import { StrictDict } from '../../utils';\nexport const locationId = window.location.pathname.slice(1);\n\nexport const SortKeys = StrictDict({\n enrolled: 'enrolled',\n title: 'title',\n});\n\nexport const FilterKeys = StrictDict({\n inProgress: 'inProgress',\n notStarted: 'notStarted',\n done: 'done',\n notEnrolled: 'notEnrolled',\n upgraded: 'upgraded',\n});\n\nexport const ListPageSize = 25;\n// TODO : Below URL is temporary and will be removed once the subscription renewal flow is implemented in the app.\nexport const subscriptionRenewalURL = 'https://courses.edx.org/manage-subscription';\nexport const exploreProgramsUrl = '/explore-programs';\nexport const manageSubscriptionURL = '/manage-subscription';\n"]}
|