@openedx/frontend-app-authn 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.
Files changed (48) hide show
  1. package/README.rst +304 -108
  2. package/dist/app.js +1 -27
  3. package/dist/app.js.map +1 -1
  4. package/dist/base-container/components/BrandLogo.d.ts +24 -0
  5. package/dist/base-container/components/BrandLogo.js +28 -0
  6. package/dist/base-container/components/BrandLogo.js.map +1 -0
  7. package/dist/base-container/components/default-layout/LargeLayout.js +3 -3
  8. package/dist/base-container/components/default-layout/LargeLayout.js.map +1 -1
  9. package/dist/base-container/components/default-layout/MediumLayout.js +3 -3
  10. package/dist/base-container/components/default-layout/MediumLayout.js.map +1 -1
  11. package/dist/base-container/components/default-layout/SmallLayout.js +3 -3
  12. package/dist/base-container/components/default-layout/SmallLayout.js.map +1 -1
  13. package/dist/base-container/components/image-layout/ExtraSmallLayout.js +4 -3
  14. package/dist/base-container/components/image-layout/ExtraSmallLayout.js.map +1 -1
  15. package/dist/base-container/components/image-layout/LargeLayout.js +4 -3
  16. package/dist/base-container/components/image-layout/LargeLayout.js.map +1 -1
  17. package/dist/base-container/components/image-layout/MediumLayout.js +4 -3
  18. package/dist/base-container/components/image-layout/MediumLayout.js.map +1 -1
  19. package/dist/base-container/components/image-layout/SmallLayout.js +4 -3
  20. package/dist/base-container/components/image-layout/SmallLayout.js.map +1 -1
  21. package/dist/base-container/components/welcome-page-layout/LargeLayout.js +3 -3
  22. package/dist/base-container/components/welcome-page-layout/LargeLayout.js.map +1 -1
  23. package/dist/base-container/components/welcome-page-layout/MediumLayout.js +3 -3
  24. package/dist/base-container/components/welcome-page-layout/MediumLayout.js.map +1 -1
  25. package/dist/base-container/components/welcome-page-layout/SmallLayout.js +3 -3
  26. package/dist/base-container/components/welcome-page-layout/SmallLayout.js.map +1 -1
  27. package/dist/common-components/components/ThirdPartyAuthContext.js.map +1 -1
  28. package/dist/forgot-password/ForgotPasswordAlert.js +5 -1
  29. package/dist/forgot-password/ForgotPasswordAlert.js.map +1 -1
  30. package/dist/forgot-password/ForgotPasswordPage.js +1 -1
  31. package/dist/forgot-password/ForgotPasswordPage.js.map +1 -1
  32. package/dist/forgot-password/data/apiHook.js.map +1 -1
  33. package/dist/login/AccountActivationMessage.js +5 -1
  34. package/dist/login/AccountActivationMessage.js.map +1 -1
  35. package/dist/login/components/LoginContext.js.map +1 -1
  36. package/dist/login/data/apiHook.js.map +1 -1
  37. package/dist/progressive-profiling/ProgressiveProfiling.js +1 -1
  38. package/dist/progressive-profiling/ProgressiveProfiling.js.map +1 -1
  39. package/dist/progressive-profiling/ProgressiveProfilingPageModal.d.ts +3 -1
  40. package/dist/progressive-profiling/ProgressiveProfilingPageModal.js +7 -4
  41. package/dist/progressive-profiling/ProgressiveProfilingPageModal.js.map +1 -1
  42. package/dist/progressive-profiling/components/ProgressiveProfilingContext.js.map +1 -1
  43. package/dist/progressive-profiling/data/apiHook.js.map +1 -1
  44. package/dist/register/components/RegisterContext.js.map +1 -1
  45. package/dist/register/data/apiHook.js.map +1 -1
  46. package/dist/register/types.js.map +1 -1
  47. package/dist/reset-password/data/apiHook.js.map +1 -1
  48. package/package.json +2 -2
package/README.rst CHANGED
@@ -2,153 +2,323 @@
2
2
  frontend-app-authn
3
3
  ##################
4
4
 
5
- |Build Status| |ci-badge| |Codecov| |semantic-release|
5
+ |license-badge| |status-badge| |ci-badge| |codecov-badge| |semantic-release|
6
+
7
+ Authn is a `frontend-base`_ application: a library that plugs into the Open edX
8
+ frontend shell, rather than a standalone micro-frontend bundled with its own
9
+ webpack build.
10
+
11
+ .. _frontend-base: https://github.com/openedx/frontend-base
6
12
 
7
13
  ********
8
14
  Purpose
9
15
  ********
10
16
 
11
- This is a micro-frontend application responsible for the login, registration and password reset functionality.
12
-
13
- **What is the domain of this MFE?**
17
+ This app is responsible for the login, registration and password reset
18
+ functionality, and serves:
14
19
 
15
20
  - Register page
16
-
17
21
  - Login page
18
-
19
22
  - Forgot password page
20
-
21
23
  - Reset password page
22
-
23
24
  - Progressive profiling page
24
25
 
26
+ *********************
27
+ Branches and Releases
28
+ *********************
29
+
30
+ This app is published to NPM by ``semantic-release``, and its branches follow
31
+ `OEP-10 ADR 0002`_:
32
+
33
+ ``master``
34
+ Unstable. Every merge publishes a prerelease on the ``alpha`` dist-tag.
35
+ Breaking changes land here with no DEPR process and no warning, so it is not
36
+ supported in production. All changes, including bug fixes, should target this
37
+ branch first.
38
+
39
+ ``stable``
40
+ Carries the newest stable major and owns the ``latest`` dist-tag. Changes
41
+ arrive here as backports from ``master``, and no breaking change lands after
42
+ publication.
43
+
44
+ ``n.x`` and ``n.m.x``
45
+ Maintenance branches for majors and minors that ``stable`` has moved past.
46
+ Each owns the dist-tag matching its own name, so consumers select a maintained
47
+ line by semver range, e.g. ``"1.x"``.
48
+
49
+ ``stable`` is cut, and ``1.0.0`` is the current stable release. Both
50
+ ``.releaserc`` and the ``Release CI`` workflow know the whole layout, including
51
+ the maintenance branch patterns, so a new line starts publishing as soon as it
52
+ is pushed.
53
+
54
+ This repository is no longer branched or tagged for Open edX releases in its own
55
+ right. It participates by published version instead, per `OEP-10 ADR 0003`_.
56
+
57
+ The micro-frontend this app replaces goes on living on `legacy-mfe`_, which is
58
+ where any further ``release/RELEASENAME`` branches for it are cut, for as long as
59
+ a supported release still ships it. Teak, Ulmo and Verawood all do.
60
+
61
+ .. _OEP-10 ADR 0002: https://docs.openedx.org/projects/openedx-proposals/en/latest/processes/oep-0010/decisions/0002-frontend-stable-branches.html
62
+ .. _OEP-10 ADR 0003: https://docs.openedx.org/projects/openedx-proposals/en/latest/processes/oep-0010/decisions/0003-frontend-release-strategy.html
63
+ .. _legacy-mfe: https://github.com/openedx/frontend-app-authn/tree/legacy-mfe
64
+
25
65
  ***************
26
66
  Getting Started
27
67
  ***************
28
68
 
29
- Installation
30
- ============
69
+ Prerequisites
70
+ =============
31
71
 
32
- `Tutor`_ is currently recommended as a development environment for your new MFE. Please refer to the `relevant tutor-mfe documentation`_ to get started using it.
72
+ A running Open edX instance is needed to serve this app's backend APIs.
73
+ `Tutor`_ in development mode is the usual choice, and ``site.config.dev.tsx``
74
+ already points at its default hostnames.
75
+
76
+ Unlike a micro-frontend, this app is neither built nor served by ``tutor-mfe``.
77
+ The dev server below runs on the host. Note that ``tutor-mfe`` v22 and later do
78
+ ship this app as a frontend-base application for *deployment*, disabled by
79
+ default; see `Frontend apps`_ in its README to enable it.
33
80
 
34
81
  .. _Tutor: https://github.com/overhangio/tutor
35
- .. _relevant tutor-mfe documentation: https://github.com/overhangio/tutor-mfe?tab=readme-ov-file#mfe-development
82
+ .. _Frontend apps: https://github.com/overhangio/tutor-mfe#frontend-apps
83
+
84
+ Cloning and Startup
85
+ ===================
86
+
87
+ 1. Clone the repo:
88
+
89
+ ``git clone https://github.com/openedx/frontend-app-authn.git``
90
+
91
+ 2. Use the version of Node specified in the ``.nvmrc`` file.
36
92
 
37
- Environment Variables/Setup Notes
38
- =================================
93
+ Using other major versions of Node *may* work, but is unsupported. This
94
+ repository includes an ``.nvmrc`` file to help set the correct Node version
95
+ via `nvm <https://github.com/nvm-sh/nvm>`_.
39
96
 
40
- This MFE is configured via environment variables supplied at build time. All micro-frontends have a shared set of required environment variables, as documented in the Open edX Developer Guide under `Required Environment Variables <https://github.com/overhangio/tutor-mfe?tab=readme-ov-file#mfe-development>`__.
97
+ 3. Install npm dependencies:
41
98
 
42
- The authentication micro-frontend also requires the following additional variable:
99
+ ``cd frontend-app-authn && npm install``
43
100
 
44
- .. list-table:: Environment Variables
45
- :widths: 30 50 20
101
+ 4. Start the dev server:
102
+
103
+ ``npm run dev``
104
+
105
+ The dev server defaults to ``PORT=1999 PUBLIC_PATH=/authn`` (set in the ``dev``
106
+ script in ``package.json``) and is available at
107
+ `http://apps.local.openedx.io:1999/authn <http://apps.local.openedx.io:1999/authn>`_.
108
+
109
+ Configuration used by the dev server is defined in ``site.config.dev.tsx`` at
110
+ the repo root.
111
+
112
+ Local Development Against ``frontend-base``
113
+ ===========================================
114
+
115
+ To develop this app and a local checkout of ``frontend-base`` in tandem, use the
116
+ built-in npm workspace support:
117
+
118
+ .. code-block:: sh
119
+
120
+ mkdir -p packages/frontend-base
121
+ sudo mount --bind /path/to/frontend-base packages/frontend-base
122
+ npm install
123
+ npm run dev:packages
124
+
125
+ Bind mounts are used instead of symlinks because Node resolves symlinks to their
126
+ real paths, which breaks hoisted dependency resolution. When you are done,
127
+ unmount with ``sudo umount packages/frontend-base``.
128
+
129
+ Configuration
130
+ =============
131
+
132
+ This app is no longer configured by build-time environment variables.
133
+ ``getAppConfig`` resolves three sources, in order of increasing precedence: the
134
+ app's bundled ``defaultConfig``, the site's ``commonAppConfig``, and the app's
135
+ ``config``. The first is the app author's, at build time; the other two are the
136
+ operator's, the second applying to every app on the site and the third to this
137
+ app alone.
138
+
139
+ Authn bundles three defaults, in ``src/app.ts``:
140
+ ``DISABLE_ENTERPRISE_LOGIN``, ``LOGO_URL`` and ``LOGO_WHITE_URL``. Every other
141
+ field below is supplied by the operator.
142
+
143
+ .. list-table::
144
+ :widths: 30 70
46
145
  :header-rows: 1
47
146
 
48
147
  * - Name
49
148
  - Description / Usage
50
- - Example
51
-
52
- * - ``LOGIN_ISSUE_SUPPORT_LINK``
53
- - The fully-qualified URL to the login issue support page in the target environment.
54
- - ``https://support.example.com``
55
149
 
56
150
  * - ``ACTIVATION_EMAIL_SUPPORT_LINK``
57
- - The fully-qualified URL to the activation email support page in the target environment.
58
- - ``https://support.example.com``
151
+ - Support page linked from the account-activation error message. Unset,
152
+ the message names support as plain text rather than a link.
59
153
 
60
- * - ``PASSWORD_RESET_SUPPORT_LINK``
61
- - The fully-qualified URL to the password reset support page in the target environment.
62
- - ``https://support.example.com``
154
+ * - ``ALLOW_PUBLIC_ACCOUNT_CREATION``
155
+ - Whether visitors may register themselves. Set it to ``false`` to hide
156
+ the registration page and the links to it; visitors may register
157
+ otherwise.
63
158
 
64
159
  * - ``AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK``
65
- - The fully-qualified URL to the progressive profiling support page in the target environment.
66
- - ``https://support.example.com``
160
+ - Support page linked from the progressive-profiling form. Not rendered
161
+ when unset.
67
162
 
68
- * - ``TOS_AND_HONOR_CODE``
69
- - The fully-qualified URL to the Honor code page in the target environment.
70
- - ``https://example.com/honor``
163
+ * - ``BANNER_IMAGE_EXTRA_SMALL``, ``BANNER_IMAGE_SMALL``,
164
+ ``BANNER_IMAGE_MEDIUM``, ``BANNER_IMAGE_LARGE``
165
+ - Banner images for the image layout, one per breakpoint. Where one is
166
+ unset the banner falls back to a flat background. Only used when
167
+ ``ENABLE_IMAGE_LAYOUT`` is on.
71
168
 
72
- * - ``TOS_LINK``
73
- - The fully-qualified URL to the Terms of service page in the target environment.
74
- - ``https://example.com/tos``
75
-
76
- * - ``PRIVACY_POLICY``
77
- - The fully-qualified URL to the Privacy policy page in the target environment.
78
- - ``https://example.com/privacy``
169
+ * - ``DISABLE_ENTERPRISE_LOGIN``
170
+ - Disables the enterprise login flow. Bundled as ``true``; set it to
171
+ ``false`` to offer enterprise login.
79
172
 
80
- * - ``INFO_EMAIL``
81
- - The valid email address for information query regarding the target environment.
82
- - ``info@example.com``
173
+ * - ``ENABLE_AUTO_GENERATED_USERNAME``
174
+ - Generates the username from the registration form rather than asking for
175
+ one.
83
176
 
84
177
  * - ``ENABLE_DYNAMIC_REGISTRATION_FIELDS``
85
- - Enables support for configurable registration fields on the MFE. This flag must be enabled to show any required registration field besides the default fields (name, email, username, password).
86
- - ``true`` | ``''`` (empty strings are falsy)
178
+ - Enables configurable registration fields. Must be enabled to show any
179
+ registration field besides the defaults (name, email, username,
180
+ password).
181
+
182
+ * - ``ENABLE_IMAGE_LAYOUT``
183
+ - Allows images in the base container layout. See `Modifying base
184
+ container <docs/how_tos/modifying_base_container.rst>`_.
87
185
 
88
186
  * - ``ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN``
89
- - Enables support for progressive profiling. If enabled, users are redirected to a second page where data for optional registration fields can be collected.
90
- - ``true`` | ``''`` (empty strings are falsy)
187
+ - Enables progressive profiling. If enabled, users are redirected to a
188
+ second page where data for optional registration fields is collected.
91
189
 
92
- * - ``DISABLE_ENTERPRISE_LOGIN``
93
- - Disables the enterprise login from Authn MFE.
94
- - ``true`` | ``''`` (empty strings are falsy)
190
+ * - ``INFO_EMAIL``
191
+ - Support address offered on the forgot-password page. The sentence
192
+ offering it is omitted when unset.
193
+
194
+ * - ``LOGIN_ISSUE_SUPPORT_LINK``
195
+ - Support page linked from the forgot-password form. Not rendered when
196
+ unset.
95
197
 
96
- * - ``MFE_CONFIG_API_URL``
97
- - Link of the API to get runtime mfe configuration variables from the site configuration or django settings.
98
- - ``/api/v1/mfe_config`` | ``''`` (empty strings are falsy)
198
+ * - ``LOGO_URL``, ``LOGO_WHITE_URL``
199
+ - The site logo, in its regular and light-on-dark forms. Both are bundled
200
+ with the same default frontend-base uses for the shell header.
99
201
 
100
- * - ``APP_ID``
101
- - Name of MFE, this will be used by the API to get runtime configurations for the specific micro frontend. For a frontend repo `frontend-app-appName`, use `appName` as APP_ID.
102
- - ``authn`` | ``''``
202
+ * - ``MARKETING_SITE_BASE_URL``
203
+ - Marketing site the logo links to. The logo renders unlinked when unset.
103
204
 
104
- * - ``ENABLE_IMAGE_LAYOUT``
105
- - Enables the image layout feature within the authn. When set to True, this feature allows the inclusion of images in the base container layout. For more details on configuring this feature, please refer to the `Modifying base container <docs/how_tos/modifying_base_container.rst>`_.
106
- - ``true`` | ``''`` (empty strings are falsy)
205
+ * - ``PASSWORD_RESET_SUPPORT_LINK``
206
+ - Support page linked from the password-reset confirmation. Unset, the
207
+ message names support as plain text rather than a link.
208
+
209
+ * - ``POST_REGISTRATION_REDIRECT_URL``
210
+ - Where to send a user after registration, sent to the host page in the
211
+ embedded-registration flow.
212
+
213
+ * - ``PRIVACY_POLICY``, ``TOS_LINK``, ``TOS_AND_HONOR_CODE``
214
+ - Destinations for the privacy-policy, terms-of-service and honor-code
215
+ links on the registration form. Each falls back to ``#`` when unset, so
216
+ a site collecting agreement to them should set them.
217
+
218
+ * - ``SEARCH_CATALOG_URL``
219
+ - Where to send a learner who finishes progressive profiling with no
220
+ ``nextUrl`` from the backend. Falls back to the site itself.
221
+
222
+ * - ``SESSION_COOKIE_DOMAIN``
223
+ - Domain the cookies this app sets are scoped to. Unset, they are scoped
224
+ to the host that served the page.
225
+
226
+ * - ``SHOW_REGISTRATION_LINKS``
227
+ - Whether to show links to the registration page from the other pages. Set
228
+ it to ``false`` to hide them; they are shown otherwise.
107
229
 
230
+ * - ``USER_RETENTION_COOKIE_NAME``
231
+ - Name of the cookie set on successful registration. No cookie is set when
232
+ unset.
108
233
 
109
- edX-specific Environment Variables
110
- ==================================
234
+ edX-specific Configuration
235
+ ==========================
111
236
 
112
- Furthermore, there are several edX-specific environment variables that enable integrations with closed-source services private to the edX organization, and might be unsupported in Open edX.
237
+ The following key enables an integration with a closed-source service private to
238
+ the edX organization, and might be unsupported in Open edX.
113
239
 
114
- .. list-table:: edX-specific Environment Variables
115
- :widths: 30 50 20
240
+ .. list-table::
241
+ :widths: 30 70
116
242
  :header-rows: 1
117
243
 
118
244
  * - Name
119
245
  - Description / Usage
120
- - Example
121
246
 
122
247
  * - ``MARKETING_EMAILS_OPT_IN``
123
- - Enables support for opting in marketing emails that helps us getting user consent for sending marketing emails.
124
- - ``true`` | ``''`` (empty strings are falsy)
248
+ - Enables opting in to marketing emails, to capture user consent for
249
+ sending them.
125
250
 
126
- For more information see the document: `Micro-frontend applications in Open
127
- edX <https://github.com/overhangio/tutor-mfe?tab=readme-ov-file#mfe-development>`__.
128
251
 
129
- How To Contribute
252
+ *****
253
+ Slots
254
+ *****
255
+
256
+ This app offers slots for operators to customize its pages. See `src/slots/`_
257
+ for the current list and per-slot READMEs with usage examples.
258
+
259
+ .. _src/slots/: ./src/slots/
260
+
261
+ **********
262
+ Developing
263
+ **********
264
+
265
+ Project Structure
130
266
  =================
131
267
 
132
- Contributions are very welcome, and strongly encouraged! We've
133
- put together `some documentation that describes our contribution process <https://docs.openedx.org/en/latest/developers/references/developer_guide/process/index.html>`_.
268
+ The layout follows the standard `frontend-base app layout`_:
269
+
270
+ - ``src/app.ts`` - the app definition imported by ``site.config.*.tsx``.
271
+ - ``src/constants.ts`` - the app's ``appId`` and route role identifiers.
272
+ - ``src/index.ts`` - the package's public exports (this is a library).
273
+ - ``src/routes.jsx`` - the app's react-router routes.
274
+ - ``src/Main.tsx`` - the root component for the app's routes.
275
+ - ``src/provides.ts`` - what the app provides to the shell; here, the roles that
276
+ render its pages chromeless.
277
+ - ``src/slots/`` - the slots this app offers to consumers.
278
+ - ``src/style.scss`` and ``src/sass/`` - app-scoped runtime styles.
279
+
280
+ Everything else under ``src/`` is a feature directory, one per page or shared
281
+ concern, as described in `ADR 0002: feature based application organization
282
+ <docs/decisions/0002-feature-based-application-organization.rst>`_.
283
+
284
+ For more, see the `frontend-base migration how-to`_.
285
+
286
+ .. _frontend-base app layout: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/migrate-frontend-app.md#src-file-structure
287
+ .. _frontend-base migration how-to: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/migrate-frontend-app.md
288
+
289
+ Build Process Notes
290
+ ===================
291
+
292
+ **Library build**
134
293
 
135
- Even though they were written with edx-platform in mind, the guidelines should be followed for Open edX code in general.
294
+ ``npm run build`` compiles the library into ``dist/`` via ``tsc`` and
295
+ ``tsc-alias``, and copies the SCSS across. This is what gets published and
296
+ consumed by sites.
136
297
 
137
- PR description template should be automatically applied if you are sending PR from github interface; otherwise you
138
- can find it it at `PULL_REQUEST_TEMPLATE.md <https://github.com/openedx/frontend-app-authn/blob/master/.github/pull_request_template.md>`_
298
+ **CI build**
139
299
 
140
- This project is currently accepting all types of contributions, bug fixes and security fixes.
300
+ ``npm run build:ci`` runs ``openedx build`` against ``site.config.ci.tsx`` so
301
+ webpack traverses the full app graph. This catches issues, such as broken
302
+ lazy-loaded imports, that ``tsc`` and Jest would not surface.
141
303
 
304
+ Internationalization
305
+ ====================
306
+
307
+ Please refer to the `frontend-base i18n howto`_ for documentation on
308
+ internationalization.
309
+
310
+ .. _frontend-base i18n howto: https://github.com/openedx/frontend-base/blob/main/docs/how_tos/i18n.rst
311
+
312
+ ************
142
313
  Getting Help
143
- ============
314
+ ************
144
315
 
145
316
  If you're having trouble, we have discussion forums at
146
317
  https://discuss.openedx.org where you can connect with others in the community.
147
318
 
148
- Our real-time conversations are on Slack. You can request a `Slack
149
- invitation`_, then join our `community Slack workspace`_. Because this is a
150
- frontend repository, the best place to discuss it would be in the `#wg-frontend
151
- channel`_.
319
+ Our real-time conversations are on Slack. You can request a `Slack invitation`_,
320
+ then join our `community Slack workspace`_. Because this is a frontend
321
+ repository, the best place to discuss it would be in the `#wg-frontend channel`_.
152
322
 
153
323
  For anything non-trivial, the best path is to open an issue in this repository
154
324
  with as many details about the issue you are facing as you can provide.
@@ -160,45 +330,71 @@ For more information about these options, see the `Getting Help`_ page.
160
330
  .. _Slack invitation: https://openedx.org/slack
161
331
  .. _community Slack workspace: https://openedx.slack.com/
162
332
  .. _#wg-frontend channel: https://openedx.slack.com/archives/C04BM6YC7A6
163
- .. _Getting Help: https://openedx.org/community/connect
333
+ .. _Getting Help: https://openedx.org/getting-help
334
+
335
+ *******
336
+ License
337
+ *******
338
+
339
+ The code in this repository is licensed under the AGPLv3 unless otherwise noted.
340
+
341
+ Please see `LICENSE <LICENSE>`_ for details.
342
+
343
+ ************
344
+ Contributing
345
+ ************
346
+
347
+ Contributions are very welcome. Please read `How To Contribute`_ for details.
348
+
349
+ .. _How To Contribute: https://openedx.org/r/how-to-contribute
164
350
 
351
+ This project is currently accepting all types of contributions, bug fixes and
352
+ security fixes.
353
+
354
+ The PR description template should be applied automatically if you open the pull
355
+ request from the GitHub interface; otherwise you can find it at
356
+ `pull_request_template.md <.github/pull_request_template.md>`_.
357
+
358
+ ****************************
165
359
  The Open edX Code of Conduct
166
- ============================
167
- All community members are expected to follow the `Open edX Code of Conduct <https://openedx.org/code-of-conduct/>`_.
360
+ ****************************
361
+
362
+ All community members are expected to follow the `Open edX Code of Conduct`_.
168
363
 
364
+ .. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/
365
+
366
+ ******
169
367
  People
170
- ======
368
+ ******
369
+
171
370
  The assigned maintainers for this component and other project details may be
172
- found in `Backstage <https://backstage.openedx.org/catalog/default/group/2u-infinity>`_. Backstage pulls this data from the ``catalog-info.yaml``
371
+ found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``
173
372
  file in this repo.
174
373
 
175
- Reporting Security Issues
176
- =========================
177
-
178
- Please do not report security issues in public. Please email security@openedx.org.
179
-
180
- Known Issues
181
- ============
374
+ .. _Backstage: https://backstage.openedx.org/catalog/default/component/frontend-app-authn
182
375
 
183
- None
376
+ *************************
377
+ Reporting Security Issues
378
+ *************************
184
379
 
185
- License
186
- =======
380
+ Please do not report security issues in public, and email security@openedx.org
381
+ instead.
187
382
 
188
- The code in this repository is licensed under the GNU Affero General Public License v3.0, unless
189
- otherwise noted.
383
+ .. |license-badge| image:: https://img.shields.io/github/license/openedx/frontend-app-authn.svg
384
+ :target: https://github.com/openedx/frontend-app-authn/blob/master/LICENSE
385
+ :alt: License
190
386
 
191
- Please see `LICENSE <https://github.com/openedx/frontend-app-authn/blob/master/LICENSE>`_ for details.
387
+ .. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
388
+ :alt: Maintained
192
389
 
390
+ .. |ci-badge| image:: https://github.com/openedx/frontend-app-authn/actions/workflows/ci.yml/badge.svg
391
+ :target: https://github.com/openedx/frontend-app-authn/actions/workflows/ci.yml
392
+ :alt: Continuous Integration
193
393
 
194
- ==============================
394
+ .. |codecov-badge| image:: https://codecov.io/github/openedx/frontend-app-authn/coverage.svg?branch=master
395
+ :target: https://codecov.io/github/openedx/frontend-app-authn?branch=master
396
+ :alt: Codecov
195
397
 
196
- .. |Build Status| image:: https://api.travis-ci.com/edx/frontend-app-authn.svg?branch=master
197
- :target: https://travis-ci.com/edx/frontend-app-authn
198
- .. |Codecov| image:: https://img.shields.io/codecov/c/github/edx/frontend-app-authn
199
- :target: https://codecov.io/gh/edx/frontend-app-authn
200
- .. |ci-badge| image:: https://github.com/openedx/edx-developer-docs/actions/workflows/ci.yml/badge.svg
201
- :target: https://github.com/openedx/edx-developer-docs/actions/workflows/ci.yml
202
- :alt: Continuous Integration
203
398
  .. |semantic-release| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
204
- :target: https://github.com/semantic-release/semantic-release
399
+ :target: https://github.com/semantic-release/semantic-release
400
+ :alt: semantic-release
package/dist/app.js CHANGED
@@ -5,36 +5,10 @@ const app = {
5
5
  appId,
6
6
  routes,
7
7
  provides,
8
- config: {
9
- ACTIVATION_EMAIL_SUPPORT_LINK: null,
10
- ALLOW_PUBLIC_ACCOUNT_CREATION: true,
11
- AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK: null,
12
- BANNER_IMAGE_EXTRA_SMALL: '',
13
- BANNER_IMAGE_LARGE: '',
14
- BANNER_IMAGE_MEDIUM: '',
15
- BANNER_IMAGE_SMALL: '',
8
+ defaultConfig: {
16
9
  DISABLE_ENTERPRISE_LOGIN: true,
17
- ENABLE_AUTO_GENERATED_USERNAME: false,
18
- ENABLE_DYNAMIC_REGISTRATION_FIELDS: false,
19
- ENABLE_IMAGE_LAYOUT: false,
20
- ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN: false,
21
- FAVICON_URL: 'https://edx-cdn.org/v3/default/favicon.ico',
22
- INFO_EMAIL: '',
23
- LOGIN_ISSUE_SUPPORT_LINK: null,
24
- LOGO_TRADEMARK_URL: 'https://edx-cdn.org/v3/default/logo-trademark.svg',
25
10
  LOGO_URL: 'https://edx-cdn.org/v3/default/logo.svg',
26
11
  LOGO_WHITE_URL: 'https://edx-cdn.org/v3/default/logo-white.svg',
27
- MARKETING_EMAILS_OPT_IN: '',
28
- MARKETING_SITE_BASE_URL: 'http://local.openedx.io',
29
- PASSWORD_RESET_SUPPORT_LINK: null,
30
- POST_REGISTRATION_REDIRECT_URL: '',
31
- PRIVACY_POLICY: null,
32
- SEARCH_CATALOG_URL: null,
33
- SESSION_COOKIE_DOMAIN: 'local.openedx.io',
34
- SHOW_REGISTRATION_LINKS: true,
35
- TOS_AND_HONOR_CODE: null,
36
- TOS_LINK: null,
37
- USER_RETENTION_COOKIE_NAME: '',
38
12
  },
39
13
  };
40
14
  export default app;
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,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,GAAG,GAAQ;IACf,KAAK;IACL,MAAM;IACN,QAAQ;IACR,MAAM,EAAE;QACN,6BAA6B,EAAE,IAAI;QACnC,6BAA6B,EAAE,IAAI;QACnC,wCAAwC,EAAE,IAAI;QAC9C,wBAAwB,EAAE,EAAE;QAC5B,kBAAkB,EAAE,EAAE;QACtB,mBAAmB,EAAE,EAAE;QACvB,kBAAkB,EAAE,EAAE;QACtB,wBAAwB,EAAE,IAAI;QAC9B,8BAA8B,EAAE,KAAK;QACrC,kCAAkC,EAAE,KAAK;QACzC,mBAAmB,EAAE,KAAK;QAC1B,qCAAqC,EAAE,KAAK;QAC5C,WAAW,EAAE,4CAA4C;QACzD,UAAU,EAAE,EAAE;QACd,wBAAwB,EAAE,IAAI;QAC9B,kBAAkB,EAAE,mDAAmD;QACvE,QAAQ,EAAE,yCAAyC;QACnD,cAAc,EAAE,+CAA+C;QAC/D,uBAAuB,EAAE,EAAE;QAC3B,uBAAuB,EAAE,yBAAyB;QAClD,2BAA2B,EAAE,IAAI;QACjC,8BAA8B,EAAE,EAAE;QAClC,cAAc,EAAE,IAAI;QACpB,kBAAkB,EAAE,IAAI;QACxB,qBAAqB,EAAE,kBAAkB;QACzC,uBAAuB,EAAE,IAAI;QAC7B,kBAAkB,EAAE,IAAI;QACxB,QAAQ,EAAE,IAAI;QACd,0BAA0B,EAAE,EAAE;KAC/B;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { App } from '@openedx/frontend-base';\nimport { appId } from './constants';\nimport provides from './provides';\nimport routes from './routes';\n\nconst app: App = {\n appId,\n routes,\n provides,\n config: {\n ACTIVATION_EMAIL_SUPPORT_LINK: null,\n ALLOW_PUBLIC_ACCOUNT_CREATION: true,\n AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK: null,\n BANNER_IMAGE_EXTRA_SMALL: '',\n BANNER_IMAGE_LARGE: '',\n BANNER_IMAGE_MEDIUM: '',\n BANNER_IMAGE_SMALL: '',\n DISABLE_ENTERPRISE_LOGIN: true,\n ENABLE_AUTO_GENERATED_USERNAME: false,\n ENABLE_DYNAMIC_REGISTRATION_FIELDS: false,\n ENABLE_IMAGE_LAYOUT: false,\n ENABLE_PROGRESSIVE_PROFILING_ON_AUTHN: false,\n FAVICON_URL: 'https://edx-cdn.org/v3/default/favicon.ico',\n INFO_EMAIL: '',\n LOGIN_ISSUE_SUPPORT_LINK: null,\n LOGO_TRADEMARK_URL: 'https://edx-cdn.org/v3/default/logo-trademark.svg',\n LOGO_URL: 'https://edx-cdn.org/v3/default/logo.svg',\n LOGO_WHITE_URL: 'https://edx-cdn.org/v3/default/logo-white.svg',\n MARKETING_EMAILS_OPT_IN: '',\n MARKETING_SITE_BASE_URL: 'http://local.openedx.io',\n PASSWORD_RESET_SUPPORT_LINK: null,\n POST_REGISTRATION_REDIRECT_URL: '',\n PRIVACY_POLICY: null,\n SEARCH_CATALOG_URL: null,\n SESSION_COOKIE_DOMAIN: 'local.openedx.io',\n SHOW_REGISTRATION_LINKS: true,\n TOS_AND_HONOR_CODE: null,\n TOS_LINK: null,\n USER_RETENTION_COOKIE_NAME: '',\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,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,GAAG,GAAQ;IACf,KAAK;IACL,MAAM;IACN,QAAQ;IACR,aAAa,EAAE;QACb,wBAAwB,EAAE,IAAI;QAC9B,QAAQ,EAAE,yCAAyC;QACnD,cAAc,EAAE,+CAA+C;KAChE;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { App } from '@openedx/frontend-base';\nimport { appId } from './constants';\nimport provides from './provides';\nimport routes from './routes';\n\nconst app: App = {\n appId,\n routes,\n provides,\n defaultConfig: {\n DISABLE_ENTERPRISE_LOGIN: true,\n LOGO_URL: 'https://edx-cdn.org/v3/default/logo.svg',\n LOGO_WHITE_URL: 'https://edx-cdn.org/v3/default/logo-white.svg',\n },\n};\n\nexport default app;\n"]}
@@ -0,0 +1,24 @@
1
+ export default BrandLogo;
2
+ /**
3
+ * The site logo, linked to the marketing site when the operator has configured one.
4
+ *
5
+ * `MARKETING_SITE_BASE_URL` has no default that could work for every site, so when it is
6
+ * unset the logo renders on its own rather than as a link to nowhere.
7
+ */
8
+ declare function BrandLogo({ className, variant }: {
9
+ className: any;
10
+ variant: any;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ declare namespace BrandLogo {
13
+ namespace defaultProps {
14
+ let className: null;
15
+ let variant: string;
16
+ }
17
+ namespace propTypes {
18
+ let className_1: PropTypes.Requireable<string>;
19
+ export { className_1 as className };
20
+ let variant_1: PropTypes.Requireable<string>;
21
+ export { variant_1 as variant };
22
+ }
23
+ }
24
+ import PropTypes from 'prop-types';
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getSiteConfig, useAppConfig } from '@openedx/frontend-base';
3
+ import { Hyperlink, Image } from '@openedx/paragon';
4
+ import PropTypes from 'prop-types';
5
+ /**
6
+ * The site logo, linked to the marketing site when the operator has configured one.
7
+ *
8
+ * `MARKETING_SITE_BASE_URL` has no default that could work for every site, so when it is
9
+ * unset the logo renders on its own rather than as a link to nowhere.
10
+ */
11
+ const BrandLogo = ({ className, variant }) => {
12
+ const { LOGO_URL, LOGO_WHITE_URL, MARKETING_SITE_BASE_URL } = useAppConfig();
13
+ const image = (_jsx(Image, { className: className, alt: getSiteConfig().siteName, src: variant === 'white' ? LOGO_WHITE_URL : LOGO_URL }));
14
+ if (!MARKETING_SITE_BASE_URL) {
15
+ return image;
16
+ }
17
+ return (_jsx(Hyperlink, { destination: MARKETING_SITE_BASE_URL, children: image }));
18
+ };
19
+ BrandLogo.defaultProps = {
20
+ className: null,
21
+ variant: 'white',
22
+ };
23
+ BrandLogo.propTypes = {
24
+ className: PropTypes.string,
25
+ variant: PropTypes.oneOf(['white', 'default']),
26
+ };
27
+ export default BrandLogo;
28
+ //# sourceMappingURL=BrandLogo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrandLogo.js","sourceRoot":"","sources":["../../../src/base-container/components/BrandLogo.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,SAAS,GAAG,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;IAC3C,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,uBAAuB,EAAE,GAAG,YAAY,EAAE,CAAC;IAC7E,MAAM,KAAK,GAAG,CACZ,KAAC,KAAK,IACJ,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,aAAa,EAAE,CAAC,QAAQ,EAC7B,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,GACpD,CACH,CAAC;IAEF,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,CACL,KAAC,SAAS,IAAC,WAAW,EAAE,uBAAuB,YAC5C,KAAK,GACI,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,CAAC,YAAY,GAAG;IACvB,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF,SAAS,CAAC,SAAS,GAAG;IACpB,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;CAC/C,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { getSiteConfig, useAppConfig } from '@openedx/frontend-base';\nimport { Hyperlink, Image } from '@openedx/paragon';\nimport PropTypes from 'prop-types';\n\n/**\n * The site logo, linked to the marketing site when the operator has configured one.\n *\n * `MARKETING_SITE_BASE_URL` has no default that could work for every site, so when it is\n * unset the logo renders on its own rather than as a link to nowhere.\n */\nconst BrandLogo = ({ className, variant }) => {\n const { LOGO_URL, LOGO_WHITE_URL, MARKETING_SITE_BASE_URL } = useAppConfig();\n const image = (\n <Image\n className={className}\n alt={getSiteConfig().siteName}\n src={variant === 'white' ? LOGO_WHITE_URL : LOGO_URL}\n />\n );\n\n if (!MARKETING_SITE_BASE_URL) {\n return image;\n }\n\n return (\n <Hyperlink destination={MARKETING_SITE_BASE_URL}>\n {image}\n </Hyperlink>\n );\n};\n\nBrandLogo.defaultProps = {\n className: null,\n variant: 'white',\n};\n\nBrandLogo.propTypes = {\n className: PropTypes.string,\n variant: PropTypes.oneOf(['white', 'default']),\n};\n\nexport default BrandLogo;\n"]}
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useAppConfig, getSiteConfig, useIntl } from '@openedx/frontend-base';
3
- import { Hyperlink, Image } from '@openedx/paragon';
2
+ import { getSiteConfig, useIntl } from '@openedx/frontend-base';
4
3
  import classNames from 'classnames';
4
+ import BrandLogo from '../BrandLogo';
5
5
  import messages from './messages';
6
6
  const LargeLayout = () => {
7
7
  const { formatMessage } = useIntl();
8
- return (_jsxs("div", { className: "w-50 d-flex", children: [_jsxs("div", { className: "col-md-9 bg-primary-400", children: [_jsx(Hyperlink, { destination: useAppConfig().MARKETING_SITE_BASE_URL, children: _jsx(Image, { className: "logo position-absolute", alt: getSiteConfig().siteName, src: useAppConfig().LOGO_WHITE_URL }) }), _jsxs("div", { className: "min-vh-100 d-flex align-items-center", children: [_jsx("div", { className: classNames({ 'large-yellow-line mr-n4.5': getSiteConfig().siteName === 'edX' }) }), _jsxs("h1", { className: classNames('display-2 text-white mw-xs', { 'ml-6': getSiteConfig().siteName !== 'edX' }), children: [formatMessage(messages['start.learning']), _jsx("div", { className: "text-accent-a", children: formatMessage(messages['with.site.name'], { siteName: getSiteConfig().siteName }) })] })] })] }), _jsx("div", { className: "col-md-3 bg-white p-0", children: _jsx("svg", { className: "ml-n1 w-100 h-100 large-screen-svg-primary", preserveAspectRatio: "xMaxYMin meet", children: _jsx("g", { transform: "skewX(171.6)", children: _jsx("rect", { x: "0", y: "0", height: "100%", width: "100%" }) }) }) })] }));
8
+ return (_jsxs("div", { className: "w-50 d-flex", children: [_jsxs("div", { className: "col-md-9 bg-primary-400", children: [_jsx(BrandLogo, { className: "logo position-absolute" }), _jsxs("div", { className: "min-vh-100 d-flex align-items-center", children: [_jsx("div", { className: classNames({ 'large-yellow-line mr-n4.5': getSiteConfig().siteName === 'edX' }) }), _jsxs("h1", { className: classNames('display-2 text-white mw-xs', { 'ml-6': getSiteConfig().siteName !== 'edX' }), children: [formatMessage(messages['start.learning']), _jsx("div", { className: "text-accent-a", children: formatMessage(messages['with.site.name'], { siteName: getSiteConfig().siteName }) })] })] })] }), _jsx("div", { className: "col-md-3 bg-white p-0", children: _jsx("svg", { className: "ml-n1 w-100 h-100 large-screen-svg-primary", preserveAspectRatio: "xMaxYMin meet", children: _jsx("g", { transform: "skewX(171.6)", children: _jsx("rect", { x: "0", y: "0", height: "100%", width: "100%" }) }) }) })] }));
9
9
  };
10
10
  export default LargeLayout;
11
11
  //# sourceMappingURL=LargeLayout.js.map