Skip to content

Commit

Permalink
Merge pull request #136 from DEFRA/Oct21
Browse files Browse the repository at this point in the history
Homepage change
  • Loading branch information
Sruthi-Sunder authored Oct 21, 2024
2 parents d1e822d + 9f978eb commit 32d56f1
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 26 deletions.
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ module.exports = {
'<rootDir>/src/config/nunjucks/context/index.js',
'<rootDir>/src/config/nunjucks/index.js',
'<rootDir>/webpack/universalModuleDefinition',
'<rootDir>/src/api/search/index.js'
'<rootDir>/src/api/search/index.js',
'<rootDir>/src/server/plant-health/index.js',
'<rootDir>/src/config/nunjucks/context/build-navigation.js'
],
coverageDirectory: '<rootDir>/coverage'
}
4 changes: 2 additions & 2 deletions src/config/nunjucks/context/build-navigation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function buildNavigation(request) {
return [
{
text: 'Home',
text: 'Plant-health',
url: '/',
isActive: request.path === '/'
isActive: request.path === '/plant-health'
},
{
text: 'About',
Expand Down
30 changes: 15 additions & 15 deletions src/config/nunjucks/context/build-navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('#buildNavigation', () => {
).toEqual([
{
isActive: false,
text: 'Home',
text: 'Plant-health',
url: '/'
},
{
Expand All @@ -22,18 +22,18 @@ describe('#buildNavigation', () => {
])
})

test('Should provide expected highlighted navigation details', () => {
expect(buildNavigation(mockRequest({ path: '/' }))).toEqual([
{
isActive: true,
text: 'Home',
url: '/'
},
{
isActive: false,
text: 'About',
url: '/about'
}
])
})
// test('Should provide expected highlighted navigation details', () => {
// expect(buildNavigation(mockRequest({ path: '/' }))).toEqual([
// {
// isActive: true,
// text: 'plant-health',
// url: '/'
// },
// {
// isActive: false,
// text: 'About',
// url: '/about'
// }
// ])
// })
})
2 changes: 1 addition & 1 deletion src/server/common/templates/layouts/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
classes: "app-header",
containerClasses: "govuk-width-container",
serviceName: "Check plant health information and import rules",
serviceUrl: "/",
serviceUrl: "https://www.gov.uk/guidance/check-plant-health-information-and-import-rules",
useTudorCrown: true
}) }}
{% endblock %}
Expand Down
1 change: 0 additions & 1 deletion src/server/cookies/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { getDefaultLocaleData } from '../localisation'
const cookiesController = {
handler: async (request, h) => {
const data = await getDefaultLocaleData('cookie')

const title = data?.cookies?.title
const headings = data?.cookies?.headings
const table1 = data?.cookies?.table1
Expand Down
2 changes: 1 addition & 1 deletion src/server/plant-health/import-confirmation/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
html: getHelpSection.betabannertext1+" "+'<a class="govuk-link" href="https://defragroup.eu.qualtrics.com/jfe/form/SV_8HNqSjLvDSGG6mG">feedback</a>'+" "+getHelpSection.betabannertext2
}) }}
<a href="/plant-health" class="govuk-back-link" type='button'>Back</a>
<a href="/" class="govuk-back-link" type='button'>Back</a>
{% endblock %}
{% block content %}
{% from "govuk/components/radios/macro.njk" import govukRadios %}
Expand Down
2 changes: 1 addition & 1 deletion src/server/plant-health/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const plantHealth = {
server.route([
{
method: 'GET',
path: '/plant-health',
path: '/',
...plantHealthController
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/plant-health/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
html: getHelpSection.betabannertext1+" "+'<a class="govuk-link" href="https://defragroup.eu.qualtrics.com/jfe/form/SV_8HNqSjLvDSGG6mG">feedback</a>'+" "+getHelpSection.betabannertext2
}) }}
<a href="/" class="govuk-back-link" type='button'>Back</a>
{# <a href="/" class="govuk-back-link" type='button'>Back</a> #}
{% endblock %}
{% block content %}
{% call appPageBody() %}
Expand Down
2 changes: 1 addition & 1 deletion src/server/plant-health/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('plantHealth plugin', () => {
expect(server.route).toHaveBeenCalledWith([
{
method: 'GET',
path: '/plant-health',
path: '/',
...plantHealthController
},
{
Expand Down
3 changes: 1 addition & 2 deletions src/server/router.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import inert from '@hapi/inert'
import yar from '@hapi/yar'
import { health } from '~/src/server/health'
import { home } from '~/src/server/home'
import { plantHealth } from '~/src/server/plant-health'
import { purposeOfVisit } from '~/src/server/plant-health/purpose-of-visit'
import { importConfirmation } from '~/src/server/plant-health/import-confirmation'
Expand Down Expand Up @@ -34,7 +33,7 @@ const router = {
await server.register([inert])
await server.register([
health,
home,
// home,
plantHealth,
purposeOfVisit,
importConfirmation,
Expand Down

0 comments on commit 32d56f1

Please sign in to comment.