govuk_navigation_helpers 8.0.0 → 8.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a8d53a0b9816b50497c8313afd80b4364b7ea16
4
- data.tar.gz: 33886df66629debdb34052d67e1808401952c89b
3
+ metadata.gz: 9bccfd9c258c7c6f945128b01c3c1db4920ea14d
4
+ data.tar.gz: b03031562708aac53ca280baf28fd113a2d1efdc
5
5
  SHA512:
6
- metadata.gz: 1f890e275991e6ccc0e3b0958f9e486c271fa1e184fdd8b9df851fc6d6f479e9b60c3c905e6b34e62dcdc040444bc44acb338013dd7958037f3c841b2e4f85be
7
- data.tar.gz: f4e4b5b6b2c0b3656f73dfed959e89e2489a4d0a9a47c726cafc40f53277aee82eb644ed8b20a0955ca1f97244ebd7f8f4fd83b23dd696ebc23c04a9d7615b12
6
+ metadata.gz: c9249a91fc7aa6efdc3d620cb0b263220f4f182026f0aa5284d76977515e1b1b5ccb7053e71b0cc94ec0adb3da6143b78bb2c6ab957f71b00cb36e9d2cdbc2ba
7
+ data.tar.gz: 3eefa4583d68e4b780ff9589894f3e5aa436b3c21fe9ceccbb7e77705a00f85d541bf0e13346c5a4c3c0bd3d1a5d878ac5bd104a77c5390c29f20e801f4b87ae
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 8.1.0
2
+ * Update related navigation sidebar helper to return statistical data sets.
3
+
1
4
  ## 8.0.0
2
5
  * Remove special handling of publication formats as the default layouts in government-frontend are sufficient
3
6
  * Fix a link in tasklist content for /end-a-civil-partnership
@@ -101,6 +101,10 @@ module GovukNavigationHelpers
101
101
  filter_link_type(content_store_response.dig("links", "related_policies").to_a, "policy")
102
102
  end
103
103
 
104
+ def related_statistical_data_sets
105
+ filter_link_type(content_store_response.dig("links", "related_statistical_data_sets").to_a, "statistical_data_set")
106
+ end
107
+
104
108
  def related_topics
105
109
  filter_link_type(content_store_response.dig("links", "topics").to_a, "topic")
106
110
  end
@@ -11,6 +11,7 @@ module GovukNavigationHelpers
11
11
  {
12
12
  related_items: related_items,
13
13
  collections: related_collections,
14
+ statistical_data_sets: related_statistical_data_sets,
14
15
  topics: related_topics,
15
16
  topical_events: related_topical_events,
16
17
  policies: related_policies,
@@ -64,6 +65,10 @@ module GovukNavigationHelpers
64
65
  build_links_for_sidebar(@content_item.related_policies)
65
66
  end
66
67
 
68
+ def related_statistical_data_sets
69
+ build_links_for_sidebar(@content_item.related_statistical_data_sets)
70
+ end
71
+
67
72
  def related_topics
68
73
  build_links_for_sidebar(@content_item.related_topics)
69
74
  end
@@ -1,3 +1,3 @@
1
1
  module GovukNavigationHelpers
2
- VERSION = "8.0.0".freeze
2
+ VERSION = "8.1.0".freeze
3
3
  end
@@ -26,6 +26,7 @@ RSpec.describe GovukNavigationHelpers::RelatedNavigationSidebar do
26
26
  expected = {
27
27
  related_items: [],
28
28
  collections: [],
29
+ statistical_data_sets: [],
29
30
  topics: [],
30
31
  topical_events: [],
31
32
  policies: [],
@@ -123,6 +124,7 @@ RSpec.describe GovukNavigationHelpers::RelatedNavigationSidebar do
123
124
  publishers: [{ path: "/related-organisation", text: "related organisation" }],
124
125
  world_locations: [{ path: "/world/world-location/news", text: "World Location" }],
125
126
  worldwide_organisations: [],
127
+ statistical_data_sets: [],
126
128
  other: [[], []]
127
129
  }
128
130
 
@@ -156,6 +158,7 @@ RSpec.describe GovukNavigationHelpers::RelatedNavigationSidebar do
156
158
  expected = {
157
159
  related_items: [],
158
160
  collections: [],
161
+ statistical_data_sets: [],
159
162
  topics: [],
160
163
  topical_events: [],
161
164
  policies: [],
@@ -167,6 +170,46 @@ RSpec.describe GovukNavigationHelpers::RelatedNavigationSidebar do
167
170
  expect(payload).to eql(expected)
168
171
  end
169
172
 
173
+ it "returns statistical data sets" do
174
+ payload = payload_for("publication",
175
+ "details" => {
176
+ "body" => "body",
177
+ "government" => {
178
+ "title" => "government",
179
+ "slug" => "government",
180
+ "current" => true
181
+ },
182
+ "political" => false,
183
+ "documents" => [],
184
+ "first_public_at" => "2016-01-01T19:00:00Z",
185
+ },
186
+ "links" => {
187
+ "related_statistical_data_sets" => [
188
+ {
189
+ "content_id" => "32c1b93d-2553-47c9-bc3c-fc5b513ecc32",
190
+ "title" => "related statistical data set",
191
+ "base_path" => "/related-statistical-data-set",
192
+ "document_type" => "statistical_data_set",
193
+ "locale" => "en"
194
+ }
195
+ ],
196
+ }
197
+ )
198
+ expected = {
199
+ related_items: [],
200
+ collections: [],
201
+ statistical_data_sets: [{ path: "/related-statistical-data-set", text: "related statistical data set" }],
202
+ topics: [],
203
+ topical_events: [],
204
+ policies: [],
205
+ publishers: [],
206
+ world_locations: [],
207
+ worldwide_organisations: [],
208
+ other: [[], []]
209
+ }
210
+ expect(payload).to eql(expected)
211
+ end
212
+
170
213
  it "returns an Elsewhere on the web section for external related links" do
171
214
  payload = payload_for("placeholder",
172
215
  "details" => {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_navigation_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.0
4
+ version: 8.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev