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

Link to people instead of ministers #1100

Merged
merged 3 commits into from
Sep 28, 2018
Merged

Link to people instead of ministers #1100

merged 3 commits into from
Sep 28, 2018

Conversation

kevindew
Copy link
Member

Trello: https://trello.com/c/3GT17tkH/211-associate-content-with-ministers-l

This is marked as not to be merged due to requiring this: alphagov/govuk-content-schemas#816

The ministers link type is now deprecated as it serves the same purpose as people links and these contain the same data. This allows widening up to link to people with other role appointments.

As people document_types don't require a base_path it also does a check that those actually have links (this is something that can affect pretty much all links so there should probably be more checks across this app - but I'm not opening up that rabbit hole just yet)

@benthorner benthorner temporarily deployed to government-frontend-pr-1100 September 26, 2018 09:06 Inactive
@@ -54,6 +54,7 @@ def emphasised_organisations

def link_for_type(type, link)
return link_for_world_location(link) if type == "world_locations"
return unless link["base_path"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be a reject outside of the map, instead of having to do a compact?

@benthorner benthorner temporarily deployed to government-frontend-pr-1100 September 26, 2018 10:31 Inactive
Ministers is now deprecated [1] as it serves the same purpose as people
links and these contain the same data. This allows widening up to links
to people with other role appointments.

As people can not have a base_path this also removes links that don't
have pages.

[1]: https://github.com/alphagov/govuk-content-schemas/blob/76fe9441a2b9ec6f030735f012347dbe8eb6e331/formats/news_article.jsonnet#L47
This namespaces the DummyContentItem class inside the
ContentItemShareableTest class. This is done so that it doesn't use the
global namesapce of DummyContentItem which restricted this pattern to
only this single test (other tests that used it would break depending on
load order).
@benthorner benthorner temporarily deployed to government-frontend-pr-1100 September 26, 2018 14:30 Inactive
@kevindew
Copy link
Member Author

@benthorner Thanks, I went for a select rather than a reject as that felt more natural, unfortunately there's an annoying extra condition for world_locations

@benthorner
Copy link
Contributor

@kevindew fair enough, although should probably add a test to explain - I don't actually understand why.

Added in to explain a bit of the oddity here since it could get lost in
the annals of time.
Copy link
Contributor

@benthorner benthorner left a comment

Choose a reason for hiding this comment

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

👍

@kevindew kevindew changed the title [DO NOT MERGE] Link to people instead of ministers Link to people instead of ministers Sep 28, 2018
@kevindew kevindew merged commit cb343c6 into master Sep 28, 2018
@kevindew kevindew deleted the people branch September 28, 2018 15:43
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.

2 participants