alphagov / govuk_publishing_components

A gem to document and distribute frontend components for GOV.UK applications
https://components.publishing.service.gov.uk
MIT License
66 stars 20 forks source link

Review `metadata` component usage #3482

Open MartinJJones opened 1 year ago

MartinJJones commented 1 year ago

What

We have a metadata component available in the publishing components gem that can be used in rendering applications.

However, several applications appear to also have their own metadata components, applications could be using their own variation of the component for several reasons, either because the metadata component was not available at the time, or it does not provide all the requirements.

We should look to either directly replace the metadata components in the rendering app with the one from the publishing components gem, or update the metadata component in the gem where appropriate, so the app component can be replaced.

Why

The screenshots below show examples of the varying implementation of the metadata component, as well as the different HTML used, visually they will have different font-size, color and spacing.

Screenshots Comparisons

Content Data Admin

Publishing component Content data admin
metadata-gem content-data-admin

Frontend

Publishing component Frontend
metadata-last-updated metadata-government-frontend

Content Publisher

Publishing component Content publisher
metadata-gem-c-2-lines metadata-content-publisher

Government Frontend

Publishing component - inversed Government Frontend - metadata
metadata-inverse-gem-c government-frontend-important-metadata
Publishing component Government Frontend - published-dates
metadata-last-updated published-dates-metadata

In this example, the metadata component from the gem is already included at the top of this page - https://www.gov.uk/government/case-studies/2013-elections-in-swaziland, but an additional request for the published-dates is sent.

nnagewad commented 5 months ago

@MartinJJones do you have examples where I could see the non-publishing components in action?

Silly question, what will the impact be once front-end apps merge?

MartinJJones commented 5 months ago

@MartinJJones do you have examples where I could see the non-publishing components in action?

I've included some examples below, just let me know if you need any further info.

Application Example Comments
Content Publisher https://content-publisher.publishing.service.gov.uk/component-guide/metadata appears on the right hand side when editing a document in content publisher
Frontend https://www.gov.uk/bank-holidays included at the bottom of the page
Government Frontend https://components.publishing.service.gov.uk/component-guide/metadata Examples where this is used: https://www.gov.uk/government/case-studies/2013-elections-in-swaziland (at the end of the content). https://www.gov.uk/business-finance-support/access-to-finance-advice-north-west-england (important variation used at the top of the page

Silly question, what will the impact be once front-end apps merge?

I think this depends on the approach used when the frontend apps are merged, and if this only includes public facing frontend applications, is content-publisher included in the consolidation work for example. It's not something I've been directly involved in, but happy to discuss further, will provide any other info where I can 👍