@openedx/frontend-app-learner-dashboard 1.0.0 → 2.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.rst CHANGED
@@ -1,61 +1,257 @@
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 ``defaultConfig``, the site's ``commonAppConfig``, and the app's
134
+ ``config``. The first is the app author's, at build time; the other two are the
135
+ operator's, the second applying to every app on the site and the third to this
136
+ app alone.
137
+
138
+ These are the fields the app reads:
139
+
140
+ .. list-table::
141
+ :widths: 30 50 20
142
+ :header-rows: 1
143
+
144
+ * - Name
145
+ - Description / Usage
146
+ - Example
42
147
 
43
- Please see the `license`_ for more info.
148
+ * - ``ENABLE_PROGRAMS``
149
+ - Shows the Programs link in the header's primary navigation, pointing at
150
+ the LMS's ``/dashboard/programs``. The link is hidden when this is
151
+ unset. The related-programs badges and banners on course cards are
152
+ driven by course data and are not affected by this.
153
+ - ``true``
44
154
 
45
- .. _license: https://github.com/openedx/frontend-app-learner-dashboard/blob/master/LICENSE
155
+ * - ``ECOMMERCE_BASE_URL``
156
+ - Base URL of the ecommerce service. Used to build the credit checkout
157
+ link, as ``ECOMMERCE_BASE_URL/credit/checkout/COURSE_ID/``. The credit
158
+ banner renders no "Get credit" button when neither this nor
159
+ ``CREDIT_PURCHASE_URL`` is set.
160
+ - ``http://localhost:18130``
46
161
 
162
+ * - ``CREDIT_PURCHASE_URL``
163
+ - Overrides the credit checkout link with ``CREDIT_PURCHASE_URL/COURSE_ID/``,
164
+ for deployments whose credit purchase flow does not live behind
165
+ ``ECOMMERCE_BASE_URL``. Takes precedence when set.
166
+ - ``http://credit.example.com``
167
+
168
+ * - ``ORDER_HISTORY_URL``
169
+ - Destination of the order history link in the header menu. The link is
170
+ hidden when this is unset.
171
+ - ``http://localhost:1996/orders``
172
+
173
+ * - ``SHOW_UNENROLL_SURVEY``
174
+ - Shows the survey that asks learners why they unenrolled, as the last step
175
+ of the unenrollment flow. Skipped when unset.
176
+ - ``true``
177
+
178
+ *****
179
+ Slots
180
+ *****
181
+
182
+ This app offers slots for operators to customize its pages. See `src/slots/`_
183
+ for the current list and per-slot READMEs with usage examples.
184
+
185
+ .. _src/slots/: ./src/slots/
186
+
187
+ **********
188
+ Developing
189
+ **********
190
+
191
+ Project Structure
192
+ =================
193
+
194
+ The layout follows the standard `frontend-base app layout`_:
195
+
196
+ - ``src/app.ts`` - the app definition imported by ``site.config.*.tsx``.
197
+ - ``src/constants.ts`` - the app's ``appId`` and route role identifiers.
198
+ - ``src/index.ts`` - the package's public exports (this is a library).
199
+ - ``src/routes.jsx`` - the app's react-router routes.
200
+ - ``src/Main.jsx`` - the root component for the app's routes.
201
+ - ``src/providers.ts`` - the context providers the app wraps the site in.
202
+ - ``src/slots.tsx`` - slot operations this app performs on *other* apps' slots,
203
+ such as the header.
204
+ - ``src/slots/`` - the slots this app offers to consumers.
205
+ - ``src/widgets/`` - components this app contributes to slots, including its
206
+ header.
207
+ - ``src/style.scss`` - app-scoped runtime styles.
208
+
209
+ Everything else under ``src/`` is a feature or shared-concern directory:
210
+ ``containers/`` for the page's composed pieces, ``components/`` for the reusable
211
+ ones, ``data/`` for API access and React Query hooks, and ``hooks/``,
212
+ ``tracking/`` and ``utils/`` for the shared remainder.
213
+
214
+ For more, see the `frontend-base migration how-to`_.
215
+
216
+ .. _frontend-base app layout: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/migrate-frontend-app.md#src-file-structure
217
+ .. _frontend-base migration how-to: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/migrate-frontend-app.md
218
+
219
+ Build Process Notes
220
+ ===================
221
+
222
+ **Library build**
223
+
224
+ ``npm run build`` compiles the library into ``dist/`` via ``tsc`` and
225
+ ``tsc-alias``, and copies the SCSS and asset files across. This is what gets
226
+ published and consumed by sites.
227
+
228
+ **CI build**
229
+
230
+ ``npm run build:ci`` runs ``openedx build`` against ``site.config.ci.tsx`` so
231
+ webpack traverses the full app graph. This catches issues, such as broken
232
+ lazy-loaded imports, that ``tsc`` and Jest would not surface.
233
+
234
+ Internationalization
235
+ ====================
236
+
237
+ Please refer to the `frontend-base i18n howto`_ for documentation on
238
+ internationalization.
239
+
240
+ .. _frontend-base i18n howto: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/i18n.rst
241
+
242
+ ************
47
243
  Getting Help
48
- ------------
244
+ ************
49
245
 
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.
246
+ If you're having trouble, we have discussion forums at
247
+ https://discuss.openedx.org where you can connect with others in the community.
52
248
 
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`_.
249
+ Our real-time conversations are on Slack. You can request a `Slack invitation`_,
250
+ then join our `community Slack workspace`_. Because this is a frontend
251
+ repository, the best place to discuss it would be in the `#wg-frontend channel`_.
56
252
 
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.
253
+ For anything non-trivial, the best path is to open an issue in this repository
254
+ with as many details about the issue you are facing as you can provide.
59
255
 
60
256
  https://github.com/openedx/frontend-app-learner-dashboard/issues
61
257
 
@@ -64,23 +260,67 @@ For more information about these options, see the `Getting Help`_ page.
64
260
  .. _Slack invitation: https://openedx.org/slack
65
261
  .. _community Slack workspace: https://openedx.slack.com/
66
262
  .. _#wg-frontend channel: https://openedx.slack.com/archives/C04BM6YC7A6
67
- .. _Getting Help: https://openedx.org/community/connect
263
+ .. _Getting Help: https://openedx.org/getting-help
68
264
 
69
- Resources
70
- ---------
265
+ *******
266
+ License
267
+ *******
71
268
 
72
- Additional info about the Learner Home MFE project can be found on the `Open edX Wiki`_.
269
+ The code in this repository is licensed under the AGPLv3 unless otherwise noted.
73
270
 
74
- .. _Open edX Wiki: https://openedx.atlassian.net/wiki/spaces/OEPM/pages/3575906333/Learner+Home
271
+ Please see `LICENSE <LICENSE>`_ for details.
75
272
 
273
+ ************
274
+ Contributing
275
+ ************
276
+
277
+ Contributions are very welcome. Please read `How To Contribute`_ for details.
278
+
279
+ .. _How To Contribute: https://openedx.org/r/how-to-contribute
280
+
281
+ This project is currently accepting all types of contributions, bug fixes and
282
+ security fixes.
283
+
284
+ ****************************
76
285
  The Open edX Code of Conduct
77
- ----------------------------
286
+ ****************************
78
287
 
79
288
  All community members are expected to follow the `Open edX Code of Conduct`_.
80
289
 
81
290
  .. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/
82
291
 
292
+ ******
293
+ People
294
+ ******
295
+
296
+ The assigned maintainers for this component and other project details may be
297
+ found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``
298
+ file in this repo.
299
+
300
+ .. _Backstage: https://backstage.openedx.org/catalog/default/component/frontend-app-learner-dashboard
301
+
302
+ *************************
83
303
  Reporting Security Issues
84
- -------------------------
304
+ *************************
305
+
306
+ Please do not report security issues in public, and email security@openedx.org
307
+ instead.
308
+
309
+ .. |license-badge| image:: https://img.shields.io/github/license/openedx/frontend-app-learner-dashboard.svg
310
+ :target: https://github.com/openedx/frontend-app-learner-dashboard/blob/master/LICENSE
311
+ :alt: License
312
+
313
+ .. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
314
+ :alt: Maintained
315
+
316
+ .. |ci-badge| image:: https://github.com/openedx/frontend-app-learner-dashboard/actions/workflows/ci.yml/badge.svg
317
+ :target: https://github.com/openedx/frontend-app-learner-dashboard/actions/workflows/ci.yml
318
+ :alt: Continuous Integration
319
+
320
+ .. |codecov-badge| image:: https://codecov.io/github/openedx/frontend-app-learner-dashboard/coverage.svg?branch=master
321
+ :target: https://codecov.io/github/openedx/frontend-app-learner-dashboard?branch=master
322
+ :alt: Codecov
85
323
 
86
- Please do not report security issues in public. Please email security@openedx.org.
324
+ .. |semantic-release| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
325
+ :target: https://github.com/semantic-release/semantic-release
326
+ :alt: semantic-release
package/dist/app.js CHANGED
@@ -7,13 +7,6 @@ const app = {
7
7
  routes,
8
8
  providers,
9
9
  slots,
10
- config: {
11
- LEARNING_BASE_URL: 'http://apps.local.openedx.io:2000',
12
- ENABLE_PROGRAMS: false,
13
- ECOMMERCE_BASE_URL: '',
14
- ORDER_HISTORY_URL: '',
15
- SHOW_UNENROLL_SURVEY: false,
16
- }
17
10
  };
18
11
  export default app;
19
12
  //# sourceMappingURL=app.js.map
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,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
+ {"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;CACN,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};\n\nexport default app;\n"]}
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { useIntl } from '@openedx/frontend-base';
5
5
  import { useCourseData } from '../../../../../../hooks';
6
+ import { creditPurchaseUrl } from '../../../../../../data/services/lms/urls';
6
7
  import track from '../../../../../../tracking';
7
8
  import CreditContent from './components/CreditContent';
8
9
  import messages from './messages';
@@ -12,12 +13,13 @@ export const EligibleContent = ({ cardId }) => {
12
13
  const courseData = useCourseData(cardId);
13
14
  const providerName = (_a = courseData === null || courseData === void 0 ? void 0 : courseData.credit) === null || _a === void 0 ? void 0 : _a.providerName;
14
15
  const courseId = (_b = courseData === null || courseData === void 0 ? void 0 : courseData.courseRun) === null || _b === void 0 ? void 0 : _b.courseId;
16
+ const purchaseUrl = creditPurchaseUrl(courseId);
15
17
  const onClick = track.credit.purchase(courseId);
16
18
  const getCredit = formatMessage(messages.getCredit);
17
19
  const message = providerName
18
20
  ? formatMessage(messages.eligibleFromProvider, { providerName })
19
21
  : formatMessage(messages.eligible, { getCredit: (_jsx("b", { children: getCredit })) });
20
- return (_jsx(CreditContent, { action: { onClick, message: getCredit }, message: message }));
22
+ return (_jsx(CreditContent, { action: purchaseUrl ? { onClick, message: getCredit } : null, message: message }));
21
23
  };
22
24
  EligibleContent.propTypes = {
23
25
  cardId: PropTypes.string.isRequired,
@@ -1 +1 @@
1
- {"version":3,"file":"EligibleContent.js","sourceRoot":"","sources":["../../../../../../../src/containers/CourseCard/components/CourseCardBanners/CreditBanner/views/EligibleContent.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,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,MAAM,eAAe,CAAC;AAElC,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;;IAC5C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,YAAY,GAAG,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,0CAAE,YAAY,CAAC;IACtD,MAAM,QAAQ,GAAG,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,0CAAE,QAAQ,CAAC;IAEjD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,YAAY;QAC1B,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,oBAAoB,EAAE,EAAE,YAAY,EAAE,CAAC;QAChE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,sBAAI,SAAS,GAAK,CAAC,EAAE,CAAC,CAAC;IAE1E,OAAO,CACL,KAAC,aAAa,IACZ,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EACvC,OAAO,EAAE,OAAO,GAChB,CACH,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,CAAC,SAAS,GAAG;IAC1B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACpC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { useCourseData } from '@src/hooks';\nimport track from '@src/tracking';\n\nimport CreditContent from './components/CreditContent';\nimport messages from './messages';\n\nexport const EligibleContent = ({ cardId }) => {\n const { formatMessage } = useIntl();\n const courseData = useCourseData(cardId);\n const providerName = courseData?.credit?.providerName;\n const courseId = courseData?.courseRun?.courseId;\n\n const onClick = track.credit.purchase(courseId);\n const getCredit = formatMessage(messages.getCredit);\n const message = providerName\n ? formatMessage(messages.eligibleFromProvider, { providerName })\n : formatMessage(messages.eligible, { getCredit: (<b>{getCredit}</b>) });\n\n return (\n <CreditContent\n action={{ onClick, message: getCredit }}\n message={message}\n />\n );\n};\nEligibleContent.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\n\nexport default EligibleContent;\n"]}
1
+ {"version":3,"file":"EligibleContent.js","sourceRoot":"","sources":["../../../../../../../src/containers/CourseCard/components/CourseCardBanners/CreditBanner/views/EligibleContent.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,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,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React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { useCourseData } from '@src/hooks';\nimport { creditPurchaseUrl } from '@src/data/services/lms/urls';\nimport track from '@src/tracking';\n\nimport CreditContent from './components/CreditContent';\nimport messages from './messages';\n\nexport const EligibleContent = ({ cardId }) => {\n const { formatMessage } = useIntl();\n const courseData = useCourseData(cardId);\n const providerName = courseData?.credit?.providerName;\n const courseId = courseData?.courseRun?.courseId;\n\n const purchaseUrl = creditPurchaseUrl(courseId);\n const onClick = track.credit.purchase(courseId);\n const getCredit = formatMessage(messages.getCredit);\n const message = providerName\n ? formatMessage(messages.eligibleFromProvider, { providerName })\n : formatMessage(messages.eligible, { getCredit: (<b>{getCredit}</b>) });\n\n return (\n <CreditContent\n action={purchaseUrl ? { onClick, message: getCredit } : null}\n message={message}\n />\n );\n};\nEligibleContent.propTypes = {\n cardId: PropTypes.string.isRequired,\n};\n\nexport default EligibleContent;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FiltersProvider.js","sourceRoot":"","sources":["../../../src/data/context/FiltersProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,GAC1D,MAAM,OAAO,CAAC;AAgBf,MAAM,cAAc,GAAG,aAAa,CAA4B,IAAI,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IAC7E,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IACrD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAa,UAAU,CAAC,CAAC;IAC7D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEhD,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,MAAc,EAAE,EAAE;QAC/C,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACxC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,MAAc,EAAE,EAAE;QAClD,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC;IAC3D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,UAAU,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC;QACL,OAAO;QACP,MAAM;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,aAAa;KACd,CAAC,EACF,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,CAAC,CACrE,CAAC;IAEF,OAAO,CACL,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YACzC,QAAQ,GACe,CAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React, {\n createContext, useContext, useState, useMemo, useCallback,\n} from 'react';\n\ntype SortOption = 'enrolled' | 'title';\n\ninterface FiltersContextType {\n filters: string[],\n sortBy: SortOption,\n pageNumber: number,\n setFilters: (newFilters: string[]) => void,\n addFilter: (filter: string) => void,\n removeFilter: (filter: string) => void,\n clearFilters: () => void,\n setSortBy: (sortBy: SortOption) => void,\n setPageNumber: (pageNumber: number) => void,\n}\n\nconst FiltersContext = createContext<FiltersContextType | null>(null);\n\nexport const FiltersProvider = ({ children }: { children: React.ReactNode }) => {\n const [filters, setFilters] = useState<string[]>([]);\n const [sortBy, setSortBy] = useState<SortOption>('enrolled');\n const [pageNumber, setPageNumber] = useState(1);\n\n const addFilter = useCallback((filter: string) => {\n setFilters(prev => [...prev, filter]);\n }, []);\n\n const removeFilter = useCallback((filter: string) => {\n setFilters(prev => prev.filter(item => item !== filter));\n }, []);\n\n const clearFilters = useCallback(() => {\n setFilters([]);\n }, []);\n\n const contextValue = useMemo(\n () => ({\n filters,\n sortBy,\n pageNumber,\n setFilters,\n addFilter,\n removeFilter,\n clearFilters,\n setSortBy,\n setPageNumber,\n }),\n [filters, sortBy, pageNumber, addFilter, removeFilter, clearFilters],\n );\n\n return (\n <FiltersContext.Provider value={contextValue}>\n {children}\n </FiltersContext.Provider>\n );\n};\n\nexport const useFilters = () => {\n const context = useContext(FiltersContext);\n if (!context) {\n throw new Error('useFilters must be used within a FiltersProvider');\n }\n return context;\n};\n"]}
1
+ {"version":3,"file":"FiltersProvider.js","sourceRoot":"","sources":["../../../src/data/context/FiltersProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,GAC1D,MAAM,OAAO,CAAC;AAgBf,MAAM,cAAc,GAAG,aAAa,CAA4B,IAAI,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAiC,EAAE,EAAE;IAC7E,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IACrD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ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O,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React, {\n createContext, useContext, useState, useMemo, useCallback,\n} from 'react';\n\ntype SortOption = 'enrolled' | 'title';\n\ninterface FiltersContextType {\n filters: string[];\n sortBy: SortOption;\n pageNumber: number;\n setFilters: (newFilters: string[]) => void;\n addFilter: (filter: string) => void;\n removeFilter: (filter: string) => void;\n clearFilters: () => void;\n setSortBy: (sortBy: SortOption) => void;\n setPageNumber: (pageNumber: number) => void;\n}\n\nconst FiltersContext = createContext<FiltersContextType | null>(null);\n\nexport const FiltersProvider = ({ children }: { children: React.ReactNode }) => {\n const [filters, setFilters] = useState<string[]>([]);\n const [sortBy, setSortBy] = useState<SortOption>('enrolled');\n const [pageNumber, setPageNumber] = useState(1);\n\n const addFilter = useCallback((filter: string) => {\n setFilters(prev => [...prev, filter]);\n }, []);\n\n const removeFilter = useCallback((filter: string) => {\n setFilters(prev => prev.filter(item => item !== filter));\n }, []);\n\n const clearFilters = useCallback(() => {\n setFilters([]);\n }, []);\n\n const contextValue = useMemo(\n () => ({\n filters,\n sortBy,\n pageNumber,\n setFilters,\n addFilter,\n removeFilter,\n clearFilters,\n setSortBy,\n setPageNumber,\n }),\n [filters, sortBy, pageNumber, addFilter, removeFilter, clearFilters],\n );\n\n return (\n <FiltersContext.Provider value={contextValue}>\n {children}\n </FiltersContext.Provider>\n );\n};\n\nexport const useFilters = () => {\n const context = useContext(FiltersContext);\n if (!context) {\n throw new Error('useFilters must be used within a FiltersProvider');\n }\n return context;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MasqueradeProvider.js","sourceRoot":"","sources":["../../../src/data/context/MasqueradeProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,GAC7C,MAAM,OAAO,CAAC;AAOf,MAAM,iBAAiB,GAAG,aAAa,CAA+B,IAAI,CAAC,CAAC;AAM5E,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IAEpF,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAClC,cAAc;QACd,iBAAiB;KAClB,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAEtB,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC5C,QAAQ,GACkB,CAC9B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAA0B,EAAE;IACvD,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC9C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React, {\n createContext, useContext, useMemo, useState, ReactNode,\n} from 'react';\n\ninterface MasqueradeContextType {\n masqueradeUser: string | undefined,\n setMasqueradeUser: (user: string | undefined) => void,\n}\n\nconst MasqueradeContext = createContext<MasqueradeContextType | null>(null);\n\ninterface MasqueradeProviderProps {\n children: ReactNode,\n}\n\nexport const MasqueradeProvider: React.FC<MasqueradeProviderProps> = ({ children }) => {\n const [masqueradeUser, setMasqueradeUser] = useState<string | undefined>(undefined);\n\n const contextValue = useMemo(() => ({\n masqueradeUser,\n setMasqueradeUser,\n }), [masqueradeUser]);\n\n return (\n <MasqueradeContext.Provider value={contextValue}>\n {children}\n </MasqueradeContext.Provider>\n );\n};\n\nexport const useMasquerade = (): MasqueradeContextType => {\n const context = useContext(MasqueradeContext);\n if (!context) {\n throw new Error('useMasquerade must be used within a MasqueradeProvider');\n }\n return context;\n};\n"]}
1
+ {"version":3,"file":"MasqueradeProvider.js","sourceRoot":"","sources":["../../../src/data/context/MasqueradeProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,GAC7C,MAAM,OAAO,CAAC;AAOf,MAAM,iBAAiB,GAAG,aAAa,CAA+B,IAAI,CAAC,CAAC;AAM5E,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpF,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IAEpF,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAClC,cAAc;QACd,iBAAiB;KAClB,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAEtB,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC5C,QAAQ,GACkB,CAC9B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAA0B,EAAE;IACvD,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC9C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React, {\n createContext, useContext, useMemo, useState, ReactNode,\n} from 'react';\n\ninterface MasqueradeContextType {\n masqueradeUser: string | undefined;\n setMasqueradeUser: (user: string | undefined) => void;\n}\n\nconst MasqueradeContext = createContext<MasqueradeContextType | null>(null);\n\ninterface MasqueradeProviderProps {\n children: ReactNode;\n}\n\nexport const MasqueradeProvider: React.FC<MasqueradeProviderProps> = ({ children }) => {\n const [masqueradeUser, setMasqueradeUser] = useState<string | undefined>(undefined);\n\n const contextValue = useMemo(() => ({\n masqueradeUser,\n setMasqueradeUser,\n }), [masqueradeUser]);\n\n return (\n <MasqueradeContext.Provider value={contextValue}>\n {children}\n </MasqueradeContext.Provider>\n );\n};\n\nexport const useMasquerade = (): MasqueradeContextType => {\n const context = useContext(MasqueradeContext);\n if (!context) {\n throw new Error('useMasquerade must be used within a MasqueradeProvider');\n }\n return context;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SelectSessionProvider.js","sourceRoot":"","sources":["../../../src/data/context/SelectSessionProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAC9C,WAAW,GACZ,MAAM,OAAO,CAAC;AAYf,MAAM,yBAAyB,GAAG,aAAa,CAAuC,IAAI,CAAC,CAAC;AAU5F,MAAM,YAAY,GAAU;IAC1B,kBAAkB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;CACrC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,KAAY,EAAE,MAAc,EAAS,EAAE;IACxE,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,6BAA6B;YAChC,uCACK,KAAK,KACR,kBAAkB,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,IAC9C;QACJ,KAAK,4BAA4B;YAC/B,uCACK,KAAK,KACR,kBAAkB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IACpC;QACJ,0BAA0B;QAC1B;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC,CAAC;AAMF,MAAM,CAAC,MAAM,0BAA0B,GAA8C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpG,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,UAAU,CAAC,yBAAyB,EAAE,YAAY,CAAC,CAAC;IAE9E,MAAM,wBAAwB,GAAG,WAAW,CAAC,CAAC,MAAqB,EAAE,EAAE;QACrE,QAAQ,CAAC,EAAE,IAAI,EAAE,6BAA6B,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACrE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,uBAAuB,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/C,QAAQ,CAAC,EAAE,IAAI,EAAE,4BAA4B,EAAE,CAAC,CAAC;IACnD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC;QACL,kBAAkB,EAAE,KAAK,CAAC,kBAAkB;QAC5C,wBAAwB;QACxB,uBAAuB;KACxB,CAAC,EACF,CAAC,uBAAuB,EAAE,KAAK,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,CAC9E,CAAC;IAEF,OAAO,CACL,KAAC,yBAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YACpD,QAAQ,GAC0B,CACtC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAkC,EAAE;IACvE,MAAM,OAAO,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IAC5F,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React, {\n createContext, useContext, useReducer, useMemo, ReactNode,\n useCallback,\n} from 'react';\n\ninterface SelectSessionModalState {\n cardId: string | null,\n}\n\ninterface SelectSessionModalContextType {\n selectSessionModal: SelectSessionModalState,\n updateSelectSessionModal: (cardId: string | null) => void,\n closeSelectSessionModal: () => void,\n}\n\nconst SelectSessionModalContext = createContext<SelectSessionModalContextType | null>(null);\n\ninterface State {\n selectSessionModal: SelectSessionModalState,\n}\n\ntype Action =\n | { type: 'UPDATE_SELECT_SESSION_MODAL', payload: string | null }\n | { type: 'CLOSE_SELECT_SESSION_MODAL' };\n\nconst initialState: State = {\n selectSessionModal: { cardId: null },\n};\n\nconst selectSessionModalReducer = (state: State, action: Action): State => {\n switch (action.type) {\n case 'UPDATE_SELECT_SESSION_MODAL':\n return {\n ...state,\n selectSessionModal: { cardId: action.payload },\n };\n case 'CLOSE_SELECT_SESSION_MODAL':\n return {\n ...state,\n selectSessionModal: { cardId: null },\n };\n /* istanbul ignore next */\n default:\n return state;\n }\n};\n\ninterface SelectSessionModalProviderProps {\n children: ReactNode,\n}\n\nexport const SelectSessionModalProvider: React.FC<SelectSessionModalProviderProps> = ({ children }) => {\n const [state, dispatch] = useReducer(selectSessionModalReducer, initialState);\n\n const updateSelectSessionModal = useCallback((cardId: string | null) => {\n dispatch({ type: 'UPDATE_SELECT_SESSION_MODAL', payload: cardId });\n }, []);\n\n const closeSelectSessionModal = useCallback(() => {\n dispatch({ type: 'CLOSE_SELECT_SESSION_MODAL' });\n }, []);\n\n const contextValue = useMemo(\n () => ({\n selectSessionModal: state.selectSessionModal,\n updateSelectSessionModal,\n closeSelectSessionModal,\n }),\n [closeSelectSessionModal, state.selectSessionModal, updateSelectSessionModal],\n );\n\n return (\n <SelectSessionModalContext.Provider value={contextValue}>\n {children}\n </SelectSessionModalContext.Provider>\n );\n};\n\nexport const useSelectSessionModal = (): SelectSessionModalContextType => {\n const context = useContext(SelectSessionModalContext);\n if (!context) {\n throw new Error('useSelectSessionModal must be used within a SelectSessionModalProvider');\n }\n return context;\n};\n"]}
1
+ {"version":3,"file":"SelectSessionProvider.js","sourceRoot":"","sources":["../../../src/data/context/SelectSessionProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAC9C,WAAW,GACZ,MAAM,OAAO,CAAC;AAYf,MAAM,yBAAyB,GAAG,aAAa,CAAuC,IAAI,CAAC,CAAC;AAU5F,MAAM,YAAY,GAAU;IAC1B,kBAAkB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;CACrC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,KAAY,EAAE,MAAc,EAAS,EAAE;IACxE,QAAQ,MAAM,CAAC,IAA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BAAyB,CAAC,CAAC;IACtD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IAC5F,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React, {\n createContext, useContext, useReducer, useMemo, ReactNode,\n useCallback,\n} from 'react';\n\ninterface SelectSessionModalState {\n cardId: string | null;\n}\n\ninterface SelectSessionModalContextType {\n selectSessionModal: SelectSessionModalState;\n updateSelectSessionModal: (cardId: string | null) => void;\n closeSelectSessionModal: () => void;\n}\n\nconst SelectSessionModalContext = createContext<SelectSessionModalContextType | null>(null);\n\ninterface State {\n selectSessionModal: SelectSessionModalState;\n}\n\ntype Action =\n | { type: 'UPDATE_SELECT_SESSION_MODAL'; payload: string | null }\n | { type: 'CLOSE_SELECT_SESSION_MODAL' };\n\nconst initialState: State = {\n selectSessionModal: { cardId: null },\n};\n\nconst selectSessionModalReducer = (state: State, action: Action): State => {\n switch (action.type) {\n case 'UPDATE_SELECT_SESSION_MODAL':\n return {\n ...state,\n selectSessionModal: { cardId: action.payload },\n };\n case 'CLOSE_SELECT_SESSION_MODAL':\n return {\n ...state,\n selectSessionModal: { cardId: null },\n };\n /* istanbul ignore next */\n default:\n return state;\n }\n};\n\ninterface SelectSessionModalProviderProps {\n children: ReactNode;\n}\n\nexport const SelectSessionModalProvider: React.FC<SelectSessionModalProviderProps> = ({ children }) => {\n const [state, dispatch] = useReducer(selectSessionModalReducer, initialState);\n\n const updateSelectSessionModal = useCallback((cardId: string | null) => {\n dispatch({ type: 'UPDATE_SELECT_SESSION_MODAL', payload: cardId });\n }, []);\n\n const closeSelectSessionModal = useCallback(() => {\n dispatch({ type: 'CLOSE_SELECT_SESSION_MODAL' });\n }, []);\n\n const contextValue = useMemo(\n () => ({\n selectSessionModal: state.selectSessionModal,\n updateSelectSessionModal,\n closeSelectSessionModal,\n }),\n [closeSelectSessionModal, state.selectSessionModal, updateSelectSessionModal],\n );\n\n return (\n <SelectSessionModalContext.Provider value={contextValue}>\n {children}\n </SelectSessionModalContext.Provider>\n );\n};\n\nexport const useSelectSessionModal = (): SelectSessionModalContextType => {\n const context = useContext(SelectSessionModalContext);\n if (!context) {\n throw new Error('useSelectSessionModal must be used within a SelectSessionModalProvider');\n }\n return context;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/context/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAM5F,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAyB,EAAE,EAAE,CAAC,CAChE,KAAC,eAAe,cACd,KAAC,0BAA0B,cACxB,QAAQ,GACkB,GACb,CACnB,CAAC;AAEF,OAAO,EACL,kBAAkB,EAAE,aAAa,EAAE,UAAU,EAAE,qBAAqB,GACrE,CAAC;AACF,eAAe,gBAAgB,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport { MasqueradeProvider, useMasquerade } from './MasqueradeProvider';\nimport { FiltersProvider, useFilters } from './FiltersProvider';\nimport { SelectSessionModalProvider, useSelectSessionModal } from './SelectSessionProvider';\n\ninterface ContextProvidersProps {\n children: ReactNode,\n}\n\nconst ContextProviders = ({ children }: ContextProvidersProps) => (\n <FiltersProvider>\n <SelectSessionModalProvider>\n {children}\n </SelectSessionModalProvider>\n </FiltersProvider>\n);\n\nexport {\n MasqueradeProvider, useMasquerade, useFilters, useSelectSessionModal,\n};\nexport default ContextProviders;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/context/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAM5F,MAAM,gBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAyB,EAAE,EAAE,CAAC,CAChE,KAAC,eAAe,cACd,KAAC,0BAA0B,cACxB,QAAQ,GACkB,GACb,CACnB,CAAC;AAEF,OAAO,EACL,kBAAkB,EAAE,aAAa,EAAE,UAAU,EAAE,qBAAqB,GACrE,CAAC;AACF,eAAe,gBAAgB,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport { MasqueradeProvider, useMasquerade } from './MasqueradeProvider';\nimport { FiltersProvider, useFilters } from './FiltersProvider';\nimport { SelectSessionModalProvider, useSelectSessionModal } from './SelectSessionProvider';\n\ninterface ContextProvidersProps {\n children: ReactNode;\n}\n\nconst ContextProviders = ({ children }: ContextProvidersProps) => (\n <FiltersProvider>\n <SelectSessionModalProvider>\n {children}\n </SelectSessionModalProvider>\n </FiltersProvider>\n);\n\nexport {\n MasqueradeProvider, useMasquerade, useFilters, useSelectSessionModal,\n};\nexport default ContextProviders;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalDataContext.js","sourceRoot":"","sources":["../../../src/data/contexts/GlobalDataContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,OAAO,CAAC;AAkBhE,MAAM,iBAAiB,GAAG,aAAa,CAAwB;IAC7D,iBAAiB,EAAE;QACjB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,EAAE;KACjB;IACD,gBAAgB,EAAE;QAChB,eAAe,EAAE,EAAE;KACpB;IACD,oBAAoB,EAAE,IAAI;IAC1B,mBAAmB,EAAE,IAAI;CAC1B,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC","sourcesContent":["import { createContext, Dispatch, SetStateAction } from 'react';\n\ninterface EmailConfirmation {\n isNeeded: boolean,\n sendEmailUrl: string,\n}\n\ninterface PlatformSettings {\n courseSearchUrl: string,\n}\n\ninterface GlobalDataContextType {\n emailConfirmation: EmailConfirmation,\n platformSettings: PlatformSettings,\n setEmailConfirmation: Dispatch<SetStateAction<EmailConfirmation>> | null,\n setPlatformSettings: Dispatch<SetStateAction<PlatformSettings>> | null,\n}\n\nconst GlobalDataContext = createContext<GlobalDataContextType>({\n emailConfirmation: {\n isNeeded: false,\n sendEmailUrl: '',\n },\n platformSettings: {\n courseSearchUrl: '',\n },\n setEmailConfirmation: null,\n setPlatformSettings: null,\n});\n\nexport default GlobalDataContext;\n"]}
1
+ {"version":3,"file":"GlobalDataContext.js","sourceRoot":"","sources":["../../../src/data/contexts/GlobalDataContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,OAAO,CAAC;AAkBhE,MAAM,iBAAiB,GAAG,aAAa,CAAwB;IAC7D,iBAAiB,EAAE;QACjB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,EAAE;KACjB;IACD,gBAAgB,EAAE;QAChB,eAAe,EAAE,EAAE;KACpB;IACD,oBAAoB,EAAE,IAAI;IAC1B,mBAAmB,EAAE,IAAI;CAC1B,CAAC,CAAC;AAEH,eAAe,iBAAiB,CAAC","sourcesContent":["import { createContext, Dispatch, SetStateAction } from 'react';\n\ninterface EmailConfirmation {\n isNeeded: boolean;\n sendEmailUrl: string;\n}\n\ninterface PlatformSettings {\n courseSearchUrl: string;\n}\n\ninterface GlobalDataContextType {\n emailConfirmation: EmailConfirmation;\n platformSettings: PlatformSettings;\n setEmailConfirmation: Dispatch<SetStateAction<EmailConfirmation>> | null;\n setPlatformSettings: Dispatch<SetStateAction<PlatformSettings>> | null;\n}\n\nconst GlobalDataContext = createContext<GlobalDataContextType>({\n emailConfirmation: {\n isNeeded: false,\n sendEmailUrl: '',\n },\n platformSettings: {\n courseSearchUrl: '',\n },\n setEmailConfirmation: null,\n setPlatformSettings: null,\n});\n\nexport default Gl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,KAAK,EAAE,EAAE;YACjB,QAAQ,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACpB,CAAC","sourcesContent":["import { useQueryClient, useMutation } from '@tanstack/react-query';\nimport { logError } from '@openedx/frontend-base';\nimport {\n createCreditRequest,\n deleteEntitlementEnrollment,\n sendConfirmEmail,\n unenrollFromCourse,\n updateEmailSettings,\n updateEntitlementEnrollment,\n} from '@src/data/services/lms/api';\nimport { learnerDashboardQueryKeys, learnerDashboardMutationKeys } from './queryKeys';\n\ninterface UpdateEntitlementProps {\n uuid: string,\n courseId: string,\n}\n\ninterface DeleteEntitlementParams {\n uuid: string,\n isRefundable: boolean,\n}\n\ninterface UpdateEmailSettingsParams {\n courseId: string,\n enable: boolean,\n}\n\ninterface CreditParams {\n providerId: string,\n courseId: string,\n username: string,\n}\n\nconst useUnenrollFromCourse = () => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.unenrollFromCourse(),\n mutationFn: ({ courseId }: { courseId: string }) => unenrollFromCourse({ courseId }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error, variables) => {\n logError(`Failed to unenroll from course ${variables.courseId}:`, error);\n },\n });\n};\n\nconst useUpdateEntitlementEnrollment = () => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.updateEntitlementEnrollment(),\n mutationFn: ({ uuid, courseId }: UpdateEntitlementProps) => updateEntitlementEnrollment({ uuid, courseId }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error, variables) => {\n logError(`Failed to update entitlement enrollment for UUID ${variables.uuid}:`, error);\n },\n });\n};\n\nconst useDeleteEntitlementEnrollment = () => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.deleteEntitlementEnrollment(),\n mutationFn: (params: DeleteEntitlementParams) => deleteEntitlementEnrollment(params),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error, variables) => {\n logError(`Failed to delete entitlement enrollment for UUID ${variables.uuid}:`, error);\n },\n });\n};\n\nconst useUpdateEmailSettings = () => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.updateEmailSettings(),\n mutationFn: ({ courseId, enable }: UpdateEmailSettingsParams) => updateEmailSettings({ courseId, enable }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error, variables) => {\n logError(`Failed to update email settings for course ${variables.courseId}:`, error);\n },\n });\n};\n\nconst useCreateCreditRequest = () => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.createCreditRequest(),\n mutationFn: (props: CreditParams) => createCreditRequest(props),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error, variables) => {\n logError(`Failed to create credit request for course ${variables.courseId} with provider ${variables.providerId}:`, error);\n },\n });\n};\n\nconst useSendConfirmEmail = (sendEmailUrl: string) => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.sendConfirmEmail(sendEmailUrl),\n mutationFn: () => sendConfirmEmail(sendEmailUrl),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error) => {\n logError('Failed to send confirmation email:', error);\n },\n });\n};\n\nexport {\n useUnenrollFromCourse,\n useUpdateEntitlementEnrollment,\n useDeleteEntitlementEnrollment,\n useUpdateEmailSettings,\n useCreateCreditRequest,\n useSendConfirmEm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AE;YACjB,QAAQ,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACpB,CAAC","sourcesContent":["import { useQueryClient, useMutation } from '@tanstack/react-query';\nimport { logError } from '@openedx/frontend-base';\nimport {\n createCreditRequest,\n deleteEntitlementEnrollment,\n sendConfirmEmail,\n unenrollFromCourse,\n updateEmailSettings,\n updateEntitlementEnrollment,\n} from '@src/data/services/lms/api';\nimport { learnerDashboardQueryKeys, learnerDashboardMutationKeys } from './queryKeys';\n\ninterface UpdateEntitlementProps {\n uuid: string;\n courseId: string;\n}\n\ninterface DeleteEntitlementParams {\n uuid: string;\n isRefundable: boolean;\n}\n\ninterface UpdateEmailSettingsParams {\n courseId: string;\n enable: boolean;\n}\n\ninterface CreditParams {\n providerId: string;\n courseId: string;\n username: string;\n}\n\nconst useUnenrollFromCourse = () => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.unenrollFromCourse(),\n mutationFn: ({ courseId }: { courseId: string }) => unenrollFromCourse({ courseId }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error, variables) => {\n logError(`Failed to unenroll from course ${variables.courseId}:`, error);\n },\n });\n};\n\nconst useUpdateEntitlementEnrollment = () => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.updateEntitlementEnrollment(),\n mutationFn: ({ uuid, courseId }: UpdateEntitlementProps) => updateEntitlementEnrollment({ uuid, courseId }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error, variables) => {\n logError(`Failed to update entitlement enrollment for UUID ${variables.uuid}:`, error);\n },\n });\n};\n\nconst useDeleteEntitlementEnrollment = () => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.deleteEntitlementEnrollment(),\n mutationFn: (params: DeleteEntitlementParams) => deleteEntitlementEnrollment(params),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error, variables) => {\n logError(`Failed to delete entitlement enrollment for UUID ${variables.uuid}:`, error);\n },\n });\n};\n\nconst useUpdateEmailSettings = () => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.updateEmailSettings(),\n mutationFn: ({ courseId, enable }: UpdateEmailSettingsParams) => updateEmailSettings({ courseId, enable }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error, variables) => {\n logError(`Failed to update email settings for course ${variables.courseId}:`, error);\n },\n });\n};\n\nconst useCreateCreditRequest = () => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.createCreditRequest(),\n mutationFn: (props: CreditParams) => createCreditRequest(props),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error, variables) => {\n logError(`Failed to create credit request for course ${variables.courseId} with provider ${variables.providerId}:`, error);\n },\n });\n};\n\nconst useSendConfirmEmail = (sendEmailUrl: string) => {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: learnerDashboardMutationKeys.sendConfirmEmail(sendEmailUrl),\n mutationFn: () => sendConfirmEmail(sendEmailUrl),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: learnerDashboardQueryKeys.initializeBase() });\n },\n onError: (error) => {\n logError('Failed to send confirmation email:', error);\n },\n });\n};\n\nexport {\n useUnenrollFromCourse,\n useUpdateEntitlementEnrollment,\n useDeleteEntitlementEnrollment,\n useUpdateEmailSettings,\n useCreateCreditRequest,\n useSendConfirmEmail,\n};\n"]}
@@ -1,8 +1,7 @@
1
1
  export function getApiUrl(): string;
2
2
  export function updateUrl(base: any, url: any): any;
3
3
  export function baseAppUrl(url: any): any;
4
- export function learningMfeUrl(url: any): any;
5
- export function creditPurchaseUrl(courseId: any): string;
4
+ export function creditPurchaseUrl(courseId: any): string | null;
6
5
  export function creditRequestUrl(providerId: any): string;
7
6
  declare const _default: any;
8
7
  export default _default;
@@ -11,14 +11,20 @@ const entitlementEnrollment = (uuid) => `${getApiUrl()}/entitlements/v1/entitlem
11
11
  // if url is null or absolute, return it as is
12
12
  export const updateUrl = (base, url) => ((url == null || url.startsWith('http://') || url.startsWith('https://')) ? url : `${base}${url}`);
13
13
  export const baseAppUrl = (url) => updateUrl(getBaseUrl(), url);
14
- export const learningMfeUrl = (url) => updateUrl(getAppConfig(appId).LEARNING_BASE_URL, url);
15
14
  // static view url
16
15
  const programsUrl = () => baseAppUrl('/dashboard/programs');
16
+ /**
17
+ * Returns the credit purchase URL for a course, or `null` when the site
18
+ * configures neither CREDIT_PURCHASE_URL nor ECOMMERCE_BASE_URL.
19
+ */
17
20
  export const creditPurchaseUrl = (courseId) => {
18
21
  const config = getAppConfig(appId);
19
- return config.CREDIT_PURCHASE_URL
20
- ? `${config.CREDIT_PURCHASE_URL}/${courseId}/`
21
- : `${config.ECOMMERCE_BASE_URL}/credit/checkout/${courseId}/`;
22
+ if (config.CREDIT_PURCHASE_URL) {
23
+ return `${config.CREDIT_PURCHASE_URL}/${courseId}/`;
24
+ }
25
+ return config.ECOMMERCE_BASE_URL
26
+ ? `${config.ECOMMERCE_BASE_URL}/credit/checkout/${courseId}/`
27
+ : null;
22
28
  };
23
29
  export const creditRequestUrl = (providerId) => `${getApiUrl()}/credit/v1/providers/${providerId}/request/`;
24
30
  export default StrictDict({
@@ -30,7 +36,6 @@ export default StrictDict({
30
36
  entitlementEnrollment,
31
37
  event,
32
38
  getInitApiUrl,
33
- learningMfeUrl,
34
39
  programsUrl,
35
40
  updateEmailSettings,
36
41
  });
@@ -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AAE,EAAE,GAAG,CAAC,CAAC;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAE7F,kBAAkB;AAClB,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,EAAE;IAC5C,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,mBAAmB;QAC/B,CAAC,CAAC,GAAG,MAAM,CAAC,mBAAmB,IAAI,QAAQ,GAAG;QAC9C,CAAC,CAAC,GAAG,MAAM,CAAC,kBAAkB,oBAAoB,QAAQ,GAAG,CAAC;AAClE,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,SAAS,EAAE,wBAAwB,UAAU,WAAW,CAAC;AAE5G,eAAe,UAAU,CAAC;IACxB,SAAS;IACT,UAAU;IACV,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,qBAAqB;IACrB,KAAK;IACL,aAAa;IACb,cAAc;IACd,WAAW;IACX,mBAAmB;CACpB,CAAC,CAAC","sourcesContent":["import { appId } from '../../../constants';\nimport { StrictDict } from '../../../utils';\n\nimport { getAppConfig, getSiteConfig } from '@openedx/frontend-base';\n\nconst getBaseUrl = () => getSiteConfig().lmsBaseUrl;\n\nexport const getApiUrl = () => (`${getSiteConfig().lmsBaseUrl}/api`);\n\nconst getInitApiUrl = () => (`${getApiUrl()}/learner_home/init`);\n\nconst event = () => `${getBaseUrl()}/event`;\nconst courseUnenroll = () => `${getBaseUrl()}/change_enrollment`;\nconst updateEmailSettings = () => `${getApiUrl()}/change_email_settings`;\nconst entitlementEnrollment = (uuid) => `${getApiUrl()}/entitlements/v1/entitlements/${uuid}/enrollments`;\n\n// if url is null or absolute, return it as is\nexport const updateUrl = (base, url) => ((url == null || url.startsWith('http://') || url.startsWith('https://')) ? url : `${base}${url}`);\n\nexport const baseAppUrl = (url) => updateUrl(getBaseUrl(), url);\nexport const learningMfeUrl = (url) => updateUrl(getAppConfig(appId).LEARNING_BASE_URL, url);\n\n// static view url\nconst programsUrl = () => baseAppUrl('/dashboard/programs');\n\nexport const creditPurchaseUrl = (courseId) => {\n const config = getAppConfig(appId);\n return config.CREDIT_PURCHASE_URL\n ? `${config.CREDIT_PURCHASE_URL}/${courseId}/`\n : `${config.ECOMMERCE_BASE_URL}/credit/checkout/${courseId}/`;\n};\nexport const creditRequestUrl = (providerId) => `${getApiUrl()}/credit/v1/providers/${providerId}/request/`;\n\nexport default StrictDict({\n getApiUrl,\n baseAppUrl,\n courseUnenroll,\n creditPurchaseUrl,\n creditRequestUrl,\n entitlementEnrollment,\n event,\n getInitApiUrl,\n learningMfeUrl,\n programsUrl,\n updateEmailSettings,\n});\n"]}
1
+ {"version":3,"file":"urls.js","sourceRoot":"","sources":["../../../../src/data/services/lms/urls.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAErE,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,UAAU,CAAC;AAEpD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC,UAAU,MAAM,CAAC,CAAC;AAErE,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAEjE,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,GAAG,UAAU,EAAE,QAAQ,CAAC;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G,SAAS,EAAE,wBAAwB,UAAU,WAAW,CAAC;AAE5G,eAAe,UAAU,CAAC;IACxB,SAAS;IACT,UAAU;IACV,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,qBAAqB;IACrB,KAAK;IACL,aAAa;IACb,WAAW;IACX,mBAAmB;CACpB,CAAC,CAAC","sourcesContent":["import { appId } from '../../../constants';\nimport { StrictDict } from '../../../utils';\n\nimport { getAppConfig, getSiteConfig } from '@openedx/frontend-base';\n\nconst getBaseUrl = () => getSiteConfig().lmsBaseUrl;\n\nexport const getApiUrl = () => (`${getSiteConfig().lmsBaseUrl}/api`);\n\nconst getInitApiUrl = () => (`${getApiUrl()}/learner_home/init`);\n\nconst event = () => `${getBaseUrl()}/event`;\nconst courseUnenroll = () => `${getBaseUrl()}/change_enrollment`;\nconst updateEmailSettings = () => `${getApiUrl()}/change_email_settings`;\nconst entitlementEnrollment = (uuid) => `${getApiUrl()}/entitlements/v1/entitlements/${uuid}/enrollments`;\n\n// if url is null or absolute, return it as is\nexport const updateUrl = (base, url) => ((url == null || url.startsWith('http://') || url.startsWith('https://')) ? url : `${base}${url}`);\n\nexport const baseAppUrl = (url) => updateUrl(getBaseUrl(), url);\n\n// static view url\nconst programsUrl = () => baseAppUrl('/dashboard/programs');\n\n/**\n * Returns the credit purchase URL for a course, or `null` when the site\n * configures neither CREDIT_PURCHASE_URL nor ECOMMERCE_BASE_URL.\n */\nexport const creditPurchaseUrl = (courseId) => {\n const config = getAppConfig(appId);\n if (config.CREDIT_PURCHASE_URL) {\n return `${config.CREDIT_PURCHASE_URL}/${courseId}/`;\n }\n return config.ECOMMERCE_BASE_URL\n ? `${config.ECOMMERCE_BASE_URL}/credit/checkout/${courseId}/`\n : null;\n};\nexport const creditRequestUrl = (providerId) => `${getApiUrl()}/credit/v1/providers/${providerId}/request/`;\n\nexport default StrictDict({\n getApiUrl,\n baseAppUrl,\n courseUnenroll,\n creditPurchaseUrl,\n creditRequestUrl,\n entitlementEnrollment,\n event,\n getInitApiUrl,\n programsUrl,\n updateEmailSettings,\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openedx/frontend-app-learner-dashboard",
3
- "version": "1.0.0",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -85,7 +85,7 @@
85
85
  "turbo": "^2.8.20"
86
86
  },
87
87
  "peerDependencies": {
88
- "@openedx/frontend-base": "^1.0.0 || 0.0.0-dev",
88
+ "@openedx/frontend-base": "^2.0.0-alpha.4 || 0.0.0-dev",
89
89
  "@openedx/paragon": "^23",
90
90
  "@tanstack/react-query": "^5",
91
91
  "@types/react": "^18",