Skip to content

Commit

Permalink
Merge branch 'main' into upgrade-sass
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieroberto authored Nov 7, 2024
2 parents a5728e4 + 1ba3a91 commit fba1cdb
Show file tree
Hide file tree
Showing 21 changed files with 565 additions and 11 deletions.
45 changes: 38 additions & 7 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@ name: Pull request
on: pull_request

jobs:
build:
name: Pull request
sonar_analysis:
name: Sonar analysis
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Sonar analysis
uses: sonarsource/sonarcloud-github-action@master
with:
Expand All @@ -27,11 +23,46 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

linting:
name: Code style checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint

tests:
name: Javascript unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test

ui_tests:
name: Visual regression tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Run backstop
run: npm run backstop:ci
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# NHS.UK frontend Changelog

## Unreleased
## 9.1.0 - 4 November 2024

:new: **New features**

- Add task list component ([PR 969](https://github.com/nhsuk/nhsuk-frontend/pull/969))

:wrench: **Fixes**

Expand Down
81 changes: 81 additions & 0 deletions app/components/task-list/index.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{% set html_style = 'background-color: #f0f4f5;' %}
{% set title = 'Task list' %}
{% from 'components/task-list/macro.njk' import taskList %}
{% extends 'layout.njk' %}

{% block body %}

<div class="nhsuk-width-container">
<main class="nhsuk-main-wrapper" id="maincontent">

<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
{{ taskList({
idPrefix: "your-health",
items: [
{
title: {
text: "Exercise"
},
href: "#",
status: {
text: "Completed",
classes: "nhsuk-task-list__status--completed"
}
},
{
title: {
text: "Personal health"
},
href: "#",
status: {
text: "Completed",
classes: "nhsuk-task-list__status--completed"
}
},
{
title: {
text: "Family health history"
},
hint: {
text: "Details of your parents and siblings"
},
href: "#",
status: {
tag: {
text: "Incomplete",
classes: "nhsuk-tag--blue"
}
}
},
{
title: {
text: "Smoking history"
},
href: "#",
status: {
tag: {
text: "Incomplete",
classes: "nhsuk-tag--blue"
}
}
},
{
title: {
text: "Blood test"
},
status: {
text: "Cannot start yet",
classes: "nhsuk-task-list__status--cannot-start-yet"
}
}
]
}) }}

</div>
</div>

</main>
</div>

{% endblock %}
118 changes: 118 additions & 0 deletions app/components/task-list/multiple-sections.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{% set html_style = 'background-color: #f0f4f5;' %}
{% set title = 'Task list' %}
{% from 'components/task-list/macro.njk' import taskList %}
{% from 'components/button/macro.njk' import button %}
{% extends 'layout.njk' %}

{% block body %}

<div class="nhsuk-width-container">
<main class="nhsuk-main-wrapper" id="maincontent">

<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
<h1 class="nhsuk-heading-l">Service name</h1>

<h2 class="nhsuk-heading-m">Check before you start</h2>
{{ taskList({
idPrefix: "before-you-start",
items: [
{
title: {
text: "Check eligibility"
},
href: "#",
status: {
text: "Completed",
classes: "nhsuk-task-list__status--completed"
}
},
{
title: {
text: "Read declaration"
},
href: "#",
status: {
tag: {
text: "Incomplete",
classes: "nhsuk-tag--blue"
}
}
}
]
}) }}

<h2 class="nhsuk-heading-m">Prepare application</h2>

{{ taskList({
idPrefix: "your-health",
items: [
{
title: {
text: "Exercise"
},
href: "#",
status: {
text: "Completed",
classes: "nhsuk-task-list__status--completed"
}
},
{
title: {
text: "Personal health"
},
href: "#",
status: {
text: "Completed",
classes: "nhsuk-task-list__status--completed"
}
},
{
title: {
text: "Family health history"
},
hint: {
text: "Details of your parents and siblings"
},
href: "#",
status: {
tag: {
text: "Incomplete",
classes: "nhsuk-tag--blue"
}
}
},
{
title: {
text: "Smoking history"
},
href: "#",
status: {
tag: {
text: "Incomplete",
classes: "nhsuk-tag--blue"
}
}
},
{
title: {
text: "Blood test"
},
status: {
text: "Cannot start yet",
classes: "nhsuk-task-list__status--cannot-start-yet"
}
}
]
}) }}

{{ button({
text: "Continue"
}) }}
</div>
</div>

</main>
</div>

{% endblock %}
2 changes: 2 additions & 0 deletions app/pages/examples.njk
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
<li><a href="../components/tables/tables-panel.html">Table as a panel</a></li>
<li><a href="../components/tabs/index.html">Tabs</a> <strong class="nhsuk-tag nhsuk-tag--yellow">Experimental</strong></li>
<li><a href="../components/tag/index.html">Tag</a></li>
<li><a href="../components/task-list/index.html">Task list</a></li>
<li><a href="../components/task-list/multiple-sections.html">Task list with multiple sections</a></li>
<li><a href="../components/textarea/index.html">Textarea</a></li>
<li><a href="../components/textarea/autocomplete.html">Textarea with autocomplete attribute</a></li>
<li><a href="../components/textarea/error.html">Textarea with error message</a></li>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nhsuk-frontend",
"version": "9.0.1",
"version": "9.1.0",
"description": "NHS.UK frontend contains the code you need to start building user interfaces for NHS websites and services.",
"engines": {
"node": ">=20.0.0"
Expand Down
Loading

0 comments on commit fba1cdb

Please sign in to comment.