@edx/frontend-app-subscription-learner-dashboard 1.7.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/containers/Dashboard/DashboardLayout.d.ts +0 -48
- package/dist/containers/Dashboard/DashboardLayout.js +2 -24
- package/dist/containers/Dashboard/DashboardLayout.js.map +1 -1
- package/dist/containers/Dashboard/index.js +2 -1
- package/dist/containers/Dashboard/index.js.map +1 -1
- package/dist/containers/Dashboard/index.scss +1 -25
- package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/index.d.ts +3 -0
- package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/index.js +9 -0
- package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/index.js.map +1 -0
- package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/messages.d.ts +8 -0
- package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/messages.js +10 -0
- package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/messages.js.map +1 -0
- package/dist/containers/RecentlyViewedPanel/RecentlyViewedCourseProgram/index.d.ts +4 -0
- package/dist/containers/RecentlyViewedPanel/RecentlyViewedCourseProgram/index.js +7 -0
- package/dist/containers/RecentlyViewedPanel/RecentlyViewedCourseProgram/index.js.map +1 -0
- package/dist/containers/RecentlyViewedPanel/index.d.ts +3 -0
- package/dist/containers/RecentlyViewedPanel/index.js +19 -0
- package/dist/containers/RecentlyViewedPanel/index.js.map +1 -0
- package/dist/containers/RecentlyViewedPanel/messages.d.ts +13 -0
- package/dist/containers/RecentlyViewedPanel/messages.js +15 -0
- package/dist/containers/RecentlyViewedPanel/messages.js.map +1 -0
- package/dist/data/services/subs/api.d.ts +10 -0
- package/dist/data/services/subs/api.js +56 -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/hooks/useRecentlyViewedCoursesAndProgramsData.d.ts +15 -0
- package/dist/hooks/useRecentlyViewedCoursesAndProgramsData.js +6 -0
- package/dist/hooks/useRecentlyViewedCoursesAndProgramsData.js.map +1 -0
- package/dist/widgets/LearnerDashboardHeader/app.js +0 -7
- package/dist/widgets/LearnerDashboardHeader/app.js.map +1 -1
- package/package.json +1 -1
- package/dist/slots/WidgetSidebarSlot/index.d.ts +0 -2
- package/dist/slots/WidgetSidebarSlot/index.js +0 -6
- package/dist/slots/WidgetSidebarSlot/index.js.map +0 -1
- package/dist/widgets/LookingForChallengeWidget/index.d.ts +0 -6
- package/dist/widgets/LookingForChallengeWidget/index.js +0 -22
- package/dist/widgets/LookingForChallengeWidget/index.js.map +0 -1
- package/dist/widgets/LookingForChallengeWidget/index.scss +0 -6
- package/dist/widgets/LookingForChallengeWidget/messages.d.ts +0 -16
- package/dist/widgets/LookingForChallengeWidget/messages.js +0 -15
- package/dist/widgets/LookingForChallengeWidget/messages.js.map +0 -1
- package/dist/widgets/LookingForChallengeWidget/track.d.ts +0 -7
- package/dist/widgets/LookingForChallengeWidget/track.js +0 -13
- package/dist/widgets/LookingForChallengeWidget/track.js.map +0 -1
|
@@ -1,51 +1,3 @@
|
|
|
1
|
-
export namespace columnConfig {
|
|
2
|
-
namespace courseList {
|
|
3
|
-
namespace withSidebar {
|
|
4
|
-
namespace lg {
|
|
5
|
-
let span: number;
|
|
6
|
-
let offset: number;
|
|
7
|
-
}
|
|
8
|
-
namespace xl {
|
|
9
|
-
let span_1: number;
|
|
10
|
-
export { span_1 as span };
|
|
11
|
-
let offset_1: number;
|
|
12
|
-
export { offset_1 as offset };
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
namespace noSidebar {
|
|
16
|
-
export namespace lg_1 {
|
|
17
|
-
let span_2: number;
|
|
18
|
-
export { span_2 as span };
|
|
19
|
-
let offset_2: number;
|
|
20
|
-
export { offset_2 as offset };
|
|
21
|
-
}
|
|
22
|
-
export { lg_1 as lg };
|
|
23
|
-
export namespace xl_1 {
|
|
24
|
-
let span_3: number;
|
|
25
|
-
export { span_3 as span };
|
|
26
|
-
let offset_3: number;
|
|
27
|
-
export { offset_3 as offset };
|
|
28
|
-
}
|
|
29
|
-
export { xl_1 as xl };
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
namespace sidebar {
|
|
33
|
-
export namespace lg_2 {
|
|
34
|
-
let span_4: number;
|
|
35
|
-
export { span_4 as span };
|
|
36
|
-
let offset_4: number;
|
|
37
|
-
export { offset_4 as offset };
|
|
38
|
-
}
|
|
39
|
-
export { lg_2 as lg };
|
|
40
|
-
export namespace xl_2 {
|
|
41
|
-
let span_5: number;
|
|
42
|
-
export { span_5 as span };
|
|
43
|
-
let offset_5: number;
|
|
44
|
-
export { offset_5 as offset };
|
|
45
|
-
}
|
|
46
|
-
export { xl_2 as xl };
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
1
|
export function DashboardLayout({ children }: {
|
|
50
2
|
children: any;
|
|
51
3
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,31 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { Container, Col, Row } from '@openedx/paragon';
|
|
5
|
-
import WidgetSidebarSlot from '../../slots/WidgetSidebarSlot';
|
|
6
|
-
import hooks from './hooks';
|
|
7
|
-
export const columnConfig = {
|
|
8
|
-
courseList: {
|
|
9
|
-
withSidebar: {
|
|
10
|
-
lg: { span: 12, offset: 0 },
|
|
11
|
-
xl: { span: 8, offset: 0 },
|
|
12
|
-
},
|
|
13
|
-
noSidebar: {
|
|
14
|
-
lg: { span: 12, offset: 0 },
|
|
15
|
-
xl: { span: 12, offset: 0 },
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
sidebar: {
|
|
19
|
-
lg: { span: 12, offset: 0 },
|
|
20
|
-
xl: { span: 4, offset: 0 },
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
5
|
export const DashboardLayout = ({ children }) => {
|
|
24
|
-
|
|
25
|
-
const courseListColumnProps = sidebarShowing
|
|
26
|
-
? columnConfig.courseList.withSidebar
|
|
27
|
-
: columnConfig.courseList.noSidebar;
|
|
28
|
-
return (_jsx(Container, { fluid: true, size: "xl", children: _jsxs(Row, { children: [_jsx(Col, Object.assign({}, courseListColumnProps, { className: "course-list-column", children: children })), _jsx(Col, Object.assign({}, columnConfig.sidebar, { className: ['sidebar-column', !isCollapsed && 'not-collapsed'], children: _jsx(WidgetSidebarSlot, {}) }))] }) }));
|
|
6
|
+
return (_jsx(Container, { fluid: true, size: "xl", children: _jsx(Row, { children: _jsx(Col, { className: "course-list-column", children: children }) }) }));
|
|
29
7
|
};
|
|
30
8
|
DashboardLayout.propTypes = {
|
|
31
9
|
children: PropTypes.node.isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardLayout.js","sourceRoot":"","sources":["../../../src/containers/Dashboard/DashboardLayout.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvD,
|
|
1
|
+
{"version":3,"file":"DashboardLayout.js","sourceRoot":"","sources":["../../../src/containers/Dashboard/DashboardLayout.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9C,OAAO,CACL,KAAC,SAAS,IAAC,KAAK,QAAC,IAAI,EAAC,IAAI,YACxB,KAAC,GAAG,cACF,KAAC,GAAG,IAAC,SAAS,EAAC,oBAAoB,YAChC,QAAQ,GACL,GACF,GACI,CACb,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,CAAC,SAAS,GAAG;IAC1B,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CACpC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Container, Col, Row } from '@openedx/paragon';\n\nexport const DashboardLayout = ({ children }) => {\n return (\n <Container fluid size=\"xl\">\n <Row>\n <Col className=\"course-list-column\">\n {children}\n </Col>\n </Row>\n </Container>\n );\n};\nDashboardLayout.propTypes = {\n children: PropTypes.node.isRequired,\n};\n\nexport default DashboardLayout;\n"]}
|
|
@@ -5,6 +5,7 @@ import { useInitializeLearnerHome } from '../../data/hooks';
|
|
|
5
5
|
import SelectSessionModal from '../../containers/SelectSessionModal';
|
|
6
6
|
import DashboardTabs from './DashboardTabs';
|
|
7
7
|
import DashboardModalSlot from '../../slots/DashboardModalSlot';
|
|
8
|
+
import RecentlyViewedPanel from '../RecentlyViewedPanel';
|
|
8
9
|
import LoadingView from './LoadingView';
|
|
9
10
|
import DashboardLayout from './DashboardLayout';
|
|
10
11
|
import hooks from './hooks';
|
|
@@ -19,7 +20,7 @@ export const Dashboard = () => {
|
|
|
19
20
|
const hasCourses = useMemo(() => { var _a; return ((_a = data === null || data === void 0 ? void 0 : data.courses) === null || _a === void 0 ? void 0 : _a.length) > 0; }, [data]);
|
|
20
21
|
return (_jsx("div", { id: "learnerdashboardroot", children: _jsx("main", { children: _jsxs("div", { id: "dashboard-container", className: "d-flex flex-column p-2 pt-0", children: [_jsx("h1", { className: "sr-only", children: pageTitle }), !isPending && (_jsxs(_Fragment, { children: [_jsx(DashboardModalSlot, {}), (hasCourses && showSelectSessionModal) && _jsx(SelectSessionModal, {})] })), _jsx("div", { id: "dashboard-content", "data-testid": "dashboard-content", children: isPending
|
|
21
22
|
? (_jsx(LoadingView, {}))
|
|
22
|
-
: (_jsxs(DashboardLayout, { children: [_jsx(SubscriptionBanner, {}), _jsx(DashboardTitle, {}), _jsx(DashboardTabs, {})] })) })] }) }) }));
|
|
23
|
+
: (_jsxs(DashboardLayout, { children: [_jsx(SubscriptionBanner, {}), _jsx(DashboardTitle, {}), _jsx(DashboardTabs, {}), _jsx(RecentlyViewedPanel, {})] })) })] }) }) }));
|
|
23
24
|
};
|
|
24
25
|
export default Dashboard;
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/Dashboard/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,kBAAkB,MAAM,qCAAqC,CAAC;AACrE,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/Dashboard/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,kBAAkB,MAAM,qCAAqC,CAAC;AACrE,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,gCAAgC,CAAC;AAChE,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AAEzD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,OAAO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AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { useMemo } from 'react';\n\nimport { useSelectSessionModal } from '@src/data/context';\nimport { useInitializeLearnerHome } from '@src/data/hooks';\nimport SelectSessionModal from '../../containers/SelectSessionModal';\nimport DashboardTabs from './DashboardTabs';\nimport DashboardModalSlot from '../../slots/DashboardModalSlot';\nimport RecentlyViewedPanel from '../RecentlyViewedPanel';\n\nimport LoadingView from './LoadingView';\nimport DashboardLayout from './DashboardLayout';\n\nimport hooks from './hooks';\nimport './index.scss';\nimport { SubscriptionBanner } from '../SubscriptionBanner';\nimport { DashboardTitle } from './DashboardTitle';\n\nexport const Dashboard = () => {\n const { data, isPending } = useInitializeLearnerHome();\n const { pageTitle } = hooks.useDashboardMessages();\n const { selectSessionModal } = useSelectSessionModal();\n const showSelectSessionModal = selectSessionModal.cardId !== null;\n\n const hasCourses = useMemo(() => data?.courses?.length > 0, [data]);\n\n return (\n <div id=\"learnerdashboardroot\">\n <main>\n <div id=\"dashboard-container\" className=\"d-flex flex-column p-2 pt-0\">\n <h1 className=\"sr-only\">{pageTitle}</h1>\n {!isPending && (\n <>\n <DashboardModalSlot />\n {(hasCourses && showSelectSessionModal) && <SelectSessionModal />}\n </>\n )}\n <div id=\"dashboard-content\" data-testid=\"dashboard-content\">\n {isPending\n ? (<LoadingView />)\n : (\n <DashboardLayout>\n <SubscriptionBanner />\n <DashboardTitle />\n <DashboardTabs />\n <RecentlyViewedPanel />\n </DashboardLayout>\n )}\n </div>\n </div>\n </main>\n </div>\n );\n};\n\nexport default Dashboard;\n"]}
|
|
@@ -2,28 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
.course-list-column {
|
|
4
4
|
padding: 0 var(--pgn-spacing-spacer-4);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.sidebar-column {
|
|
8
|
-
padding: 0 var(--pgn-spacing-spacer-3) 0 var(--pgn-spacing-spacer-1);
|
|
9
|
-
|
|
10
|
-
&.not-collapsed {
|
|
11
|
-
padding-top: var(--pgn-spacing-spacer-2);
|
|
12
|
-
|
|
13
|
-
& >:first-child {
|
|
14
|
-
margin-top: var(--pgn-spacing-spacer-5-5);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@media (--pgn-size-breakpoint-max-width-lg) {
|
|
20
|
-
.sidebar-column {
|
|
21
|
-
// grid are inheriting dir="ltr" from the body, so we need to override it
|
|
22
|
-
[dir=ltr] & {
|
|
23
|
-
padding: 0 var(--pgn-spacing-spacer-3);
|
|
24
|
-
}
|
|
25
|
-
[dir=rtl] & {
|
|
26
|
-
padding: 0 var(--pgn-spacing-spacer-3);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
3
|
+
import messages from './messages';
|
|
4
|
+
const NoRecentlyViewedItems = () => {
|
|
5
|
+
const { formatMessage } = useIntl();
|
|
6
|
+
return (_jsx("div", { "data-testid": "no-recently-viewed-items", children: _jsx("p", { className: "mb-0", children: formatMessage(messages.recentlyViewedEmptyState) }) }));
|
|
7
|
+
};
|
|
8
|
+
export default NoRecentlyViewedItems;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/RecentlyViewedPanel/NoRecentlyViewedItems/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,qBAAqB,GAAO,GAAG,EAAE;IACrC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,6BAAiB,0BAA0B,YACzC,YAAG,SAAS,EAAC,MAAM,YAAE,aAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,GAAK,GACtE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import { FC } from 'react';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport messages from './messages';\n\nconst NoRecentlyViewedItems: FC = () => {\n const { formatMessage } = useIntl();\n\n return (\n <div data-testid=\"no-recently-viewed-items\">\n <p className=\"mb-0\">{formatMessage(messages.recentlyViewedEmptyState)}</p>\n </div>\n );\n};\n\nexport default NoRecentlyViewedItems;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
recentlyViewedEmptyState: {
|
|
4
|
+
id: 'subs-dash.recentlyViewedPanel.emptyState',
|
|
5
|
+
defaultMessage: 'When you browse the edX Unlimited catalog, we\'ll show the courses and programs you viewed here.',
|
|
6
|
+
description: 'Placeholder text for recently viewed courses and programs section',
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
export default messages;
|
|
10
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/containers/RecentlyViewedPanel/NoRecentlyViewedItems/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,wBAAwB,EAAE;QACxB,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,kGAAkG;QAClH,WAAW,EAAE,mEAAmE;KACjF;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n recentlyViewedEmptyState: {\n id: 'subs-dash.recentlyViewedPanel.emptyState',\n defaultMessage: 'When you browse the edX Unlimited catalog, we\\'ll show the courses and programs you viewed here.',\n description: 'Placeholder text for recently viewed courses and programs section',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ProductCard } from '../../ProductCard';
|
|
3
|
+
export const RecentlyViewedCourseProgram = ({ items, isLoading }) => {
|
|
4
|
+
return (_jsx("div", { "data-testid": "recently-viewed-items", children: _jsx("div", { className: "row g-3 flex-nowrap flex-md-wrap overflow-auto", children: items.map((item) => (_jsx("div", { className: "col-12 col-md-6 col-xl-3 d-flex mb-2", children: _jsx(ProductCard, { item: item, isLoading: isLoading }) }, item.id))) }) }));
|
|
5
|
+
};
|
|
6
|
+
export default RecentlyViewedCourseProgram;
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/RecentlyViewedPanel/RecentlyViewedCourseProgram/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,CAAC,MAAM,2BAA2B,GAAyC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;IACxG,OAAO,CACL,6BAAiB,uBAAuB,YACtC,cAAK,SAAS,EAAC,gDAAgD,YAC5D,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,cAAmB,SAAS,EAAC,sCAAsC,YACjE,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,IADzC,IAAI,CAAC,EAAE,CAEX,CACP,CAAC,GACE,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC","sourcesContent":["import { FC } from 'react';\n\nimport { ProductCard } from '../../ProductCard';\nimport { RecentlyViewedCourseProgramProps } from './data/types';\n\nexport const RecentlyViewedCourseProgram: FC<RecentlyViewedCourseProgramProps> = ({ items, isLoading }) => {\n return (\n <div data-testid=\"recently-viewed-items\">\n <div className=\"row g-3 flex-nowrap flex-md-wrap overflow-auto\">\n {items.map((item) => (\n <div key={item.id} className=\"col-12 col-md-6 col-xl-3 d-flex mb-2\">\n <ProductCard item={item} isLoading={isLoading} />\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nexport default RecentlyViewedCourseProgram;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { Alert } from '@openedx/paragon';
|
|
4
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
5
|
+
import { useRecentlyViewedCoursesAndProgramsData } from '../../hooks/useRecentlyViewedCoursesAndProgramsData';
|
|
6
|
+
import messages from './messages';
|
|
7
|
+
import NoRecentlyViewedItems from './NoRecentlyViewedItems';
|
|
8
|
+
import RecentlyViewedCourseProgram from './RecentlyViewedCourseProgram';
|
|
9
|
+
export const RecentlyViewedPanel = () => {
|
|
10
|
+
const { formatMessage } = useIntl();
|
|
11
|
+
const { data: recentlyViewedCoursesAndProgramsData = [], isError, isLoading, } = useRecentlyViewedCoursesAndProgramsData();
|
|
12
|
+
const hasRecentlyViewedData = useMemo(() => recentlyViewedCoursesAndProgramsData.length > 0, [recentlyViewedCoursesAndProgramsData]);
|
|
13
|
+
if (isError) {
|
|
14
|
+
return (_jsx("div", { className: "recently-viewed-container mt-5 mb-3", "data-testid": "recently-viewed-panel", children: _jsx(Alert, { variant: "danger", "data-testid": "recently-viewed-error", children: formatMessage(messages.recentlyViewedErrorText) }) }));
|
|
15
|
+
}
|
|
16
|
+
return (_jsxs("div", { className: "recently-viewed-container mt-5 mb-3", "data-testid": "recently-viewed-panel", children: [_jsx("div", { className: "recently-viewed-heading-container mb-4", children: _jsx("h2", { children: formatMessage(messages.recentlyViewedHeader) }) }), (isLoading || hasRecentlyViewedData) ? (_jsx(RecentlyViewedCourseProgram, { items: recentlyViewedCoursesAndProgramsData, isLoading: isLoading })) : (_jsx(NoRecentlyViewedItems, {}))] }));
|
|
17
|
+
};
|
|
18
|
+
export default RecentlyViewedPanel;
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/RecentlyViewedPanel/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,uCAAuC,EAAE,MAAM,oDAAoD,CAAC;AAC7G,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AAExE,MAAM,CAAC,MAAM,mBAAmB,GAAO,GAAG,EAAE;IAC1C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EACJ,IAAI,EAAE,oCAAoC,GAAG,EAAE,EAC/C,OAAO,EACP,SAAS,GACV,GAAG,uCAAuC,EAAE,CAAC;IAC9C,MAAM,qBAAqB,GAAG,OAAO,CACnC,GAAG,EAAE,CAAC,oCAAoC,CAAC,MAAM,GAAG,CAAC,EACrD,CAAC,oCAAoC,CAAC,CACvC,CAAC;IAEF,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,cAAK,SAAS,EAAC,qCAAqC,iBAAa,uBAAuB,YACtF,KAAC,KAAK,IAAC,OAAO,EAAC,QAAQ,iBAAa,uBAAuB,YACxD,aAAa,CAAC,QAAQ,CAAC,uBAAuB,CAAC,GAC1C,GACJ,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,eAAK,SAAS,EAAC,qCAAqC,iBAAa,uBAAuB,aACtF,cAAK,SAAS,EAAC,wCAAwC,YACrD,uBAAK,aAAa,CAAC,QAAQ,CAAC,oBAAoB,CAAC,GAAM,GACnD,EACL,CAAC,SAAS,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC,CACtC,KAAC,2BAA2B,IAC1B,KAAK,EAAE,oCAAoC,EAC3C,SAAS,EAAE,SAAS,GACpB,CACH,CAAC,CAAC,CAAC,CACF,KAAC,qBAAqB,KAAG,CAC1B,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { FC, useMemo } from 'react';\nimport { Alert } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { useRecentlyViewedCoursesAndProgramsData } from '@src/hooks/useRecentlyViewedCoursesAndProgramsData';\nimport messages from './messages';\nimport NoRecentlyViewedItems from './NoRecentlyViewedItems';\nimport RecentlyViewedCourseProgram from './RecentlyViewedCourseProgram';\n\nexport const RecentlyViewedPanel: FC = () => {\n const { formatMessage } = useIntl();\n const {\n data: recentlyViewedCoursesAndProgramsData = [],\n isError,\n isLoading,\n } = useRecentlyViewedCoursesAndProgramsData();\n const hasRecentlyViewedData = useMemo(\n () => recentlyViewedCoursesAndProgramsData.length > 0,\n [recentlyViewedCoursesAndProgramsData]\n );\n\n if (isError) {\n return (\n <div className=\"recently-viewed-container mt-5 mb-3\" data-testid=\"recently-viewed-panel\">\n <Alert variant=\"danger\" data-testid=\"recently-viewed-error\">\n {formatMessage(messages.recentlyViewedErrorText)}\n </Alert>\n </div>\n );\n }\n\n return (\n <div className=\"recently-viewed-container mt-5 mb-3\" data-testid=\"recently-viewed-panel\">\n <div className=\"recently-viewed-heading-container mb-4\">\n <h2>{formatMessage(messages.recentlyViewedHeader)}</h2>\n </div>\n {(isLoading || hasRecentlyViewedData) ? (\n <RecentlyViewedCourseProgram\n items={recentlyViewedCoursesAndProgramsData}\n isLoading={isLoading}\n />\n ) : (\n <NoRecentlyViewedItems />\n )}\n </div>\n );\n};\n\nexport default RecentlyViewedPanel;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
recentlyViewedHeader: {
|
|
4
|
+
id: 'subs-dash.recentlyViewedPanel.header',
|
|
5
|
+
defaultMessage: 'Recently viewed courses and programs',
|
|
6
|
+
description: 'Label for the recently viewed courses and programs section',
|
|
7
|
+
},
|
|
8
|
+
recentlyViewedErrorText: {
|
|
9
|
+
id: 'subs-dash.recentlyViewedPanel.errorText',
|
|
10
|
+
defaultMessage: 'Failed to load recently viewed courses and programs. Please try again later.',
|
|
11
|
+
description: 'Error text for failing to load recently viewed courses and 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/RecentlyViewedPanel/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,oBAAoB,EAAE;QACpB,EAAE,EAAE,sCAAsC;QAC1C,cAAc,EAAE,sCAAsC;QACtD,WAAW,EAAE,4DAA4D;KAC1E;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,yCAAyC;QAC7C,cAAc,EAAE,8EAA8E;QAC9F,WAAW,EAAE,qEAAqE;KACnF;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n recentlyViewedHeader: {\n id: 'subs-dash.recentlyViewedPanel.header',\n defaultMessage: 'Recently viewed courses and programs',\n description: 'Label for the recently viewed courses and programs section',\n },\n recentlyViewedErrorText: {\n id: 'subs-dash.recentlyViewedPanel.errorText',\n defaultMessage: 'Failed to load recently viewed courses and programs. Please try again later.',\n description: 'Error text for failing to load recently viewed courses and programs',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -8,4 +8,14 @@ export declare const fetchRecommendedCourses: () => Promise<{
|
|
|
8
8
|
tagText: string;
|
|
9
9
|
footerLabel: string;
|
|
10
10
|
}[]>;
|
|
11
|
+
export declare const fetchRecentlyViewedCoursesAndPrograms: () => Promise<{
|
|
12
|
+
id: number;
|
|
13
|
+
title: string;
|
|
14
|
+
body: string;
|
|
15
|
+
url: string;
|
|
16
|
+
thumbnail: string;
|
|
17
|
+
isProgram: boolean;
|
|
18
|
+
tagText: string;
|
|
19
|
+
footerLabel: string;
|
|
20
|
+
}[]>;
|
|
11
21
|
export declare const getProgramProgressData: (uuid: string) => Promise<any>;
|
|
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { getAuthenticatedHttpClient } from '@openedx/frontend-base';
|
|
11
11
|
import { programProgressUrl } from './urls';
|
|
12
|
+
const optimizedData = (data, size) => (data.length > size ? `${data.slice(0, size)}...` : data);
|
|
12
13
|
export const fetchRecommendedCourses = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
13
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.
|
|
14
15
|
Reason: The API endpoint is not yet available and the data structure is still being finalized.
|
|
15
16
|
Action: Revisit after endpoint is made available.
|
|
16
17
|
*/
|
|
17
|
-
const optimizedData = (data, size) => data.length > size ? `${data.slice(0, size)}...` : data;
|
|
18
18
|
try {
|
|
19
19
|
const finalData = [
|
|
20
20
|
{
|
|
@@ -65,6 +65,61 @@ export const fetchRecommendedCourses = () => __awaiter(void 0, void 0, void 0, f
|
|
|
65
65
|
throw error;
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
+
export const fetchRecentlyViewedCoursesAndPrograms = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
+
/* TODO [TEMP]: Replace with actual API call to fetch recently viewed courses and programs data.
|
|
70
|
+
Reason: The API endpoint is not yet available and the data structure is still being finalized.
|
|
71
|
+
Action: Revisit after endpoint is made available.
|
|
72
|
+
*/
|
|
73
|
+
try {
|
|
74
|
+
const finalData = [
|
|
75
|
+
{
|
|
76
|
+
id: 1,
|
|
77
|
+
title: optimizedData('Data Analytics Fundamentals', 30),
|
|
78
|
+
body: optimizedData('Learn the core concepts of data analytics, including data cleaning, visualization, and basic statistical interpretation.', 100),
|
|
79
|
+
url: 'https://cdn.dummyjson.com/product-images/beauty/essence-mascara-lash-princess/1.webp',
|
|
80
|
+
thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/essence-mascara-lash-princess/thumbnail.webp',
|
|
81
|
+
isProgram: false,
|
|
82
|
+
tagText: '',
|
|
83
|
+
footerLabel: 'Course'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 2,
|
|
87
|
+
title: optimizedData('Product Management Essentials', 30),
|
|
88
|
+
body: optimizedData('Review the workflows, tools, and communication patterns used by product managers to guide delivery across teams.', 100),
|
|
89
|
+
url: 'https://cdn.dummyjson.com/product-images/beauty/eyeshadow-palette-with-mirror/1.webp',
|
|
90
|
+
thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/eyeshadow-palette-with-mirror/thumbnail.webp',
|
|
91
|
+
isProgram: false,
|
|
92
|
+
tagText: '',
|
|
93
|
+
footerLabel: 'Course'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 3,
|
|
97
|
+
title: optimizedData('AI Product Strategy', 30),
|
|
98
|
+
body: optimizedData('Continue a professional certificate covering AI roadmap planning, experimentation, and responsible product delivery.', 100),
|
|
99
|
+
url: 'https://cdn.dummyjson.com/product-images/beauty/powder-canister/1.webp',
|
|
100
|
+
thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/powder-canister/thumbnail.webp',
|
|
101
|
+
isProgram: true,
|
|
102
|
+
tagText: 'Professional Certificate',
|
|
103
|
+
footerLabel: '3 Courses'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: 4,
|
|
107
|
+
title: optimizedData('Red Lipstick', 30),
|
|
108
|
+
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),
|
|
109
|
+
url: 'https://cdn.dummyjson.com/product-images/beauty/red-lipstick/1.webp',
|
|
110
|
+
thumbnail: 'https://cdn.dummyjson.com/product-images/beauty/red-lipstick/thumbnail.webp',
|
|
111
|
+
isProgram: false,
|
|
112
|
+
tagText: '',
|
|
113
|
+
footerLabel: 'Course'
|
|
114
|
+
}
|
|
115
|
+
];
|
|
116
|
+
return finalData;
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
console.error('Error fetching recently viewed courses and programs data:', error);
|
|
120
|
+
throw error;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
68
123
|
export const getProgramProgressData = (uuid) => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
124
|
try {
|
|
70
125
|
const { data } = yield getAuthenticatedHttpClient().get(programProgressUrl(uuid));
|
|
@@ -1 +1 @@
|
|
|
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,MAAM,QAAQ,CAAC;AAE5C,MAAM,
|
|
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,MAAM,QAAQ,CAAC;AAE5C,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,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gBAC3F,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,0BAA0B;gBACnC,WAAW,EAAE,WAAW;aACzB;YACD;gBACE,EAAE,EAAE,CAAC;gBACL,KAAK,EAAE,aAAa,CAAC,cAAc,EAAE,EAAE,CAAC;gBACxC,IAAI,EAAE,aAAa,CAAC,2KAA2K,EAAE,GAAG,CAAC;gBACrM,GAAG,EAAE,qEAAqE;gBAC1E,SAAS,EAAE,6EAA6E;gBACxF,SAAS,EAAE,KAAK;gBAChB,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,QAAQ;aACtB;SACF,CAAC;QAEF,OAAO,SAAS,CAAC;IACnB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,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","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 +1 @@
|
|
|
1
|
-
export { fetchRecommendedCourses, getProgramProgressData } from './api';
|
|
1
|
+
export { fetchRecommendedCourses, fetchRecentlyViewedCoursesAndPrograms, getProgramProgressData, } from './api';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { fetchRecommendedCourses, getProgramProgressData } from './api';
|
|
1
|
+
export { fetchRecommendedCourses, fetchRecentlyViewedCoursesAndPrograms, getProgramProgressData, } 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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data/services/subs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,qCAAqC,EACrC,sBAAsB,GACvB,MAAM,OAAO,CAAC","sourcesContent":["export {\n fetchRecommendedCourses,\n fetchRecentlyViewedCoursesAndPrograms,\n getProgramProgressData,\n} from './api';\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { fetchRecentlyViewedCoursesAndPrograms } from '../data/services/subs';
|
|
3
|
+
type RecentlyViewedCoursesAndProgramsData = Awaited<ReturnType<typeof fetchRecentlyViewedCoursesAndPrograms>>;
|
|
4
|
+
type UseRecentlyViewedCoursesAndProgramsOptions = Omit<UseQueryOptions<RecentlyViewedCoursesAndProgramsData>, 'queryKey' | 'queryFn'>;
|
|
5
|
+
export declare const useRecentlyViewedCoursesAndProgramsData: (options?: UseRecentlyViewedCoursesAndProgramsOptions) => import("@tanstack/react-query").UseQueryResult<{
|
|
6
|
+
id: number;
|
|
7
|
+
title: string;
|
|
8
|
+
body: string;
|
|
9
|
+
url: string;
|
|
10
|
+
thumbnail: string;
|
|
11
|
+
isProgram: boolean;
|
|
12
|
+
tagText: string;
|
|
13
|
+
footerLabel: string;
|
|
14
|
+
}[], Error>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { fetchRecentlyViewedCoursesAndPrograms } from '../data/services/subs';
|
|
3
|
+
export const useRecentlyViewedCoursesAndProgramsData = (options) => {
|
|
4
|
+
return useQuery(Object.assign({ queryKey: ['recentlyViewedCoursesAndPrograms'], queryFn: fetchRecentlyViewedCoursesAndPrograms, staleTime: 1000 * 60 * 5, retry: 2 }, options));
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=useRecentlyViewedCoursesAndProgramsData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecentlyViewedCoursesAndProgramsData.js","sourceRoot":"","sources":["../../src/hooks/useRecentlyViewedCoursesAndProgramsData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,qCAAqC,EAAE,MAAM,yBAAyB,CAAC;AAShF,MAAM,CAAC,MAAM,uCAAuC,GAAG,CACrD,OAAoD,EACpD,EAAE;IACF,OAAO,QAAQ,iBACb,QAAQ,EAAE,CAAC,kCAAkC,CAAC,EAC9C,OAAO,EAAE,qCAAqC,EAC9C,SAAS,EAAE,IAAI,GAAG,EAAE,GAAG,CAAC,EACxB,KAAK,EAAE,CAAC,IACL,OAAO,EACV,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { useQuery, UseQueryOptions } from '@tanstack/react-query';\nimport { fetchRecentlyViewedCoursesAndPrograms } from '@src/data/services/subs';\n\ntype RecentlyViewedCoursesAndProgramsData = Awaited<ReturnType<typeof fetchRecentlyViewedCoursesAndPrograms>>;\n\ntype UseRecentlyViewedCoursesAndProgramsOptions = Omit<\n UseQueryOptions<RecentlyViewedCoursesAndProgramsData>,\n 'queryKey' | 'queryFn'\n>;\n\nexport const useRecentlyViewedCoursesAndProgramsData = (\n options?: UseRecentlyViewedCoursesAndProgramsOptions,\n) => {\n return useQuery({\n queryKey: ['recentlyViewedCoursesAndPrograms'],\n queryFn: fetchRecentlyViewedCoursesAndPrograms,\n staleTime: 1000 * 60 * 5,\n retry: 2,\n ...options,\n });\n};\n"]}
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { LinkMenuItem, WidgetOperationTypes, getAppConfig } from '@openedx/frontend-base';
|
|
3
3
|
import { appId } from '../../constants';
|
|
4
4
|
import ConfirmEmailBanner from './ConfirmEmailBanner';
|
|
5
|
-
import MasqueradeBar from './MasqueradeBar';
|
|
6
5
|
import CoursesLink from './CoursesLink';
|
|
7
6
|
import DiscoverLinkMenuItem from './DiscoverLinkMenuItem';
|
|
8
7
|
import ProgramsLinkMenuItem from './ProgramsLinkMenuItem';
|
|
@@ -57,12 +56,6 @@ const app = {
|
|
|
57
56
|
callback: () => getAppConfig(appId).ORDER_HISTORY_URL ? true : false,
|
|
58
57
|
}
|
|
59
58
|
},
|
|
60
|
-
{
|
|
61
|
-
slotId: 'org.openedx.frontend.slot.header.main.v1',
|
|
62
|
-
id: 'org.openedx.frontend.widget.learnerDashboard.headerMasqueradeBar.v1',
|
|
63
|
-
op: WidgetOperationTypes.APPEND,
|
|
64
|
-
component: MasqueradeBar,
|
|
65
|
-
},
|
|
66
59
|
]
|
|
67
60
|
};
|
|
68
61
|
export default app;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/widgets/LearnerDashboardHeader/app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAO,YAAY,E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E;gBACT,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,eAAe,KAAK,IAAI;aAC7D;SACF;QACD;YACE,MAAM,EAAE,kDAAkD;YAC1D,EAAE,EAAE,oEAAoE;YACxE,EAAE,EAAE,oBAAoB,CAAC,MAAM;YAC/B,OAAO,EAAE,CACP,KAAC,oBAAoB,IACnB,OAAO,EAAC,SAAS,GACjB,CACH;SACF;QACD;YACE,MAAM,EAAE,oDAAoD;YAC5D,EAAE,EAAE,mEAAmE;YACvE,EAAE,EAAE,oBAAoB,CAAC,MAAM;YAC/B,OAAO,EAAE,CACP,KAAC,mBAAmB,IAClB,OAAO,EAAC,SAAS,GACjB,CACH;YACD,SAAS,EAAE;gBACT,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;aAC/D;SACF;QACD;YACE,MAAM,EAAE,uDAAuD;YAC/D,EAAE,EAAE,wEAAwE;YAC5E,EAAE,EAAE,oBAAoB,CAAC,aAAa;YACtC,SAAS,EAAE,sEAAsE;YACjF,OAAO,EAAE,CACP,KAAC,wBAAwB,IACvB,OAAO,EAAC,SAAS,GACjB,CACH;YACD,SAAS,EAAE;gBACT,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;aACrE;SACF;KACF;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { App, LinkMenuItem, WidgetOperationTypes, getAppConfig } from '@openedx/frontend-base';\n\nimport { appId } from '../../constants';\n\nimport ConfirmEmailBanner from './ConfirmEmailBanner';\nimport CoursesLink from './CoursesLink';\nimport DiscoverLinkMenuItem from './DiscoverLinkMenuItem';\nimport ProgramsLinkMenuItem from './ProgramsLinkMenuItem';\nimport SupportLinkMenuItem from './SupportLinkMenuItem';\nimport OrderHistoryLinkMenuItem from './OrderHistoryLinkMenuItem';\n\nconst app: App = {\n appId: 'org.openedx.frontend.app.learnerDashboard.header',\n slots: [\n {\n slotId: 'org.openedx.frontend.slot.header.main.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerConfirmEmail.v1',\n op: WidgetOperationTypes.PREPEND,\n component: ConfirmEmailBanner,\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkCourses.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <LinkMenuItem\n label={<CoursesLink />}\n url=\"/\"\n variant=\"navLink\"\n />\n )\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkPrograms.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <ProgramsLinkMenuItem\n variant=\"navLink\"\n />\n ),\n condition: {\n callback: () => getAppConfig(appId).ENABLE_PROGRAMS === true,\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkDiscover.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <DiscoverLinkMenuItem\n variant=\"navLink\"\n />\n ),\n },\n {\n slotId: 'org.openedx.frontend.slot.header.secondaryLinks.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkSupport.v1',\n op: WidgetOperationTypes.APPEND,\n element: (\n <SupportLinkMenuItem\n variant=\"navLink\"\n />\n ),\n condition: {\n callback: () => getAppConfig(appId).SUPPORT_URL ? true : false,\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkOrderHistory.v1',\n op: WidgetOperationTypes.INSERT_BEFORE,\n relatedId: 'org.openedx.frontend.widget.header.desktopAuthenticatedMenuLogout.v1',\n element: (\n <OrderHistoryLinkMenuItem\n variant=\"navLink\"\n />\n ),\n condition: {\n callback: () => getAppConfig(appId).ORDER_HISTORY_URL ? true : false,\n }\n },\n ]\n};\n\nexport default app;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Slot } from '@openedx/frontend-base';
|
|
3
|
-
import LookingForChallengeWidget from '../../widgets/LookingForChallengeWidget';
|
|
4
|
-
export const WidgetSidebarSlot = () => (_jsx(Slot, { id: "org.openedx.frontend.slot.learnerDashboard.widgetSidebar.v1", children: _jsx(LookingForChallengeWidget, {}) }));
|
|
5
|
-
export default WidgetSidebarSlot;
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/slots/WidgetSidebarSlot/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,yBAAyB,MAAM,yCAAyC,CAAC;AAEhF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,CACrC,KAAC,IAAI,IAAC,EAAE,EAAC,6DAA6D,YACpE,KAAC,yBAAyB,KAAG,GACxB,CACR,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { Slot } from '@openedx/frontend-base';\nimport LookingForChallengeWidget from '../../widgets/LookingForChallengeWidget';\n\nexport const WidgetSidebarSlot = () => (\n <Slot id=\"org.openedx.frontend.slot.learnerDashboard.widgetSidebar.v1\">\n <LookingForChallengeWidget />\n </Slot>\n);\n\nexport default WidgetSidebarSlot;\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useIntl } from '@openedx/frontend-base';
|
|
3
|
-
import { Card, Hyperlink, Icon } from '@openedx/paragon';
|
|
4
|
-
import { ArrowForward } from '@openedx/paragon/icons';
|
|
5
|
-
import { useInitializeLearnerHome } from '../../data/hooks';
|
|
6
|
-
import moreCoursesSVG from '../../assets/more-courses-sidewidget.svg';
|
|
7
|
-
import { baseAppUrl } from '../../data/services/lms/urls';
|
|
8
|
-
import { findCoursesWidgetClicked } from './track';
|
|
9
|
-
import messages from './messages';
|
|
10
|
-
import './index.scss';
|
|
11
|
-
export const arrowIcon = (_jsx(Icon, { className: "mx-1", src: ArrowForward }));
|
|
12
|
-
export const LookingForChallengeWidget = () => {
|
|
13
|
-
var _a;
|
|
14
|
-
const { formatMessage } = useIntl();
|
|
15
|
-
const { data: learnerData } = useInitializeLearnerHome();
|
|
16
|
-
const courseSearchUrl = ((_a = learnerData === null || learnerData === void 0 ? void 0 : learnerData.platformSettings) === null || _a === void 0 ? void 0 : _a.courseSearchUrl) || '';
|
|
17
|
-
const hyperlinkDestination = baseAppUrl(courseSearchUrl) || '';
|
|
18
|
-
return (_jsxs(Card, { orientation: "horizontal", id: "looking-for-challenge-widget", children: [_jsx(Card.ImageCap, { src: moreCoursesSVG, srcAlt: "course side widget" }), _jsxs(Card.Body, { className: "m-auto pr-2", children: [_jsx("h4", { children: formatMessage(messages.lookingForChallengePrompt) }), _jsx("h5", { children: _jsx(Hyperlink, { variant: "brand", destination: hyperlinkDestination, onClick: findCoursesWidgetClicked(hyperlinkDestination), className: "d-flex align-items-center", children: formatMessage(messages.findCoursesButton, { arrow: arrowIcon }) }) })] })] }));
|
|
19
|
-
};
|
|
20
|
-
LookingForChallengeWidget.propTypes = {};
|
|
21
|
-
export default LookingForChallengeWidget;
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/LookingForChallengeWidget/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,SAAS,EAA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AS,EAAC,2BAA2B,YAEpC,aAAa,CAAC,QAAQ,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,GACtD,GACT,IACK,IACP,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,yBAAyB,CAAC,SAAS,GAAG,EAAE,CAAC;AAEzC,eAAe,yBAAyB,CAAC","sourcesContent":["import { useIntl } from '@openedx/frontend-base';\nimport { Card, Hyperlink, Icon } from '@openedx/paragon';\nimport { ArrowForward } from '@openedx/paragon/icons';\n\nimport { useInitializeLearnerHome } from '@src/data/hooks';\nimport moreCoursesSVG from '../../assets/more-courses-sidewidget.svg';\nimport { baseAppUrl } from '../../data/services/lms/urls';\n\nimport { findCoursesWidgetClicked } from './track';\nimport messages from './messages';\nimport './index.scss';\n\nexport const arrowIcon = (<Icon className=\"mx-1\" src={ArrowForward} />);\n\nexport const LookingForChallengeWidget = () => {\n const { formatMessage } = useIntl();\n const { data: learnerData } = useInitializeLearnerHome();\n const courseSearchUrl = learnerData?.platformSettings?.courseSearchUrl || '';\n const hyperlinkDestination = baseAppUrl(courseSearchUrl) || '';\n\n return (\n <Card orientation=\"horizontal\" id=\"looking-for-challenge-widget\">\n <Card.ImageCap\n src={moreCoursesSVG}\n srcAlt=\"course side widget\"\n />\n <Card.Body className=\"m-auto pr-2\">\n <h4>\n {formatMessage(messages.lookingForChallengePrompt)}\n </h4>\n <h5>\n <Hyperlink\n variant=\"brand\"\n destination={hyperlinkDestination}\n onClick={findCoursesWidgetClicked(hyperlinkDestination)}\n className=\"d-flex align-items-center\"\n >\n {formatMessage(messages.findCoursesButton, { arrow: arrowIcon })}\n </Hyperlink>\n </h5>\n </Card.Body>\n </Card>\n );\n};\n\nLookingForChallengeWidget.propTypes = {};\n\nexport default LookingForChallengeWidget;\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default messages;
|
|
2
|
-
declare namespace messages {
|
|
3
|
-
namespace lookingForChallengePrompt {
|
|
4
|
-
let id: string;
|
|
5
|
-
let defaultMessage: string;
|
|
6
|
-
let description: string;
|
|
7
|
-
}
|
|
8
|
-
namespace findCoursesButton {
|
|
9
|
-
let id_1: string;
|
|
10
|
-
export { id_1 as id };
|
|
11
|
-
let defaultMessage_1: string;
|
|
12
|
-
export { defaultMessage_1 as defaultMessage };
|
|
13
|
-
let description_1: string;
|
|
14
|
-
export { description_1 as description };
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
-
const messages = defineMessages({
|
|
3
|
-
lookingForChallengePrompt: {
|
|
4
|
-
id: 'WidgetSidebar.lookingForChallengePrompt',
|
|
5
|
-
defaultMessage: 'Looking for a new challenge?',
|
|
6
|
-
description: 'Prompt user for new challenge',
|
|
7
|
-
},
|
|
8
|
-
findCoursesButton: {
|
|
9
|
-
id: 'WidgetSidebar.findCoursesButton',
|
|
10
|
-
defaultMessage: 'Find a course {arrow}',
|
|
11
|
-
description: 'Button to explore more courses',
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
export default messages;
|
|
15
|
-
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/widgets/LookingForChallengeWidget/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,yBAAyB,EAAE;QACzB,EAAE,EAAE,yCAAyC;QAC7C,cAAc,EAAE,8BAA8B;QAC9C,WAAW,EAAE,+BAA+B;KAC7C;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,iCAAiC;QACrC,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,gCAAgC;KAC9C;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n lookingForChallengePrompt: {\n id: 'WidgetSidebar.lookingForChallengePrompt',\n defaultMessage: 'Looking for a new challenge?',\n description: 'Prompt user for new challenge',\n },\n findCoursesButton: {\n id: 'WidgetSidebar.findCoursesButton',\n defaultMessage: 'Find a course {arrow}',\n description: 'Button to explore more courses',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { StrictDict } from '../../utils';
|
|
2
|
-
import track from '../../tracking';
|
|
3
|
-
export const linkNames = StrictDict({
|
|
4
|
-
findCoursesWidget: 'learner_home_widget_explore',
|
|
5
|
-
});
|
|
6
|
-
export const findCoursesWidgetClicked = (href) => track.findCourses.findCoursesClicked(href, {
|
|
7
|
-
linkName: linkNames.findCoursesWidget,
|
|
8
|
-
});
|
|
9
|
-
export default {
|
|
10
|
-
linkNames,
|
|
11
|
-
findCoursesWidgetClicked,
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=track.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"track.js","sourceRoot":"","sources":["../../../src/widgets/LookingForChallengeWidget/track.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,MAAM,gBAAgB,CAAC;AAEnC,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC;IAClC,iBAAiB,EAAE,6BAA6B;CACjD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,EAAE;IAC3F,QAAQ,EAAE,SAAS,CAAC,iBAAiB;CACtC,CAAC,CAAC;AAEH,eAAe;IACb,SAAS;IACT,wBAAwB;CACzB,CAAC","sourcesContent":["import { StrictDict } from '../../utils';\nimport track from '../../tracking';\n\nexport const linkNames = StrictDict({\n findCoursesWidget: 'learner_home_widget_explore',\n});\n\nexport const findCoursesWidgetClicked = (href) => track.findCourses.findCoursesClicked(href, {\n linkName: linkNames.findCoursesWidget,\n});\n\nexport default {\n linkNames,\n findCoursesWidgetClicked,\n};\n"]}
|