govuk-one-login / service-header

A header for services using GOV.UK One Login
https://govuk-one-login.github.io/service-header/
6 stars 4 forks source link

GUA-899: Add Prototype Kit plugin config #14

Closed danacotoran closed 1 year ago

danacotoran commented 1 year ago

What

Note: it looks like loads of files changed in this one but this is because dist is all compiled files, and some of the assets under docs were moved into a subfolder.

Implement configuration to make it easier for users of the prototype kit to install the header in their prototypes for user research. This configuration specifies load paths for the SCSS and JS as well as Nunjucks paths making it so that the Nunjucks template for the header can be included easily into any Prototype Kit project.

These changes do not make it that the header will automatically appear in the list of available plugins in the Prototype Kit UI. For that to happen the header must be added manually to an allow list of plugins by someone from the Prototype Kit team.

However, the header doesn't need to be on the list of plugins to be usable, it could still be installed using npm install github:alphagov/di-govuk-one-login-service-header

Other changes

Why

Our team had a meeting with folks working on the Prototype kit where they outlined steps to make the header easier to install for users of the Prototype Kit.

One of the suggestions was to make our header repo a prototype kit “plugin” for easy installation by less technical folks.

alex9smith commented 1 year ago

The install scripts etc. all look sensible. I figured the best way to test this was to use the plugin

I set up a new prototype kit app

mkdir prototype-kit-testing
cd prototype-kit-testing
npx govuk-prototype-kit-create

Then I installed the header plugin from this branch and started the kit

npm install github:alphagov/di-govuk-one-login-service-header#prototype-example
npm run dev

I can see the plugin in the list: image

Clicking 'Create' makes a new page as I'd expect.

I did see that the body text in the created page and preview pages wasn't styled. Is that intentional? image

Could we also change the name of the plugin and drop the 'Di' prefix (so it's GOV.UK One Login service header)? I don't think we use the Digital Identity name when we're talking about One Login.

danacotoran commented 1 year ago

@alex9smith thanks for the feedback and for testing; the name of the plugin should have been changed now to remove the "DI" bit.

I did see that the body text in the created page and preview pages wasn't styled. Is that intentional?]

The way typography works in the DS is text isn't styled by default so you need to apply some type of class to individual elements to make a paragraph look like a paragraph (govuk-body) or a link look like a link (govuk-link) etc. In this case I don't think it really matters since they would be replacing that bit with their own content anyway... 🤷🏻‍♀️ I guess I could have left it empty but I just put some placeholder text as I figured it might make it easier for users to work out where to put their own content if they don't know already.

This was also tested by Anisa who was able to set it up herself with not too many difficulties. She only had some suggestions for the doc so I've updated it based on her feedback.