govuk_publishing_components 29.12.0 → 29.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3dd3c468990ad57344b60f3268db6600fc77389ec57fa53688699284bef86502
4
- data.tar.gz: 2dc30bfb1f489e894134032e8d055e694b4ac45e5eb49e3055ceae8ac0f2b0b7
3
+ metadata.gz: 4334fdd441cbca8d9fac8dfa8fd49478fd01cd847eb29707872abf0dd8c523d1
4
+ data.tar.gz: fe3f84de2e16d964fb9e7567ce52e8509258f833cc291fee28f54be4c4b8bd8c
5
5
  SHA512:
6
- metadata.gz: 1d147c794de4cd0cb8210584db07fe0e32a3036d68bded430d2c8d9b45a00b50f78a931d21b48be269f971099f8b054881f3b707694b4f52c3dfa7d00aef7ea2
7
- data.tar.gz: 786de6478e56d31089cb7745914bc5e38e5e8e63043d2b862777a69a5622b19f7f678c2d43559e179eb1701b3222fd1f384d05530c7f403abcccf1f025a005ef
6
+ metadata.gz: e6776dd162047045dbad8f70cda8d7eae8cc8e66321d607f614daf49c410d29b40c8cf718c6c04c27756bfa05382a58fe70b94633a49cbce7e4bbd5934006c7f
7
+ data.tar.gz: d9411dfa23e431152880d95f455d42d6ac326cae14eddb0f905dcdef5a68e1b19b9affb3407e9c6052ed5f813131ec5cf68a8398d0899bcd150bb35bf0ad85aa
@@ -64,7 +64,7 @@
64
64
  'taxon-slugs': { dimension: 58, defaultValue: 'other' },
65
65
  'taxon-ids': { dimension: 59, defaultValue: 'other' },
66
66
  'content-has-history': { dimension: 39, defaultValue: 'false' },
67
- 'publishing-application': { dimension: 89 },
67
+ 'publishing-app': { dimension: 89 },
68
68
  'brexit-audience': { dimension: 112 },
69
69
  'brexit-superbreadcrumb': { dimension: 111 },
70
70
  stepnavs: { dimension: 96 },
@@ -25,7 +25,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
25
25
  link_url: window.location.href.substring(window.location.origin.length),
26
26
  ui: JSON.parse(target.getAttribute('data-gtm-attributes')) || {}
27
27
  }
28
- var ariaExpanded = this.getClosestAttribute(target, 'aria-expanded')
28
+
29
+ // Ensure it only tracks aria-expanded in an accordion element, instead of in any child of the clicked element
30
+ if (target.closest('.gem-c-accordion')) {
31
+ var ariaExpanded = this.getClosestAttribute(target, 'aria-expanded')
32
+ }
33
+
29
34
  /*
30
35
  the details component uses an 'open' attribute instead of aria-expanded, so we need to check if we're on a details component.
31
36
  since details deletes the 'open' attribute when closed, we need this boolean, otherwise every element which
@@ -35,11 +40,11 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
35
40
 
36
41
  if (ariaExpanded) {
37
42
  data.ui.text = data.ui.text || target.innerText
38
- data.ui.state = (ariaExpanded === 'false') ? 'opened' : 'closed'
43
+ data.ui.action = (ariaExpanded === 'false') ? 'opened' : 'closed'
39
44
  } else if (detailsElement) {
40
45
  data.ui.text = data.ui.text || detailsElement.textContent
41
46
  var openAttribute = detailsElement.getAttribute('open')
42
- data.ui.state = (openAttribute == null) ? 'opened' : 'closed'
47
+ data.ui.action = (openAttribute == null) ? 'opened' : 'closed'
43
48
  }
44
49
 
45
50
  window.dataLayer.push(data)
@@ -16,8 +16,8 @@
16
16
  },
17
17
  publishing: {
18
18
  document_type: this.getMetaContent('format'),
19
- publishing_application: this.getMetaContent('publishing-application'),
20
- rendering_application: this.getMetaContent('rendering-application'),
19
+ publishing_app: this.getMetaContent('publishing-app'),
20
+ rendering_app: this.getMetaContent('rendering-app'),
21
21
  schema_name: this.getMetaContent('schema-name'),
22
22
  content_id: this.getMetaContent('content-id')
23
23
  },
@@ -6,7 +6,7 @@
6
6
  { :name => "month", :width => 2 },
7
7
  { :name => "year", :width => 4 }
8
8
  ]
9
-
9
+ autocomplete_date_of_birth ||= nil
10
10
  legend_text ||= nil
11
11
  hint ||= nil
12
12
  error_message ||= nil
@@ -64,7 +64,7 @@
64
64
  id: item[:id],
65
65
  type: "number",
66
66
  data: item[:data],
67
- autocomplete: item[:autocomplete]
67
+ autocomplete: autocomplete_date_of_birth ? "bday-#{item[:name]}" : nil
68
68
  } %>
69
69
  <% end %>
70
70
  <% end %>
@@ -26,6 +26,13 @@ examples:
26
26
  component as follows: `custom-name[day]`, `custom-name[month]`, `custom-name[year]`
27
27
  data:
28
28
  name: "dob"
29
+ with_autocomplete_for_date_of_birth_fields:
30
+ description: |
31
+ Use the `autocomplete_date_of_birth` option when you're asking for the user's date of birth. This supports browsers or tools that can autofill the information on a user's behalf if they've entered it previously.
32
+
33
+ Note that the option should only be passed to the component if the date of birth asked for is the date of birth of the person filling the form in and not asked for on behalf of someone else.
34
+ data:
35
+ autocomplete_date_of_birth: true
29
36
  with_legend:
30
37
  data:
31
38
  legend_text: "What is your date of birth?"
@@ -27,9 +27,12 @@ module GovukPublishingComponents
27
27
 
28
28
  private
29
29
 
30
+ # other meta tags are inserted by slimmer here:
31
+ # https://github.com/alphagov/slimmer/blob/82144be372aa4afc1f8ff30917c96c2ee3a47ed8/lib/slimmer/processors/metadata_inserter.rb#L15
30
32
  def add_core_tags(meta_tags)
31
33
  meta_tags["govuk:format"] = content_item[:document_type] if content_item[:document_type]
32
- meta_tags["govuk:publishing-application"] = content_item[:publishing_app] if content_item[:publishing_app]
34
+ meta_tags["govuk:publishing-app"] = content_item[:publishing_app] if content_item[:publishing_app]
35
+ meta_tags["govuk:rendering-app"] = content_item[:rendering_app] if content_item[:rendering_app]
33
36
  meta_tags["govuk:schema-name"] = content_item[:schema_name] if content_item[:schema_name]
34
37
  meta_tags["govuk:content-id"] = content_item[:content_id] if content_item[:content_id]
35
38
  meta_tags["govuk:navigation-page-type"] = content_item[:navigation_page_type] if content_item[:navigation_page_type]
@@ -43,8 +46,8 @@ module GovukPublishingComponents
43
46
  meta_tags["govuk:updated-at"] = content_item[:updated_at] if content_item[:updated_at]
44
47
  meta_tags["govuk:public-updated-at"] = content_item[:public_updated_at] if content_item[:public_updated_at]
45
48
  primary_publisher = content_item.dig(:links, :primary_publishing_organisation)
46
- primary_publisher = primary_publisher.first[:title] if primary_publisher
47
- meta_tags["govuk:primary-publishing-organisation"] = primary_publisher if primary_publisher
49
+ primary_publisher = primary_publisher.first[:title] unless primary_publisher.blank?
50
+ meta_tags["govuk:primary-publishing-organisation"] = primary_publisher unless primary_publisher.blank?
48
51
 
49
52
  meta_tags
50
53
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "29.12.0".freeze
2
+ VERSION = "29.12.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 29.12.0
4
+ version: 29.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-21 00:00:00.000000000 Z
11
+ date: 2022-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -1919,7 +1919,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1919
1919
  - !ruby/object:Gem::Version
1920
1920
  version: '0'
1921
1921
  requirements: []
1922
- rubygems_version: 3.3.16
1922
+ rubygems_version: 3.3.17
1923
1923
  signing_key:
1924
1924
  specification_version: 4
1925
1925
  summary: A gem to document components in GOV.UK frontend applications