govuk_document_types 0.8.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +21 -0
- data/README.md +17 -22
- data/data/supertypes.yml +6 -239
- data/govuk_document_types.gemspec +1 -0
- data/lib/govuk_document_types.rb +1 -0
- data/lib/govuk_document_types/translations_railtie.rb +21 -0
- data/lib/govuk_document_types/version.rb +1 -1
- data/rails/locale/en.yml +28 -0
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f152778caca037e3809f912c605c4584dee81a1b0e12e8673f8bc83ba5765aef
|
4
|
+
data.tar.gz: 1099c56c1e8b2f1dfcfe92100d78a76fec263e193e16a8f93daba8e28060a0e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b68846617a60aee53b4d3742382b749a757e53db4aa581e3b860d41ec42f78493440012479806a35ed39799f70d8f79f1b2d87fb5dbe91561c299d9f69568bc
|
7
|
+
data.tar.gz: 9152ba233f0554176f18511b33bf59a10d1e818a53eb8c69077eb44d75158e4c895df1fb3eef1969dfe2bb78174f975964744725a1638b0da7ff48e884e2ae1f
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.6
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
# 1.0.0
|
2
|
+
|
3
|
+
* Remove deprecated supertypes
|
4
|
+
* Add Flood & Coastal Erosion Risk Management Report (FCERM) Research Report to research supergroup
|
5
|
+
|
6
|
+
# 0.9.3
|
7
|
+
|
8
|
+
* Added `standard` subtype to the guidance group
|
9
|
+
|
10
|
+
# 0.9.2
|
11
|
+
|
12
|
+
* Moved `case_study` from policy papers and consultations to news and comms.
|
13
|
+
|
14
|
+
# 0.9.1
|
15
|
+
|
16
|
+
* Removed `contact` from the guidance group.
|
17
|
+
|
18
|
+
# 0.9.0
|
19
|
+
|
20
|
+
* Add translations to content purpose supergroup titles
|
21
|
+
|
1
22
|
# 0.8.0
|
2
23
|
|
3
24
|
* Adds `GovukDocumentTypes.supergroup_subgroups` as a way to retrieve
|
data/README.md
CHANGED
@@ -5,26 +5,29 @@ of document types.
|
|
5
5
|
|
6
6
|
https://docs.publishing.service.gov.uk/document-types.html
|
7
7
|
|
8
|
-
|
9
|
-
[rummager][rummager]. **Don't use it in your project**.
|
8
|
+
## Usage
|
10
9
|
|
11
|
-
## Long term vision
|
12
10
|
|
13
|
-
|
11
|
+
Find the supertypes for a document type:
|
14
12
|
|
15
|
-
|
13
|
+
```rb
|
14
|
+
supertypes = GovukDocumentTypes.supertypes(document_type: "detailed_guide")
|
15
|
+
supertypes["content_purpose_subgroup"]
|
16
|
+
=> "guidance"
|
17
|
+
```
|
16
18
|
|
17
|
-
|
18
|
-
2. [Add the supertype][rummager-pr] in Rummager so that it can be indexed and searched with. Bump the gem in Rummager.
|
19
|
-
3. [Add the type to content-schemas][schemas-pr]
|
20
|
-
4. [Add the type to the content-store][content-store-pr]
|
21
|
-
5. Bump the gem version in [publishing-api][publishing-api]
|
19
|
+
Find the document types for a supertype:
|
22
20
|
|
23
|
-
|
21
|
+
```rb
|
22
|
+
GovukDocumentTypes.supergroup_document_types("policy_and_engagement")
|
23
|
+
=> ["case_study", "closed_consultation", "consultation_outcome", "impact_assessment", "open_consultation", "policy_paper"]
|
24
|
+
```
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
## How to add or update a supertype
|
27
|
+
|
28
|
+
1. Add it to [data/supertypes.yml](data/supertypes.yml) in this gem and release a new version
|
29
|
+
2. Bump the gem version across GOV.UK apps using [Dependabot](https://app.dependabot.com/)
|
30
|
+
3. Run the `rummager:update_supertypes` rake task in Search-api to set the correct supertypes in each document in the Elasticsearch indices. Do this _after_ bumping the gem version because this rake task uses information in the gem to find the correct supertype for the document_type defined in each document.
|
28
31
|
|
29
32
|
## Running the test suite
|
30
33
|
|
@@ -35,11 +38,3 @@ bundle exec rake
|
|
35
38
|
## License
|
36
39
|
|
37
40
|
[MIT License](LICENSE.txt)
|
38
|
-
|
39
|
-
[rummager-pr]: https://github.com/alphagov/rummager/pull/756
|
40
|
-
[govuk-content-schemas]: https://github.com/alphagov/govuk-content-schemas
|
41
|
-
[schemas-pr]: https://github.com/alphagov/govuk-content-schemas/pull/551
|
42
|
-
[content-store-pr]: https://github.com/alphagov/content-store/pull/268
|
43
|
-
|
44
|
-
[publishing-api]: https://github.com/alphagov/publishing-api
|
45
|
-
[rummager]: https://github.com/alphagov/rummager
|
data/data/supertypes.yml
CHANGED
@@ -1,215 +1,3 @@
|
|
1
|
-
navigation_document_supertype:
|
2
|
-
name: "Navigation document type"
|
3
|
-
description: "Used to filter pages on the new taxonomy-based navigation pages"
|
4
|
-
default: other
|
5
|
-
items:
|
6
|
-
- id: guidance
|
7
|
-
document_types:
|
8
|
-
- answer
|
9
|
-
- contact
|
10
|
-
- detailed_guide
|
11
|
-
- document_collection
|
12
|
-
- form
|
13
|
-
- guidance
|
14
|
-
- guide
|
15
|
-
- licence
|
16
|
-
- local_transaction
|
17
|
-
- manual
|
18
|
-
- map
|
19
|
-
- place
|
20
|
-
- promotional
|
21
|
-
- regulation
|
22
|
-
- simple_smart_answer
|
23
|
-
- smart_answer
|
24
|
-
- statutory_guidance
|
25
|
-
- transaction
|
26
|
-
- travel_advice
|
27
|
-
|
28
|
-
content_purpose_document_supertype:
|
29
|
-
name: "Content purpose"
|
30
|
-
description: "DEPRECATED - Please use `content_purpose_subgroup`. The team grouped document types that serve a similar purpose for users into top-level content groups. In time, this information could be used to serve relevant links into a content page sidebar and pull feeds of specific content groups into navigation pages."
|
31
|
-
default: other
|
32
|
-
items:
|
33
|
-
- id: updates-and-alerts
|
34
|
-
description: To provide time-based information on a new thing (alert) or something that's already happened (update)
|
35
|
-
document_types:
|
36
|
-
- drug_safety_update
|
37
|
-
- fatality_notice
|
38
|
-
- medical_safety_alert
|
39
|
-
- national_statistics_announcement
|
40
|
-
- official_statistics_announcement
|
41
|
-
- staff_update
|
42
|
-
- statistics_announcement
|
43
|
-
|
44
|
-
- id: news
|
45
|
-
description: To communicate what government is doing (non-urgent)
|
46
|
-
document_types:
|
47
|
-
- case_study
|
48
|
-
- correspondence # Also used for other things
|
49
|
-
- news_article
|
50
|
-
- news_story
|
51
|
-
- press_release
|
52
|
-
- world_location_news_article
|
53
|
-
- world_news_story
|
54
|
-
|
55
|
-
- id: resources
|
56
|
-
document_types:
|
57
|
-
- map
|
58
|
-
- promotional
|
59
|
-
|
60
|
-
- id: speeches-and-statements
|
61
|
-
document_types:
|
62
|
-
- authored_article
|
63
|
-
- oral_statement
|
64
|
-
- speech
|
65
|
-
- written_statement
|
66
|
-
|
67
|
-
- id: guidance
|
68
|
-
description: To provide information that prepares the user for doing a thing (without the need to share any personal information).
|
69
|
-
document_types:
|
70
|
-
- answer
|
71
|
-
- calendar
|
72
|
-
- detailed_guide
|
73
|
-
- guidance
|
74
|
-
- guide
|
75
|
-
- hmrc_manual
|
76
|
-
- hmrc_manual_section
|
77
|
-
- html_publication
|
78
|
-
- manual
|
79
|
-
- manual_section
|
80
|
-
- policy_paper
|
81
|
-
- regulation
|
82
|
-
- statutory_guidance
|
83
|
-
- travel_advice
|
84
|
-
|
85
|
-
- id: contacts
|
86
|
-
document_types:
|
87
|
-
- contact
|
88
|
-
|
89
|
-
- id: transactions
|
90
|
-
description: To provide specific information and tools that enables the user to do a thing, based on information they provide during the transaction.
|
91
|
-
document_types:
|
92
|
-
- calculator
|
93
|
-
- completed_transaction
|
94
|
-
- form
|
95
|
-
- licence
|
96
|
-
- local_transaction
|
97
|
-
- place
|
98
|
-
- simple_smart_answer
|
99
|
-
- smart_answer
|
100
|
-
- transaction
|
101
|
-
|
102
|
-
- id: reports
|
103
|
-
description: To share in detail the outcome of investigations, research and changes in regulation (government and independent bodies).
|
104
|
-
document_types:
|
105
|
-
- aaib_report
|
106
|
-
- consultation_outcome
|
107
|
-
- impact_assessment
|
108
|
-
- independent_report
|
109
|
-
- maib_report
|
110
|
-
- raib_report
|
111
|
-
- research
|
112
|
-
- service_standard_report
|
113
|
-
|
114
|
-
- id: decisions
|
115
|
-
description: To share decisions and/or reports made by government on a specific thing.
|
116
|
-
document_types:
|
117
|
-
- asylum_support_decision
|
118
|
-
- decision
|
119
|
-
- dfid_research_output
|
120
|
-
- employment_appeal_tribunal_decision
|
121
|
-
- employment_tribunal_decision
|
122
|
-
- government_response
|
123
|
-
- international_treaty
|
124
|
-
- tax_tribunal_decision
|
125
|
-
- utaac_decision
|
126
|
-
|
127
|
-
- id: engagement-activities
|
128
|
-
description: To enable bodies and people to comment on government policy and provide evidence.
|
129
|
-
document_types:
|
130
|
-
- closed_consultation
|
131
|
-
- cma_case
|
132
|
-
- consultation
|
133
|
-
- notice
|
134
|
-
- open_consultation
|
135
|
-
|
136
|
-
- id: data
|
137
|
-
description: To provide data that enables people to hold government to account (both raw data and data with analysis).
|
138
|
-
document_types:
|
139
|
-
- foi_release
|
140
|
-
- national_statistics
|
141
|
-
- official_statistics
|
142
|
-
- statistical_data_set
|
143
|
-
- statistics
|
144
|
-
- transparency
|
145
|
-
|
146
|
-
- id: organising-entities
|
147
|
-
description: Things that exist in the real world
|
148
|
-
document_types:
|
149
|
-
- working_group
|
150
|
-
- organisation
|
151
|
-
- person
|
152
|
-
- worldwide_organisation
|
153
|
-
- world_location
|
154
|
-
- topical_event
|
155
|
-
- field_of_operation
|
156
|
-
- ministerial_role
|
157
|
-
|
158
|
-
- id: navigation
|
159
|
-
description: Pages that enable users to get to content pages
|
160
|
-
document_types:
|
161
|
-
# "Tags"
|
162
|
-
- document_collection
|
163
|
-
- mainstream_browse_page
|
164
|
-
- policy
|
165
|
-
- policy_area
|
166
|
-
- taxon
|
167
|
-
- topic
|
168
|
-
|
169
|
-
# Hardcoded pages to let users navigate
|
170
|
-
- finder
|
171
|
-
- homepage
|
172
|
-
- search
|
173
|
-
- travel_advice_index
|
174
|
-
|
175
|
-
- id: grants-and-funding
|
176
|
-
document_types:
|
177
|
-
- countryside_stewardship_grant
|
178
|
-
- esi_fund
|
179
|
-
- international_development_fund
|
180
|
-
- business_finance_support_scheme
|
181
|
-
|
182
|
-
- id: corporate-info
|
183
|
-
document_types:
|
184
|
-
- about
|
185
|
-
- about_our_services
|
186
|
-
- access_and_opening
|
187
|
-
- complaints_procedure
|
188
|
-
- corporate_report
|
189
|
-
- equality_and_diversity
|
190
|
-
- help_page
|
191
|
-
- media_enquiries
|
192
|
-
- membership
|
193
|
-
- our_energy_use
|
194
|
-
- our_governance
|
195
|
-
- personal_information_charter
|
196
|
-
- petitions_and_campaigns
|
197
|
-
- procurement
|
198
|
-
- publication_scheme
|
199
|
-
- recruitment
|
200
|
-
- services_and_information
|
201
|
-
- social_media_use
|
202
|
-
- terms_of_reference
|
203
|
-
- welsh_language_scheme
|
204
|
-
|
205
|
-
- id: service-manual
|
206
|
-
document_types:
|
207
|
-
- service_manual_homepage
|
208
|
-
- service_manual_service_toolkit
|
209
|
-
- service_manual_service_standard
|
210
|
-
- service_manual_guide
|
211
|
-
- service_manual_topic
|
212
|
-
|
213
1
|
user_journey_document_supertype:
|
214
2
|
name: "User journey"
|
215
3
|
description: "Used to distinguish pages used mainly for navigation (finding) from content pages (thing)"
|
@@ -224,8 +12,6 @@ user_journey_document_supertype:
|
|
224
12
|
- license_finder
|
225
13
|
- mainstream_browse_page
|
226
14
|
- organisation
|
227
|
-
- policy
|
228
|
-
- policy_area
|
229
15
|
- search
|
230
16
|
- service_manual_homepage
|
231
17
|
- service_manual_topic
|
@@ -234,23 +20,6 @@ user_journey_document_supertype:
|
|
234
20
|
- topic
|
235
21
|
- topical_event
|
236
22
|
|
237
|
-
search_user_need_document_supertype:
|
238
|
-
name: "Search user need"
|
239
|
-
description: "Used to group documents based on user need, core for mainstream users and government for specialist users in search results"
|
240
|
-
default: government
|
241
|
-
items:
|
242
|
-
- id: core
|
243
|
-
document_types:
|
244
|
-
- answer
|
245
|
-
- guide
|
246
|
-
- local_transaction
|
247
|
-
- place
|
248
|
-
- simple_smart_answer
|
249
|
-
- smart_answer
|
250
|
-
- transaction
|
251
|
-
- travel_advice
|
252
|
-
- travel_advice_index
|
253
|
-
|
254
23
|
email_document_supertype:
|
255
24
|
name: "Email document type"
|
256
25
|
description: "High level group for email subscriptions use to identify publications and announcement"
|
@@ -392,6 +161,7 @@ content_purpose_subgroup:
|
|
392
161
|
- drug_safety_update
|
393
162
|
- id: news
|
394
163
|
document_types:
|
164
|
+
- case_study
|
395
165
|
- news_article
|
396
166
|
- news_story
|
397
167
|
- press_release
|
@@ -441,7 +211,6 @@ content_purpose_subgroup:
|
|
441
211
|
- manual_section
|
442
212
|
- guidance
|
443
213
|
- map
|
444
|
-
- contact
|
445
214
|
- calendar
|
446
215
|
- statutory_guidance
|
447
216
|
- notice
|
@@ -449,6 +218,7 @@ content_purpose_subgroup:
|
|
449
218
|
- travel_advice
|
450
219
|
- promotional
|
451
220
|
- hmrc_manual
|
221
|
+
- standard
|
452
222
|
- id: business_support
|
453
223
|
document_types:
|
454
224
|
- international_development_fund
|
@@ -458,7 +228,6 @@ content_purpose_subgroup:
|
|
458
228
|
- id: policy
|
459
229
|
document_types:
|
460
230
|
- impact_assessment
|
461
|
-
- case_study
|
462
231
|
- policy_paper
|
463
232
|
- id: consultations
|
464
233
|
document_types:
|
@@ -468,6 +237,7 @@ content_purpose_subgroup:
|
|
468
237
|
- id: research
|
469
238
|
document_types:
|
470
239
|
- dfid_research_output
|
240
|
+
- flood_and_coastal_erosion_risk_management_research_report
|
471
241
|
- independent_report
|
472
242
|
- research
|
473
243
|
- id: statistics
|
@@ -521,6 +291,7 @@ content_purpose_supergroup:
|
|
521
291
|
- correspondence
|
522
292
|
- speech
|
523
293
|
- government_response
|
294
|
+
- case_study
|
524
295
|
- id: services
|
525
296
|
document_types:
|
526
297
|
- completed_transaction
|
@@ -543,7 +314,6 @@ content_purpose_supergroup:
|
|
543
314
|
- manual_section
|
544
315
|
- guidance
|
545
316
|
- map
|
546
|
-
- contact
|
547
317
|
- calendar
|
548
318
|
- statutory_guidance
|
549
319
|
- notice
|
@@ -556,10 +326,10 @@ content_purpose_supergroup:
|
|
556
326
|
- business_finance_support_scheme
|
557
327
|
- statutory_instrument
|
558
328
|
- hmrc_manual
|
329
|
+
- standard
|
559
330
|
- id: policy_and_engagement
|
560
331
|
document_types:
|
561
332
|
- impact_assessment
|
562
|
-
- case_study
|
563
333
|
- policy_paper
|
564
334
|
- open_consultation
|
565
335
|
- closed_consultation
|
@@ -567,6 +337,7 @@ content_purpose_supergroup:
|
|
567
337
|
- id: research_and_statistics
|
568
338
|
document_types:
|
569
339
|
- dfid_research_output
|
340
|
+
- flood_and_coastal_erosion_risk_management_research_report
|
570
341
|
- independent_report
|
571
342
|
- research
|
572
343
|
- statistics
|
@@ -584,7 +355,3 @@ content_purpose_supergroup:
|
|
584
355
|
- aaib_report
|
585
356
|
- raib_report
|
586
357
|
- maib_report
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
data/lib/govuk_document_types.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rails'
|
2
|
+
module GovukDocumentTypes
|
3
|
+
class TranslationsRailtie < ::Rails::Railtie
|
4
|
+
initializer 'govuk_document_types' do |app|
|
5
|
+
GovukDocumentTypes::TranslationsRailtie.instance_eval do
|
6
|
+
pattern = pattern_from app.config.i18n.available_locales
|
7
|
+
add("rails/locale/#{pattern}.yml")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.add(pattern)
|
12
|
+
files = Dir[File.join(File.dirname(__FILE__), '../..', pattern)]
|
13
|
+
I18n.load_path.concat(files)
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.pattern_from(args)
|
17
|
+
array = Array(args || [])
|
18
|
+
array.blank? ? '*' : "{#{array.join ','}}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/rails/locale/en.yml
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
en:
|
3
|
+
content_purpose_supergroup:
|
4
|
+
guidance_and_regulation: Guidance and regulation
|
5
|
+
news_and_communications: News and communications
|
6
|
+
policy_and_engagement: Policy papers and consultations
|
7
|
+
research_and_statistics: "Research and statistics"
|
8
|
+
services: Services
|
9
|
+
transparency: Transparency and freedom of information releases
|
10
|
+
content_purpose_subgroup:
|
11
|
+
announcements: Announcements
|
12
|
+
business_support: Business funds and grants
|
13
|
+
consultations: Consultations
|
14
|
+
decisions: Decisions
|
15
|
+
freedom_of_information_releases: Freedom of information releases
|
16
|
+
guidance: Guidance
|
17
|
+
incidents: Incident reports
|
18
|
+
news: News
|
19
|
+
policy: Policy papers
|
20
|
+
regulation: Regulation
|
21
|
+
research: Research
|
22
|
+
safety_alerts: Safety alerts
|
23
|
+
services: Services
|
24
|
+
speeches_and_statements: Speeches and statements
|
25
|
+
statistics: Statistics
|
26
|
+
transactions: Transactions
|
27
|
+
transparency_data: Transparency data
|
28
|
+
updates_and_alerts: Updates and alerts
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_document_types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: i18n-spec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: Gem to share document type groupings
|
56
70
|
email:
|
57
71
|
- govuk-dev@digital.cabinet-office.gov.uk
|
@@ -75,7 +89,9 @@ files:
|
|
75
89
|
- data/supertypes.yml
|
76
90
|
- govuk_document_types.gemspec
|
77
91
|
- lib/govuk_document_types.rb
|
92
|
+
- lib/govuk_document_types/translations_railtie.rb
|
78
93
|
- lib/govuk_document_types/version.rb
|
94
|
+
- rails/locale/en.yml
|
79
95
|
homepage: https://github.com/alphagov/govuk_document_types
|
80
96
|
licenses:
|
81
97
|
- MIT
|
@@ -95,8 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
111
|
- !ruby/object:Gem::Version
|
96
112
|
version: '0'
|
97
113
|
requirements: []
|
98
|
-
|
99
|
-
rubygems_version: 2.7.6
|
114
|
+
rubygems_version: 3.1.4
|
100
115
|
signing_key:
|
101
116
|
specification_version: 4
|
102
117
|
summary: Gem to share document type groupings
|