File tree Expand file tree Collapse file tree 4 files changed +16
-7
lines changed
Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 11// app/locals.js
22
33module . exports = ( config ) => ( req , res , next ) => {
4+ const currentUser = req . session . data . currentUser
5+ const currentBSU = currentUser
6+ ? req . session . data . breastScreeningUnits ?. find ( unit => unit . id === currentUser . breastScreeningUnit )
7+ : null
8+
49 const locals = {
510 serviceName : config . serviceName ,
611 currentUrl : req . path ,
712 flash : req . flash ( ) ,
813 query : req . query ,
914 referrerChain : req . query . referrerChain ,
10- currentUser : req . session . data . currentUser ,
15+ currentUser : currentUser ,
16+ currentBSU : currentBSU ,
1117 isAppointmentWorkflow : false
1218 }
1319
Original file line number Diff line number Diff line change 8484 {{ header({
8585 account: {
8686 items: [
87+ {
88+ text: currentBSU.name
89+ },
8790 {
8891 href: "#",
89- text: data.currentUser.email ,
92+ text: ( data.currentUser.lastName | upper) + ", " + (data.currentUser.firstName) ,
9093 icon: true
9194 },
9295 {
Original file line number Diff line number Diff line change 1313 {% endswitch %}
1414{% endset %}
1515
16+ {# Can get to dashboard using main nav instead #}
1617{% set hideBackLink = true %}
1718
1819{% set gridColumn = "nhsuk-grid-column-full" %}
1920
20- {# {% set back = {
21- href: "/dashboard",
22- text: "Dashboard"
23- } %} #}
24-
2521{% block pageContent %}
22+
23+ < span class ="nhsuk-caption-l "> {{ currentBSU.name }}</ span >
2624 < h1 > {{pageHeading}}</ h1 >
2725
2826 {% set secondaryNavItems = [] %}
Original file line number Diff line number Diff line change 1010
1111
1212{% block pageContent %}
13+
14+ {# Todo: this could instead use the currentBSU local variable though that relates to the signed in user #}
1315 {% set unit = data.breastScreeningUnits | findById(clinic.breastScreeningUnitId) %}
1416 {{ filteredEvents | log("Filtered events")}}
1517 {# {% set events = data.events | getClinicEvents(clinicId) %} #}
You can’t perform that action at this time.
0 commit comments