govuk_document_types 0.1.1 → 0.1.2
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/CHANGELOG.md +6 -0
- data/Jenkinsfile +0 -4
- data/data/supertypes.yml +52 -24
- data/lib/govuk_document_types.rb +6 -5
- data/lib/govuk_document_types/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a551a4eb03655704ece9b7b67b878b892419afc
|
|
4
|
+
data.tar.gz: 781b6e6e8f307fe15e12c14e3014b8fc59f6360f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c0c2b3bd1e3ac5de55074000acd7cd24be4e12f6bc1caf0c59b6d0a4ee971268cceb9ec425f0b2370a8d0387c857936badece937b6498a5ba2ed89e5b922211
|
|
7
|
+
data.tar.gz: ed0392214eca92cc153b3e7eac60cf5a9b3aac0055a69e45541396c004274972b9208bbc9fe180b39cc1dd1c16287f91855f84ae1df45051929f0728d8493c9b
|
data/CHANGELOG.md
CHANGED
data/Jenkinsfile
CHANGED
data/data/supertypes.yml
CHANGED
|
@@ -1,25 +1,53 @@
|
|
|
1
|
-
# Groups used for navigation.
|
|
2
1
|
navigation_document_supertype:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
+
- notice
|
|
20
|
+
- place
|
|
21
|
+
- programme
|
|
22
|
+
- promotional
|
|
23
|
+
- regulation
|
|
24
|
+
- simple_smart_answer
|
|
25
|
+
- smart_answer
|
|
26
|
+
- statutory_guidance
|
|
27
|
+
- transaction
|
|
28
|
+
- travel_advice
|
|
29
|
+
|
|
30
|
+
user_journey_document_supertype:
|
|
31
|
+
name: "User journey"
|
|
32
|
+
description: "Used to distinguish pages used mainly for navigation (finding) from content pages (thing)"
|
|
33
|
+
# Most pages are primarily for displaying content rather than navigation
|
|
34
|
+
default: thing
|
|
35
|
+
items:
|
|
36
|
+
- id: finding
|
|
37
|
+
document_types:
|
|
38
|
+
- business_support_finder
|
|
39
|
+
- document_collection
|
|
40
|
+
- finder
|
|
41
|
+
- homepage
|
|
42
|
+
- license_finder
|
|
43
|
+
- mainstream_browse_page
|
|
44
|
+
- organisation
|
|
45
|
+
- policy
|
|
46
|
+
- policy_area
|
|
47
|
+
- search
|
|
48
|
+
- service_manual_homepage
|
|
49
|
+
- service_manual_topic
|
|
50
|
+
- services_and_information
|
|
51
|
+
- taxon
|
|
52
|
+
- topic
|
|
53
|
+
- topical_event
|
data/lib/govuk_document_types.rb
CHANGED
|
@@ -2,17 +2,18 @@ require "govuk_document_types/version"
|
|
|
2
2
|
require "yaml"
|
|
3
3
|
|
|
4
4
|
module GovukDocumentTypes
|
|
5
|
-
|
|
6
|
-
@supertypes ||= YAML.load_file(File.dirname(__FILE__) + "/../data/supertypes.yml")
|
|
5
|
+
DATA = YAML.load_file(File.dirname(__FILE__) + "/../data/supertypes.yml")
|
|
7
6
|
|
|
7
|
+
def self.supertypes(document_type:)
|
|
8
8
|
types = {}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
group_data =
|
|
10
|
+
DATA.each do |name, definition|
|
|
11
|
+
group_data = definition["items"].find do |supertype|
|
|
12
12
|
supertype['document_types'].include?(document_type)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
type = (group_data && group_data["id"]) || definition["default"]
|
|
16
|
+
types.merge!(name => type)
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
types
|
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.1.
|
|
4
|
+
version: 0.1.2
|
|
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: 2017-03-
|
|
11
|
+
date: 2017-03-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|