Git Product home page Git Product logo

digital-prison-services's Introduction

Prison Staff Hub UI App

Application can be built with for dev mode

npm install
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 digital-prison-services \
     quay.io/hmpps/digital-prison-services:latest

Run remotely as docker

docker run -p 3000:3000 -d \
     --name digital-prison-services \
     -e API_ENDPOINT_URL=https://prison-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> \
     quay.io/hmpps/digital-prison-services:latest

Cypress integration tests

The integration-tests directory contains a set of Cypress integration tests for the digital-prison-services 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.
  • Neurodivergence accelerated prisons: To restrict access to neurodivergence information to nominated prisons only. This is a temporary measure agreed with stakeholders and to allow third party curiousApi provider time to rethink their API connections threshold. To enable the feature, add prison codes to the environment variable NEURODIVERSITY_ENABLED_PRISONS. For example, to allow access to only Moorland and Bristol: NEURODIVERSITY_ENABLED_PRISONS=MDI,BLI If left blank then all prisons will have access to the neurodivergence information.

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.

Regenerating API typescript types

The types files for apis can be regenerated by first a command like this example for the Curious api:

npx openapi-typescript https://testservices.sequation.net/sequation-virtual-campus2-api/v3/api-docs --output backend/api/curious/types/index.d.ts

.. then formatting using prettier and reincorporating the local changes such as the enums and invalid type names.

digital-prison-services's People

Contributors

ake3mio avatar andrewrlee avatar andymarke avatar bell-pa avatar brightonsbox avatar connormaglynn avatar dependabot[bot] avatar ed209uk avatar gurnankcheema avatar jamesak-oncloud9 avatar jamesgrant-moj avatar jamiedraperuk avatar jsrobertson avatar lbennett-moj avatar mattops avatar mikehalmamoj avatar mjwillis avatar monskapinga avatar natclamp-moj avatar neilmendum avatar petergphillips avatar psoleckimoj avatar renovate[bot] avatar robc24 avatar sp-watson avatar steverendell avatar timoj58 avatar ushkarev avatar whitfield-mj avatar xoen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

digital-prison-services's Issues

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

A branch protection setting is not enabled: codeowners require reviews

Hi there
The default branch protection setting called codeowners require review is not enabled for this repository
This option affects a pull request, i.e a PR will need to be reviewed and approved by a CODEOWNER before it can be merged.
See repository settings/Branches/Branch protection rules
Either add a new Branch protection rule or edit the existing branch protection rule and select the Require review from Code Owners option
Create a .github/CODEOWNERS file
Add a or multiple entries of @ministryofjustice/team_name to the CODEOWNERS file
The team_name shall be a team from within the MoJ teams: https://github.com/orgs/ministryofjustice/teams
See GH Codeowners documentation: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
See the repository standards: https://github.com/ministryofjustice/github-repository-standards
See the report: https://operations-engineering-reports.cloud-platform.service.justice.gov.uk/github_repositories
Please contact Operations Engineering on Slack #ask-operations-engineering, if you need any assistance

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

User access removed, access is now via a team

Hi there

This user had Direct Member access to this repository and access via a team.

Access is now only via a team.

If you have any questions, please post in #ask-operations-engineering on Slack.

This issue can be closed.

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.