govuk_publishing_components 9.4.0 → 9.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/admin_scripts.js +4 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +57 -86
  4. data/app/assets/stylesheets/component_guide/application.scss +0 -10
  5. data/app/assets/stylesheets/govuk_publishing_components/admin_styles.scss +3 -2
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +30 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +11 -31
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_skip-link.scss +1 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +1 -70
  10. data/app/views/govuk_publishing_components/component_guide/show.html.erb +3 -6
  11. data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +23 -21
  12. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +22 -20
  13. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +1 -1
  14. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +1 -1
  15. data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +5 -2
  16. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +48 -0
  17. data/app/views/govuk_publishing_components/components/_notice.html.erb +2 -2
  18. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +6 -2
  19. data/app/views/govuk_publishing_components/components/_skip_link.html.erb +4 -0
  20. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +0 -7
  21. data/app/views/govuk_publishing_components/components/docs/layout_for_admin.yml +1 -0
  22. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +57 -0
  23. data/app/views/govuk_publishing_components/components/docs/notice.yml +4 -0
  24. data/app/views/govuk_publishing_components/components/docs/skip_link.yml +16 -0
  25. data/app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml +1 -190
  26. data/app/views/layouts/govuk_publishing_components/application.html.erb +3 -0
  27. data/config/initializers/assets.rb +2 -0
  28. data/lib/govuk_publishing_components/presenters/step_by_step_nav_helper.rb +0 -26
  29. data/lib/govuk_publishing_components/version.rb +1 -1
  30. metadata +9 -3
  31. data/app/assets/javascripts/govuk_publishing_components/lib/history-support.js +0 -8
@@ -43,5 +43,8 @@
43
43
 
44
44
  <%= yield %>
45
45
  </main>
46
+ <% if @component_doc && @component_doc.part_of_admin_layout? %>
47
+ <%= javascript_include_tag "govuk_publishing_components/admin_scripts" %>
48
+ <% end %>
46
49
  </body>
47
50
  </html>
@@ -1,4 +1,5 @@
1
1
  Rails.application.config.assets.precompile += %w(
2
+ govuk_publishing_components/admin_scripts.js
2
3
  govuk_publishing_components/admin_styles.css
3
4
  govuk_publishing_components/component_guide.css
4
5
  component_guide/all_components.css
@@ -24,4 +25,5 @@ Rails.application.config.assets.precompile += %w(
24
25
  Rails.application.config.assets.paths += %W(
25
26
  #{__dir__}/../../node_modules/govuk-frontend/assets/images
26
27
  #{__dir__}/../../node_modules/govuk-frontend/assets/fonts
28
+ #{__dir__}/../../node_modules/govuk-frontend/
27
29
  )
@@ -13,12 +13,8 @@ module GovukPublishingComponents
13
13
  case element[:type]
14
14
  when "paragraph"
15
15
  paragraph(element[:text])
16
- when "heading"
17
- heading(element[:text])
18
16
  when "list"
19
17
  list(element)
20
- when "substep"
21
- substep(element)
22
18
  end
23
19
  end
24
20
 
@@ -37,14 +33,6 @@ module GovukPublishingComponents
37
33
  )
38
34
  end
39
35
 
40
- def heading(text)
41
- content_tag(
42
- "h#{@options[:heading_level] + 1}",
43
- text,
44
- class: "gem-c-step-nav__heading"
45
- )
46
- end
47
-
48
36
  def list(element)
49
37
  content_tag(
50
38
  get_list_element(element[:style]),
@@ -66,20 +54,6 @@ module GovukPublishingComponents
66
54
  end
67
55
  end
68
56
 
69
- def substep(element)
70
- optional = "gem-c-step-nav__substep--optional" if element[:optional] == true
71
- content_tag(
72
- :div,
73
- class: "gem-c-step-nav__substep #{optional}"
74
- ) do
75
- element[:contents].collect { |contents|
76
- concat(
77
- render_step_nav_element(contents, @options)
78
- )
79
- }
80
- end
81
- end
82
-
83
57
  def create_list_item_content(link)
84
58
  if link[:href]
85
59
  @link_index += 1
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '9.4.0'.freeze
2
+ VERSION = '9.5.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.4.0
4
+ version: 9.5.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-07-11 00:00:00.000000000 Z
11
+ date: 2018-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -316,13 +316,13 @@ files:
316
316
  - app/assets/javascripts/component_guide/vendor/axe.min.js
317
317
  - app/assets/javascripts/component_guide/vendor/matches-polyfill.min.js
318
318
  - app/assets/javascripts/component_guide/visual-regression.js
319
+ - app/assets/javascripts/govuk_publishing_components/admin_scripts.js
319
320
  - app/assets/javascripts/govuk_publishing_components/all_components.js
320
321
  - app/assets/javascripts/govuk_publishing_components/components/error-summary.js
321
322
  - app/assets/javascripts/govuk_publishing_components/components/feedback.js
322
323
  - app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js
323
324
  - app/assets/javascripts/govuk_publishing_components/components/success-alert.js
324
325
  - app/assets/javascripts/govuk_publishing_components/lib/current-location.js
325
- - app/assets/javascripts/govuk_publishing_components/lib/history-support.js
326
326
  - app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js
327
327
  - app/assets/javascripts/govuk_publishing_components/lib/toggle.js
328
328
  - app/assets/stylesheets/component_guide/application.scss
@@ -347,6 +347,7 @@ files:
347
347
  - app/assets/stylesheets/govuk_publishing_components/components/_label.scss
348
348
  - app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss
349
349
  - app/assets/stylesheets/govuk_publishing_components/components/_layout-for-admin.scss
350
+ - app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss
350
351
  - app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss
351
352
  - app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss
352
353
  - app/assets/stylesheets/govuk_publishing_components/components/_notice.scss
@@ -357,6 +358,7 @@ files:
357
358
  - app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss
358
359
  - app/assets/stylesheets/govuk_publishing_components/components/_search.scss
359
360
  - app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss
361
+ - app/assets/stylesheets/govuk_publishing_components/components/_skip-link.scss
360
362
  - app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss
361
363
  - app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss
362
364
  - app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss
@@ -440,6 +442,7 @@ files:
440
442
  - app/views/govuk_publishing_components/components/_label.html.erb
441
443
  - app/views/govuk_publishing_components/components/_layout_footer.html.erb
442
444
  - app/views/govuk_publishing_components/components/_layout_for_admin.html.erb
445
+ - app/views/govuk_publishing_components/components/_layout_header.html.erb
443
446
  - app/views/govuk_publishing_components/components/_lead_paragraph.html.erb
444
447
  - app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb
445
448
  - app/views/govuk_publishing_components/components/_meta_tags.html.erb
@@ -452,6 +455,7 @@ files:
452
455
  - app/views/govuk_publishing_components/components/_related_navigation.html.erb
453
456
  - app/views/govuk_publishing_components/components/_search.html.erb
454
457
  - app/views/govuk_publishing_components/components/_share_links.html.erb
458
+ - app/views/govuk_publishing_components/components/_skip_link.html.erb
455
459
  - app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb
456
460
  - app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
457
461
  - app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb
@@ -481,6 +485,7 @@ files:
481
485
  - app/views/govuk_publishing_components/components/docs/label.yml
482
486
  - app/views/govuk_publishing_components/components/docs/layout_footer.yml
483
487
  - app/views/govuk_publishing_components/components/docs/layout_for_admin.yml
488
+ - app/views/govuk_publishing_components/components/docs/layout_header.yml
484
489
  - app/views/govuk_publishing_components/components/docs/lead_paragraph.yml
485
490
  - app/views/govuk_publishing_components/components/docs/machine_readable_metadata.yml
486
491
  - app/views/govuk_publishing_components/components/docs/meta_tags.yml
@@ -493,6 +498,7 @@ files:
493
498
  - app/views/govuk_publishing_components/components/docs/related_navigation.yml
494
499
  - app/views/govuk_publishing_components/components/docs/search.yml
495
500
  - app/views/govuk_publishing_components/components/docs/share_links.yml
501
+ - app/views/govuk_publishing_components/components/docs/skip_link.yml
496
502
  - app/views/govuk_publishing_components/components/docs/step_by_step_nav.yml
497
503
  - app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml
498
504
  - app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml
@@ -1,8 +0,0 @@
1
- // used by the step by step navigation component
2
-
3
- if(typeof window.GOVUK === 'undefined'){ window.GOVUK = {}; }
4
- if(typeof window.GOVUK.support === 'undefined'){ window.GOVUK.support = {}; }
5
-
6
- window.GOVUK.support.history = function() {
7
- return window.history && window.history.pushState && window.history.replaceState;
8
- }