Skip to content

[DTOSS-10296] split participant details into multiple sections#250

Merged
MatMoore merged 12 commits intomainfrom
DTOSS-10296-split-participant-details
Aug 11, 2025
Merged

[DTOSS-10296] split participant details into multiple sections#250
MatMoore merged 12 commits intomainfrom
DTOSS-10296-split-participant-details

Conversation

@MatMoore
Copy link
Copy Markdown
Contributor

@MatMoore MatMoore commented Aug 4, 2025

Description

This PR splits the personal details card into 3 separate cards, each with their own summary list. I've extracted all of these and the appointments card into macros to simplify the show template. These may be reused later on the appointment page, but for now the appointment page still has a big combined card, so I've left the old participant-details template in the code.

Screenshot showing summary lists for personal details, contact details and screening details, followed by the existing appointments card

I've also put in some tests for the bits I've extracted. These are not exhaustive, but I think we should move towards doing more testing at the component level as this is somewhere we have gaps in our unit test coverage, and I've noticed a couple of bugs slipping through.

Jira link

Review notes

The prototype is using a modified version of the summary list that allows extracting each row into a separate template, see this slack comment. While this is quite nice for reusing stuff across pages, I don't want to diverge from NHS.UK frontend components as it will add extra maintenance burden. For now I've just accepted a bit of duplication here.

I've also included a fix for a failing test - for some reason this didn't fail in CI but it did locally.

I've not added or removed any rows that weren't already there but there are some new bits in the prototype. I'm going to card these up separately.

Comment on lines +18 to +27
{
"key": {
"text": "Address"
},
"value": {
"html": address_html
}
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NHS summary list guidance wasn't updated with Showing missing information (GOV.UK) but what if the address is empty here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for phone and email I suppose

Copy link
Copy Markdown
Contributor Author

@MatMoore MatMoore Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think I'll park this one as well, we've got tickets to add the edit forms, so when that is done we will be linking to those.

{% endif %}

{% if mammogram.additional_information %}
<br>Additional information: {{ mammogram.additional_information | nl2br }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just me liking nicely indented HTML

If you wanted the new lines to match the (10 space) indent level of the first line:

Suggested change
<br>Additional information: {{ mammogram.additional_information | nl2br }}
<br>Additional information: {{ mammogram.additional_information | nl2br | indent(10) }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are indenting issues throughout so I'm going to leave this one for now. Higher priority is fixing the indenting in the NHS.UK frontend jinja components, especially the attributes macro which is very weird at the moment

Copy link
Copy Markdown
Contributor

@colinrotherham colinrotherham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are looking ace @MatMoore

Mostly comments unrelated to this PR that I've flagged

Although they raise good questions about checking one variables before presenting another, and/or whether we should show placeholder text (or omitting them entirely) when items don't exist

@MatMoore MatMoore force-pushed the DTOSS-10296-split-participant-details branch from 5715df3 to 8ffb650 Compare August 6, 2025 16:11
(not sure why this wasn't failing before)
This brings it inline with the general pattern of namespacing custom
components.

I've also made `__tag` the element and `--temporary` `--no-details` are
modifiers.
For the time being, there are additional djlint issues that need
correcting, but I'll fix them in a separate PR.
This is redundant - we can use the classes from the design system
instead.
@MatMoore MatMoore force-pushed the DTOSS-10296-split-participant-details branch from 3f8db9a to 9b9f57a Compare August 11, 2025 09:23
@MatMoore MatMoore merged commit 0108f4d into main Aug 11, 2025
7 checks passed
@MatMoore MatMoore deleted the DTOSS-10296-split-participant-details branch August 11, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants