govuk_publishing_components 64.1.1 → 64.2.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.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/modal-dialogue.js +0 -2
  3. data/app/assets/javascripts/govuk_publishing_components/components/select-with-search.js +33 -0
  4. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +3 -3
  5. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +16 -13
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +4 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +2 -2
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +5 -1
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +1 -13
  10. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +0 -20
  11. data/app/controllers/govuk_publishing_components/applications_page_controller.rb +5 -2
  12. data/app/controllers/govuk_publishing_components/audit_controller.rb +3 -2
  13. data/app/models/govuk_publishing_components/applications_page.rb +39 -4
  14. data/app/views/govuk_publishing_components/applications_page/_table-content.html.erb +9 -0
  15. data/app/views/govuk_publishing_components/applications_page/show.html.erb +1 -0
  16. data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +8 -8
  17. data/app/views/govuk_publishing_components/components/_service_navigation.html.erb +1 -1
  18. data/app/views/govuk_publishing_components/components/docs/attachment.yml +1 -2
  19. data/app/views/govuk_publishing_components/components/docs/details.yml +1 -8
  20. data/app/views/govuk_publishing_components/components/docs/error_alert.yml +2 -4
  21. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +7 -7
  22. data/app/views/govuk_publishing_components/components/docs/heading.yml +1 -1
  23. data/app/views/govuk_publishing_components/components/docs/modal_dialogue.yml +1 -1
  24. data/app/views/govuk_publishing_components/components/docs/table.yml +2 -2
  25. data/app/views/govuk_publishing_components/components/docs/tabs.yml +2 -6
  26. data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +2 -3
  27. data/lib/govuk_publishing_components/presenters/pagination_helper.rb +1 -1
  28. data/lib/govuk_publishing_components/version.rb +1 -1
  29. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +31 -3
  30. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js.map +1 -1
  31. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +31 -3
  32. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs.map +1 -1
  33. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  34. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +5 -0
  35. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss.map +1 -1
  36. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +8 -0
  37. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss.map +1 -1
  38. data/node_modules/govuk-frontend/dist/govuk/components/footer/fixtures.json +95 -23
  39. data/node_modules/govuk-frontend/dist/govuk/components/footer/macro-options.json +1 -1
  40. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-default.html +22 -22
  41. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-full-gds-example.html +22 -22
  42. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-three-equal-columns.html +22 -22
  43. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-html-content-licence-and-copyright-notice.html +17 -17
  44. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-meta.html +22 -22
  45. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-custom-text-content-licence-and-copyright-notice.html +17 -17
  46. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-one-column.html +22 -22
  47. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-default-width-navigation-two-columns.html +22 -22
  48. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-meta-links-and-meta-content.html +22 -22
  49. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-navigation.html +22 -22
  50. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-no-content-licence.html +16 -0
  51. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-custom-meta.html +20 -0
  52. data/node_modules/govuk-frontend/dist/govuk/components/footer/template-with-only-meta-links.html +59 -0
  53. data/node_modules/govuk-frontend/dist/govuk/components/footer/template.njk +30 -28
  54. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +12 -0
  55. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss.map +1 -1
  56. data/node_modules/govuk-frontend/dist/govuk/components/pagination/fixtures.json +31 -9
  57. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-default.html +3 -3
  58. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-first-page.html +3 -3
  59. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-last-page.html +3 -3
  60. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-custom-link-and-item-text.html +3 -3
  61. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template-with-many-pages.html +9 -9
  62. data/node_modules/govuk-frontend/dist/govuk/components/pagination/template.njk +3 -1
  63. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +1 -1
  64. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss.map +1 -1
  65. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/fixtures.json +18 -18
  66. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +30 -2
  67. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js.map +1 -1
  68. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +30 -2
  69. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs.map +1 -1
  70. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +30 -2
  71. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs.map +1 -1
  72. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-default.html +1 -1
  73. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-inverse.html +1 -1
  74. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-a-single-navigation-item-and-collapsenavigationonmobile-set-to-true.html +1 -1
  75. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-html-navigation-items.html +1 -1
  76. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-large-navigation.html +1 -1
  77. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-navigation-with-a-current-item.html +1 -1
  78. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-non-link-navigation-items.html +1 -1
  79. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template-with-service-name-and-navigation.html +1 -1
  80. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/template.njk +1 -1
  81. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +4 -0
  82. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss.map +1 -1
  83. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
  84. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css +2 -2
  85. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.css.map +1 -1
  86. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  87. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js.map +1 -1
  88. data/node_modules/govuk-frontend/dist/govuk/macros/attributes.njk +30 -14
  89. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +1 -1
  90. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss.map +1 -1
  91. data/node_modules/govuk-frontend/govuk-prototype-kit.config.json +1 -1
  92. data/node_modules/govuk-frontend/package.json +1 -1
  93. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ce0c3f4602a7fc50dd1f1f38a9d177c256c320842afd37f83260571361c8aef
4
- data.tar.gz: 851ec585153e68a005871ad0a242130d0e8df04e10902c888750f51186a63410
3
+ metadata.gz: ac4e471b589031c6a117d700be0a816631ed09e325fd174a05965d7d86f5ad95
4
+ data.tar.gz: 8a9a5455dd4b3464b4abd50a2b84fb7a21d39415e7c72f6043232f8711f20db7
5
5
  SHA512:
6
- metadata.gz: 994f0af2defdd9971a6c22b14e039e9afc801ef18d704527287fc6d355ba1a2d9ea2c898fd1a067992e7a6f289529c8844e4822f8e855b69cfbcdad204dd4ea7
7
- data.tar.gz: b9b4edbc35f12d6373aca1df522393529da9124a65eb64b8598c120963815be5f405b29dede59ea5a9277123c1d1632e2753ecc9d9b727bcb0a62e5932cc9b3b
6
+ metadata.gz: b695337f57ca2b458e5df63e52338565ad1e0021be84e912a29373b0119d5ce96c49a5b78bc88b577372ef2efcfcb2b147e1bb7e1c6433cf1b069499187196f2
7
+ data.tar.gz: 216b8f0d3f45d9a8732983b26361632d6597bc21279c170dbbf4a123e416b9c1863abb922e898afe0af3d897fa0b6fe4b742fb9d21b16ea4a59cdaef10a1f98c
@@ -49,7 +49,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
49
49
 
50
50
  this.$html.classList.add('gem-o-template--modal')
51
51
  this.$body.classList.add('gem-o-template__body--modal')
52
- this.$body.classList.add('gem-o-template__body--blur')
53
52
  this.$focusedElementBeforeOpen = document.activeElement
54
53
  this.$module.style.display = 'block'
55
54
  this.$dialogBox.focus()
@@ -64,7 +63,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
64
63
 
65
64
  this.$html.classList.remove('gem-o-template--modal')
66
65
  this.$body.classList.remove('gem-o-template__body--modal')
67
- this.$body.classList.remove('gem-o-template__body--blur')
68
66
  this.$module.style.display = 'none'
69
67
  this.$focusedElementBeforeOpen.focus()
70
68
 
@@ -13,6 +13,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {}
13
13
  return
14
14
  }
15
15
 
16
+ const blankOptionText = 'Select none'
16
17
  const placeholderOption = this.module.querySelector(
17
18
  'option[value=""]:first-child'
18
19
  )
@@ -42,6 +43,21 @@ window.GOVUK.Modules = window.GOVUK.Modules || {}
42
43
  const inner = this.containerInner.element
43
44
  const input = this.input.element
44
45
  inner.prepend(input)
46
+ } else {
47
+ // Update text for blank option in the hidden select
48
+ const selectElement = this.passedElement.element
49
+ if (selectElement.id.search('blank') > 0) {
50
+ selectElement.firstChild.innerText = blankOptionText
51
+ }
52
+ // Update text for blank option in the choices dropdown
53
+ // choices.js 'lastChild' in this context is the listbox of choices:
54
+ const listbox = this.dropdown.element.lastChild
55
+ // choices.js 'firstChild' in this context is the first option.
56
+ // This always displays "Select One" for selects with a blank option:
57
+ var blankOption = listbox.firstChild
58
+ if (blankOption && blankOption.id.search('blank') > 0) {
59
+ blankOption.innerText = blankOptionText
60
+ }
45
61
  }
46
62
  // Add aria-labelledby to the listbox as well as the combobox
47
63
  const listbox = this.itemList.element
@@ -54,6 +70,23 @@ window.GOVUK.Modules = window.GOVUK.Modules || {}
54
70
  }
55
71
  })
56
72
 
73
+ // Reset blank 'Select One' to 'Select None' on each change
74
+ // This is because choices.js rebuilds the widget on each
75
+ // change event and resets the text. We can't use the preferred
76
+ // refresh method as this loses the current state of the dropdown.
77
+ const selectElement = this.choices.passedElement.element
78
+ const listbox = this.choices.dropdown.element.lastChild
79
+ selectElement.addEventListener(
80
+ 'change',
81
+ function (event) {
82
+ var blankOption = listbox.firstChild
83
+ if (blankOption && blankOption.id.search('blank') > 0) {
84
+ blankOption.innerText = blankOptionText
85
+ }
86
+ },
87
+ false
88
+ )
89
+
57
90
  this.module.choices = this.choices
58
91
  }
59
92
 
@@ -193,13 +193,13 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
193
193
  var toggleText = document.createElement('span')
194
194
  var toggleStatus = document.createElement('span')
195
195
 
196
- toggleText.classList.add('mc-toggle-text')
196
+ toggleText.classList.add('js-toggle-text')
197
197
  toggleText.innerHTML = chartVisibleText
198
198
 
199
199
  toggleStatus.classList.add('govuk-visually-hidden', 'mc-toggle-status')
200
200
  toggleStatus.setAttribute('role', 'alert')
201
201
 
202
- link.classList.add('govuk-body-s', 'mc-toggle-button')
202
+ link.classList.add('gem-c-button', 'govuk-button', 'govuk-button--secondary')
203
203
  link.appendChild(toggleText)
204
204
  link.appendChild(toggleStatus)
205
205
 
@@ -213,7 +213,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
213
213
  this.toggleLink.addEventListener('click', function (e) {
214
214
  e.preventDefault()
215
215
 
216
- var toggleText = that.toggleLink.querySelector('.mc-toggle-text')
216
+ var toggleText = that.toggleLink.querySelector('.js-toggle-text')
217
217
  var toggleStatus = that.toggleLink.querySelector('.mc-toggle-status')
218
218
 
219
219
  that.$graphContainer.classList.toggle('mc-hidden')
@@ -286,7 +286,9 @@
286
286
  return sinceNavigationStart;
287
287
  }
288
288
 
289
- var version = "4.4.2";
289
+ var version = "4.4.3";
290
+ var pkg = {
291
+ version: version};
290
292
 
291
293
  function padStart(str, length$1, char) {
292
294
  while (str[length] < length$1) {
@@ -295,7 +297,8 @@
295
297
  return str;
296
298
  }
297
299
 
298
- var VERSION = version;
300
+ var pkgVersion = pkg.version;
301
+ var VERSION = pkgVersion;
299
302
  /**
300
303
  * Returns the version of the script as a float to be stored in legacy systems that do not support
301
304
  * string versions.
@@ -458,7 +461,7 @@
458
461
  emit("beacon", payload);
459
462
  }
460
463
  }
461
- catch (e) {
464
+ catch (_b) {
462
465
  // Intentionally empty; handled below
463
466
  }
464
467
  if (!this.isSent) {
@@ -636,7 +639,7 @@
636
639
  return currentSelector;
637
640
  }
638
641
  }
639
- catch (error) {
642
+ catch (_a) {
640
643
  // Do nothing.
641
644
  }
642
645
  return selector;
@@ -1461,7 +1464,7 @@
1461
1464
  // Seeing "Permission denied" errors, so do a simple try-catch.
1462
1465
  bCancelable = evt.cancelable;
1463
1466
  }
1464
- catch (e) {
1467
+ catch (_a) {
1465
1468
  // bail - no need to return anything
1466
1469
  logger.logEvent(52 /* LogEvent.InputEventPermissionError */);
1467
1470
  return;
@@ -2053,7 +2056,7 @@
2053
2056
  try {
2054
2057
  size += e.innerHTML[length];
2055
2058
  }
2056
- catch (e) {
2059
+ catch (_a) {
2057
2060
  // It seems like IE throws an error when accessing the innerHTML property
2058
2061
  logger.logEvent(53 /* LogEvent.InnerHtmlAccessError */);
2059
2062
  return -1;
@@ -2359,7 +2362,7 @@
2359
2362
  curtop += el.offsetTop;
2360
2363
  el = el.offsetParent;
2361
2364
  }
2362
- catch (e) {
2365
+ catch (_a) {
2363
2366
  // If we get an exception, just return the current values.
2364
2367
  return [curleft, curtop];
2365
2368
  }
@@ -2681,7 +2684,7 @@
2681
2684
  target = e.target;
2682
2685
  }
2683
2686
  }
2684
- catch (e) {
2687
+ catch (_a) {
2685
2688
  logger.logEvent(54 /* LogEvent.EventTargetAccessError */);
2686
2689
  }
2687
2690
  if (target) {
@@ -2827,7 +2830,7 @@
2827
2830
  }
2828
2831
  }
2829
2832
  }
2830
- catch (e) {
2833
+ catch (_a) {
2831
2834
  logger.logEvent(55 /* LogEvent.CookieReadError */);
2832
2835
  }
2833
2836
  return undefined;
@@ -2842,7 +2845,7 @@
2842
2845
  (globalConfig.cookieDomain ? "; domain=" + globalConfig.cookieDomain : "") +
2843
2846
  "; path=/; SameSite=Lax";
2844
2847
  }
2845
- catch (e) {
2848
+ catch (_a) {
2846
2849
  logger.logEvent(56 /* LogEvent.CookieSetError */);
2847
2850
  }
2848
2851
  }
@@ -2994,9 +2997,9 @@
2994
2997
  */
2995
2998
  function _runCommand(_a) {
2996
2999
  var fn = _a[0], args = _a.slice(1);
2997
- if (typeof globalLux[fn] === "function") {
2998
- // eslint-disable-next-line @typescript-eslint/ban-types
2999
- globalLux[fn].apply(globalLux, args);
3000
+ var method = globalLux[fn];
3001
+ if (typeof method === "function") {
3002
+ method.apply(globalLux, args);
3000
3003
  }
3001
3004
  }
3002
3005
  // Process the command queue
@@ -4,6 +4,10 @@
4
4
  // needs to be this specific to override govuk-heading
5
5
  .gem-c-heading__text {
6
6
  margin: 0;
7
+ // improve visual layout of headings
8
+ // set balance as a fallback for firefox, pretty for other browsers
9
+ text-wrap: balance;
10
+ text-wrap: pretty;
7
11
  }
8
12
  }
9
13
 
@@ -13,7 +13,7 @@
13
13
  @include govuk-text-colour;
14
14
 
15
15
  @include govuk-media-query($until: tablet) {
16
- flex-direction: row-reverse;
16
+ flex-direction: column-reverse;
17
17
  gap: govuk-spacing(3);
18
18
  }
19
19
  }
@@ -142,7 +142,7 @@
142
142
  border-top: none;
143
143
  }
144
144
 
145
- @include govuk-media-query($until: "mobile") {
145
+ @include govuk-media-query($until: mobile) {
146
146
  flex-direction: column-reverse;
147
147
  }
148
148
  }
@@ -684,7 +684,7 @@ $search-icon-height: 20px;
684
684
  border-top: 0;
685
685
  border-bottom: 2pt solid $govuk-print-text-colour;
686
686
  margin: 0 0 5mm;
687
- background: none;
687
+ background: transparent;
688
688
 
689
689
  &:has(.gem-c-layout-super-navigation-header__header-logo .govuk-visually-hidden) {
690
690
  border: 0;
@@ -698,6 +698,10 @@ $search-icon-height: 20px;
698
698
  .govuk-width-container {
699
699
  margin: 0;
700
700
  }
701
+
702
+ .gem-c-layout-super-navigation-header__container {
703
+ background: transparent;
704
+ }
701
705
  }
702
706
 
703
707
  .gem-c-layout-super-navigation-header__header-logo {
@@ -71,10 +71,9 @@ $govuk-modal-wide-breakpoint: $govuk-page-width + $govuk-modal-margin * 2 + $gov
71
71
  left: 0;
72
72
  width: 100%;
73
73
  height: 100%;
74
- opacity: .8;
75
- background: govuk-colour("black");
76
74
  pointer-events: none;
77
75
  touch-action: none;
76
+ backdrop-filter: blur(2px) brightness(0.4);
78
77
  }
79
78
 
80
79
  .gem-o-template--modal {
@@ -87,17 +86,6 @@ $govuk-modal-wide-breakpoint: $govuk-page-width + $govuk-modal-margin * 2 + $gov
87
86
  overflow: hidden;
88
87
  }
89
88
 
90
- .gem-o-template__body--blur {
91
- .govuk-skip-link,
92
- .govuk-header,
93
- .govuk-phase-banner,
94
- .govuk-width-container .govuk-back-link,
95
- .govuk-footer,
96
- .govuk-main-wrapper {
97
- filter: blur(2px);
98
- }
99
- }
100
-
101
89
  .gem-c-modal-dialogue__header {
102
90
  padding: 9px govuk-spacing(3) 10px;
103
91
  color: govuk-colour("white");
@@ -283,26 +283,6 @@
283
283
  text-align: left;
284
284
  }
285
285
 
286
- .mc-toggle-button {
287
- border: 1px solid $govuk-border-colour;
288
- color: $govuk-link-colour;
289
- cursor: pointer;
290
- margin: govuk-spacing(0);
291
- padding: govuk-spacing(2);
292
- background-color: govuk-colour("white");
293
-
294
- &:hover {
295
- background-color: govuk-colour("light-grey");
296
- color: $govuk-link-hover-colour;
297
- }
298
-
299
- &:focus {
300
- background-color: $govuk-focus-colour;
301
- border-color: transparent;
302
- @include govuk-focused-text;
303
- }
304
- }
305
-
306
286
  // Hides the original table
307
287
  .mc-hidden,
308
288
  .mc-hidden caption {
@@ -8,11 +8,11 @@ module GovukPublishingComponents
8
8
  },
9
9
  {
10
10
  type: "publishing",
11
- apps: %w[content-data-admin collections-publisher travel-advice-publisher whitehall datagovuk_find local-links-manager places-manager support manuals-publisher service-manual-publisher short-url-manager specialist-publisher content-tagger publisher transition search-admin].sort,
11
+ apps: %w[content-data-admin collections-publisher travel-advice-publisher whitehall datagovuk_find local-links-manager places-manager support manuals-publisher service-manual-publisher short-url-manager specialist-publisher content-tagger publisher transition search-admin fact-check-manager content-block-manager].sort,
12
12
  },
13
13
  {
14
14
  type: "utility",
15
- apps: %w[account-api signon govspeak govspeak-preview release govuk-developer-docs govuk-chat].sort,
15
+ apps: %w[account-api signon govspeak govspeak-preview release govuk-developer-docs govuk-chat govuk_web_banners].sort,
16
16
  },
17
17
  ]
18
18
 
@@ -41,6 +41,9 @@ module GovukPublishingComponents
41
41
  gem_version_status: app.gem_version == GovukPublishingComponents::VERSION ? "green" : "red",
42
42
  sass_version: app.sass_version,
43
43
  ruby_version: app.ruby_version,
44
+ ruby_version_status: app.ruby_status(app.ruby_version),
45
+ yarn_version: app.yarn_version,
46
+ yarn_version_status: app.yarn_version.to_f >= 4 ? "green" : "red",
44
47
  }
45
48
  end
46
49
  end
@@ -5,11 +5,12 @@ module GovukPublishingComponents
5
5
  account-api
6
6
  collections
7
7
  collections-publisher
8
+ content-block-manager
8
9
  content-data-admin
9
- content-publisher
10
10
  content-tagger
11
11
  datagovuk_find
12
12
  email-alert-frontend
13
+ fact-check-manager
13
14
  feedback
14
15
  finder-frontend
15
16
  frontend
@@ -18,13 +19,13 @@ module GovukPublishingComponents
18
19
  govspeak-preview
19
20
  govuk-chat
20
21
  govuk-developer-docs
22
+ govuk_web_banners
21
23
  local-links-manager
22
24
  manuals-publisher
23
25
  places-manager
24
26
  publisher
25
27
  release
26
28
  search-admin
27
- search-v2-evaluator
28
29
  service-manual-publisher
29
30
  short-url-manager
30
31
  signon
@@ -1,12 +1,14 @@
1
1
  module GovukPublishingComponents
2
2
  class ApplicationsPage
3
- attr_reader :source
3
+ attr_reader :source, :ruby_version
4
4
 
5
5
  def initialize(application)
6
6
  @application = application
7
7
  @dir = get_directory
8
8
  @gemfilelock = get_file("Gemfile.lock")
9
- @rubyfile = get_file(".ruby-version")
9
+ rubyfile = get_file(".ruby-version")
10
+ @ruby_version = rubyfile.strip if rubyfile
11
+ @packagejson = get_file("package.json")
10
12
  end
11
13
 
12
14
  def readable_name
@@ -21,8 +23,41 @@ module GovukPublishingComponents
21
23
  parse_file(@gemfilelock, /sass-embedded \(([^)>=~ ]+)\)/)
22
24
  end
23
25
 
24
- def ruby_version
25
- @rubyfile.strip if @rubyfile
26
+ def ruby_status(version)
27
+ version = version.to_f # to_f ignores non-numbers on the string end, so 3.3.1 becomes 3.1
28
+ versions = [
29
+ {
30
+ version: 3.3,
31
+ eol: "2027-03-31",
32
+ },
33
+ {
34
+ version: 3.2,
35
+ eol: "2026-03-31",
36
+ },
37
+ {
38
+ version: 3.1,
39
+ eol: "2024-04-23",
40
+ },
41
+ ]
42
+ today = Date.today # rubocop:disable Rails/Date
43
+ result = "not set"
44
+
45
+ versions.each do |v|
46
+ next unless version >= v[:version]
47
+
48
+ version_eol = Date.parse(v[:eol])
49
+ age = version_eol - today
50
+ result = "green"
51
+ result = "orange" if age < 100
52
+ result = "red" if age.negative?
53
+ break
54
+ end
55
+
56
+ result
57
+ end
58
+
59
+ def yarn_version
60
+ parse_file(@packagejson, /"packageManager"\s*:\s*"yarn@(\d+(?:\.\d+)*)"/)
26
61
  end
27
62
 
28
63
  private
@@ -32,6 +32,15 @@
32
32
  <% if app[:ruby_version] %>
33
33
  <%= render "govuk_publishing_components/components/tag", {
34
34
  text: app[:ruby_version],
35
+ colour: app[:ruby_version_status],
36
+ } %>
37
+ <% end %>
38
+ </td>
39
+ <td class="govuk-table__cell">
40
+ <% if app[:yarn_version] %>
41
+ <%= render "govuk_publishing_components/components/tag", {
42
+ text: app[:yarn_version],
43
+ colour: app[:yarn_version_status],
35
44
  } %>
36
45
  <% end %>
37
46
  </td>
@@ -25,6 +25,7 @@
25
25
  <th scope="col" class="govuk-table__header sticky-table-header">Gem version</th>
26
26
  <th scope="col" class="govuk-table__header sticky-table-header">Sass version</th>
27
27
  <th scope="col" class="govuk-table__header sticky-table-header">Ruby version</th>
28
+ <th scope="col" class="govuk-table__header sticky-table-header">Yarn version</th>
28
29
  </tr>
29
30
  </thead>
30
31
  <tbody class="govuk-table__body">
@@ -1,12 +1,12 @@
1
- <%
2
- cb_helper = GovukPublishingComponents::Presenters::CheckboxesHelper.new(local_assigns)
3
- id = cb_helper.id
4
- component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
5
- component_helper.set_id(id)
6
- component_helper.add_class(cb_helper.css_classes.join(" ")) # cb_helper.css_classes generates "gem-c-checkboxes"
7
- component_helper.add_data_attribute({ module: "gem-checkboxes govuk-checkboxes" })
8
- %>
1
+ <% cb_helper = GovukPublishingComponents::Presenters::CheckboxesHelper.new(local_assigns) %>
9
2
  <% if cb_helper.items.any? %>
3
+ <%
4
+ id = cb_helper.id
5
+ component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
6
+ component_helper.set_id(id)
7
+ component_helper.add_class(cb_helper.css_classes.join(" ")) # cb_helper.css_classes generates "gem-c-checkboxes"
8
+ component_helper.add_data_attribute({ module: "gem-checkboxes govuk-checkboxes" })
9
+ %>
10
10
  <%= tag.div(**component_helper.all_attributes) do %>
11
11
  <% if cb_helper.should_have_fieldset %>
12
12
  <% if cb_helper.heading_markup %>
@@ -31,7 +31,7 @@
31
31
  <% if navigation_items.present? %>
32
32
  <nav aria-label="<%= navigation_aria_label %>" class="govuk-service-navigation__wrapper">
33
33
  <% if collapse_navigation_on_mobile %>
34
- <button type="button" class="govuk-service-navigation__toggle govuk-js-service-navigation-toggle" aria-controls="navigation" hidden>
34
+ <button type="button" class="govuk-service-navigation__toggle govuk-js-service-navigation-toggle" aria-controls="navigation" hidden aria-hidden="true">
35
35
  Menu
36
36
  </button>
37
37
  <% end %>
@@ -4,8 +4,7 @@ body: |
4
4
  This component shows a link to a document that is attached to GOV.UK content
5
5
  along with a thumbnail and relevant file data.
6
6
 
7
- It is intended to be rendered in Govspeak and as an attachment 'preview' in
8
- Content Publisher.
7
+ It is intended to be rendered in Govspeak.
9
8
 
10
9
  It is not as rich in features as the [attachment rendering][Whitehall]
11
10
  provided by Whitehall, it lacks support for multiple languages, CSV previews
@@ -1,5 +1,6 @@
1
1
  name: Details
2
2
  description: Make a page easier to scan by letting users reveal more detailed information only if they need it
3
+ uses_component_wrapper_helper: true
3
4
  shared_accessibility_criteria:
4
5
  - link
5
6
  accessibility_criteria: |
@@ -38,14 +39,6 @@ examples:
38
39
  <p class="govuk-body">Attorney General's office</p>
39
40
  <%= component %>
40
41
  </div>
41
- with_GTM_tracking:
42
- description: Applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
43
- data:
44
- title: Help with nationality
45
- data_attributes:
46
- tracking: GTM-123AB
47
- block: |
48
- We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
49
42
  with_ga4_tracking:
50
43
  description: |
51
44
  GA4 tracking is mostly handled internally by the component, apart from the required attribute `index_section_count`. This records the number of details components on the page and must be passed by the hosting application. Other GA4 attributes can also be passed if required, including to override attributes set by the component (for some reason this doesn't work in the component guide but works in applications).
@@ -24,14 +24,12 @@ examples:
24
24
  Nullam sed neque quis turpis.
25
25
  with_data_attributes:
26
26
  description: |
27
- The example shown applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
28
-
29
- Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/trackers/ga4-link-tracker.md).
27
+ Note that the component does not include built in tracking. If this is required consider using the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/trackers/ga4-link-tracker.md).
30
28
  data:
31
29
  message: Message to alert the user to a unsuccessful action goes here
32
30
  description: A further description
33
31
  data_attributes:
34
- tracking: GTM-123AB
32
+ hello: world
35
33
  with_specified_id_attribute:
36
34
  data:
37
35
  id: test-id
@@ -317,7 +317,7 @@ examples:
317
317
  </section>
318
318
  <section class="attachment embedded" id="attachment_1399344">
319
319
  <div class="attachment-thumb">
320
- <a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/world-location-news/294043.es-419"><img alt="" src="https://assets.digital.cabinet-office.gov.uk/government/assets/pub-cover-doc-afe3b0a8a9511beeca890340170aee8b5649413f948e512c9b8ce432d8513d32.png"></a>
320
+ <a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/world-location-news/294043.es-419"><img alt="" src="#"></a>
321
321
  </div>
322
322
  <div class="attachment-details">
323
323
  <h2 class="title"><a href="https://www.gov.uk/government/world-location-news/294043.es-419">Document attachment</a></h2>
@@ -345,7 +345,7 @@ examples:
345
345
  </section>
346
346
  <section class="attachment embedded" id="attachment_1399348">
347
347
  <div class="attachment-thumb">
348
- <img alt="" src="https://assets.digital.cabinet-office.gov.uk/government/assets/pub-cover-spreadsheet-471052e0d03e940bbc62528a05ac204a884b553e4943e63c8bffa6b8baef8967.png">
348
+ <img alt="" src="#">
349
349
  </div>
350
350
  <div class="attachment-details">
351
351
  <h2 class="title">Previewable online example</h2>
@@ -366,7 +366,7 @@ examples:
366
366
  </section>
367
367
  <section class="attachment embedded" id="attachment_1243761">
368
368
  <div class="attachment-thumb">
369
- <a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/statistical-data-sets/env24-fly-tipping-incidents-and-actions-taken-in-england"><img alt="" src="https://assets.digital.cabinet-office.gov.uk/government/assets/pub-cover-spreadsheet-471052e0d03e940bbc62528a05ac204a884b553e4943e63c8bffa6b8baef8967.png"></a>
369
+ <a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/statistical-data-sets/env24-fly-tipping-incidents-and-actions-taken-in-england"><img alt="" src="#"></a>
370
370
  </div>
371
371
  <div class="attachment-details">
372
372
  <h2 class="title"><a aria-describedby="attachment-1243761-accessibility-help" href="https://www.gov.uk/government/statistical-data-sets/env24-fly-tipping-incidents-and-actions-taken-in-england">Fly-tipping incidents and actions reported by local authorities in 2014 to 2015</a></h2>
@@ -391,7 +391,7 @@ examples:
391
391
  </section>
392
392
  <section class="attachment embedded" id="attachment_1112527">
393
393
  <div class="attachment-thumb">
394
- <a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/publications/summer-budget-2015/summer-budget-2015"><img alt="" src="https://assets.digital.cabinet-office.gov.uk/government/assets/pub-cover-html-b0465911e56983d98c70f0e25fba24bc206d37e8c83d4addf6421dcf6022c6cd.png"></a>
394
+ <a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/publications/summer-budget-2015/summer-budget-2015"><img alt="" src="#"></a>
395
395
  </div>
396
396
  <div class="attachment-details">
397
397
  <h2 class="title"><a href="https://www.gov.uk/government/publications/summer-budget-2015/summer-budget-2015">Summer Budget 2015</a></h2>
@@ -402,7 +402,7 @@ examples:
402
402
  </section>
403
403
  <section class="attachment hosted-externally" id="attachment_1425055">
404
404
  <div class="attachment-thumb">
405
- <a aria-hidden="true" class="thumbnail" href="http://example.com"><img alt="" src="//www.gov.uk/government/assets/pub-cover-a380604bb953dc22ac9dcfbf3cc65598327f493c37b09ac497c45148cbaa21b1.png"></a>
405
+ <a aria-hidden="true" class="thumbnail" href="http://example.com"><img alt="" src="#"></a>
406
406
  </div>
407
407
  <div class="attachment-details">
408
408
  <h2 class="title"><a rel="external" href="https://www.arcgis.com/apps/opsdashboard/index.html#/f94c3c90da5b4e9f9a0b19484dd4bb14">Track coronavirus cases</a></h2>
@@ -413,7 +413,7 @@ examples:
413
413
  </section>
414
414
  <section class="attachment hosted-externally" id="attachment_1425056">
415
415
  <div class="attachment-thumb">
416
- <a aria-hidden="true" class="thumbnail" href="http://example.com"><img alt="" src="//www.gov.uk/government/assets/pub-cover-a380604bb953dc22ac9dcfbf3cc65598327f493c37b09ac497c45148cbaa21b1.png"></a>
416
+ <a aria-hidden="true" class="thumbnail" href="http://example.com"><img alt="" src="#"></a>
417
417
  </div>
418
418
  <div class="attachment-details">
419
419
  <h2 class="title"><a rel="external" href="http://example.com">An external link (with all possible metadata)</a></h2>
@@ -431,7 +431,7 @@ examples:
431
431
  </section>
432
432
  <section class="attachment embedded" id="attachment_1398523">
433
433
  <div class="attachment-thumb">
434
- <a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/consultations/environmental-permitting-updating-the-standards-for-petrol-vapour-recovery-at-service-stations"><img alt="" src="https://assets.digital.cabinet-office.gov.uk/government/uploads/system/uploads/attachment_data/file/498443/thumbnail_petrol-vapour-recovery-consult-sum-resp.pdf.png"></a>
434
+ <a aria-hidden="true" class="thumbnail" href="https://www.gov.uk/government/consultations/environmental-permitting-updating-the-standards-for-petrol-vapour-recovery-at-service-stations"><img alt="" src="#"></a>
435
435
  </div>
436
436
  <div class="attachment-details">
437
437
  <h2 class="title"><a href="https://www.gov.uk/government/consultations/environmental-permitting-updating-the-standards-for-petrol-vapour-recovery-at-service-stations">Consultation outcome with published date</a></h2>
@@ -30,7 +30,7 @@ examples:
30
30
 
31
31
  This option is not tied to the `heading_level` option in order to give flexibility.
32
32
  data:
33
- text: 'One big heading'
33
+ text: 'One big heading containing a number of words'
34
34
  font_size: "xl"
35
35
  right_to_left:
36
36
  data:
@@ -10,7 +10,7 @@ body: |
10
10
 
11
11
  Modal components must be a direct descendant of the `<body>` element; we recommend placing it toward the end of the document for performance considerations.
12
12
 
13
- This component is currently experimental. If you are using it, please feed back any research findings to the Content Publisher team.
13
+ This component is currently experimental. If you are using it, please feed back any research findings to #govuk-ruby-frontenders on Slack.
14
14
  accessibility_criteria: |
15
15
  The modal dialogue box must:
16
16
 
@@ -90,7 +90,7 @@ examples:
90
90
  description: |
91
91
  This option allows links to be added to the table headers for sorting. Sorting must be handled server side, it is not done by the component.
92
92
 
93
- The example shown applies a tracking attribute specifically for use by Google Tag Manager in [Content Publisher](https://github.com/alphagov/content-publisher).
93
+ The example shown applies a data attribute too.
94
94
 
95
95
  Other data attributes can also be applied as required. Note that the component does not include built in tracking. If this is required consider using the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/trackers/ga4-link-tracker.md).
96
96
  data:
@@ -102,7 +102,7 @@ examples:
102
102
  sort_direction: descending
103
103
  href: /?sort_direction=desc
104
104
  data_attributes:
105
- tracking: "UTM-123A"
105
+ hello: world
106
106
  - text: Rate for vehicles
107
107
  format: numeric
108
108
  href: /?sort_direction=desc