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

Subscription links add colour and tracking #299

Merged
merged 5 commits into from
May 15, 2018

Conversation

andysellick
Copy link
Contributor

@andysellick andysellick commented May 8, 2018

Adds colour branding options and the ability to add tracking to the subscription links component.

Component guide: https://govuk-publishing-compon-pr-299.herokuapp.com/component-guide/subscription-links
Trello card: https://trello.com/c/NjgS3vym/55-modify-component-subscription-links

@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-299 May 8, 2018 12:25 Inactive
@andysellick andysellick requested a review from vanitabarrett May 8, 2018 13:44
feed_link_data = false
feed_link_data_attributes ||= {}

tracking_is_present = true if email_signup_link_data_attributes || !feed_link_data_attributes.empty?
Copy link
Contributor

Choose a reason for hiding this comment

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

!feed_link_data_attributes.empty? is a bit confusing. How about feed_link_data_attributes.any? ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that's much better.

@@ -1,39 +1,45 @@
<%
email_signup_link ||= false
email_signup_link_text ||= t("govuk_component.subscription_links.email_signup_link_text", default: "Get email alerts")
email_signup_link_data_attributes ||= false
Copy link
Contributor

Choose a reason for hiding this comment

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

This section at the top of the component is getting quite large now, and making it difficult to follow what's happening in the view. Can we move some of this logic out into a helper?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gave it a go but by the time I've passed everything I need out to the helper and back again I'm not sure it actually saves any lines of code.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do something like we do for the related navigation component and just pass through the local assigns?

<% related_nav_helper = GovukPublishingComponents::Presenters::RelatedNavigationHelper.new(local_assigns) %>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vanitabarrett ah good idea, I'd forgotten you can do that, thanks. Have moved the code into a helper.

@vanitabarrett
Copy link
Contributor

vanitabarrett commented May 8, 2018

Also possibly out of scope of this PR, but the component guide page for this component now errors because of a duplicate ID. It works when running on heroku etc, but stops you from viewing it locally.

@andysellick andysellick force-pushed the subscription-links-add-colour-and-tracking branch from b74ff83 to a2a0684 Compare May 9, 2018 08:46
@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-299 May 9, 2018 08:46 Inactive
@andysellick
Copy link
Contributor Author

@vanitabarrett have fixed the duplicate id problem, I'd spotted it but was being lazy :)

@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-299 May 10, 2018 10:03 Inactive
@andysellick andysellick force-pushed the subscription-links-add-colour-and-tracking branch from 2d2e237 to 57b635f Compare May 10, 2018 10:11
@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-299 May 10, 2018 10:11 Inactive
@andysellick andysellick force-pushed the subscription-links-add-colour-and-tracking branch from 57b635f to 8f52856 Compare May 10, 2018 14:47
@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-299 May 10, 2018 14:47 Inactive
@andysellick andysellick force-pushed the subscription-links-add-colour-and-tracking branch from 8f52856 to 7e2f1d4 Compare May 10, 2018 14:53
@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-299 May 10, 2018 14:53 Inactive
Copy link
Contributor

@vanitabarrett vanitabarrett left a comment

Choose a reason for hiding this comment

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

Helper refactor is much tidier! 👍 🎉

@andysellick andysellick force-pushed the subscription-links-add-colour-and-tracking branch from 7e2f1d4 to 4fbaf8b Compare May 11, 2018 14:07
@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-299 May 11, 2018 14:07 Inactive
- expand feed link test to check for toggle module
- improve template readability
- test modules are not added unless needed
- make test for data modules more specific
- make id for feed box unique
@andysellick andysellick force-pushed the subscription-links-add-colour-and-tracking branch from 4fbaf8b to f6fee99 Compare May 15, 2018 10:19
@andysellick andysellick merged commit a163fb3 into master May 15, 2018
@andysellick andysellick deleted the subscription-links-add-colour-and-tracking branch May 15, 2018 10:26
@andysellick andysellick mentioned this pull request May 15, 2018
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