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

Change single page notification button allow list to an exemption list #2356

Merged
merged 3 commits into from
Mar 1, 2022

Conversation

danacotoran
Copy link
Contributor

@danacotoran danacotoran commented Feb 4, 2022

The next stage for the single page notification rollout is to put the button on all pages with a publication, detailed_guide or consultation type.
The exemption mechanism will be a denylist. Publishers can request that the button not be included on certain individual pages. The way the exemption is applied is by adding the content_id of the page to the single page notification button exclusion list.

Implement notification button exemption list:

Change single page notification button allow list to an exemption list.

Switch from using base_paths to content_ids for long term stability (content ids persist, base paths can change)

Add some basic tests to verify that pages whose content item is on the exemption list do not display with the single page notification button.

Put account flash message on consultation:

This was missed in the previous PR which added the button to the consultation template. The success message is necessary to indicate when subscribing/unsubscribing to notifications has been completed.

Fix failing test:

.app-c-published-dates:last-of-type is failing because there is now another element after the published dates component.
The :last-of-type selector doesn't work the way one might assume on first glance, as in it doesn't apply to classes the same way that it applies to element selectors.
https://stackoverflow.com/questions/13211453/css-how-to-say-classlast-of-type-classes-not-elements


https://trello.com/c/4OWUb0no


⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

@govuk-ci govuk-ci temporarily deployed to government-f-button-eve-wx46jo February 4, 2022 10:23 Inactive
@govuk-ci govuk-ci temporarily deployed to government-f-button-eve-wx46jo February 4, 2022 11:42 Inactive
@govuk-ci govuk-ci temporarily deployed to government-f-button-eve-wx46jo February 4, 2022 11:46 Inactive
@govuk-ci govuk-ci temporarily deployed to government-f-button-eve-wx46jo February 4, 2022 16:17 Inactive
@govuk-ci govuk-ci temporarily deployed to government-f-button-eve-wx46jo February 4, 2022 17:45 Inactive
@govuk-ci govuk-ci temporarily deployed to government-f-button-eve-wx46jo February 8, 2022 09:44 Inactive
@govuk-ci govuk-ci temporarily deployed to government-f-button-eve-wx46jo February 8, 2022 10:01 Inactive
@govuk-ci govuk-ci temporarily deployed to government-f-button-eve-wx46jo February 8, 2022 12:40 Inactive
@danacotoran danacotoran changed the title [DO NOT MERGE][WIP] Change single page notification button allow list to an exemption list [DO NOT MERGE] Change single page notification button allow list to an exemption list Feb 8, 2022
@danacotoran danacotoran marked this pull request as ready for review February 8, 2022 12:57
@danacotoran danacotoran marked this pull request as draft February 8, 2022 13:05
@danacotoran danacotoran marked this pull request as ready for review February 22, 2022 11:41
Copy link
Member

@huwd huwd left a comment

Choose a reason for hiding this comment

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

Great work, really nice neat Ruby I think - and good catch on the flash and the test.
I wonder if we should add a test to catch the absence of the flash banner?

But generally this is a ✅
Gonna abuse the "request changes" feature to block any accidential merge of this until the 28th, when we've heard back from our last stakeholders.

@danacotoran danacotoran force-pushed the button-everywhere branch 5 times, most recently from 95adc4f to 614f431 Compare March 1, 2022 10:08
@danacotoran danacotoran requested a review from huwd March 1, 2022 11:59
@huwd huwd changed the title [DO NOT MERGE] Change single page notification button allow list to an exemption list Change single page notification button allow list to an exemption list Mar 1, 2022
Copy link
Member

@huwd huwd left a comment

Choose a reason for hiding this comment

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

Nice work on the new tests

This was missed in the previous PR which added the button to the
consultation template. The success message is necessary to indicate when
subscribing/unsubscribing to notifications has been completed

Update test to verify that the success banner appears as expected on all
publication types on which the single page notification button is
present.
".app-c-published-dates:last-of-type" is failing because there is now
another element after the published dates component.
Change single page notification button allow list to an exemption list.

Add tests to verify that pages whose content item is on the exemption
list do not display with the single page notification button.

Ensure that the button appears only on detailed_guides, publications and
consultations and update tests for all other types of publications to
check that the button is not included on those types.
@danacotoran danacotoran merged commit a4a8902 into main Mar 1, 2022
@danacotoran danacotoran deleted the button-everywhere branch March 1, 2022 14:24
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