From 2a8c48a18445588dcfbbdaa02ab2b52cebc2a658 Mon Sep 17 00:00:00 2001 From: Caitlin Roach Date: Tue, 16 Jun 2026 16:14:41 +0100 Subject: [PATCH 1/6] Add empty state for no pharmacies --- app/routes/prototype-admin.js | 14 +++ .../includes/_preset-scenarios-table.html | 8 ++ app/views/pharmacies/index.html | 116 +++++++++--------- 3 files changed, 81 insertions(+), 57 deletions(-) diff --git a/app/routes/prototype-admin.js b/app/routes/prototype-admin.js index b2401748..2bd6777f 100644 --- a/app/routes/prototype-admin.js +++ b/app/routes/prototype-admin.js @@ -564,6 +564,20 @@ module.exports = (router) => { res.redirect('/home') }) + // ---------------------------------------------------------------- + // Preset: Pharmacy HQ, no data (Amanda White, P15951) + // ---------------------------------------------------------------- + + router.get('/prototype-setup/preset/pharmacy-hq-no-data', (req, res) => { + resetSession(req) + const data = req.session.data + data.currentUserId = '6424325235325' + data.currentOrganisationId = 'P15951' + // Remove all pharmacies belonging to P15951 to start with a clean slate + data.organisations = data.organisations.filter(org => org.companyId !== 'P15951' || org.type === 'Pharmacy HQ') + res.redirect('/home') + }) + // ---------------------------------------------------------------- // Preset: Recorder, single organisation (Ocean Merritt, FR4V56) // ---------------------------------------------------------------- diff --git a/app/views/includes/_preset-scenarios-table.html b/app/views/includes/_preset-scenarios-table.html index 3d9bd63b..05a98cf7 100644 --- a/app/views/includes/_preset-scenarios-table.html +++ b/app/views/includes/_preset-scenarios-table.html @@ -71,6 +71,14 @@ role: "Group administrator", scenarioDetails: "Group admin for a large pharmacy chain (same-name pharmacies)." }, + { + presetLabel: "Group admin, pharmacy HQ (no data)", + presetPath: "/prototype-setup/preset/pharmacy-hq-no-data", + userName: "Amanda White", + userEmail: "amanda.white@nhs.net", + role: "Group administrator", + scenarioDetails: "Group admin for a pharmacy HQ with no pre-loaded data, pharmacies or users." + }, { presetLabel: "Regional lead", presetPath: "/prototype-setup/preset/regions", diff --git a/app/views/pharmacies/index.html b/app/views/pharmacies/index.html index b033a9bf..ac9ab6ff 100644 --- a/app/views/pharmacies/index.html +++ b/app/views/pharmacies/index.html @@ -43,65 +43,67 @@

Pharmacies

href: "/pharmacies/select" }) }} - - -
Pharmacies added ({{ organisations | length }})
- {% if (organisations | length) > 10 %} -
- - -
- {% endif %} - - - - - - - - - - - - {% for organisation in organisations %} - - - - - - + {% if (organisations | length) > 0 %} +
- Name - - Vaccines - - Users - - Status - - Actions -
- {{ organisation.name }} ({{ organisation.id}}) - - {% set vaccinesEnabled = [] %} - {% for vaccine in organisation.vaccines %} - {% if vaccine.status == "enabled" %} - {% set vaccinesEnabled = (vaccinesEnabled.push(vaccine.name), vaccinesEnabled) %} - {% endif %} - {% endfor %} - - {{ (vaccinesEnabled | sort | join(", ")) | capitaliseFirstLetter }} - - {{ organisationUserCounts[organisation.id] }} - - {{ organisation.status }} - - Manage -
+ +
Pharmacies added ({{ organisations | length }})
+ {% if (organisations | length) > 10 %} +
+ + +
+ {% endif %} + + + + + + + + - {% endfor %} + + + {% for organisation in organisations %} + + + + + + + + {% endfor %} - -
+ Name + + Vaccines + + Users + + Status + + Actions +
+ {{ organisation.name }} ({{ organisation.id}}) + + {% set vaccinesEnabled = [] %} + {% for vaccine in organisation.vaccines %} + {% if vaccine.status == "enabled" %} + {% set vaccinesEnabled = (vaccinesEnabled.push(vaccine.name), vaccinesEnabled) %} + {% endif %} + {% endfor %} + + {{ (vaccinesEnabled | sort | join(", ")) | capitaliseFirstLetter }} + + {{ organisationUserCounts[organisation.id] }} + + {{ organisation.status }} + + Manage +
+ + + {% endif %} {% if closedOrganisations.length > 0 %}
From 1fdb00594726693533fd8b568a5ff5481e770a05 Mon Sep 17 00:00:00 2001 From: Caitlin Roach Date: Thu, 2 Jul 2026 16:16:59 +0100 Subject: [PATCH 2/6] Nav item rename and reorder --- app/views/home/index.html | 4 +-- app/views/includes/header.html | 66 +++++++++++++++++----------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/app/views/home/index.html b/app/views/home/index.html index e79c5f45..a4715310 100644 --- a/app/views/home/index.html +++ b/app/views/home/index.html @@ -1,9 +1,9 @@ {% extends 'layout.html' %} {% if currentOrganisation %} - {% set pageName = currentOrganisation.name + " - Home" %} + {% set pageName = currentOrganisation.name + " - Dashboard" %} {% else %} - {% set pageName = "Home" %} + {% set pageName = "Dashboard" %} {% endif %} {% set currentSection = "home" %} diff --git a/app/views/includes/header.html b/app/views/includes/header.html index 72ce5266..602369bb 100644 --- a/app/views/includes/header.html +++ b/app/views/includes/header.html @@ -4,30 +4,7 @@ {% if currentUser and not (currentOrganisation.type === "Region") %} - - {% set navigationItems = (navigationItems.push({ - href: "/home/", - text: "Home", - active: (currentSection == "home") - }), navigationItems) %} - - - {% if currentOrganisation.type === "Pharmacy HQ" %} - {% set navigationItems = (navigationItems.push({ - href: "/pharmacies", - text: "Pharmacies", - active: (currentSection == "pharmacies") - }), navigationItems) %} - - {% set navigationItems = (navigationItems.push({ - href: "/pharmacies/users", - text: "Users", - active: (currentSection == "pharmacies-users") - }), navigationItems) %} - - {% endif %} - - + {% if currentOrganisation and (currentOrganisation.type != "Pharmacy HQ") and (currentOrganisation.appointmentsInterfaceEnabled !== false) %} {% set navigationItems = (navigationItems.push({ href: "/appointments", @@ -36,6 +13,7 @@ }), navigationItems) %} {% endif %} + {% if currentOrganisation and (currentOrganisation.type != "Pharmacy HQ") %} {% set navigationItems = (navigationItems.push({ href: "/record-vaccinations", @@ -44,16 +22,29 @@ }), navigationItems) %} {% endif %} - - {% if (["Lead administrator", "Administrator"] | arrayOrStringIncludes(organisationSetting.permissionLevel)) %} + + {% set navigationItems = (navigationItems.push({ + href: "/home/", + text: "Dashboard", + active: (currentSection == "home") + }), navigationItems) %} + + + {% if currentOrganisation.type === "Pharmacy HQ" %} {% set navigationItems = (navigationItems.push({ - href: "/vaccines", - text: "Vaccines", - active: (currentSection == "vaccines") + href: "/pharmacies", + text: "Pharmacies", + active: (currentSection == "pharmacies") + }), navigationItems) %} + + {% set navigationItems = (navigationItems.push({ + href: "/pharmacies/users", + text: "Users", + active: (currentSection == "pharmacies-users") }), navigationItems) %} {% endif %} - + {% if currentOrganisation and (not currentOrganisation.type == "Pharmacy HQ") %} {% set navigationItems = (navigationItems.push({ href: "/records", @@ -62,7 +53,7 @@ }), navigationItems) %} {% endif %} - + {% if (["Lead administrator", "Administrator"] | arrayOrStringIncludes(organisationSetting.permissionLevel)) or currentOrganisation.type === "Pharmacy HQ" %} {% set navigationItems = (navigationItems.push({ href: "/reports", @@ -71,7 +62,16 @@ }), navigationItems) %} {% endif %} - + + {% if (["Lead administrator", "Administrator"] | arrayOrStringIncludes(organisationSetting.permissionLevel)) %} + {% set navigationItems = (navigationItems.push({ + href: "/vaccines", + text: "Vaccines", + active: (currentSection == "vaccines") + }), navigationItems) %} + {% endif %} + + {% if (["Lead administrator"] | arrayOrStringIncludes(organisationSetting.permissionLevel)) %} {% set navigationItems = (navigationItems.push({ href: '/user-admin', @@ -103,7 +103,7 @@ {% if currentUser.admin %} {% set navigationItems = (navigationItems.push({ href: "/support", - text: "Home", + text: "Dashboard", active: (currentSection == "dashboard") }), navigationItems) %} From acb4eae089d2a570f0aa10b49403184c9e04ea57 Mon Sep 17 00:00:00 2001 From: Caitlin Roach Date: Thu, 2 Jul 2026 16:20:51 +0100 Subject: [PATCH 3/6] Fix to ensure "Records" appears in nav where appropriate --- app/views/includes/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/includes/header.html b/app/views/includes/header.html index 602369bb..4232535c 100644 --- a/app/views/includes/header.html +++ b/app/views/includes/header.html @@ -45,7 +45,7 @@ {% endif %} - {% if currentOrganisation and (not currentOrganisation.type == "Pharmacy HQ") %} + {% if currentOrganisation and (currentOrganisation.type != "Pharmacy HQ") %} {% set navigationItems = (navigationItems.push({ href: "/records", text: "Records", From f6679987cb47283f33042631554e2a7f0fd07125 Mon Sep 17 00:00:00 2001 From: Caitlin Roach Date: Thu, 2 Jul 2026 16:24:40 +0100 Subject: [PATCH 4/6] Updating presets to not include appointments. Added one new preset that shows the appointments interface --- app/routes/prototype-admin.js | 46 +++++++++++-------- .../includes/_preset-scenarios-table.html | 10 ++-- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/app/routes/prototype-admin.js b/app/routes/prototype-admin.js index 2bd6777f..2e7021ed 100644 --- a/app/routes/prototype-admin.js +++ b/app/routes/prototype-admin.js @@ -97,15 +97,6 @@ const SIGN_IN_USERS = [ orgId: 'FT81513', role: 'Lead administrator', orgDescription: 'Holborn Pharmacy (FT81513) — MMR and London flu only' - }, - { - id: '5500000001', - name: 'Riley Carter', - email: 'riley.carter@nhs.net', - orgId: 'FR4V56', - role: 'Recorder', - orgDescription: 'pharmacy (FR4V56), no appointments interface', - appointmentsInterfaceEnabled: false } ] @@ -424,6 +415,18 @@ module.exports = (router) => { }) } + function setAppointmentsInterfaceForUserOrganisations(data, userId, isEnabled) { + const user = data.users.find(item => item.id === userId) + if (!user || !Array.isArray(user.organisations)) return + + for (const userOrganisation of user.organisations) { + const organisation = data.organisations.find(item => item.id === userOrganisation.id) + if (!organisation) continue + + organisation.appointmentsInterfaceEnabled = isEnabled + } + } + // ---------------------------------------------------------------- // Reset data // ---------------------------------------------------------------- @@ -476,6 +479,7 @@ module.exports = (router) => { const data = req.session.data data.currentUserId = '2387441662601' data.currentOrganisationId = 'RW3' + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) setupBatchesForOrg(data, 'RW3') addRandomUsers(data, 'RW3', 2) addRandomVaccinations(data, 'RW3', 2) @@ -491,6 +495,7 @@ module.exports = (router) => { const data = req.session.data data.currentUserId = '46436346' data.currentOrganisationId = 'FA424' + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) setupBatchesForOrg(data, 'FA424') addRandomUsers(data, 'FA424', 10) addRandomVaccinations(data, 'FA424', 30) @@ -506,6 +511,7 @@ module.exports = (router) => { const data = req.session.data data.currentUserId = '9847489647892' data.currentOrganisationId = 'P0191N' + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) setupBatchesForOrg(data, 'P0191N') res.redirect('/home') }) @@ -519,6 +525,7 @@ module.exports = (router) => { const data = req.session.data data.currentUserId = '3283602393037' data.email = 'graham.wallace@nhs.net' + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) setupBatchesForOrg(data, 'RWP') addRandomVaccinations(data, 'RWP', 20) res.redirect('/auth/select-organisation') @@ -533,6 +540,7 @@ module.exports = (router) => { const data = req.session.data data.currentUserId = '16346346361' data.currentOrganisationId = 'RV3' + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) res.redirect('/home') }) @@ -545,6 +553,7 @@ module.exports = (router) => { const data = req.session.data data.currentUserId = '2058253531' data.email = 'phoebe.black@nhs.net' + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) setupBatchesForOrg(data, 'RWP') addRandomUsers(data, 'RWP', 10) addRandomVaccinations(data, 'RWP', 20) @@ -560,6 +569,7 @@ module.exports = (router) => { const data = req.session.data data.currentUserId = '6424325235325' data.currentOrganisationId = 'P15951' + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) setupBatchesForOrg(data, 'P15951') res.redirect('/home') }) @@ -573,6 +583,7 @@ module.exports = (router) => { const data = req.session.data data.currentUserId = '6424325235325' data.currentOrganisationId = 'P15951' + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) // Remove all pharmacies belonging to P15951 to start with a clean slate data.organisations = data.organisations.filter(org => org.companyId !== 'P15951' || org.type === 'Pharmacy HQ') res.redirect('/home') @@ -587,6 +598,7 @@ module.exports = (router) => { const data = req.session.data data.currentUserId = '1394978032564' data.currentOrganisationId = 'FS2847' + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) res.redirect('/home') }) @@ -599,6 +611,7 @@ module.exports = (router) => { const data = req.session.data data.currentUserId = '5960938237423' data.currentOrganisationId = 'RFF' + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) setupBatchesForOrg(data, 'RFF') addRandomUsers(data, 'RFF', 10) addRandomVaccinations(data, 'RFF', 30) @@ -638,29 +651,26 @@ module.exports = (router) => { const data = req.session.data data.currentUserId = '633464144' data.currentOrganisationId = 'FT81513' + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) setupBatchesForOrgVaccines(data, 'FT81513', ['MMR', 'flu (London service)']) addRandomVaccinations(data, 'FT81513', 10) res.redirect('/home') }) // ---------------------------------------------------------------- - // Preset: Recorder at pharmacy with no appointments interface + // Preset: Recorder at pharmacy with appointments interface enabled // ---------------------------------------------------------------- - router.get('/prototype-setup/preset/recorder-pharmacy-no-appointments', (req, res) => { + router.get('/prototype-setup/preset/recorder-pharmacy-with-appointments', (req, res) => { resetSession(req) const data = req.session.data - const scenarioUser = SIGN_IN_USERS.find(user => user.id === '5500000001') + const scenarioUser = SIGN_IN_USERS.find(user => user.id === '1394978032564') ensureUserExistsForScenario(data, scenarioUser) - data.currentUserId = '5500000001' + data.currentUserId = '1394978032564' data.currentOrganisationId = 'FR4V56' - - const org = data.organisations.find(organisation => organisation.id === 'FR4V56') - if (org) { - org.appointmentsInterfaceEnabled = false - } + setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, true) setupBatchesForOrg(data, 'FR4V56') addRandomVaccinations(data, 'FR4V56', 10) diff --git a/app/views/includes/_preset-scenarios-table.html b/app/views/includes/_preset-scenarios-table.html index 05a98cf7..8652de2a 100644 --- a/app/views/includes/_preset-scenarios-table.html +++ b/app/views/includes/_preset-scenarios-table.html @@ -32,12 +32,12 @@ scenarioDetails: "Recorder at Seaside Drive Pharmacy. Recorder permissions only, with no vaccines or additional users set up." }, { - presetLabel: "Recorder, pharmacy with no appointments interface", - presetPath: "/prototype-setup/preset/recorder-pharmacy-no-appointments", - userName: "Riley Carter", - userEmail: "riley.carter@nhs.net", + presetLabel: "Recorder, pharmacy with appointments interface", + presetPath: "/prototype-setup/preset/recorder-pharmacy-with-appointments", + userName: "Ocean Merritt", + userEmail: "ocean.merritt@nhs.net", role: "Recorder", - scenarioDetails: "Appointments interface is disabled for this pharmacy context." + scenarioDetails: "Appointments interface is enabled for this pharmacy context." }, { presetLabel: "Recorder, multiple NHS Trusts", From 598f20ac8c0539aec4466eee0c29dc4ed3363c21 Mon Sep 17 00:00:00 2001 From: Caitlin Roach Date: Thu, 2 Jul 2026 16:37:25 +0100 Subject: [PATCH 5/6] Updating references to home so they go to dashboard --- app/routes/appointments.js | 22 +++++++++- app/routes/auth.js | 26 ++++++++++- app/routes/home.js | 2 +- app/routes/prototype-admin.js | 44 ++++++++++++++----- app/views/{home => dashboard}/_by-day.html | 0 .../{home => dashboard}/_by-pharmacy.html | 0 app/views/{home => dashboard}/_by-site.html | 0 .../{home => dashboard}/_by-vaccine.html | 0 .../_no-vaccinations-recorded.html | 0 .../_vaccination-totals.html | 0 app/views/{home => dashboard}/index.html | 12 ++--- app/views/includes/header.html | 11 +++-- app/views/index.html | 2 +- 13 files changed, 93 insertions(+), 26 deletions(-) rename app/views/{home => dashboard}/_by-day.html (100%) rename app/views/{home => dashboard}/_by-pharmacy.html (100%) rename app/views/{home => dashboard}/_by-site.html (100%) rename app/views/{home => dashboard}/_by-vaccine.html (100%) rename app/views/{home => dashboard}/_no-vaccinations-recorded.html (100%) rename app/views/{home => dashboard}/_vaccination-totals.html (100%) rename app/views/{home => dashboard}/index.html (88%) diff --git a/app/routes/appointments.js b/app/routes/appointments.js index 6ac25b97..22f2c1cf 100644 --- a/app/routes/appointments.js +++ b/app/routes/appointments.js @@ -1,8 +1,28 @@ module.exports = (router) => { + const getDefaultLandingPath = (organisation) => { + if (!organisation) { + return '/home' + } + + if (organisation.type === 'Region') { + return '/regions' + } + + if (organisation.type !== 'Pharmacy HQ' && organisation.appointmentsInterfaceEnabled !== false) { + return '/appointments' + } + + if (organisation.type !== 'Pharmacy HQ') { + return '/record-vaccinations' + } + + return '/home' + } + router.get('/appointments', (req, res) => { if (res.locals.currentOrganisation && res.locals.currentOrganisation.appointmentsInterfaceEnabled === false) { - return res.redirect('/home') + return res.redirect(getDefaultLandingPath(res.locals.currentOrganisation)) } const data = req.session.data diff --git a/app/routes/auth.js b/app/routes/auth.js index 0ebf2be1..cb3fb725 100644 --- a/app/routes/auth.js +++ b/app/routes/auth.js @@ -1,5 +1,27 @@ module.exports = router => { + const getDefaultLandingPath = (data, organisationId) => { + const organisation = (data.organisations || []).find((item) => item.id === organisationId) + + if (!organisation) { + return '/home' + } + + if (organisation.type === 'Region') { + return '/regions' + } + + if (organisation.type !== 'Pharmacy HQ' && organisation.appointmentsInterfaceEnabled !== false) { + return '/appointments' + } + + if (organisation.type !== 'Pharmacy HQ') { + return '/record-vaccinations' + } + + return '/home' + } + router.post('/auth/sign-in', (req, res) => { const data = req.session.data @@ -36,7 +58,7 @@ module.exports = router => { req.session.data.currentUserId = user.id; req.session.data.currentOrganisationId = userOrganisationIds[0] - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, userOrganisationIds[0])) } else if (userRegionIds.length === 1) { @@ -90,7 +112,7 @@ module.exports = router => { req.session.data.currentUserId = user.id req.session.data.currentOrganisationId = selectedOrganisationId; - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, selectedOrganisationId)) } else { res.redirect('/auth/select-organisation') diff --git a/app/routes/home.js b/app/routes/home.js index 7bee500f..a70f4c6d4 100644 --- a/app/routes/home.js +++ b/app/routes/home.js @@ -217,7 +217,7 @@ module.exports = router => { } } - res.render('home/index', { + res.render('dashboard/index', { sites, pharmacies, totalVaccinationsRecorded, diff --git a/app/routes/prototype-admin.js b/app/routes/prototype-admin.js index 2e7021ed..7dcfc20f 100644 --- a/app/routes/prototype-admin.js +++ b/app/routes/prototype-admin.js @@ -427,6 +427,28 @@ module.exports = (router) => { } } + function getDefaultLandingPath(data, organisationId) { + const organisation = (data.organisations || []).find(item => item.id === organisationId) + + if (!organisation) { + return '/home' + } + + if (organisation.type === 'Region') { + return '/regions' + } + + if (organisation.type !== 'Pharmacy HQ' && organisation.appointmentsInterfaceEnabled !== false) { + return '/appointments' + } + + if (organisation.type !== 'Pharmacy HQ') { + return '/record-vaccinations' + } + + return '/home' + } + // ---------------------------------------------------------------- // Reset data // ---------------------------------------------------------------- @@ -483,7 +505,7 @@ module.exports = (router) => { setupBatchesForOrg(data, 'RW3') addRandomUsers(data, 'RW3', 2) addRandomVaccinations(data, 'RW3', 2) - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, data.currentOrganisationId)) }) // ---------------------------------------------------------------- @@ -499,7 +521,7 @@ module.exports = (router) => { setupBatchesForOrg(data, 'FA424') addRandomUsers(data, 'FA424', 10) addRandomVaccinations(data, 'FA424', 30) - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, data.currentOrganisationId)) }) // ---------------------------------------------------------------- @@ -513,7 +535,7 @@ module.exports = (router) => { data.currentOrganisationId = 'P0191N' setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) setupBatchesForOrg(data, 'P0191N') - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, data.currentOrganisationId)) }) // ---------------------------------------------------------------- @@ -541,7 +563,7 @@ module.exports = (router) => { data.currentUserId = '16346346361' data.currentOrganisationId = 'RV3' setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, data.currentOrganisationId)) }) // ---------------------------------------------------------------- @@ -571,7 +593,7 @@ module.exports = (router) => { data.currentOrganisationId = 'P15951' setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) setupBatchesForOrg(data, 'P15951') - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, data.currentOrganisationId)) }) // ---------------------------------------------------------------- @@ -586,7 +608,7 @@ module.exports = (router) => { setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) // Remove all pharmacies belonging to P15951 to start with a clean slate data.organisations = data.organisations.filter(org => org.companyId !== 'P15951' || org.type === 'Pharmacy HQ') - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, data.currentOrganisationId)) }) // ---------------------------------------------------------------- @@ -599,7 +621,7 @@ module.exports = (router) => { data.currentUserId = '1394978032564' data.currentOrganisationId = 'FS2847' setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, data.currentOrganisationId)) }) // ---------------------------------------------------------------- @@ -615,7 +637,7 @@ module.exports = (router) => { setupBatchesForOrg(data, 'RFF') addRandomUsers(data, 'RFF', 10) addRandomVaccinations(data, 'RFF', 30) - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, data.currentOrganisationId)) }) // ---------------------------------------------------------------- @@ -654,7 +676,7 @@ module.exports = (router) => { setAppointmentsInterfaceForUserOrganisations(data, data.currentUserId, false) setupBatchesForOrgVaccines(data, 'FT81513', ['MMR', 'flu (London service)']) addRandomVaccinations(data, 'FT81513', 10) - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, data.currentOrganisationId)) }) // ---------------------------------------------------------------- @@ -674,7 +696,7 @@ module.exports = (router) => { setupBatchesForOrg(data, 'FR4V56') addRandomVaccinations(data, 'FR4V56', 10) - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, data.currentOrganisationId)) }) // ---------------------------------------------------------------- @@ -1097,7 +1119,7 @@ module.exports = (router) => { } delete data.customConfig - res.redirect('/home') + res.redirect(getDefaultLandingPath(data, data.currentOrganisationId)) }) } diff --git a/app/views/home/_by-day.html b/app/views/dashboard/_by-day.html similarity index 100% rename from app/views/home/_by-day.html rename to app/views/dashboard/_by-day.html diff --git a/app/views/home/_by-pharmacy.html b/app/views/dashboard/_by-pharmacy.html similarity index 100% rename from app/views/home/_by-pharmacy.html rename to app/views/dashboard/_by-pharmacy.html diff --git a/app/views/home/_by-site.html b/app/views/dashboard/_by-site.html similarity index 100% rename from app/views/home/_by-site.html rename to app/views/dashboard/_by-site.html diff --git a/app/views/home/_by-vaccine.html b/app/views/dashboard/_by-vaccine.html similarity index 100% rename from app/views/home/_by-vaccine.html rename to app/views/dashboard/_by-vaccine.html diff --git a/app/views/home/_no-vaccinations-recorded.html b/app/views/dashboard/_no-vaccinations-recorded.html similarity index 100% rename from app/views/home/_no-vaccinations-recorded.html rename to app/views/dashboard/_no-vaccinations-recorded.html diff --git a/app/views/home/_vaccination-totals.html b/app/views/dashboard/_vaccination-totals.html similarity index 100% rename from app/views/home/_vaccination-totals.html rename to app/views/dashboard/_vaccination-totals.html diff --git a/app/views/home/index.html b/app/views/dashboard/index.html similarity index 88% rename from app/views/home/index.html rename to app/views/dashboard/index.html index a4715310..6c498fe7 100644 --- a/app/views/home/index.html +++ b/app/views/dashboard/index.html @@ -17,7 +17,7 @@

{% if currentOrganisation %} {% if currentOrganisation and totalVaccinationsRecorded == 0 %} - {% include "home/_no-vaccinations-recorded.html" %} + {% include "dashboard/_no-vaccinations-recorded.html" %} {% endif %} {% from 'inset-text/macro.njk' import insetText %} @@ -41,24 +41,24 @@

All vaccinations

- {% include "home/_vaccination-totals.html" %} + {% include "dashboard/_vaccination-totals.html" %} {% if totalVaccinationsRecorded > 0 %} {% set byDayHtml %} - {% include "home/_by-day.html" %} + {% include "dashboard/_by-day.html" %} {% endset %} {% set byVaccinationHtml %} - {% include "home/_by-vaccine.html" %} + {% include "dashboard/_by-vaccine.html" %} {% endset %} {% set bySiteHtml %} - {% include "home/_by-site.html" %} + {% include "dashboard/_by-site.html" %} {% endset %} {% set byPharmacyHtml %} - {% include "home/_by-pharmacy.html" %} + {% include "dashboard/_by-pharmacy.html" %} {% endset %} diff --git a/app/views/includes/header.html b/app/views/includes/header.html index 4232535c..2f48b59a 100644 --- a/app/views/includes/header.html +++ b/app/views/includes/header.html @@ -1,24 +1,27 @@ {% set organisationSetting = currentUser.organisations | findById(data.currentOrganisationId) %} {% set navigationItems = [] %} +{% set canShowAppointments = currentOrganisation and (currentOrganisation.type != "Pharmacy HQ") and (currentOrganisation.appointmentsInterfaceEnabled !== false) %} +{% set canShowRecordVaccinations = currentOrganisation and (currentOrganisation.type != "Pharmacy HQ") %} +{% set defaultMainSection = "appointments" if canShowAppointments else ("vaccinate" if canShowRecordVaccinations else "") %} {% if currentUser and not (currentOrganisation.type === "Region") %} - {% if currentOrganisation and (currentOrganisation.type != "Pharmacy HQ") and (currentOrganisation.appointmentsInterfaceEnabled !== false) %} + {% if canShowAppointments %} {% set navigationItems = (navigationItems.push({ href: "/appointments", html: "Appointments New", - active: (currentSection == "appointments") + active: (currentSection == "appointments") or ((not currentSection) and (defaultMainSection == "appointments")) }), navigationItems) %} {% endif %} - {% if currentOrganisation and (currentOrganisation.type != "Pharmacy HQ") %} + {% if canShowRecordVaccinations %} {% set navigationItems = (navigationItems.push({ href: "/record-vaccinations", text: "Record vaccinations", - active: (currentSection == "vaccinate") + active: (currentSection == "vaccinate") or ((not currentSection) and (defaultMainSection == "vaccinate")) }), navigationItems) %} {% endif %} diff --git a/app/views/index.html b/app/views/index.html index 13f37c2d..1c88c480 100755 --- a/app/views/index.html +++ b/app/views/index.html @@ -96,7 +96,7 @@

Main interface

Quick access links below apply the Pharmacy lead admin preset first, so you can open these pages without manually signing in.

    -
  • Home
  • +
  • Dashboard
  • Record vaccinations
  • Vaccines
  • Records
  • From 95def133bccfc1cad823c0627257a71892d688c4 Mon Sep 17 00:00:00 2001 From: Caitlin Roach Date: Thu, 2 Jul 2026 17:05:37 +0100 Subject: [PATCH 6/6] Updates to what's new --- app/assets/sass/_overrides.scss | 25 +++++++++++++++++++++++++ app/views/dashboard/index.html | 11 ----------- app/views/layout.html | 15 +++++++++++---- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/app/assets/sass/_overrides.scss b/app/assets/sass/_overrides.scss index cf51f41f..546b6b08 100644 --- a/app/assets/sass/_overrides.scss +++ b/app/assets/sass/_overrides.scss @@ -5,6 +5,31 @@ } } +.app-pre-footer-banner { + border-top: 1px solid #b1b4b6; +} + +.app-pre-footer-banner .govuk-phase-banner__content { + display: flex; + flex-wrap: nowrap; + align-items: baseline; + @include nhsuk-font(16); + margin-top: 24px; + margin-bottom: 24px; +} + +.app-pre-footer-banner .govuk-phase-banner__content__tag { + @include nhsuk-font(16); + margin-right: 18px; + margin-bottom: 0; +} + +.app-pre-footer-banner .govuk-phase-banner__text { + @include nhsuk-font(16); + display: inline; + margin-bottom: 0; +} + .app-custom-config-progress-card__details { .nhsuk-details { margin-bottom: 0; diff --git a/app/views/dashboard/index.html b/app/views/dashboard/index.html index 6c498fe7..5d90a5e1 100644 --- a/app/views/dashboard/index.html +++ b/app/views/dashboard/index.html @@ -20,17 +20,6 @@

    {% if currentOrganisation %} {% include "dashboard/_no-vaccinations-recorded.html" %} {% endif %} - {% from 'inset-text/macro.njk' import insetText %} - -{% set insetTextHtml %} -

    Find out about the latest updates to the service: -
    What's new (opens in new tab)

    -{% endset %} - -{{ insetText({ - html: insetTextHtml -}) }} -

    All vaccinations

    Last updated: {{ dashboardLastUpdated }}

    {% if not currentOrganisation %} diff --git a/app/views/layout.html b/app/views/layout.html index f753273f..862e7185 100755 --- a/app/views/layout.html +++ b/app/views/layout.html @@ -27,6 +27,17 @@ {% block footer %} + + {{ footer({ meta: { items: [ @@ -38,10 +49,6 @@ href: "https://guide.ravs.england.nhs.uk/guide/", text: "User guide (opens in new tab)" }, - { - href: "https://guide.ravs.england.nhs.uk/whats-new/", - text: "What's new (opens in new tab)" - }, { href: "/cookies", text: "Cookies"