alphagov / whitehall Goto Github PK
View Code? Open in Web Editor NEWPublishes government content on GOV.UK
Home Page: https://docs.publishing.service.gov.uk/apps/whitehall.html
License: MIT License
Publishes government content on GOV.UK
Home Page: https://docs.publishing.service.gov.uk/apps/whitehall.html
License: MIT License
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.
Issue found while visiting the Scottish Government's Device Lab
Also see this video for accessibility concerns
https://www.youtube.com/watch?v=CULhzDFFDoE
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
As discovered by @joelanman, the No.10 history page appears to require Adobe Flash - with it blocked you get the below warning. It also has non standard navigation.
As far as I'm aware, we avoid / don't allow flash on GOV.UK. Hoping this can be escalated.
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:
Because the MIME type is not recognised, the metadata is displayed as
, 361KB
That is space comma space filesize
.
HUMANIZED_CONTENT_TYPE
in https://github.com/alphagov/whitehall/blob/master/app/helpers/document_helper.rb ?It looks like that policies route was removed in 006aa80.
But it is still displayed in the header:
Leading to 404.
Steps to recreate
Expected result
Filters persist across tabs
Actual result
All filters have been removed
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.
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]] }
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.
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
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:
Users have tried:
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.
The blue background used in html publications doesn't meet our minimum contrast requirements.
Example: https://www.gov.uk/government/publications/budget-2016-documents/budget-2016
This blue is 3.72:1, when we need 4.5:1 to meet WCAG 2.0 AA for small text.
Suggest this blue could be changed to $govuk-blue as an easy fix.
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
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?
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>
The space after the span means the title is misaligned with the text below.
Removing the space will correct the alignment:
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.
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:
Raising here for the record; may look to PR this myself soon.
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.alphagov.co.uk
production.alphagov.co.uk
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'
There are a few places where we use different abbreviations for Cabinet Office in this repo:
<abbr>
tagWhich is correct?
We've just added department abbreviations to our services page. More generally, what's the canonical source of abbreviations?
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>
We currently use datetime microformat markup ( http://microformats.org/wiki/date-pattern ) which is ugly for users and superceded by HTML5’s element in conjunction with the datetime attribute ( https://html.spec.whatwg.org/multipage/semantics.html#the-time-element ). We should migrate to the newer markup.
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.
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:
Admin::EditionsController
has a #destroy
actionEditionDeleter
which has a #fire_transition!
method which, in turn, calls Attachable#delete_all_attachments
which marks the attachments as deleted
deleted
flag is used to decide whether an AttachmentData
should be visibleConversely:
Admin::PolicyGroupsController
has a #destroy
actionPolicyGroup
model has no custom attachment-related behaviour other than that added by Attachable
Attachable
doesn't have any callbacks which would mark attachments as deletedWhitehall 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:
When Javascript fails – eg SRI hash not accepted, network failure, JS blocked, the "More" link in the Whitehall navigation won't open and reveal the links behind it. This blocks users from completing their tasks.
We're using [target=_blank] which has a vulnerability (https://mathiasbynens.github.io/rel-noopener/)
Used in the share links which has been ported and fixed to government-frontend
in the following PR alphagov/government-frontend#217
This public page: https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/387271/exrates-201411.csv/preview
Contains this code:
<link rel="stylesheet" media="screen" href="//whitehall-admin.production.alphagov.co.uk/government/assets/frontend/html-publication-e0b258a6f964fbcace322634a69d92a503dc26ee7ef8ca5e5133266da3f221d8.css">
Which is not correct.
On this page, it would be good to have some more spacing between the dd
elements in #whitehall-wrapper .document-footer-meta .primary-metadata dd
, so it's a bit more readable.
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 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.
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.
carrierwaveuploader/carrierwave#1933 indicates that there's a vulnerability in the way we handle uploads. When a fix is available we need to upgrade carrierwave.
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.
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.
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.
Could you add a JSON output for publications?
Example resource:
Proposed URL:
Currently returns a 404
Expected JSON document
Relevant code: https://github.com/alphagov/whitehall/blob/master/app/controllers/publications_controller.rb#L26
https://www.gov.uk/government/publications?publication_filter_option=foi-releases
The title is "Publications: foi releases"
In user research, some users have been confused by the text which appears next to ODS, ODT, ODP files:
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
This was on assets.publishing.service.gov.uk
. Whitehall should never set cookies for frontend users.
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:
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.
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.
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
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:
/
, 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
/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?
Are you interested in a pull request which updates your version of Twitter Bootstrap-Sass to the latest, 3.3.3?
Bootstrap 3.0.0's release statement touches on the major changes:
http://blog.getbootstrap.com/2013/08/19/bootstrap-3-released/
Otherwise we have to update that page every time the Prime Minister changes.
Pages that display search results with filters in a left-hand column do not identify the summary information consistently to assistive tech'.
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.
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.
The pages I've found of this type (there may be others) are:
1-4 are owned by this app. I've raised another issue for this on 5 & 6.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.