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

Modify subscription links component #294

Merged
merged 1 commit into from
May 4, 2018

Conversation

andysellick
Copy link
Contributor

@andysellick andysellick commented May 2, 2018

The subscription links component is going to be used on the new organisation pages, but needs a few extra features adding.

  • add option to change link text
  • add option to turn feed link into a toggle to display an input box containing a link
  • includes toggle.js from static, included without changes (apart from the namespace) as a module outside of the component (so it can be used by other components if required)

Component guide link: https://govuk-publishing-compon-pr-294.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-294 May 2, 2018 13:33 Inactive
@andysellick andysellick force-pushed the iterate-subscription-links-component branch from 386aad3 to fc75a6d Compare May 2, 2018 13:34
@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-294 May 2, 2018 13:34 Inactive
@andysellick andysellick requested a review from vanitabarrett May 2, 2018 13:38
@andysellick andysellick changed the title Modify subscription links component [DO NOT MERGE] Modify subscription links component May 3, 2018
@andysellick andysellick force-pushed the iterate-subscription-links-component branch from fc75a6d to 4f6993c Compare May 4, 2018 07:39
@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-294 May 4, 2018 07:39 Inactive
@andysellick andysellick force-pushed the iterate-subscription-links-component branch from 4f6993c to cbe3988 Compare May 4, 2018 07:56
@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-294 May 4, 2018 07:56 Inactive
@andysellick andysellick changed the title [DO NOT MERGE] Modify subscription links component Modify subscription links component May 4, 2018
@andysellick andysellick force-pushed the iterate-subscription-links-component branch from cbe3988 to ca2a61e Compare May 4, 2018 08:34
@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-294 May 4, 2018 08:34 Inactive

<% if feed_link_box_value %>
<div class="gem-c-subscription-links__feed-box js-hidden" id="feed-reader">
<p class="gem-c-subscription-links__feed-description js-hidden"><%= feed_link_text %></p>
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the js-hidden means that this is never shown?

See this example in the component guide: https://govuk-publishing-compon-pr-294.herokuapp.com/component-guide/subscription-links/with_copyable_feed_link/preview

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If Javascript is disabled, it gets shown and the main feed link gets hidden. Seemed like a sensible way to keep the text but remove the link/button.

}

.gem-c-subscription-links__feed-description {
font-weight: bold;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be using our font mixins here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the only way to do that is to specify a font size as well? I deliberately didn't, because I didn't want to set a font size, only the weight.

@@ -1,21 +1,50 @@
<%
email_signup_link ||= false
email_signup_link_text ||= "Get email alerts"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this and the default feed link text be in locale files for translation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a bad idea, will add.

<% if email_signup_link || feed_link %>
<section class="gem-c-subscription-links">
<% if email_signup_link || feed_link || feed_link_box_value %>
<section class="gem-c-subscription-links" data-module="gem-toggle">
<h2 class="visuallyhidden">Subscriptions</h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here for using translated string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

feed_link_text: 'View feed'
with_copyable_feed_link:
description: |
This option changes the feed link to a toggle control, which opens a hidden element containing an input containing the value passed to the component, usually a URL to an atom feed. This uses the [form input](/component-guide/input) component.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: this reads a bit weirdly "..which opens a hidden element containing an input containing the value...".

Could we say "..which opens a hidden element containing an input prepopulated with the value...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Much better, thanks.

@andysellick andysellick force-pushed the iterate-subscription-links-component branch from ca2a61e to 41c7d53 Compare May 4, 2018 11:11
@tijmenb tijmenb temporarily deployed to govuk-publishing-compon-pr-294 May 4, 2018 11:11 Inactive
- add option to change link text
- add option to turn feed link into a toggle to display an input box containing a link
- includes toggle.js from static, included without changes
@andysellick andysellick force-pushed the iterate-subscription-links-component branch from 41c7d53 to 0ddaaa2 Compare May 4, 2018 11:57
@andysellick andysellick merged commit d4800f2 into master May 4, 2018
@andysellick andysellick deleted the iterate-subscription-links-component branch May 4, 2018 12:02
feed_link ||= false
feed_link_text ||= t("govuk_component.subscription_links.feed_link_text", default: "Subscribe to feed")
feed_link_box_value ||= 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 is way too late (again), but will feed_link_box_value ever be different from feed_link? Perhaps a boolean param to show the box or not would make it easier to use.

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