Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

hmcts/rpa-jui-webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT Build Status codecov Codacy Badge Codacy Badge Known Vulnerabilities

sonarcloud sonarcloud sonarcloud sonarcloud sonarcloud sonarcloud sonarcloud sonarcloud sonarcloud sonarcloud

Judicial UI Webapp

This is the Web Application to allow Judicial staff (Judges & Panel Members) to access and work on cases.

Cloning repo

git clone https://github.com/hmcts/rpa-jui-webapp.git
cd rpa-jui-webapp/

Set Environmental Variables

export S2S_SECRET=
export IDAM_SECRET=

Run Local with quick reload for angular

To Run the Angular code

npm install
npm run start:ng

To Run the Node Code

npm install
npm run start:node
# or if you have nodemon
nodemon dev-server.js

Run Local like prod

yarn install
yarn build
yarn start

Run Local with docker

To Run the Angular code with docker

yarn start-dev-docker-proxy;

To Run the Node Code with docker

yarn start-dev-docker-node;

spin up docker

./docker/buildrun-docker-base.sh

setup test idam users

./bin/idam/idam.sh

setup test ccd data (note you need to find your own ccd def file)

./bin/ccd/ccd.sh ~/Downloads/CCD_Definition.xlsx

Run test

lint

 yarn test;
 open ./reports/lint/node/index.html;
 xdg-open ./reports/lint/node/index.html;
 open ./reports/lint/ng/index.html;
 xdg-open ./reports/lint/ng/index.html;

lint (ng Only)

 yarn test:ng;
 open ./reports/lint/ng/index.html;
 xdg-open ./reports/lint/ng/index.html;

lint (Node Only)

 yarn test:node;
 open ./reports/lint/node/index.html;
 xdg-open ./reports/lint/node/index.html;

Unit test

 yarn test;
 open ./reports/tests/unit/node/index.html;
 xdg-open ./reports/tests/unit/node/index.html;
 open ./reports/tests/unit/ng/index.html;
 xdg-open ./reports/tests/unit/ng/index.html;

Unit test (ng Only)

 yarn test:ng;
 open ./reports/tests/unit/ng/index.html;
 xdg-open ./reports/tests/unit/ng/index.html;

Unit test (Node Only)

 yarn test:node;
 open ./reports/tests/unit/node/index.html;
 xdg-open ./reports/tests/unit/node/index.html;

Unit test + coverage

 yarn test:coverage;
 open ./reports/tests/coverage/node/index.html;
 xdg-open ./reports/tests/coverage/node/index.html;
 open ./reports/tests/coverage/ng/index.html;
 xdg-open ./reports/tests/coverage/ng/index.html;

Unit test + coverage (ng Only)

 yarn test:coverage:ng;
 open ./reports/tests/coverage/ng/index.html;
 xdg-open ./reports/tests/coverage/ng/index.html;

Unit test + coverage (Node Only)

 yarn test:coverage:node;
 open ./reports/tests/coverage/node/index.html;
 xdg-open ./reports/tests/coverage/node/index.html;

Functional test

export TEST_EMAIL=;
export TEST_PASSWORD=;
yarn test:functional:local 
open ./reports/tests/functional/index.html;
xdg-open ./reports/tests/functional/index.html;

##Run Mock Server for CCD data for Development

Install JSON Server

npm install -g json-server

Set the environment variable :

Mac :

export JUI_ENV=mock;

Windows:

set JUI_ENV=mock
echo %JUI_ENV%

Run the mock Server

yarn install
yarn start-json-server

This will run a mock server (json-server) on port 3004 and sets the JUI_ENV as mock.

Now, run the below in the terminal and then start running the api (node)

export JUI_ENV=mock; 
yarn build; 
yarn start

Note : Here is the git repo for json-server : https://github.com/typicode/json-server

##Toggling Rotation Button Visibility

Import the rotation button service

import {RotationService} from 'hmcts-em-viewer-ui/viewers/annotation-pdf-viewer/rotation-toolbar/rotation.service';

declare it in the constructor

private rotationService: RotationService

and call the toggleRotation() function

this.rotationService.toggleRotation();