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

Add the news and communications section #1002

Merged
merged 3 commits into from
Jul 31, 2018
Merged

Conversation

sihugh
Copy link
Contributor

@sihugh sihugh commented Jul 31, 2018

News and communications are displayed differently from the other sections in that we show images from articles for the first three items. We'll show a placeholder if there isn't an image.

This functionality will be updated in future to get content images from rummager which removes the need to call content store for each item.

We'll also update this to display results as one list rather than as separate items. We have this as an item in the backlog, but it'll need work on a couple of components to achieve

I've also added tests for the services supergroup presenter, as these were missing

screen shot 2018-07-31 at 09 11 42

Examples:

You will need to have an extension like ModHeader installed in your browser to see the B Variant. The values should be:
Request Header Name: GOVUK-ABTest-ContentPagesNav
Request Header Value: B

Component guide for this PR:
https://government-frontend-pr-1002.herokuapp.com/component-guide

https://trello.com/c/XCqGIGZE/49-get-most-recent-news-and-communications-data

@benthorner benthorner temporarily deployed to government-frontend-pr-1002 July 31, 2018 08:15 Inactive
@sihugh sihugh force-pushed the news-announcements-nav branch from e9ab068 to 489e42e Compare July 31, 2018 08:16
@boffbowsh boffbowsh temporarily deployed to government-frontend-pr-1002 July 31, 2018 08:17 Inactive
@sihugh sihugh changed the title [WIP] News and communications section News and communications section Jul 31, 2018
@sihugh sihugh changed the title News and communications section Add the news and communications section Jul 31, 2018
href: promo[:link][:path],
heading_text: promo[:link][:text],
image_src: promo[:image][:url],
image_alt: "",
Copy link
Contributor

@vanitabarrett vanitabarrett Jul 31, 2018

Choose a reason for hiding this comment

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

We should be able to get the actual alt text of the image in news_and_communications.rb, I'd only set alt to "" if we're using the placeholder image.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, I think we talked about this in the accessibility session. I should have been a bit more overt. I think when the image is part of a link it should use the link text instead of the alt text? (I may be wrong).
Either way, I can add the alt text and it shouldn't make anything worse. 👍

sihugh added 3 commits July 31, 2018 13:30
Adding this flushed out that we were making an unnecessary request when taxon
ids weren't provided.
Using guids can be confusing for future us
News and comms are different from the other sections in that we show the image
from the article if it's a featured link (and the image is present).

This will be updated in future to get content images from rummager which
removes the need to call content store for each item.

We'll also update this to display results as one list rather than separate
items.
@sihugh sihugh merged commit 89cc08c into master Jul 31, 2018
@sihugh sihugh deleted the news-announcements-nav branch July 31, 2018 12:52
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.

4 participants