Skip to content

Commit 8965110

Browse files
authored
PPHA 516: Pilot Give Feedback phase banner (#361)
# What is the change? * Created a phase banner jinja template * Added phase banner to the header in layout.jinja # Why are we making this change? To indicate to users that this service is in Pilot phase at the top of the page using a GDS style phase banner. <img width="1512" height="663" alt="image" src="https://github.com/user-attachments/assets/d68f3007-71e9-4edf-86cc-f6a071f1f2ef" />
2 parents 235ccc6 + c84d1ec commit 8965110

6 files changed

Lines changed: 55 additions & 4 deletions

File tree

features/static.feature

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@
22
Feature: Static Pages
33
Scenario: The static pages are available without logging in
44
When I go to "/cookies"
5-
Then I see a page title "NHS check if you need a lung scan cookies policy"
5+
Then I see a phase header "Pilot"
6+
And I see a link named "feedback"
7+
And I see a page title "NHS check if you need a lung scan cookies policy"
68
When I go to "/privacy-policy"
7-
Then I see a page title "NHS check if you need a lung scan privacy policy"
9+
Then I see a phase header "Pilot"
10+
And I see a link named "feedback"
11+
And I see a page title "NHS check if you need a lung scan privacy policy"
812

913
Scenario: The static pages are available when logged in and accessible
1014
Given I am logged in
1115
When I go to "/cookies"
12-
Then there are no accessibility violations
16+
Then I see a phase header "Pilot"
17+
And I see a link named "feedback"
18+
And there are no accessibility violations
1319
And I see a page title "NHS check if you need a lung scan cookies policy"
1420
When I go to "/privacy-policy"
15-
Then there are no accessibility violations
21+
Then I see a phase header "Pilot"
22+
And I see a link named "feedback"
23+
And there are no accessibility violations
1624
And I see a page title "NHS check if you need a lung scan privacy policy"

features/steps/page_assertion_steps.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ def then_i_see_a_back_link_to(context, url):
1414
@then(u'I see a page title "{title}"')
1515
def then_i_see_a_page_title(context, title):
1616
expect(context.page.locator('h1')).to_have_text(title)
17+
18+
@then(u'I see a phase header "{phase}"')
19+
def then_i_see_a_phase_header(context, phase):
20+
expect(context.page.locator('.lung-nhsuk-phase-banner__text')).to_have_count(1)
21+
expect(context.page.locator('.lung-nhsuk-phase-banner__content .nhsuk-tag')).to_have_text(phase)
22+
23+
@then(u'I see a link named "{link_text}"')
24+
def then_i_see_a_link_named(context, link_text):
25+
link = context.page.locator(f'a:has-text("{link_text}")')
26+
expect(link).to_have_count(1)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.lung-nhsuk-phase-banner__container{
2+
border-bottom: 1px solid var(--nhsuk-grey-3-colour);
3+
padding-bottom: 10px;
4+
padding-top: 10px;
5+
}
6+
7+
.lung-nhsuk-phase-banner__content {
8+
display: table;
9+
margin: 0;
10+
}
11+
12+
.lung-nhsuk-phase-banner__text {
13+
display: table-cell;
14+
vertical-align: middle;
15+
padding-left: 10px;
16+
}

lung_cancer_screening/assets/sass/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
// Components that are not in the NHS.UK frontend library
55
@forward "components/multi_field_input";
66

7+
@forward 'components/phase_banner';
78
@forward "components/numbered_lists"

lung_cancer_screening/core/jinja2/layout.jinja

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
] if request.user.is_authenticated else []
3131
}
3232
}) }}
33+
34+
{% include 'phase_banner.jinja' %}
35+
3336
{% endblock header %}
3437

3538
{% block beforeContent %}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<section role="region" aria-label="Service phase" class="nhsuk-width-container">
2+
<div class="lung-nhsuk-phase-banner__container">
3+
<div class="nhsuk-phase-banner">
4+
<p class="lung-nhsuk-phase-banner__content">
5+
<span class="nhsuk-tag nhsuk-tag__content nhsuk-tag--blue">Pilot</span>
6+
<span class="lung-nhsuk-phase-banner__text nhsuk-body-s">
7+
We are testing a new service &ndash; your <a
8+
href="https://feedback.digital.nhs.uk/jfe/form/SV_6V8dAlFT0sxJnzo" target="_blank"
9+
rel="noopener">feedback</a> will help us improve it.</span>
10+
</p>
11+
</div>
12+
</div>
13+
</section>

0 commit comments

Comments
 (0)