Skip to content

Commit

Permalink
CDPS-762: switch on establishment roll. Include feature switch (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitfield-mj authored Jun 17, 2024
1 parent f4ccb69 commit b4ba666
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions helm_deploy/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ generic-service:
COMPONENT_API_LATEST: true
COVID_UNITS_ENABLED: false
ACCREDITED_PROGRAMMES_ENABLED: true
ESTABLISHMENT_ROLL_EXCLUDED: ""

generic-prometheus-alerts:
alertSeverity: hmpps-digital-prison-services-non-prod
1 change: 1 addition & 0 deletions helm_deploy/values-preprod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ generic-service:
COMPONENT_API_LATEST: true
COVID_UNITS_ENABLED: false
ACCREDITED_PROGRAMMES_ENABLED: true
ESTABLISHMENT_ROLL_EXCLUDED: ""

allowlist:
sscl-blackpool: 31.121.5.27/32
Expand Down
1 change: 1 addition & 0 deletions helm_deploy/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ generic-service:
COMPONENT_API_LATEST: false
COVID_UNITS_ENABLED: false
ACCREDITED_PROGRAMMES_ENABLED: false
ESTABLISHMENT_ROLL_EXCLUDED: ""

allowlist:
sscl-blackpool: 31.121.5.27/32
Expand Down
3 changes: 3 additions & 0 deletions server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,7 @@ export default {
analytics: {
tagManagerContainerId: get('TAG_MANAGER_CONTAINER_ID', ''),
},
features: {
establishmentRollExcluded: get('ESTABLISHMENT_ROLL_EXCLUDED', '', requiredInProduction),
},
}
2 changes: 2 additions & 0 deletions server/controllers/homepageController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ describe('Homepage Controller', () => {
title: 'Whats new three',
},
],
establishmentRollExcluded: false,
}

describe('With no feComponentsMeta', () => {
Expand Down Expand Up @@ -160,6 +161,7 @@ describe('Homepage Controller', () => {
whatsNewPosts: whatsNewPostsMock,
outageBanner: 'Banner',
userHasPrisonCaseLoad: true,
establishmentRollExcluded: false,
})
})
})
Expand Down
1 change: 1 addition & 0 deletions server/controllers/homepageController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export default class HomepageController {
outageBanner,
userHasPrisonCaseLoad,
showServicesOutage,
establishmentRollExcluded: config.features.establishmentRollExcluded.split(',').includes(activeCaseLoadId),
})
}
}
Expand Down
6 changes: 3 additions & 3 deletions server/views/partials/homepage/today.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
<h3>Current population</h3>
<div class="today-card__count">{{ currentPopulationCount }}</div>
<div class="today-card__link">
<a href="{{ config.serviceUrls.digitalPrisons }}/establishment-roll" class="govuk-link govuk-link--no-visited-state">Establishment roll</a>
<a href="{{ config.serviceUrls.digitalPrisons if establishmentRollExcluded }}/establishment-roll" class="govuk-link govuk-link--no-visited-state">Establishment roll</a>
</div>
</div>
<div class="today-card" data-qa="today-in-card">
<h3>Arrived today</h3>
<div class="today-card__count">{{ inTodayCount }}</div>
<div class="today-card__link">
<a href="{{ config.serviceUrls.digitalPrisons }}/establishment-roll/in-today" class="govuk-link govuk-link--no-visited-state">Arrived today</a>
<a href="{{ config.serviceUrls.digitalPrisons if establishmentRollExcluded }}/establishment-roll/{{ 'in-today' if establishmentRollExcluded else 'arrived-today' }}" class="govuk-link govuk-link--no-visited-state">Arrived today</a>
</div>
</div>
<div class="today-card" data-qa="today-out-card">
<h3>Out today</h3>
<div class="today-card__count">{{ outTodayCount }}</div>
<div class="today-card__link">
<a href="{{ config.serviceUrls.digitalPrisons }}/establishment-roll/out-today" class="govuk-link govuk-link--no-visited-state">People out today</a>
<a href="{{ config.serviceUrls.digitalPrisons if establishmentRollExcluded }}/establishment-roll/out-today" class="govuk-link govuk-link--no-visited-state">People out today</a>
</div>
</div>
</div>
Expand Down

0 comments on commit b4ba666

Please sign in to comment.