Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide email signup button from pages that do not have an :en locale #3467

Merged
merged 6 commits into from
Dec 10, 2024

Conversation

hannako
Copy link
Contributor

@hannako hannako commented Dec 6, 2024

What

Hide the single page notification button from pages that are not published in English.

Why

GOV.UK does not support email subscriptions to foreign language content. The single page notification button was added to all pages (English and foreign language). The consequence has been users signing up to an email subscription that will never match a content change.

We could make the button work so that clicking the button on eg a welsh page results
in the user signing up to the equivalent content in English. But we decided against this for the following reasons:

  1. There is no indication that there is a user need for that behaviour
  2. The code to fetch the english base-path would be added to the button component in the
    gem. The logic for this button is already very complicated, and adding further complexity
    feels like a bad idea.
  3. Not all our publishing applications create foreign content with a link back to the english
    version. So if the button was added to other content types in the future it wouldn't work as
    expected eg https://www.gov.uk/api/content/budd-dal-plant-16-19
  4. Hiding the signup button is the same approach used elsewhere.
Before After
Screenshot 2024-12-06 at 16 50 52 Screenshot 2024-12-06 at 16 50 21

Review app

Trello

@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 6, 2024 16:16 Inactive
@hannako hannako changed the title Remove email signup button Hide email signup button from pages that do not have an :en locale Dec 6, 2024
@hannako hannako force-pushed the remove_email_signup_button branch from 7881360 to 473a516 Compare December 6, 2024 16:48
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 6, 2024 16:49 Inactive
@hannako hannako force-pushed the remove_email_signup_button branch from 473a516 to 38b8036 Compare December 6, 2024 17:22
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 6, 2024 17:22 Inactive
@hannako hannako force-pushed the remove_email_signup_button branch from 38b8036 to e886e37 Compare December 9, 2024 11:44
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 9, 2024 11:44 Inactive
@hannako hannako marked this pull request as ready for review December 9, 2024 11:54
Copy link
Contributor

@unoduetre unoduetre left a comment

Choose a reason for hiding this comment

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

I've only added some comments which I think would improve the readability and one comment about adding some tests.

@hannako hannako force-pushed the remove_email_signup_button branch from e886e37 to dedfbf6 Compare December 9, 2024 14:37
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 9, 2024 14:38 Inactive
@hannako hannako force-pushed the remove_email_signup_button branch from dedfbf6 to 7156c54 Compare December 9, 2024 14:45
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 9, 2024 14:45 Inactive
@hannako hannako force-pushed the remove_email_signup_button branch from 7156c54 to 22053d5 Compare December 9, 2024 15:02
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 9, 2024 15:02 Inactive
This was missed from  4d2c8a4

No behavioural changes here, just making sure that we follow the same pattern for all
document types
@hannako hannako force-pushed the remove_email_signup_button branch from 22053d5 to e5c7f0d Compare December 9, 2024 15:49
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 9, 2024 15:50 Inactive
@hannako hannako force-pushed the remove_email_signup_button branch from e5c7f0d to 33337d8 Compare December 9, 2024 16:00
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 9, 2024 16:00 Inactive
@hannako hannako force-pushed the remove_email_signup_button branch from 33337d8 to 5252313 Compare December 9, 2024 16:14
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 9, 2024 16:15 Inactive
@hannako hannako force-pushed the remove_email_signup_button branch from 5252313 to 7e2ee4b Compare December 9, 2024 16:19
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 9, 2024 16:20 Inactive
GOV.UK does not support email subscriptions to foreign language content.
The single page notification button is present on the following document types,
regardless of their locale: document collections, detailed guides, publications,
call for evidence and consultations (except those pages that have a hardcoded exception [1]).
The consequence has been users signing up to an email subscription that will never match a content change [2]

We could make the button work so that clicking the button on eg a welsh page results
in the user signing up to the equivalent content in English. But we decided against this:

1. There is no indication that there is a user need for that behaviour
2. The code to fetch the english base-path would be added to the button component in the
gem. The logic for this button is already very complicated, and adding further complexity
feels like a bad idea.
3. Not all our publishing applications create foreign content with a link back to the english
version. So if the button was added to other content types in the future it wouldn't work as
expected eg https://www.gov.uk/api/content/budd-dal-plant-16-19
4. Hiding the signup button is the same approach used elsewhere [3]

[1] https://github.com/alphagov/government-frontend/blob/e7b9db33536f487991ba907502080e0625a066cc/app/presenters/content_item/single_page_notification_button.rb#L4
[2] https://github.com/alphagov/email-alert-service/blob/main/email_alert_service/models/major_change_message_processor.rb#L23-L26
[3] https://github.com/alphagov/collections/blob/ea307473313aa5138e6db6dd16eb26f1bf453bfd/app/views/world_location_news/show.html.erb#L56-L86
Following the pattern in this repo of having small module that are
inherited by the document type presenter.
@hannako hannako force-pushed the remove_email_signup_button branch from 7e2ee4b to 61e9074 Compare December 10, 2024 10:27
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3467 December 10, 2024 10:28 Inactive
Copy link
Contributor

@unoduetre unoduetre 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 to me.

@hannako hannako merged commit aa2639f into main Dec 10, 2024
11 checks passed
@hannako hannako deleted the remove_email_signup_button branch December 10, 2024 10:47
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.

3 participants