govuk_publishing_components 6.7.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f88881b02018b9b7cc7e47fcd045799d90ded54098093f95f4481d594b23f9b9
4
- data.tar.gz: a8e89d46fac1748bfcbc2fd22472ad5a8a124b0ebb062418354aea7f919460a5
3
+ metadata.gz: bba4841a5d552322905968aee5f052211f27c6098b4852773783b31df829f89c
4
+ data.tar.gz: 4dad4283c06f90c7ba5f344f06ab1e1ae689a525b759aecdfcbbf445e915f9f0
5
5
  SHA512:
6
- metadata.gz: 11f29247660b10e5628829475e88b63e42a3be0d0d17d6b4a7c10b5920bbefaebf7ad898c93dad40f662a5a50875b61240d5560a3a090231284cfd5ee3f4d77c
7
- data.tar.gz: eebdd2b04fa3998c304b855c1fa48e4e3cfba93b7ceef353c9676873183ca7f3dcdc5280dccdec15a8c9bd4e97efd22a961d6d5a8d81144077e1379d55595c42
6
+ metadata.gz: 9ea2543a323847fe1a88c0857f5c4bcc6915399619519c31c884005faf9c1b422d0e92388933519840f39ceae547262ddfcb133332decd0ff312828dc4447f10
7
+ data.tar.gz: 2514492ef7efafd17c6b6b893f88eefadd92edbc2d821c2b86ce3609c39887789219bf415fb14e08feb25a3e8c30f34b9e40170421210b08f50e6eedc72519ec
@@ -12,6 +12,7 @@
12
12
  @import "components/document-list";
13
13
  @import "components/error-summary";
14
14
  @import "components/fieldset";
15
+ @import "components/heading";
15
16
  @import "components/input";
16
17
  @import "components/label";
17
18
  @import "components/radio";
@@ -0,0 +1,10 @@
1
+ .gem-c-heading {
2
+ @include bold-27;
3
+ margin-top: $gutter;
4
+ margin-bottom: $gutter-half;
5
+
6
+ @include media(tablet) {
7
+ margin-top: 0;
8
+ margin-bottom: $gutter;
9
+ }
10
+ }
@@ -0,0 +1,11 @@
1
+ <%
2
+ id = "id=#{id}" if id
3
+ heading_level ||= 1
4
+ heading_level_tag = "h#{heading_level}" if [1,2,3,4,5,6].include? heading_level
5
+ %>
6
+ <<%= heading_level_tag %>
7
+ <%= id %>
8
+ class="gem-c-heading"
9
+ >
10
+ <%= text %>
11
+ </<%= heading_level_tag %>>
@@ -8,7 +8,6 @@
8
8
  value ||= ""
9
9
  id ||= "search-main-" + SecureRandom.hex(4)
10
10
  label_text ||= "Search GOV.UK"
11
- label_text = "#{label_text}".html_safe
12
11
  %>
13
12
 
14
13
  <div class="gem-c-search <%= class_name %>" data-module="gem-toggle-input-class-on-focus">
@@ -0,0 +1,32 @@
1
+ name: Heading
2
+ description: A text heading
3
+ body: |
4
+ A heading tag with an optional id attribute, used predominantly to the left of content on consultations and publications.
5
+
6
+ Real world examples:
7
+
8
+ - [Publication](/government/publications/recognising-the-terrorist-threat)
9
+ - [Consultation](/government/consultations/proposal-for-the-future-of-rotherham-goldthorpe-jobcentre)
10
+ accessibility_criteria: |
11
+ The heading must:
12
+
13
+ - be part of a correct heading structure for a page
14
+ - be semantically represented as a heading
15
+ - convey the heading level
16
+ examples:
17
+ default:
18
+ data:
19
+ text: 'Download the full outcome'
20
+ right_to_left:
21
+ data:
22
+ text: 'مستندات'
23
+ context:
24
+ right_to_left: true
25
+ with_id_attribute:
26
+ data:
27
+ text: 'Detail of outcome'
28
+ id: 'detail_of_outcome'
29
+ specific_heading_level:
30
+ data:
31
+ text: 'Original consultation'
32
+ heading_level: 3
@@ -38,6 +38,7 @@ module GovukPublishingComponents
38
38
  meta_tags["govuk:content-id"] = content_item[:content_id] if content_item[:content_id]
39
39
  meta_tags["govuk:withdrawn"] = "withdrawn" if content_item[:withdrawn_notice].present?
40
40
  meta_tags["govuk:content-has-history"] = "true" if has_content_history?
41
+ meta_tags["govuk:static-analytics:strip-dates"] = "true" if should_strip_dates_pii?(content_item, local_assigns)
41
42
  meta_tags["govuk:static-analytics:strip-postcodes"] = "true" if should_strip_postcode_pii?(content_item, local_assigns)
42
43
 
43
44
  meta_tags
@@ -128,6 +129,15 @@ module GovukPublishingComponents
128
129
  root_taxon_set
129
130
  end
130
131
 
132
+ def should_strip_dates_pii?(content_item, local_assigns)
133
+ # allow override if we explicitly want to strip pii (or not) regardless of
134
+ # document_type
135
+ return local_assigns[:strip_dates_pii] if local_assigns.key?(:strip_dates_pii)
136
+
137
+ formats_that_might_include_dates = %w[smart_answer]
138
+ formats_that_might_include_dates.include?(content_item[:document_type])
139
+ end
140
+
131
141
  def should_strip_postcode_pii?(content_item, local_assigns)
132
142
  # allow override if we explicitly want to strip pii (or not) regardless of
133
143
  # document_type
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '6.7.0'.freeze
2
+ VERSION = '7.0.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: 6.7.0
4
+ version: 7.0.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-04-24 00:00:00.000000000 Z
11
+ date: 2018-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config
@@ -324,6 +324,7 @@ files:
324
324
  - app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss
325
325
  - app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss
326
326
  - app/assets/stylesheets/govuk_publishing_components/components/_fieldset.scss
327
+ - app/assets/stylesheets/govuk_publishing_components/components/_heading.scss
327
328
  - app/assets/stylesheets/govuk_publishing_components/components/_input.scss
328
329
  - app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss
329
330
  - app/assets/stylesheets/govuk_publishing_components/components/_label.scss
@@ -365,6 +366,7 @@ files:
365
366
  - app/views/govuk_publishing_components/components/_error_summary.html.erb
366
367
  - app/views/govuk_publishing_components/components/_feedback.html.erb
367
368
  - app/views/govuk_publishing_components/components/_fieldset.html.erb
369
+ - app/views/govuk_publishing_components/components/_heading.html.erb
368
370
  - app/views/govuk_publishing_components/components/_input.html.erb
369
371
  - app/views/govuk_publishing_components/components/_inverse_header.html.erb
370
372
  - app/views/govuk_publishing_components/components/_label.html.erb
@@ -385,6 +387,7 @@ files:
385
387
  - app/views/govuk_publishing_components/components/docs/error_summary.yml
386
388
  - app/views/govuk_publishing_components/components/docs/feedback.yml
387
389
  - app/views/govuk_publishing_components/components/docs/fieldset.yml
390
+ - app/views/govuk_publishing_components/components/docs/heading.yml
388
391
  - app/views/govuk_publishing_components/components/docs/input.yml
389
392
  - app/views/govuk_publishing_components/components/docs/inverse_header.yml
390
393
  - app/views/govuk_publishing_components/components/docs/label.yml