Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/data/all-organisations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 0 additions & 15 deletions app/data/organisations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 0 additions & 14 deletions app/data/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions app/routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion app/routes/regions.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,23 @@ 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,
name: organisation.name,
address: organisation.address,
type: organisation.type,
status: 'Invited',
region: currentOrganisation.id
region: currentOrganisation.id,
vaccines: vaccinesEnabled
})

req.session.data.users.push({
Expand Down
2 changes: 1 addition & 1 deletion app/views/regions/add-organisation.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1 class="nhsuk-heading-l">{{ pageName }}</h1>

<div class="nhsuk-form-group">
<h1 class="nhsuk-label-wrapper">
<label class="nhsuk-label nhsuk-label--m nhsuk-u-margin-bottom-1" for="organisationId">
<label class="nhsuk-label nhsuk-label--s nhsuk-u-margin-bottom-1" for="organisationId">
NHS organisation or community pharmacy
</label>
</h1>
Expand Down
1 change: 0 additions & 1 deletion app/views/regions/add-vaccines.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

{{ checkboxes({
name: "vaccinesToAdd",
classes: "nhsuk-radios--inline",
fieldset: {
legend: {
text: "Which vaccines do you want to add?",
Expand Down
8 changes: 7 additions & 1 deletion app/views/regions/organisation-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ <h1 class="nhsuk-heading-l">Organisation</h1>
}) }}
{% endif %}

{% set addressHtml %}
{{ organisation.address.line1 }}<br>
{{ organisation.address.town }}<br>
{{ organisation.address.postcode }}
{% endset %}

{{ summaryList({
rows: [
{
Expand Down Expand Up @@ -60,7 +66,7 @@ <h1 class="nhsuk-heading-l">Organisation</h1>
text: "Address"
},
value: {
html: (organisation.address)
html: addressHtml
}
}
]
Expand Down
88 changes: 46 additions & 42 deletions app/views/regions/organisation.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,39 +24,40 @@ <h1 class="nhsuk-heading-l">{{ organisation.name }}</h1>

<p><a href="/regions/organisations/{{ organisation.id }}/reactivate">Reactivate organisation</a></p>

{% else %}

<p>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) %}
<a href="/regions/organisations/{{organisation.id}}/add-vaccines">Add vaccines<span class="nhsuk-u-visually-hidden"></span></a>
{% endif %}
</p>

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

{% set messageHtml %}
<p>Access to record {{ message.vaccineRequested }} requested on {{ message.sentOn | govukDate }}. <a href="/regions/messages/{{ message.id }}">View&nbsp;request</a></p>
{% endset %}

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


<p>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) %}
<a href="/regions/organisations/{{organisation.id}}/add-vaccines">Add vaccines<span class="nhsuk-u-visually-hidden"></span></a>
{% endif %}
</p>

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

<p><a href="/regions/organisations/{{organisation.id}}/deactivate">Deactivate organisation</a></p>
{% set messageHtml %}
<p>Access to record {{ message.vaccineRequested }} requested on {{ message.sentOn | govukDate }}. <a href="/regions/messages/{{ message.id }}">View&nbsp;request</a></p>
{% 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' %}
<p><a href="/regions/organisations/{{organisation.id}}/deactivate">Deactivate organisation</a></p>
{% endif %}

</div>
</div>

Expand Down Expand Up @@ -110,22 +111,25 @@ <h1 class="nhsuk-heading-l">{{ organisation.name }}</h1>
</table>
{% 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" %}

Expand Down