ccs-frontend_helpers 0.3.0 → 0.5.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +93 -74
  3. data/Gemfile +2 -2
  4. data/Gemfile.lock +85 -83
  5. data/LICENSE.txt +1 -1
  6. data/README.md +43 -9
  7. data/ccs-frontend_helpers.gemspec +2 -3
  8. data/lib/ccs/components/ccs/dashboard_section/panel.rb +5 -1
  9. data/lib/ccs/components/ccs/footer/meta.rb +2 -2
  10. data/lib/ccs/components/ccs/footer.rb +7 -4
  11. data/lib/ccs/components/ccs/header/navigation.rb +2 -1
  12. data/lib/ccs/components/ccs/header.rb +7 -4
  13. data/lib/ccs/components/ccs/logo.rb +4 -7
  14. data/lib/ccs/components/govuk/error_summary.rb +6 -4
  15. data/lib/ccs/components/govuk/field/input/file_upload.rb +1 -5
  16. data/lib/ccs/components/govuk/field/input/select.rb +1 -1
  17. data/lib/ccs/components/govuk/field/input/textarea.rb +1 -1
  18. data/lib/ccs/components/govuk/field/input.rb +1 -1
  19. data/lib/ccs/components/govuk/field/inputs/item/checkbox/form.rb +2 -2
  20. data/lib/ccs/components/govuk/field/inputs/item/checkbox/tag.rb +2 -2
  21. data/lib/ccs/components/govuk/field/inputs/item/radio/form.rb +2 -2
  22. data/lib/ccs/components/govuk/field/inputs/item/radio/tag.rb +2 -2
  23. data/lib/ccs/components/govuk/pagination/increment/next.rb +1 -1
  24. data/lib/ccs/components/govuk/pagination/increment/previous.rb +1 -1
  25. data/lib/ccs/components/govuk/pagination/item/form.rb +1 -1
  26. data/lib/ccs/components/govuk/pagination/item/tag.rb +1 -1
  27. data/lib/ccs/frontend_helpers/ccs_frontend/footer.rb +1 -1
  28. data/lib/ccs/frontend_helpers/ccs_frontend/header.rb +1 -1
  29. data/lib/ccs/frontend_helpers/ccs_frontend/logo.rb +24 -0
  30. data/lib/ccs/frontend_helpers/ccs_frontend.rb +2 -0
  31. data/lib/ccs/frontend_helpers/govuk_frontend/error_summary.rb +1 -1
  32. data/lib/ccs/frontend_helpers/version.rb +1 -1
  33. data/package.json +2 -1
  34. data/yarn.lock +9 -4
  35. metadata +14 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d935d241fb0117c445c9e5a7eaa2cee257c5f7bc1e68457baf347aabf946a664
4
- data.tar.gz: 4a8328285e0adad683eafbf72d8385ea7b3703ae352eded484eb6595bb8ce136
3
+ metadata.gz: 722e42a0b6590c17be63a46678cdcc8fe242aa296ffb4d0a9db4daabdde7a072
4
+ data.tar.gz: c7d20fb3f29d5312a0346e90340f8a133bbfaf3388f915cf408a637d9eec2006
5
5
  SHA512:
6
- metadata.gz: 3e4698ad6bcca9cfc345922d05da7580f8f21c4789ff2631d838001f0cd68090c0039467d95e2af4fee2b279822e9b522bfcc42f9ee198c89f4658e153e9e9ae
7
- data.tar.gz: 5fb56ee826dc2350d685e6fa888e11e2644bbf199db306a9953174b386e21efd42393db88f62813268218f0a387f15e107f3f010d8d2964690063034808833f2
6
+ metadata.gz: 51b61a7315924d8b3c8acc2f39e0936424f10f2a98e6ace651551573095e51a75b84d7e2155a43fdee4afb76d1144acfe8e5e87328e60086fa7a4247e3381f0e
7
+ data.tar.gz: f1ed0e45e3128214ededdc1228245af162100826f1b2095200ab78c7f27a6036ce1f20e46509735f0e4e88885787f9588bf3fdd6242f3daf064bb8291f0fc2a5
data/CHANGELOG.md CHANGED
@@ -1,96 +1,115 @@
1
- ## [0.3.0] - 2024-04-12
1
+ # Changelog
2
2
 
3
- Update components to be compatible with GOV.UK Frontend v5.3
3
+ All notable changes to this project will be documented in this file.
4
4
 
5
- ### 🆕 New features
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
7
 
7
- The following GOV.UK helpers have been added:
8
+ ## [Unreleased]
8
9
 
9
- - Password input
10
+ ## [0.5.0.beta1] - 2024-06-07
10
11
 
11
- ## [0.2.0] - 2024-03-13
12
+ ### Changed
12
13
 
13
- ### 💥 Breaking changes
14
+ - Internal change to use CCS Frontend fixtures to test the CCS frontend components.
15
+ This included some minor changes to the HTML for the components.
14
16
 
15
- Update components to be compatible with GOV.UK Frontend v5.2
17
+ ## [0.4.0] - 2024-05-20
16
18
 
17
- For pagination, the option to enable ellipsis is now:
18
- ```ruby
19
- {
20
- ellipsis: true
21
- }
22
- ```
23
- instead of:
24
- ```ruby
25
- {
26
- type: :ellipsis
27
- }
28
- ```
19
+ ### Added
29
20
 
30
- ### 🏠 Internal changes
21
+ - Update components to be compatible with GOV.UK Frontend v5.4
31
22
 
32
- Add tests for GOV.UK Frontend fixtures
23
+ ## [0.3.0] - 2024-04-12
33
24
 
34
- ### 🆕 New features
25
+ ### Added
35
26
 
36
- The following GOV.UK helpers have been added:
27
+ - Update components to be compatible with GOV.UK Frontend v5.3
28
+ - The following GOV.UK helpers have been added:
29
+ - Password input
37
30
 
38
- - Exit this page
39
- - Task list
31
+ ## [0.2.0] - 2024-03-13
32
+
33
+ ### Changed
34
+
35
+ - Update components to be compatible with GOV.UK Frontend v5.2
36
+ - For pagination, the option to enable ellipsis is now:
37
+ ```ruby
38
+ {
39
+ ellipsis: true
40
+ }
41
+ ```
42
+ instead of:
43
+ ```ruby
44
+ {
45
+ type: :ellipsis
46
+ }
47
+ ```
48
+ - Add tests for GOV.UK Frontend fixtures
49
+
50
+ ### Added
51
+
52
+ - The following GOV.UK helpers have been added:
53
+ - Exit this page
54
+ - Task list
40
55
 
41
56
  ## [0.1.2] - 2023-11-16
42
57
 
43
- Fix issue with radios component which, when passed a model or form, would treat the value as an array.
44
- This did not cause an issue for strings as the `include?` method still works for them but if the value was a boolean or a number then an error would be thrown.
58
+ ### Fixed
59
+
60
+ - Fix issue with radios component which, when passed a model or form, would treat the value as an array.
61
+ This did not cause an issue for strings as the `include?` method still works for them but if the value was a boolean or a number then an error would be thrown.
45
62
 
46
63
  ## [0.1.1] - 2023-10-25
47
64
 
48
- Fix some bugs with various helpers and update dependencies
65
+ ### Fixed
66
+
67
+ - Fix some bugs with various helpers and update dependencies
49
68
 
50
69
  ## [0.1.0] - 2023-02-22
51
70
 
52
- Initial release of CCS Frontend Helpers.
53
- This release contains view helpers that are used to create GOV.UK and CCS components.
54
-
55
- The following GOV.UK helpers have been added:
56
-
57
- - Accordion
58
- - Back link
59
- - Breadcrumbs
60
- - Button
61
- - Character count
62
- - Checkboxes
63
- - Cookie banner
64
- - Date input
65
- - Details
66
- - Error message
67
- - Error summary
68
- - Fieldset
69
- - File upload
70
- - Footer
71
- - Form group
72
- - Header
73
- - Hint
74
- - Inset text
75
- - Notification banner
76
- - Pagination
77
- - Panel
78
- - Phase banner
79
- - Radios
80
- - Select
81
- - Skip link
82
- - Step by step navigation
83
- - Summary list
84
- - Table
85
- - Tabs
86
- - Tag
87
- - Text input
88
- - Textarea
89
- - Warning text
90
-
91
- The following CCS helpers have been added:
92
-
93
- - Dashboard Panels
94
- - Logo
95
- - Header
96
- - Footer
71
+ ### Added
72
+
73
+ - Initial release of CCS Frontend Helpers.
74
+ This release contains view helpers that are used to create GOV.UK and CCS components.
75
+
76
+ - The following GOV.UK helpers have been added:
77
+ - Accordion
78
+ - Back link
79
+ - Breadcrumbs
80
+ - Button
81
+ - Character count
82
+ - Checkboxes
83
+ - Cookie banner
84
+ - Date input
85
+ - Details
86
+ - Error message
87
+ - Error summary
88
+ - Fieldset
89
+ - File upload
90
+ - Footer
91
+ - Form group
92
+ - Header
93
+ - Hint
94
+ - Inset text
95
+ - Notification banner
96
+ - Pagination
97
+ - Panel
98
+ - Phase banner
99
+ - Radios
100
+ - Select
101
+ - Skip link
102
+ - Step by step navigation
103
+ - Summary list
104
+ - Table
105
+ - Tabs
106
+ - Tag
107
+ - Text input
108
+ - Textarea
109
+ - Warning text
110
+
111
+ - The following CCS helpers have been added:
112
+ - Dashboard Panels
113
+ - Logo
114
+ - Header
115
+ - Footer
data/Gemfile CHANGED
@@ -16,8 +16,8 @@ gem 'simplecov', '~> 0.21'
16
16
  gem 'nokogiri-diff', '~> 0.3.0'
17
17
 
18
18
  # Gems for linting/formatting the package
19
- gem 'rubocop', '~> 1.62'
20
- gem 'rubocop-rails', '~> 2.24'
19
+ gem 'rubocop', '~> 1.64'
20
+ gem 'rubocop-rails', '~> 2.25'
21
21
  gem 'rubocop-rake', '~> 0.6'
22
22
  gem 'rubocop-rspec', '~> 2.29'
23
23
 
data/Gemfile.lock CHANGED
@@ -1,41 +1,41 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ccs-frontend_helpers (0.3.0)
4
+ ccs-frontend_helpers (0.5.0.beta1)
5
5
  rails (>= 6.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (7.1.3.2)
11
- actionpack (= 7.1.3.2)
12
- activesupport (= 7.1.3.2)
10
+ actioncable (7.1.3.3)
11
+ actionpack (= 7.1.3.3)
12
+ activesupport (= 7.1.3.3)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
15
  zeitwerk (~> 2.6)
16
- actionmailbox (7.1.3.2)
17
- actionpack (= 7.1.3.2)
18
- activejob (= 7.1.3.2)
19
- activerecord (= 7.1.3.2)
20
- activestorage (= 7.1.3.2)
21
- activesupport (= 7.1.3.2)
16
+ actionmailbox (7.1.3.3)
17
+ actionpack (= 7.1.3.3)
18
+ activejob (= 7.1.3.3)
19
+ activerecord (= 7.1.3.3)
20
+ activestorage (= 7.1.3.3)
21
+ activesupport (= 7.1.3.3)
22
22
  mail (>= 2.7.1)
23
23
  net-imap
24
24
  net-pop
25
25
  net-smtp
26
- actionmailer (7.1.3.2)
27
- actionpack (= 7.1.3.2)
28
- actionview (= 7.1.3.2)
29
- activejob (= 7.1.3.2)
30
- activesupport (= 7.1.3.2)
26
+ actionmailer (7.1.3.3)
27
+ actionpack (= 7.1.3.3)
28
+ actionview (= 7.1.3.3)
29
+ activejob (= 7.1.3.3)
30
+ activesupport (= 7.1.3.3)
31
31
  mail (~> 2.5, >= 2.5.4)
32
32
  net-imap
33
33
  net-pop
34
34
  net-smtp
35
35
  rails-dom-testing (~> 2.2)
36
- actionpack (7.1.3.2)
37
- actionview (= 7.1.3.2)
38
- activesupport (= 7.1.3.2)
36
+ actionpack (7.1.3.3)
37
+ actionview (= 7.1.3.3)
38
+ activesupport (= 7.1.3.3)
39
39
  nokogiri (>= 1.8.5)
40
40
  racc
41
41
  rack (>= 2.2.4)
@@ -43,35 +43,35 @@ GEM
43
43
  rack-test (>= 0.6.3)
44
44
  rails-dom-testing (~> 2.2)
45
45
  rails-html-sanitizer (~> 1.6)
46
- actiontext (7.1.3.2)
47
- actionpack (= 7.1.3.2)
48
- activerecord (= 7.1.3.2)
49
- activestorage (= 7.1.3.2)
50
- activesupport (= 7.1.3.2)
46
+ actiontext (7.1.3.3)
47
+ actionpack (= 7.1.3.3)
48
+ activerecord (= 7.1.3.3)
49
+ activestorage (= 7.1.3.3)
50
+ activesupport (= 7.1.3.3)
51
51
  globalid (>= 0.6.0)
52
52
  nokogiri (>= 1.8.5)
53
- actionview (7.1.3.2)
54
- activesupport (= 7.1.3.2)
53
+ actionview (7.1.3.3)
54
+ activesupport (= 7.1.3.3)
55
55
  builder (~> 3.1)
56
56
  erubi (~> 1.11)
57
57
  rails-dom-testing (~> 2.2)
58
58
  rails-html-sanitizer (~> 1.6)
59
- activejob (7.1.3.2)
60
- activesupport (= 7.1.3.2)
59
+ activejob (7.1.3.3)
60
+ activesupport (= 7.1.3.3)
61
61
  globalid (>= 0.3.6)
62
- activemodel (7.1.3.2)
63
- activesupport (= 7.1.3.2)
64
- activerecord (7.1.3.2)
65
- activemodel (= 7.1.3.2)
66
- activesupport (= 7.1.3.2)
62
+ activemodel (7.1.3.3)
63
+ activesupport (= 7.1.3.3)
64
+ activerecord (7.1.3.3)
65
+ activemodel (= 7.1.3.3)
66
+ activesupport (= 7.1.3.3)
67
67
  timeout (>= 0.4.0)
68
- activestorage (7.1.3.2)
69
- actionpack (= 7.1.3.2)
70
- activejob (= 7.1.3.2)
71
- activerecord (= 7.1.3.2)
72
- activesupport (= 7.1.3.2)
68
+ activestorage (7.1.3.3)
69
+ actionpack (= 7.1.3.3)
70
+ activejob (= 7.1.3.3)
71
+ activerecord (= 7.1.3.3)
72
+ activesupport (= 7.1.3.3)
73
73
  marcel (~> 1.0)
74
- activesupport (7.1.3.2)
74
+ activesupport (7.1.3.3)
75
75
  base64
76
76
  bigdecimal
77
77
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -85,8 +85,8 @@ GEM
85
85
  public_suffix (>= 2.0.2, < 6.0)
86
86
  ast (2.4.2)
87
87
  base64 (0.2.0)
88
- bigdecimal (3.1.7)
89
- builder (3.2.4)
88
+ bigdecimal (3.1.8)
89
+ builder (3.3.0)
90
90
  capybara (3.40.0)
91
91
  addressable
92
92
  matrix
@@ -106,11 +106,11 @@ GEM
106
106
  erubi (1.12.0)
107
107
  globalid (1.2.1)
108
108
  activesupport (>= 6.1)
109
- i18n (1.14.4)
109
+ i18n (1.14.5)
110
110
  concurrent-ruby (~> 1.0)
111
111
  io-console (0.7.2)
112
- irb (1.11.2)
113
- rdoc
112
+ irb (1.13.1)
113
+ rdoc (>= 4.0.0)
114
114
  reline (>= 0.4.2)
115
115
  json (2.7.2)
116
116
  language_server-protocol (3.17.0.3)
@@ -122,37 +122,37 @@ GEM
122
122
  net-imap
123
123
  net-pop
124
124
  net-smtp
125
- marcel (1.0.2)
125
+ marcel (1.0.4)
126
126
  matrix (0.4.2)
127
127
  mini_mime (1.1.5)
128
- minitest (5.22.3)
128
+ minitest (5.23.0)
129
129
  mutex_m (0.2.0)
130
- net-imap (0.4.10)
130
+ net-imap (0.4.12)
131
131
  date
132
132
  net-protocol
133
133
  net-pop (0.1.2)
134
134
  net-protocol
135
135
  net-protocol (0.2.2)
136
136
  timeout
137
- net-smtp (0.4.0.1)
137
+ net-smtp (0.5.0)
138
138
  net-protocol
139
- nio4r (2.7.0)
140
- nokogiri (1.16.2-x86_64-darwin)
139
+ nio4r (2.7.3)
140
+ nokogiri (1.16.5-x86_64-darwin)
141
141
  racc (~> 1.4)
142
- nokogiri (1.16.2-x86_64-linux)
142
+ nokogiri (1.16.5-x86_64-linux)
143
143
  racc (~> 1.4)
144
144
  nokogiri-diff (0.3.0)
145
145
  nokogiri (~> 1.5)
146
146
  tdiff (~> 0.4)
147
147
  parallel (1.24.0)
148
- parser (3.3.0.5)
148
+ parser (3.3.2.0)
149
149
  ast (~> 2.4.1)
150
150
  racc
151
151
  psych (5.1.2)
152
152
  stringio
153
153
  public_suffix (5.0.4)
154
- racc (1.7.3)
155
- rack (3.0.10)
154
+ racc (1.8.0)
155
+ rack (3.0.11)
156
156
  rack-session (2.0.0)
157
157
  rack (>= 3.0.0)
158
158
  rack-test (2.1.0)
@@ -160,20 +160,20 @@ GEM
160
160
  rackup (2.1.0)
161
161
  rack (>= 3)
162
162
  webrick (~> 1.8)
163
- rails (7.1.3.2)
164
- actioncable (= 7.1.3.2)
165
- actionmailbox (= 7.1.3.2)
166
- actionmailer (= 7.1.3.2)
167
- actionpack (= 7.1.3.2)
168
- actiontext (= 7.1.3.2)
169
- actionview (= 7.1.3.2)
170
- activejob (= 7.1.3.2)
171
- activemodel (= 7.1.3.2)
172
- activerecord (= 7.1.3.2)
173
- activestorage (= 7.1.3.2)
174
- activesupport (= 7.1.3.2)
163
+ rails (7.1.3.3)
164
+ actioncable (= 7.1.3.3)
165
+ actionmailbox (= 7.1.3.3)
166
+ actionmailer (= 7.1.3.3)
167
+ actionpack (= 7.1.3.3)
168
+ actiontext (= 7.1.3.3)
169
+ actionview (= 7.1.3.3)
170
+ activejob (= 7.1.3.3)
171
+ activemodel (= 7.1.3.3)
172
+ activerecord (= 7.1.3.3)
173
+ activestorage (= 7.1.3.3)
174
+ activesupport (= 7.1.3.3)
175
175
  bundler (>= 1.15.0)
176
- railties (= 7.1.3.2)
176
+ railties (= 7.1.3.3)
177
177
  rails-dom-testing (2.2.0)
178
178
  activesupport (>= 5.0.0)
179
179
  minitest
@@ -181,9 +181,9 @@ GEM
181
181
  rails-html-sanitizer (1.6.0)
182
182
  loofah (~> 2.21)
183
183
  nokogiri (~> 1.14)
184
- railties (7.1.3.2)
185
- actionpack (= 7.1.3.2)
186
- activesupport (= 7.1.3.2)
184
+ railties (7.1.3.3)
185
+ actionpack (= 7.1.3.3)
186
+ activesupport (= 7.1.3.3)
187
187
  irb
188
188
  rackup (>= 1.0.0)
189
189
  rake (>= 12.2)
@@ -191,12 +191,13 @@ GEM
191
191
  zeitwerk (~> 2.6)
192
192
  rainbow (3.1.1)
193
193
  rake (13.2.1)
194
- rdoc (6.6.2)
194
+ rdoc (6.7.0)
195
195
  psych (>= 4.0.0)
196
- regexp_parser (2.9.0)
197
- reline (0.4.2)
196
+ regexp_parser (2.9.2)
197
+ reline (0.5.8)
198
198
  io-console (~> 0.5)
199
- rexml (3.2.6)
199
+ rexml (3.2.8)
200
+ strscan (>= 3.0.9)
200
201
  rspec (3.13.0)
201
202
  rspec-core (~> 3.13.0)
202
203
  rspec-expectations (~> 3.13.0)
@@ -210,7 +211,7 @@ GEM
210
211
  diff-lcs (>= 1.2.0, < 2.0)
211
212
  rspec-support (~> 3.13.0)
212
213
  rspec-support (3.13.1)
213
- rubocop (1.62.1)
214
+ rubocop (1.64.1)
214
215
  json (~> 2.3)
215
216
  language_server-protocol (>= 3.17.0)
216
217
  parallel (~> 1.10)
@@ -221,25 +222,25 @@ GEM
221
222
  rubocop-ast (>= 1.31.1, < 2.0)
222
223
  ruby-progressbar (~> 1.7)
223
224
  unicode-display_width (>= 2.4.0, < 3.0)
224
- rubocop-ast (1.31.2)
225
- parser (>= 3.3.0.4)
225
+ rubocop-ast (1.31.3)
226
+ parser (>= 3.3.1.0)
226
227
  rubocop-capybara (2.20.0)
227
228
  rubocop (~> 1.41)
228
229
  rubocop-factory_bot (2.25.1)
229
230
  rubocop (~> 1.41)
230
- rubocop-rails (2.24.1)
231
+ rubocop-rails (2.25.0)
231
232
  activesupport (>= 4.2.0)
232
233
  rack (>= 1.1)
233
234
  rubocop (>= 1.33.0, < 2.0)
234
235
  rubocop-ast (>= 1.31.1, < 2.0)
235
236
  rubocop-rake (0.6.0)
236
237
  rubocop (~> 1.0)
237
- rubocop-rspec (2.29.1)
238
+ rubocop-rspec (2.29.2)
238
239
  rubocop (~> 1.40)
239
240
  rubocop-capybara (~> 2.17)
240
241
  rubocop-factory_bot (~> 2.22)
241
242
  rubocop-rspec_rails (~> 2.28)
242
- rubocop-rspec_rails (2.28.2)
243
+ rubocop-rspec_rails (2.28.3)
243
244
  rubocop (~> 1.40)
244
245
  ruby-progressbar (1.13.0)
245
246
  simplecov (0.22.0)
@@ -249,8 +250,9 @@ GEM
249
250
  simplecov-html (0.12.3)
250
251
  simplecov_json_formatter (0.1.4)
251
252
  stringio (3.1.0)
253
+ strscan (3.1.0)
252
254
  tdiff (0.4.0)
253
- thor (1.3.0)
255
+ thor (1.3.1)
254
256
  timeout (0.4.1)
255
257
  tzinfo (2.0.6)
256
258
  concurrent-ruby (~> 1.0)
@@ -262,7 +264,7 @@ GEM
262
264
  xpath (3.2.0)
263
265
  nokogiri (~> 1.8)
264
266
  yard (0.9.36)
265
- zeitwerk (2.6.13)
267
+ zeitwerk (2.6.15)
266
268
 
267
269
  PLATFORMS
268
270
  x86_64-darwin-19
@@ -276,8 +278,8 @@ DEPENDENCIES
276
278
  nokogiri-diff (~> 0.3.0)
277
279
  rake (~> 13.2)
278
280
  rspec (~> 3.13)
279
- rubocop (~> 1.62)
280
- rubocop-rails (~> 2.24)
281
+ rubocop (~> 1.64)
282
+ rubocop-rails (~> 2.25)
281
283
  rubocop-rake (~> 0.6)
282
284
  rubocop-rspec (~> 2.29)
283
285
  simplecov (~> 0.21)
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2023 tim-s-ccs
3
+ Copyright (c) 2023 Crown-Commercial-Service
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CCS Frontend Helpers
2
2
 
3
- [![Ruby](https://github.com/tim-s-ccs/ccs-frontend_helpers/actions/workflows/main.yml/badge.svg)](https://github.com/tim-s-ccs/ccs-frontend_helpers/actions/workflows/main.yml)
3
+ [![Ruby](https://github.com/Crown-Commercial-Service/ccs-frontend_helpers/actions/workflows/main.yml/badge.svg)](https://github.com/Crown-Commercial-Service/ccs-frontend_helpers/actions/workflows/main.yml)
4
4
  [![Gem Version](https://badge.fury.io/rb/ccs-frontend_helpers.svg)](https://badge.fury.io/rb/ccs-frontend_helpers)
5
5
 
6
6
  The CCS Frontend Helpers gem was created for use in the Crown Marketplace projects at the Crown Commercial Service.
@@ -12,11 +12,12 @@ This project contains two applications (both use the Ruby on Rails framework):
12
12
 
13
13
  The following table shows the version of CCS Frontend Helpers that you should use for your targeted version of GOV.UK Frontend:
14
14
 
15
- | CCS Frontend Helpers Version | Target GOV.UK Frontend Version |
16
- | ----------------------------- | ------------------------------ |
17
- | [0.3.0](https://github.com/tim-s-ccs/ccs-frontend_helpers/releases/tag/v0.3.0) | [5.3.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.3.0) |
18
- | [0.2.0](https://github.com/tim-s-ccs/ccs-frontend_helpers/releases/tag/v0.2.0) | [5.2.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.2.0) |
19
- | [0.1.2](https://github.com/tim-s-ccs/ccs-frontend_helpers/releases/tag/v0.1.2) | [4.7.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.7.0) |
15
+ | CCS Frontend Helpers Version | Target GOV.UK Frontend Version | Target CCS Frontend Version |
16
+ | ----------------------------- | ------------------------------ | --------------------------- |
17
+ | [0.4.0](https://github.com/Crown-Commercial-Service/ccs-frontend_helpers/releases/tag/v0.4.0) | [5.4.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.4.0) | [1.0.0-beta.5](https://github.com/tim-s-ccs/ccs-frontend-project/releases/tag/v1.0.0-beta.5) |
18
+ | [0.3.0](https://github.com/Crown-Commercial-Service/ccs-frontend_helpers/releases/tag/v0.3.0) | [5.3.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.3.0) | [1.0.0-beta.5](https://github.com/tim-s-ccs/ccs-frontend-project/releases/tag/v1.0.0-beta.5) |
19
+ | [0.2.0](https://github.com/Crown-Commercial-Service/ccs-frontend_helpers/releases/tag/v0.2.0) | [5.2.0](https://github.com/alphagov/govuk-frontend/releases/tag/v5.2.0) | [1.0.0-beta.5](https://github.com/tim-s-ccs/ccs-frontend-project/releases/tag/v1.0.0-beta.5) |
20
+ | [0.1.2](https://github.com/Crown-Commercial-Service/ccs-frontend_helpers/releases/tag/v0.1.2) | [4.7.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.7.0) | [1.0.0-beta.5](https://github.com/tim-s-ccs/ccs-frontend-project/releases/tag/v1.0.0-beta.5) |
20
21
 
21
22
  Any other versions of GOV.UK Frontend not shown above _may_ still be compatible, but have not been specifically tested and verified.
22
23
 
@@ -44,7 +45,7 @@ module ApplicationHelper
44
45
  end
45
46
  ```
46
47
 
47
- This will give you access to a variety of [GDS components](https://design-system.service.gov.uk/components) and [CCS components](https://github.com/tim-s-ccs/ts-ccs-frontend) to use in your application views.
48
+ This will give you access to a variety of [GDS components](https://design-system.service.gov.uk/components) and [CCS components](https://github.com/Crown-Commercial-Service/ts-ccs-frontend) to use in your application views.
48
49
  The `GovUKFrontend` components are based on the components found in [GOV.UK Frontend v4.5.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.5.0).
49
50
 
50
51
  Documentation for the helper methods can be found at [LINK TO RDOCS](#)
@@ -53,7 +54,7 @@ Documentation for the helper methods can be found at [LINK TO RDOCS](#)
53
54
 
54
55
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
55
56
 
56
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
57
+ To install this gem onto your local machine, run `bundle exec rake install`.
57
58
 
58
59
  ### Linting
59
60
 
@@ -92,9 +93,42 @@ We schedule `dependabot` to run every Sunday night which will get the latest dep
92
93
 
93
94
  Snyk is used more for analysing security issues and it will raise PRs itself for a developer to analyse.
94
95
 
96
+ ## Releasing
97
+
98
+ 1. Check out the **main** branch and pull the latest changes.
99
+
100
+ 2. Update the version number in `version.rb` (we follow [Semantic Versioning](https://semver.org/)).
101
+
102
+ 3. Run `bundle install` to update the `Gemfile.lock`
103
+
104
+ 4. Create and check out a new branch (`release-[version]`)
105
+
106
+ ```shell
107
+ git switch -c "release-$(./bin/version)"
108
+ ```
109
+
110
+ 5. Update the [`CHANGELOG.md`](/CHANGELOG.md) by:
111
+
112
+ - changing the 'Unreleased' heading to the new version number and release type. For example, '3.11.0 (Feature release)'
113
+ - adding a new 'Unreleased' heading above the new version number and release type, so users will know where to add PRs to the changelog
114
+ - if the changelog has headings from a pre release, regroup the content under those headings in a single block
115
+ - saving your changes
116
+
117
+ 6. Run `./bin/build-release.sh` to:
118
+
119
+ - commit the changes
120
+ - push a branch to GitHub
121
+
122
+ You will now be prompted to continue or cancel. Check the details and enter `y` to continue. If something does not look right, press `N` to cancel the build and creation of the branch on GitHub.
123
+
124
+ 7. Create a pull request and copy the changelog text.
125
+ When reviewing the PR, check that the version numbers have been updated and that the compiled assets use this version number.
126
+
127
+ 8. Once a reviewer approves the pull request, merge it to **main**. The gem will then automatically be published to [rubygems.org](https://rubygems.org) via a GitHub action.
128
+
95
129
  ## Contributing
96
130
 
97
- Bug reports and pull requests are welcome on GitHub at https://github.com/tim-s-ccs/ccs-frontend_helpers.
131
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Crown-Commercial-Service/ccs-frontend_helpers.
98
132
 
99
133
  To contribute to the project, you should checkout a new branch from `main` and make your changes.
100
134
 
@@ -5,12 +5,11 @@ require_relative 'lib/ccs/frontend_helpers/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'ccs-frontend_helpers'
7
7
  spec.version = CCS::FrontendHelpers::VERSION
8
- spec.authors = ['tim-s-ccs']
9
- spec.email = ['timothy.south@crowncommercial.gov.uk']
8
+ spec.authors = ['Crown Commercial Service']
10
9
 
11
10
  spec.summary = 'Gem containing view helpers for CCS Ruby on Rails projects'
12
11
  spec.description = 'Gem containing view helpers for CCS Ruby on Rails projects'
13
- spec.homepage = 'https://github.com/tim-s-ccs/ccs-frontend_helpers'
12
+ spec.homepage = 'https://github.com/Crown-Commercial-Service/ccs-frontend_helpers'
14
13
  spec.license = 'MIT'
15
14
  spec.required_ruby_version = '>= 3.0.0'
16
15
 
@@ -33,7 +33,7 @@ module CCS
33
33
  def initialize(title:, href:, description:, **options)
34
34
  super(**options)
35
35
 
36
- @options[:attributes][:class] = "ccs-dashboard-section__panel govuk-grid-column-#{@options[:width] || 'one-third'}"
36
+ @options[:attributes][:class] << " govuk-grid-column-#{@options[:width] || 'one-third'}"
37
37
 
38
38
  @title = title
39
39
  @href = href
@@ -50,6 +50,10 @@ module CCS
50
50
  concat(tag.p(description, class: 'ccs-dashboard-section__panel-description'))
51
51
  end
52
52
  end
53
+
54
+ # The default attributes for the dashboard panel
55
+
56
+ DEFAULT_ATTRIBUTES = { class: 'ccs-dashboard-section__panel' }.freeze
53
57
  end
54
58
  end
55
59
  end
@@ -32,7 +32,7 @@ module CCS
32
32
  # @param context [ActionView::Base] the view context
33
33
 
34
34
  def initialize(context:, items: nil, visually_hidden_title: nil, text: nil)
35
- @meta_links = items&.map { |meta_link| Link.new(li_class: 'ccs-footer__inline-list-item', context: context, **meta_link) }
35
+ @meta_links = items.map { |meta_link| Link.new(li_class: 'ccs-footer__inline-list-item', context: context, **meta_link) } if items.present?
36
36
  @visually_hidden_title = visually_hidden_title || 'Support links'
37
37
  @text = text
38
38
  end
@@ -45,7 +45,7 @@ module CCS
45
45
  capture do
46
46
  concat(tag.h2(visually_hidden_title, class: 'govuk-visually-hidden'))
47
47
  if meta_links
48
- concat(tag.ul(class: 'ccs-footer__inline-list') do
48
+ concat(tag.ul(class: "ccs-footer__inline-list #{'ccs-footer__inline-list--bottom' unless text}".rstrip) do
49
49
  meta_links.each { |meta_link| concat(meta_link.render) }
50
50
  end)
51
51
  end
@@ -9,8 +9,10 @@ module CCS
9
9
  # = CCS Footer
10
10
  #
11
11
  # This is used for generating the footer component from the
12
- # {https://github.com/tim-s-ccs/ts-ccs-frontend/tree/main/src/ccs/components/footer CCS - Components - Footer}
12
+ # {https://github.com/tim-s-ccs/ccs-frontend-project/tree/main/packages/ccs-frontend/src/ccs/components/footer CCS - Components - Footer}
13
13
  #
14
+ # @!attribute [r] logo
15
+ # @return [Logo] The initialised Logo component
14
16
  # @!attribute [r] navigation
15
17
  # @return [Array<Navigation>] An array of the initialised navigation sections
16
18
  # @!attribute [r] meta
@@ -19,7 +21,7 @@ module CCS
19
21
  class Footer < Base
20
22
  private
21
23
 
22
- attr_reader :navigation, :meta
24
+ attr_reader :logo, :navigation, :meta
23
25
 
24
26
  public
25
27
 
@@ -39,7 +41,8 @@ module CCS
39
41
 
40
42
  @options[:copyright] ||= '© Crown copyright'
41
43
 
42
- @navigation = navigation&.map { |navigation_item| Navigation.new(context: @context, **navigation_item) }
44
+ @logo = Logo.new(context: @context)
45
+ @navigation = navigation.map { |navigation_item| Navigation.new(context: @context, **navigation_item) } if navigation.present?
43
46
  @meta = Meta.new(context: @context, **meta) if meta
44
47
  end
45
48
 
@@ -60,7 +63,7 @@ module CCS
60
63
  end
61
64
  concat(tag.div(class: 'ccs-footer__meta') do
62
65
  concat(tag.div(class: 'ccs-footer__meta-item') do
63
- concat(tag.div(Logo.render, class: 'ccs-footer__logo'))
66
+ concat(tag.div(logo.render, class: 'ccs-footer__logo'))
64
67
  concat(footer_copyright)
65
68
  end)
66
69
  concat(tag.div(class: 'ccs-footer__meta-item ccs-footer__meta-item--grow') do
@@ -56,8 +56,9 @@ module CCS
56
56
  @primary_links = navigation[:primary_items]&.map { |navigation_link| Link.new(li_class: LI_CLASS, context: context, **navigation_link) }
57
57
  @secondary_links = navigation[:secondary_items]&.map { |navigation_link| Link.new(li_class: LI_CLASS, context: context, **navigation_link) }
58
58
  @navigation_label = navigation[:label] || menu_button[:text]
59
- @navigation_classes = "ccs-header__navigation #{navigation[:classes]}".rstrip
59
+ @navigation_classes = 'ccs-header__navigation'
60
60
  @navigation_classes << ' ccs-header__navigation--no-service-name' unless serivce_name_present
61
+ @navigation_classes << " #{navigation[:classes]}" if navigation[:classes]
61
62
  end
62
63
 
63
64
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
@@ -9,8 +9,10 @@ module CCS
9
9
  # = CCS Header
10
10
  #
11
11
  # This is used for generating the header component from the
12
- # {https://github.com/tim-s-ccs/ts-ccs-frontend/tree/main/src/ccs/components/header CCS - Components - Header}
12
+ # {https://github.com/tim-s-ccs/ccs-frontend-project/tree/main/packages/ccs-frontend/src/ccs/components/header CCS - Components - Header}
13
13
  #
14
+ # @!attribute [r] logo
15
+ # @return [Logo] The initialised Logo component
14
16
  # @!attribute [r] service_authentication
15
17
  # @return [ServiceAuthentication] The initialised service authentication section
16
18
  # @!attribute [r] navigation
@@ -21,7 +23,7 @@ module CCS
21
23
  class Header < Base
22
24
  private
23
25
 
24
- attr_reader :service_authentication, :navigation, :service
26
+ attr_reader :logo, :service_authentication, :navigation, :service
25
27
 
26
28
  public
27
29
 
@@ -48,8 +50,9 @@ module CCS
48
50
  @options[:container_classes] ||= 'govuk-width-container'
49
51
  @options[:homepage_url] ||= 'https://www.crowncommercial.gov.uk'
50
52
 
53
+ @logo = Logo.new(context: @context)
51
54
  @service_authentication = ServiceAuthentication.new(service_authentication_items: service_authentication_items, container_classes: @options[:container_classes], context: @context) if service_authentication_items
52
- @navigation = Navigation.new(navigation: navigation, serivce_name_present: service, menu_button: menu_button, context: @context) if navigation
55
+ @navigation = Navigation.new(navigation: navigation, serivce_name_present: service, menu_button: menu_button, context: @context) if navigation && (navigation[:primary_items] || navigation[:secondary_items])
53
56
  @service = service
54
57
  end
55
58
 
@@ -88,7 +91,7 @@ module CCS
88
91
 
89
92
  def header_logo
90
93
  tag.div(class: 'ccs-header__logo') do
91
- link_to(Logo.render, options[:homepage_url], class: 'ccs-header__link ccs-header__link--homepage', aria: { label: 'Crown Commercial Service' })
94
+ link_to(logo.render, options[:homepage_url], class: 'ccs-header__link ccs-header__link--homepage', aria: { label: 'Crown Commercial Service' })
92
95
  end
93
96
  end
94
97
 
@@ -1,4 +1,4 @@
1
- require 'action_view'
1
+ require_relative '../base'
2
2
 
3
3
  module CCS
4
4
  module Components
@@ -6,18 +6,15 @@ module CCS
6
6
  # = CCS Logo
7
7
  #
8
8
  # This is used for generating the logo component from the
9
- # {https://github.com/tim-s-ccs/ts-ccs-frontend/tree/main/src/ccs/components/logo CCS - Components - Logo}
10
-
11
- class Logo
12
- extend ActionView::Context
13
- extend ActionView::Helpers
9
+ # {https://github.com/tim-s-ccs/ccs-frontend-project/tree/main/packages/ccs-frontend/src/ccs/components/logo CCS - Components - Logo}
14
10
 
11
+ class Logo < Base
15
12
  # Generates the HTML for the CCS Logo.
16
13
  # Used in {CCS::Components::CCS::Header Header} and {CCS::Components::CCS::Footer Footer}
17
14
  #
18
15
  # @return [ActiveSupport::SafeBuffer]
19
16
 
20
- def self.render
17
+ def render
21
18
  tag.span(class: 'ccs-logo') do
22
19
  concat(tag.svg(class: 'ccs-logo__svg', xmlns: 'http://www.w3.org/2000/svg', height: '101', width: '121', aria: { hidden: 'true' }, focusable: 'false', viewBox: '0 0 121 101') do
23
20
  CCS_LOGO_PATHS.each { |ccs_logo_path_attributes| concat(tag.path(**ccs_logo_path_attributes)) }
@@ -31,7 +31,7 @@ module CCS
31
31
  # @option options [String] :classes additional CSS classes for the error summary HTML
32
32
  # @option options [Hash] :attributes ({}) any additional attributes that will be added as part of the HTML
33
33
 
34
- def initialize(title:, error_summary_items:, description: nil, **options)
34
+ def initialize(title:, error_summary_items: [], description: nil, **options)
35
35
  super(**options)
36
36
 
37
37
  @title = title
@@ -51,9 +51,11 @@ module CCS
51
51
  concat(tag.h2(title, class: 'govuk-error-summary__title'))
52
52
  concat(tag.div(class: 'govuk-error-summary__body') do
53
53
  concat(tag.p(description)) if description
54
- concat(tag.ul(class: 'govuk-list govuk-error-summary__list') do
55
- error_summary_items.each { |error_summary_item| concat(error_summary_item.render) }
56
- end)
54
+ if error_summary_items.any?
55
+ concat(tag.ul(class: 'govuk-list govuk-error-summary__list') do
56
+ error_summary_items.each { |error_summary_item| concat(error_summary_item.render) }
57
+ end)
58
+ end
57
59
  end)
58
60
  end
59
61
  end
@@ -15,16 +15,12 @@ module CCS
15
15
  #
16
16
  # @option (see CCS::Components::GovUK::Field::Input#initialize)
17
17
 
18
- def initialize(attribute:, **options)
19
- super(attribute: attribute, **options)
20
- end
21
-
22
18
  # Generates the HTML for the GOV.UK File Upload component
23
19
  #
24
20
  # @return [ActiveSupport::SafeBuffer]
25
21
 
26
22
  def render
27
- super() do
23
+ super do
28
24
  if options[:form]
29
25
  options[:form].file_field(attribute, **options[:attributes])
30
26
  else
@@ -50,7 +50,7 @@ module CCS
50
50
  # @return [ActiveSupport::SafeBuffer]
51
51
 
52
52
  def render
53
- super() do
53
+ super do
54
54
  if options[:form]
55
55
  options[:form].select(
56
56
  attribute,
@@ -39,7 +39,7 @@ module CCS
39
39
  # @return [ActiveSupport::SafeBuffer]
40
40
 
41
41
  def render
42
- super() do
42
+ super do
43
43
  if options[:form]
44
44
  options[:form].text_area(attribute, **options[:attributes])
45
45
  else
@@ -50,7 +50,7 @@ module CCS
50
50
  # @return [ActiveSupport::SafeBuffer]
51
51
 
52
52
  def render
53
- super() do |display_error_message|
53
+ super do |display_error_message|
54
54
  concat(label.render)
55
55
  concat(hint.render) if hint
56
56
  concat(display_error_message)
@@ -17,7 +17,7 @@ module CCS
17
17
  # @option (see CCS::Components::GovUK::Field::Items::Item::Checkbox#initialize)
18
18
 
19
19
  def initialize(attribute:, label:, **options)
20
- super(attribute: attribute, label: label, **options)
20
+ super
21
21
 
22
22
  (label[:attributes] ||= {})[:value] = @value
23
23
  label[:attributes][:for] = @options[:attributes][:id] if @options[:attributes][:id]
@@ -33,7 +33,7 @@ module CCS
33
33
  # @return [ActiveSupport::SafeBuffer]
34
34
 
35
35
  def render
36
- super() do
36
+ super do
37
37
  @options[:form].check_box(@attribute, @options[:attributes], @value)
38
38
  end
39
39
  end
@@ -17,7 +17,7 @@ module CCS
17
17
  # @option (see CCS::Components::GovUK::Field::Items::Item::Checkbox#initialize)
18
18
 
19
19
  def initialize(attribute:, label:, **options)
20
- super(attribute: attribute, label: label, **options)
20
+ super
21
21
 
22
22
  @options[:attributes][:id] ||= "#{sanitize_to_id(@attribute)}_#{sanitize_to_id(@value)}"
23
23
 
@@ -29,7 +29,7 @@ module CCS
29
29
  # @return [ActiveSupport::SafeBuffer]
30
30
 
31
31
  def render
32
- super() do
32
+ super do
33
33
  context.check_box_tag("#{@attribute}[]", @value, @options[:checked], **@options[:attributes])
34
34
  end
35
35
  end
@@ -17,7 +17,7 @@ module CCS
17
17
  # @option (see CCS::Components::GovUK::Field::Items::Item::Radio#initialize)
18
18
 
19
19
  def initialize(attribute:, label:, **options)
20
- super(attribute: attribute, label: label, **options)
20
+ super
21
21
 
22
22
  (label[:attributes] ||= {})[:value] = @value
23
23
  label[:attributes][:for] = @options[:attributes][:id] if @options[:attributes][:id]
@@ -30,7 +30,7 @@ module CCS
30
30
  # @return [ActiveSupport::SafeBuffer]
31
31
 
32
32
  def render
33
- super() do
33
+ super do
34
34
  @options[:form].radio_button(@attribute, @value, **@options[:attributes])
35
35
  end
36
36
  end
@@ -17,7 +17,7 @@ module CCS
17
17
  # @option (see CCS::Components::GovUK::Field::Items::Item::Radio#initialize)
18
18
 
19
19
  def initialize(attribute:, label:, **options)
20
- super(attribute: attribute, label: label, **options)
20
+ super
21
21
 
22
22
  @options[:attributes][:id] ||= "#{sanitize_to_id(@attribute)}_#{sanitize_to_id(@value)}"
23
23
 
@@ -29,7 +29,7 @@ module CCS
29
29
  # @return [ActiveSupport::SafeBuffer]
30
30
 
31
31
  def render
32
- super() do
32
+ super do
33
33
  context.radio_button_tag(@attribute, @value, @options[:checked], **@options[:attributes])
34
34
  end
35
35
  end
@@ -24,7 +24,7 @@ module CCS
24
24
 
25
25
  def render
26
26
  tag.div(class: 'govuk-pagination__next') do
27
- super() do
27
+ super do
28
28
  concat(pagination_icon) if block_is_level
29
29
  concat(tag.span(class: pagination_text_classes) do
30
30
  concat(text)
@@ -24,7 +24,7 @@ module CCS
24
24
 
25
25
  def render
26
26
  tag.div(class: 'govuk-pagination__prev') do
27
- super() do
27
+ super do
28
28
  concat(pagination_icon)
29
29
  concat(tag.span(class: pagination_text_classes) do
30
30
  concat(text)
@@ -37,7 +37,7 @@ module CCS
37
37
  # @return [ActiveSupport::SafeBuffer]
38
38
 
39
39
  def render
40
- super() do
40
+ super do
41
41
  form.button(number, **@options[:attributes])
42
42
  end
43
43
  end
@@ -35,7 +35,7 @@ module CCS
35
35
  # @return [ActiveSupport::SafeBuffer]
36
36
 
37
37
  def render
38
- super() do
38
+ super do
39
39
  link_to(number, href, **@options[:attributes])
40
40
  end
41
41
  end
@@ -8,7 +8,7 @@ module CCS
8
8
  # = CCS Footer
9
9
  #
10
10
  # This helper is used for generating the footer component from the
11
- # {https://github.com/tim-s-ccs/ts-ccs-frontend/tree/main/src/ccs/components/footer CCS - Components - Footer}
11
+ # {https://github.com/tim-s-ccs/ccs-frontend-project/tree/main/packages/ccs-frontend/src/ccs/components/footer CCS - Components - Footer}
12
12
 
13
13
  module Footer
14
14
  # Generates the HTML for the CCS Footer component
@@ -8,7 +8,7 @@ module CCS
8
8
  # = CCS Header
9
9
  #
10
10
  # This helper is used for generating the header component from the
11
- # {https://github.com/tim-s-ccs/ts-ccs-frontend/tree/main/src/ccs/components/header CCS - Components - Header}
11
+ # {https://github.com/tim-s-ccs/ccs-frontend-project/tree/main/packages/ccs-frontend/src/ccs/components/header CCS - Components - Header}
12
12
 
13
13
  module Header
14
14
  # Generates the HTML for the CCS Header component
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../components/ccs/logo'
4
+
5
+ module CCS
6
+ module FrontendHelpers
7
+ module CCSFrontend
8
+ # = CCS Logo
9
+ #
10
+ # This helper is used for generating the logo component from the
11
+ # {https://github.com/tim-s-ccs/ccs-frontend-project/tree/main/packages/ccs-frontend/src/ccs/components/logo CCS - Components - Logo}
12
+
13
+ module Logo
14
+ # Generates the HTML for the CCS Logo component
15
+ #
16
+ # @return (see CCS::Components::CCS::Logo#render)
17
+
18
+ def ccs_logo
19
+ Components::CCS::Logo.new(context: self).render
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -3,6 +3,7 @@
3
3
  require_relative 'ccs_frontend/dashboard_section'
4
4
  require_relative 'ccs_frontend/footer'
5
5
  require_relative 'ccs_frontend/header'
6
+ require_relative 'ccs_frontend/logo'
6
7
 
7
8
  module CCS
8
9
  module FrontendHelpers
@@ -13,6 +14,7 @@ module CCS
13
14
  include DashboardSection
14
15
  include Footer
15
16
  include Header
17
+ include Logo
16
18
  end
17
19
  end
18
20
  end
@@ -19,7 +19,7 @@ module CCS
19
19
  #
20
20
  # @return (see CCS::Components::GovUK::ErrorSummary#render)
21
21
 
22
- def govuk_error_summary(title, error_summary_items, description = nil, **options)
22
+ def govuk_error_summary(title, error_summary_items = [], description = nil, **options)
23
23
  Components::GovUK::ErrorSummary.new(context: self, title: title, error_summary_items: error_summary_items, description: description, **options).render
24
24
  end
25
25
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module CCS
4
4
  module FrontendHelpers
5
- VERSION = '0.3.0'
5
+ VERSION = '0.5.0.beta1'
6
6
  end
7
7
  end
data/package.json CHANGED
@@ -5,6 +5,7 @@
5
5
  "author": "CCS",
6
6
  "license": "MIT",
7
7
  "devDependencies": {
8
- "govuk-frontend": "^5.3.0"
8
+ "govuk-frontend": "^5.4.0",
9
+ "ccs-frontend": "^1.0.0-beta.5"
9
10
  }
10
11
  }
data/yarn.lock CHANGED
@@ -2,7 +2,12 @@
2
2
  # yarn lockfile v1
3
3
 
4
4
 
5
- govuk-frontend@^5.3.0:
6
- version "5.3.0"
7
- resolved "https://registry.yarnpkg.com/govuk-frontend/-/govuk-frontend-5.3.0.tgz#f9a2b405925beada90d074e17939f9d8ddcd256e"
8
- integrity sha512-w6yaaDU3nqhVmWJFnOuJKRIUEB/2RrTFGzoA3z5n4cTG9h292EseT/q+JJA/LYTf5IYzeTIVAUbE5fFjUxefiQ==
5
+ ccs-frontend@^1.0.0-beta.5:
6
+ version "1.0.0-beta.5"
7
+ resolved "https://registry.yarnpkg.com/ccs-frontend/-/ccs-frontend-1.0.0-beta.5.tgz#d69ae71603074922d93f0c4eea31739abe2dd0da"
8
+ integrity sha512-thdhIusFYAOHCyQT2nPTi0cqz1nGTN6ZffFryy8zF21kklVkYyvKsnx+uxrjjhJKmAMgtqxzoXxONws3OeZ8YA==
9
+
10
+ govuk-frontend@^5.4.0:
11
+ version "5.4.0"
12
+ resolved "https://registry.yarnpkg.com/govuk-frontend/-/govuk-frontend-5.4.0.tgz#8f2e0b55ef7c7552a1efe68c7b40ff1b4a393e72"
13
+ integrity sha512-F3YwQYrYQqIPfNxsoph6O78Ey1unCB6cy6omx8KeWY9G504lWZFBSIaiUCma1jNLw9bOUU7Ui+tXG09jjqy0Mw==
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ccs-frontend_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
- - tim-s-ccs
8
- autorequire:
7
+ - Crown Commercial Service
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-12 00:00:00.000000000 Z
11
+ date: 2024-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -25,8 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '6.0'
27
27
  description: Gem containing view helpers for CCS Ruby on Rails projects
28
- email:
29
- - timothy.south@crowncommercial.gov.uk
28
+ email:
30
29
  executables: []
31
30
  extensions: []
32
31
  extra_rdoc_files: []
@@ -152,6 +151,7 @@ files:
152
151
  - lib/ccs/frontend_helpers/ccs_frontend/dashboard_section.rb
153
152
  - lib/ccs/frontend_helpers/ccs_frontend/footer.rb
154
153
  - lib/ccs/frontend_helpers/ccs_frontend/header.rb
154
+ - lib/ccs/frontend_helpers/ccs_frontend/logo.rb
155
155
  - lib/ccs/frontend_helpers/govuk_frontend.rb
156
156
  - lib/ccs/frontend_helpers/govuk_frontend/accordion.rb
157
157
  - lib/ccs/frontend_helpers/govuk_frontend/back_link.rb
@@ -194,15 +194,15 @@ files:
194
194
  - package.json
195
195
  - sig/ccs/frontend_helpers.rbs
196
196
  - yarn.lock
197
- homepage: https://github.com/tim-s-ccs/ccs-frontend_helpers
197
+ homepage: https://github.com/Crown-Commercial-Service/ccs-frontend_helpers
198
198
  licenses:
199
199
  - MIT
200
200
  metadata:
201
- homepage_uri: https://github.com/tim-s-ccs/ccs-frontend_helpers
202
- source_code_uri: https://github.com/tim-s-ccs/ccs-frontend_helpers
203
- changelog_uri: https://github.com/tim-s-ccs/ccs-frontend_helpers/blob/main/CHANGELOG.md
201
+ homepage_uri: https://github.com/Crown-Commercial-Service/ccs-frontend_helpers
202
+ source_code_uri: https://github.com/Crown-Commercial-Service/ccs-frontend_helpers
203
+ changelog_uri: https://github.com/Crown-Commercial-Service/ccs-frontend_helpers/blob/main/CHANGELOG.md
204
204
  rubygems_mfa_required: 'true'
205
- post_install_message:
205
+ post_install_message:
206
206
  rdoc_options: []
207
207
  require_paths:
208
208
  - lib
@@ -213,12 +213,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
213
213
  version: 3.0.0
214
214
  required_rubygems_version: !ruby/object:Gem::Requirement
215
215
  requirements:
216
- - - ">="
216
+ - - ">"
217
217
  - !ruby/object:Gem::Version
218
- version: '0'
218
+ version: 1.3.1
219
219
  requirements: []
220
220
  rubygems_version: 3.4.10
221
- signing_key:
221
+ signing_key:
222
222
  specification_version: 4
223
223
  summary: Gem containing view helpers for CCS Ruby on Rails projects
224
224
  test_files: []