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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb2c7e30189a9de446d75eef1685fb2ee181bea5
4
- data.tar.gz: de40cae6c9c04d1c3ba93b964fbaf1ccaef87cef
3
+ metadata.gz: 5a551a4eb03655704ece9b7b67b878b892419afc
4
+ data.tar.gz: 781b6e6e8f307fe15e12c14e3014b8fc59f6360f
5
5
  SHA512:
6
- metadata.gz: de17a5c09ec29123400c361e182b2fb7233b14341239f4b4f5792d0b16858c0bfe59ad7eae95963e4a5444e5c6dc6b0e245171ec5742300a7018820b9e3404e0
7
- data.tar.gz: 766af3a3e8fd0f42194f14e8745f3871016ac42962193ad2c7abb9cf3e36f8aa8c0ac4a46f37dea96d354b6637887c26ea024f564dfb355046a47b5e78789cb4
6
+ metadata.gz: 7c0c2b3bd1e3ac5de55074000acd7cd24be4e12f6bc1caf0c59b6d0a4ee971268cceb9ec425f0b2370a8d0387c857936badece937b6498a5ba2ed89e5b922211
7
+ data.tar.gz: ed0392214eca92cc153b3e7eac60cf5a9b3aac0055a69e45541396c004274972b9208bbc9fe180b39cc1dd1c16287f91855f84ae1df45051929f0728d8493c9b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.1.2
2
+
3
+ * Allow users to specify a default group
4
+ * Add a "user journey" supertype to indicate whether a page is "finding" or "thing"
5
+ * Add names & descriptions to the supertypes
6
+
1
7
  # 0.1.1
2
8
 
3
9
  * Initial release.
data/Jenkinsfile CHANGED
@@ -15,10 +15,6 @@ node {
15
15
  govuk.mergeMasterBranch()
16
16
  }
17
17
 
18
- stage("Set up content schema dependency") {
19
- govuk.contentSchemaDependency()
20
- }
21
-
22
18
  stage('Bundle') {
23
19
  echo 'Bundling'
24
20
  sh("bundle install --path ${JENKINS_HOME}/bundles/${JOB_NAME}")
data/data/supertypes.yml CHANGED
@@ -1,25 +1,53 @@
1
- # Groups used for navigation.
2
1
  navigation_document_supertype:
3
- - id: guidance
4
- document_types:
5
- - answer
6
- - contact
7
- - detailed_guide
8
- - document_collection
9
- - form
10
- - guidance
11
- - guide
12
- - licence
13
- - local_transaction
14
- - manual
15
- - map
16
- - notice
17
- - place
18
- - programme
19
- - promotional
20
- - regulation
21
- - simple_smart_answer
22
- - smart_answer
23
- - statutory_guidance
24
- - transaction
25
- - travel_advice
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
@@ -2,17 +2,18 @@ require "govuk_document_types/version"
2
2
  require "yaml"
3
3
 
4
4
  module GovukDocumentTypes
5
- def self.supertypes(document_type:)
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
- @supertypes.each do |name, ary|
11
- group_data = ary.find do |supertype|
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
- types.merge!(name => (group_data && group_data["id"]))
15
+ type = (group_data && group_data["id"]) || definition["default"]
16
+ types.merge!(name => type)
16
17
  end
17
18
 
18
19
  types
@@ -1,3 +1,3 @@
1
1
  module GovukDocumentTypes
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.2".freeze
3
3
  end
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.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-01 00:00:00.000000000 Z
11
+ date: 2017-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake