Skip to content

Commit cdd99f2

Browse files
Merge pull request #10976 from alphagov/change-workflow-updates
Change [document type - news articles] workflow updates [WHIT-2812]
2 parents eabb594 + 92fa74c commit cdd99f2

15 files changed

Lines changed: 53 additions & 40 deletions

File tree

app/components/admin/editions/document_type_change_summary.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
<% else %>
77
<h3 class="govuk-heading-m">Document fields</h3>
88
<p class="govuk-body">
9-
All document fields will be carried over and no additional document fields will need to be populated.
9+
All content in the document fields will be carried over. You will not have to add your content again.
1010
</p>
1111
<% end %>
1212

1313
<% if lost_association_items.any? || new_association_items.any? %>
1414
<%= render "govuk_publishing_components/components/summary_list", {
1515
title: "Associations",
16-
items: lost_association_items + new_association_items,
16+
items: lost_association_items + new_association_items + common_association_items,
1717
} %>
1818
<% else %>
1919
<h3 class="govuk-heading-m">Associations</h3>
2020
<p class="govuk-body">
21-
All associations will be carried over and no additional associations will need to be populated.
21+
All associations will be carried over. You will not have to fill in the associations again.
2222
</p>
2323
<% end %>

app/components/admin/editions/document_type_change_summary.rb

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ class Admin::Editions::DocumentTypeChangeSummary < ViewComponent::Base
22
attr_reader :lost_property_items,
33
:new_property_items,
44
:lost_association_items,
5-
:new_association_items
5+
:new_association_items,
6+
:common_association_items
67

78
def initialize(edition:, old_type:, new_type:)
89
@edition = edition
910
@old_type = old_type
1011
@new_type = new_type
12+
@association_to_label = {
13+
"ministerial_role_appointments" => "Ministers",
14+
}
1115

1216
compute_diffs
1317
end
@@ -19,34 +23,36 @@ def compute_diffs
1923
added_prop_keys = @new_type.properties.keys - @old_type.properties.keys # will need populating
2024
removed_assoc_keys = @old_type.associations.map { |a| a["key"] } - @new_type.associations.map { |a| a["key"] }
2125
added_assoc_keys = @new_type.associations.map { |a| a["key"] } - @old_type.associations.map { |a| a["key"] }
26+
common_assoc_keys = @new_type.associations.map { |a| a["key"] } & @old_type.associations.map { |a| a["key"] }
2227

2328
@lost_property_items = removed_prop_keys.map do |key|
2429
schema = @old_type.properties[key]
2530
{
2631
field: schema["title"] || key.humanize,
27-
value: "Will be LOST - this field exists on “#{@old_type.label}” but not on “#{@new_type.label}”.",
32+
value: "Will be <strong>deleted</strong>. A ‘#{@new_type.label}’ does not have a ‘#{schema['title'] || key.humanize}’ field.".html_safe,
2833
}
2934
end
3035

3136
@new_property_items = added_prop_keys.map do |key|
3237
schema = @new_type.properties[key]
3338
{
3439
field: schema["title"] || key.humanize,
35-
value: "Will need POPULATING - this field exists on “#{@new_type.label}” but not on “#{@old_type.label}”. It will be blank after the change.",
40+
value: "Will need to be <strong>added</strong>. A ‘#{@new_type.label}’ has a ‘#{schema['title'] || key.humanize}’ field. This field will be blank after the change.".html_safe,
3641
}
3742
end
3843

39-
@lost_association_items = removed_assoc_keys.map do |key|
40-
{
41-
field: key.humanize,
42-
value: "Will be LOST - this association exists on “#{@old_type.label}” but not on “#{@new_type.label}”.",
43-
}
44-
end
44+
@lost_association_items = build_association_items(removed_assoc_keys, proc { |field| "Will be <strong>deleted</strong>. A ‘#{@new_type.label}’ does not have a ‘#{field}’ association.".html_safe })
45+
@new_association_items = build_association_items(added_assoc_keys, proc { |field| "Will need to be <strong>added</strong>. A ‘#{@new_type.label}’ has a ‘#{field}’ association. This field will be blank after the change.".html_safe })
46+
@common_association_items = build_association_items(common_assoc_keys, proc { "These associations will be carried over, you will not have to fill them in again." })
47+
end
48+
49+
def build_association_items(items, value)
50+
items.map do |key|
51+
field = @association_to_label[key] || key.humanize
4552

46-
@new_association_items = added_assoc_keys.map do |key|
4753
{
48-
field: key.humanize,
49-
value: "Will need POPULATING - this association exists on “#{@new_type.label}” but not on “#{@old_type.label}”. It will be blank after the change",
54+
field:,
55+
value: value.call(field),
5056
}
5157
end
5258
end

app/models/configurable_document_types/government_response.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"key": "government_response",
33
"title": "Government response",
4-
"description": "Government statements in response to media coverage, such as rebuttals and ‘myth busters’. Do not use for: statements to Parliament. Use the Speech format for those.",
4+
"description": "Government statements in response to media coverage, such as rebuttals and ‘myth busters’. Do not use for: statements to Parliament. Use the Speech format for those.",
55
"forms": {
66
"documents": {
77
"fields": {

app/models/configurable_document_types/press_release.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"key": "press_release",
33
"title": "Press release",
4-
"description": "Unedited press releases as sent to the media, and official statements from the organisation or a minister. Do not use for: statements to Parliament. Use the Speech format for those.",
4+
"description": "Unedited press releases as sent to the media, and official statements from the organisation or a minister. Do not use for: statements to Parliament. Use the Speech format for those.",
55
"forms": {
66
"documents": {
77
"fields": {

app/models/configurable_document_types/world_news_story.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"key": "world_news_story",
33
"title": "World news story",
4-
"description": "Announcements specific to one or more world location. Don’t duplicate news published by another department.",
4+
"description": "Announcements specific to one or more world location. Do not duplicate news published by another department.",
55
"forms": {
66
"documents": {
77
"fields": {

app/models/publication_type.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ class PublicationType
88
FORMAT_ADVICE = {
99
1 => "<p>A policy paper explains the government’s position on something. It doesn’t include instructions on how to carry out a task, only the policy itself and how it’ll be implemented.</p><p>Read the <a href=\"https://www.gov.uk/guidance/content-design/content-types#policy-paper\" target=\"_blank\" class=\"govuk-link\">policy papers guidance</a> in full.</p>",
1010
2 => "<p>Cost-benefit analyses and other assessments of the impact of proposed initiatives, or changes to regulations or legislation.</p>",
11-
3 => "<p>Non-statutory guidance publications. Includes: manuals, handbooks and other documents that offer advice.</p><p>Do not use for: statutory guidance (use the statutory guidance publication type) or guidance about completing a form (attach to same publication as the form itself).</p>",
12-
4 => "<p>Pro-forma or form documents that need to be completed by the user. Can include guidance on how to fill in forms (ie no need to create a separate guidance publication for form instructions).</p>",
11+
3 => "<p>Non-statutory guidance publications. Includes: manuals, handbooks and other documents that offer advice.</p><p>Do not use for: statutory guidance (use the statutory guidance publication type) or guidance about completing a form (attach to same publication as the form itself).</p>",
12+
4 => "<p>Pro-forma or form documents that need to be completed by the user. Can include guidance on how to fill in forms (ie no need to create a separate guidance publication for form instructions).</p>",
1313
5 => "<p>Statistics governed by the UK Statistics Authority and produced by members of the Government Statistical Service.</p>",
1414
6 => "<p>Research and evaluation papers. Can be conducted by government, commissioned by government or independent of government.</p>",
15-
7 => "<p>Publications about what an organisation does (eg business plans, annual reports, accounts), or any plans that affect the organisation (eg structural reform plans, efficiency reviews). Corporate reports are shown automatically on the organisation’s What we do page.</p>",
16-
8 => "<p>Ministerial or departmental responses (eg to campaign letters), announcements, or statements;regularly issued circulars or bulletins (eg fire service circulars), official correspondence to professionals (eg Dear chief planning officer letters);letters to individuals or organisations that are published to share with a wider audience than their original recipient;online versions of e-bulletins or newsletters.</p><p>Do not use for: minutes, agendas or other meeting papers. Attach them to relevant policy detail”, “team or our governance pages instead.</p>",
15+
7 => "<p>Publications about what an organisation does (eg business plans, annual reports, accounts), or any plans that affect the organisation (eg structural reform plans, efficiency reviews). Corporate reports are shown automatically on the organisation’s What we do page.</p>",
16+
8 => "<p>Ministerial or departmental responses (eg to campaign letters), announcements, or statements;regularly issued circulars or bulletins (eg fire service circulars), official correspondence to professionals (eg Dear chief planning officer letters);letters to individuals or organisations that are published to share with a wider audience than their original recipient;online versions of e-bulletins or newsletters.</p><p>Do not use for: minutes, agendas or other meeting papers. Attach them to relevant policy detail’, ’team or our governance pages instead.</p>",
1717
10 => "<p>Information made available about departmental operations with the intent of making government more transparent.Includes organisation charts, staff survey results, departmental spending, salaries, contracts, meetings with ministers, etc.</p><p>Do not use for: FOI responses.</p>",
1818
12 => "<p>Responses to Freedom of Information requests. Ensure the title describes specifically what the request is about.</p>",
1919
13 => "<p>Leaflets, posters, fact sheets and marketing collateral.</p>",
2020
14 => "<p>Reviews, inquiries and other reports commissioned from or conducted by independent (ie non-governmental) bodies for consideration by the government.</p>",
2121
15 => "<p>Official Statistics that have been produced in accordance with the Code of Practice for Official Statistics, which is indicated using the Accredited Official Statistics quality mark.</p>",
2222
17 => "<p>Drawn maps and geographical data.</p>",
2323
18 => "<p>Treaties and memoranda of understanding between the UK and other nations.</p>",
24-
19 => "<p>Guidance which relevant users are legally obliged to follow. (For non-statutory guidance publications, use the guidance sub-type).</p>",
24+
19 => "<p>Guidance which relevant users are legally obliged to follow. (For non-statutory guidance publications, use the guidance sub-type).</p>",
2525
20 => "<p>Permit and licence applications published temporarily for public awareness.</p>",
2626
21 => "<p>Formal decisions by tribunals, regulators or adjudicators (including courts and Secretaries of State).</p>",
2727
22 => "<p>Regulations imposed by an independent regulatory authority only.</p><p>Do not use for: statutory guidance.</p>",

app/views/admin/editions/edit.html.erb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
items: secondary_navigation_tabs_items(@edition, request.path),
3838
} if @edition.editable? %>
3939

40-
<%= govspeak_to_html("^This is a read-only view of the current (#{@edition.state}) edition. To edit, please return to the summary page and choose \"Create new edition\".^") unless @edition.editable? %>
40+
<% unless @edition.editable? %>
41+
<%= render "govuk_publishing_components/components/inset_text", {} do %>
42+
This is a read-only view of the current (<%= @edition.state %>) edition. To edit, please return to the summary page and choose ‘Create new edition’.
43+
<% end %>
44+
<% end %>
4145

4246
<%= render "form", edition: @edition %>
4347
</div>

app/views/admin/speeches/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="format-advice">
22
<p class="govuk-body"><strong>Use this format for:</strong> Public speeches by ministers or other named spokespeople, ministerial statements to Parliament and bylined articles.</p>
3-
<p class="govuk-body">Do not use for: statements <em>not</em> made to Parliament (use the news article format for those).</p>
3+
<p class="govuk-body">Do not use for: statements <em>not</em> made to Parliament (use the news article format for those).</p>
44
</div>
55

66
<%= standard_edition_form(edition) do |form| %>

app/views/admin/standard_editions/change_type_preview.html.erb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<% page_heading = "Preview document type change" %>
1+
<% page_heading = "Review document type change" %>
22
<% content_for :page_title, page_heading %>
33
<% content_for :back_link do %>
44
<%= render "govuk_publishing_components/components/back_link", {
@@ -11,10 +11,9 @@
1111
<h1 class="govuk-heading-l"><%= page_heading %></h1>
1212

1313
<p class="govuk-body">
14-
You are about to change the document type of <%= @edition.title %>
14+
You're about to change the document type of <%= @edition.title %>
1515
from <strong><%= @old_type.label %></strong>
16-
to <strong><%= @new_type.label %></strong>. A summary of the changes is
17-
shown below. Please review these carefully before proceeding.
16+
to <strong><%= @new_type.label %></strong>. A summary of what this change means is shown below. Please review carefully before confirming the change.
1817
</p>
1918

2019
<%= render(

app/views/admin/statistical_data_sets/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="format-advice">
2-
<p class="govuk-body"><strong>Use this format for:</strong> Frequently updated (live) statistical data files.</p>
2+
<p class="govuk-body"><strong>Use this format for:</strong> Frequently updated (live) statistical data files.</p>
33
<p class="govuk-body">Do not use for: less frequently updated (eg quarterly) data. Use a publication (subtype: statistics) instead.</p>
44
</div>
55

0 commit comments

Comments
 (0)