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 +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-click-tracking.js +8 -3
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/gtm-page-views.js +2 -2
- data/app/views/govuk_publishing_components/components/_date_input.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/docs/date_input.yml +7 -0
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +6 -3
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4334fdd441cbca8d9fac8dfa8fd49478fd01cd847eb29707872abf0dd8c523d1
|
4
|
+
data.tar.gz: fe3f84de2e16d964fb9e7567ce52e8509258f833cc291fee28f54be4c4b8bd8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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-
|
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
|
-
|
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.
|
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.
|
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
|
-
|
20
|
-
|
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[:
|
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-
|
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]
|
47
|
-
meta_tags["govuk:primary-publishing-organisation"] = 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
|
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.
|
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-
|
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.
|
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
|