govuk_publishing_components 27.6.0 → 27.8.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/google-analytics-universal-tracker.js +9 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics/init.js +12 -8
  5. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +0 -55
  6. data/app/assets/javascripts/govuk_publishing_components/components/intervention.js +1 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +9 -3
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +8 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +14 -4
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +13 -10
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +17 -10
  12. data/app/assets/stylesheets/govuk_publishing_components/components/print/_organisation-logo.scss +3 -0
  13. data/app/controllers/govuk_publishing_components/audit_controller.rb +11 -3
  14. data/app/views/govuk_publishing_components/audit/_components.html.erb +2 -2
  15. data/app/views/govuk_publishing_components/audit/show.html.erb +1 -1
  16. data/app/views/govuk_publishing_components/components/_big_number.html.erb +2 -1
  17. data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +2 -2
  18. data/app/views/govuk_publishing_components/components/_input.html.erb +2 -1
  19. data/app/views/govuk_publishing_components/components/_intervention.html.erb +39 -26
  20. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +4 -24
  21. data/app/views/govuk_publishing_components/components/_list.html.erb +7 -2
  22. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
  23. data/app/views/govuk_publishing_components/components/docs/big_number.yml +7 -0
  24. data/app/views/govuk_publishing_components/components/docs/devolved_nations.yml +24 -14
  25. data/app/views/govuk_publishing_components/components/docs/govspeak.yml +4 -4
  26. data/app/views/govuk_publishing_components/components/docs/intervention.yml +45 -6
  27. data/app/views/govuk_publishing_components/components/docs/list.yml +8 -0
  28. data/app/views/govuk_publishing_components/components/docs/radio.yml +45 -40
  29. data/app/views/govuk_publishing_components/components/docs/title.yml +0 -11
  30. data/app/views/govuk_publishing_components/components/search/_search_icon.html.erb +28 -0
  31. data/config/locales/en.yml +5 -5
  32. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +3 -17
  33. data/lib/govuk_publishing_components/presenters/devolved_nations_helper.rb +12 -1
  34. data/lib/govuk_publishing_components/presenters/intervention_helper.rb +19 -0
  35. data/lib/govuk_publishing_components/version.rb +1 -1
  36. data/lib/govuk_publishing_components.rb +1 -0
  37. metadata +7 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 826abb0589e48d2525ea4581c2822e8c924143fd8fe1291723d8daeb9ea27aed
4
- data.tar.gz: 3609b9bc4dd4431663e8d8a9424a366c1e62259f305eb89deea5cbd730c47459
3
+ metadata.gz: 3763a55d9466b65e17b6d352fcbc6a646aebe57cb22dfca0918a8732244af04b
4
+ data.tar.gz: 1cd543455e2a9881bb70efff661206cb6869ff7608f782429d767c8cf6287893
5
5
  SHA512:
6
- metadata.gz: fc3b285ebf4bb142daad075031fd004e6be838ee306d4efc21e77c887f46ce8a35a91fc7d4b8a5496941e6be16b365c778b2c2a58f3e7b32c8a2863ccb1f2e92
7
- data.tar.gz: 35d279033c32850de9356d00d89a3752203f31495b475f3810b7449ad0cb05db681d037b4f0a3b1852d635c1c9c1fb1cd5d6afb6d231341942ff742b3377e0b6
6
+ metadata.gz: 0e50da185727b17d9440a957019e0231de4947251bfe3a06273f19e4a0d4fa60bc1b67c9a937877c6dd09f3ac494bc80fb287c767d6541bb4399b1ef194828e7
7
+ data.tar.gz: 59f7ef7156937d87460beebe6c798c9307ef7472a84fa44eaaa9795e7d41adfb6510833ee16af03b54911c13a834b2514a0b026ad2a3fa2e62aa08dd0ef9be2e
data/README.md CHANGED
@@ -47,6 +47,7 @@ bin/rake app:jasmine:ci
47
47
  - [Code documentation on rubydoc.info](http://www.rubydoc.info/gems/govuk_publishing_components)
48
48
  - [Component conventions](docs/component_conventions.md)
49
49
  - [Component principles](docs/component_principles.md)
50
+ - [Component auditing](docs/auditing.md)
50
51
 
51
52
  ## Licence
52
53
 
@@ -36,11 +36,20 @@
36
36
  fieldsObject = { cookieDomain: fieldsObject }
37
37
  }
38
38
 
39
+ function setLinkedDomains () {
40
+ var domains = window.GOVUK.analyticsVars.primaryLinkedDomains
41
+ if (domains && domains.length > 0) {
42
+ sendToGa('require', 'linker')
43
+ sendToGa('linker:autoLink', domains)
44
+ }
45
+ }
46
+
39
47
  configureProfile()
40
48
  anonymizeIp()
41
49
  disableAdFeatures()
42
50
  stripTitlePII()
43
51
  stripLocationPII()
52
+ setLinkedDomains()
44
53
  }
45
54
 
46
55
  GoogleAnalyticsUniversalTracker.load = function () {
@@ -3,9 +3,12 @@ var analyticsInit = function () {
3
3
 
4
4
  var analyticsVars = window.GOVUK.analyticsVars || false
5
5
  if (analyticsVars) {
6
- var gaProperty = window.GOVUK.analyticsVars.gaProperty || false
7
- var gaPropertyCrossDomain = window.GOVUK.analyticsVars.gaPropertyCrossDomain || false
8
- var linkedDomains = window.GOVUK.analyticsVars.linkedDomains || false
6
+ // the property naming convention here isn't consistent, but used in static and
7
+ // govuk-account-manager-prototype, so hard to change
8
+ var primaryGaProperty = window.GOVUK.analyticsVars.gaProperty || false
9
+
10
+ var crossDomainGaProperty = window.GOVUK.analyticsVars.gaPropertyCrossDomain || false
11
+ var crossDomainLinkedDomains = window.GOVUK.analyticsVars.linkedDomains || false
9
12
  }
10
13
 
11
14
  window.GOVUK.Analytics.checkDigitalIdentityConsent = function (location) {
@@ -39,7 +42,7 @@ var analyticsInit = function () {
39
42
 
40
43
  // Disable analytics by default
41
44
  // This will be reversed below, if the consent cookie says usage cookies are allowed
42
- var disabler = 'ga-disable-' + gaProperty
45
+ var disabler = 'ga-disable-' + primaryGaProperty
43
46
  window[disabler] = true
44
47
 
45
48
  if (consentCookie && consentCookie.usage) {
@@ -48,14 +51,14 @@ var analyticsInit = function () {
48
51
  // Load Google Analytics libraries
49
52
  window.GOVUK.StaticAnalytics.load()
50
53
 
51
- if (gaProperty) {
54
+ if (primaryGaProperty) {
52
55
  // Use document.domain in dev, preview and staging so that tracking works
53
56
  // Otherwise explicitly set the domain as www.gov.uk (and not gov.uk).
54
57
  var cookieDomain = (document.domain === 'www.gov.uk') ? '.www.gov.uk' : document.domain
55
58
 
56
59
  // Configure profiles, setup custom vars, track initial pageview
57
60
  var analytics = new window.GOVUK.StaticAnalytics({
58
- universalId: gaProperty,
61
+ universalId: primaryGaProperty,
59
62
  cookieDomain: cookieDomain,
60
63
  allowLinker: true
61
64
  })
@@ -63,8 +66,9 @@ var analyticsInit = function () {
63
66
  // Make interface public for virtual pageviews and events
64
67
  window.GOVUK.analytics = analytics
65
68
 
66
- if (linkedDomains && linkedDomains.length > 0) {
67
- window.GOVUK.analytics.addLinkedTrackerDomain(gaPropertyCrossDomain, 'govuk', linkedDomains)
69
+ // set up linking of domains for cross domain ga property
70
+ if (crossDomainLinkedDomains && crossDomainLinkedDomains.length > 0) {
71
+ window.GOVUK.analytics.addLinkedTrackerDomain(crossDomainGaProperty, 'govuk', crossDomainLinkedDomains)
68
72
  }
69
73
  }
70
74
  } else {
@@ -58,13 +58,6 @@
58
58
  '/guidance/foreign-travel-insurance': [
59
59
  ['Heading', 'What your travel insurance policy should cover']
60
60
  ],
61
- '/guidance/social-security-contributions-for-uk-and-eu-workers-if-the-uk-leaves-the-eu-with-no-deal': [
62
- ['Heading', 'UK employers'],
63
- ['Heading', 'UK employees and self-employed']
64
- ],
65
- '/guidance/student-finance-arrangements-in-a-no-deal-scenario': [
66
- ['Heading', 'Other overseas study placements']
67
- ],
68
61
  '/guidance/living-in-france': [
69
62
  ['Heading', 'Passports and travel']
70
63
  ],
@@ -74,12 +67,6 @@
74
67
  '/guidance/healthcare-for-eu-and-efta-citizens-visiting-the-uk': [
75
68
  ['Heading', 'Travel insurance']
76
69
  ],
77
- '/guidance/driving-in-the-eu-after-brexit': [
78
- ['Heading', 'GB stickers and number plates']
79
- ],
80
- '/guidance/driving-in-the-eu-after-brexit#insurance-for-your-vehicle-caravan-or-trailer': [
81
- ['Heading', 'Trailer registration']
82
- ],
83
70
  '/driving-abroad': [
84
71
  ['Heading', 'Check your insurance if you’re taking your own vehicle']
85
72
  ],
@@ -89,57 +76,15 @@
89
76
  '/driving-abroad/international-driving-permit': [
90
77
  ['Heading', 'Check which IDP you need']
91
78
  ],
92
- '/guidance/driving-in-the-eu-after-brexit#gb-stickers-and-number-plates': [
93
- ['Heading', 'GB stickers and number plates']
94
- ],
95
79
  '/guidance/guidance-for-suppliers-of-cattle-sheep-and-goat-ear-tags': [
96
80
  ['Heading', 'Tagging information for livestock keepers']
97
81
  ],
98
- '/guidance/wine-trade-regulations': [
99
- ['Heading', 'Rules for transporting wine into the UK']
100
- ],
101
- '/guidance/the-chemicals-sector-and-preparing-for-eu-exit': [
102
- ['Heading', 'Energy and climate']
103
- ],
104
82
  '/guidance/how-to-move-goods-between-or-through-common-transit-countries-including-the-eu': [
105
83
  ['Heading', 'Start moving your goods']
106
84
  ],
107
85
  '/guidance/ecmt-international-road-haulage-permits': [
108
86
  ['Heading', 'Apply for permits']
109
87
  ],
110
- '/guidance/prepare-to-drive-in-the-eu-after-brexit-lorry-and-goods-vehicle-drivers': [
111
- ['Heading', 'Driver CPC for lorry drivers']
112
- ],
113
- '/guidance/run-international-bus-or-coach-services-after-brexit': [
114
- ['Heading', 'Run regular international services']
115
- ],
116
- '/guidance/vehicle-type-approval-if-theres-no-brexit-deal': [
117
- ['Heading', 'Existing vehicle and component type-approvals']
118
- ],
119
- '/guidance/the-retail-sector-and-preparing-for-eu-exit': [
120
- ['Heading', 'Importing and exporting']
121
- ],
122
- '/guidance/the-consumer-goods-sector-and-preparing-for-eu-exit': [
123
- ['Heading', 'Importing and exporting']
124
- ],
125
- '/government/publications/banking-insurance-and-other-financial-services-if-theres-no-brexit-deal/banking-insurance-and-other-financial-services-if-theres-no-brexit-deal-information-for-financial-services-institutions': [
126
- ['Heading', '3. Action taken by the UK']
127
- ],
128
- '/government/publications/further-guidance-note-on-the-regulation-of-medicines-medical-devices-and-clinical-trials-if-theres-no-brexit-deal/further-guidance-note-on-the-regulation-of-medicines-medical-devices-and-clinical-trials-if-theres-no-brexit-deal': [
129
- ['Heading', '1.4 Orphan medicines']
130
- ],
131
- '/guidance/check-temporary-rates-of-customs-duty-on-imports-after-eu-exit': [
132
- ['Heading', 'Tariff-rate quotas (TRQ)']
133
- ],
134
- '/guidance/construction-products-regulation-if-there-is-no-brexit-deal': [
135
- ['Heading', 'UK manufacturers exporting to the EU']
136
- ],
137
- '/guidance/european-and-domestic-funding-after-brexit': [
138
- ['Heading', 'What you need to do']
139
- ],
140
- '/guidance/guidance-on-substantial-amendments-to-a-clinical-trial-if-the-uk-leaves-the-eu-with-no-deal': [
141
- ['Heading', 'Investigational medicinal product (IMP) certification and importation']
142
- ],
143
88
  '/taking-goods-out-uk-temporarily/get-an-ata-carnet': [
144
89
  ['Heading', 'Using an ATA Carnet']
145
90
  ],
@@ -8,6 +8,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
8
8
 
9
9
  Intervention.prototype.init = function () {
10
10
  if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
11
+ // Send a tracking event when this component is shown
11
12
  window.GOVUK.analytics.trackEvent('interventionBanner', 'interventionShown')
12
13
  }
13
14
  }
@@ -94,13 +94,19 @@
94
94
 
95
95
  .gem-c-action-link--blue-arrow {
96
96
  &:before {
97
- width: 45px;
98
- height: 35px;
97
+ width: 36px;
98
+ height: 28px;
99
99
  background: image-url("govuk_publishing_components/action-link-arrow--blue.png");
100
100
  background: image-url("govuk_publishing_components/action-link-arrow--blue.svg"), linear-gradient(transparent, transparent);
101
101
  background-repeat: no-repeat;
102
- background-size: 35px auto;
102
+ background-size: 28px auto;
103
103
  background-position: 0 0;
104
+
105
+ @include govuk-media-query($from: tablet) {
106
+ width: 45px;
107
+ height: 35px;
108
+ background-size: 35px auto;
109
+ }
104
110
  }
105
111
  }
106
112
 
@@ -38,4 +38,12 @@
38
38
  @include govuk-link-hover-decoration;
39
39
  }
40
40
  }
41
+
42
+ &:focus,
43
+ &:focus:hover {
44
+ .gem-c-big-number__label,
45
+ .gem-c-big-number__value--decorated {
46
+ text-decoration: none;
47
+ }
48
+ }
41
49
  }
@@ -1,8 +1,18 @@
1
1
  @import "govuk/components/input/input";
2
+ $search-icon-size: 40px;
2
3
 
3
- .gem-c-input--search-icon {
4
- background: govuk-colour("white") url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E") no-repeat -5px -3px;
5
- padding-left: govuk-spacing(6);
4
+ .gem-c-input__search-icon {
5
+ display: block;
6
+ position: relative;
7
+ margin-bottom: -$search-icon-size;
8
+ z-index: 1;
9
+ width: $search-icon-size;
10
+ height: $search-icon-size;
11
+ @if $govuk-typography-use-rem {
12
+ margin-bottom: -(govuk-px-to-rem($search-icon-size));
13
+ height: govuk-px-to-rem($search-icon-size);
14
+ }
15
+ background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E") no-repeat -3px center;
6
16
  }
7
17
 
8
18
  // this overrides styles from static that break the look of the component
@@ -14,7 +24,7 @@
14
24
  padding: govuk-spacing(1);
15
25
  box-sizing: border-box;
16
26
 
17
- &.gem-c-input--search-icon {
27
+ &.gem-c-input--with-search-icon {
18
28
  padding-left: govuk-spacing(6);
19
29
  }
20
30
  }
@@ -1,18 +1,21 @@
1
1
  .gem-c-intervention {
2
2
  @include govuk-text-colour;
3
- @include govuk-responsive-padding(6, "left");
4
- @include govuk-responsive-padding(6, "right");
5
- @include govuk-responsive-padding(4, "top");
6
- @include govuk-responsive-padding(4, "bottom");
3
+ @include govuk-responsive-padding(3);
7
4
  @include govuk-responsive-margin(6, "bottom");
8
5
  background-color: govuk-colour("light-grey", $legacy: "grey-4");
9
-
10
- .gem-c-intervention__title {
11
- @include govuk-responsive-margin(0);
12
- @include govuk-responsive-padding(4, "bottom");
13
- }
6
+ border-left: 10px solid $govuk-success-colour;
14
7
 
15
8
  .govuk-body:last-of-type {
16
- @include govuk-responsive-margin(0, "bottom");
9
+ margin-bottom: 0;
17
10
  }
18
11
  }
12
+
13
+ .gem-c-intervention__textwrapper {
14
+ display: block;
15
+ }
16
+
17
+ .gem-c-intervention__dismiss-icon {
18
+ width: 1em;
19
+ height: 1em;
20
+ margin-bottom: -2px;
21
+ }
@@ -85,6 +85,19 @@ $large-input-size: 50px;
85
85
  }
86
86
  }
87
87
 
88
+ @mixin icon-positioning($container-size) {
89
+ $icon-dimension: 20px;
90
+ $icon-position: ($container-size - $icon-dimension) / 2;
91
+
92
+ display: block;
93
+ pointer-events: none;
94
+ position: absolute;
95
+ height: $icon-dimension;
96
+ width: $icon-dimension;
97
+ top: $icon-position;
98
+ left: $icon-position;
99
+ }
100
+
88
101
  .gem-c-search__submit {
89
102
  border: 0;
90
103
  cursor: pointer;
@@ -93,15 +106,11 @@ $large-input-size: 50px;
93
106
  padding: 0;
94
107
  width: $input-size;
95
108
  height: $input-size;
96
- background-image: image-url("govuk_publishing_components/search-button.png");
97
- background-repeat: no-repeat;
98
- background-position: 2px 50%;
99
109
  text-indent: -5000px;
100
110
  overflow: hidden;
101
111
 
102
- @include govuk-device-pixel-ratio {
103
- background-size: 52.5px auto;
104
- background-position: 115% 50%;
112
+ .gem-c-search__icon {
113
+ @include icon-positioning($input-size);
105
114
  }
106
115
 
107
116
  &:focus {
@@ -222,11 +231,9 @@ $large-input-size: 50px;
222
231
  .gem-c-search__submit {
223
232
  width: $large-input-size;
224
233
  height: $large-input-size;
225
- background-position: 8px 50%;
226
234
 
227
- @include govuk-device-pixel-ratio {
228
- background-size: 60px auto;
229
- background-position: 160% 50%;
235
+ .gem-c-search__icon {
236
+ @include icon-positioning($large-input-size);
230
237
  }
231
238
  }
232
239
  }
@@ -0,0 +1,3 @@
1
+ .gem-c-organisation-logo__image {
2
+ max-width: 100%;
3
+ }
@@ -31,9 +31,14 @@ module GovukPublishingComponents
31
31
 
32
32
  gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
33
33
  gem_path = Dir.pwd if ENV["MAIN_COMPONENT_GUIDE"]
34
+ host_dir = File.expand_path("..")
35
+ path = File.expand_path("..", gem_path)
36
+
37
+ @in_application = false
38
+ @in_application = true unless path.to_s == host_dir.to_s
34
39
 
35
40
  components = AuditComponents.new(gem_path, false)
36
- applications = analyse_applications(File.expand_path("..", gem_path), application_dirs)
41
+ applications = analyse_applications(host_dir, application_dirs)
37
42
  compared_data = AuditComparer.new(components.data, applications, false)
38
43
 
39
44
  @applications = compared_data.applications_data || []
@@ -44,15 +49,18 @@ module GovukPublishingComponents
44
49
 
45
50
  def analyse_applications(path, application_dirs)
46
51
  results = []
47
- @applications_found = false
52
+ applications_found = 0
48
53
 
49
54
  application_dirs.each do |application|
50
55
  application_path = [path, application].join("/")
51
56
  app = AuditApplications.new(application_path, application)
52
- @applications_found = true if app.data[:application_found]
57
+ applications_found += 1 if app.data[:application_found]
53
58
  results << app.data
54
59
  end
55
60
 
61
+ @other_applications = false
62
+ @other_applications = true if applications_found > 1
63
+
56
64
  results
57
65
  end
58
66
  end
@@ -1,4 +1,4 @@
1
- <% if @applications_found %>
1
+ <% if @other_applications %>
2
2
  <%= render "govuk_publishing_components/components/heading", {
3
3
  text: "Components",
4
4
  font_size: "l",
@@ -101,7 +101,7 @@
101
101
  }
102
102
  %>
103
103
 
104
- <% if @applications_found %>
104
+ <% if @other_applications %>
105
105
  <% components_by_application = capture do %>
106
106
  <% if @components[:components_by_application].any? %>
107
107
  <dl class="govuk-summary-list">
@@ -10,7 +10,7 @@
10
10
  <%= render "components" %>
11
11
  <% end %>
12
12
 
13
- <% if @applications_found %>
13
+ <% if @in_application or @other_applications %>
14
14
  <%= render "govuk_publishing_components/components/tabs", {
15
15
  tabs: [
16
16
  {
@@ -4,6 +4,7 @@
4
4
  label ||= nil
5
5
  href ||= nil
6
6
  data_attributes ||= nil
7
+ aria ||= nil
7
8
  classes = ["gem-c-big-number__value"]
8
9
 
9
10
  if label.nil? && href
@@ -25,7 +26,7 @@
25
26
  <% end %>
26
27
  <% end %>
27
28
 
28
- <%= tag.div class: "gem-c-big-number" do %>
29
+ <%= tag.div class: "gem-c-big-number", aria: aria do %>
29
30
  <% unless href.nil? %>
30
31
  <%= link_to big_number_value, href, class: "govuk-link gem-c-big-number__link", data: data_attributes %>
31
32
  <% else %>
@@ -2,7 +2,7 @@
2
2
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
3
3
  devolved_nations_helper = GovukPublishingComponents::Presenters::DevolvedNationsHelper.new(local_assigns)
4
4
 
5
- applies_to ||= t('components.devolved_nations.applies_to')
5
+ applies_to ||= t("components.devolved_nations.applies_to")
6
6
  heading_level ||= 2
7
7
  %>
8
8
 
@@ -15,7 +15,7 @@
15
15
  <% if devolved_nations_helper.nations_with_urls.any? %>
16
16
  <%= content_tag :ul, class: "govuk-list govuk-!-margin-top-1 govuk-!-margin-bottom-0" do -%>
17
17
  <% devolved_nations_helper.nations_with_urls.each do |k, v| %>
18
- <%= content_tag(:li, link_to("Guidance for #{t("components.devolved_nations.#{k}")}", v[:alternative_url], class: "govuk-link")) %>
18
+ <%= content_tag(:li, link_to(devolved_nations_helper.alternative_content_text(k), v[:alternative_url], class: "govuk-link")) %>
19
19
  <% end %>
20
20
  <% end %>
21
21
  <% end %>
@@ -31,7 +31,7 @@
31
31
  css_classes = %w(gem-c-input govuk-input)
32
32
  css_classes << "govuk-input--error" if has_error
33
33
  css_classes << "govuk-input--width-#{width}" if [2, 3, 4, 5, 10, 20, 30].include?(width)
34
- css_classes << "gem-c-input--search-icon" if search_icon
34
+ css_classes << "gem-c-input--with-search-icon" if search_icon
35
35
  form_group_css_classes = %w(govuk-form-group)
36
36
  form_group_css_classes << "govuk-form-group--error" if has_error && !grouped
37
37
 
@@ -120,6 +120,7 @@
120
120
  <%= input_tag %><%= tag.span suffix, class: "govuk-input__suffix", aria: { hidden: true } %>
121
121
  <% end %>
122
122
  <% else %>
123
+ <%= tag.span class: "gem-c-input__search-icon" if search_icon %>
123
124
  <%= input_tag %>
124
125
  <% end %>
125
126
  <% end %>
@@ -1,33 +1,46 @@
1
1
  <%
2
+ dismiss_text ||= false
3
+ suggestion_link_text ||= false
4
+ suggestion_link_url ||= false
5
+ suggestion_text ||= nil
6
+
2
7
  data_attributes ||= {}
3
8
  data_attributes[:module] = 'intervention'
4
- %>
9
+ suggestion_data_attributes ||= {}
10
+ dismiss_data_attributes ||= {}
11
+
12
+ aria_attributes ||= {}
13
+ aria_attributes[:label] = 'Intervention'
5
14
 
6
- <%= tag.section class: "gem-c-intervention", role: "region", data: data_attributes do %>
7
- <h2 class="gem-c-intervention__title govuk-heading-s">
8
- <a class="govuk-link" href="/next-steps-for-your-business"
9
- data-module="gem-track-click"
10
- data-track-category="interventionBanner"
11
- data-track-action="interventionClicked"
12
- data-track-dimension="<%= t("components.intervention.title") %>"
13
- data-track-dimension-index="29"
14
- data-track-label="/next-steps-for-your-business">
15
- <%= t("components.intervention.title") %></a>
16
- </h2>
15
+ local_assigns[:query_string] ||= request.query_string
16
+
17
+ intervention_helper = GovukPublishingComponents::Presenters::InterventionHelper.new(local_assigns)
18
+ dismiss_href = intervention_helper.dismiss_link
19
+ %>
20
+ <% if suggestion_text or (suggestion_link_text and suggestion_link_text) %>
21
+ <%= tag.section class: "gem-c-intervention", role: "region", aria: aria_attributes, data: data_attributes do %>
22
+ <p class="govuk-body">
23
+ <%= tag.span suggestion_text, class: "gem-c-intervention__textwrapper" if suggestion_text %>
24
+ <% if suggestion_link_text and suggestion_link_url %>
25
+ <%= tag.a suggestion_link_text, class: "govuk-link gem-c-intervention__suggestion-link", href: suggestion_link_url, data: suggestion_data_attributes %>
17
26
 
18
- <p class="govuk-body">
19
- <%= t("components.intervention.description") %>
20
- </p>
27
+ <% end %>
28
+ </p>
21
29
 
22
- <p class="govuk-body">
23
- <a class="govuk-link" href="?hide-intervention=true"
24
- data-module="gem-track-click"
25
- data-track-category="interventionBanner"
26
- data-track-action="interventionDismissed"
27
- data-track-label="?hide-intervention=true"
28
- data-track-dimension="<%= t("components.intervention.dismiss_link_text") %>"
29
- data-track-dimension-index="29">
30
- <%= t("components.intervention.dismiss_link_text") %></a>
31
- <%= t("components.intervention.dismiss_post_link") %>
32
- </p>
30
+ <% if dismiss_text %>
31
+ <p class="govuk-body">
32
+ <%= tag.a class: "govuk-link gem-c-intervention__dismiss", href: dismiss_href, data: dismiss_data_attributes do %>
33
+ <svg class="gem-c-intervention__dismiss-icon"
34
+ width="19" height="19" viewBox="0 0 19 19"
35
+ aria-hidden="true"
36
+ fill="none" stroke="currentColor">
37
+ <path d="M0.499997 9.5C0.499997 4.52944 4.52944 0.499999 9.5 0.499999C14.4706 0.5 18.5 4.52944 18.5 9.5C18.5 14.4706 14.4706 18.5 9.5 18.5C4.52943 18.5 0.499997 14.4706 0.499997 9.5Z"/>
38
+ <path d="M13.3477 5.4209L9.67383 9.09473L6 5.4209"/>
39
+ <path d="M6 13.4209L9.67383 9.74707L13.3477 13.4209"/>
40
+ </svg>
41
+ <%= dismiss_text %>
42
+ <% end %>
43
+ </p>
44
+ <% end %>
45
+ <% end %>
33
46
  <% end %>
@@ -213,30 +213,10 @@
213
213
  <span class="govuk-visually-hidden">
214
214
  <%= search_text %>
215
215
  </span>
216
- <svg
217
- class="gem-c-layout-super-navigation-header__search-toggle-button-link-icon"
218
- width="27"
219
- height="27"
220
- viewBox="0 0 27 27"
221
- fill="none"
222
- xmlns="http://www.w3.org/2000/svg"
223
- aria-hidden="true"
224
- focusable="false"
225
- >
226
- <circle
227
- cx="10.0161"
228
- cy="10.0161"
229
- r="8.51613"
230
- stroke="currentColor"
231
- stroke-width="3" />
232
- <line
233
- x1="15.8668"
234
- y1="16.3587"
235
- x2="25.4475"
236
- y2="25.9393"
237
- stroke="currentColor"
238
- stroke-width="3" />
239
- </svg>
216
+ <%=
217
+ render "govuk_publishing_components/components/search/search_icon",
218
+ classes: %W[gem-c-layout-super-navigation-header__search-toggle-button-link-icon]
219
+ %>
240
220
  </button>
241
221
 
242
222
  <div id="super-search-menu" class="gem-c-layout-super-navigation-header__search-items">
@@ -6,10 +6,15 @@
6
6
  list_type ||= "unordered"
7
7
  visible_counters ||= nil
8
8
 
9
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
10
+
9
11
  classes = %w[gem-c-list govuk-list]
10
- classes << "govuk-list--bullet" if visible_counters && list_type === "unordered"
11
- classes << "govuk-list--number" if visible_counters && list_type === "number"
12
+ classes << "govuk-list--bullet" if visible_counters and list_type === "unordered"
13
+ classes << "govuk-list--number" if visible_counters and list_type === "number"
12
14
  classes << "govuk-list--spaced" if extra_spacing
15
+ # Setting the `margin_bottom` to 4 is the same as the default margin - so we
16
+ # can omit the override class. To do this we leave out `4` from the array:
17
+ classes << (shared_helper.get_margin_bottom) if [0,1,2,3,5,6,7,8,9].include?(local_assigns[:margin_bottom])
13
18
 
14
19
  # Default list type is unordered list.
15
20
  list_tag = "ul"
@@ -53,6 +53,7 @@
53
53
  <div class="gem-c-search__item gem-c-search__submit-wrapper">
54
54
  <%= tag.button class: "gem-c-search__submit", type: "submit", data: data_attributes do %>
55
55
  <%= button_text %>
56
+ <%= render "govuk_publishing_components/components/search/search_icon" %>
56
57
  <% end %>
57
58
  </div>
58
59
  </div>
@@ -54,3 +54,10 @@ examples:
54
54
  label: Ministerial departments
55
55
  data_attributes:
56
56
  department-count: true
57
+ with_aria_attributes:
58
+ description: Aria attributes are applied to the whole component instance
59
+ data:
60
+ number: 23
61
+ label: Ministerial departments
62
+ aria:
63
+ hidden: true
@@ -1,18 +1,18 @@
1
1
  name: Devolved Nations (experimental)
2
- description: A banner for linking to guidance for other nations.
2
+ description: A banner for linking to alternative content for other nations.
3
3
  body: |
4
- The component replaces uses of the important metadata component for guidance for other nations.
4
+ The component replaces uses of the important metadata component for alternative content for other nations.
5
5
 
6
6
  The component can display:
7
7
 
8
- * nations that the guidance relates to
8
+ * nations that the alternative content relates to
9
9
  * a list of alternative URLs where applicable
10
10
  shared_accessibility_criteria:
11
11
  - link
12
12
  accessibility_criteria: |
13
13
  The component must:
14
14
 
15
- - Provide context for link text to highlight guidance is available.
15
+ - Provide context for link text to highlight alternative content is available.
16
16
  examples:
17
17
  default:
18
18
  data:
@@ -35,18 +35,22 @@ examples:
35
35
  applicable: true
36
36
  wales:
37
37
  applicable: true
38
- applies_to_one_nation_individual_guidance_available:
38
+ applies_to_one_nation_individual_publication_available:
39
+ description: If no content type, or an invalid type, is specified then the default alternative content type is displayed as "Publication" e.g. "Publication for Northern Ireland"
39
40
  data:
40
41
  national_applicability:
41
42
  england:
42
43
  applicable: true
44
+ northern_ireland:
45
+ applicable: false
46
+ alternative_url: /
43
47
  scotland:
44
48
  applicable: false
45
49
  alternative_url: /
46
50
  wales:
47
51
  applicable: false
48
52
  alternative_url: /
49
- applies_to_one_nation_individual_guidance_available:
53
+ applies_to_three_nations_individual_publication_available:
50
54
  data:
51
55
  national_applicability:
52
56
  england:
@@ -55,12 +59,21 @@ examples:
55
59
  applicable: false
56
60
  alternative_url: /
57
61
  scotland:
58
- applicable: false
59
- alternative_url: /
62
+ applicable: true
60
63
  wales:
64
+ applicable: true
65
+ applies_to_one_nation_individual_consultation_available:
66
+ description: Specify alternative type for the content e.g. Consultation
67
+ data:
68
+ national_applicability:
69
+ england:
70
+ applicable: true
71
+ northern_ireland:
61
72
  applicable: false
62
73
  alternative_url: /
63
- applies_to_three_nations_individual_guidance_available:
74
+ type: consultation
75
+ applies_to_one_nation_individual_guidance_available:
76
+ description: Specify alternative type for the content e.g. Guidance
64
77
  data:
65
78
  national_applicability:
66
79
  england:
@@ -68,12 +81,9 @@ examples:
68
81
  northern_ireland:
69
82
  applicable: false
70
83
  alternative_url: /
71
- scotland:
72
- applicable: true
73
- wales:
74
- applicable: true
84
+ type: detailed_guide
75
85
  specific_heading level:
76
- description: Use a different heading level for the main link title. Defaults to H2 if not passed.
86
+ description: Use a different heading level for the main link title. Defaults to `H2` if not passed.
77
87
  data:
78
88
  heading_level: 3
79
89
  national_applicability:
@@ -439,16 +439,16 @@ examples:
439
439
  statistic_headlines:
440
440
  data:
441
441
  block: |
442
- <aside class="stat-headline">
442
+ <div class="stat-headline">
443
443
  <p><em>£6bn</em>
444
444
  Total Departmental Expenditure Limit (<abbr title="Departmental Expenditure Limit">DEL</abbr>) in financial year 2015 to 2016</p>
445
- </aside>
445
+ </div>
446
446
  <p>This includes £5.8 billion Resource <abbr title="Departmental Expenditure Limit">DEL</abbr> and £0.2 billion Capital <abbr title="Departmental Expenditure Limit">DEL</abbr>. In addition, <abbr title="Department for Work and Pensions">DWP</abbr> Annually Managed Expenditure (<abbr title="Annually Managed Expenditure">AME</abbr>) in financial year 2015 to 2016 is £170.5 billion, as forecast by the Office for Budget Responsibility.</p>
447
- <aside class="stat-headline">
447
+ <div class="stat-headline">
448
448
  <p>UK employment rate
449
449
  <em>74.1%</em>
450
450
  between October and December 2015</p>
451
- </aside>
451
+ </div>
452
452
  specialist_content:
453
453
  data:
454
454
  block: |
@@ -6,19 +6,58 @@ body: |
6
6
  that would be useful to them. This component would be used to add this personalised content and would
7
7
  indicate to the user that this is not normally part of the page, but has been added for them specifically.
8
8
 
9
- Right now the contents of the component are static, as the MVP of personalised content is only for Start a Business.
10
- Since many pages will use this component with the same text, we hard-code it here for now.
9
+ The dismiss link points to the current URL with the "hide-intervention" query string parameter set to "true". The backend should check for this string in order to render the same page without the intervention.
11
10
 
12
- The dismiss link will reload the page but the `hide-intervention` query string parameter will cause the
13
- backed not to show the intervention again. Some progressive enhancement will be added in later to avoid
14
- reloading the page if JavaScript is available.
15
11
  accessibility_criteria: |
16
12
  The intervention component must:
17
13
 
18
14
  - have a border colour contrast ratio of more than 4.5:1 with its background to be visually distinct
15
+ - prevent screen readers from announcing the dismiss link icon
16
+
19
17
 
20
- - always render headings with associated description content, so there are no isolated heading elements inside the component
21
18
  shared_accessibility_criteria:
22
19
  - link
23
20
  examples:
24
21
  default:
22
+ data:
23
+ suggestion_text: "You should renew your permit every 6 months."
24
+
25
+ with_suggestion_link:
26
+ data:
27
+ suggestion_text: "Based on your browsing you might be interested in"
28
+ suggestion_link_text: "Travel abroad: step by step"
29
+ suggestion_link_url: "/travel-abroad"
30
+
31
+ with_dismiss_link:
32
+ data:
33
+ suggestion_text: "You should renew your permit every 6 months."
34
+ dismiss_text: "Hide this suggestion"
35
+
36
+ with_suggestion_link_only:
37
+ data:
38
+ suggestion_link_text: "You can now apply for a permit online."
39
+ suggestion_link_url: "/permit"
40
+
41
+ with_data_attributes:
42
+ description: |
43
+ This example shows the use of `suggestion_data_attributes` and
44
+ `dismiss_data_attributes` for click tracking.
45
+ data:
46
+ suggestion_text: "Based on your browsing you might be interested in"
47
+ suggestion_link_text: "Travel abroad: step by step"
48
+ suggestion_link_url: "/travel-abroad"
49
+ suggestion_data_attributes:
50
+ module: "gem-track-click"
51
+ track-category: "interventionBanner"
52
+ track-action: "interventionClicked"
53
+ track-dimension: "Travel abroad: step by step"
54
+ track-dimension-index: "29"
55
+ track-label: "clicked suggestion"
56
+ dismiss_text: "Hide this suggestion"
57
+ dismiss_data_attributes:
58
+ module: "gem-track-click"
59
+ track-category: "interventionBanner"
60
+ track-action: "interventionDismissed"
61
+ track-dimension: "Hide this suggestion"
62
+ track-dimension-index: "29"
63
+ track-label: "hid the intervention"
@@ -62,3 +62,11 @@ examples:
62
62
  data:
63
63
  id: 'super-fantastic-chocolate-list'
64
64
  <<: *default-example-data
65
+ with_margin:
66
+ description: |
67
+ Sets the margin on the bottom of the list element.
68
+
69
+ The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a 20px margin.
70
+ data:
71
+ margin_bottom: 9
72
+ <<: *default-example-data
@@ -11,7 +11,7 @@ accessibility_criteria: |
11
11
  - be focusable with a keyboard
12
12
  - be usable with a keyboard
13
13
  - indicate when they have focus
14
- - change in appearance when touched (in the touch-down state)
14
+ - change in appearance when active (in the active state)
15
15
  - be usable with touch
16
16
  - have label with a touch area similar to the input
17
17
  - be usable with [voice commands](https://www.w3.org/WAI/perspectives/voice.html)
@@ -53,7 +53,7 @@ examples:
53
53
  - value: "govuk-verify"
54
54
  text: "Use GOV.UK Verify"
55
55
  with_bold:
56
- description: 'Used to provide better contrast between long labels and hint text, Note that the `:or` option [is documented as a string due to a bug](https://github.com/alphagov/govuk_publishing_components/issues/102)'
56
+ description: Used to provide better contrast between long labels and hint text, Note that the `:or` option [is documented as a string due to a bug](https://github.com/alphagov/govuk_publishing_components/issues/102)
57
57
  data:
58
58
  name: "radio-group-bold"
59
59
  items:
@@ -66,7 +66,7 @@ examples:
66
66
  hint_text: "You'll have an account if you've already proved your identity with a certified company, such as the Post Office."
67
67
  bold: true
68
68
  with_bottom_margin:
69
- description: "The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to a margin bottom of 30px (6)."
69
+ description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to a margin bottom of `30px` (`6`).
70
70
  data:
71
71
  name: "radio-group"
72
72
  margin_bottom: 9
@@ -85,16 +85,50 @@ examples:
85
85
  text: "Use Government Gateway"
86
86
  - value: "govuk-verify"
87
87
  text: "Use GOV.UK Verify"
88
- with_heading:
89
- description: This adds a legend element containing the text supplied.
88
+ with_legend:
89
+ description: |
90
+ Legend text is automatically wrapped inside a `h2`. To render the text without it, `heading_level` must be set to `0`.
90
91
  data:
91
- name: "radio-group-heading"
92
- heading: "Are you hungry?"
92
+ name: "radio-group-legend"
93
+ heading: "What's it to do with?"
94
+ heading_level: 0
93
95
  items:
94
96
  - value: "yes"
95
97
  text: "Yes"
96
98
  - value: "no"
97
99
  text: "No"
100
+ with_heading:
101
+ description: |
102
+ By default, text supplied for the `legend` is wrapped inside a `h2`.
103
+
104
+ The font size of this heading can be changed using the `heading_size` option. Valid options are `s`, `m`, `l`, `xl`, defaulting to `m` if no option is passed.
105
+ data:
106
+ name: "radio-group-description"
107
+ heading: "What is your favourite colour?"
108
+ heading_size: "s"
109
+ items:
110
+ - value: "red"
111
+ text: "Red"
112
+ - value: "green"
113
+ text: "Green"
114
+ - value: "blue"
115
+ text: "Blue"
116
+ with_different_heading_level:
117
+ description: |
118
+ By default, text supplied for the `legend` is wrapped inside a `h2`. This can be changed using the `heading_level` option.
119
+
120
+ If `heading_level` is `1` and `heading_size` is not set, the text size will be `xl`.
121
+ data:
122
+ name: "radio-group-description"
123
+ heading: "What is your favourite colour?"
124
+ heading_level: 1
125
+ items:
126
+ - value: "red"
127
+ text: "Red"
128
+ - value: "green"
129
+ text: "Green"
130
+ - value: "blue"
131
+ text: "Blue"
98
132
  with_heading_and_hint:
99
133
  data:
100
134
  name: "radio-group-heading"
@@ -109,9 +143,9 @@ examples:
109
143
  text: "Blue"
110
144
  with_page_header_and_caption:
111
145
  description: |
112
- If a caption text is provided with a page heading, it will be displayed above the heading.
113
- A caption can only be used with a page heading. If a heading is not provided the caption will not render.
114
- The pattern is used across GOV.UK to show a high-level section that this page question falls into.
146
+ A caption can be added using the `heading_caption` option. Captions will only be displayed if text for the heading option is present.
147
+
148
+ The pattern is used across GOV.UK to show a high-level section that this page belongs to.
115
149
  data:
116
150
  name: "radio-group-heading"
117
151
  heading: "Is it snowing?"
@@ -181,35 +215,6 @@ examples:
181
215
  text: "Green"
182
216
  - value: "blue"
183
217
  text: "Blue"
184
- with_custom_heading_size:
185
- description: |
186
- This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
187
-
188
- If heading_level is 1 and heading_size is not set, the text size will be xl.
189
- data:
190
- name: "radio-group-description"
191
- heading: "What is your favourite colour?"
192
- heading_size: "s"
193
- items:
194
- - value: "red"
195
- text: "Red"
196
- - value: "green"
197
- text: "Green"
198
- - value: "blue"
199
- text: "Blue"
200
- with_custom_heading_level:
201
- description: This allows the heading level to be changed. Heading level will default to `h2` if nothing is passed.
202
- data:
203
- name: "radio-group-description"
204
- heading: "What is your favourite colour?"
205
- heading_level: 3
206
- items:
207
- - value: "red"
208
- text: "Red"
209
- - value: "green"
210
- text: "Green"
211
- - value: "blue"
212
- text: "Blue"
213
218
  with_hint_text_on_radios:
214
219
  data:
215
220
  name: "radio-group-hint-text"
@@ -248,7 +253,7 @@ examples:
248
253
  - value: "govuk-verify"
249
254
  text: "Use GOV.UK Verify"
250
255
  with_or_divider:
251
- description: "See [related service manual gudiance for this pattern](https://www.gov.uk/service-manual/design/writing-for-user-interfaces#ask-questions-that-users-can-understand)"
256
+ description: "See [related service manual guidance for this pattern](https://www.gov.uk/service-manual/design/writing-for-user-interfaces#ask-questions-that-users-can-understand)"
252
257
  data:
253
258
  name: "radio-group-or-divider"
254
259
  items:
@@ -62,17 +62,6 @@ examples:
62
62
  margin_bottom: 0
63
63
  context:
64
64
  dark_background: true
65
- in_html_publication_with_context_link:
66
- description: Page titles are used in HTML Publications ([see example](https://www.gov.uk/government/publications/fees-for-civil-and-family-courts/court-fees-for-the-high-court-county-court-and-family-court))
67
- data:
68
- context:
69
- text: Publication
70
- href: '/link'
71
- title: HTML publication page title
72
- inverse: true
73
- margin_bottom: 0
74
- context:
75
- dark_background: true
76
65
  using_design_system_template:
77
66
  description: |
78
67
  This option allows the removal of top margin from the component so that it works within a [Design System page template](https://design-system.service.gov.uk/styles/page-template/default/index.html), where spacing above the title is already provided by padding on the wrapping div.
@@ -0,0 +1,28 @@
1
+ <%
2
+ classes ||= %w[gem-c-search__icon]
3
+ %>
4
+
5
+ <svg
6
+ class="<%= classes.join(" ") %>"
7
+ width="27"
8
+ height="27"
9
+ viewBox="0 0 27 27"
10
+ fill="none"
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ aria-hidden="true"
13
+ focusable="false"
14
+ >
15
+ <circle
16
+ cx="10.0161"
17
+ cy="10.0161"
18
+ r="8.51613"
19
+ stroke="currentColor"
20
+ stroke-width="3" />
21
+ <line
22
+ x1="15.8668"
23
+ y1="16.3587"
24
+ x2="25.4475"
25
+ y2="25.9393"
26
+ stroke="currentColor"
27
+ stroke-width="3" />
28
+ </svg>
@@ -51,6 +51,11 @@ en:
51
51
  connectors:
52
52
  last_word: " and "
53
53
  two_words: " and "
54
+ type:
55
+ consultation: Consultation for %{nation}
56
+ detailed_guide: Guidance for %{nation}
57
+ guidance: Guidance for %{nation}
58
+ publication: Publication for %{nation}
54
59
  england: England
55
60
  northern_ireland: Northern Ireland
56
61
  scotland: Scotland
@@ -81,11 +86,6 @@ en:
81
86
  news_and_communications: News and communications
82
87
  statistics: Statistics
83
88
  worldwide: Worldwide
84
- intervention:
85
- title: Check the next steps for your limited company
86
- description: You might be interested in this because you’ve been browsing guidance relevant to starting a limited company.
87
- dismiss_link_text: Hide this suggestion
88
- dismiss_post_link: if it’s not relevant to you
89
89
  layout_footer:
90
90
  copyright_html: <a class="govuk-footer__link govuk-footer__copyright-logo" href="http://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/">© Crown copyright</a>
91
91
  licence_html: All content is available under the <a class="govuk-footer__link" href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" rel="license">Open Government Licence v3.0</a>, except where otherwise stated
@@ -4,18 +4,12 @@ module GovukPublishingComponents
4
4
  # keys are labels, values are the content_ids for the matching taxons
5
5
  # Where multiple matching taxons are present, the top most one is the highest priority
6
6
  # and the bottom one the lowest priority
7
- BREXIT_TAXONS = {
7
+ PRIORITY_TAXONS = {
8
8
  brexit_business: "634fd193-8039-4a70-a059-919c34ff4bfc",
9
9
  brexit_individuals: "614b2e65-56ac-4f8d-bb9c-d1a14167ba25",
10
10
  brexit_taxon: "d6c2de5d-ef90-45d1-82d4-5f2438369eea",
11
11
  }.freeze
12
12
 
13
- PRIORITY_TAXONS = {
14
- education_coronavirus: "272308f4-05c8-4d0d-abc7-b7c2e3ccd249",
15
- worker_coronavirus: "b7f57213-4b16-446d-8ded-81955d782680",
16
- business_coronavirus: "65666cdf-b177-4d79-9687-b9c32805e450",
17
- }.merge(BREXIT_TAXONS).freeze
18
-
19
13
  # Returns the highest priority taxon that has a content_id matching those in PRIORITY_TAXONS
20
14
  def self.call(content_item, query_parameters = nil)
21
15
  new(content_item, query_parameters).breadcrumbs
@@ -37,9 +31,9 @@ module GovukPublishingComponents
37
31
 
38
32
  def priority_brexit_taxon
39
33
  if tagged_to_both_brexit_child_taxons?
40
- priority_brexit_taxons.find { |t| t["content_id"] == BREXIT_TAXONS[:brexit_taxon] }
34
+ priority_taxons.find { |t| t["content_id"] == PRIORITY_TAXONS[:brexit_taxon] }
41
35
  else
42
- priority_brexit_taxons.min_by { |t| BREXIT_TAXONS.values.index(t["content_id"]) }
36
+ priority_taxons.min_by { |t| PRIORITY_TAXONS.values.index(t["content_id"]) }
43
37
  end
44
38
  end
45
39
 
@@ -83,10 +77,6 @@ module GovukPublishingComponents
83
77
  end
84
78
  end
85
79
 
86
- def priority_brexit_taxons
87
- priority_taxons.select { |t| priority_brexit_taxon?(t) }
88
- end
89
-
90
80
  def taxon_tree(taxons)
91
81
  return [] if taxons.blank?
92
82
 
@@ -97,10 +87,6 @@ module GovukPublishingComponents
97
87
  PRIORITY_TAXONS.values.include?(taxon["content_id"])
98
88
  end
99
89
 
100
- def priority_brexit_taxon?(taxon)
101
- BREXIT_TAXONS.values.include?(taxon["content_id"])
102
- end
103
-
104
90
  def brexit_child_taxon?(taxon)
105
91
  brexit_child_taxons.include?(taxon["content_id"])
106
92
  end
@@ -1,10 +1,11 @@
1
1
  module GovukPublishingComponents
2
2
  module Presenters
3
3
  class DevolvedNationsHelper
4
- attr_reader :national_applicability
4
+ attr_reader :national_applicability, :type
5
5
 
6
6
  def initialize(local_assigns)
7
7
  @national_applicability = local_assigns[:national_applicability]
8
+ @type = local_assigns[:type] || "publication"
8
9
  end
9
10
 
10
11
  def applicable_nations_title_text
@@ -25,6 +26,16 @@ module GovukPublishingComponents
25
26
  .present?
26
27
  end
27
28
  end
29
+
30
+ def alternative_content_text(name)
31
+ nation = I18n.t("components.devolved_nations.#{name}")
32
+
33
+ if I18n.exists?("components.devolved_nations.type.#{@type}")
34
+ I18n.t("components.devolved_nations.type.#{@type}", nation: nation)
35
+ else
36
+ I18n.t("components.devolved_nations.type.publication", nation: nation)
37
+ end
38
+ end
28
39
  end
29
40
  end
30
41
  end
@@ -0,0 +1,19 @@
1
+ module GovukPublishingComponents
2
+ module Presenters
3
+ class InterventionHelper
4
+ attr_reader :query_string
5
+
6
+ def initialize(local_assigns)
7
+ @query_string = local_assigns[:query_string]
8
+ end
9
+
10
+ def dismiss_link
11
+ if @query_string.present?
12
+ "#{@query_string}&hide-intervention=true"
13
+ else
14
+ "?hide-intervention=true"
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "27.6.0".freeze
2
+ VERSION = "27.8.2".freeze
3
3
  end
@@ -30,6 +30,7 @@ require "govuk_publishing_components/presenters/schema_org"
30
30
  require "govuk_publishing_components/presenters/heading_helper"
31
31
  require "govuk_publishing_components/presenters/contents_list_helper"
32
32
  require "govuk_publishing_components/presenters/image_card_helper"
33
+ require "govuk_publishing_components/presenters/intervention_helper"
33
34
  require "govuk_publishing_components/presenters/organisation_logo_helper"
34
35
  require "govuk_publishing_components/presenters/highlight_boxes_helper"
35
36
  require "govuk_publishing_components/presenters/taxonomy_list_helper"
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: 27.6.0
4
+ version: 27.8.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: 2021-10-12 00:00:00.000000000 Z
11
+ date: 2021-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 3.9.2
215
+ version: 3.10.0
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 3.9.2
222
+ version: 3.10.0
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: jasmine_selenium_runner
225
225
  requirement: !ruby/object:Gem::Requirement
@@ -642,6 +642,7 @@ files:
642
642
  - app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak-html-publication.scss
643
643
  - app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss
644
644
  - app/assets/stylesheets/govuk_publishing_components/components/print/_layout-super-navigation-header.scss
645
+ - app/assets/stylesheets/govuk_publishing_components/components/print/_organisation-logo.scss
645
646
  - app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss
646
647
  - app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss
647
648
  - app/assets/stylesheets/govuk_publishing_components/components/print/_textarea.scss
@@ -843,6 +844,7 @@ files:
843
844
  - app/views/govuk_publishing_components/components/layout_header/_search.html.erb
844
845
  - app/views/govuk_publishing_components/components/metadata/_sentence.html.erb
845
846
  - app/views/govuk_publishing_components/components/related_navigation/_section.html.erb
847
+ - app/views/govuk_publishing_components/components/search/_search_icon.html.erb
846
848
  - app/views/layouts/govuk_publishing_components/application.html.erb
847
849
  - config/i18n-tasks.yml
848
850
  - config/initializers/assets.rb
@@ -942,6 +944,7 @@ files:
942
944
  - lib/govuk_publishing_components/presenters/heading_helper.rb
943
945
  - lib/govuk_publishing_components/presenters/highlight_boxes_helper.rb
944
946
  - lib/govuk_publishing_components/presenters/image_card_helper.rb
947
+ - lib/govuk_publishing_components/presenters/intervention_helper.rb
945
948
  - lib/govuk_publishing_components/presenters/machine_readable/article_schema.rb
946
949
  - lib/govuk_publishing_components/presenters/machine_readable/creative_work_schema.rb
947
950
  - lib/govuk_publishing_components/presenters/machine_readable/dataset_schema.rb