Conversation
|
@frankieroberto Oooh, I was thinking of trying this, glad you’ve taken up the challenge! How does it fair? |
|
@paulrobertlloyd well it’s not working yet. Need to take some time to go through all the errors one by one. I’d like to switch the package from CommonJS to ESM modules but probably it needs to work with both for a while?! One other issue is that your prototype uses |
|
@frankieroberto Give up!? |
|
@paulrobertlloyd no just ran out of time that night! Will pick this up again soon. Might end up being a Christmas break project. Feel free to push any commits if you spot anything. |
|
@paulrobertlloyd ok, 1 step closer to working. I’ve updated the kit ( However all the pages throw an error - which I think is because the prototype is now missing all Postgres database stuff. Looks like the One for another day! |
|
@paulrobertlloyd Need you to add a We should ideally add a |
|
@colinrotherham there was already a @paulrobertlloyd give it a test? |
f5454e9 to
b9a8a35
Compare
c1b7288 to
e20ae6a
Compare
The prototype kit currently expects this, and it can't be configured.
e20ae6a to
ed2a6b3
Compare
ed2a6b3 to
c7ee0da
Compare
c7ee0da to
69a8a0c
Compare
3bbf5fa to
4215a0f
Compare
…nhsuk/manage-vaccinations-in-schools-prototype into use-nhsuk-prototype-kit-package
|
This is mostly working now, but one outstanding issue is I thought adding the following would work: app.use(express.json())
app.use(
express.urlencoded({
extended: true
})
)As this is used in the Rig. However this made no difference. This’ll need some more digging to resolve. |
|
@paulrobertlloyd can you remember which pages/routes the |
| sessionDataDefaults | ||
| }) | ||
|
|
||
| prototype.app.set('view engine', 'njk') |
There was a problem hiding this comment.
Does this break all the internal error views etc that use .html extensions?
Or basic things like password.html in Heroku?
I've proposed a fix in nhsuk/nhsuk-prototype-kit-package#260
But otherwise, could you add the extensions manually for now?
- response.render('dashboard')
+ response.render('dashboard.njk')| prototype.nunjucks?.addGlobal(key, value) | ||
| } | ||
|
|
||
| prototype.start(2000) |
There was a problem hiding this comment.
We use this port for Browsersync now, not Express
So assuming you want to continue using http://localhost:3000
| prototype.start(2000) | |
| prototype.start(3000) |
|
|
||
| const prototype = await NHSPrototypeKit.init({ | ||
| serviceName: 'Manage vaccinations in schools', | ||
| app, |
There was a problem hiding this comment.
This app will receive a second app.use(session) store 😔
I'm not quite sure how that might behave, unless it's somehow adding a different non-conflicting name to the request?
Similarly expect lots of async session weirdness:
- We reset using
req.session.data = {}notreq.session.regenerate() - We don't wait for
req.session.save()before redirecting after POST
Probably need to wait for (and help test) this new feature instead:
Try logging in as a nurse, going to an in progress session, and registering a child. And if that works, recording a vaccination. That whole flow is broken right now. |
This PR adds support for an (optional) Express `session` option for custom session stores This change unblocks NHSDigital/manage-vaccinations-in-schools-prototype#178 and uses: * `req.session.regenerate()` during session reset * `req.session.save()` after session reset ```mjs const prototype = await NHSPrototypeKit.init({ session: expressSession({ secret: 'Shhh' }) }) ``` We should test this feature with various asynchronous session stores
f453b8d to
f11a87a
Compare
A spike to see if/how the nhsuk-prototype-rig could be swapped out for the (not yet released) nhsuk-prototype-kit package.
Part of nhsuk/nhsuk-prototype-kit-package#49