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 @@
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) %} - + {% 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' %} + {% endif %} +