jsdrupal / drupal-admin-ui

This is an admin UI for Drupal, built with JavaScript & React. ⬅️✌️➡️
Other
236 stars 91 forks source link

Drupal Admin UI

Greenkeeper badge

This is an admin UI for Drupal, built with JavaScript and based on create-react-app.

Requirements

Installation

Ensure that you currently have nothing running on port 80 (e.g. a local webserver) or port 3000 (e.g. a local node process). You can run lsof -i :80 -S to see what you currently have running.

git clone git@github.com:jsdrupal/drupal-admin-ui.git
cd drupal-admin-ui
make build
docker-compose up
(open a new terminal)
make install

If this fails and you see Killed from composer, you will need to increase your memory allocation for Docker.

You can run your Drupal commands inside the container (e.g. docker exec -it drupal_admin_ui_drupal drush status). Instead of first entering the container to run commands (with make drupal:cli), you can create an alias to run commands directly in the containers, e.g.

alias admin_ui_drupal='function _admin_ui_drupal() { docker exec -it drupal_admin_ui_drupal $@ };_admin_ui_drupal'
admin_ui_drupal drush status

The Makefile contains several useful commands! e.g. enabling XDebug.

Open the one time login link in your browser to log into Drupal. You will then have the following available:

URL Description
http://127.0.0.1 Regular Drupal installation / JSON API endpoints
http://127.0.0.1/admin/content A page taken over by the new admin UI. This uses the bundled version from packages/admin-ui/build, run yarn workspace admin-ui build in the node container to re-build

Development

yarn workspace @drupal/admin-ui start will start the Webpack dev sever that comes with Create React App.

Testing

We have functional testing with Nightwatch, and component/unit testing with Jest.

When deciding which system to use to add test coverage, the general rule is Nightwatch should be used to test the common path, and Jest can be used for more detailed test coverage. Nightwatch tests will run slower as they simulate clicking around in a real browser.

Nightwatch

React AXE

Due to outstanding performance issues, react-axe is behind a flag. To enable the assessment provided by react-axe, pass an environment variable when starting the application.

REACT_APP_AXE=true yarn workspace @drupal/admin-ui start

Contributing to This Repository

If someone has made a pull request and you would like to add code to their branch, there are a number of ways to move forward. It will be very helpful to get familiar with managing remotes in Git.

See the documentation in packages/extension-points for how this tooling works.