Skip to content

Commit

Permalink
Update button to skip the govuk-account
Browse files Browse the repository at this point in the history
The single page notification button component, by default, enforces
creating/signing in to a gov.uk account. It has a default form action
of "/email/subscriptions/single-page/new".
Passing in the optional paramater `skip_account` sets a form action of
"/email-signup" which does not enforce the gov.uk account

See govuk_publishing_components/presenters/single_page_notification_button_helper.rb#L63-L69
  • Loading branch information
hannako committed Jul 3, 2023
1 parent a41d30e commit ecea8c8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/content_items/document_collection.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</div>

<%= render 'shared/publisher_metadata_with_logo' %>
<%= render 'shared/single_page_notification_button', content_item: @content_item %>
<%= render 'shared/single_page_notification_button', content_item: @content_item, skip_account: "true" %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<% add_view_stylesheet("published-dates-button-group") %>
<% skip_account = skip_account || "false" %>

<%= render 'components/published_dates', {
published: @content_item.published,
Expand All @@ -13,6 +14,7 @@
js_enhancement: @has_govuk_account,
button_location: "bottom",
margin_bottom: 3,
skip_account: skip_account,
} if @content_item.has_single_page_notifications? %>
<%= render "govuk_publishing_components/components/print_link", {
margin_top: 0,
Expand Down
3 changes: 3 additions & 0 deletions app/views/shared/_single_page_notification_button.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<% skip_account = skip_account || "false" %>

<%= render 'govuk_publishing_components/components/single_page_notification_button', {
base_path: @content_item.base_path,
js_enhancement: @has_govuk_account,
margin_bottom: 6,
button_location: "top",
skip_account: skip_account,
} if @content_item.has_single_page_notifications? %>

0 comments on commit ecea8c8

Please sign in to comment.