fxa/packages/fxa-admin-panel
dependabot[bot] a908cb5956
chore(deps): bump react-router-dom from 6.19.0 to 6.22.1
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.19.0 to 6.22.1.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/react-router-dom@6.22.1/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.22.1/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-23 14:16:37 +00:00
..
constants refactor(ts(x),css): Admin panel component restructure and cleanup 2022-11-07 10:48:44 -06:00
interfaces feat(sentry): Add AppErrorBoundary to admin-panel and enable Sentry 2022-09-14 11:41:49 -05:00
public task(many): Update favicons 2023-10-13 17:27:14 -07:00
scripts task(CI): Improve nx caching for CI pipelines 2023-08-29 11:19:54 -07:00
server task(all): Add support for sentry performance monitoring 2023-12-19 16:05:05 -08:00
src task(all): Add support for sentry performance monitoring 2023-12-19 16:05:05 -08:00
.eslintrc.json task(many): Enable eslint and fix linting errors 2023-04-13 14:19:17 -07:00
.nsprc feat(admin-panel): Add base fxa-admin-panel package (client) shell 2020-03-05 08:47:17 -06:00
.prettierignore feat(admin-panel): Add base fxa-admin-panel package (client) shell 2020-03-05 08:47:17 -06:00
.rescriptsrc.js feat(libs): move fxa-shared/l10n to libs/shared/l10n 2023-10-04 16:08:01 -04:00
README.md task(all): Remove ':' characters from npm targets 2023-03-29 17:15:51 -07:00
backstage.yaml fix(backstage): use api ref now that its allowed 2024-01-25 08:53:42 -08:00
package.json chore(deps): bump react-router-dom from 6.19.0 to 6.22.1 2024-02-23 14:16:37 +00:00
pm2.config.js task(gql-api): Allowlist graphql queries 2023-07-18 05:54:28 -07:00
postcss.config.js chore(copyright): Add missing copyright headers to fxa-admin-panel 2023-05-02 15:13:44 -07:00
tailwind.config.js chore(deps): Upgrade tailwindcss (v1.9 to v3), autoprefixer, & all SB deps, replace postcss deps, remove other deps 2022-06-30 16:51:57 -05:00
tsconfig.json feat: add foundational db classes 2023-07-24 14:44:12 -04:00

README.md

Firefox Accounts Admin Panel

The FxA Admin Panel is an internal resource for FxA Admins to access a set of convenience tools.

Outside of local development, this application is protected by SSO, a VPN connection, and "guest list" login wall to ensure those without administrator privileges cannot access the service.

Development

  • yarn start|stop|restart to start, stop, and restart the server as a PM2 process
  • yarn build to create a production build
  • yarn test to run unit tests

Getting Started

This service will automatically spin up when yarn start is ran from the root directory. A small Express server serves a React application and exposes the server config file for the client to consume via a meta tag.

The React dev server runs at localhost:8092 which can be useful when building components if you'd like an auto page refresh on file changes, however, the Express server that serves the React application and proxies its static resources runs at localhost:8091. Develop on :8091 if you need access to anything set in the server configuration file, including the URI for connecting to the fxa-admin-server.

API calls are done through Apollo Client with GraphQL to communicate with the fxa-admin-server. See its documentation to connect to the playground, a place to view the API docs and schema, and to write and test queries and mutations before using them in a component.

With the addition of subscriptions, running the Admin Panel now requires secrets to be set up in fxa-admin-server.

Option A: Set up Stripe Test Key

As documented in the Subscription Platform documentation:

If you're a Mozilla employee, you can request access to the Stripe dev (and/or stage) account, created for the FxA Subscription Platform team to easily connect with fake products and plans. Otherwise, you can create your own Stripe account to use for testing that is not linked to any bank account information with your own products and plans. These keys should be taken from Stripe's test environment which you can verify by checking that the key includes the word test.

Once you have a test key, replace the example key sk-test_123 in packages/fxa-admin-server/src/config/development.json

"stripeApiKey": "sk-test_123"

You may need to restart the service after replacing the key.

Option B: Set stripe featureFlag to false

In packages/fxa-admin-server/src/config/development.json, set the feature flag for Stripe to false, then restart the service.

External imports

You can import React components from other packages into this project. This is currently restricted to fxa-react:

// e.g. assuming the component HelloWorld exists
import HelloWorld from 'fxa-react/components/HelloWorld';

See the fxa-react section of the fxa-settings docs for more info on sharing or moving components into this package.

Testing

This package uses Jest to test both the frontend and server. By default yarn test will run all test scripts:

  • yarn test-frontend will test the React App frontend under src/
  • yarn test-server will test the Express server under server/

Test specific tests with the following commands:

# Test frontend tests for the component AccountSearch
yarn test-frontend AccountSearch

# Grep frontend tests for "displays the error"
yarn test-frontend -t "displays the error"

# Test server tests for the file server/lib/csp
yarn test-server server/lib/csp

# Grep server tests for "simple server routes"
yarn test-server -t "simple server routes"

Refer to Jest's CLI documentation for more advanced test configuration.

License

MPL-2.0