refactor: update the app template for the console
- Update the basic libraries needed for the application - Update README and configuration files - Create the authz folder as the fist module for development
This commit is contained in:
committed by
Adolfo R. Brandes
parent
199a622006
commit
885b408e71
@@ -1,7 +1,7 @@
|
||||
NODE_ENV='development'
|
||||
PORT=8080
|
||||
PORT=2025
|
||||
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
|
||||
BASE_URL='http://localhost:8080'
|
||||
BASE_URL='http://localhost:2025'
|
||||
CREDENTIALS_BASE_URL='http://localhost:18150'
|
||||
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
|
||||
ECOMMERCE_BASE_URL='http://localhost:18130'
|
||||
@@ -19,7 +19,7 @@ REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
|
||||
SEGMENT_KEY=''
|
||||
SITE_NAME=localhost
|
||||
USER_INFO_COOKIE_NAME='edx-user-info'
|
||||
APP_ID=''
|
||||
APP_ID='console'
|
||||
MFE_CONFIG_API_URL=''
|
||||
# Fallback in local style files
|
||||
PARAGON_THEME_URLS={}
|
||||
|
||||
@@ -17,6 +17,6 @@ REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
|
||||
SEGMENT_KEY=''
|
||||
SITE_NAME=localhost
|
||||
USER_INFO_COOKIE_NAME='edx-user-info'
|
||||
APP_ID=''
|
||||
APP_ID='console'
|
||||
MFE_CONFIG_API_URL=''
|
||||
PARAGON_THEME_URLS={}
|
||||
|
||||
@@ -1,265 +0,0 @@
|
||||
frontend-app-[PLACEHOLDER]
|
||||
##########################
|
||||
|
||||
.. note::
|
||||
|
||||
This README is a template. As a maintainer, please review its contents and
|
||||
update all relevant sections. Instructions to you are marked with
|
||||
"[PLACEHOLDER]" or "[TODO]". Update or remove those sections, and remove this
|
||||
note when you are done.
|
||||
|
||||
|license-badge| |status-badge| |ci-badge| |codecov-badge|
|
||||
|
||||
.. |license-badge| image:: https://img.shields.io/github/license/openedx/frontend-app-[PLACEHOLDER].svg
|
||||
:target: https://github.com/openedx/frontend-app-[PLACEHOLDER]/blob/main/LICENSE
|
||||
:alt: License
|
||||
|
||||
.. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
|
||||
|
||||
.. |ci-badge| image:: https://github.com/openedx/frontend-app-[PLACEHOLDER]/actions/workflows/ci.yml/badge.svg
|
||||
:target: https://github.com/openedx/frontend-app-[PLACEHOLDER]/actions/workflows/ci.yml
|
||||
:alt: Continuous Integration
|
||||
|
||||
.. |codecov-badge| image:: https://codecov.io/github/openedx/frontend-app-[PLACEHOLDER]/coverage.svg?branch=main
|
||||
:target: https://codecov.io/github/openedx/frontend-app[PLACEHOLDER]?branch=main
|
||||
:alt: Codecov
|
||||
|
||||
Purpose
|
||||
=======
|
||||
|
||||
.. note::
|
||||
|
||||
[TODO]
|
||||
|
||||
What is this MFE? Add a 2-3 sentence description of what it is and what it
|
||||
does.
|
||||
|
||||
This is the Awesome MFE. It was built to provide an unmatched learning
|
||||
experience, with improved tools for both randomized goodness and the ability to
|
||||
directly reference amaze-blocks in existing courses. This experience is powered
|
||||
by the new Fantastico storage engine.
|
||||
|
||||
Getting Started
|
||||
===============
|
||||
|
||||
Devstack Installation
|
||||
---------------------
|
||||
|
||||
.. note::
|
||||
|
||||
[TODO]
|
||||
|
||||
Describe in detail how this MFE can be installed and set up for development
|
||||
in a devstack. Include as many screenshots as you can to make your guide
|
||||
easier to follow! Use the following steps as an example:
|
||||
|
||||
Follow these steps to provision, run, and enable an instance of the
|
||||
[PLACEHOLDER] MFE for local development via the `devstack`_.
|
||||
|
||||
.. _devstack: https://github.com/openedx/devstack#getting-started
|
||||
|
||||
#. To start, clone the devstack repository as a child of an arbitrary ``~/workspace/`` directory.
|
||||
|
||||
.. code-block::
|
||||
|
||||
mkdir -p ~/workspace/
|
||||
cd ~/workspace/
|
||||
git clone https://github.com/openedx/devstack.git
|
||||
|
||||
#. Configure default services and setup devstack
|
||||
|
||||
Create a ``devstack/options.local.mk`` file with only the services required.
|
||||
Commonly, this will just be the LMS:
|
||||
|
||||
.. code-block::
|
||||
|
||||
DEFAULT_SERVICES ?= \
|
||||
lms
|
||||
|
||||
#. Start the devstack with:
|
||||
|
||||
.. code-block::
|
||||
|
||||
cd devstack
|
||||
make dev.pull
|
||||
make dev.provision
|
||||
make dev.up
|
||||
|
||||
#. In an LMS shell, enable the ``ENABLE_[PLACEHOLDER]_MICROFRONTEND`` feature flag:
|
||||
|
||||
.. code-block::
|
||||
|
||||
make lms-shell
|
||||
vim /edx/etc/lms.yml
|
||||
---
|
||||
FEATURES:
|
||||
ENABLE_[PLACEHOLDER]_MICROFRONTEND: true
|
||||
|
||||
Exit the shell and restart the LMS so changes take effect:
|
||||
|
||||
.. code-block::
|
||||
|
||||
make lms-restart
|
||||
|
||||
#. Create and enable the waffle flag required to redirect users to the MFE,
|
||||
enabling it for everyone:
|
||||
|
||||
.. code-block::
|
||||
|
||||
make lms-shell
|
||||
./manage.py lms waffle_flag --create --everyone [PLACEHOLDER].redirect_to_microfrontend
|
||||
|
||||
#. Start this MFE with:
|
||||
|
||||
.. code-block::
|
||||
|
||||
cd frontend-app-[PLACEHOLDER]
|
||||
nvm use
|
||||
npm ci
|
||||
npm start
|
||||
|
||||
#. Finally, open the MFE in a browser
|
||||
|
||||
Navigate to `http://localhost:8080 <http://localhost:8080>`_ to open the
|
||||
MFE. This is what it should look like if everything worked:
|
||||
|
||||
.. figure:: ./docs/images/template.jpg
|
||||
|
||||
"Polycon marking template" by mangtronix is licensed under CC BY-SA 2.0.
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
.. note::
|
||||
|
||||
[TODO]
|
||||
|
||||
Explicitly list anything that this MFE requires to function correctly. This includes:
|
||||
|
||||
* A list of both required and optional .env variables, and how they each
|
||||
affect the functioning of the MFE
|
||||
|
||||
* A list of edx-platform `feature and waffle flags`_ that are either required
|
||||
to enable use of this MFE, or affect the behavior of the MFE in some other
|
||||
way
|
||||
|
||||
* A list of IDAs or other MFEs that this MFE depends on to function correctly
|
||||
|
||||
.. _feature and waffle flags: https://docs.openedx.org/projects/openedx-proposals/en/latest/best-practices/oep-0017-bp-feature-toggles.html
|
||||
|
||||
Plugins
|
||||
=======
|
||||
This MFE can be customized using `Frontend Plugin Framework <https://github.com/openedx/frontend-plugin-framework>`_.
|
||||
|
||||
The parts of this MFE that can be customized in that manner are documented `here </src/plugin-slots>`_.
|
||||
|
||||
[PLACEHOLDER: Other Relevant Sections]
|
||||
======================================
|
||||
|
||||
.. note::
|
||||
|
||||
[TODO]
|
||||
|
||||
This is optional, but you might have additional sections you wish to cover.
|
||||
For instance, architecture documentation, i18n notes, build process, or
|
||||
more.
|
||||
|
||||
Known Issues
|
||||
============
|
||||
|
||||
.. note::
|
||||
|
||||
[TODO]
|
||||
|
||||
If there are long-standing known issues, list them here as a bulletted list,
|
||||
linking to the actual issues in the Github repository.
|
||||
|
||||
Development Roadmap
|
||||
===================
|
||||
|
||||
.. note::
|
||||
|
||||
[TODO]
|
||||
|
||||
Include a list of current development targets, in (rough) descending order
|
||||
of priority. It can be a simple bulleted list of roadmap items with links
|
||||
to Github issues or wiki pages.
|
||||
|
||||
Getting Help
|
||||
============
|
||||
|
||||
.. note::
|
||||
|
||||
[TODO]
|
||||
|
||||
Use the following as a template, but feel free to add specific places where
|
||||
this MFE is commonly discussed.
|
||||
|
||||
If you're having trouble, we have discussion forums at
|
||||
https://discuss.openedx.org where you can connect with others in the community.
|
||||
|
||||
Our real-time conversations are on Slack. You can request a `Slack
|
||||
invitation`_, then join our `community Slack workspace`_. Because this is a
|
||||
frontend repository, the best place to discuss it would be in the `#wg-frontend
|
||||
channel`_.
|
||||
|
||||
For anything non-trivial, the best path is to open an issue in this repository
|
||||
with as many details about the issue you are facing as you can provide.
|
||||
|
||||
https://github.com/openedx/frontend-app-[PLACEHOLDER]/issues
|
||||
|
||||
For more information about these options, see the `Getting Help`_ page.
|
||||
|
||||
.. _Slack invitation: https://openedx.org/slack
|
||||
.. _community Slack workspace: https://openedx.slack.com/
|
||||
.. _#wg-frontend channel: https://openedx.slack.com/archives/C04BM6YC7A6
|
||||
.. _Getting Help: https://openedx.org/getting-help
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
The code in this repository is licensed under the AGPLv3 unless otherwise
|
||||
noted.
|
||||
|
||||
Please see `LICENSE <LICENSE>`_ for details.
|
||||
|
||||
Contributing
|
||||
============
|
||||
|
||||
.. note::
|
||||
|
||||
[TODO]
|
||||
|
||||
Feel free to add contribution details specific to your repository.
|
||||
|
||||
Contributions are very welcome. Please read `How To Contribute`_ for details.
|
||||
|
||||
.. _How To Contribute: https://openedx.org/r/how-to-contribute
|
||||
|
||||
This project is currently accepting all types of contributions, bug fixes,
|
||||
security fixes, maintenance work, or new features. However, please make sure
|
||||
to have a discussion about your new feature idea with the maintainers prior to
|
||||
beginning development to maximize the chances of your change being accepted.
|
||||
You can start a conversation by creating a new issue on this repo summarizing
|
||||
your idea.
|
||||
|
||||
The Open edX Code of Conduct
|
||||
============================
|
||||
|
||||
All community members are expected to follow the `Open edX Code of Conduct`_.
|
||||
|
||||
.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/
|
||||
|
||||
People
|
||||
======
|
||||
|
||||
The assigned maintainers for this component and other project details may be
|
||||
found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``
|
||||
file in this repo.
|
||||
|
||||
.. _Backstage: https://open-edx-backstage.herokuapp.com/catalog/default/component/frontend-app-[PLACEHOLDER]
|
||||
|
||||
Reporting Security Issues
|
||||
=========================
|
||||
|
||||
Please do not report security issues in public. Email security@openedx.org instead.
|
||||
166
README.rst
166
README.rst
@@ -1,128 +1,54 @@
|
||||
frontend-template-application
|
||||
#############################
|
||||
frontend-app-admin-console
|
||||
##########################
|
||||
|
||||
|license-badge| |status-badge| |ci-badge| |codecov-badge|
|
||||
|
||||
⚠️ Warning ⚠️
|
||||
***************
|
||||
.. |license-badge| image:: https://img.shields.io/github/license/openedx/frontend-app-admin-console.svg
|
||||
:target: https://github.com/openedx/frontend-app-admin-console/blob/main/LICENSE
|
||||
:alt: License
|
||||
|
||||
This template uses a version of Paragon that includes `design tokens <https://github.com/openedx/paragon/?tab=readme-ov-file#design-tokens>`_ support. Support for design tokens is a breaking change, and more information is available in `the DEPR <https://github.com/openedx/brand-openedx/issues/23>`_.
|
||||
.. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
|
||||
|
||||
To use this template with a pre-design-tokens version of Paragon, you can utilize `the release/teak branch <https://github.com/openedx/frontend-template-application/tree/release/teak>`_.
|
||||
.. |ci-badge| image:: https://github.com/openedx/frontend-app-admin-console/actions/workflows/ci.yml/badge.svg
|
||||
:target: https://github.com/openedx/frontend-app-admin-console/actions/workflows/ci.yml
|
||||
:alt: Continuous Integration
|
||||
|
||||
.. |codecov-badge| image:: https://codecov.io/github/openedx/frontend-app-admin-console/coverage.svg?branch=main
|
||||
:target: https://codecov.io/github/openedx/frontend-app-admin-console?branch=main
|
||||
:alt: Codecov
|
||||
|
||||
Purpose
|
||||
*******
|
||||
=======
|
||||
|
||||
This repository is a template for Open edX micro-frontend applications. It is
|
||||
flagged as a Template Repository, meaning it can be used as a basis for new
|
||||
GitHub repositories by clicking the green "Use this template" button above.
|
||||
The rest of this document describes how to work with your new micro-frontend
|
||||
**after you've created a new repository from the template.**
|
||||
The console aims to centralize platform-level settings and administrative tasks—including authorization (AuthZ) and,
|
||||
eventually, other key configurations—into a single, extensible UI. It reduces platform fragmentation and improves
|
||||
administrator efficiency.
|
||||
|
||||
Getting Started
|
||||
***************
|
||||
===============
|
||||
|
||||
After copying the template repository, you'll want to do a find-and-replace to
|
||||
replace all instances of ``frontend-template-application`` with the name of
|
||||
your new repository. Also edit index.html to replace "Application Template"
|
||||
with a friendly name for this application that users will see in their browser
|
||||
tab.
|
||||
It is recomended to use it in a Tutor instalation, for adding the MFE follow the intruction in
|
||||
`Tutor MFE plugin <https://github.com/overhangio/tutor-mfe?tab=readme-ov-file#mfe-management>`_.
|
||||
|
||||
Prerequisites
|
||||
=============
|
||||
Configuration
|
||||
-------------
|
||||
This repository works with `openedx-authz <https://github.com/openedx/openedx-authz>`_
|
||||
|
||||
The `devstack`_ is currently recommended as a development environment for your
|
||||
new MFE. If you start it with ``make dev.up.lms`` that should give you
|
||||
everything you need as a companion to this frontend.
|
||||
Plugins
|
||||
=======
|
||||
This MFE can be customized using `Frontend Plugin Framework <https://github.com/openedx/frontend-plugin-framework>`_.
|
||||
|
||||
Note that it is also possible to use `Tutor`_ to develop an MFE. You can refer
|
||||
to the `relevant tutor-mfe documentation`_ to get started using it.
|
||||
The parts of this MFE that can be customized in that manner are documented `here </src/plugin-slots>`_.
|
||||
|
||||
.. _Devstack: https://github.com/openedx/devstack
|
||||
|
||||
.. _Tutor: https://github.com/overhangio/tutor
|
||||
|
||||
.. _relevant tutor-mfe documentation: https://github.com/overhangio/tutor-mfe#mfe-development
|
||||
|
||||
Cloning and Startup
|
||||
Development Roadmap
|
||||
===================
|
||||
|
||||
In the following steps, replace "[PLACEHOLDER]" with the name of the repo you
|
||||
created when copying this template above.
|
||||
|
||||
1. Clone your new repo:
|
||||
|
||||
``git clone https://github.com/openedx/frontend-app-[PLACEHOLDER].git``
|
||||
|
||||
2. Use node v18.x.
|
||||
|
||||
The current version of the micro-frontend build scripts support node 18.
|
||||
Using other major versions of node *may* work, but this is unsupported. For
|
||||
convenience, this repository includes an .nvmrc file to help in setting the
|
||||
correct node version via `nvm <https://github.com/nvm-sh/nvm>`_.
|
||||
|
||||
3. Install npm dependencies:
|
||||
|
||||
``cd frontend-app-[PLACEHOLDER] && npm install``
|
||||
|
||||
4. Update the application port to use for local development:
|
||||
|
||||
Default port is 8080. If this does not work for you, update the line
|
||||
`PORT=8080` to your port in all .env.* files
|
||||
|
||||
5. Start the dev server:
|
||||
|
||||
``npm start``
|
||||
|
||||
The dev server is running at `http://localhost:8080 <http://localhost:8080>`_
|
||||
or whatever port you setup.
|
||||
|
||||
Making Your New Project's README File
|
||||
=====================================
|
||||
|
||||
Move ``README-template-frontend-app.rst`` to your project's ``README.rst``
|
||||
file. Please fill out all the sections - this helps out all developers
|
||||
understand your MFE, how to install it, and how to use it.
|
||||
|
||||
Developing
|
||||
**********
|
||||
|
||||
This section concerns development of ``frontend-template-application`` itself,
|
||||
not the templated copy.
|
||||
|
||||
It should be noted that one of the goals of this repository is for it to
|
||||
function correctly as an MFE (as in ``npm install && npm start``) even if no
|
||||
modifications are made. This ensures that developers get a *practical* working
|
||||
example, not just a theoretical one.
|
||||
|
||||
This also means, of course, that any committed code should be tested and
|
||||
subject to both CI and branch protection rules.
|
||||
|
||||
Project Structure
|
||||
=================
|
||||
|
||||
The source for this project is organized into nested submodules according to
|
||||
the `Feature-based Application Organization ADR`_.
|
||||
|
||||
.. _Feature-based Application Organization ADR: https://github.com/openedx/frontend-template-application/blob/master/docs/decisions/0002-feature-based-application-organization.rst
|
||||
|
||||
Build Process Notes
|
||||
===================
|
||||
|
||||
**Production Build**
|
||||
|
||||
The production build is created with ``npm run build``.
|
||||
|
||||
Internationalization
|
||||
====================
|
||||
|
||||
Please see refer to the `frontend-platform i18n howto`_ for documentation on
|
||||
internationalization.
|
||||
|
||||
.. _frontend-platform i18n howto: https://github.com/openedx/frontend-platform/blob/master/docs/how_tos/i18n.rst
|
||||
* `Technical Approach: Console MVP (AuthZ-Scoped, Ulmo Release) <https://openedx.atlassian.net/wiki/x/M4B4MgE>`_.
|
||||
* `Administrative Console Long-Term Technical Approach <https://openedx.atlassian.net/wiki/x/AgAwMQE>`_.
|
||||
|
||||
Getting Help
|
||||
************
|
||||
============
|
||||
|
||||
If you're having trouble, we have discussion forums at
|
||||
https://discuss.openedx.org where you can connect with others in the community.
|
||||
@@ -135,7 +61,7 @@ channel`_.
|
||||
For anything non-trivial, the best path is to open an issue in this repository
|
||||
with as many details about the issue you are facing as you can provide.
|
||||
|
||||
https://github.com/openedx/frontend-template-application/issues
|
||||
https://github.com/openedx/frontend-app-[PLACEHOLDER]/issues
|
||||
|
||||
For more information about these options, see the `Getting Help`_ page.
|
||||
|
||||
@@ -145,7 +71,7 @@ For more information about these options, see the `Getting Help`_ page.
|
||||
.. _Getting Help: https://openedx.org/getting-help
|
||||
|
||||
License
|
||||
*******
|
||||
=======
|
||||
|
||||
The code in this repository is licensed under the AGPLv3 unless otherwise
|
||||
noted.
|
||||
@@ -153,7 +79,7 @@ noted.
|
||||
Please see `LICENSE <LICENSE>`_ for details.
|
||||
|
||||
Contributing
|
||||
************
|
||||
============
|
||||
|
||||
Contributions are very welcome. Please read `How To Contribute`_ for details.
|
||||
|
||||
@@ -167,36 +93,22 @@ You can start a conversation by creating a new issue on this repo summarizing
|
||||
your idea.
|
||||
|
||||
The Open edX Code of Conduct
|
||||
****************************
|
||||
============================
|
||||
|
||||
All community members are expected to follow the `Open edX Code of Conduct`_.
|
||||
|
||||
.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/
|
||||
|
||||
People
|
||||
******
|
||||
======
|
||||
|
||||
The assigned maintainers for this component and other project details may be
|
||||
found in `Backstage`_. Backstage pulls this data from the ``catalog-info.yaml``
|
||||
file in this repo.
|
||||
|
||||
.. _Backstage: https://open-edx-backstage.herokuapp.com/catalog/default/component/frontend-template-application
|
||||
.. _Backstage: https://open-edx-backstage.herokuapp.com/catalog/default/component/frontend-app-[PLACEHOLDER]
|
||||
|
||||
Reporting Security Issues
|
||||
*************************
|
||||
=========================
|
||||
|
||||
Please do not report security issues in public, and email security@openedx.org instead.
|
||||
|
||||
.. |license-badge| image:: https://img.shields.io/github/license/openedx/frontend-template-application.svg
|
||||
:target: https://github.com/openedx/frontend-template-application/blob/main/LICENSE
|
||||
:alt: License
|
||||
|
||||
.. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
|
||||
|
||||
.. |ci-badge| image:: https://github.com/openedx/frontend-template-application/actions/workflows/ci.yml/badge.svg
|
||||
:target: https://github.com/openedx/frontend-template-application/actions/workflows/ci.yml
|
||||
:alt: Continuous Integration
|
||||
|
||||
.. |codecov-badge| image:: https://codecov.io/github/openedx/frontend-template-application/coverage.svg?branch=main
|
||||
:target: https://codecov.io/github/openedx/frontend-template-application?branch=main
|
||||
:alt: Codecov
|
||||
Please do not report security issues in public. Email security@openedx.org instead.
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
apiVersion: backstage.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: "frontend-template-application"
|
||||
description: "A template for Open edX micro-frontend applications."
|
||||
name: "frontend-frontend-app-admin-console"
|
||||
description: ""
|
||||
links:
|
||||
- url: "https://github.com/openedx/frontend-template-application/blob/master/README.rst"
|
||||
- url: "https://github.com/openedx/frontend-frontend-app-admin-console/blob/master/README.rst"
|
||||
title: "README"
|
||||
icon: "Article"
|
||||
annotations:
|
||||
@@ -24,5 +24,5 @@ metadata:
|
||||
openedx.org/arch-interest-groups: ""
|
||||
spec:
|
||||
owner: group:committers-frontend
|
||||
type: "library"
|
||||
type: "website"
|
||||
lifecycle: "experimental"
|
||||
|
||||
@@ -4,10 +4,10 @@ module.exports = createConfig('jest', {
|
||||
// setupFilesAfterEnv is used after the jest environment has been loaded. In general this is what you want.
|
||||
// If you want to add config BEFORE jest loads, use setupFiles instead.
|
||||
setupFilesAfterEnv: [
|
||||
'<rootDir>/src/setupTest.js',
|
||||
'<rootDir>/src/setupTest.jsx',
|
||||
],
|
||||
coveragePathIgnorePatterns: [
|
||||
'src/setupTest.js',
|
||||
'src/setupTest.jsx',
|
||||
'src/i18n',
|
||||
],
|
||||
});
|
||||
|
||||
9082
package-lock.json
generated
9082
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
45
package.json
45
package.json
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "@edx/frontend-template-application",
|
||||
"name": "@openedx/frontend-app-admin-console",
|
||||
"version": "0.1.0",
|
||||
"description": "Frontend application template",
|
||||
"description": "Frontend Admin Console",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/openedx/frontend-template-application.git"
|
||||
"url": "git+https://github.com/openedx/frontend-app-admin-console.git"
|
||||
},
|
||||
"browserslist": [
|
||||
"extends @edx/browserslist-config"
|
||||
@@ -17,50 +17,45 @@
|
||||
"snapshot": "fedx-scripts jest --updateSnapshot",
|
||||
"start": "fedx-scripts webpack-dev-server --progress",
|
||||
"start:with-theme": "paragon install-theme && npm start && npm install",
|
||||
"test": "fedx-scripts jest --coverage --passWithNoTests"
|
||||
"dev": "PUBLIC_PATH=/console/ MFE_CONFIG_API_URL='http://localhost:8000/api/mfe_config/v1' fedx-scripts webpack-dev-server --progress --host apps.local.openedx.io",
|
||||
"test": "fedx-scripts jest --coverage --passWithNoTests",
|
||||
"types": "tsc --noEmit"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "npm run lint"
|
||||
}
|
||||
},
|
||||
"author": "edX",
|
||||
"author": "Open edX Community",
|
||||
"license": "AGPL-3.0",
|
||||
"homepage": "https://github.com/openedx/frontend-template-application#readme",
|
||||
"homepage": "https://github.com/openedx/frontend-app-admin-console#readme",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/openedx/frontend-template-application/issues"
|
||||
"url": "https://github.com/openedx/frontend-app-admin-console/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
|
||||
"@openedx/frontend-plugin-framework": "^1.7.0",
|
||||
"@edx/frontend-component-header": "^6.4.0",
|
||||
"@edx/frontend-component-footer": "^14.6.0",
|
||||
"@edx/frontend-platform": "^8.3.0",
|
||||
"@edx/openedx-atlas": "^0.7.0",
|
||||
"@fortawesome/fontawesome-svg-core": "1.2.36",
|
||||
"@fortawesome/free-brands-svg-icons": "5.15.4",
|
||||
"@fortawesome/free-regular-svg-icons": "5.15.4",
|
||||
"@fortawesome/free-solid-svg-icons": "5.15.4",
|
||||
"@fortawesome/react-fontawesome": "0.2.6",
|
||||
"@openedx/paragon": "^23.4.5",
|
||||
"core-js": "3.45.1",
|
||||
"prop-types": "15.8.1",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"react-redux": "7.2.9",
|
||||
"react-router": "6.30.1",
|
||||
"react-router-dom": "6.30.1",
|
||||
"redux": "4.2.1",
|
||||
"regenerator-runtime": "0.14.1"
|
||||
"@tanstack/react-query": "5.89.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-router-dom": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@edx/browserslist-config": "^1.1.1",
|
||||
"@edx/reactifex": "^2.1.1",
|
||||
"@openedx/frontend-build": "14.6.2",
|
||||
"glob": "7.2.3",
|
||||
"husky": "7.0.4",
|
||||
"jest": "30.1.3"
|
||||
"@edx/typescript-config": "1.1.0",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"@testing-library/dom": "^10.4.1",
|
||||
"@testing-library/jest-dom": "^6.6.4",
|
||||
"@testing-library/react": "^16.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
5
src/authz-module/index.tsx
Normal file
5
src/authz-module/index.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
const AuthZModule = () => (
|
||||
<div>AuthZ Module</div>
|
||||
);
|
||||
|
||||
export default AuthZModule;
|
||||
@@ -1,12 +0,0 @@
|
||||
import { Container } from '@openedx/paragon';
|
||||
|
||||
const ExamplePage = () => (
|
||||
<main>
|
||||
<Container className="py-5">
|
||||
<h1>Example Page</h1>
|
||||
<p>Hello world!</p>
|
||||
</Container>
|
||||
</main>
|
||||
);
|
||||
|
||||
export default ExamplePage;
|
||||
@@ -1,5 +0,0 @@
|
||||
describe('example', () => {
|
||||
it('will pass because it is an example', () => {
|
||||
|
||||
});
|
||||
});
|
||||
@@ -1,4 +0,0 @@
|
||||
data folder
|
||||
===========
|
||||
|
||||
This folder is the home for non-component files, such as redux reducers, actions, selectors, API client services, etc. See `Feature-based Application Organization <https://github.com/openedx/frontend-template-application/blob/master/docs/decisions/0002-feature-based-application-organization.rst>`_. for more detail.
|
||||
@@ -1,34 +0,0 @@
|
||||
import 'core-js/stable';
|
||||
import 'regenerator-runtime/runtime';
|
||||
|
||||
import {
|
||||
APP_INIT_ERROR, APP_READY, subscribe, initialize,
|
||||
} from '@edx/frontend-platform';
|
||||
import { AppProvider, ErrorPage } from '@edx/frontend-platform/react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
import Header from '@edx/frontend-component-header';
|
||||
import { FooterSlot } from '@edx/frontend-component-footer';
|
||||
import messages from './i18n';
|
||||
import ExamplePage from './example/ExamplePage';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
subscribe(APP_READY, () => {
|
||||
ReactDOM.render(
|
||||
<AppProvider>
|
||||
<Header />
|
||||
<ExamplePage />
|
||||
<FooterSlot />
|
||||
</AppProvider>,
|
||||
document.getElementById('root'),
|
||||
);
|
||||
});
|
||||
|
||||
subscribe(APP_INIT_ERROR, (error) => {
|
||||
ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));
|
||||
});
|
||||
|
||||
initialize({
|
||||
messages,
|
||||
});
|
||||
@@ -1,6 +1,4 @@
|
||||
@use "@openedx/paragon/styles/css/core/custom-media-breakpoints" as paragonCustomMediaBreakpoints;
|
||||
|
||||
@import './example/index.scss';
|
||||
|
||||
@import "~@edx/frontend-component-header/dist/index";
|
||||
@import "~@edx/frontend-component-footer/dist/footer";
|
||||
|
||||
41
src/index.tsx
Normal file
41
src/index.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import { StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { Route, Routes } from 'react-router-dom';
|
||||
import { AppProvider, ErrorPage } from '@edx/frontend-platform/react';
|
||||
import {
|
||||
APP_INIT_ERROR, APP_READY, subscribe, initialize,
|
||||
} from '@edx/frontend-platform';
|
||||
|
||||
import messages from './i18n';
|
||||
|
||||
import './index.scss';
|
||||
import AuthZModule from 'authz-module';
|
||||
|
||||
subscribe(APP_READY, () => {
|
||||
const root = createRoot(document.getElementById('root') as HTMLElement);
|
||||
|
||||
root.render(
|
||||
<StrictMode>
|
||||
<AppProvider>
|
||||
<Routes>
|
||||
<Route path="/authz/*" element={<AuthZModule />} />
|
||||
</Routes>
|
||||
</ AppProvider>
|
||||
</StrictMode>,
|
||||
);
|
||||
});
|
||||
|
||||
subscribe(APP_INIT_ERROR, (error) => {
|
||||
const root = createRoot(document.getElementById('root') as HTMLElement);
|
||||
|
||||
root.render(
|
||||
<StrictMode>
|
||||
<ErrorPage message={error.message} />
|
||||
</StrictMode>,
|
||||
);
|
||||
});
|
||||
|
||||
initialize({
|
||||
messages,
|
||||
requireAuthenticatedUser: true,
|
||||
});
|
||||
@@ -1,2 +0,0 @@
|
||||
import 'core-js/stable';
|
||||
import 'regenerator-runtime/runtime';
|
||||
10
src/setupTest.jsx
Normal file
10
src/setupTest.jsx
Normal file
@@ -0,0 +1,10 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import '@testing-library/jest-dom';
|
||||
import { render } from '@testing-library/react';
|
||||
import { AppProvider } from '@edx/frontend-platform/react';
|
||||
|
||||
export const renderWrapper = (children) => render(
|
||||
<AppProvider>
|
||||
{children}
|
||||
</AppProvider>,
|
||||
);
|
||||
14
tsconfig.json
Normal file
14
tsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"extends": "@openedx/frontend-build",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"rootDir": ".",
|
||||
"baseUrl": "./src",
|
||||
"paths": {
|
||||
"*": ["*"],
|
||||
"@src/*": ["*"]
|
||||
}
|
||||
},
|
||||
"include": ["*.js", ".eslintrc.js", "src/**/*", "plugins/**/*"],
|
||||
"exclude": ["dist", "node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user