Skip to content

Commit 1939336

Browse files
Show imports and exports under ‘Manage data’ section
1 parent f649202 commit 1939336

11 files changed

Lines changed: 94 additions & 15 deletions

File tree

app/controllers/download.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { AcademicYear, DownloadFormat, ProgrammeType } from '../enums.js'
33
import { Download, Programme, Team } from '../models.js'
44

55
export const downloadController = {
6+
list(request, response) {
7+
response.render(`download/list`)
8+
},
9+
610
form(request, response) {
711
const { data } = request.session
812

app/controllers/interchange.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const interchangeController = {
2+
list(request, response) {
3+
response.redirect('/uploads')
4+
}
5+
}

app/locales/en.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,11 @@ export const en = {
712712
}
713713
},
714714
download: {
715+
label: 'Exports',
716+
list: {
717+
label: 'Exports',
718+
title: 'Exports'
719+
},
715720
new: {
716721
label: 'Download vaccination report',
717722
confirm: 'Download vaccination data'
@@ -848,6 +853,14 @@ export const en = {
848853
title: 'Home'
849854
}
850855
},
856+
interchange: {
857+
label: 'Manage data',
858+
list: {
859+
label: 'Manage data',
860+
title: 'Manage data',
861+
description: 'Import and export child and vaccination records'
862+
}
863+
},
851864
notice: {
852865
label: 'Notice',
853866
list: {

app/routes.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { consentRoutes } from './routes/consent.js'
1818
import { defaultBatchRoutes } from './routes/default-batch.js'
1919
import { downloadRoutes } from './routes/download.js'
2020
import { homeRoutes } from './routes/home.js'
21+
import { interchangeRoutes } from './routes/interchange.js'
2122
import { moveRoutes } from './routes/move.js'
2223
import { noticeRoutes } from './routes/notice.js'
2324
import { parentRoutes } from './routes/parent.js'
@@ -45,7 +46,9 @@ router.use(referrer)
4546
router.use('/', homeRoutes)
4647
router.use('/account', accountRoutes)
4748
router.use('/consents', consentRoutes)
49+
router.use('/downloads', downloadRoutes)
4850
router.use('/give-or-refuse-consent', parentRoutes)
51+
router.use('/interchange', interchangeRoutes)
4952
router.use('/moves', moveRoutes)
5053
router.use('/notices', noticeRoutes)
5154
router.use('/teams', teamRoutes)

app/routes/download.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { downloadController as download } from '../controllers/download.js'
44

55
const router = express.Router({ strict: true })
66

7+
router.get('/', download.list)
8+
79
router.get('/new', download.form)
810
router.post('/new', download.create)
911

app/routes/interchange.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import express from 'express'
2+
3+
import { interchangeController as interchange } from '../controllers/interchange.js'
4+
5+
const router = express.Router({ strict: true, mergeParams: true })
6+
7+
router.get('/', interchange.list)
8+
9+
export const interchangeRoutes = router

app/views/_layouts/default.njk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
},
6868
{
6969
classes: 'app-header__navigation-item--with-count',
70-
href: "/uploads",
71-
html: __("upload.list.label"),
72-
active: navigation.activeSection == "uploads"
70+
href: "/interchange",
71+
html: __("interchange.list.label"),
72+
active: navigation.activeSection in ["uploads", "downloads"]
7373
},
7474
{
7575
href: "/reports",

app/views/dashboard.njk

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,30 +65,30 @@
6565
{{ card({
6666
clickable: true,
6767
secondary: true,
68-
heading: __("move.list.title"),
68+
heading: __("consent.list.title"),
6969
headingSize: "xs",
70-
href: "/moves",
71-
description: __("move.list.description")
70+
href: "/consents",
71+
description: __("consent.list.description")
7272
}) }}
7373
</li>
7474
<li class="nhsuk-grid-column-one-third nhsuk-card-group__item">
7575
{{ card({
7676
clickable: true,
7777
secondary: true,
78-
heading: __("consent.list.title"),
78+
heading: __("move.list.title"),
7979
headingSize: "xs",
80-
href: "/consents",
81-
description: __("consent.list.description")
80+
href: "/moves",
81+
description: __("move.list.description")
8282
}) }}
8383
</li>
8484
<li class="nhsuk-grid-column-one-third nhsuk-card-group__item">
8585
{{ card({
8686
clickable: true,
8787
secondary: true,
88-
heading: __("upload.list.title"),
88+
heading: __("interchange.list.title"),
8989
headingSize: "xs",
90-
href: "/uploads",
91-
description: __("upload.list.description")
90+
href: "/interchange",
91+
description: __("interchange.list.description")
9292
}) }}
9393
</li>
9494
<li class="nhsuk-grid-column-one-third nhsuk-card-group__item">

app/views/download/list.njk

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% from "interchange/_navigation.njk" import interchangeNavigation with context %}
2+
3+
{% extends "_layouts/form.njk" %}
4+
5+
{% set gridColumns = "full" %}
6+
{% set hideConfirmButton = true %}
7+
{% set title = __("download.list.title") %}
8+
9+
{% block form %}
10+
{{ super() }}
11+
12+
{{ interchangeNavigation({
13+
view: "downloads"
14+
}) }}
15+
{% endblock %}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{% from "_macros/heading.njk" import appHeading %}
2+
{% from "_macros/secondary-navigation.njk" import appSecondaryNavigation %}
3+
4+
{% macro interchangeNavigation(params) %}
5+
{{ appHeading({
6+
title: __("interchange.list.title")
7+
}) }}
8+
9+
{{ appSecondaryNavigation({
10+
items: [
11+
{
12+
text: __("upload.list.label"),
13+
href: "/uploads",
14+
current: params.view == "uploads"
15+
},
16+
{
17+
text: __("download.list.label"),
18+
href: "/downloads",
19+
current: params.view == "downloads"
20+
}
21+
]
22+
}) }}
23+
24+
<h2 class="nhsuk-heading-m nhsuk-u-visually-hidden">
25+
{{ __(params.view + "list.title") }}
26+
</h2>
27+
{% endmacro %}

0 commit comments

Comments
 (0)