-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
force-pushed
the
remove_email_signup_button
branch
from
December 6, 2024 16:48
7881360
to
473a516
Compare
hannako
force-pushed
the
remove_email_signup_button
branch
from
December 6, 2024 17:22
473a516
to
38b8036
Compare
hannako
force-pushed
the
remove_email_signup_button
branch
from
December 9, 2024 11:44
38b8036
to
e886e37
Compare
unoduetre
reviewed
Dec 9, 2024
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.
I've only added some comments which I think would improve the readability and one comment about adding some tests.
hannako
force-pushed
the
remove_email_signup_button
branch
from
December 9, 2024 14:37
e886e37
to
dedfbf6
Compare
hannako
force-pushed
the
remove_email_signup_button
branch
from
December 9, 2024 14:45
dedfbf6
to
7156c54
Compare
hannako
force-pushed
the
remove_email_signup_button
branch
from
December 9, 2024 15:02
7156c54
to
22053d5
Compare
This was missed from 4d2c8a4 No behavioural changes here, just making sure that we follow the same pattern for all document types
hannako
force-pushed
the
remove_email_signup_button
branch
from
December 9, 2024 15:49
22053d5
to
e5c7f0d
Compare
hannako
force-pushed
the
remove_email_signup_button
branch
from
December 9, 2024 16:00
e5c7f0d
to
33337d8
Compare
hannako
force-pushed
the
remove_email_signup_button
branch
from
December 9, 2024 16:14
33337d8
to
5252313
Compare
hannako
force-pushed
the
remove_email_signup_button
branch
from
December 9, 2024 16:19
5252313
to
7e2ee4b
Compare
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
force-pushed
the
remove_email_signup_button
branch
from
December 10, 2024 10:27
7e2ee4b
to
61e9074
Compare
unoduetre
approved these changes
Dec 10, 2024
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.
Looks good to me.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
gem. The logic for this button is already very complicated, and adding further complexity
feels like a bad idea.
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
Review app
Trello