Create SummaryList View, ViewComponent and Model#37
Conversation
kevwhitt-hee
left a comment
There was a problem hiding this comment.
See inline code comment suggestion for suggested changes, otherwise this looks good.
| @listItem.Description | ||
| </dd> | ||
|
|
||
| <dd class="nhsuk-summary-list__actions"> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Just to be sure I well understand. You are suggesting checking once per
SummaryListif theactionUrlis present, instead of checking for each row. This assumes that for eachSummaryListeither 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 classnhsuk-summary-list__actions, making it look like the example below where the border extends only until the end of the description)
Yes, that's correct. We should check across the list because we should include an empty
kevwhitt-hee
left a comment
There was a problem hiding this comment.
See code comment, what do you think?
| { | ||
| <dd class="nhsuk-summary-list__actions"> | ||
|
|
||
| <a href=@listItem.ActionUrl> |
There was a problem hiding this comment.
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.


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.

Developer checks
(Leave tasks unticked if they haven't been appropriate for your ticket.)
I have:
Either:
Or: