Skip to content

Commit d52e782

Browse files
Show org name in header (#215)
* Show org name in header * Use BSU name in places
1 parent 47240ec commit d52e782

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

app/locals.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
// app/locals.js
22

33
module.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

app/views/_templates/layout-base.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@
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
{

app/views/clinics/index.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@
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 = [] %}

app/views/clinics/show.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
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) %} #}

0 commit comments

Comments
 (0)