Skip to content

Commit

Permalink
MAP-178 fix dps link in fallback header and css
Browse files Browse the repository at this point in the history
1. reverted css relating to contenr width because the Use of force reports' page needs a greater width to accommodate 4 tabs and a link. Have made the new headers the same width.
2. reverted crossOriginEmbedderPolicy to false as otherwise the date widget will not work. 
3. Defined the digitalPrisonServiceUrldp var in nunjucks setup so that it could be accessed by the fallback header
  • Loading branch information
GurnankCheema committed Sep 28, 2023
1 parent 5c0097e commit ecb5b10
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions assets/sass/application.sass
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ $path: "/assets/images/"
@import 'govuk/all'
@import 'moj/all'

@import './local'
@import './components/header-bar'
@import './components/footer'
@import './components/footer'
@import './local'
3 changes: 2 additions & 1 deletion assets/sass/components/_footer.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.govuk-footer {
min-height: 160px;
}
}

7 changes: 7 additions & 0 deletions assets/sass/local.sass
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
@import "palette"

div.govuk-width-container
max-width: 1170px
margin-top: 15px

.hmpps-header__container
max-width: 1170px

// Task list pattern
.app-task-list
Expand Down
2 changes: 1 addition & 1 deletion server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function createApp(services: Services): Express {

app.use(
helmet({
crossOriginEmbedderPolicy: true,
crossOriginEmbedderPolicy: false,
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
Expand Down
1 change: 0 additions & 1 deletion server/middleware/feComponentsMiddleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Response } from 'express'
import feComponentsMiddleware from './feComponentsMiddleware'
import FeComponentsService from '../services/feComponentsService'
import { Services } from '../services'
import config from '../config'
import logger from '../../log'

jest.mock('../services/feComponentsService')
Expand Down
1 change: 1 addition & 0 deletions server/utils/nunjucksSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default function configureNunjucks(app: Express.Application): nunjucks.En
njkEnv.addGlobal('authUrl', config.apis.oauth2.url)
njkEnv.addGlobal('apiClientId', config.apis.oauth2.apiClientId)
njkEnv.addGlobal('featureFlagOutageBannerEnabled', config.featureFlagOutageBannerEnabled)
njkEnv.addGlobal('digitalPrisonServiceUrl', config.apis.digitalPrisonServiceUrl)

// eslint-disable-next-line default-param-last
njkEnv.addFilter('findError', (array: Error[] = [], formFieldId: string) => {
Expand Down
2 changes: 1 addition & 1 deletion server/views/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<header class="hmpps-header" role="banner">
<div class="hmpps-header__container">
<div class="hmpps-header__title">
<a class="hmpps-header__link hmpps-header__link--no-underline hmpps-header__title__service-name" href="{{ config.apis.digitalPrisonServiceUrl }}">
<a class="hmpps-header__link hmpps-header__link--no-underline hmpps-header__title__service-name" href="{{ digitalPrisonServiceUrl }}">
<svg role="presentation" focusable="false" class="hmpps-header__logo" xmlns="http://www.w3.org/2000/svg" width="41" height="30" viewBox="0 0 41 30">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.54677 9.20065C8.64351 9.65301 9.88802 9.13584 10.3347 8.05183C10.7839 6.97073 10.27 5.71374 9.17342 5.26352C8.09836 4.82212 6.84843 5.34938 6.40124 6.4349C5.95404 7.515 6.47121 8.76014 7.54677 9.20065Z"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.71865 12.0298C3.81564 12.4821 5.0599 11.965 5.50659 10.881C5.9558 9.79984 5.44191 8.54286 4.34529 8.09264C3.27023 7.65124 2.02031 8.17837 1.57311 9.26402C1.12592 10.3441 1.64308 11.5891 2.71865 12.0298Z"/>
Expand Down

0 comments on commit ecb5b10

Please sign in to comment.