@edx/frontend-app-subscription-learner-dashboard 1.16.0 → 1.18.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 (72) hide show
  1. package/dist/containers/Dashboard/DashboardHeader.d.ts +3 -0
  2. package/dist/containers/Dashboard/DashboardHeader.js +10 -0
  3. package/dist/containers/Dashboard/DashboardHeader.js.map +1 -0
  4. package/dist/containers/Dashboard/index.js +8 -4
  5. package/dist/containers/Dashboard/index.js.map +1 -1
  6. package/dist/containers/Dashboard/index.scss +12 -1
  7. package/dist/containers/Dashboard/messages.d.ts +10 -0
  8. package/dist/containers/Dashboard/messages.js +10 -0
  9. package/dist/containers/Dashboard/messages.js.map +1 -1
  10. package/dist/containers/PopularCoursePanel/NoPopularCourseItems/index.d.ts +3 -0
  11. package/dist/containers/PopularCoursePanel/NoPopularCourseItems/index.js +9 -0
  12. package/dist/containers/PopularCoursePanel/NoPopularCourseItems/index.js.map +1 -0
  13. package/dist/containers/{RecentlyViewedPanel/NoRecentlyViewedItems → PopularCoursePanel/NoPopularCourseItems}/messages.d.ts +1 -1
  14. package/dist/containers/PopularCoursePanel/NoPopularCourseItems/messages.js +10 -0
  15. package/dist/containers/PopularCoursePanel/NoPopularCourseItems/messages.js.map +1 -0
  16. package/dist/containers/PopularCoursePanel/PopularCourses/index.d.ts +4 -0
  17. package/dist/containers/{RecentlyViewedPanel/RecentlyViewedCourseProgram → PopularCoursePanel/PopularCourses}/index.js +3 -3
  18. package/dist/containers/PopularCoursePanel/PopularCourses/index.js.map +1 -0
  19. package/dist/containers/PopularCoursePanel/index.d.ts +3 -0
  20. package/dist/containers/PopularCoursePanel/index.js +21 -0
  21. package/dist/containers/PopularCoursePanel/index.js.map +1 -0
  22. package/dist/containers/{RecentlyViewedPanel → PopularCoursePanel}/messages.d.ts +2 -2
  23. package/dist/containers/PopularCoursePanel/messages.js +15 -0
  24. package/dist/containers/PopularCoursePanel/messages.js.map +1 -0
  25. package/dist/containers/ProductCard/index.d.ts +1 -1
  26. package/dist/containers/ProductCard/index.js +7 -6
  27. package/dist/containers/ProductCard/index.js.map +1 -1
  28. package/dist/containers/ProductCard/index.scss +17 -6
  29. package/dist/containers/ProductCard/messages.d.ts +13 -0
  30. package/dist/containers/ProductCard/messages.js +15 -0
  31. package/dist/containers/ProductCard/messages.js.map +1 -0
  32. package/dist/containers/ProgramDashboard/ProgramProgress/InProgressTabData/index.d.ts +2 -0
  33. package/dist/containers/ProgramDashboard/ProgramProgress/InProgressTabData/index.js +39 -0
  34. package/dist/containers/ProgramDashboard/ProgramProgress/InProgressTabData/index.js.map +1 -0
  35. package/dist/containers/ProgramDashboard/ProgramProgress/ProgramProgressTabs/index.js +2 -1
  36. package/dist/containers/ProgramDashboard/ProgramProgress/ProgramProgressTabs/index.js.map +1 -1
  37. package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCard/index.js +20 -2
  38. package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCard/index.js.map +1 -1
  39. package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/ProgressCardButton.js +15 -6
  40. package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/ProgressCardButton.js.map +1 -1
  41. package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/index.js +5 -2
  42. package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCardActions/index.js.map +1 -1
  43. package/dist/containers/ProgramDashboard/ProgramProgress/index.scss +6 -0
  44. package/dist/containers/ProgramDashboard/ProgramProgress/messages.d.ts +45 -0
  45. package/dist/containers/ProgramDashboard/ProgramProgress/messages.js +45 -0
  46. package/dist/containers/ProgramDashboard/ProgramProgress/messages.js.map +1 -1
  47. package/dist/containers/ProgramDashboard/data/util.d.ts +14 -0
  48. package/dist/containers/ProgramDashboard/data/util.js +26 -0
  49. package/dist/containers/ProgramDashboard/data/util.js.map +1 -1
  50. package/dist/data/services/subs/urls.d.ts +1 -0
  51. package/dist/data/services/subs/urls.js +1 -1
  52. package/dist/data/services/subs/urls.js.map +1 -1
  53. package/dist/hooks/{useRecentlyViewedCoursesAndProgramsData.d.ts → usePopularCourses.d.ts} +1 -1
  54. package/dist/hooks/{useRecentlyViewedCoursesAndProgramsData.js → usePopularCourses.js} +7 -4
  55. package/dist/hooks/usePopularCourses.js.map +1 -0
  56. package/dist/routes.d.ts +2 -3
  57. package/dist/routes.js +28 -3
  58. package/dist/routes.js.map +1 -1
  59. package/package.json +1 -1
  60. package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/index.d.ts +0 -3
  61. package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/index.js +0 -9
  62. package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/index.js.map +0 -1
  63. package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/messages.js +0 -10
  64. package/dist/containers/RecentlyViewedPanel/NoRecentlyViewedItems/messages.js.map +0 -1
  65. package/dist/containers/RecentlyViewedPanel/RecentlyViewedCourseProgram/index.d.ts +0 -4
  66. package/dist/containers/RecentlyViewedPanel/RecentlyViewedCourseProgram/index.js.map +0 -1
  67. package/dist/containers/RecentlyViewedPanel/index.d.ts +0 -3
  68. package/dist/containers/RecentlyViewedPanel/index.js +0 -21
  69. package/dist/containers/RecentlyViewedPanel/index.js.map +0 -1
  70. package/dist/containers/RecentlyViewedPanel/messages.js +0 -15
  71. package/dist/containers/RecentlyViewedPanel/messages.js.map +0 -1
  72. package/dist/hooks/useRecentlyViewedCoursesAndProgramsData.js.map +0 -1
@@ -1,3 +0,0 @@
1
- import { FC } from 'react';
2
- export declare const RecentlyViewedPanel: FC;
3
- export default RecentlyViewedPanel;
@@ -1,21 +0,0 @@
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 { useAlgoliaSearch } from '../../utils/algoliaUtils';
7
- import messages from './messages';
8
- import NoRecentlyViewedItems from './NoRecentlyViewedItems';
9
- import RecentlyViewedCourseProgram from './RecentlyViewedCourseProgram';
10
- export const RecentlyViewedPanel = () => {
11
- const { formatMessage } = useIntl();
12
- const [searchClient] = useAlgoliaSearch();
13
- const { data: recentlyViewedCoursesAndProgramsData = [], isError, isLoading, } = useRecentlyViewedCoursesAndProgramsData(searchClient, true);
14
- const hasRecentlyViewedData = useMemo(() => recentlyViewedCoursesAndProgramsData.length > 0, [recentlyViewedCoursesAndProgramsData]);
15
- if (isError) {
16
- 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) }) }));
17
- }
18
- 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, {}))] }));
19
- };
20
- export default RecentlyViewedPanel;
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,QAAQ,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end-base';\n\nimport { useRecentlyViewedCoursesAndProgramsData } from '@src/hooks/useRecentlyViewedCoursesAndProgramsData';\nimport { useAlgoliaSearch } from '@src/utils/algoliaUtils';\nimport messages from './messages';\nimport NoRecentlyViewedItems from './NoRecentlyViewedItems';\nimport RecentlyViewedCourseProgram from './RecentlyViewedCourseProgram';\n\nexport const RecentlyViewedPanel: FC = () => {\n const { formatMessage } = useIntl();\n const [searchClient] = useAlgoliaSearch();\n const {\n data: recentlyViewedCoursesAndProgramsData = [],\n isError,\n isLoading,\n } = useRecentlyViewedCoursesAndProgramsData(searchClient, true);\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"]}
@@ -1,15 +0,0 @@
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
@@ -1 +0,0 @@
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"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRecentlyViewedCoursesAndProgramsData.js","sourceRoot":"","sources":["../../src/hooks/useRecentlyViewedCoursesAndProgramsData.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,iFAAiF;AACjF,oDAAoD;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,GAAG,EAAE,CAAC,QAAQ,CAAU;IACxB,QAAQ,EAAE,CAAC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CAAI,EAAE;gBACtD,WAAW,EAAE,MAAA,MAAA,UAAU,CAAC,YAAY,mCAAI,UAAU,CAAC,IAAI,mCAAI,QAAQ;gBACnE,OAAO,EAAE,QAAQ;aAClB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAA;IACD,OAAO,EAAE,CAAC,CAAC,YAAY,IAAI,OAAO;IAClC,SAAS,EAAE,IAAI,GAAG,EAAE,GAAG,EAAE;CAC1B,CAAC,CAAC","sourcesContent":["import { useQuery, UseQueryResult } from '@tanstack/react-query';\nimport { SearchClient } from 'algoliasearch';\nimport { ProductType } from '@src/types/types';\nimport { PRODUCT_TYPE_COURSE } from '@src/constants';\nimport { fetchPopularProducts } from '@src/utils/algoliaUtils';\nimport { ProductCardItem } from '@src/containers/ProductCard/data/types';\n\n// ─── Query key factories ──────────────────────────────────────────────────────\n// Centralised so cache invalidation is never a typo\n\nexport const searchKeys = {\n all: ['search'] as const,\n programs: (query: string, tags: string[]) =>\n [...searchKeys.all, 'programs', query, tags] as const,\n courses: (query: string, tags: string[], page: number) =>\n [...searchKeys.all, 'courses', query, tags, page] as const,\n popular: (productType: ProductType, limit: number) =>\n [...searchKeys.all, 'popular', productType, limit] as const,\n};\n\nexport const useRecentlyViewedCoursesAndProgramsData = (\n searchClient: SearchClient | null,\n enabled: boolean,\n): UseQueryResult<ProductCardItem[]> =>\n useQuery({\n queryKey: searchKeys.popular(PRODUCT_TYPE_COURSE, 4),\n queryFn: async () => {\n const hits = await fetchPopularProducts(searchClient!, PRODUCT_TYPE_COURSE, 4);\n return hits.map((hit): ProductCardItem => {\n const hitDetails = hit as {\n short_description?: string,\n primary_description?: string,\n description?: string,\n marketing_url?: string,\n image_url?: string,\n card_image_url?: string,\n organization_logo_override?: string,\n content_type?: string,\n type?: string,\n };\n\n return {\n objectID: hit.objectID,\n title: hit.title ?? hit.name ?? 'Untitled',\n primary_description: hitDetails.primary_description ?? hitDetails.short_description ?? hitDetails.description ?? '',\n url: hitDetails.card_image_url ?? hitDetails.image_url ?? hitDetails.marketing_url ?? '',\n thumbnail: hitDetails.organization_logo_override ?? '',\n footerLabel: hitDetails.content_type ?? hitDetails.type ?? 'Course',\n product: 'Course',\n };\n });\n },\n enabled: !!searchClient && enabled,\n staleTime: 1000 * 60 * 10,\n });\n"]}