Skip to content

Commit

Permalink
Merge branch 'main' into temporary_branch_that_should_not_be_merged
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrlee authored Oct 7, 2024
2 parents fa652d9 + bf88927 commit dd2fe0c
Show file tree
Hide file tree
Showing 9 changed files with 1,056 additions and 1,184 deletions.
1 change: 1 addition & 0 deletions helm_deploy/prisoner-content-hub-frontend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ingress:
prefixes:
- berwyn
- bullingdon
- cardiff
- chelmsford
- cookhamwood
- erlestoke
Expand Down
2,170 changes: 1,009 additions & 1,161 deletions package-lock.json

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@
]
},
"dependencies": {
"@ministryofjustice/frontend": "^2.1.3",
"@sentry/node": "^8.9.2",
"@ministryofjustice/frontend": "^2.2.1",
"@sentry/node": "^8.30.0",
"applicationinsights": "^2.9.5",
"axios": "^1.7.2",
"body-parser": "^1.20.2",
"axios": "^1.7.7",
"body-parser": "^1.20.3",
"bunyan": "^1.8.15",
"bunyan-format": "^0.2.1",
"compression": "^1.7.4",
"cookie-session": "^2.1.0",
"cookies": "^0.9.1",
"date-fns": "^3.6.0",
"date-fns": "^4.1.0",
"dotenv": "^16.4.5",
"drupal-jsonapi-params": "^2.3.1",
"express": "~4.19.2",
"govuk-frontend": "^5.4.0",
"express": "^4.21.0",
"govuk-frontend": "^5.6.0",
"helmet": "^7.1.0",
"jquery": "^3.7.1",
"jsona": "~1.9.7",
Expand All @@ -62,27 +62,27 @@
"passport": "^0.7.0",
"passport-azure-ad-oauth2": "0.0.4",
"ramda": "^0.30.1",
"redis": "^4.6.14",
"redis": "^4.7.0",
"uuid": "^10.0.0",
"video.js": "^8.12.0"
"video.js": "^8.17.4"
},
"devDependencies": {
"@babel/eslint-parser": "^7.24.7",
"@sinonjs/fake-timers": "^11.2.2",
"cheerio": "^1.0.0-rc.12",
"@babel/eslint-parser": "^7.25.1",
"@sinonjs/fake-timers": "^12.0.0",
"cheerio": "^1.0.0",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-cypress": "^3.1.1",
"eslint-plugin-import": "^2.29.1",
"husky": "^9.0.11",
"eslint-plugin-cypress": "^3.5.0",
"eslint-plugin-import": "^2.30.0",
"husky": "^9.1.6",
"jest": "^29.7.0",
"jsdom": "^24.1.0",
"lint-staged": "^15.2.7",
"nock": "^13.5.4",
"nodemon": "^3.1.3",
"prettier": "^3.3.2",
"sass": "^1.77.5",
"jsdom": "^25.0.0",
"lint-staged": "^15.2.10",
"nock": "^13.5.5",
"nodemon": "^3.1.5",
"prettier": "^3.3.3",
"sass": "^1.79.1",
"supertest": "^7.0.0"
}
}
4 changes: 4 additions & 0 deletions server/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ module.exports = {
enabled: true,
features: ['incentives', 'money', 'timetable', 'visits'],
},
cardiff: {
enabled: true,
features: ['adjudications', 'incentives', 'money', 'timetable', 'visits'],
},
chelmsford: {
enabled: true,
features: ['incentives', 'money', 'timetable', 'visits'],
Expand Down
6 changes: 6 additions & 0 deletions server/content/establishmentData.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"youth": false,
"agencyId": "BNI"
},
"2095": {
"name": "cardiff",
"displayName": "HMP Cardiff",
"youth": false,
"agencyId": "CFI"
},
"2001": {
"name": "chelmsford",
"displayName": "HMP Chelmsford",
Expand Down
2 changes: 1 addition & 1 deletion server/repositories/offender.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function offenderRepository(prisonApiHttpClient, incentivesApiHttpClient) {

function getVisitorsFor(prisonerId) {
return prisonApiHttpClient.get(
`${prisonContactRegistryBaseUrl}/prisoners/${prisonerId}/contacts?type=S`,
`${prisonContactRegistryBaseUrl}/prisoners/${prisonerId}/contacts/social`,
);
}

Expand Down
8 changes: 8 additions & 0 deletions server/routes/__tests__/homepage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ const {
const setCurrentUser = require('../../middleware/setCurrentUser');
const retrieveTopicList = require('../../middleware/retrieveTopicList');

const mockCheckFeatureEnabledAtSite = jest.fn();

jest.mock('../../utils', () => ({
...jest.requireActual('../../utils'),
checkFeatureEnabledAtSite: () => mockCheckFeatureEnabledAtSite(),
}));

describe('GET /', () => {
let featuredItem;
let cmsService;
Expand Down Expand Up @@ -225,6 +232,7 @@ describe('GET /', () => {
],
isTomorrow: false,
};
mockCheckFeatureEnabledAtSite.mockReturnValue(true);
});

it('renders the homepage with a search bar', () =>
Expand Down
5 changes: 5 additions & 0 deletions server/routes/homepage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const express = require('express');
const { checkFeatureEnabledAtSite } = require('../utils');

const createHomepageRouter = ({ cmsService, offenderService }) => {
const router = express.Router();
Expand Down Expand Up @@ -57,6 +58,10 @@ const createHomepageRouter = ({ cmsService, offenderService }) => {
largeUpdateTile,
exploreContent,
currentEvents,
displayTimetable: checkFeatureEnabledAtSite(
req.session.establishmentName,
'timetable',
),
});
} catch (error) {
next(error);
Expand Down
2 changes: 1 addition & 1 deletion server/views/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% endblock %}

{% block title %}
{% if establishmentEnabled %}
{% if displayTimetable %}
<div class="govuk-width-container home-navigation govuk-!-margin-top-3">
{{personalScheduleToday({ data: currentEvents, authReturnUrl: returnUrl }, userName if isSignedIn else '')}}
</div>
Expand Down

0 comments on commit dd2fe0c

Please sign in to comment.