govuk_web_banners 1.3.0 → 1.4.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: e82716ff793fe171809d1ddef0e06de382ddcd923c33e3e563b7a7b870a19eb2
4
- data.tar.gz: 88bb6ac90018c9f77f9b948542b2efa5a325fe219c9c1f30f66758b6560e8736
3
+ metadata.gz: 72390441ea030c79a304774d614bafeea76076f348a7a18f1c91a0550d3b5e06
4
+ data.tar.gz: bb60e3fec30d355df9e3c2202f895b43ca96cd313c75703b16cf19d423e3c276
5
5
  SHA512:
6
- metadata.gz: 290ab6c009769ace09e30135b865810d4bd92ced7d6093ac28bca5c03f97bdc4a1394a1e2acfb5f7fa2f83c59830d2e186a4d1f7fb0fd3b97d4c603ebf19b063
7
- data.tar.gz: d12209e9cbf9002ed091fb505caa8b536d266be6253269aac7d15ba4393ca59112e97f80a2eaf013a6faad2ec3d27e9eb07d18a2fb5a6bdbbc4685ac0d30fb5e
6
+ metadata.gz: af4a88e99f13d25dd2ded6f765633771c709396690ebff903ad48dfc743f54e093555fbb55daa96f14937b51753e010234c43ffbdea46125a03e0b160383df9d
7
+ data.tar.gz: 004ae46414c0af964d0663c3a2a1bee921a6f7200cd545a9ca36f62695a77870d6fad34b9f8408a0198a6c5c574f316b495a123b5aa9a5543475dcea7b5e5308
data/README.md CHANGED
@@ -206,17 +206,22 @@ banners:
206
206
  - /foreign-travel-advice
207
207
  start_date: 2024/10/21
208
208
  end_date: 2024/11/18
209
+ image: hmrc
209
210
  ```
210
211
 
211
212
  The required keys are `suggestion_text`, `suggestion_link_text`, and
212
213
  `survey_url` (the values to appear in the banner), and `page_paths` (an array of
213
214
  paths on which the banner should be shown).
214
215
 
215
- Optional keys are `name` (an identifying name for this banner, not rendered
216
- anywhere), and `start_date` / `end_date` (the banner becomes active at the start
217
- of the day specified as `start_date`, and stops at the *start* of the day
218
- specified as `end_date`). Start and end dates must be in the YYYY/MM/DD format
219
- parsable as a YAML -> Date.
216
+ Optional keys are:
217
+ - `name` (an identifying name for this banner, not rendered
218
+ anywhere)
219
+ - `start_date` the banner becomes active at the *start* of the day specified.
220
+ Must be in the YYYY/MM/DD format parsable as a YAML -> Date.
221
+ - `end_date` (the banner stops being active at the *start* of the day
222
+ specified). Must be in the YYYY/MM/DD format parsable as a YAML -> Date.
223
+ - `image` an image name supported by the [interaction banner image option](https://components.publishing.service.gov.uk/component-guide/intervention#with_image)
224
+ Currently the only allowable value is `hmrc`.
220
225
 
221
226
  ### Validations on the recruitment banners config file
222
227
 
@@ -6,6 +6,7 @@
6
6
  suggestion_text: recruitment_banner.suggestion_text,
7
7
  suggestion_link_text: recruitment_banner.suggestion_link_text,
8
8
  suggestion_link_url: recruitment_banner.survey_url,
9
+ image: recruitment_banner.image,
9
10
  } %>
10
11
  </div>
11
12
  <% end %>
@@ -1,17 +1,5 @@
1
1
  # Check README.md for how to format this file
2
2
  banners:
3
- - name: HMRC Comms & Guidance banner - Manual 2025/02/18
4
- suggestion_text: "Help improve GOV.UK"
5
- suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
6
- survey_url: https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_74GjifgnGv6GsMC?Source=BannerList_HMRC_CT-Manual_TAD
7
- page_paths:
8
- # government-frontend
9
- - /hmrc-internal-manuals/business-income-manual/bim30000
10
- - /hmrc-internal-manuals/business-income-manual/bim37000
11
- - /hmrc-internal-manuals/property-income-manual/pim1900
12
- - /hmrc-internal-manuals/property-income-manual/pim2010
13
- start_date: 2025/05/29
14
- end_date: 2025/07/11
15
3
  - name: HMRC banner - Register VAT 2025/07/04
16
4
  suggestion_text: "Help improve GOV.UK"
17
5
  suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
@@ -18,7 +18,7 @@ module GovukWebBanners
18
18
  recruitment_banners_data["banners"].map { |attributes| RecruitmentBanner.new(attributes:) }
19
19
  end
20
20
 
21
- attr_reader :name, :suggestion_text, :suggestion_link_text, :survey_url, :page_paths, :start_date, :end_date
21
+ attr_reader :name, :suggestion_text, :suggestion_link_text, :survey_url, :page_paths, :start_date, :end_date, :image
22
22
 
23
23
  def initialize(attributes:)
24
24
  @name = attributes["name"]
@@ -28,6 +28,7 @@ module GovukWebBanners
28
28
  @page_paths = attributes["page_paths"]
29
29
  @start_date = attributes["start_date"] ? ActiveSupport::TimeZone[GovukWebBanners::TIME_ZONE].parse(attributes["start_date"]) : Time.at(0)
30
30
  @end_date = attributes["end_date"] ? ActiveSupport::TimeZone[GovukWebBanners::TIME_ZONE].parse(attributes["end_date"]) : Time.now + 10.years
31
+ @image = attributes["image"]
31
32
  end
32
33
 
33
34
  # NB: .between? is inclusive. To make it exclude the end date, we set the end range as
@@ -1,3 +1,3 @@
1
1
  module GovukWebBanners
2
- VERSION = "1.3.0".freeze
2
+ VERSION = "1.4.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_web_banners
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev