Skip to content

Commit f5a7da9

Browse files
Merge branch 'main' into header-breaking-changes
2 parents 1d394a5 + 1ba3a91 commit f5a7da9

21 files changed

+565
-11
lines changed

.github/workflows/pull-request.yml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@ name: Pull request
33
on: pull_request
44

55
jobs:
6-
build:
7-
name: Pull request
6+
sonar_analysis:
7+
name: Sonar analysis
88
runs-on: ubuntu-latest
9-
109
steps:
11-
- uses: actions/checkout@v4
12-
10+
- uses: actions/checkout@v2
1311
- uses: actions/setup-node@v4
1412
with:
1513
node-version: 20
1614
cache: 'npm'
17-
1815
- name: Install dependencies
1916
run: npm ci
20-
2117
- name: Sonar analysis
2218
uses: sonarsource/sonarcloud-github-action@master
2319
with:
@@ -27,11 +23,46 @@ jobs:
2723
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2824
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
2925

26+
linting:
27+
name: Code style checks
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: 20
34+
cache: 'npm'
35+
- name: Install dependencies
36+
run: npm ci
3037
- name: Run linting
3138
run: npm run lint
3239

40+
tests:
41+
name: Javascript unit tests
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-node@v4
46+
with:
47+
node-version: 20
48+
cache: 'npm'
49+
- name: Install dependencies
50+
run: npm ci
3351
- name: Run tests
3452
run: npm test
3553

54+
ui_tests:
55+
name: Visual regression tests
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v4
59+
- uses: actions/setup-node@v4
60+
with:
61+
node-version: 20
62+
cache: 'npm'
63+
- name: Install dependencies
64+
run: npm ci
65+
- name: Run tests
66+
run: npm test
3667
- name: Run backstop
3768
run: npm run backstop:ci

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# NHS.UK frontend Changelog
22

3-
## Unreleased
3+
## 9.1.0 - 4 November 2024
4+
5+
:new: **New features**
6+
7+
- Add task list component ([PR 969](https://github.com/nhsuk/nhsuk-frontend/pull/969))
48

59
:wrench: **Fixes**
610

app/components/task-list/index.njk

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{% set html_style = 'background-color: #f0f4f5;' %}
2+
{% set title = 'Task list' %}
3+
{% from 'components/task-list/macro.njk' import taskList %}
4+
{% extends 'layout.njk' %}
5+
6+
{% block body %}
7+
8+
<div class="nhsuk-width-container">
9+
<main class="nhsuk-main-wrapper" id="maincontent">
10+
11+
<div class="nhsuk-grid-row">
12+
<div class="nhsuk-grid-column-two-thirds">
13+
{{ taskList({
14+
idPrefix: "your-health",
15+
items: [
16+
{
17+
title: {
18+
text: "Exercise"
19+
},
20+
href: "#",
21+
status: {
22+
text: "Completed",
23+
classes: "nhsuk-task-list__status--completed"
24+
}
25+
},
26+
{
27+
title: {
28+
text: "Personal health"
29+
},
30+
href: "#",
31+
status: {
32+
text: "Completed",
33+
classes: "nhsuk-task-list__status--completed"
34+
}
35+
},
36+
{
37+
title: {
38+
text: "Family health history"
39+
},
40+
hint: {
41+
text: "Details of your parents and siblings"
42+
},
43+
href: "#",
44+
status: {
45+
tag: {
46+
text: "Incomplete",
47+
classes: "nhsuk-tag--blue"
48+
}
49+
}
50+
},
51+
{
52+
title: {
53+
text: "Smoking history"
54+
},
55+
href: "#",
56+
status: {
57+
tag: {
58+
text: "Incomplete",
59+
classes: "nhsuk-tag--blue"
60+
}
61+
}
62+
},
63+
{
64+
title: {
65+
text: "Blood test"
66+
},
67+
status: {
68+
text: "Cannot start yet",
69+
classes: "nhsuk-task-list__status--cannot-start-yet"
70+
}
71+
}
72+
]
73+
}) }}
74+
75+
</div>
76+
</div>
77+
78+
</main>
79+
</div>
80+
81+
{% endblock %}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{% set html_style = 'background-color: #f0f4f5;' %}
2+
{% set title = 'Task list' %}
3+
{% from 'components/task-list/macro.njk' import taskList %}
4+
{% from 'components/button/macro.njk' import button %}
5+
{% extends 'layout.njk' %}
6+
7+
{% block body %}
8+
9+
<div class="nhsuk-width-container">
10+
<main class="nhsuk-main-wrapper" id="maincontent">
11+
12+
<div class="nhsuk-grid-row">
13+
<div class="nhsuk-grid-column-two-thirds">
14+
<h1 class="nhsuk-heading-l">Service name</h1>
15+
16+
<h2 class="nhsuk-heading-m">Check before you start</h2>
17+
{{ taskList({
18+
idPrefix: "before-you-start",
19+
items: [
20+
{
21+
title: {
22+
text: "Check eligibility"
23+
},
24+
href: "#",
25+
status: {
26+
text: "Completed",
27+
classes: "nhsuk-task-list__status--completed"
28+
}
29+
},
30+
{
31+
title: {
32+
text: "Read declaration"
33+
},
34+
href: "#",
35+
status: {
36+
tag: {
37+
text: "Incomplete",
38+
classes: "nhsuk-tag--blue"
39+
}
40+
}
41+
}
42+
]
43+
}) }}
44+
45+
<h2 class="nhsuk-heading-m">Prepare application</h2>
46+
47+
{{ taskList({
48+
idPrefix: "your-health",
49+
items: [
50+
{
51+
title: {
52+
text: "Exercise"
53+
},
54+
href: "#",
55+
status: {
56+
text: "Completed",
57+
classes: "nhsuk-task-list__status--completed"
58+
}
59+
},
60+
{
61+
title: {
62+
text: "Personal health"
63+
},
64+
href: "#",
65+
status: {
66+
text: "Completed",
67+
classes: "nhsuk-task-list__status--completed"
68+
}
69+
},
70+
{
71+
title: {
72+
text: "Family health history"
73+
},
74+
hint: {
75+
text: "Details of your parents and siblings"
76+
},
77+
href: "#",
78+
status: {
79+
tag: {
80+
text: "Incomplete",
81+
classes: "nhsuk-tag--blue"
82+
}
83+
}
84+
},
85+
{
86+
title: {
87+
text: "Smoking history"
88+
},
89+
href: "#",
90+
status: {
91+
tag: {
92+
text: "Incomplete",
93+
classes: "nhsuk-tag--blue"
94+
}
95+
}
96+
},
97+
{
98+
title: {
99+
text: "Blood test"
100+
},
101+
status: {
102+
text: "Cannot start yet",
103+
classes: "nhsuk-task-list__status--cannot-start-yet"
104+
}
105+
}
106+
]
107+
}) }}
108+
109+
{{ button({
110+
text: "Continue"
111+
}) }}
112+
</div>
113+
</div>
114+
115+
</main>
116+
</div>
117+
118+
{% endblock %}

app/pages/examples.njk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@
125125
<li><a href="../components/tables/tables-panel.html">Table as a panel</a></li>
126126
<li><a href="../components/tabs/index.html">Tabs</a> <strong class="nhsuk-tag nhsuk-tag--yellow">Experimental</strong></li>
127127
<li><a href="../components/tag/index.html">Tag</a></li>
128+
<li><a href="../components/task-list/index.html">Task list</a></li>
129+
<li><a href="../components/task-list/multiple-sections.html">Task list with multiple sections</a></li>
128130
<li><a href="../components/textarea/index.html">Textarea</a></li>
129131
<li><a href="../components/textarea/autocomplete.html">Textarea with autocomplete attribute</a></li>
130132
<li><a href="../components/textarea/error.html">Textarea with error message</a></li>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nhsuk-frontend",
3-
"version": "9.0.1",
3+
"version": "9.1.0",
44
"description": "NHS.UK frontend contains the code you need to start building user interfaces for NHS websites and services.",
55
"engines": {
66
"node": ">=20.0.0"

0 commit comments

Comments
 (0)