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

Refactor Brexit callout #1958

Merged
merged 2 commits into from
Dec 30, 2020
Merged

Refactor Brexit callout #1958

merged 2 commits into from
Dec 30, 2020

Conversation

benthorner
Copy link
Contributor

https://trello.com/c/kUqdYsCD/746-update-the-wording-of-the-whitehall-brexit-callout-box

This makes a couple of changes to make future updates to the
callout easier. Please see the commits for more details.

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

@bevanloon bevanloon temporarily deployed to government-f-refactor-n-hmgm9e December 29, 2020 15:38 Inactive
Previously we introduced this notice to inform users of a "no-deal"
outcome, but it has since been re-used for a "deal". While we can't
easily change the attributes in the content item, we can at least
fix the inaccurate terminology within this app.
@bevanloon bevanloon temporarily deployed to government-f-refactor-n-hmgm9e December 29, 2020 15:44 Inactive
Previously we had a generic "header notice" component that was only
actually used once. While we should aim for generic components, the
behaviour of this one is clearly coupled to the needs of Brexit. By
clearly marking it as a "brexit thing", we:

- Make it easier to identify for removal, along with other bits of
code that were only added around the transition period.

- Make it more flexible, without having to worry about accomodating
other use cases (since there are none).
@bevanloon bevanloon temporarily deployed to government-f-refactor-n-hmgm9e December 29, 2020 15:50 Inactive
module NoDealNotice
def has_no_deal_notice?
module BrexitNotice
def has_brexit_notice?
content_item.dig("details").key?("brexit_no_deal_notice")
Copy link
Member

Choose a reason for hiding this comment

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

mmm yeah, that's a good reminder for future eh?
overly descriptive names for things that might get hijacked in future!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's an interesting one: going in it may have appeared like a more specific naming was better (the old "avoid premature refactoring" mantra). I expect the product thinking at the time was all around "a brexit notice for a no deal scenario". As developers, the onus was really on us to ask: would we ever have more than one brexit notice? Even if we did, it would still be possible to distinguish them i.e. the future risk of confusion was always low.

Oh well. Easy to say all this with hindsight!

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.

Yep great work.
I partcularly agree with the thinking beind the second commit.

Things like that made tearing down some parts of the old brexit business finder much easier!
Especially when the app was old and it was approached with less context.

@benthorner benthorner merged commit 84635dc into master Dec 30, 2020
@benthorner benthorner deleted the refactor-no-deal branch December 30, 2020 11:41
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