govuk_publishing_components 9.18.0 → 9.19.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1bc16e5c509fef3c4df8d29124a2223cf2f56d548493deea7578249650bd5e63
4
- data.tar.gz: f99801097df93fa76824e915dc2fb166cc4169af3d6826ae1b6e6398bed99af8
3
+ metadata.gz: 5d47c0f1a027c444e13130f4a1653e81c970369f8a12dfc287b18f822e3cc8cb
4
+ data.tar.gz: 41e27deae34274a7a801b42fc4189cd1a0807196ccabf10c6622d9b775d5dd4d
5
5
  SHA512:
6
- metadata.gz: da9871ca56d90218af756734c900ee93d18095eac44e166695a78d485a042aa031b2c3c3752ccc97778a6a8f248fefaeb935c0e7126da9f2c079a555d2690b37
7
- data.tar.gz: 103bf20d66caae335fd95d3ef6558f29520bee61c4d9396c3b7c3165ebec0351a871b7ca0a659db17045e36d6ce548f4a0a150c67afa1f5683795946325ab601
6
+ metadata.gz: 537ee31aa00db01fe094653f18a14a55e1509c7afeef9bac9194ec8eca98b84a8f9b61129ed2eee784700a8fef99615dde9c7d09317adad9c3a2a36e87ec373c
7
+ data.tar.gz: c707c68d10de23995acbfb23322cf0d65612367f74367ec2038dfa3a7139a8927026316247412fc022dd9e4798bbf9cabd5a53b6c6e0303608f626910a68ea6c
@@ -48,6 +48,8 @@
48
48
  }
49
49
 
50
50
  .gem-c-error-summary__list__item {
51
+ color: $gem-error-colour;
52
+ font-weight: bold;
51
53
  margin-bottom: $gem-spacing-scale-2;
52
54
 
53
55
  &:last-child {
@@ -1,7 +1,11 @@
1
1
  <%
2
+ title ||= false
2
3
  description ||= false
3
4
  items ||= []
4
5
  title_id ||= "error-summary-title-#{SecureRandom.hex(4)}"
6
+ if items.empty? && !title
7
+ raise ArgumentError, "The error_summary component needs at least one item or a title in order to render."
8
+ end
5
9
  %>
6
10
  <div
7
11
  class="gem-c-error-summary"
@@ -10,9 +14,11 @@
10
14
  role="alert"
11
15
  tabindex="-1"
12
16
  >
13
- <h2 class="gem-c-error-summary__title" id="<%= title_id %>">
14
- <%= title %>
15
- </h2>
17
+ <% if title %>
18
+ <h2 class="gem-c-error-summary__title" id="<%= title_id %>">
19
+ <%= title %>
20
+ </h2>
21
+ <% end %>
16
22
  <div class="gem-c-error-summary__body">
17
23
  <% if description %>
18
24
  <p class="gem-c-error-summary__text"><%= description %></p>
@@ -21,10 +27,14 @@
21
27
  <ul class="gem-c-error-summary__list">
22
28
  <% items.each_with_index do |item, index| %>
23
29
  <li class="gem-c-error-summary__list__item">
24
- <a
25
- class="js-error-summary__link gem-c-error-summary__link"
26
- href="<%= item[:href] %>"
27
- ><%= item[:text] %></a>
30
+ <% if item[:href] %>
31
+ <a
32
+ class="js-error-summary__link gem-c-error-summary__link"
33
+ href="<%= item[:href] %>"
34
+ ><%= item[:text] %></a>
35
+ <% else %>
36
+ <%= item[:text] %>
37
+ <% end %>
28
38
  </li>
29
39
  <% end %>
30
40
  </ul>
@@ -22,5 +22,4 @@ examples:
22
22
  href: '#example-error-1'
23
23
  - text: Descriptive link to the question with an error 2
24
24
  href: '#example-error-2'
25
- - text: Descriptive link to the question with an error 3
26
- href: '#example-error-3'
25
+ - text: Description of error without link
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '9.18.0'.freeze
2
+ VERSION = '9.19.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.18.0
4
+ version: 9.19.0
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: 2018-09-07 00:00:00.000000000 Z
11
+ date: 2018-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config