-
Notifications
You must be signed in to change notification settings - Fork 5
Replaces custom breadcrumb component with govuk-component #509
Conversation
5851747
to
94cac1a
Compare
{ 'Home' => responsible_body_home_path }, | ||
title, | ||
]) %> | ||
<%= render GovukComponent::Breadcrumbs.new(breadcrumbs:{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to get rid of the syntactic sugar? (breadcrumbs
is much punchier than render GovukComponent::Breadcrumbs.new(breadcrumbs:
), and the "#{title}": ''
could also be cleaner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, I thought it would be best to try reduce all the extra fluff and just call the component directly but on second thought seeing the actual number of times we use the breadcrumbs it does seem rather long winded for an easier to remember call to breadcrumbs
. Also using the older rocket style for the hash will make it tidier to read instead of all the string interpolations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benilovj I've taking another stab at replacing the breadcrumbs. I've kept the view helper method as we discussed. I think this is good for another review and potential merge.
`govuk-components` gem includes a breadcrumb component. We should use this instead of maintaining our own custom one. This commit also replaces all the hardcoded breadcrumbs and standardises the breadcrumbs. I've still kept the breadcrumb view helper method for syntactic sugar. Inside this method I had to transform the array that comes in as it can include a hash (key is breadcrumb link text and value is breadcrumb path) and a string (last breadcrumb in the list and not usually linked to).
94cac1a
to
36d7284
Compare
Context
Apologies for the size of this PR, as you will see from the file changes, this will standardise our approach to breadcrumbs. Currently, there is a mixture of hardcoded markup in the view or a view helper method which uses a custom view component under the hood.
part of #466
Changes proposed in this pull request
Guidance to review