govuk_publishing_components 35.21.0 → 35.21.2
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-ga4/ga4-core.js +9 -9
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +5 -17
- data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +2 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb0f9b39701d51e7c540675b4edcd276a9ee485b4c277c7d2fbbdcdf913933d0
|
4
|
+
data.tar.gz: 1b3148fd18a2211bee6c0ff59686e074a15970116b8216649fadb71018d38c86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a432b034c1f6de19813d82e68394fe4637d0b851d7617933dd1fc4f56b820ac5f7d2e3320f1dc15aebd1c2e2ec5896de41d7bac4a7244e398d5a0bb30f51e45e
|
7
|
+
data.tar.gz: ba80773b85de541a717533b35c438e7c4e2500363c8477c00c371bd638cec74f9f14d38f2820f6778d92f89680c949b27ceedc4dea98bf2d53ddd916a56fe865
|
@@ -281,7 +281,7 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
281
281
|
},
|
282
282
|
|
283
283
|
getIndex: function (element, startPosition) {
|
284
|
-
var index = element.getAttribute('data-ecommerce-index')
|
284
|
+
var index = element.getAttribute('data-ga4-ecommerce-index')
|
285
285
|
|
286
286
|
if (!index) {
|
287
287
|
return null
|
@@ -307,7 +307,7 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
307
307
|
var element = data.element
|
308
308
|
var resultsId = data.resultsId
|
309
309
|
var isClickEvent = data.event !== undefined
|
310
|
-
var isSearchResult = element.getAttribute('data-search-query')
|
310
|
+
var isSearchResult = element.getAttribute('data-ga4-search-query')
|
311
311
|
|
312
312
|
var ecommerceSchema = new window.GOVUK.analyticsGa4.Schemas().ecommerceSchema()
|
313
313
|
var PIIRemover = new window.GOVUK.analyticsGa4.PIIRemover()
|
@@ -315,14 +315,14 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
315
315
|
|
316
316
|
if (isSearchResult) {
|
317
317
|
// Limiting to 100 characters to avoid noise from extra long search queries and to stop the size of the payload going over 8k limit.
|
318
|
-
var searchQuery = PIIRemover.stripPII(element.getAttribute('data-search-query')).substring(0, 100).toLowerCase()
|
319
|
-
var variant = element.getAttribute('data-ecommerce-variant')
|
318
|
+
var searchQuery = PIIRemover.stripPII(element.getAttribute('data-ga4-search-query')).substring(0, 100).toLowerCase()
|
319
|
+
var variant = element.getAttribute('data-ga4-ecommerce-variant')
|
320
320
|
DEFAULT_LIST_TITLE = 'Site search results'
|
321
321
|
}
|
322
322
|
|
323
323
|
var items = element.querySelectorAll('[data-ga4-ecommerce-path]')
|
324
|
-
var listTitle = element.getAttribute('data-list-title') || DEFAULT_LIST_TITLE
|
325
|
-
var startPosition = parseInt(element.getAttribute('data-ecommerce-start-index'), 10)
|
324
|
+
var listTitle = element.getAttribute('data-ga4-list-title') || DEFAULT_LIST_TITLE
|
325
|
+
var startPosition = parseInt(element.getAttribute('data-ga4-ecommerce-start-index'), 10)
|
326
326
|
|
327
327
|
ecommerceSchema.event = 'search_results'
|
328
328
|
ecommerceSchema.search_results.event_name = isClickEvent ? 'select_item' : 'view_item_list'
|
@@ -353,10 +353,10 @@ window.GOVUK.analyticsGa4 = window.GOVUK.analyticsGa4 || {};
|
|
353
353
|
var item = items[i]
|
354
354
|
var path = item.getAttribute('data-ga4-ecommerce-path')
|
355
355
|
|
356
|
-
// If the element does not have a data-ecommerce-index attribute, we set one so that we can use it later when setting the index property
|
356
|
+
// If the element does not have a data-ga4-ecommerce-index attribute, we set one so that we can use it later when setting the index property
|
357
357
|
// on the ecommerce object.
|
358
|
-
if (!item.getAttribute('data-ecommerce-index')) {
|
359
|
-
item.setAttribute('data-ecommerce-index', i + 1)
|
358
|
+
if (!item.getAttribute('data-ga4-ecommerce-index')) {
|
359
|
+
item.setAttribute('data-ga4-ecommerce-index', i + 1)
|
360
360
|
}
|
361
361
|
|
362
362
|
ecommerceSchema.search_results.ecommerce.items.push({
|
@@ -851,11 +851,6 @@ $after-button-padding-left: govuk-spacing(4);
|
|
851
851
|
}
|
852
852
|
}
|
853
853
|
|
854
|
-
.gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar .gem-c-layout-super-navigation-header__navigation-second-item-link {
|
855
|
-
font-size: 19px;
|
856
|
-
font-size: govuk-px-to-rem(19px);
|
857
|
-
}
|
858
|
-
|
859
854
|
.gem-c-layout-super-navigation-header__navigation-second-item-link--with-description {
|
860
855
|
font-size: 16px;
|
861
856
|
font-size: govuk-px-to-rem(16px);
|
@@ -881,13 +876,11 @@ $after-button-padding-left: govuk-spacing(4);
|
|
881
876
|
}
|
882
877
|
|
883
878
|
.gem-c-layout-super-navigation-header__navigation-second-item-description {
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
font-size: govuk-px-to-rem(19px);
|
890
|
-
margin-top: govuk-spacing(2);
|
879
|
+
@include govuk-typography-common;
|
880
|
+
font-size: 16px;
|
881
|
+
font-size: govuk-px-to-rem(16px);
|
882
|
+
font-weight: normal;
|
883
|
+
margin: govuk-spacing(1) 0 0 0;
|
891
884
|
}
|
892
885
|
|
893
886
|
.gem-c-layout-super-navigation-header__search-form {
|
@@ -911,11 +904,6 @@ $after-button-padding-left: govuk-spacing(4);
|
|
911
904
|
}
|
912
905
|
}
|
913
906
|
|
914
|
-
.gem-c-layout-super-navigation-header__navigation-dropdown-menu--large-navbar .gem-c-layout-super-navigation-header__popular-link {
|
915
|
-
font-size: 19px;
|
916
|
-
font-size: govuk-px-to-rem(19px);
|
917
|
-
}
|
918
|
-
|
919
907
|
.gem-c-layout-super-navigation-header__width-container {
|
920
908
|
@include govuk-media-query($until: "desktop") {
|
921
909
|
margin: 0;
|
@@ -24,13 +24,13 @@ module GovukPublishingComponents
|
|
24
24
|
|
25
25
|
def wrap_numbers_with_spans(content_item_link)
|
26
26
|
content_item_text = strip_tags(content_item_link) # just the text of the link
|
27
|
-
|
27
|
+
content_item_text_stripped = content_item_text.strip # strip trailing spaces for the regex. Keep original content_item_text for the string replacement.
|
28
28
|
# Must start with a number
|
29
29
|
# Number must be between 1 and 999 (ie not 2014)
|
30
30
|
# Must be followed by a space
|
31
31
|
# May contain a period `1.`
|
32
32
|
# May be a decimal `1.2`
|
33
|
-
number = /^\d{1,3}(\.?|\.\d{1,2})(?=\s)/.match(
|
33
|
+
number = /^\d{1,3}(\.?|\.\d{1,2})(?=\s)/.match(content_item_text_stripped)
|
34
34
|
|
35
35
|
if number
|
36
36
|
words = content_item_text.sub(number.to_s, "").strip # remove the number from the text
|
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: 35.21.
|
4
|
+
version: 35.21.2
|
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: 2023-10-
|
11
|
+
date: 2023-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|