Giter Site home page Giter Site logo

alphagov / whitehall Goto Github PK

View Code? Open in Web Editor NEW
872.0 134.0 187.0 185.74 MB

Publishes government content on GOV.UK

Home Page: https://docs.publishing.service.gov.uk/apps/whitehall.html

License: MIT License

Ruby 81.27% JavaScript 2.45% HTML 13.46% Gherkin 2.01% Dockerfile 0.02% SCSS 0.71% Procfile 0.01% Shell 0.08%
govuk-publishing-frontend govuk container

whitehall's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whitehall's Issues

Rail Accident Investigation Branch "Independent Reports" don't appear in generic announcements.atom feed

Safety Digests ("Independent Reports") (which as far as I can tell are just RAIB's new name for Bulletins, which do appear) don't appear in this feed:

https://www.gov.uk/government/announcements.atom?departments[]=rail-accident-investigation-branch

But they do appear in this feed:

https://www.gov.uk/government/organisations/rail-accident-investigation-branch.atom

However, the former feed supports pagination (by adding page=n as a GET parameter), whereas the latter feed appears to be hardcoded to a very small number of entries with no ability to change pages that I can find. Either adding pagination to the latter feed or adding the Safety Digests to the former feed will suffice in sorting this issue in my mind :)

Another (probably unrelated, but I'll moan about it here anyway) irritation is that the PDF attachments don't appear in the embedded content HTML for Safety Digests, but they do for full reports; meaning even if they did appear in the right feed, I'd still need to make additional page loads in order to extract the PDF links, when it used to be perfectly possible to do for both reports and bulletins from the Atom feed directly.

Available languages links need lang attributes

Language links are presented to the user as the name of the language in the language the link points too. For example, https://www.gov.uk/government/organisations/wales-office has a link to ‘Cymraeg’. This language name needs a lang attribute on the link so that screen-readers can pronounce it properly. The value of that attribute should be the appropriate language code.

The link can be found at

<%= link_to_translation(locale) %>

XML files display odd behaviour

BEIS have uploaded an XML file to https://www.gov.uk/government/statistical-data-sets/oil-and-petroleum-products-weekly-statistics (let's ignore why for now).

Here's how the site renders the link to it:

screen shot 2018-08-07 at 10 19 39

Because the MIME type is not recognised, the metadata is displayed as

, 361KB

That is space comma space filesize.

"Coming soon" content items in the past

There are 142 content items with the schema_name "Coming soon" which tell users that this content will be published on a date that's in the past.

Example:
https://www.gov.uk/government/case-studies/ww1-australian-vc-recipient-corporal-alexander-stewart-burton

screen shot 2017-05-13 at 11 03 32

See list of 142

all = ContentItem.where(schema_name: 'coming_soon').to_a
y all.select {|c| Date.parse(c.details[:publish_time]) < Date.today }.map {|c| [c._id, c.details[:publish_time]] }

cc @gpeng @rubenarakelyan @NickColley

SSL issue with https://assets-origin.integration.publishing.service.gov.uk

Hello from a fellow gov content/technology enthusiast!

I'm dying to explore the Whitehall contributor experience given all the user research you've undoubtedly done. It may well change my life.

Following along to set up a local instance, I'm running into an SSL error when connecting to https://assets-origin.integration.publishing.service.gov.uk.

Is there another URL that would work better? Any thoughts greatly appreciated.

ActionView::Template::Error when asset legacy_url_path includes non-ascii characters

https://sentry.io/govuk/app-whitehall/issues/443169539/

We're seeing ActionView::Template::Error in OrganisationsController#show when the legacy_url_path of an asset contains non-ascii characters.

ActionView::Template::Error: URI must be ascii only "/government/uploads/system/uploads/feature/image/59558/s300_Autonomous_and_electric_shuttle_shown_on_the_esplanade_of_La_De\u0301fense__Paris__2017_by_Sebastien_Durand_Shutterstock.jpg"

From https://www.gov.uk/government/organisations/centre-for-connected-and-autonomous-vehicles

Search input renders native styling in iOS

On iOS the search input is styled with it's native styling (rounded corners and drop shadow). It’s not something you’d notice by making the screen smaller, only by testing on the device.

I believe this is due to the absence of -webkit-appearance: none; on the input.

image1

Setting and updating custom images for speeches must be easier and documented

Custom images shown on speech pages are determined by the image used when featuring the speech (https://github.com/alphagov/whitehall/blob/master/app/presenters/publishing_api/speech_presenter.rb#L120). This is different to the process used for News articles – which uses the first uploaded image in the sidebar.

The process to update the image is more convoluted. At the moment the process would be to un-feature the speech and re-feature it with a new image. Presumably something would also need to trigger a republish so the new image gets picked up.

The feature was originally added after a request came through on 2nd line.

Users do not know:

  • why an image is used
  • how to update images

Users have tried:

  • uploading new images to the document itself to see if they display

Context: https://govuk.zendesk.com/agent/tickets/2484542

Assets renamed in next release of govuk_frontend_toolkit

This repo uses the accordion icon from the govuk_frontend_toolkit.

The spelling of this icon has been corrected in the next release of the frontend toolkit - version 5.0.0.

Please be aware that when this repo is updated to use the latest version of the frontend toolkit, the name of this asset will have changed and line 25 in the _historic-people-list.scss will need to be updated accordingly.

background: transparent image-url("accordian-arrow.png") $full-width -40px no-repeat;

Investigate Psych::BadAlias: Unknown alias: nested_attachment_field_names

test/unit/text_direction_test.rb contains a YAML.load invocation, it would be preferable to replace this with YAML.safe_load however doing so produces the following test failure:

TextDirectionTest#test_explicitly_sets_text_direction_for_en.yml:¬
Psych::BadAlias: Unknown alias: nested_attachment_field_names¬

The en.yml file contains the folowing line which appears to be invalid YAML:

nested_attachment_field_names: &nested_attachment_field_names

PeopleController#show is slow

We're still phoning people out of hours even though we know that this is slow because of a database query. It needs to be fixed.

screen shot 2016-09-17 at 14 16 19

Content fixes

I don't think this is the right place, but not sure where the content comes from/ is stored, and this is the repo that outputs my example page below ;-)

I was just wondering for e.g. https://www.gov.uk/bee-health - where's the best place to submit a fix/ point out the list of links at the bottom under Further Information should be an HTML list rather than separate paragraphs?

Spaces before headings in HTML publications cause misalignment

Examples from: https://www.gov.uk/government/publications/let-property-campaign-your-guide-to-making-a-disclosure/let-property-campaign-your-guide-to-making-a-disclosure

Example govspeak:
###1.5 What’s in it for me?

Example HTML output:
<h3 id="whats-in-it-for-me"> <span class="number">1.5 </span> What’s in it for me?</h3>

Example screenshot:
screen shot 2015-12-08 at 12 10 10

The space after the span means the title is misaligned with the text below.

Removing the space will correct the alignment:

screen shot 2015-12-08 at 12 10 23

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependencies.

As a result, Dependabot couldn't update any of your dependencies.

This could have been caused by a git reference having been deleted at the source, by an out-of-sync lockfile, or by a bug in Dependabot.

To help diagnose the issue, please try running bundle update --patch locally. If no errors occur, get in touch and we'll help dig into it.

You can mention @dependabot in the comments below to contact the Dependabot team.

Missing colon after Location key

When a speech is published in Whitehall, there appears to be a missing colon after the 'Location' key (for want of a better term). The colon is evident in all other keys on the same page.

As an example, from here:
screen shot 2014-12-09 at 23 43 52

Raising here for the record; may look to PR this myself soon.

Remove references to FACTER_govuk_platform

Applications should not refer to facter variables set by puppet (we want to remove this one). They can rely on environment variables set by puppet.

In all our environments except the dev VM, FACTER_govuk_platform == production. This seems to be at odds with things like lib/whitehall/exporters/mappings.rb which has Whitehall.public_host_for("whitehall.#{ENV['FACTER_govuk_platform']}.alphagov.co.uk") - that's always going to return the public hostname of production, which is a bit odd...

I suggest migrating all the instances I found to using ENV['GOVUK_APP_DOMAIN'] which is what you want most of the time. It is currently set as follows:

  • preview: preview.alphagov.co.uk
  • staging: production.alphagov.co.uk
  • production: production.alphagov.co.uk

References found:

lib/tasks/export.rake
15:    ENV['FACTER_govuk_platform'] ||= "production"
19:    if ENV['FACTER_govuk_platform'] == 'production'
24:    exporter = Whitehall::Exporters::Mappings.new(ENV['FACTER_govuk_platform'])
43:    ENV['FACTER_govuk_platform'] ||= "production"
47:    if ENV['FACTER_govuk_platform'] == 'production'
52:    exporter = Whitehall::Exporters::RedirectorDocumentMappings.new(ENV['FACTER_govuk_platform'])

lib/whitehall/exporters/mappings.rb
65:    Whitehall.public_host_for("whitehall.#{ENV['FACTER_govuk_platform']}.alphagov.co.uk")

lib/whitehall/exporters/redirector_document_mappings.rb
19:    Whitehall.public_host_for("whitehall.#{ENV['FACTER_govuk_platform']}.alphagov.co.uk")

script/unpublished_docs.rb
11:admin_host = "whitehall-admin.#{ENV['FACTER_govuk_platform']}.alphagov.co.uk"
12:host_name = (ENV['FACTER_govuk_platform'] == 'production' ? 'www.gov.uk' : 'www.preview.alphagov.co.uk')
13:protocol = (ENV['FACTER_govuk_platform'] == 'development' ? 'http': 'https')

test/unit/whitehall/exporters/mappings_test.rb
8:      ENV['FACTER_govuk_platform'] = 'preview'

test/unit/whitehall/exporters/redirector_document_mappings_test.rb
8:      ENV['FACTER_govuk_platform'] = 'preview'

Policy list on minister pages displays full timestamp

Ministers with associated policies (e.g. Damian Green ) display them with precise ISO 8601 format dates. This differs from the short date formats used elsewhere.

Helping and supporting victims of crime
2013-04-09 10:00:58 +0100

app/views/ministerial_roles/_policies.html.erb
<li class="date"><%= policy.public_timestamp %></li>

Translated pages are unpronounceable by assistive tech

Issue found while visiting the Scottish Government's Device Lab

When testing with VoiceOver on iPad I found that these pages can not be accessed at all.

https://www.gov.uk/government/world/saudi-arabia

https://drive.google.com/file/d/0B-GzTJBVVSNzcnpQa2d6Nk5fVjA/view?usp=sharing

I think this could be solved by making sure we're setting the right lang attribute https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang

I've tested the BBC Arabic site and VoiceOver was able to read that fine.

Deleting a PolicyGroup does not delete its associated attachments

This is inconsistent with what happens when you discard a draft edition. In that case, all the edition's attachments are marked as deleted and they are no longer visible, even in the draft stack:

Conversely:

Delete frontend parts for migrated formats

Whitehall contains frontend code for formats it no longer renders.

Templates, controllers, tests, javascripts and styles should be removed

Based on https://github.com/alphagov/whitehall/tree/master/app/views, these formats still have frontend code in Whitehall:

  • Consultations (#3334)
  • Case studies (#3332)
  • Corporate information pages (except worldwide corp info pages)
  • Document collections (#3335)
  • HTML Attachments (with care to leave in code for rendering CSVs) (#3362 – a lot still present for CSVs though)
  • Publications (#3370)

cc @rubenarakelyan @gpeng @NickColley

Remove "Closed organisation: " prefix from 'title' in API JSON

Hi,

A recent change seems to have resulted in including the prefix "Closed organisation: " within the title value of closed organisations in the API, eg see example: https://www.gov.uk/api/organisations/health-protection-agency

This seems redundant as there are separate govuk_status and govuk_closed_status values which describe the status of the organisation.

(It also slightly breaks my code which consumes the API in order to populate an autocomplete of past and current UK government organisations for an internal service.)\

I'm guessing (from a quick glance at the commit history) that this was an accidental consequence of including this prefix within the model/presenters for use in indexing?

Cheers.

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependencies.

As a result, Dependabot couldn't update any of your dependencies.

This could have been caused by a git reference having been deleted at the source, by an out-of-sync lockfile, or by a bug in Dependabot.

To help diagnose the issue, please try running bundle update --patch locally. If no errors occur, get in touch and we'll help dig into it.

You can mention @dependabot in the comments below to contact the Dependabot team.

Translated HTML publications with whitehall-frontend as rendering app

There's about 308 HTML publications with their rendering app set to whitehall-frontend rather than government-frontend. Each of these URLs ends with a number, suggesting they are all translations.

https://gist.github.com/fofr/103bb4d6b22c82e072347d84632be845

Translation URLs change when the content is updated. This suggests that perhaps the old content isn't being cleaned up correctly and that the old URLs are not being redirected to the new ones.

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependencies.

As a result, Dependabot couldn't update any of your dependencies.

This could have been caused by a git reference having been deleted at the source, by an out-of-sync lockfile, or by a bug in Dependabot.

To help diagnose the issue, please try running bundle update --patch locally. If no errors occur, get in touch and we'll help dig into it.

You can mention @dependabot in the comments below to contact the Dependabot team.

Pages written in RTL languages have odd rendering of LTR text

On pages where the majority text is right-to-left (for example, https://www.gov.uk/government/world/saudi-arabia.ar), whitehall sets the text-direction: rtl CSS rule for the whole page. However, this results in embedded English text being rendered oddly to comply with right-to-left rules.

screen shot 2016-12-05 at 13 33 24

See in particular the positioning of brackets and full stops.

#2864 should also fix this as long as all language sections are marked up appropriately.

Guidance on ODF should go to GOV.UK page

In user research, some users have been confused by the text which appears next to ODS, ODT, ODP files:

Screenshot of page on GOV.UK. Explanation text next to a file type.

This file is in an OpenDocument format

The link currently goes to Wikipedia - which doesn't help users open the files.

The link should go to our guidance page - https://www.gov.uk/guidance/open-document-format-odf-guidance-for-uk-government/overview-of-productivity-software

This guidance is being updated this month to include better navigation and links to Android & iOS apps.

Ref https://github.com/alphagov/whitehall/blob/master/config/locales/en.yml#L446

Organisation custom logo field hidden

The "Custom logo" file input element isn't shown when choosing "Use custom logo for organisations exempt from the single identity".

Steps to replicate the problem:

  1. Edit an organisation (e.g. https://whitehall-admin.integration.publishing.service.gov.uk/government/admin/organisations/cabinet-office)
  2. Choose "Use custom logo for organisations exempt from the single identity" from the "Logo crest" menu
  3. Observe the absence of the "Custom logo" file input field
  4. Save the organisation
  5. Observe that the organisation can't be saved because "Logo can't be blank"
  6. Observe the presence of the "Custom logo" file input field

I would expect the "Custom logo" file input field to appear as soon as I choose "Use custom logo for organisations exempt from the single identity" from the "Logo crest" menu.

License information about the repository

Hello,

I've been trying to find information regarding the license under which this code is being published, but I can't find any.

Is this intentional? If so, it would mean the code is copyrighted and can't be freely reused.

If not, could you include a LICENSE file, or mention the license of the code in the readme?

P.S. I'm also interested in the license behind other parts of www.gov.uk, but I'm having a bit of a trouble understanding what parts the architecture of gov.uk is actually comprised from and which repositories are these parts present in. Is it all opensource? This app, for instance, points to /government/, but I get redirected to / when I open it and I wonder if it's still in use. I'd appreciate any tips and information regarding this. Thanks.

Use edition links on case studies

When creating a new case study and previewing the draft on the draft stack, the links are not accurately displayed because they are not sent as edition links.

The page doesn't error because of the lack of these links, but the preview is not accurate.

Spotted when working on #3332

cc @gpeng @rubenarakelyan

Additional resources needed for setting up a local development copy

I'm not a member of GDS, just an interested citizen.

I cloned this repo and followed the Detailed Setup Guide. bundle install and rake db:setup went fine.

Some errors:

  • Visiting /, though it's not recommended, results in an error: Slimmer::CouldNotRetrieveTemplate: Unable to fetch: 'core_layout' from 'http://static.dev.gov.uk/templates/core_layout.html.erb' because getaddrinfo: nodename nor servname provided, or not known
  • Visting /government/admin/publications/new results in SocketError: getaddrinfo: nodename nor servname provided, or not known.

Is it possible to run the app without these external dependencies?

Use of aria-live inconsistent across www.gov.uk search results

Pages that display search results with filters in a left-hand column do not identify the summary information consistently to assistive tech'.

Overview

When JS is enabled, the search results on these pages are updated by AJAX.

The change in the page content needs to be announced to users of assistive tech'. It's normally done by making the results summary paragraph a live region by adding the aria-live attribute.

On the pages of this type owned by whitehall, aria-live is set on the search results, not the summary.

What needs to be done

aria-live needs to be set on the results summary paragraph, not the results.

It's value is different for the pages in this repo compared to those owned by finder-frontend. We should decide on one value for it and make it the same everywhere.

Note: work done on this a while ago was documented in this excellent blog post.

Pages owned by whitehall

The pages I've found of this type (there may be others) are:

  1. https://www.gov.uk/government/publications
  2. https://www.gov.uk/government/consultations
  3. https://www.gov.uk/government/statistics
  4. https://www.gov.uk/government/announcements
  5. https://www.gov.uk/government/policies
  6. https://www.gov.uk/search

1-4 are owned by this app. I've raised another issue for this on 5 & 6.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.