@openedx/frontend-app-learner-dashboard 1.0.0-alpha.9 → 2.0.0-alpha.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.
Files changed (37) hide show
  1. package/README.rst +295 -49
  2. package/dist/Main.js +11 -4
  3. package/dist/Main.js.map +1 -1
  4. package/dist/app.js +0 -1
  5. package/dist/app.js.map +1 -1
  6. package/dist/constants.d.ts +1 -0
  7. package/dist/constants.js +1 -0
  8. package/dist/constants.js.map +1 -1
  9. package/dist/containers/CourseCard/components/CourseCardActions/BeginCourseButton.js +1 -1
  10. package/dist/containers/CourseCard/components/CourseCardActions/BeginCourseButton.js.map +1 -1
  11. package/dist/containers/CourseCard/components/CourseCardActions/ResumeButton.js +3 -2
  12. package/dist/containers/CourseCard/components/CourseCardActions/ResumeButton.js.map +1 -1
  13. package/dist/containers/CourseCard/components/CourseCardActions/ViewCourseButton.js +1 -1
  14. package/dist/containers/CourseCard/components/CourseCardActions/ViewCourseButton.js.map +1 -1
  15. package/dist/containers/CourseCard/components/CourseCardBanners/CertificateBanner.js +1 -1
  16. package/dist/containers/CourseCard/components/CourseCardBanners/CertificateBanner.js.map +1 -1
  17. package/dist/containers/CoursesPanel/index.scss +2 -0
  18. package/dist/containers/Dashboard/index.scss +2 -0
  19. package/dist/messages.d.ts +5 -0
  20. package/dist/messages.js +5 -0
  21. package/dist/messages.js.map +1 -1
  22. package/dist/routes.d.ts +1 -1
  23. package/dist/routes.js +4 -3
  24. package/dist/routes.js.map +1 -1
  25. package/dist/{app.scss → style.scss} +0 -2
  26. package/dist/widgets/LearnerDashboardHeader/MasqueradeBar/index.js +4 -4
  27. package/dist/widgets/LearnerDashboardHeader/MasqueradeBar/index.js.map +1 -1
  28. package/dist/widgets/LearnerDashboardHeader/MasqueradeBar/index.scss +5 -3
  29. package/dist/widgets/LearnerDashboardHeader/app.js +16 -11
  30. package/dist/widgets/LearnerDashboardHeader/app.js.map +1 -1
  31. package/dist/widgets/LearnerDashboardHeader/messages.d.ts +13 -21
  32. package/dist/widgets/LearnerDashboardHeader/messages.js +0 -5
  33. package/dist/widgets/LearnerDashboardHeader/messages.js.map +1 -1
  34. package/package.json +5 -5
  35. package/dist/widgets/LearnerDashboardHeader/SupportLinkMenuItem.d.ts +0 -3
  36. package/dist/widgets/LearnerDashboardHeader/SupportLinkMenuItem.js +0 -15
  37. package/dist/widgets/LearnerDashboardHeader/SupportLinkMenuItem.js.map +0 -1
package/README.rst CHANGED
@@ -1,61 +1,263 @@
1
- |license-badge| |status-badge| |ci-badge| |codecov-badge|
1
+ ##############################
2
+ frontend-app-learner-dashboard
3
+ ##############################
2
4
 
3
- .. |license-badge| image:: https://img.shields.io/github/license/openedx/frontend-app-learner-dashboard.svg
4
- :target: https://github.com/openedx/frontend-app-learner-dashboard/blob/master/LICENSE
5
- :alt: License
6
- .. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
7
- :alt: Maintained
8
- .. |ci-badge| image:: https://github.com/openedx/frontend-app-learner-dashboard/actions/workflows/ci.yml/badge.svg
9
- :target: https://github.com/openedx/frontend-app-learner-dashboard/actions/workflows/ci.yml
10
- :alt: Continuous Integration
11
- .. |codecov-badge| image:: https://codecov.io/github/openedx/frontend-app-learner-dashboard/coverage.svg?branch=master
12
- :target: https://app.codecov.io/github/openedx/frontend-app-learner-dashboard?branch=master
13
- :alt: Codecov
5
+ |license-badge| |status-badge| |ci-badge| |codecov-badge| |semantic-release|
14
6
 
15
- frontend-app-learner-dashboard
16
- ==============================
7
+ The Learner Dashboard is a `frontend-base`_ application: a library that plugs
8
+ into the Open edX frontend shell, rather than a standalone micro-frontend
9
+ bundled with its own webpack build.
17
10
 
18
- The Learner Home app is a microfrontend (MFE) course listing experience for the Open edX Learning Management System
19
- (LMS). This experience was designed to provide a clean and functional interface to allow learners to view all of their
20
- open enrollments, as well as take relevant actions on those enrollments. It also serves as host to a number of exposed
21
- "widget" containers to provide upsell and discovery widgets as sidebar components.
11
+ .. _frontend-base: https://github.com/openedx/frontend-base
22
12
 
23
- Quickstart
24
- ----------
13
+ ********
14
+ Purpose
15
+ ********
25
16
 
26
- To start the MFE and enable the feature in LMS:
17
+ This app is the course listing experience for the Open edX Learning Management
18
+ System. It gives learners a single place to see all of their open enrollments
19
+ and act on them: resume a course, change a session, manage email settings,
20
+ unenroll, view related programs, and pursue credit or certificates.
27
21
 
28
- 1. Start the MFE with ``npm run start``. Take a note of the path/port (defaults to ``http://localhost:1996``).
22
+ It also hosts a sidebar of widget slots, which operators use for upsell and
23
+ discovery components.
29
24
 
30
- From there, simply load the configured address/port. You should be prompted to log into your LMS if you are not
31
- already, and then redirected to your home page.
25
+ *********************
26
+ Branches and Releases
27
+ *********************
32
28
 
33
- Widgets
34
- -------
35
- This MFE can be customized with widgets. The parts of this MFE that can be customized in that manner are documented
36
- `here </src/slots>`_.
29
+ This app is published to NPM by ``semantic-release``, and its branches follow
30
+ `OEP-10 ADR 0002`_:
37
31
 
38
- License
39
- -------
32
+ ``master``
33
+ Unstable. Every merge publishes a prerelease on the ``alpha`` dist-tag.
34
+ Breaking changes land here with no DEPR process and no warning, so it is not
35
+ supported in production. All changes, including bug fixes, should target this
36
+ branch first.
40
37
 
41
- The code in this repository is licensed under the AGPLv3 unless otherwise noted.
38
+ ``stable``
39
+ Carries the newest stable major and owns the ``latest`` dist-tag. Changes
40
+ arrive here as backports from ``master``, and no breaking change lands after
41
+ publication.
42
+
43
+ ``n.x`` and ``n.m.x``
44
+ Maintenance branches for majors and minors that ``stable`` has moved past.
45
+ Each owns the dist-tag matching its own name, so consumers select a maintained
46
+ line by semver range, e.g. ``"1.x"``.
47
+
48
+ ``stable`` is cut, and ``1.0.0`` is the current stable release. Both
49
+ ``.releaserc`` and the ``Release CI`` workflow know the whole layout, including
50
+ the maintenance branch patterns, so a new line starts publishing as soon as it
51
+ is pushed.
52
+
53
+ This repository is no longer branched or tagged for Open edX releases in its own
54
+ right. It participates by published version instead, per `OEP-10 ADR 0003`_.
55
+
56
+ The micro-frontend this app replaces goes on living on `legacy-mfe`_, which is
57
+ where any further ``release/RELEASENAME`` branches for it are cut, for as long as
58
+ a supported release still ships it. Teak, Ulmo and Verawood all do.
59
+
60
+ .. _OEP-10 ADR 0002: https://docs.openedx.org/projects/openedx-proposals/en/latest/processes/oep-0010/decisions/0002-frontend-stable-branches.html
61
+ .. _OEP-10 ADR 0003: https://docs.openedx.org/projects/openedx-proposals/en/latest/processes/oep-0010/decisions/0003-frontend-release-strategy.html
62
+ .. _legacy-mfe: https://github.com/openedx/frontend-app-learner-dashboard/tree/legacy-mfe
63
+
64
+ ***************
65
+ Getting Started
66
+ ***************
67
+
68
+ Prerequisites
69
+ =============
70
+
71
+ A running Open edX instance is needed to serve this app's backend APIs.
72
+ `Tutor`_ in development mode is the usual choice, and ``site.config.dev.tsx``
73
+ already points at its default hostnames.
74
+
75
+ Unlike a micro-frontend, this app is neither built nor served by ``tutor-mfe``.
76
+ The dev server below runs on the host. Note that ``tutor-mfe`` v22 and later do
77
+ ship this app as a frontend-base application for *deployment*, disabled by
78
+ default; see `Frontend apps`_ in its README to enable it.
79
+
80
+ .. _Tutor: https://github.com/overhangio/tutor
81
+ .. _Frontend apps: https://github.com/overhangio/tutor-mfe#frontend-apps
82
+
83
+ Cloning and Startup
84
+ ===================
85
+
86
+ 1. Clone the repo:
87
+
88
+ ``git clone https://github.com/openedx/frontend-app-learner-dashboard.git``
89
+
90
+ 2. Use the version of Node specified in the ``.nvmrc`` file.
91
+
92
+ Using other major versions of Node *may* work, but is unsupported. This
93
+ repository includes an ``.nvmrc`` file to help set the correct Node version
94
+ via `nvm <https://github.com/nvm-sh/nvm>`_.
95
+
96
+ 3. Install npm dependencies:
97
+
98
+ ``cd frontend-app-learner-dashboard && npm install``
99
+
100
+ 4. Start the dev server:
101
+
102
+ ``npm run dev``
103
+
104
+ The dev server defaults to ``PORT=1996 PUBLIC_PATH=/learner-dashboard`` (set in
105
+ the ``dev`` script in ``package.json``) and is available at
106
+ `http://apps.local.openedx.io:1996/learner-dashboard <http://apps.local.openedx.io:1996/learner-dashboard>`_.
107
+
108
+ Configuration used by the dev server is defined in ``site.config.dev.tsx`` at
109
+ the repo root.
110
+
111
+ Local Development Against ``frontend-base``
112
+ ===========================================
113
+
114
+ To develop this app and a local checkout of ``frontend-base`` in tandem, use the
115
+ built-in npm workspace support:
116
+
117
+ .. code-block:: sh
118
+
119
+ mkdir -p packages/frontend-base
120
+ sudo mount --bind /path/to/frontend-base packages/frontend-base
121
+ npm install
122
+ npm run dev:packages
123
+
124
+ Bind mounts are used instead of symlinks because Node resolves symlinks to their
125
+ real paths, which breaks hoisted dependency resolution. When you are done,
126
+ unmount with ``sudo umount packages/frontend-base``.
127
+
128
+ Configuration
129
+ =============
130
+
131
+ This app is no longer configured by build-time environment variables.
132
+ ``getAppConfig`` resolves three sources, in order of increasing precedence: the
133
+ app's bundled defaults, the site's ``commonAppConfig``, and the app's ``config``.
134
+ The first is the app author's, at build time; the other two are the operator's,
135
+ the second applying to every app on the site and the third to this app alone. In
136
+ edx-platform they arrive as ``MFE_CONFIG`` and
137
+ ``MFE_CONFIG_OVERRIDES['learner-dashboard']`` respectively.
138
+
139
+ The full list of keys and their defaults is the ``config`` block in
140
+ ``src/app.ts``:
141
+
142
+ .. list-table::
143
+ :widths: 30 50 20
144
+ :header-rows: 1
145
+
146
+ * - Name
147
+ - Description / Usage
148
+ - Example
149
+
150
+ * - ``LEARNING_BASE_URL``
151
+ - Base URL of the Learning MFE, used to build course home and courseware
152
+ links from the dashboard's cards.
153
+ - ``http://apps.local.openedx.io:2000``
42
154
 
43
- Please see the `license`_ for more info.
155
+ * - ``ENABLE_PROGRAMS``
156
+ - Shows the Programs link in the header's primary navigation, pointing at
157
+ the LMS's ``/dashboard/programs``. The related-programs badges and
158
+ banners on course cards are driven by course data and are not affected by
159
+ this.
160
+ - ``false``
44
161
 
45
- .. _license: https://github.com/openedx/frontend-app-learner-dashboard/blob/master/LICENSE
162
+ * - ``ECOMMERCE_BASE_URL``
163
+ - Base URL of the ecommerce service. Used to build the credit checkout
164
+ link, as ``ECOMMERCE_BASE_URL/credit/checkout/COURSE_ID/``.
165
+ - ``''``
46
166
 
167
+ * - ``CREDIT_PURCHASE_URL``
168
+ - Overrides the credit checkout link with ``CREDIT_PURCHASE_URL/COURSE_ID/``,
169
+ for deployments whose credit purchase flow does not live behind
170
+ ``ECOMMERCE_BASE_URL``. It has no bundled default; set it to take
171
+ precedence.
172
+ - ``''``
173
+
174
+ * - ``ORDER_HISTORY_URL``
175
+ - Destination of the order history link in the header menu. The link is
176
+ hidden when this is empty.
177
+ - ``''``
178
+
179
+ * - ``SHOW_UNENROLL_SURVEY``
180
+ - Shows the survey that asks learners why they unenrolled, as the last step
181
+ of the unenrollment flow.
182
+ - ``false``
183
+
184
+ *****
185
+ Slots
186
+ *****
187
+
188
+ This app offers slots for operators to customize its pages. See `src/slots/`_
189
+ for the current list and per-slot READMEs with usage examples.
190
+
191
+ .. _src/slots/: ./src/slots/
192
+
193
+ **********
194
+ Developing
195
+ **********
196
+
197
+ Project Structure
198
+ =================
199
+
200
+ The layout follows the standard `frontend-base app layout`_:
201
+
202
+ - ``src/app.ts`` - the app definition imported by ``site.config.*.tsx``.
203
+ - ``src/constants.ts`` - the app's ``appId`` and route role identifiers.
204
+ - ``src/index.ts`` - the package's public exports (this is a library).
205
+ - ``src/routes.jsx`` - the app's react-router routes.
206
+ - ``src/Main.jsx`` - the root component for the app's routes.
207
+ - ``src/providers.ts`` - the context providers the app wraps the site in.
208
+ - ``src/slots.tsx`` - slot operations this app performs on *other* apps' slots,
209
+ such as the header.
210
+ - ``src/slots/`` - the slots this app offers to consumers.
211
+ - ``src/widgets/`` - components this app contributes to slots, including its
212
+ header.
213
+ - ``src/style.scss`` - app-scoped runtime styles.
214
+
215
+ Everything else under ``src/`` is a feature or shared-concern directory:
216
+ ``containers/`` for the page's composed pieces, ``components/`` for the reusable
217
+ ones, ``data/`` for API access and React Query hooks, and ``hooks/``,
218
+ ``tracking/`` and ``utils/`` for the shared remainder.
219
+
220
+ For more, see the `frontend-base migration how-to`_.
221
+
222
+ .. _frontend-base app layout: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/migrate-frontend-app.md#src-file-structure
223
+ .. _frontend-base migration how-to: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/migrate-frontend-app.md
224
+
225
+ Build Process Notes
226
+ ===================
227
+
228
+ **Library build**
229
+
230
+ ``npm run build`` compiles the library into ``dist/`` via ``tsc`` and
231
+ ``tsc-alias``, and copies the SCSS and asset files across. This is what gets
232
+ published and consumed by sites.
233
+
234
+ **CI build**
235
+
236
+ ``npm run build:ci`` runs ``openedx build`` against ``site.config.ci.tsx`` so
237
+ webpack traverses the full app graph. This catches issues, such as broken
238
+ lazy-loaded imports, that ``tsc`` and Jest would not surface.
239
+
240
+ Internationalization
241
+ ====================
242
+
243
+ Please refer to the `frontend-base i18n howto`_ for documentation on
244
+ internationalization.
245
+
246
+ .. _frontend-base i18n howto: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/i18n.rst
247
+
248
+ ************
47
249
  Getting Help
48
- ------------
250
+ ************
49
251
 
50
- If you're having trouble, we have discussion forums at https://discuss.openedx.org where you can connect with others in
51
- the community.
252
+ If you're having trouble, we have discussion forums at
253
+ https://discuss.openedx.org where you can connect with others in the community.
52
254
 
53
- Our real-time conversations are on Slack. You can request a `Slack invitation`_, then join our
54
- `community Slack workspace`_. Because this is a frontend repository, the best place to discuss it would be in the
55
- `#wg-frontend channel`_.
255
+ Our real-time conversations are on Slack. You can request a `Slack invitation`_,
256
+ then join our `community Slack workspace`_. Because this is a frontend
257
+ repository, the best place to discuss it would be in the `#wg-frontend channel`_.
56
258
 
57
- For anything non-trivial, the best path is to open an issue in this repository with as many details about the issue you
58
- are facing as you can provide.
259
+ For anything non-trivial, the best path is to open an issue in this repository
260
+ with as many details about the issue you are facing as you can provide.
59
261
 
60
262
  https://github.com/openedx/frontend-app-learner-dashboard/issues
61
263
 
@@ -64,23 +266,67 @@ For more information about these options, see the `Getting Help`_ page.
64
266
  .. _Slack invitation: https://openedx.org/slack
65
267
  .. _community Slack workspace: https://openedx.slack.com/
66
268
  .. _#wg-frontend channel: https://openedx.slack.com/archives/C04BM6YC7A6
67
- .. _Getting Help: https://openedx.org/community/connect
269
+ .. _Getting Help: https://openedx.org/getting-help
68
270
 
69
- Resources
70
- ---------
271
+ *******
272
+ License
273
+ *******
71
274
 
72
- Additional info about the Learner Home MFE project can be found on the `Open edX Wiki`_.
275
+ The code in this repository is licensed under the AGPLv3 unless otherwise noted.
73
276
 
74
- .. _Open edX Wiki: https://openedx.atlassian.net/wiki/spaces/OEPM/pages/3575906333/Learner+Home
277
+ Please see `LICENSE <LICENSE>`_ for details.
75
278
 
279
+ ************
280
+ Contributing
281
+ ************
282
+
283
+ Contributions are very welcome. Please read `How To Contribute`_ for details.
284
+
285
+ .. _How To Contribute: https://openedx.org/r/how-to-contribute
286
+
287
+ This project is currently accepting all types of contributions, bug fixes and
288
+ security fixes.
289
+
290
+ ****************************
76
291
  The Open edX Code of Conduct
77
- ----------------------------
292
+ ****************************
78
293
 
79
294
  All community members are expected to follow the `Open edX Code of Conduct`_.
80
295
 
81
296
  .. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/
82
297
 
298
+ ******
299
+ People
300
+ ******
301
+
302
+ The assigned maintainers for this component and other project details may be
303
+ found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``
304
+ file in this repo.
305
+
306
+ .. _Backstage: https://backstage.openedx.org/catalog/default/component/frontend-app-learner-dashboard
307
+
308
+ *************************
83
309
  Reporting Security Issues
84
- -------------------------
310
+ *************************
311
+
312
+ Please do not report security issues in public, and email security@openedx.org
313
+ instead.
314
+
315
+ .. |license-badge| image:: https://img.shields.io/github/license/openedx/frontend-app-learner-dashboard.svg
316
+ :target: https://github.com/openedx/frontend-app-learner-dashboard/blob/master/LICENSE
317
+ :alt: License
318
+
319
+ .. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
320
+ :alt: Maintained
321
+
322
+ .. |ci-badge| image:: https://github.com/openedx/frontend-app-learner-dashboard/actions/workflows/ci.yml/badge.svg
323
+ :target: https://github.com/openedx/frontend-app-learner-dashboard/actions/workflows/ci.yml
324
+ :alt: Continuous Integration
325
+
326
+ .. |codecov-badge| image:: https://codecov.io/github/openedx/frontend-app-learner-dashboard/coverage.svg?branch=master
327
+ :target: https://codecov.io/github/openedx/frontend-app-learner-dashboard?branch=master
328
+ :alt: Codecov
85
329
 
86
- Please do not report security issues in public. Please email security@openedx.org.
330
+ .. |semantic-release| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
331
+ :target: https://github.com/semantic-release/semantic-release
332
+ :alt: semantic-release
package/dist/Main.js CHANGED
@@ -1,9 +1,16 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { CurrentAppProvider, PageWrap } from '@openedx/frontend-base';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CurrentAppProvider, getSiteConfig, PageWrap, useIntl } from '@openedx/frontend-base';
3
+ import { Helmet } from 'react-helmet';
3
4
  import { appId } from './constants';
4
5
  import ContextProviders from './data/context';
5
6
  import Dashboard from './containers/Dashboard';
6
- import './app.scss';
7
- const Main = () => (_jsx(CurrentAppProvider, { appId: appId, children: _jsx(ContextProviders, { children: _jsx(PageWrap, { children: _jsx(Dashboard, {}) }) }) }));
7
+ import messages from './messages';
8
+ import './style.scss';
9
+ const Main = () => {
10
+ const { formatMessage } = useIntl();
11
+ return (_jsxs(CurrentAppProvider, { appId: appId, children: [_jsx(Helmet, { children: _jsx("title", { children: formatMessage(messages['learner-dash.page.title'], {
12
+ siteName: getSiteConfig().siteName,
13
+ }) }) }), _jsx(ContextProviders, { children: _jsx(PageWrap, { children: _jsx(Dashboard, {}) }) })] }));
14
+ };
8
15
  export default Main;
9
16
  //# sourceMappingURL=Main.js.map
package/dist/Main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Main.js","sourceRoot":"","sources":["../src/Main.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,gBAAgB,MAAM,gBAAgB,CAAC;AAC9C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C,OAAO,YAAY,CAAC;AAEpB,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,CACjB,KAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,YAC9B,KAAC,gBAAgB,cACf,KAAC,QAAQ,cACP,KAAC,SAAS,KAAG,GACJ,GACM,GACA,CACtB,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { CurrentAppProvider, PageWrap } from '@openedx/frontend-base';\n\nimport { appId } from './constants';\nimport ContextProviders from './data/context';\nimport Dashboard from './containers/Dashboard';\n\nimport './app.scss';\n\nconst Main = () => (\n <CurrentAppProvider appId={appId}>\n <ContextProviders>\n <PageWrap>\n <Dashboard />\n </PageWrap>\n </ContextProviders>\n </CurrentAppProvider>\n);\n\nexport default Main;\n"]}
1
+ {"version":3,"file":"Main.js","sourceRoot":"","sources":["../src/Main.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,gBAAgB,MAAM,gBAAgB,CAAC;AAC9C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,cAAc,CAAC;AAEtB,MAAM,IAAI,GAAG,GAAG,EAAE;IAChB,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,OAAO,CACL,MAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,aAC9B,KAAC,MAAM,cACL,0BACG,aAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAAE;wBAClD,QAAQ,EAAE,aAAa,EAAE,CAAC,QAAQ;qBACnC,CAAC,GACI,GACD,EACT,KAAC,gBAAgB,cACf,KAAC,QAAQ,cACP,KAAC,SAAS,KAAG,GACJ,GACM,IACA,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { CurrentAppProvider, getSiteConfig, PageWrap, useIntl } from '@openedx/frontend-base';\nimport { Helmet } from 'react-helmet';\n\nimport { appId } from './constants';\nimport ContextProviders from './data/context';\nimport Dashboard from './containers/Dashboard';\nimport messages from './messages';\n\nimport './style.scss';\n\nconst Main = () => {\n const { formatMessage } = useIntl();\n return (\n <CurrentAppProvider appId={appId}>\n <Helmet>\n <title>\n {formatMessage(messages['learner-dash.page.title'], {\n siteName: getSiteConfig().siteName,\n })}\n </title>\n </Helmet>\n <ContextProviders>\n <PageWrap>\n <Dashboard />\n </PageWrap>\n </ContextProviders>\n </CurrentAppProvider>\n );\n};\n\nexport default Main;\n"]}
package/dist/app.js CHANGED
@@ -12,7 +12,6 @@ const app = {
12
12
  ENABLE_PROGRAMS: false,
13
13
  ECOMMERCE_BASE_URL: '',
14
14
  ORDER_HISTORY_URL: '',
15
- SUPPORT_URL: '',
16
15
  SHOW_UNENROLL_SURVEY: false,
17
16
  }
18
17
  };
package/dist/app.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,MAAM,GAAG,GAAQ;IACf,KAAK;IACL,MAAM;IACN,SAAS;IACT,KAAK;IACL,MAAM,EAAE;QACN,iBAAiB,EAAE,mCAAmC;QACtD,eAAe,EAAE,KAAK;QACtB,kBAAkB,EAAE,EAAE;QACtB,iBAAiB,EAAE,EAAE;QACrB,WAAW,EAAE,EAAE;QACf,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { App } from '@openedx/frontend-base';\nimport { appId } from './constants';\nimport routes from './routes';\nimport providers from './providers';\nimport slots from './slots';\n\nconst app: App = {\n appId,\n routes,\n providers,\n slots,\n config: {\n LEARNING_BASE_URL: 'http://apps.local.openedx.io:2000',\n ENABLE_PROGRAMS: false,\n ECOMMERCE_BASE_URL: '',\n ORDER_HISTORY_URL: '',\n SUPPORT_URL: '',\n SHOW_UNENROLL_SURVEY: false,\n }\n};\n\nexport default app;\n"]}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,MAAM,GAAG,GAAQ;IACf,KAAK;IACL,MAAM;IACN,SAAS;IACT,KAAK;IACL,MAAM,EAAE;QACN,iBAAiB,EAAE,mCAAmC;QACtD,eAAe,EAAE,KAAK;QACtB,kBAAkB,EAAE,EAAE;QACtB,iBAAiB,EAAE,EAAE;QACrB,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { App } from '@openedx/frontend-base';\nimport { appId } from './constants';\nimport routes from './routes';\nimport providers from './providers';\nimport slots from './slots';\n\nconst app: App = {\n appId,\n routes,\n providers,\n slots,\n config: {\n LEARNING_BASE_URL: 'http://apps.local.openedx.io:2000',\n ENABLE_PROGRAMS: false,\n ECOMMERCE_BASE_URL: '',\n ORDER_HISTORY_URL: '',\n SHOW_UNENROLL_SURVEY: false,\n }\n};\n\nexport default app;\n"]}
@@ -1 +1,2 @@
1
1
  export declare const appId = "org.openedx.frontend.app.learnerDashboard";
2
+ export declare const dashboardRole = "org.openedx.frontend.role.dashboard";
package/dist/constants.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export const appId = 'org.openedx.frontend.app.learnerDashboard';
2
+ export const dashboardRole = 'org.openedx.frontend.role.dashboard';
2
3
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,2CAA2C,CAAC","sourcesContent":["export const appId = 'org.openedx.frontend.app.learnerDashboard';\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,2CAA2C,CAAC;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,qCAAqC,CAAC","sourcesContent":["export const appId = 'org.openedx.frontend.app.learnerDashboard';\nexport const dashboardRole = 'org.openedx.frontend.role.dashboard';\n"]}
@@ -22,7 +22,7 @@ export const BeginCourseButton = ({ cardId }) => {
22
22
  }, [courseData.enrollment.mode, learnerData.enterpriseDashboard]);
23
23
  const { disableBeginCourse } = useActionDisabledState(cardId);
24
24
  const handleClick = useCourseTrackingEvent(track.course.enterCourseClicked, cardId, homeUrl + execEdTrackingParam);
25
- return (_jsx(ActionButton, { disabled: disableBeginCourse, as: "a", href: "#", onClick: handleClick, children: formatMessage(messages.beginCourse) }));
25
+ return (_jsx(ActionButton, { disabled: disableBeginCourse, as: "a", href: homeUrl + execEdTrackingParam, onClick: handleClick, children: formatMessage(messages.beginCourse) }));
26
26
  };
27
27
  BeginCourseButton.propTypes = {
28
28
  cardId: PropTypes.string.isRequired,
@@ -1 +1 @@
1
- {"version":3,"file":"BeginCourseButton.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardActions/BeginCourseButton.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAE9E,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,sBAAsB,MAAM,UAAU,CAAC;AAC9C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;;IAC9C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,wBAAwB,EAAE,CAAC;IACzD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,0CAAE,OAAO,CAAC;IAC/C,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE;QACvC,MAAM,gBAAgB,GAAG,gCAAgC,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC/F,MAAM,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,mBAAmB,IAAI,EAAE,CAAC;QAC5D,OAAO,gBAAgB,CAAC,CAAC,CAAC,WAAW,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACxD,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAClE,MAAM,EAAE,kBAAkB,EAAE,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAE9D,MAAM,WAAW,GAAG,sBAAsB,CACxC,KAAK,CAAC,MAAM,CAAC,kBAAkB,EAC/B,MAAM,EACN,OAAO,GAAG,mBAAmB,CAC9B,CAAC;IACF,OAAO,CACL,KAAC,YAAY,IACX,QAAQ,EAAE,kBAAkB,EAC5B,EAAE,EAAC,GAAG,EACN,IAAI,EAAC,GAAG,EACR,OAAO,EAAE,WAAW,YAEnB,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,GACvB,CAChB,CAAC;AACJ,CAAC,CAAC;AACF,iBAAiB,CAAC,SAAS,GAAG;IAC5B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACpC,CAAC;AACF,eAAe,iBAAiB,CAAC","sourcesContent":["import React, { useMemo } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { useIntl } from '@openedx/frontend-base';\nimport { EXECUTIVE_EDUCATION_COURSE_MODES } from '@src/data/constants/course';\n\nimport track from '@src/tracking';\nimport { useCourseData, useCourseTrackingEvent } from '@src/hooks';\nimport { useInitializeLearnerHome } from '@src/data/hooks';\nimport useActionDisabledState from '../hooks';\nimport ActionButton from './ActionButton';\nimport messages from './messages';\n\nexport const BeginCourseButton = ({ cardId }) => {\n const { formatMessage } = useIntl();\n const { data: learnerData } = useInitializeLearnerHome();\n const courseData = useCourseData(cardId);\n const homeUrl = courseData?.courseRun?.homeUrl;\n const execEdTrackingParam = useMemo(() => {\n const isExecEd2UCourse = EXECUTIVE_EDUCATION_COURSE_MODES.includes(courseData.enrollment.mode);\n const { authOrgId } = learnerData.enterpriseDashboard || {};\n return isExecEd2UCourse ? `?org_id=${authOrgId}` : '';\n }, [courseData.enrollment.mode, learnerData.enterpriseDashboard]);\n const { disableBeginCourse } = useActionDisabledState(cardId);\n\n const handleClick = useCourseTrackingEvent(\n track.course.enterCourseClicked,\n cardId,\n homeUrl + execEdTrackingParam,\n );\n return (\n <ActionButton\n disabled={disableBeginCourse}\n as=\"a\"\n href=\"#\"\n onClick={handleClick}\n >\n {formatMessage(messages.beginCourse)}\n </ActionButton>\n );\n};\nBeginCourseButton.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\nexport default BeginCourseButton;\n"]}
1
+ {"version":3,"file":"BeginCourseButton.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardActions/BeginCourseButton.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAE9E,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,sBAAsB,MAAM,UAAU,CAAC;AAC9C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;;IAC9C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,wBAAwB,EAAE,CAAC;IACzD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,0CAAE,OAAO,CAAC;IAC/C,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE;QACvC,MAAM,gBAAgB,GAAG,gCAAgC,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC/F,MAAM,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,mBAAmB,IAAI,EAAE,CAAC;QAC5D,OAAO,gBAAgB,CAAC,CAAC,CAAC,WAAW,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACxD,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAClE,MAAM,EAAE,kBAAkB,EAAE,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAE9D,MAAM,WAAW,GAAG,sBAAsB,CACxC,KAAK,CAAC,MAAM,CAAC,kBAAkB,EAC/B,MAAM,EACN,OAAO,GAAG,mBAAmB,CAC9B,CAAC;IACF,OAAO,CACL,KAAC,YAAY,IACX,QAAQ,EAAE,kBAAkB,EAC5B,EAAE,EAAC,GAAG,EACN,IAAI,EAAE,OAAO,GAAG,mBAAmB,EACnC,OAAO,EAAE,WAAW,YAEnB,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,GACvB,CAChB,CAAC;AACJ,CAAC,CAAC;AACF,iBAAiB,CAAC,SAAS,GAAG;IAC5B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACpC,CAAC;AACF,eAAe,iBAAiB,CAAC","sourcesContent":["import React, { useMemo } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { useIntl } from '@openedx/frontend-base';\nimport { EXECUTIVE_EDUCATION_COURSE_MODES } from '@src/data/constants/course';\n\nimport track from '@src/tracking';\nimport { useCourseData, useCourseTrackingEvent } from '@src/hooks';\nimport { useInitializeLearnerHome } from '@src/data/hooks';\nimport useActionDisabledState from '../hooks';\nimport ActionButton from './ActionButton';\nimport messages from './messages';\n\nexport const BeginCourseButton = ({ cardId }) => {\n const { formatMessage } = useIntl();\n const { data: learnerData } = useInitializeLearnerHome();\n const courseData = useCourseData(cardId);\n const homeUrl = courseData?.courseRun?.homeUrl;\n const execEdTrackingParam = useMemo(() => {\n const isExecEd2UCourse = EXECUTIVE_EDUCATION_COURSE_MODES.includes(courseData.enrollment.mode);\n const { authOrgId } = learnerData.enterpriseDashboard || {};\n return isExecEd2UCourse ? `?org_id=${authOrgId}` : '';\n }, [courseData.enrollment.mode, learnerData.enterpriseDashboard]);\n const { disableBeginCourse } = useActionDisabledState(cardId);\n\n const handleClick = useCourseTrackingEvent(\n track.course.enterCourseClicked,\n cardId,\n homeUrl + execEdTrackingParam,\n );\n return (\n <ActionButton\n disabled={disableBeginCourse}\n as=\"a\"\n href={homeUrl + execEdTrackingParam}\n onClick={handleClick}\n >\n {formatMessage(messages.beginCourse)}\n </ActionButton>\n );\n};\nBeginCourseButton.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\nexport default BeginCourseButton;\n"]}
@@ -6,6 +6,7 @@ import { EXECUTIVE_EDUCATION_COURSE_MODES } from '../../../../data/constants/cou
6
6
  import track from '../../../../tracking';
7
7
  import { useCourseTrackingEvent, useCourseData } from '../../../../hooks';
8
8
  import { useInitializeLearnerHome } from '../../../../data/hooks';
9
+ import { baseAppUrl } from '../../../../data/services/lms/urls';
9
10
  import useActionDisabledState from '../hooks';
10
11
  import ActionButton from './ActionButton';
11
12
  import messages from './messages';
@@ -14,7 +15,7 @@ export const ResumeButton = ({ cardId }) => {
14
15
  const { formatMessage } = useIntl();
15
16
  const { data: learnerData } = useInitializeLearnerHome();
16
17
  const courseData = useCourseData(cardId);
17
- const resumeUrl = (_a = courseData === null || courseData === void 0 ? void 0 : courseData.courseRun) === null || _a === void 0 ? void 0 : _a.resumeUrl;
18
+ const resumeUrl = baseAppUrl((_a = courseData === null || courseData === void 0 ? void 0 : courseData.courseRun) === null || _a === void 0 ? void 0 : _a.resumeUrl);
18
19
  const execEdTrackingParam = useMemo(() => {
19
20
  const isExecEd2UCourse = EXECUTIVE_EDUCATION_COURSE_MODES.includes(courseData.enrollment.mode);
20
21
  const { authOrgId } = learnerData.enterpriseDashboard || {};
@@ -22,7 +23,7 @@ export const ResumeButton = ({ cardId }) => {
22
23
  }, [courseData.enrollment.mode, learnerData.enterpriseDashboard]);
23
24
  const { disableResumeCourse } = useActionDisabledState(cardId);
24
25
  const handleClick = useCourseTrackingEvent(track.course.enterCourseClicked, cardId, resumeUrl + execEdTrackingParam);
25
- return (_jsx(ActionButton, { disabled: disableResumeCourse, as: "a", href: "#", onClick: handleClick, children: formatMessage(messages.resume) }));
26
+ return (_jsx(ActionButton, { disabled: disableResumeCourse, as: "a", href: resumeUrl + execEdTrackingParam, onClick: handleClick, children: formatMessage(messages.resume) }));
26
27
  };
27
28
  ResumeButton.propTypes = {
28
29
  cardId: PropTypes.string.isRequired,
@@ -1 +1 @@
1
- {"version":3,"file":"ResumeButton.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardActions/ResumeButton.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,sBAAsB,MAAM,UAAU,CAAC;AAC9C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;;IACzC,MAAM,EAAE,aAAa,E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x/frontend-base';\n\nimport { EXECUTIVE_EDUCATION_COURSE_MODES } from '@src/data/constants/course';\nimport track from '@src/tracking';\nimport { useCourseTrackingEvent, useCourseData } from '@src/hooks';\nimport { useInitializeLearnerHome } from '@src/data/hooks';\nimport useActionDisabledState from '../hooks';\nimport ActionButton from './ActionButton';\nimport messages from './messages';\n\nexport const ResumeButton = ({ cardId }) => {\n const { formatMessage } = useIntl();\n const { data: learnerData } = useInitializeLearnerHome();\n const courseData = useCourseData(cardId);\n const resumeUrl = courseData?.courseRun?.resumeUrl;\n const execEdTrackingParam = useMemo(() => {\n const isExecEd2UCourse = EXECUTIVE_EDUCATION_COURSE_MODES.includes(courseData.enrollment.mode);\n const { authOrgId } = learnerData.enterpriseDashboard || {};\n return isExecEd2UCourse ? `?org_id=${authOrgId}` : '';\n }, [courseData.enrollment.mode, learnerData.enterpriseDashboard]);\n const { disableResumeCourse } = useActionDisabledState(cardId);\n\n const handleClick = useCourseTrackingEvent(\n track.course.enterCourseClicked,\n cardId,\n resumeUrl + execEdTrackingParam,\n );\n return (\n <ActionButton\n disabled={disableResumeCourse}\n as=\"a\"\n href=\"#\"\n onClick={handleClick}\n >\n {formatMessage(messages.resume)}\n </ActionButton>\n );\n};\nResumeButton.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\nexport default ResumeButton;\n"]}
1
+ {"version":3,"file":"ResumeButton.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardActions/ResumeButton.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC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AAmB,EAC7B,EAAE,EAAC,GAAG,EACN,IAAI,EAAE,SAAS,GAAG,mBAAmB,EACrC,OAAO,EAAE,WAAW,YAEnB,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,GAClB,CAChB,CAAC;AACJ,CAAC,CAAC;AACF,YAAY,CAAC,SAAS,GAAG;IACvB,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACpC,CAAC;AACF,eAAe,YAAY,CAAC","sourcesContent":["import React, { useMemo } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { EXECUTIVE_EDUCATION_COURSE_MODES } from '@src/data/constants/course';\nimport track from '@src/tracking';\nimport { useCourseTrackingEvent, useCourseData } from '@src/hooks';\nimport { useInitializeLearnerHome } from '@src/data/hooks';\nimport { baseAppUrl } from '@src/data/services/lms/urls';\nimport useActionDisabledState from '../hooks';\nimport ActionButton from './ActionButton';\nimport messages from './messages';\n\nexport const ResumeButton = ({ cardId }) => {\n const { formatMessage } = useIntl();\n const { data: learnerData } = useInitializeLearnerHome();\n const courseData = useCourseData(cardId);\n const resumeUrl = baseAppUrl(courseData?.courseRun?.resumeUrl);\n const execEdTrackingParam = useMemo(() => {\n const isExecEd2UCourse = EXECUTIVE_EDUCATION_COURSE_MODES.includes(courseData.enrollment.mode);\n const { authOrgId } = learnerData.enterpriseDashboard || {};\n return isExecEd2UCourse ? `?org_id=${authOrgId}` : '';\n }, [courseData.enrollment.mode, learnerData.enterpriseDashboard]);\n const { disableResumeCourse } = useActionDisabledState(cardId);\n\n const handleClick = useCourseTrackingEvent(\n track.course.enterCourseClicked,\n cardId,\n resumeUrl + execEdTrackingParam,\n );\n return (\n <ActionButton\n disabled={disableResumeCourse}\n as=\"a\"\n href={resumeUrl + execEdTrackingParam}\n onClick={handleClick}\n >\n {formatMessage(messages.resume)}\n </ActionButton>\n );\n};\nResumeButton.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\nexport default ResumeButton;\n"]}
@@ -14,7 +14,7 @@ export const ViewCourseButton = ({ cardId }) => {
14
14
  const homeUrl = (_a = courseData === null || courseData === void 0 ? void 0 : courseData.courseRun) === null || _a === void 0 ? void 0 : _a.homeUrl;
15
15
  const { disableViewCourse } = useActionDisabledState(cardId);
16
16
  const handleClick = useCourseTrackingEvent(track.course.enterCourseClicked, cardId, homeUrl);
17
- return (_jsx(ActionButton, { disabled: disableViewCourse, as: "a", href: "#", onClick: handleClick, children: formatMessage(messages.viewCourse) }));
17
+ return (_jsx(ActionButton, { disabled: disableViewCourse, as: "a", href: homeUrl, onClick: handleClick, children: formatMessage(messages.viewCourse) }));
18
18
  };
19
19
  ViewCourseButton.propTypes = {
20
20
  cardId: PropTypes.string.isRequired,
@@ -1 +1 @@
1
- {"version":3,"file":"ViewCourseButton.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardActions/ViewCourseButton.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,sBAAsB,MAAM,UAAU,CAAC;AAC9C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;;IAC7C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,0CAAE,OAAO,CAAC;IAC/C,MAAM,EAAE,iBAAiB,EAAE,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAE7D,MAAM,WAAW,GAAG,sBAAsB,CACxC,KAAK,CAAC,MAAM,CAAC,kBAAkB,EAC/B,MAAM,EACN,OAAO,CACR,CAAC;IACF,OAAO,CACL,KAAC,YAAY,IACX,QAAQ,EAAE,iBAAiB,EAC3B,EAAE,EAAC,GAAG,EACN,IAAI,EAAC,GAAG,EACR,OAAO,EAAE,WAAW,YAEnB,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,GACtB,CAChB,CAAC;AACJ,CAAC,CAAC;AACF,gBAAgB,CAAC,SAAS,GAAG;IAC3B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACpC,CAAC;AACF,eAAe,gBAAgB,CAAC","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { useIntl } from '@openedx/frontend-base';\n\nimport track from '@src/tracking';\nimport { useCourseTrackingEvent, useCourseData } from '@src/hooks';\nimport useActionDisabledState from '../hooks';\nimport ActionButton from './ActionButton';\nimport messages from './messages';\n\nexport const ViewCourseButton = ({ cardId }) => {\n const { formatMessage } = useIntl();\n const courseData = useCourseData(cardId);\n const homeUrl = courseData?.courseRun?.homeUrl;\n const { disableViewCourse } = useActionDisabledState(cardId);\n\n const handleClick = useCourseTrackingEvent(\n track.course.enterCourseClicked,\n cardId,\n homeUrl,\n );\n return (\n <ActionButton\n disabled={disableViewCourse}\n as=\"a\"\n href=\"#\"\n onClick={handleClick}\n >\n {formatMessage(messages.viewCourse)}\n </ActionButton>\n );\n};\nViewCourseButton.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\nexport default ViewCourseButton;\n"]}
1
+ {"version":3,"file":"ViewCourseButton.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardActions/ViewCourseButton.jsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,sBAAsB,MAAM,UAAU,CAAC;AAC9C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;;IAC7C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,0CAAE,OAAO,CAAC;IAC/C,MAAM,EAAE,iBAAiB,EAAE,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAE7D,MAAM,WAAW,GAAG,sBAAsB,CACxC,KAAK,CAAC,MAAM,CAAC,kBAAkB,EAC/B,MAAM,EACN,OAAO,CACR,CAAC;IACF,OAAO,CACL,KAAC,YAAY,IACX,QAAQ,EAAE,iBAAiB,EAC3B,EAAE,EAAC,GAAG,EACN,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,WAAW,YAEnB,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,GACtB,CAChB,CAAC;AACJ,CAAC,CAAC;AACF,gBAAgB,CAAC,SAAS,GAAG;IAC3B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACpC,CAAC;AACF,eAAe,gBAAgB,CAAC","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { useIntl } from '@openedx/frontend-base';\n\nimport track from '@src/tracking';\nimport { useCourseTrackingEvent, useCourseData } from '@src/hooks';\nimport useActionDisabledState from '../hooks';\nimport ActionButton from './ActionButton';\nimport messages from './messages';\n\nexport const ViewCourseButton = ({ cardId }) => {\n const { formatMessage } = useIntl();\n const courseData = useCourseData(cardId);\n const homeUrl = courseData?.courseRun?.homeUrl;\n const { disableViewCourse } = useActionDisabledState(cardId);\n\n const handleClick = useCourseTrackingEvent(\n track.course.enterCourseClicked,\n cardId,\n homeUrl,\n );\n return (\n <ActionButton\n disabled={disableViewCourse}\n as=\"a\"\n href={homeUrl}\n onClick={handleClick}\n >\n {formatMessage(messages.viewCourse)}\n </ActionButton>\n );\n};\nViewCourseButton.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\nexport default ViewCourseButton;\n"]}
@@ -40,7 +40,7 @@ export const CertificateBanner = ({ cardId }) => {
40
40
  return (_jsxs(Banner, { variant: "danger", children: [supportEmail ? formatMessage(messages.certRestricted, { supportEmail: emailLink(supportEmail) }) : formatMessage(messages.certRestrictedNoEmail), isVerified && ' ', isVerified && (billingEmail ? formatMessage(messages.certRefundContactBilling, { billingEmail: emailLink(billingEmail) }) : formatMessage(messages.certRefundContactBillingNoEmail))] }));
41
41
  }
42
42
  if (certificate.isDownloadable) {
43
- return (_jsxs(Banner, { variant: "success", icon: CheckCircle, children: [formatMessage(messages.certReady), certificate.certPreviewUrl && (_jsxs(_Fragment, { children: [' ', _jsx(Hyperlink, { isInline: true, destination: certificate.certPreviewUrl, children: formatMessage(messages.viewCertificate) })] }))] }));
43
+ return (_jsxs(Banner, { variant: "success", icon: CheckCircle, children: [formatMessage(messages.certReady), certificate.certPreviewUrl && (_jsxs(_Fragment, { children: [' ', _jsx(Hyperlink, { isInline: true, destination: baseAppUrl(certificate.certPreviewUrl), children: formatMessage(messages.viewCertificate) })] }))] }));
44
44
  }
45
45
  if (!isPassing) {
46
46
  if (isAudit) {
@@ -1 +1 @@
1
- {"version":3,"file":"CertificateBanner.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/components/CourseCardBanners/CertificateBanner.jsx"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MA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CACV,CAAC;IACJ,CAAC;IACD,IAAI,WAAW,CAAC,QAAQ,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,GAAG,IAAI,IAAI,EAAE,EAAE,CAAC;QAC7E,OAAO,CACL,KAAC,MAAM,cACJ,aAAa,CACZ,QAAQ,CAAC,sBAAsB,EAC/B,EAAE,aAAa,EAAE,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CACzD,GACM,CACV,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AACF,iBAAiB,CAAC,SAAS,GAAG;IAC5B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACpC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["/* eslint-disable max-len */\nimport React, { useMemo } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { MailtoLink, Hyperlink } from '@openedx/paragon';\nimport { CheckCircle } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { baseAppUrl } from '@src/data/services/lms/urls';\n\nimport { useInitializeLearnerHome } from '@src/data/hooks';\nimport { utilHooks, useCourseData } from '@src/hooks';\nimport Banner from '@src/components/Banner';\n\nimport messages from './messages';\n\nconst { useFormatDate } = utilHooks;\n\nexport const CertificateBanner = ({ cardId }) => {\n const { data: learnerHomeData } = useInitializeLearnerHome();\n const courseData = useCourseData(cardId);\n const {\n certificate = {},\n isVerified = false,\n isAudit = false,\n isPassing = false,\n isArchived = false,\n minPassingGrade = 0,\n progressUrl = '',\n } = useMemo(() => ({\n isVerified: courseData?.enrollment?.isVerified,\n isAudit: courseData?.enrollment?.isAudit,\n certificate: courseData?.certificate || {},\n isPassing: courseData?.gradeData?.isPassing,\n isArchived: courseData?.courseRun?.isArchived,\n minPassingGrade: Math.floor((courseData?.courseRun?.minPassingGrade ?? 0) * 100),\n progressUrl: baseAppUrl(courseData?.courseRun?.progressUrl || ''),\n }), [courseData]);\n const { supportEmail, billingEmail } = useMemo(\n () => ({\n supportEmail: learnerHomeData?.platformSettings?.supportEmail,\n billingEmail: learnerHomeData?.platformSettings?.billingEmail,\n }),\n [learnerHomeData],\n );\n const { formatMessage } = useIntl();\n const formatDate = useFormatDate();\n\n const emailLink = address => <MailtoLink to={address}>{address}</MailtoLink>;\n\n if (certificate.isRestricted) {\n return (\n <Banner variant=\"danger\">\n { supportEmail ? formatMessage(messages.certRestricted, { supportEmail: emailLink(supportEmail) }) : formatMessage(messages.certRestrictedNoEmail)}\n {isVerified && ' '}\n {isVerified && (billingEmail ? formatMessage(messages.certRefundContactBilling, { billingEmail: emailLink(billingEmail) }) : formatMessage(messages.certRefundContactBillingNoEmail))}\n </Banner>\n );\n }\n if (certificate.isDownloadable) {\n return (\n <Banner variant=\"success\" icon={CheckCircle}>\n {formatMessage(messages.certReady)}\n {certificate.certPreviewUrl && (\n <>\n {' '}\n <Hyperlink isInline destination={certificate.certPreviewUrl}>\n {formatMessage(messages.viewCertificate)}\n </Hyperlink>\n </>\n )}\n </Banner>\n );\n }\n if (!isPassing) {\n if (isAudit) {\n return (\n <Banner>\n {formatMessage(messages.passingGrade, { minPassingGrade })}\n </Banner>\n );\n }\n if (isArchived) {\n return (\n <Banner variant=\"warning\">\n {formatMessage(messages.notEligibleForCert)}\n {' '}\n <Hyperlink isInline destination={progressUrl}>{formatMessage(messages.viewGrades)}</Hyperlink>\n </Banner>\n );\n }\n return (\n <Banner variant=\"warning\">\n {formatMessage(messages.certMinGrade, { minPassingGrade })}\n </Banner>\n );\n }\n if (certificate.isEarned && new Date(certificate.availableDate) > new Date()) {\n return (\n <Banner>\n {formatMessage(\n messages.gradeAndCertReadyAfter,\n { availableDate: formatDate(certificate.availableDate) },\n )}\n </Banner>\n );\n }\n\n return null;\n};\nCertificateBanner.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\n\nexport default CertificateBanner;\n"]}
1
+ {"version":3,"file":"CertificateBanner.js","sourceRoot":"","sources":["../../../../../src/containers/CourseCard/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OAAO,CACL,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,YACtB,aAAa,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,eAAe,EAAE,CAAC,GACnD,CACV,CAAC;IACJ,CAAC;IACD,IAAI,WAAW,CAAC,QAAQ,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,GAAG,IAAI,IAAI,EAAE,EAAE,CAAC;QAC7E,OAAO,CACL,KAAC,MAAM,cACJ,aAAa,CACZ,QAAQ,CAAC,sBAAsB,EAC/B,EAAE,aAAa,EAAE,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CACzD,GACM,CACV,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AACF,iBAAiB,CAAC,SAAS,GAAG;IAC5B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACpC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["/* eslint-disable max-len */\nimport React, { useMemo } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { MailtoLink, Hyperlink } from '@openedx/paragon';\nimport { CheckCircle } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { baseAppUrl } from '@src/data/services/lms/urls';\n\nimport { useInitializeLearnerHome } from '@src/data/hooks';\nimport { utilHooks, useCourseData } from '@src/hooks';\nimport Banner from '@src/components/Banner';\n\nimport messages from './messages';\n\nconst { useFormatDate } = utilHooks;\n\nexport const CertificateBanner = ({ cardId }) => {\n const { data: learnerHomeData } = useInitializeLearnerHome();\n const courseData = useCourseData(cardId);\n const {\n certificate = {},\n isVerified = false,\n isAudit = false,\n isPassing = false,\n isArchived = false,\n minPassingGrade = 0,\n progressUrl = '',\n } = useMemo(() => ({\n isVerified: courseData?.enrollment?.isVerified,\n isAudit: courseData?.enrollment?.isAudit,\n certificate: courseData?.certificate || {},\n isPassing: courseData?.gradeData?.isPassing,\n isArchived: courseData?.courseRun?.isArchived,\n minPassingGrade: Math.floor((courseData?.courseRun?.minPassingGrade ?? 0) * 100),\n progressUrl: baseAppUrl(courseData?.courseRun?.progressUrl || ''),\n }), [courseData]);\n const { supportEmail, billingEmail } = useMemo(\n () => ({\n supportEmail: learnerHomeData?.platformSettings?.supportEmail,\n billingEmail: learnerHomeData?.platformSettings?.billingEmail,\n }),\n [learnerHomeData],\n );\n const { formatMessage } = useIntl();\n const formatDate = useFormatDate();\n\n const emailLink = address => <MailtoLink to={address}>{address}</MailtoLink>;\n\n if (certificate.isRestricted) {\n return (\n <Banner variant=\"danger\">\n { supportEmail ? formatMessage(messages.certRestricted, { supportEmail: emailLink(supportEmail) }) : formatMessage(messages.certRestrictedNoEmail)}\n {isVerified && ' '}\n {isVerified && (billingEmail ? formatMessage(messages.certRefundContactBilling, { billingEmail: emailLink(billingEmail) }) : formatMessage(messages.certRefundContactBillingNoEmail))}\n </Banner>\n );\n }\n if (certificate.isDownloadable) {\n return (\n <Banner variant=\"success\" icon={CheckCircle}>\n {formatMessage(messages.certReady)}\n {certificate.certPreviewUrl && (\n <>\n {' '}\n <Hyperlink isInline destination={baseAppUrl(certificate.certPreviewUrl)}>\n {formatMessage(messages.viewCertificate)}\n </Hyperlink>\n </>\n )}\n </Banner>\n );\n }\n if (!isPassing) {\n if (isAudit) {\n return (\n <Banner>\n {formatMessage(messages.passingGrade, { minPassingGrade })}\n </Banner>\n );\n }\n if (isArchived) {\n return (\n <Banner variant=\"warning\">\n {formatMessage(messages.notEligibleForCert)}\n {' '}\n <Hyperlink isInline destination={progressUrl}>{formatMessage(messages.viewGrades)}</Hyperlink>\n </Banner>\n );\n }\n return (\n <Banner variant=\"warning\">\n {formatMessage(messages.certMinGrade, { minPassingGrade })}\n </Banner>\n );\n }\n if (certificate.isEarned && new Date(certificate.availableDate) > new Date()) {\n return (\n <Banner>\n {formatMessage(\n messages.gradeAndCertReadyAfter,\n { availableDate: formatDate(certificate.availableDate) },\n )}\n </Banner>\n );\n }\n\n return null;\n};\nCertificateBanner.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\n\nexport default CertificateBanner;\n"]}
@@ -1,3 +1,5 @@
1
+ @use "@openedx/paragon/styles/css/core/custom-media-breakpoints.css";
2
+
1
3
  .course-list-heading-container {
2
4
  display: flex;
3
5
  flex-direction: row;
@@ -1,3 +1,5 @@
1
+ @use "@openedx/paragon/styles/css/core/custom-media-breakpoints.css";
2
+
1
3
  .course-list-column {
2
4
  padding: 0 var(--pgn-spacing-spacer-4);
3
5
  }
@@ -10,4 +10,9 @@ declare const messages: {
10
10
  description: string;
11
11
  defaultMessage: string;
12
12
  };
13
+ 'learner-dash.page.title': {
14
+ id: string;
15
+ description: string;
16
+ defaultMessage: string;
17
+ };
13
18
  };
package/dist/messages.js CHANGED
@@ -10,6 +10,11 @@ const messages = defineMessages({
10
10
  description: 'Page title: Learner Home',
11
11
  defaultMessage: 'Learner Home',
12
12
  },
13
+ 'learner-dash.page.title': {
14
+ id: 'learner-dash.page.title',
15
+ description: 'Document title for the learner dashboard page',
16
+ defaultMessage: 'Learner Home | {siteName}',
17
+ },
13
18
  });
14
19
  export default messages;
15
20
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,wBAAwB,EAAE;QACxB,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EAAE,iCAAiC;QAC9C,cAAc,EAAE,YAAY;KAC7B;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,oBAAoB;QACxB,WAAW,EAAE,0BAA0B;QACvC,cAAc,EAAE,cAAc;KAC/B;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n 'learner-dash.loadingSR': {\n id: 'learner-dash.loadingSR',\n description: 'Page loading screen-reader text',\n defaultMessage: 'Loading...',\n },\n 'learner-dash.title': {\n id: 'learner-dash.title',\n description: 'Page title: Learner Home',\n defaultMessage: 'Learner Home',\n },\n});\n\nexport default messages;\n"]}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,wBAAwB,EAAE;QACxB,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EAAE,iCAAiC;QAC9C,cAAc,EAAE,YAAY;KAC7B;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,oBAAoB;QACxB,WAAW,EAAE,0BAA0B;QACvC,cAAc,EAAE,cAAc;KAC/B;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,yBAAyB;QAC7B,WAAW,EAAE,+CAA+C;QAC5D,cAAc,EAAE,2BAA2B;KAC5C;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n 'learner-dash.loadingSR': {\n id: 'learner-dash.loadingSR',\n description: 'Page loading screen-reader text',\n defaultMessage: 'Loading...',\n },\n 'learner-dash.title': {\n id: 'learner-dash.title',\n description: 'Page title: Learner Home',\n defaultMessage: 'Learner Home',\n },\n 'learner-dash.page.title': {\n id: 'learner-dash.page.title',\n description: 'Document title for the learner dashboard page',\n defaultMessage: 'Learner Home | {siteName}',\n },\n});\n\nexport default messages;\n"]}
package/dist/routes.d.ts CHANGED
@@ -4,7 +4,7 @@ declare const routes: {
4
4
  path: string;
5
5
  loader: typeof authenticatedLoader;
6
6
  handle: {
7
- role: string;
7
+ roles: string[];
8
8
  };
9
9
  lazy(): Promise<{
10
10
  Component: () => import("react/jsx-runtime").JSX.Element;
package/dist/routes.js CHANGED
@@ -7,18 +7,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { authenticatedLoader } from '@openedx/frontend-base';
10
+ import { authenticatedLoader, homeRole } from '@openedx/frontend-base';
11
+ import { dashboardRole } from './constants';
11
12
  const routes = [
12
13
  {
13
14
  id: 'org.openedx.frontend.route.learnerDashboard.main',
14
15
  path: '/learner-dashboard',
15
16
  loader: authenticatedLoader,
16
17
  handle: {
17
- role: 'org.openedx.frontend.role.dashboard'
18
+ roles: [dashboardRole, homeRole]
18
19
  },
19
20
  lazy() {
20
21
  return __awaiter(this, void 0, void 0, function* () {
21
- const module = yield import('./Main');
22
+ const module = yield import(/* webpackChunkName: "learner-dashboard-main" */ './Main');
22
23
  return { Component: module.default };
23
24
  });
24
25
  },
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.jsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,MAAM,GAAG;IACb;QACE,EAAE,EAAE,kDAAkD;QACtD,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE,mBAAmB;QAC3B,MAAM,EAAE;YACN,IAAI,EAAE,qCAAqC;SAC5C;QACK,IAAI;;gBACR,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;gBACtC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;KACF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { authenticatedLoader } from '@openedx/frontend-base';\n\nconst routes = [\n {\n id: 'org.openedx.frontend.route.learnerDashboard.main',\n path: '/learner-dashboard',\n loader: authenticatedLoader,\n handle: {\n role: 'org.openedx.frontend.role.dashboard'\n },\n async lazy () {\n const module = await import('./Main');\n return { Component: module.default };\n },\n }\n];\n\nexport default routes;\n"]}
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.jsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,MAAM,GAAG;IACb;QACE,EAAE,EAAE,kDAAkD;QACtD,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE,mBAAmB;QAC3B,MAAM,EAAE;YACN,KAAK,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC;SACjC;QACK,IAAI;;gBACR,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,gDAAgD,CAAC,QAAQ,CAAC,CAAC;gBACvF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;KACF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { authenticatedLoader, homeRole } from '@openedx/frontend-base';\nimport { dashboardRole } from './constants';\n\nconst routes = [\n {\n id: 'org.openedx.frontend.route.learnerDashboard.main',\n path: '/learner-dashboard',\n loader: authenticatedLoader,\n handle: {\n roles: [dashboardRole, homeRole]\n },\n async lazy () {\n const module = await import(/* webpackChunkName: \"learner-dashboard-main\" */ './Main');\n return { Component: module.default };\n },\n }\n];\n\nexport default routes;\n"]}
@@ -1,5 +1,3 @@
1
- @use "@openedx/frontend-base/shell/app.scss";
2
-
3
1
  $fa-font-path: "~font-awesome/fonts";
4
2
  @import "~font-awesome/scss/font-awesome";
5
3
 
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useContext } from 'react';
3
3
  import { SiteContext } from '@openedx/frontend-base';
4
- import { Chip, Form, FormControl, FormControlFeedback, FormLabel, FormGroup, StatefulButton, Icon, } from '@openedx/paragon';
4
+ import { Chip, Container, Form, FormControl, FormControlFeedback, FormLabel, FormGroup, StatefulButton, Icon, } from '@openedx/paragon';
5
5
  import { Close, PersonSearch } from '@openedx/paragon/icons';
6
6
  import messages from './messages';
7
7
  import { useMasqueradeBarData } from './hooks';
@@ -12,9 +12,9 @@ export const MasqueradeBar = () => {
12
12
  if (!canMasquerade) {
13
13
  return null;
14
14
  }
15
- return (_jsx("div", { className: "w-100 shadow-sm px-2", children: _jsx(Form, { className: "masquerade-bar w-100", children: isMasquerading ? (_jsxs(_Fragment, { children: [_jsxs(FormLabel, { inline: "true", className: "masquerade-form-label", children: [_jsx(Icon, { src: PersonSearch }), formatMessage(messages.ViewingAs)] }), _jsx(Chip, { className: "masquerade-chip", iconAfter: Close, onClick: handleClearMasquerade, children: masqueradeInput })] })) : (_jsxs(_Fragment, { children: [_jsxs(FormLabel, { inline: "true", id: "masquerade-form-label", className: "masquerade-form-label", children: [_jsx(Icon, { src: PersonSearch }), formatMessage(messages.ViewAs)] }), _jsxs(FormGroup, { isInvalid: isMasqueradingFailed, className: "masquerade-form-input", children: [_jsx(FormControl, { value: masqueradeInput, onChange: handleMasqueradeInputChange, floatingLabel: formatMessage(messages.StudentNameInput), "aria-labelledby": "masquerade-form-label" }), isMasqueradingFailed && (_jsx(FormControlFeedback, { type: "invalid", hasIcon: false, children: formatMessage(masqueradeErrorMessage) }))] }), _jsx(StatefulButton, { disabled: !(masqueradeInput === null || masqueradeInput === void 0 ? void 0 : masqueradeInput.length), variant: "brand", onClick: handleMasqueradeSubmit(masqueradeInput), labels: {
16
- default: formatMessage(messages.SubmitButton),
17
- }, className: "mr-3", state: isMasqueradingPending ? 'pending' : 'default', type: "submit" })] })) }) }));
15
+ return (_jsx("div", { className: "w-100 shadow-sm", children: _jsx(Container, { fluid: true, size: "xl", children: _jsx(Form, { className: "masquerade-bar w-100", children: isMasquerading ? (_jsxs(_Fragment, { children: [_jsxs(FormLabel, { inline: "true", className: "masquerade-form-label", children: [_jsx(Icon, { src: PersonSearch }), formatMessage(messages.ViewingAs)] }), _jsx(Chip, { className: "masquerade-chip", iconAfter: Close, onClick: handleClearMasquerade, children: masqueradeInput })] })) : (_jsxs(_Fragment, { children: [_jsxs(FormLabel, { inline: "true", id: "masquerade-form-label", className: "masquerade-form-label", children: [_jsx(Icon, { src: PersonSearch }), formatMessage(messages.ViewAs)] }), _jsxs(FormGroup, { isInvalid: isMasqueradingFailed, className: "masquerade-form-input", children: [_jsx(FormControl, { value: masqueradeInput, onChange: handleMasqueradeInputChange, floatingLabel: formatMessage(messages.StudentNameInput), "aria-labelledby": "masquerade-form-label" }), isMasqueradingFailed && (_jsx(FormControlFeedback, { type: "invalid", hasIcon: false, children: formatMessage(masqueradeErrorMessage) }))] }), _jsx(StatefulButton, { disabled: !(masqueradeInput === null || masqueradeInput === void 0 ? void 0 : masqueradeInput.length), variant: "brand", onClick: handleMasqueradeSubmit(masqueradeInput), labels: {
16
+ default: formatMessage(messages.SubmitButton),
17
+ }, className: "mr-3", state: isMasqueradingPending ? 'pending' : 'default', type: "submit" })] })) }) }) }));
18
18
  };
19
19
  export default MasqueradeBar;
20
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardHeader/MasqueradeBar/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,cAAc,EACd,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EA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,mBAAmB,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,KAAK,YAC/C,aAAa,CAAC,sBAAsB,CAAC,GAClB,CACvB,IACS,EACZ,KAAC,cAAc,IACb,QAAQ,EAAE,CAAC,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,CAAA,EAClC,OAAO,EAAC,OAAO,EACf,OAAO,EAAE,sBAAsB,CAAC,eAAe,CAAC,EAChD,MAAM,EAAE;4BACN,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC;yBAC9C,EACD,SAAS,EAAC,MAAM,EAChB,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACpD,IAAI,EAAC,QAAQ,GACb,IACD,CACJ,GACI,GACH,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { useContext } from 'react';\nimport { SiteContext } from '@openedx/frontend-base';\n\nimport {\n Chip,\n Form,\n FormControl,\n FormControlFeedback,\n FormLabel,\n FormGroup,\n StatefulButton,\n Icon,\n} from '@openedx/paragon';\nimport { Close, PersonSearch } from '@openedx/paragon/icons';\n\nimport messages from './messages';\nimport { useMasqueradeBarData } from './hooks';\nimport './index.scss';\n\nexport const MasqueradeBar = () => {\n const { authenticatedUser } = useContext(SiteContext);\n\n const {\n canMasquerade,\n isMasquerading,\n isMasqueradingFailed,\n isMasqueradingPending,\n masqueradeInput,\n masqueradeErrorMessage,\n handleMasqueradeInputChange,\n handleClearMasquerade,\n handleMasqueradeSubmit,\n formatMessage,\n } = useMasqueradeBarData({ authenticatedUser });\n\n if (!canMasquerade) { return null; }\n\n return (\n <div className=\"w-100 shadow-sm px-2\">\n <Form className=\"masquerade-bar w-100\">\n {isMasquerading ? (\n <>\n <FormLabel inline=\"true\" className=\"masquerade-form-label\">\n <Icon src={PersonSearch} />\n {formatMessage(messages.ViewingAs)}\n </FormLabel>\n <Chip\n className=\"masquerade-chip\"\n iconAfter={Close}\n onClick={handleClearMasquerade}\n >\n {masqueradeInput}\n </Chip>\n </>\n ) : (\n <>\n <FormLabel inline=\"true\" id=\"masquerade-form-label\" className=\"masquerade-form-label\">\n <Icon src={PersonSearch} />\n {formatMessage(messages.ViewAs)}\n </FormLabel>\n <FormGroup isInvalid={isMasqueradingFailed} className=\"masquerade-form-input\">\n <FormControl\n value={masqueradeInput}\n onChange={handleMasqueradeInputChange}\n floatingLabel={formatMessage(messages.StudentNameInput)}\n aria-labelledby=\"masquerade-form-label\"\n />\n {isMasqueradingFailed && (\n <FormControlFeedback type=\"invalid\" hasIcon={false}>\n {formatMessage(masqueradeErrorMessage)}\n </FormControlFeedback>\n )}\n </FormGroup>\n <StatefulButton\n disabled={!masqueradeInput?.length}\n variant=\"brand\"\n onClick={handleMasqueradeSubmit(masqueradeInput)}\n labels={{\n default: formatMessage(messages.SubmitButton),\n }}\n className=\"mr-3\"\n state={isMasqueradingPending ? 'pending' : 'default'}\n type=\"submit\"\n />\n </>\n )}\n </Form>\n </div>\n );\n};\n\nexport default MasqueradeBar;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/LearnerDashboardHeader/MasqueradeBar/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EACL,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,WAAW,EACX,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,cAAc,EACd,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,MAAM,aAAa,G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C,gBAAgB,CAAC,qBACvC,uBAAuB,GACvC,EACD,oBAAoB,IAAI,CACvB,KAAC,mBAAmB,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,KAAK,YAC/C,aAAa,CAAC,sBAAsB,CAAC,GAClB,CACvB,IACS,EACZ,KAAC,cAAc,IACb,QAAQ,EAAE,CAAC,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,CAAA,EAClC,OAAO,EAAC,OAAO,EACf,OAAO,EAAE,sBAAsB,CAAC,eAAe,CAAC,EAChD,MAAM,EAAE;gCACN,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC;6BAC9C,EACD,SAAS,EAAC,MAAM,EAChB,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACpD,IAAI,EAAC,QAAQ,GACb,IACD,CACJ,GACI,GACK,GACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { useContext } from 'react';\nimport { SiteContext } from '@openedx/frontend-base';\n\nimport {\n Chip,\n Container,\n Form,\n FormControl,\n FormControlFeedback,\n FormLabel,\n FormGroup,\n StatefulButton,\n Icon,\n} from '@openedx/paragon';\nimport { Close, PersonSearch } from '@openedx/paragon/icons';\n\nimport messages from './messages';\nimport { useMasqueradeBarData } from './hooks';\nimport './index.scss';\n\nexport const MasqueradeBar = () => {\n const { authenticatedUser } = useContext(SiteContext);\n\n const {\n canMasquerade,\n isMasquerading,\n isMasqueradingFailed,\n isMasqueradingPending,\n masqueradeInput,\n masqueradeErrorMessage,\n handleMasqueradeInputChange,\n handleClearMasquerade,\n handleMasqueradeSubmit,\n formatMessage,\n } = useMasqueradeBarData({ authenticatedUser });\n\n if (!canMasquerade) { return null; }\n\n return (\n <div className=\"w-100 shadow-sm\">\n <Container fluid size=\"xl\">\n <Form className=\"masquerade-bar w-100\">\n {isMasquerading ? (\n <>\n <FormLabel inline=\"true\" className=\"masquerade-form-label\">\n <Icon src={PersonSearch} />\n {formatMessage(messages.ViewingAs)}\n </FormLabel>\n <Chip\n className=\"masquerade-chip\"\n iconAfter={Close}\n onClick={handleClearMasquerade}\n >\n {masqueradeInput}\n </Chip>\n </>\n ) : (\n <>\n <FormLabel inline=\"true\" id=\"masquerade-form-label\" className=\"masquerade-form-label\">\n <Icon src={PersonSearch} />\n {formatMessage(messages.ViewAs)}\n </FormLabel>\n <FormGroup isInvalid={isMasqueradingFailed} className=\"masquerade-form-input\">\n <FormControl\n value={masqueradeInput}\n onChange={handleMasqueradeInputChange}\n floatingLabel={formatMessage(messages.StudentNameInput)}\n aria-labelledby=\"masquerade-form-label\"\n />\n {isMasqueradingFailed && (\n <FormControlFeedback type=\"invalid\" hasIcon={false}>\n {formatMessage(masqueradeErrorMessage)}\n </FormControlFeedback>\n )}\n </FormGroup>\n <StatefulButton\n disabled={!masqueradeInput?.length}\n variant=\"brand\"\n onClick={handleMasqueradeSubmit(masqueradeInput)}\n labels={{\n default: formatMessage(messages.SubmitButton),\n }}\n className=\"mr-3\"\n state={isMasqueradingPending ? 'pending' : 'default'}\n type=\"submit\"\n />\n </>\n )}\n </Form>\n </Container>\n </div>\n );\n};\n\nexport default MasqueradeBar;\n"]}
@@ -1,11 +1,13 @@
1
+ @use "@openedx/paragon/styles/css/core/custom-media-breakpoints.css";
2
+
1
3
  .masquerade-bar {
2
4
  display: flex;
3
5
  align-items: flex-start;
4
- padding: var(--pgn-spacing-spacer-3);
6
+ padding: var(--pgn-spacing-spacer-3) 0;
5
7
  margin-bottom: var(--pgn-spacing-spacer-2);
6
8
 
7
9
  .masquerade-form-label {
8
- padding: var(--pgn-spacing-spacer-2) var(--pgn-spacing-spacer-3);
10
+ padding: var(--pgn-spacing-spacer-2) var(--pgn-spacing-spacer-3) var(--pgn-spacing-spacer-2) 0;
9
11
  display: flex;
10
12
  align-items: center;
11
13
  margin-bottom: 0;
@@ -31,6 +33,6 @@
31
33
  @media (--pgn-size-breakpoint-max-width-md) {
32
34
  .masquerade-bar {
33
35
  margin: auto;
34
- padding: var(--pgn-spacing-spacer-3) var(--pgn-spacing-spacer-4);
36
+ padding: var(--pgn-spacing-spacer-3) 0;
35
37
  }
36
38
  }
@@ -1,12 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { LinkMenuItem, WidgetOperationTypes, getAppConfig } from '@openedx/frontend-base';
3
- import { appId } from '../../constants';
2
+ import { LinkMenuItem, WidgetOperationTypes, getAppConfig, helpButtonSlotOperation } from '@openedx/frontend-base';
3
+ import { appId, dashboardRole } from '../../constants';
4
4
  import ConfirmEmailBanner from './ConfirmEmailBanner';
5
5
  import MasqueradeBar from './MasqueradeBar';
6
6
  import CoursesLink from './CoursesLink';
7
7
  import DiscoverLinkMenuItem from './DiscoverLinkMenuItem';
8
8
  import ProgramsLinkMenuItem from './ProgramsLinkMenuItem';
9
- import SupportLinkMenuItem from './SupportLinkMenuItem';
10
9
  import OrderHistoryLinkMenuItem from './OrderHistoryLinkMenuItem';
11
10
  const app = {
12
11
  appId: 'org.openedx.frontend.app.learnerDashboard.header',
@@ -16,12 +15,18 @@ const app = {
16
15
  id: 'org.openedx.frontend.widget.learnerDashboard.headerConfirmEmail.v1',
17
16
  op: WidgetOperationTypes.PREPEND,
18
17
  component: ConfirmEmailBanner,
18
+ condition: {
19
+ active: [dashboardRole]
20
+ }
19
21
  },
20
22
  {
21
23
  slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',
22
24
  id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkCourses.v1',
23
25
  op: WidgetOperationTypes.APPEND,
24
- element: (_jsx(LinkMenuItem, { label: _jsx(CoursesLink, {}), url: "/", variant: "navLink" }))
26
+ element: (_jsx(LinkMenuItem, { label: _jsx(CoursesLink, {}), role: dashboardRole, variant: "navLink" })),
27
+ condition: {
28
+ active: [dashboardRole]
29
+ }
25
30
  },
26
31
  {
27
32
  slotId: 'org.openedx.frontend.slot.header.primaryLinks.v1',
@@ -29,6 +34,7 @@ const app = {
29
34
  op: WidgetOperationTypes.APPEND,
30
35
  element: (_jsx(ProgramsLinkMenuItem, { variant: "navLink" })),
31
36
  condition: {
37
+ active: [dashboardRole],
32
38
  callback: () => getAppConfig(appId).ENABLE_PROGRAMS === true,
33
39
  }
34
40
  },
@@ -37,16 +43,11 @@ const app = {
37
43
  id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkDiscover.v1',
38
44
  op: WidgetOperationTypes.APPEND,
39
45
  element: (_jsx(DiscoverLinkMenuItem, { variant: "navLink" })),
40
- },
41
- {
42
- slotId: 'org.openedx.frontend.slot.header.secondaryLinks.v1',
43
- id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkSupport.v1',
44
- op: WidgetOperationTypes.APPEND,
45
- element: (_jsx(SupportLinkMenuItem, { variant: "navLink" })),
46
46
  condition: {
47
- callback: () => getAppConfig(appId).SUPPORT_URL ? true : false,
47
+ active: [dashboardRole]
48
48
  }
49
49
  },
50
+ helpButtonSlotOperation({ appId, role: dashboardRole }),
50
51
  {
51
52
  slotId: 'org.openedx.frontend.slot.header.authenticatedMenu.v1',
52
53
  id: 'org.openedx.frontend.widget.learnerDashboard.headerLinkOrderHistory.v1',
@@ -54,6 +55,7 @@ const app = {
54
55
  relatedId: 'org.openedx.frontend.widget.header.desktopAuthenticatedMenuLogout.v1',
55
56
  element: (_jsx(OrderHistoryLinkMenuItem, { variant: "navLink" })),
56
57
  condition: {
58
+ active: [dashboardRole],
57
59
  callback: () => getAppConfig(appId).ORDER_HISTORY_URL ? true : false,
58
60
  }
59
61
  },
@@ -62,6 +64,9 @@ const app = {
62
64
  id: 'org.openedx.frontend.widget.learnerDashboard.headerMasqueradeBar.v1',
63
65
  op: WidgetOperationTypes.APPEND,
64
66
  component: MasqueradeBar,
67
+ condition: {
68
+ active: [dashboardRole]
69
+ }
65
70
  },
66
71
  ]
67
72
  };
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot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oE;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;QACD;YACE,MAAM,EAAE,0CAA0C;YAClD,EAAE,EAAE,qEAAqE;YACzE,EAAE,EAAE,oBAAoB,CAAC,MAAM;YAC/B,SAAS,EAAE,aAAa;SACzB;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 MasqueradeBar from './MasqueradeBar';\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 slotId: 'org.openedx.frontend.slot.header.main.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerMasqueradeBar.v1',\n op: WidgetOperationTypes.APPEND,\n component: MasqueradeBar,\n },\n ]\n};\n\nexport default app;\n"]}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/widgets/LearnerDashboardHeader/app.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAO,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAExH,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,MAAM,GAAG,GAAQ;IACf,KAAK,EAAE,kDAAkD;IACzD,KAAK,EAAE;QACL;YACE,MAAM,EAAE,0CAA0C;YAClD,EAAE,EAAE,oEAAoE;YACxE,EAAE,EAAE,oBAAoB,CAAC,OAAO;YAChC,SAAS,EAAE,kBAAkB;YAC7B,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC,aAAa,CAAC;aACxB;SACF;QACD;YACE,MAAM,EAAE,kDAAkD;YAC1D,EAAE,EAAE,mEAAmE;YACvE,EAAE,EAAE,oBAAoB,CAAC,MAAM;YAC/B,OAAO,EAAE,CACP,KAAC,YAAY,IACX,KAAK,EAAE,KAAC,WAAW,KAAG,EACtB,IAAI,EAAE,aAAa,EACnB,OAAO,EAAC,SAAS,GACjB,CACH;YACD,SAAS,EAAE;gBACT,MAAM,E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CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { App, LinkMenuItem, WidgetOperationTypes, getAppConfig, helpButtonSlotOperation } from '@openedx/frontend-base';\n\nimport { appId, dashboardRole } from '../../constants';\n\nimport ConfirmEmailBanner from './ConfirmEmailBanner';\nimport MasqueradeBar from './MasqueradeBar';\nimport CoursesLink from './CoursesLink';\nimport DiscoverLinkMenuItem from './DiscoverLinkMenuItem';\nimport ProgramsLinkMenuItem from './ProgramsLinkMenuItem';\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 condition: {\n active: [dashboardRole]\n }\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 role={dashboardRole}\n variant=\"navLink\"\n />\n ),\n condition: {\n active: [dashboardRole]\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 active: [dashboardRole],\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 condition: {\n active: [dashboardRole]\n }\n },\n helpButtonSlotOperation({ appId, role: dashboardRole }),\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 active: [dashboardRole],\n callback: () => getAppConfig(appId).ORDER_HISTORY_URL ? true : false,\n }\n },\n {\n slotId: 'org.openedx.frontend.slot.header.main.v1',\n id: 'org.openedx.frontend.widget.learnerDashboard.headerMasqueradeBar.v1',\n op: WidgetOperationTypes.APPEND,\n component: MasqueradeBar,\n condition: {\n active: [dashboardRole]\n }\n },\n ]\n};\n\nexport default app;\n"]}
@@ -21,7 +21,7 @@ declare namespace messages {
21
21
  let description_2: string;
22
22
  export { description_2 as description };
23
23
  }
24
- namespace help {
24
+ namespace profile {
25
25
  let id_3: string;
26
26
  export { id_3 as id };
27
27
  let defaultMessage_3: string;
@@ -29,7 +29,7 @@ declare namespace messages {
29
29
  let description_3: string;
30
30
  export { description_3 as description };
31
31
  }
32
- namespace profile {
32
+ namespace viewPrograms {
33
33
  let id_4: string;
34
34
  export { id_4 as id };
35
35
  let defaultMessage_4: string;
@@ -37,7 +37,7 @@ declare namespace messages {
37
37
  let description_4: string;
38
38
  export { description_4 as description };
39
39
  }
40
- namespace viewPrograms {
40
+ namespace account {
41
41
  let id_5: string;
42
42
  export { id_5 as id };
43
43
  let defaultMessage_5: string;
@@ -45,7 +45,7 @@ declare namespace messages {
45
45
  let description_5: string;
46
46
  export { description_5 as description };
47
47
  }
48
- namespace account {
48
+ namespace orderHistory {
49
49
  let id_6: string;
50
50
  export { id_6 as id };
51
51
  let defaultMessage_6: string;
@@ -53,7 +53,7 @@ declare namespace messages {
53
53
  let description_6: string;
54
54
  export { description_6 as description };
55
55
  }
56
- namespace orderHistory {
56
+ namespace signOut {
57
57
  let id_7: string;
58
58
  export { id_7 as id };
59
59
  let defaultMessage_7: string;
@@ -61,7 +61,7 @@ declare namespace messages {
61
61
  let description_7: string;
62
62
  export { description_7 as description };
63
63
  }
64
- namespace signOut {
64
+ namespace course {
65
65
  let id_8: string;
66
66
  export { id_8 as id };
67
67
  let defaultMessage_8: string;
@@ -69,7 +69,7 @@ declare namespace messages {
69
69
  let description_8: string;
70
70
  export { description_8 as description };
71
71
  }
72
- namespace course {
72
+ namespace program {
73
73
  let id_9: string;
74
74
  export { id_9 as id };
75
75
  let defaultMessage_9: string;
@@ -77,7 +77,7 @@ declare namespace messages {
77
77
  let description_9: string;
78
78
  export { description_9 as description };
79
79
  }
80
- namespace program {
80
+ namespace discoverNew {
81
81
  let id_10: string;
82
82
  export { id_10 as id };
83
83
  let defaultMessage_10: string;
@@ -85,7 +85,7 @@ declare namespace messages {
85
85
  let description_10: string;
86
86
  export { description_10 as description };
87
87
  }
88
- namespace discoverNew {
88
+ namespace logoAltText {
89
89
  let id_11: string;
90
90
  export { id_11 as id };
91
91
  let defaultMessage_11: string;
@@ -93,7 +93,7 @@ declare namespace messages {
93
93
  let description_11: string;
94
94
  export { description_11 as description };
95
95
  }
96
- namespace logoAltText {
96
+ namespace collapseMenuOpenAltText {
97
97
  let id_12: string;
98
98
  export { id_12 as id };
99
99
  let defaultMessage_12: string;
@@ -101,7 +101,7 @@ declare namespace messages {
101
101
  let description_12: string;
102
102
  export { description_12 as description };
103
103
  }
104
- namespace collapseMenuOpenAltText {
104
+ namespace collapseMenuClosedAltText {
105
105
  let id_13: string;
106
106
  export { id_13 as id };
107
107
  let defaultMessage_13: string;
@@ -109,7 +109,7 @@ declare namespace messages {
109
109
  let description_13: string;
110
110
  export { description_13 as description };
111
111
  }
112
- namespace collapseMenuClosedAltText {
112
+ namespace career {
113
113
  let id_14: string;
114
114
  export { id_14 as id };
115
115
  let defaultMessage_14: string;
@@ -117,7 +117,7 @@ declare namespace messages {
117
117
  let description_14: string;
118
118
  export { description_14 as description };
119
119
  }
120
- namespace career {
120
+ namespace newAlert {
121
121
  let id_15: string;
122
122
  export { id_15 as id };
123
123
  let defaultMessage_15: string;
@@ -125,12 +125,4 @@ declare namespace messages {
125
125
  let description_15: string;
126
126
  export { description_15 as description };
127
127
  }
128
- namespace newAlert {
129
- let id_16: string;
130
- export { id_16 as id };
131
- let defaultMessage_16: string;
132
- export { defaultMessage_16 as defaultMessage };
133
- let description_16: string;
134
- export { description_16 as description };
135
- }
136
128
  }
@@ -15,11 +15,6 @@ const messages = defineMessages({
15
15
  defaultMessage: 'SWITCH DASHBOARD',
16
16
  description: 'Switch Dashboard header in the user menu',
17
17
  },
18
- help: {
19
- id: 'learnerVariantDashboard.help.label',
20
- defaultMessage: 'Help',
21
- description: 'The text for the link to the Help Center',
22
- },
23
18
  profile: {
24
19
  id: 'learnerVariantDashboard.menu.profile.label',
25
20
  defaultMessage: 'Profile',
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/widgets/LearnerDashboardHeader/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,SAAS,EAAE;QACT,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,WAAW;QAC3B,WAAW,EAAE,uDAAuD;KACrE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,sDAAsD;QAC1D,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,yCAAyC;KACvD;IACD,eAAe,EAAE;QACf,EAAE,EAAE,oDAAoD;QACxD,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,0CAA0C;KACxD;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,oCAAoC;QACxC,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,0CAA0C;KACxD;IACD,OAAO,EAAE;QACP,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,q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CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n dashboard: {\n id: 'learnerVariantDashboard.menu.dashboard.label',\n defaultMessage: 'Dashboard',\n description: 'The text for the user menu Dashboard navigation link.',\n },\n dashboardPersonal: {\n id: 'learnerVariantDashboard.menu.dashboardPersonal.label',\n defaultMessage: 'Personal',\n description: 'Link to personal dashboard in user menu',\n },\n dashboardSwitch: {\n id: 'learnerVariantDashboard.menu.dashboardSwitch.label',\n defaultMessage: 'SWITCH DASHBOARD',\n description: 'Switch Dashboard header in the user menu',\n },\n help: {\n id: 'learnerVariantDashboard.help.label',\n defaultMessage: 'Help',\n description: 'The text for the link to the Help Center',\n },\n profile: {\n id: 'learnerVariantDashboard.menu.profile.label',\n defaultMessage: 'Profile',\n description: 'The text for the user menu Profile navigation link.',\n },\n viewPrograms: {\n id: 'learnerVariantDashboard.menu.viewPrograms.label',\n defaultMessage: 'View Programs',\n description: 'The text for the user menu View Programs navigation link.',\n },\n account: {\n id: 'learnerVariantDashboard.menu.account.label',\n defaultMessage: 'Account',\n description: 'The text for the user menu Account navigation link.',\n },\n orderHistory: {\n id: 'learnerVariantDashboard.menu.orderHistory.label',\n defaultMessage: 'Order History',\n description: 'The text for the user menu Order History navigation link.',\n },\n signOut: {\n id: 'learnerVariantDashboard.menu.signOut.label',\n defaultMessage: 'Sign Out',\n description: 'The label for the user menu Sign Out action.',\n },\n course: {\n id: 'learnerVariantDashboard.course',\n defaultMessage: 'Courses',\n description: 'Header link for switching to dashboard page.',\n },\n program: {\n id: 'learnerVariantDashboard.program',\n defaultMessage: 'Programs',\n description: 'Header link for switching to program page.',\n },\n discoverNew: {\n id: 'learnerVariantDashboard.discoverNew',\n defaultMessage: 'Discover New',\n description: 'Header link for switching to discover page.',\n },\n logoAltText: {\n id: 'learnerVariantDashboard.logoAltText',\n defaultMessage: 'edX, Inc. Dashboard',\n description: 'Alt text for the edX logo.',\n },\n collapseMenuOpenAltText: {\n id: 'learnerVariantDashboard.collapseMenuOpenAltText',\n defaultMessage: 'Menu',\n description: 'Alt text for the collapse menu icon when the menu is open.',\n },\n collapseMenuClosedAltText: {\n id: 'learnerVariantDashboard.collapseMenuClosedAltText',\n defaultMessage: 'Close',\n description: 'Alt text for the collapse menu icon when the menu is closed.',\n },\n career: {\n id: 'leanerDashboard.menu.career.label',\n defaultMessage: 'Career',\n description: 'The text for the user menu Career navigation link.',\n },\n newAlert: {\n id: 'header.menu.new.label',\n defaultMessage: 'New',\n description: 'The text announcing that an item in the user menu is New',\n },\n});\n\nexport default messages;\n"]}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/widgets/LearnerDashboardHeader/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,SAAS,EAAE;QACT,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,WAAW;QAC3B,WAAW,EAAE,uDAAuD;KACrE;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,sDAAsD;QAC1D,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,yCAAyC;KACvD;IACD,eAAe,EAAE;QACf,EAAE,EAAE,oDAAoD;QACxD,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,0CAA0C;KACxD;IACD,OAAO,EAAE;QACP,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,qDAAqD;KACnE;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,iDAAiD;QACrD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,2DAA2D;KACzE;IACD,OAAO,EAAE;QACP,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,qDAAqD;KACnE;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,iDAAiD;QACrD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,2DAA2D;KACzE;IACD,OAAO,EAAE;QACP,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,8CAA8C;KAC5D;IACD,MAAM,EAAE;QACN,EAAE,EAAE,gCAAgC;QACpC,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,8CAA8C;KAC5D;IACD,OAAO,EAAE;QACP,EAAE,EAAE,iCAAiC;QACrC,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,4CAA4C;KAC1D;IACD,WAAW,EAAE;QACX,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,6CAA6C;KAC3D;IACD,WAAW,EAAE;QACX,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,qBAAqB;QACrC,WAAW,EAAE,4BAA4B;KAC1C;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,iDAAiD;QACrD,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,4DAA4D;KAC1E;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,mDAAmD;QACvD,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,8DAA8D;KAC5E;IACD,MAAM,EAAE;QACN,EAAE,EAAE,mCAAmC;QACvC,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,oDAAoD;KAClE;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,uBAAuB;QAC3B,cAAc,EAAE,KAAK;QACrB,WAAW,EAAE,0DAA0D;KACxE;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n dashboard: {\n id: 'learnerVariantDashboard.menu.dashboard.label',\n defaultMessage: 'Dashboard',\n description: 'The text for the user menu Dashboard navigation link.',\n },\n dashboardPersonal: {\n id: 'learnerVariantDashboard.menu.dashboardPersonal.label',\n defaultMessage: 'Personal',\n description: 'Link to personal dashboard in user menu',\n },\n dashboardSwitch: {\n id: 'learnerVariantDashboard.menu.dashboardSwitch.label',\n defaultMessage: 'SWITCH DASHBOARD',\n description: 'Switch Dashboard header in the user menu',\n },\n profile: {\n id: 'learnerVariantDashboard.menu.profile.label',\n defaultMessage: 'Profile',\n description: 'The text for the user menu Profile navigation link.',\n },\n viewPrograms: {\n id: 'learnerVariantDashboard.menu.viewPrograms.label',\n defaultMessage: 'View Programs',\n description: 'The text for the user menu View Programs navigation link.',\n },\n account: {\n id: 'learnerVariantDashboard.menu.account.label',\n defaultMessage: 'Account',\n description: 'The text for the user menu Account navigation link.',\n },\n orderHistory: {\n id: 'learnerVariantDashboard.menu.orderHistory.label',\n defaultMessage: 'Order History',\n description: 'The text for the user menu Order History navigation link.',\n },\n signOut: {\n id: 'learnerVariantDashboard.menu.signOut.label',\n defaultMessage: 'Sign Out',\n description: 'The label for the user menu Sign Out action.',\n },\n course: {\n id: 'learnerVariantDashboard.course',\n defaultMessage: 'Courses',\n description: 'Header link for switching to dashboard page.',\n },\n program: {\n id: 'learnerVariantDashboard.program',\n defaultMessage: 'Programs',\n description: 'Header link for switching to program page.',\n },\n discoverNew: {\n id: 'learnerVariantDashboard.discoverNew',\n defaultMessage: 'Discover New',\n description: 'Header link for switching to discover page.',\n },\n logoAltText: {\n id: 'learnerVariantDashboard.logoAltText',\n defaultMessage: 'edX, Inc. Dashboard',\n description: 'Alt text for the edX logo.',\n },\n collapseMenuOpenAltText: {\n id: 'learnerVariantDashboard.collapseMenuOpenAltText',\n defaultMessage: 'Menu',\n description: 'Alt text for the collapse menu icon when the menu is open.',\n },\n collapseMenuClosedAltText: {\n id: 'learnerVariantDashboard.collapseMenuClosedAltText',\n defaultMessage: 'Close',\n description: 'Alt text for the collapse menu icon when the menu is closed.',\n },\n career: {\n id: 'leanerDashboard.menu.career.label',\n defaultMessage: 'Career',\n description: 'The text for the user menu Career navigation link.',\n },\n newAlert: {\n id: 'header.menu.new.label',\n defaultMessage: 'New',\n description: 'The text announcing that an item in the user menu is New',\n },\n});\n\nexport default messages;\n"]}
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@openedx/frontend-app-learner-dashboard",
3
- "version": "1.0.0-alpha.9",
3
+ "version": "2.0.0-alpha.1",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/openedx/frontend-app-learner-dashboard.git"
8
8
  },
9
9
  "exports": {
10
- ".": "./dist/index.js",
11
- "./app.scss": "./dist/app.scss"
10
+ ".": "./dist/index.js"
12
11
  },
13
12
  "files": [
14
13
  "/dist"
@@ -31,6 +30,7 @@
31
30
  },
32
31
  "scripts": {
33
32
  "build": "make build",
33
+ "build:ci": "make build-ci",
34
34
  "build:packages": "make build-packages",
35
35
  "clean": "make clean",
36
36
  "clean:packages": "make clean-packages",
@@ -55,7 +55,6 @@
55
55
  "url": "https://github.com/openedx/frontend-app-learner-dashboard/issues"
56
56
  },
57
57
  "dependencies": {
58
- "@edx/brand": "npm:@openedx/brand-openedx@^1.2.3",
59
58
  "@edx/openedx-atlas": "^0.7.0",
60
59
  "@fortawesome/fontawesome-svg-core": "^1.2.36",
61
60
  "@fortawesome/free-brands-svg-icons": "^5.15.4",
@@ -66,6 +65,7 @@
66
65
  "lodash": "^4.17.21",
67
66
  "moment": "^2.29.4",
68
67
  "prop-types": "15.8.1",
68
+ "react-helmet": "^6.1.0",
69
69
  "react-share": "^5.2.2"
70
70
  },
71
71
  "devDependencies": {
@@ -85,7 +85,7 @@
85
85
  "turbo": "^2.8.20"
86
86
  },
87
87
  "peerDependencies": {
88
- "@openedx/frontend-base": "^1.0.0-alpha || 0.0.0-dev",
88
+ "@openedx/frontend-base": "^1.0.0 || 0.0.0-dev",
89
89
  "@openedx/paragon": "^23",
90
90
  "@tanstack/react-query": "^5",
91
91
  "@types/react": "^18",
@@ -1,3 +0,0 @@
1
- export default function SupportLinkMenuItem({ variant }: {
2
- variant?: string | undefined;
3
- }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { LinkMenuItem, getAppConfig, useIntl } from '@openedx/frontend-base';
3
- import { appId } from '../../constants';
4
- import messages from './messages';
5
- function SupportLink() {
6
- const { formatMessage } = useIntl();
7
- return (_jsx("div", { className: "d-flex", children: _jsx("span", { children: formatMessage(messages.help) }) }));
8
- }
9
- export default function SupportLinkMenuItem({ variant = 'hyperlink' }) {
10
- const { SUPPORT_URL: url } = getAppConfig(appId);
11
- if (!url)
12
- return null;
13
- return (_jsx(LinkMenuItem, { label: _jsx(SupportLink, {}), url: url, variant: variant }));
14
- }
15
- //# sourceMappingURL=SupportLinkMenuItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SupportLinkMenuItem.js","sourceRoot":"","sources":["../../../src/widgets/LearnerDashboardHeader/SupportLinkMenuItem.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,SAAS,WAAW;IAClB,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,cAAK,SAAS,EAAC,QAAQ,YACrB,yBAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAQ,GACvC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAE,OAAO,GAAG,WAAW,EAAE;IACnE,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAEjD,IAAI,CAAC,GAAG;QACN,OAAO,IAAI,CAAC;IAEd,OAAO,CACL,KAAC,YAAY,IACX,KAAK,EAAE,KAAC,WAAW,KAAG,EACtB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,GAChB,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { LinkMenuItem, getAppConfig, useIntl } from '@openedx/frontend-base';\n\nimport { appId } from '../../constants';\nimport messages from './messages';\n\nfunction SupportLink() {\n const { formatMessage } = useIntl();\n\n return (\n <div className=\"d-flex\">\n <span>{formatMessage(messages.help)}</span>\n </div>\n );\n}\n\nexport default function SupportLinkMenuItem({ variant = 'hyperlink' }) {\n const { SUPPORT_URL: url } = getAppConfig(appId);\n\n if (!url)\n return null;\n\n return (\n <LinkMenuItem\n label={<SupportLink />}\n url={url}\n variant={variant}\n />\n );\n}\n"]}