Skip to content

os2display/display-admin-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OS2Display Admin

This is an admin for OS2Display. This is based on create-react-app. See https://github.com/os2display/display-docs/blob/main/admin.md for a description of the admin.

Docker development setup

Create public/config file

By default, the api that is requested is located at /api/. This can be configured by:

cp public/example_config.json public/config.json

And modify the entries to suit your setup.

{
  "api": "[WHERE TO FIND THE API]"
}

Create public/access-config file

This file contains the access config. This file is only required if other access setting are required than what is default.

cp public/example-access-config.json public/access-config.json

Up the containers

docker compose up --detach

Install npm packages

docker compose run --rm node yarn install

Note: When to node container is running, the JavaScript is continously being built.

Redux Toolkit

The communication with the API is generated from an OpenAPI specification with Redux Toolkit.

To regenerate (when the API specification has changed):

# Action: Replace api.json with the new api.json OpenAPI specification

# Install and run scripts to generate ned Redux Api slices.
docker compose exec node npm --prefix src/redux/api install
docker compose exec node npm --prefix src/redux/api start

Testing with playwright

We use playwright for testing.

To run playwright tests with docker:

 docker compose run --rm playwright npx playwright test

To test with user interface, up the containers and change the baseUrl in playwright.config.ts, then:

yarn playwright test --ui 

Linting

docker compose run --rm node yarn check-coding-standards
docker compose run --rm node yarn apply-coding-standards