Giter Club home page Giter Club logo

ministryofjustice.prisonstaffhub's Introduction

Prison Staff Hub UI App

Application can be built with for dev mode

npm run compile-sass 
npm run start:dev

The application will automatically pick up front end changes and it will restart if there are any changes in /backend or /views. Other changes will require a manual restart.

Run locally as docker

docker run -p 3000:3000 -d \
     --name prisonstaffhub \
     mojdigitalstudio/prisonstaffhub:latest

Run remotely as docker

docker run -p 3000:3000 -d \
     --name prisonstaffhub \
     -e API_ENDPOINT_URL=https://api-dev.prison.service.justice.gov.uk/ \
     -e OAUTH_ENDPOINT_URL=https://sign-in-dev.hmpps.service.justice.gov.uk/auth/ \
     -e API_GATEWAY_TOKEN=<add here> \
     -e API_CLIENT_SECRET=<add here> \
     -e API_GATEWAY_PRIVATE_KEY=<add here> \
     mojdigitalstudio/prisonstaffhub:latest

Cypress integration tests

The integration-tests directory contains a set of Cypress integration tests for the prisonstaffhub application. These tests use WireMock to stub the application's dependencies on the prisonApi, oauth and whereabouts RESTful APIs.

Running the Cypress tests

You need to fire up the wiremock server first: docker-compose -f docker-compose-test.yaml up

This will give you useful feedback if the app is making requests that you haven't mocked out. You can see the request log at localhost:9191/__admin/requests/ and a JSON representation of the mocks localhost:9191/__admin/mappings.

Starting feature tests node instance

A separate node instance needs to be started for the feature tests. This will run on port 3008 and won't conflict with any of the api services, e.g. prisonApi or oauth. It will also not conflict with the Groovy integration tests.

npm run start-feature --env=cypress.env

Note that the circleci will run start-feature-no-webpack instead, which will rely on a production webpack build rather than using the dev webpack against the assets.

Running the tests

With the UI:

npm run int-test-ui

Just on the command line (any console log outputs will not be visible, they appear in the browser the Cypress UI fires up):

npm run int-test

Useful links

Feature toggles

  • SOC API: This will enable/disable to ability to refer a prisoner to the SOC service and view their SOC profile if already referred. To enable the feature, change the environment variable of SOC_API_ENABLED to true. Any other value will disable the feature.

Phase Name Banner

To show the phase name banner add the environment variable SYSTEM_PHASE=ENV_NAME. This will trigger the banner to become visible showing the given name.

ministryofjustice.prisonstaffhub's People

Contributors

andrewrlee avatar andymarke avatar bell-pa avatar brightonsbox avatar connormaglynn avatar coupey avatar dependabot[bot] avatar dnyanesh-sonwane avatar ed209uk avatar electrified avatar gurnankcheema avatar jamesak-oncloud9 avatar jamiedraperuk avatar jsrobertson avatar lbennett-moj avatar mattops avatar mikehalmamoj avatar mjwillis avatar petergphillips avatar robc24 avatar simonmitchellmoj avatar snyk-bot avatar sp-watson avatar steverendell avatar timharrison-moj avatar whitfield-mj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.