@edx/frontend-app-subscription-learner-dashboard 1.6.0 → 1.8.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.
Files changed (51) hide show
  1. package/dist/containers/Dashboard/DashboardLayout.d.ts +0 -48
  2. package/dist/containers/Dashboard/DashboardLayout.js +2 -24
  3. package/dist/containers/Dashboard/DashboardLayout.js.map +1 -1
  4. package/dist/containers/Dashboard/index.js +2 -1
  5. package/dist/containers/Dashboard/index.js.map +1 -1
  6. package/dist/containers/Dashboard/index.scss +1 -25
  7. package/dist/containers/ProgramDashboard/ProgramsList/index.js +1 -1
  8. package/dist/containers/ProgramDashboard/ProgramsList/index.js.map +1 -1
  9. package/dist/containers/ProgramDashboard/ProgramsList/messages.d.ts +0 -5
  10. package/dist/containers/ProgramDashboard/ProgramsList/messages.js +0 -5
  11. package/dist/containers/ProgramDashboard/ProgramsList/messages.js.map +1 -1
  12. package/dist/containers/ProgramsPanel/index.js +6 -3
  13. package/dist/containers/ProgramsPanel/index.js.map +1 -1
  14. package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/index.d.ts +3 -0
  15. package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/index.js +9 -0
  16. package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/index.js.map +1 -0
  17. package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/messages.d.ts +8 -0
  18. package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/messages.js +10 -0
  19. package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/messages.js.map +1 -0
  20. package/dist/containers/RecentlyViewedPanel/RecentlyViewedCourseProgram/index.d.ts +4 -0
  21. package/dist/containers/RecentlyViewedPanel/RecentlyViewedCourseProgram/index.js +7 -0
  22. package/dist/containers/RecentlyViewedPanel/RecentlyViewedCourseProgram/index.js.map +1 -0
  23. package/dist/containers/RecentlyViewedPanel/index.d.ts +3 -0
  24. package/dist/containers/RecentlyViewedPanel/index.js +19 -0
  25. package/dist/containers/RecentlyViewedPanel/index.js.map +1 -0
  26. package/dist/containers/RecentlyViewedPanel/messages.d.ts +13 -0
  27. package/dist/containers/RecentlyViewedPanel/messages.js +15 -0
  28. package/dist/containers/RecentlyViewedPanel/messages.js.map +1 -0
  29. package/dist/data/services/subs/api.d.ts +10 -0
  30. package/dist/data/services/subs/api.js +56 -1
  31. package/dist/data/services/subs/api.js.map +1 -1
  32. package/dist/data/services/subs/index.d.ts +1 -1
  33. package/dist/data/services/subs/index.js +1 -1
  34. package/dist/data/services/subs/index.js.map +1 -1
  35. package/dist/hooks/useRecentlyViewedCoursesAndProgramsData.d.ts +15 -0
  36. package/dist/hooks/useRecentlyViewedCoursesAndProgramsData.js +6 -0
  37. package/dist/hooks/useRecentlyViewedCoursesAndProgramsData.js.map +1 -0
  38. package/package.json +1 -1
  39. package/dist/slots/WidgetSidebarSlot/index.d.ts +0 -2
  40. package/dist/slots/WidgetSidebarSlot/index.js +0 -6
  41. package/dist/slots/WidgetSidebarSlot/index.js.map +0 -1
  42. package/dist/widgets/LookingForChallengeWidget/index.d.ts +0 -6
  43. package/dist/widgets/LookingForChallengeWidget/index.js +0 -22
  44. package/dist/widgets/LookingForChallengeWidget/index.js.map +0 -1
  45. package/dist/widgets/LookingForChallengeWidget/index.scss +0 -6
  46. package/dist/widgets/LookingForChallengeWidget/messages.d.ts +0 -16
  47. package/dist/widgets/LookingForChallengeWidget/messages.js +0 -15
  48. package/dist/widgets/LookingForChallengeWidget/messages.js.map +0 -1
  49. package/dist/widgets/LookingForChallengeWidget/track.d.ts +0 -7
  50. package/dist/widgets/LookingForChallengeWidget/track.js +0 -13
  51. 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, jsxs as _jsxs } from "react/jsx-runtime";
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
- const { isCollapsed, sidebarShowing, } = hooks.useDashboardLayoutData();
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,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAE9D,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,UAAU,EAAE;QACV,WAAW,EAAE;YACX,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;YAC3B,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;SAC3B;QACD,SAAS,EAAE;YACT,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;YAC3B,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;SAC5B;KACF;IACD,OAAO,EAAE;QACP,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;QAC3B,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;KAC3B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9C,MAAM,EACJ,WAAW,EACX,cAAc,GACf,GAAG,KAAK,CAAC,sBAAsB,EAAE,CAAC;IAEnC,MAAM,qBAAqB,GAAG,cAAc;QAC1C,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,WAAW;QACrC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC;IAEtC,OAAO,CACL,KAAC,SAAS,IAAC,KAAK,QAAC,IAAI,EAAC,IAAI,YACxB,MAAC,GAAG,eACF,KAAC,GAAG,oBAAK,qBAAqB,IAAE,SAAS,EAAC,oBAAoB,YAC3D,QAAQ,IACL,EACN,KAAC,GAAG,oBAAK,YAAY,CAAC,OAAO,IAAE,SAAS,EAAE,CAAC,gBAAgB,EAAE,CAAC,WAAW,IAAI,eAAe,CAAC,YAC3F,KAAC,iBAAiB,KAAG,IACjB,IACF,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\nimport WidgetSidebarSlot from '../../slots/WidgetSidebarSlot';\n\nimport hooks from './hooks';\n\nexport const columnConfig = {\n courseList: {\n withSidebar: {\n lg: { span: 12, offset: 0 },\n xl: { span: 8, offset: 0 },\n },\n noSidebar: {\n lg: { span: 12, offset: 0 },\n xl: { span: 12, offset: 0 },\n },\n },\n sidebar: {\n lg: { span: 12, offset: 0 },\n xl: { span: 4, offset: 0 },\n },\n};\n\nexport const DashboardLayout = ({ children }) => {\n const {\n isCollapsed,\n sidebarShowing,\n } = hooks.useDashboardLayoutData();\n\n const courseListColumnProps = sidebarShowing\n ? columnConfig.courseList.withSidebar\n : columnConfig.courseList.noSidebar;\n\n return (\n <Container fluid size=\"xl\">\n <Row>\n <Col {...courseListColumnProps} className=\"course-list-column\">\n {children}\n </Col>\n <Col {...columnConfig.sidebar} className={['sidebar-column', !isCollapsed && 'not-collapsed']}>\n <WidgetSidebarSlot />\n </Col>\n </Row>\n </Container>\n );\n};\nDashboardLayout.propTypes = {\n children: PropTypes.node.isRequired,\n};\n\nexport default DashboardLayout;\n"]}
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;AAEhE,OAAO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a,KAAG,IACD,CACnB,GACC,IACF,GACD,GACH,CACP,CAAC;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';\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 </DashboardLayout>\n )}\n </div>\n </div>\n </main>\n </div>\n );\n};\n\nexport default Dashboard;\n"]}
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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SAAS;4BACR,CAAC,CAAC,CAAC,KAAC,WAAW,KAAG,CAAC;4BACnB,CAAC,CAAC,CACA,MAAC,eAAe,eACd,KAAC,kBAAkB,KAAG,EACtB,KAAC,cAAc,KAAG,EAClB,KAAC,aAAa,KAAG,EACjB,KAAC,mBAAmB,KAAG,IACP,CACnB,GACC,IACF,GACD,GACH,CACP,CAAC;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
+ }
@@ -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("h3", { children: formatMessage(messages.programsListHeaderText) }), _jsx("p", { children: formatMessage(messages.programsListDescriptionText) }), _jsx(Row, { className: "py-3", children: errorState ? renderFailureAlert() : renderPrograms() })] }));
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,aA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IAAI,CAEjB,CACH,CAAC,GACO,GACP,GACL,CACJ,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,MAAM,kBAAkB,GAAG,GAAG,EAAE;QAC9B,MAAM,UAAU,GAAG,GAAG,aAAa,EAAE,CAAC,UAAU,UAAU,CAAC;QAC3D,OAAO,CACL,KAAC,KAAK,IAAC,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAC,QAAQ,YACxD,aAAa,CAAC,QAAQ,CAAC,8BAA8B,EAAE;gBACtD,iBAAiB,EAAE,CACjB,KAAC,KAAK,CAAC,IAAI,IAAC,IAAI,EAAE,UAAU,YACzB,UAAU,GACA,CACd;aACF,CAAC,GACI,CACT,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,SAAS,IAAC,IAAI,EAAC,IAAI,aAClB,uBACG,aAAa,CAAC,QAAQ,CAAC,sBAAsB,CAAC,GAC5C,EACL,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 <h3>\n {formatMessage(messages.programsListHeaderText)}\n </h3>\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
+ {"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,CAAC;AAChD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MA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AAK,IAAC,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAC,QAAQ,YACxD,aAAa,CAAC,QAAQ,CAAC,8BAA8B,EAAE;gBACtD,iBAAiB,EAAE,CACjB,KAAC,KAAK,CAAC,IAAI,IAAC,IAAI,EAAE,UAAU,YACzB,UAAU,GACA,CACd;aACF,CAAC,GACI,CACT,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,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,9 +1,4 @@
1
1
  declare const messages: {
2
- programsListHeaderText: {
3
- defaultMessage: string;
4
- id: string;
5
- description: string;
6
- };
7
2
  programsListDescriptionText: {
8
3
  defaultMessage: string;
9
4
  id: string;
@@ -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,sBAAsB,EAAE;QACtB,cAAc,EAAE,UAAU;QAC1B,EAAE,EAAE,2BAA2B;QAC/B,WAAW,EAAE,mCAAmC;KACjD;IACD,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 programsListHeaderText: {\n defaultMessage: 'Programs',\n id: 'programs.list.header.text',\n description: 'Header text for the programs list',\n },\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
+ {"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 { useState } from 'react';
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 [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
+ 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,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"]}
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"]}
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const NoRecentlyViewedItems: FC;
3
+ export default NoRecentlyViewedItems;
@@ -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,8 @@
1
+ declare const messages: {
2
+ recentlyViewedEmptyState: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
8
+ export default messages;
@@ -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,4 @@
1
+ import { FC } from 'react';
2
+ import { RecentlyViewedCourseProgramProps } from './data/types';
3
+ export declare const RecentlyViewedCourseProgram: FC<RecentlyViewedCourseProgramProps>;
4
+ export default RecentlyViewedCourseProgram;
@@ -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,3 @@
1
+ import { FC } from 'react';
2
+ export declare const RecentlyViewedPanel: FC;
3
+ export default RecentlyViewedPanel;
@@ -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,13 @@
1
+ declare const messages: {
2
+ recentlyViewedHeader: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ recentlyViewedErrorText: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ };
13
+ export default messages;
@@ -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,CAAC,MAAM,uBAAuB,GAAG,GAAS,EAAE;IAChD;;;QAGI;IAEJ,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,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E,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,4BAA4B,EAAE,KAAK,CAAC,CAAC;QACnD,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\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 const optimizedData = (data: string, size: number) => data.length > size ? `${data.slice(0, size)}...` : data;\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 getProgramProgressData = async (uuid: string) => {\n try {\n const { data } = await getAuthenticatedHttpClient().get(programProgressUrl(uuid));\n return data;\n } catch (error) {\n console.error('Error fetching program progress data:', error);\n throw error;\n }\n};\n"]}
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../src/data/services/subs/api.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,0BAA0B,EAAE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Aa,CAAC,qBAAqB,EAAE,EAAE,CAAC;gBAC/C,IAAI,EAAE,aAAa,CAAC,sHAAsH,EAAE,GAAG,CAAC;gBAChJ,GAAG,EAAE,wEAAwE;gBAC7E,SAAS,EAAE,gFAAgF;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,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC","sourcesContent":["export { fetchRecommendedCourses, getProgramProgressData } from './api';\n"]}
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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-app-subscription-learner-dashboard",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,2 +0,0 @@
1
- export function WidgetSidebarSlot(): import("react/jsx-runtime").JSX.Element;
2
- export default WidgetSidebarSlot;
@@ -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,6 +0,0 @@
1
- export const arrowIcon: import("react/jsx-runtime").JSX.Element;
2
- export function LookingForChallengeWidget(): import("react/jsx-runtime").JSX.Element;
3
- export namespace LookingForChallengeWidget {
4
- let propTypes: {};
5
- }
6
- export default LookingForChallengeWidget;
@@ -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,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,cAAc,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAC,IAAI,IAAC,SAAS,EAAC,MAAM,EAAC,GAAG,EAAE,YAAY,GAAI,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE;;IAC5C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,wBAAwB,EAAE,CAAC;IACzD,MAAM,eAAe,GAAG,CAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,gBAAgB,0CAAE,eAAe,KAAI,EAAE,CAAC;IAC7E,MAAM,oBAAoB,GAAG,UAAU,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;IAE/D,OAAO,CACL,MAAC,IAAI,IAAC,WAAW,EAAC,YAAY,EAAC,EAAE,EAAC,8BAA8B,aAC9D,KAAC,IAAI,CAAC,QAAQ,IACZ,GAAG,EAAE,cAAc,EACnB,MAAM,EAAC,oBAAoB,GAC3B,EACF,MAAC,IAAI,CAAC,IAAI,IAAC,SAAS,EAAC,aAAa,aAChC,uBACG,aAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC,GAC/C,EACL,uBACE,KAAC,SAAS,IACR,OAAO,EAAC,OAAO,EACf,WAAW,EAAE,oBAAoB,EACjC,OAAO,EAAE,wBAAwB,CAAC,oBAAoB,CAAC,EACvD,SAAS,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,6 +0,0 @@
1
- #looking-for-challenge-widget {
2
- .pgn__card-wrapper-image-cap {
3
- overflow: visible;
4
- min-width: auto;
5
- }
6
- }
@@ -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,7 +0,0 @@
1
- export const linkNames: any;
2
- export function findCoursesWidgetClicked(href: any): (e: any) => number;
3
- declare namespace _default {
4
- export { linkNames };
5
- export { findCoursesWidgetClicked };
6
- }
7
- export default _default;
@@ -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"]}