diff --git a/app/data/all-organisations.js b/app/data/all-organisations.js index e59695d8..9e29f914 100644 --- a/app/data/all-organisations.js +++ b/app/data/all-organisations.js @@ -301,7 +301,12 @@ module.exports = [ { id: "RGT", name: "Cambridge University Hospitals NHS Foundation Trust", - type: "NHS Trust" + type: "NHS Trust", + address: { + line1: "University Street", + town: "Cambridge", + postcode: "CM6 9PQ" + } }, { id: "RH5", diff --git a/app/data/organisations.js b/app/data/organisations.js index bece5f5e..ce472c0b 100644 --- a/app/data/organisations.js +++ b/app/data/organisations.js @@ -890,21 +890,6 @@ module.exports = [ {name: "COVID-19", status: "enabled"} ] }, - { - id: "RGT", - name: "Cambridge University Hospitals NHS Foundation Trust", - address: { - line1: "Cambridge biomedical campus", - town: "Cambridge", - postcode: "CB2 0QQ" - }, - status: "Active", - type: "NHS Trust", - region: "Y63", - vaccines: [ - {name: "COVID-19", status: "enabled"} - ] - }, { id: "RT1", name: "Cambridgeshire and peterborough NHS Foundation Trust", diff --git a/app/data/users.js b/app/data/users.js index 4810c553..ef098328 100644 --- a/app/data/users.js +++ b/app/data/users.js @@ -7170,20 +7170,6 @@ module.exports = [ "firstName": "Stephanie", "lastName": "Mora" }, - { - "id": "3444754326063", - "email": "darren.phan@nhs.net", - "organisations": [ - { - "id": "RGT", - "permissionLevel": "Lead administrator", - "status": "Active", - "vaccinator": true - } - ], - "firstName": "Darren", - "lastName": "Phan" - }, { "id": "8975436615083", "email": "jenesis.esparza@nhs.net", diff --git a/app/routes/auth.js b/app/routes/auth.js index 7225ea4a..04e5b2c5 100644 --- a/app/routes/auth.js +++ b/app/routes/auth.js @@ -23,6 +23,10 @@ module.exports = router => { .filter((organisation) => organisation.status === "Active") .map((organisation) => organisation.id) + // reset email and password + req.session.data.email = "" + req.session.data.password = "" + if (user.admin) { req.session.data.currentUserId = user.id; req.session.data.currentOrganisationId = null diff --git a/app/routes/regions.js b/app/routes/regions.js index 6dc86529..6fdefc3d 100644 --- a/app/routes/regions.js +++ b/app/routes/regions.js @@ -54,6 +54,14 @@ module.exports = router => { const addedUserId = Math.floor(Math.random() * 10000000).toString() + let vaccinesEnabled = [] + + for (const vaccineEnabled of data.vaccinesEnabled) { + vaccinesEnabled.push({name: vaccineEnabled, status: "enabled"}) + } + + console.log(vaccinesEnabled) + // Add organisation req.session.data.organisations.push({ id: organisation.id, @@ -61,7 +69,8 @@ module.exports = router => { address: organisation.address, type: organisation.type, status: 'Invited', - region: currentOrganisation.id + region: currentOrganisation.id, + vaccines: vaccinesEnabled }) req.session.data.users.push({ diff --git a/app/views/regions/add-organisation.html b/app/views/regions/add-organisation.html index 8d727170..cf293434 100644 --- a/app/views/regions/add-organisation.html +++ b/app/views/regions/add-organisation.html @@ -21,7 +21,7 @@

{{ pageName }}

-

diff --git a/app/views/regions/add-vaccines.html b/app/views/regions/add-vaccines.html index a9bc4808..76065140 100644 --- a/app/views/regions/add-vaccines.html +++ b/app/views/regions/add-vaccines.html @@ -29,7 +29,6 @@ {{ checkboxes({ name: "vaccinesToAdd", - classes: "nhsuk-radios--inline", fieldset: { legend: { text: "Which vaccines do you want to add?", diff --git a/app/views/regions/organisation-details.html b/app/views/regions/organisation-details.html index c048b9c8..02a1ac37 100644 --- a/app/views/regions/organisation-details.html +++ b/app/views/regions/organisation-details.html @@ -29,6 +29,12 @@

Organisation

}) }} {% endif %} + {% set addressHtml %} + {{ organisation.address.line1 }}
+ {{ organisation.address.town }}
+ {{ organisation.address.postcode }} + {% endset %} + {{ summaryList({ rows: [ { @@ -60,7 +66,7 @@

Organisation

text: "Address" }, value: { - html: (organisation.address) + html: addressHtml } } ] diff --git a/app/views/regions/organisation.html b/app/views/regions/organisation.html index 53ca8e4e..4d752177 100644 --- a/app/views/regions/organisation.html +++ b/app/views/regions/organisation.html @@ -24,39 +24,40 @@

{{ organisation.name }}

Reactivate organisation

- {% else %} - -

They can record - {% if (vaccinesEnabled | length) == (data.vaccines | length) %} - all - {% else %} - {{ vaccinesEnabled | sort(false, false, "name") | pluck("name") | formatList }} - {% endif %} - vaccinations. - - {% if (vaccinesEnabled | length) < (data.vaccines | length) %} - Add vaccines - {% endif %} -

- - {% if (messages | length) > 0 %} - {% set message = (messages | first) %} - - {% set messageHtml %} -

Access to record {{ message.vaccineRequested }} requested on {{ message.sentOn | govukDate }}. View request

- {% endset %} - - {{ insetText({ - html: messageHtml, - classes: "nhsuk-u-margin-top-0 nhsuk-u-padding-top-1 nhsuk-u-padding-bottom-1" - }) }} + {% endif %} + + +

They can record + {% if (vaccinesEnabled | length) == (data.vaccines | length) %} + all + {% else %} + {{ vaccinesEnabled | sort(false, false, "name") | pluck("name") | formatList }} {% endif %} + vaccinations. + {% if (vaccinesEnabled | length) < (data.vaccines | length) %} + Add vaccines + {% endif %} +

+ {% if (messages | length) > 0 %} + {% set message = (messages | first) %} -

Deactivate organisation

+ {% set messageHtml %} +

Access to record {{ message.vaccineRequested }} requested on {{ message.sentOn | govukDate }}. View request

+ {% endset %} + + {{ insetText({ + html: messageHtml, + classes: "nhsuk-u-margin-top-0 nhsuk-u-padding-top-1 nhsuk-u-padding-bottom-1" + }) }} + {% endif %} + + {% if organisation.status != 'Invited' %} +

Deactivate organisation

{% endif %} +
@@ -110,22 +111,25 @@

{{ organisation.name }}

{% endif %} - {{ pagination({ - next: { - href: "#" - }, - items: [ - { - number: 1, - href: "#", - current: true - }, - { - number: 2, + + {% if (users | length) > 3 %} + {{ pagination({ + next: { href: "#" - } - ] - }) }} + }, + items: [ + { + number: 1, + href: "#", + current: true + }, + { + number: 2, + href: "#" + } + ] + }) }} + {% endif %} {% set buttonText = "Add another user" if (organisation.leadUsers | length) > 0 else "Add user" %}