diff --git a/README.md b/README.md index d872444..1026b95 100755 --- a/README.md +++ b/README.md @@ -8,22 +8,6 @@ This prototype tests a digital alternative to phone-based lung health check ques Currently, lung health check assessments are conducted over the phone, often taking over 30 minutes and involving personal questions. This prototype explores whether users would prefer to complete these assessments digitally, in their own time and privacy. -## Current status - -**Version:** 1.0 -**Status:** Research prototype for user testing - -### Key features at a glance -- Complete end-to-end user journey -- Age validation (55-74 years eligible) -- NHS design system patterns and components -- Responsive design following NHS accessibility standards - -### Known limitations -- **Scoring system not implemented** - The prototype doesn't calculate weighted scores from answers in the background -- **Fixed outcome** - Currently shows high-risk result by default (with option to view low-risk alternative) -- **Research prototype only** - Not intended for clinical use - ## User journey The prototype guides users through: @@ -80,7 +64,7 @@ Built with the latest NHS prototype kit. No additional setup required beyond sta ```bash npm install -npm run watch +npm start ``` The prototype will be available at `http://localhost:3000` @@ -99,4 +83,4 @@ This is a research prototype. For questions or contributions, please contact the ## Licence -This prototype is built using the NHS prototype kit and follows the same licensing terms. \ No newline at end of file +This prototype is built using the NHS prototype kit and follows the same licensing terms. diff --git a/app/assets/sass/main.scss b/app/assets/sass/main.scss index 697b813..44aacac 100755 --- a/app/assets/sass/main.scss +++ b/app/assets/sass/main.scss @@ -2,3 +2,12 @@ @import "nhsuk-frontend/dist/nhsuk"; // Add your custom CSS/Sass styles below. +.nhsuk-summary-list__row { + border-bottom: 1px solid #d8dde0; +} + +.nhsuk-summary-list__key, +.nhsuk-summary-list__value, +.nhsuk-summary-list__actions { + border-bottom: none; +} diff --git a/app/filters.js b/app/filters.js index 28ad897..06d2b52 100644 --- a/app/filters.js +++ b/app/filters.js @@ -1,55 +1,60 @@ module.exports = function (env) { /* eslint-disable-line func-names,no-unused-vars */ - const filters = {}; + const filters = {} -filters.nhsDate = function(dateInput) { - // Handle empty input - if (!dateInput) { - return '' - } + filters.nhsDate = function(dateInput) { + // Handle empty input + if (!dateInput) { + return '' + } - let day, month, year + let day, month, year + + // Handle both array and object formats + if (Array.isArray(dateInput)) { + // Array format: [day, month, year] + if (dateInput.length !== 3) { + return '' + } + [day, month, year] = dateInput + } else if (typeof dateInput === 'object') { + // Object format: {day: x, month: y, year: z} + day = dateInput.day + month = dateInput.month + year = dateInput.year + } else { + return '' + } - // Handle both array and object formats - if (Array.isArray(dateInput)) { - // Array format: [day, month, year] - if (dateInput.length !== 3) { + // Handle empty values + if (!day || !month || !year) { return '' } - [day, month, year] = dateInput - } else if (typeof dateInput === 'object') { - // Object format: {day: x, month: y, year: z} - day = dateInput.day - month = dateInput.month - year = dateInput.year - } else { - return '' - } - // Handle empty values - if (!day || !month || !year) { - return '' - } + // Month names array (index 0 = January) + const monthNames = [ + 'January', 'February', 'March', 'April', 'May', 'June', + 'July', 'August', 'September', 'October', 'November', 'December' + ] - // Month names array (index 0 = January) - const monthNames = [ - 'January', 'February', 'March', 'April', 'May', 'June', - 'July', 'August', 'September', 'October', 'November', 'December' - ] + // Convert strings to numbers and validate + const dayNum = parseInt(day, 10) + const monthNum = parseInt(month, 10) + const yearNum = parseInt(year, 10) - // Convert strings to numbers and validate - const dayNum = parseInt(day, 10) - const monthNum = parseInt(month, 10) - const yearNum = parseInt(year, 10) + // Validate ranges + if (dayNum < 1 || dayNum > 31 || monthNum < 1 || monthNum > 12 || yearNum < 1000) { + return '' + } - // Validate ranges - if (dayNum < 1 || dayNum > 31 || monthNum < 1 || monthNum > 12 || yearNum < 1000) { - return '' - } + const date = new Date(yearNum, monthNum - 1, dayNum) - // Format: "1 January 2020" - return `${dayNum} ${monthNames[monthNum - 1]} ${yearNum}` -} + if (date.getFullYear() !== yearNum || date.getMonth() !== monthNum - 1 || date.getDate() !== dayNum) { + return '' + } + // Format: "1 January 2020" + return `${dayNum} ${monthNames[monthNum - 1]} ${yearNum}` + } - return filters; -}; + return filters +} diff --git a/app/views/prototype_v3/check-your-answers.html b/app/views/prototype_v3/check-your-answers.html index e37de46..12ec860 100644 --- a/app/views/prototype_v3/check-your-answers.html +++ b/app/views/prototype_v3/check-your-answers.html @@ -12,18 +12,6 @@ {% block content %} - -

{{pageHeading}}

@@ -1067,4 +1055,4 @@

Smoking habits

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/package.json b/package.json index 3a3a762..3e69f46 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "main": "app.js", "scripts": { "start": "node .", - "watch": "echo 'run this instead: npm start'" + "watch": "npm start" }, "author": "https://github.com/nhsuk/", "license": "MIT",