Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Create SummaryList View, ViewComponent and Model#37

Merged
akdalin-hee merged 3 commits into
mainfrom
feature/TD-5211-Create-summarylist-view-component
May 1, 2025
Merged

Create SummaryList View, ViewComponent and Model#37
akdalin-hee merged 3 commits into
mainfrom
feature/TD-5211-Create-summarylist-view-component

Conversation

@akdalin-hee
Copy link
Copy Markdown

Description

Create SummaryList View, VIewComponent and Model

Screenshots

Paste screenshots for all views created or changed: mobile, tablet and desktop, wave analyser showing no errors.
image


Developer checks

(Leave tasks unticked if they haven't been appropriate for your ticket.)

I have:

  • Run the IDE auto formatter on all files I’ve worked on and made sure there are no IDE errors relating to them
  • Written or updated tests for the changes and made sure all tests are passing
  • Manually tested my work with and without JavaScript (adding notes where functionality requires JavaScript)
  • Tested with Wave Chrome plugin. Addressed any valid accessibility issues and documented any invalid errors
  • Scanned over my pull request in GitHub and addressed any warnings from the GitHub Build and Test checks in the GitHub PR ‘Files Changed’ tab
    Either:
  • Documented my work in Confluence, updating any business rules applied or modified. Updated GitHub readme/documentation for the repository if appropriate. List of documentation links added/changed:
  • Confirmed that none of the work that I have undertaken requires any updates to documentation
  • CHANGELOG entry

@akdalin-hee akdalin-hee changed the title Create SummaryList View, VIewComponent and Model Create SummaryList View, ViewComponent and Model Feb 26, 2025
Copy link
Copy Markdown

@kevwhitt-hee kevwhitt-hee left a comment

Choose a reason for hiding this comment

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

See inline code comment suggestion for suggested changes, otherwise this looks good.

@listItem.Description
</dd>

<dd class="nhsuk-summary-list__actions">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To cope with summary lists without actions (e.g. https://service-manual.nhs.uk/design-example/components/summary-list/without-action?fullpage=undefined&blankpage=undefined) we should include an if block outside this dd tag to check whether any of the items in SummaryListItem have an ActionUrl - we can do this once rather than every time by assigning true false to a hasActions param at the top.

Copy link
Copy Markdown
Author

@akdalin-hee akdalin-hee Mar 4, 2025

Choose a reason for hiding this comment

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

Just to be sure I well understand. You are suggesting checking once per SummaryList if the actionUrl is present, instead of checking for each row. This assumes that for each SummaryList either all rows have it or no row has it. Is that correct? (as opposed to, one row may have it, but another may not)

In the current implementation each row item comes with title and description required and optional action name and action url. Whilst the check for existing action name and url is done within the <dd> instead of externally so that the <dd> will always be present whether empty or populated (because if removed, it removes also the styling that come with it, in this case, the bottom border that comes with the class nhsuk-summary-list__actions, making it look like the example below where the border extends only until the end of the description)

image

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just to be sure I well understand. You are suggesting checking once per SummaryList if the actionUrl is present, instead of checking for each row. This assumes that for each SummaryList either all rows have it or no row has it. Is that correct? (as opposed to, one row may have it, but another may not)

In the current implementation each row item comes with title and description required and optional action name and action url. Whilst the check for existing action name and url is done within the <dd> instead of externally so that the <dd> will always be present whether empty or populated (because if removed, it removes also the styling that come with it, in this case, the bottom border that comes with the class nhsuk-summary-list__actions, making it look like the example below where the border extends only until the end of the description)

image

Yes, that's correct. We should check across the list because we should include an empty

for an item that doesn't have an action if some of the other items do to avoid the line length mismatch in you screenshot.

Copy link
Copy Markdown

@kevwhitt-hee kevwhitt-hee left a comment

Choose a reason for hiding this comment

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

See code comment, what do you think?

{
<dd class="nhsuk-summary-list__actions">

<a href=@listItem.ActionUrl>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Might it be more robust if we passed this asp-controller=, asp-action= and asp-all-route-data= parameters rather than relying on the dev to manually generate the URL?

It would stop us from having to handle/work out different domain routes for different environments and/or relative paths.

Copy link
Copy Markdown

@kevwhitt-hee kevwhitt-hee left a comment

Choose a reason for hiding this comment

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

Looks good.

@akdalin-hee akdalin-hee merged commit 513e380 into main May 1, 2025
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants