Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #618 from nhsuk/feature/pharmacy-name-link-to-profile
Browse files Browse the repository at this point in the history
🔗 CI2-1395 CI2-1936 services link removed and org names link to …
  • Loading branch information
nigelatwell authored Nov 18, 2019
2 parents e5a4f21 + bfedb85 commit f10dfa8
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.18.1 / TBC
===================
- Update Org Name to be the link to PIMS overview page tab
- Remove the services link

1.18.0 / TBC
===================
- Update URLs to `/service-search/find-a-pharmacy/`
Expand Down
4 changes: 2 additions & 2 deletions app/lib/choicesServices.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function addUrl(inputList) {
return inputList.map((item) => {
const identifier = item.identifier;
const choicesServicesUrl = `https://www.nhs.uk/Services/pharmacies/PctServices/DefaultView.aspx?id=${identifier}`;
const choicesOverviewUrl = `https://www.nhs.uk/Services/pharmacies/Overview/DefaultView.aspx?id=${identifier}`;

// eslint-disable-next-line no-param-reassign
item.choicesServicesUrl = choicesServicesUrl;
item.choicesOverviewUrl = choicesOverviewUrl;
return item;
});
}
Expand Down
3 changes: 1 addition & 2 deletions app/views/includes/result-item.nunjucks
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% set distance = service.distanceInMiles | round(1) %}
<div>
<p class="nhsuk-body-s nhsuk-u-margin-bottom-1"><span class="nhsuk-u-visually-hidden">{{ service.name }} is </span>{% if distance === 1.0 %}1 mile away{% else %}{{ distance }} miles away{% endif %}</p>
<h2 class="results__name nhsuk-u-padding-top-1">{{ service.name }}</h2>
<h2 class="results__name nhsuk-u-padding-top-1"><a class="serviceslink" href="{{ service.choicesOverviewUrl }}">{{ service.name }}<span class="nhsuk-u-visually-hidden"> in {{ service.name }} at {{ service.addressLine }}</span></a></h2>
<p class="nhsuk-list nhsuk-u-margin-bottom-2">
{{ service.address.lines | join(', ') }},
{% if service.address.city %} {{ service.address.city }}, {% endif %}
Expand All @@ -13,7 +13,6 @@
{% if service.contacts.telephone %}{{ service.contacts.telephone }}{% endif %}
<ul class="nhsuk-list nhsuk-u-margin-bottom-0">
<li class="results__item__link"><a class="maplink" href="{{service.mapUrl}}">Map and directions<span class="nhsuk-u-visually-hidden"> for {{ service.name }} at {{ service.addressLine }}</span></a></li>
<li class="results__item__link"><a class="serviceslink" href="{{ service.choicesServicesUrl }}">Services available<span class="nhsuk-u-visually-hidden"> in {{ service.name }} at {{ service.addressLine }}</span></a></li>
</ul>
</div>
</div>
Expand Down
21 changes: 21 additions & 0 deletions doc/adr/0017-update-links-to-pims-profiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 17. Update Navigation links to PIMS from search results

Date: 2019-11-13

## Status

Accepted

## Context

We have removed the services link from the results page. We can now navigate to the PIMS profile Overview
page via a link on the Organisation name in the search results page.

## Decision

Update the results page to use Org name as link to PIMS overview page
Remove the services link from the search results page

## Consequences

Simplifies navigation to PIMS. Make the result page a bit cleaner.
10 changes: 8 additions & 2 deletions test/integration/resultsPageGeneral.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ describe('The results page', () => {
});

it('should return distance away singularly for 1 mile and plurally for other distances', () => {
const resultTitle1 = $('.results__name').eq(0).text();
const resultTitle2 = $('.results__name').eq(8).text();
const resultTitle1 = $('.results__name .serviceslink').eq(0).clone().children()
.remove()
.end()
.text();
const resultTitle2 = $('.results__name .serviceslink').eq(8).clone().children()
.remove()
.end()
.text();
expect($('.nhsuk-body-s').eq(0).text()).to.equal(`${resultTitle1} is 0.5 miles away`);
expect($('.nhsuk-body-s').eq(8).text()).to.equal(`${resultTitle2} is 1 mile away`);
});
Expand Down
2 changes: 1 addition & 1 deletion test/lib/expectations.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function midsomerNortonResults($, location, numberOfResults) {
const choicesServicesLinks = $('.serviceslink');
expect(choicesServicesLinks.length).to.equal(10);
choicesServicesLinks.toArray().forEach((link) => {
expect($(link).attr('href')).to.have.string('https://www.nhs.uk/Services/pharmacies/PctServices/DefaultView.aspx');
expect($(link).attr('href')).to.have.string('https://www.nhs.uk/Services/pharmacies/Overview/DefaultView.aspx');
});
expect(choicesServicesLinks.length).to.equal(numberOfResults);
expect($('head title').text()).to.equal('Pharmacies near Midsomer Norton - NHS');
Expand Down
4 changes: 2 additions & 2 deletions test/unit/lib/choicesServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ describe('choicesServices', () => {
expect(results).to.be.an('array');
expect(results.length).to.be.equal(inputItems.length);
inputItems.forEach((item, index) => {
expect(results[index].choicesServicesUrl)
.to.be.equal(`https://www.nhs.uk/Services/pharmacies/PctServices/DefaultView.aspx?id=${inputItems[index].identifier}`);
expect(results[index].choicesOverviewUrl)
.to.be.equal(`https://www.nhs.uk/Services/pharmacies/Overview/DefaultView.aspx?id=${inputItems[index].identifier}`);
});
});
});

0 comments on commit f10dfa8

Please sign in to comment.