Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NHSDigital/manage-appointments-prototype
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6ce65a8332abd08609189801445e70db60149656
Choose a base ref
..
head repository: NHSDigital/manage-appointments-prototype
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e3b48214863fcc38720be5652ba46b4f6ff28c0e
Choose a head ref
Showing with 29,190 additions and 24,963 deletions.
  1. +39 −1 CHANGELOG.md
  2. +1 −1 CONTRIBUTING.md
  3. +17 −31 README.md
  4. +31 −2 app.js
  5. +34 −0 app/assets/javascript/autocomplete.js
  6. +2 −0 app/assets/javascript/main.js
  7. +167 −0 app/assets/sass/components/_autocomplete.scss
  8. +5 −8,533 app/assets/sass/components/_nhs-hero.scss
  9. +120 −0 app/assets/sass/components/_notification-banner.scss
  10. +100 −0 app/assets/sass/components/_print.scss
  11. +21 −0 app/assets/sass/main.scss
  12. +1 −4 app/config.js
  13. +155 −26 app/filters.js
  14. +28 −1 app/routes.js
  15. +32 −48 app/views/current/accessibility-statement.html
  16. +410 −390 app/views/current/bookings-scheduled.html
  17. +39 −0 app/views/current/filters.html
  18. +167 −0 app/views/current/manage-users.html
  19. +158 −0 app/views/current/okta-sign-in/check-and-add.html
  20. +84 −0 app/views/current/okta-sign-in/includes/sites.html
  21. +187 −0 app/views/current/okta-sign-in/manage-users.html
  22. +158 −0 app/views/current/okta-sign-in/new-user.html
  23. +101 −0 app/views/current/okta-sign-in/okta-sign-in.html
  24. +86 −0 app/views/current/okta-sign-in/search-user.html
  25. +66 −0 app/views/current/okta-sign-in/sign-in.html
  26. +193 −0 app/views/current/okta-sign-in/site-overview.html
  27. +81 −0 app/views/current/okta-sign-in/site-select.html
  28. +36 −0 app/views/current/okta-sign-in/welcome-email.html
  29. +28 −0 app/views/includes/_autocomplete.html
  30. +610 −0 app/views/includes/sites.html
  31. +19 −0 app/views/index.html
  32. +3 −3 app/views/layout-nhs-hero.html
  33. +3 −1 app/views/layout-top-nav.html
  34. +27 −410 app/views/test-page.html
  35. +0 −58 azure-pipelines.yml
  36. +1 −1 docs/views/layout.html
  37. +6 −3 docs/views/template.html
  38. +12 −10 gulpfile.js
  39. +24 −0 lib/example-templates/blank-transactional.html
  40. +162 −0 lib/example-templates/check-your-answers.html
  41. +37 −0 lib/example-templates/confirmation-page.html
  42. +32 −0 lib/example-templates/content-page.html
  43. +44 −0 lib/example-templates/index.html
  44. +2 −0 lib/example-templates/layout.html
  45. +60 −0 lib/example-templates/mini-hub/index.html
  46. +68 −0 lib/example-templates/mini-hub/page-2.html
  47. +66 −0 lib/example-templates/mini-hub/page-3.html
  48. +56 −0 lib/example-templates/question-page.html
  49. +44 −0 lib/example-templates/start-page.html
  50. +111 −0 lib/example-templates/template.html
  51. +6 −0 lib/example_templates_routes.js
  52. +47 −0 lib/middleware/authentication.js
  53. +45 −0 lib/middleware/auto-routing.js
  54. +22 −0 lib/middleware/production.js
  55. +37 −0 lib/middleware/prototype-admin-routes.js
  56. +25,081 −15,424 package-lock.json
  57. +18 −16 package.json
40 changes: 39 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,41 @@
# NHS.UK prototype kit Changelog
# NHS prototype kit Changelog

## 5.3.0 - 14 February 2025

- Update NHS Frontend to version 9.3.0, which includes a new Panel component
- Use strict https and automatic http to https redirects in production mode - ([PR 410](https://github.com/nhsuk/nhsuk-prototype-kit/pull/410))
- Update .devcontainer to remove the image attribute ([PR 451](https://github.com/nhsuk/nhsuk-prototype-kit/pull/451))

## 5.2.0 - 13 December 2024

- Updated start page template to use the `serviceName` variable in the h1 and title tag ([PR 414](https://github.com/nhsuk/nhsuk-prototype-kit/pull/414))
- Update Header to use the `serviceName` variable ([PR 417](https://github.com/nhsuk/nhsuk-prototype-kit/pull/417))
- Update default service name ([PR 419](https://github.com/nhsuk/nhsuk-prototype-kit/pull/419))
- Remove example page template with lots of content examples on it ([PR 420](https://github.com/nhsuk/nhsuk-prototype-kit/pull/420))
- Changed all references from 'NHS.UK prototype kit' to 'NHS prototype kit'
- Update default index page ([PR 423](https://github.com/nhsuk/nhsuk-prototype-kit/pull/423))
- Import task list component ([PR 437](https://github.com/nhsuk/nhsuk-prototype-kit/pull/437))
- The example page templates have moved from the `docs` folder to `lib/example-templates` - ([PR 409](https://github.com/nhsuk/nhsuk-prototype-kit/pull/409))
- The middleware folder has been moved into the `lib` folder - ([PR 440](https://github.com/nhsuk/nhsuk-prototype-kit/pull/440))
- Added a devcontainer.json file to configure Github Codespaces for use of the kit ([PR 428](https://github.com/nhsuk/nhsuk-prototype-kit/pull/428))


## 5.1.0 - 12 November 2024

- Remove guidance and tutorials - these can now be found online on the [NHS Prototype Kit website](https://prototype-kit.service-manual.nhs.uk) - ([PR 385](https://github.com/nhsuk/nhsuk-prototype-kit/pull/385))
- Update NHS frontend to 9.1.0
- Show errors when session data defaults crashes ([PR 402](https://github.com/nhsuk/nhsuk-prototype-kit/pull/402))

## 5.0.0 - 15 October 2024

:new: **New features**

- Update to NHS.UK frontend v9.0.1 - see [version 9.0.0 release notes](https://github.com/nhsuk/nhsuk-frontend/releases/tag/v9.0.0) for details on the breaking changes
- Drop `outerContent` block and use `beforeContent` block for both breadcrumbs and back links

:wrench: **Fixes**

- Updates to dependencies

## 4.12.0 - 15 August 2024

@@ -7,6 +44,7 @@
- Enable console logging for nodemon
- Replace basic auth with a custom authentication process
- Update NHS.UK frontend to [v8.3.0](https://github.com/nhsuk/nhsuk-frontend/releases/tag/v8.3.0)
- Fix setting PORT via the command line ([PR 347](https://github.com/nhsuk/nhsuk-prototype-kit/pull/347))

## 4.11.0 - 27 June 2024

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contribution guidelines

Thank you for your interest in contributing to NHS.UK prototype kit, we really appreciate it. There are a number of ways that you can contribute – reporting bugs, fixing bugs, suggesting new features or writing documentation.
Thank you for your interest in contributing to NHS prototype kit, we really appreciate it. There are a number of ways that you can contribute – reporting bugs, fixing bugs, suggesting new features or writing documentation.

## Contributing

48 changes: 17 additions & 31 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# NHS.UK prototype kit
# NHS prototype kit

Visit the <a href="http://nhsuk-prototype-kit.azurewebsites.net/docs">NHS.UK prototype kit site</a> to download the latest version and read the documentation.
Visit the <a href="https://prototype-kit.service-manual.nhs.uk">NHS prototype kit site</a> to download the latest version and read the documentation.

## About the NHS.UK prototype kit
## About the NHS prototype kit

The NHS.UK prototype kit enables you to make interactive prototypes that will look like pages on NHS.UK. The prototypes you make are a great way to show ideas to others and for conducting user research.
The NHS prototype kit enables you to make interactive prototypes that will look like pages on NHS.UK. The prototypes you make are a great way to show ideas to others and for conducting user research.

## Security

If you publish your prototypes online, they must be protected by a <a href="https://nhsuk-prototype-kit.azurewebsites.net/docs/how-tos/publish-your-prototype-online">username and password</a>. This is to prevent members of the public finding prototypes and thinking they are real services.
If you publish your prototypes online, they must be protected by a <a href="https://prototype-kit.service-manual.nhs.uk/how-tos/publish-your-prototype-online">username and password</a>. This is to prevent members of the public finding prototypes and thinking they are real services.

You must protect user privacy at all times, even when using prototypes. Prototypes made with the kit look like NHS.UK, but do not have the same security provisions. Always make sure you are handling user data appropriately.

## Installation instructions

- <a href="http://nhsuk-prototype-kit.azurewebsites.net/docs/install/simple">Install guide (non technical)</a>
- <a href="http://nhsuk-prototype-kit.azurewebsites.net/docs/install/advanced">Developer friendly install guide (technical)</a>
- <a href="https://prototype-kit.service-manual.nhs.uk/install/simple">Install guide (non technical)</a>
- <a href="https://prototype-kit.service-manual.nhs.uk/install/advanced">Developer friendly install guide (technical)</a>

### Running the kit

Start the kit with `npm run watch`.

## Contribute

If you want to contribute to the NHS.UK prototype kit, by reporting bugs, fixing bugs, suggesting new features or writing documentation, then read our [contributing guidelines](CONTRIBUTING.md).
If you want to contribute to the NHS prototype kit, by reporting bugs, fixing bugs, suggesting new features or writing documentation, then read our [contributing guidelines](CONTRIBUTING.md).

## Development environment

@@ -45,36 +45,22 @@ Read an <a href="https://www.gitpod.io/docs">introduction to Gitpod (on Gitpod's

Run unit tests locally with `npm run test`.

### Environments
### Making changes

#### Preview environment
- Merge required changes via pull requests into `main` branch. As you do so, document changes in the `CHANGELOG.md` under an 'Unreleased' header at the top.

Code pushed to the `main` branch will deploy on the [Preview environment](http://nhsuk-prototype-kit-preview.azurewebsites.net/).
### Releasing

#### Live

The live NHS.UK prototype kit [Live environment](https://nhsuk-prototype-kit.azurewebsites.net), accessible to the public.

__Note:__ Live is behind a server side cache which results in changes not appearing immediately.

### Versioning and deploying to live

- Merge required changes via PR into `main` branch
- Ensure the version number in `package.json` and `CHANGELOG.md` match, with a summary of the changes included in the changelog
- Verify the changes in the [Preview environment](http://nhsuk-prototype-kit-preview.azurewebsites.net/)
- Pull down merged `main` branch to your local repository
- Create a tag with the version number from the latest commit on `main`
- If the latest version you're looking to push is version "1.2.3", you can do this on the command line with
- `git tag v1.2.3`
- `git push --tags`
- [Github actions](https://github.com/nhsuk/nhsuk-prototype-kit/actions/workflows/release.yml) will spring to life and create a release which will be visible on the [releases tab](https://github.com/nhsuk/nhsuk-prototype-kit/releases) of the repository.
- Finally, edit the description of the release to match the content entered into the changelog.
- To deploy the changes to Live, the promotion to Live from the Preview environment must have the appropriate approval in Azure.
- Open a new pull request which changes the version number in `package.json` and `package-lock.json` and which updates the 'Unreleased' header in the `CHANGELOG.md` to the new version number and release date. Merge this into `main`.
- Visit the [Create a new release page](https://github.com/nhsuk/nhsuk-prototype-kit/releases/new) on GitHub. In the 'Choose a tag' dropdown, create a new tag for the new version number, prefixed with a `v`. Use the same format for the release title. You can use the 'Generate release notes' feature to generate some initial release notes, and then edit these as needed. Make sure the "Set as latest release" checkbox is checked. Publish the release (or save as draft if you’re not ready).
- Update the `prototypeKitVersion` value in [the `package.json` of the prototype kit website](https://github.com/nhsuk/nhsuk.service-manual.prototype-kit.docs/blob/main/package.json#L4) - this will update the 'Download' link to point to the new zip file.
- Add some details about the new release to the [What’s new page](https://github.com/nhsuk/nhsuk.service-manual.prototype-kit.docs/blob/main/app/views/whats-new/updates.html) on the prototype kit website
- Announce the new release on the Service Manual Slack, NHS England Slack, and any other appropriate locations

### Code Analysis

Code analysis results can be found in [SonarQube](https://sonar.nhswebsite.nhs.uk/dashboard?id=nhsuk-prototype-kit).

## Support

The NHS.UK prototype kit is maintained by NHS England. [Email us](mailto:service-manual@nhs.net), open a [Github issue](https://github.com/nhsuk/nhsuk-prototype-kit/issues/new) or get in touch on the [NHS digital service manual Slack workspace](https://join.slack.com/t/nhs-service-manual/shared_invite/enQtNTIyOTEyNjU3NDkyLTk4NDQ3YzkwYzk1Njk5YjAxYTI5YTVkZmUxMGQ0ZjA3NjMyM2ZkNjBlMWMxODVjZjYzNzg1ZmU4MWY1NmE2YzE).
The NHS prototype kit is maintained by NHS England. [Email us](mailto:service-manual@nhs.net), open a [Github issue](https://github.com/nhsuk/nhsuk-prototype-kit/issues/new) or get in touch on the [NHS digital service manual Slack workspace](https://join.slack.com/t/nhs-service-manual/shared_invite/enQtNTIyOTEyNjU3NDkyLTk4NDQ3YzkwYzk1Njk5YjAxYTI5YTVkZmUxMGQ0ZjA3NjMyM2ZkNjBlMWMxODVjZjYzNzg1ZmU4MWY1NmE2YzE).
33 changes: 31 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ const automaticRouting = require('./middleware/auto-routing');
const config = require('./app/config');
const locals = require('./app/locals');
const routes = require('./app/routes');
const documentationRoutes = require('./docs/documentation_routes');
// const documentationRoutes = require('./docs/documentation_routes');
const utils = require('./lib/utils');

const prototypeAdminRoutes = require('./middleware/prototype-admin-routes');
@@ -48,10 +48,13 @@ app.locals.serviceName = config.serviceName;
// Use cookie middleware to parse cookies
app.use(cookieParser());

// Nunjucks configuration for application
// Nunjucks configuration for application
const appViews = [
path.join(__dirname, 'app/views/'),
path.join(__dirname, 'node_modules/nhsuk-frontend/packages/components'),
// Add this line to include the macros directory
path.join(__dirname, 'node_modules/nhsuk-frontend/packages/macros'),
path.join(__dirname, 'docs/views/'),
path.join(__dirname, 'lib/prototype-admin/'),
];
@@ -63,12 +66,34 @@ const nunjucksConfig = {

nunjucksConfig.express = app;

// Find this section in your app.js (around line 66-68)

// Find this section in your app.js (around line 66-68)
let nunjucksAppEnv = nunjucks.configure(appViews, nunjucksConfig);
nunjucksAppEnv.addGlobal('version', packageInfo.version);

// Add Nunjucks filters
var filters = require('./app/filters')(nunjucksAppEnv);

// Add stringify filter for JSON handling (needed for autocomplete)
nunjucksAppEnv.addFilter('stringify', function(obj) {
return JSON.stringify(obj);
});

// Add dump filter as an alternative to stringify
nunjucksAppEnv.addFilter('dump', function(obj) {
return JSON.stringify(obj);
});

nunjucksAppEnv.addGlobal('version', packageInfo.version);

// Add Nunjucks filters from utils (only need this once)
utils.addNunjucksFilters(nunjucksAppEnv);






// Session uses service name to avoid clashes with other prototypes
const sessionName = `nhsuk-prototype-kit-${(Buffer.from(config.serviceName, 'utf8')).toString('hex')}`;
const sessionOptions = {
@@ -238,7 +263,11 @@ app.use((err, req, res) => {
res.send(err.message);
});



// Run the application
app.listen(port);



module.exports = app;
34 changes: 34 additions & 0 deletions app/assets/javascript/autocomplete.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// File: app/assets/javascript/autocomplete.js

// We can't use require or import statements directly in the browser
// Instead, we'll use the global version of the accessible-autocomplete library
document.addEventListener('DOMContentLoaded', function() {
// Check if the library is available globally (usually added via script tag)
if (typeof window.accessibleAutocomplete !== 'undefined') {
// Initialize function that we can call from our pages
window.initAccessibleAutocomplete = function(elementId, options) {
const container = document.getElementById(elementId + '-container');
const hiddenInput = document.getElementById(elementId + '-hidden');

if (!container) {
console.error('Could not find container element with ID:', elementId + '-container');
return;
}

window.accessibleAutocomplete({
element: container,
id: elementId,
source: options.source || [],
displayMenu: 'overlay',
confirmOnBlur: true,
onConfirm: function(selectedItem) {
if (hiddenInput && selectedItem) {
hiddenInput.value = selectedItem;
}
}
});
};
} else {
console.error('Accessible Autocomplete library not loaded. Make sure you\'ve included the script tag.');
}
});
2 changes: 2 additions & 0 deletions app/assets/javascript/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// ES6 or Vanilla JavaScript
// Add this line to your main.js file to import the autocomplete functionality
import './autocomplete.js'
Loading