-
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
Refactor Brexit callout #1958
Refactor Brexit callout #1958
Conversation
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.
8406ead
to
8f931a8
Compare
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).
8f931a8
to
a494556
Compare
module NoDealNotice | ||
def has_no_deal_notice? | ||
module BrexitNotice | ||
def has_brexit_notice? | ||
content_item.dig("details").key?("brexit_no_deal_notice") |
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.
mmm yeah, that's a good reminder for future eh?
overly descriptive names for things that might get hijacked in future!
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.
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!
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.
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.
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.