govuk_web_banners 1.6.0 → 1.8.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: 3559a09b54ed3fbc2bcfd16a6b7ef76412070c470bc92ee3d5449b9d6dce67cf
4
- data.tar.gz: 25fb54615aa30d92cb11c1fdd31f2993ee5eb7f1cc3c0c472734805ae4e56597
3
+ metadata.gz: 78cff5e2766b1a4474b41626672a49a2651215b50930c581aa76787e3c3466da
4
+ data.tar.gz: ce5e7349198cfa85423aec9ed2aea15950afec97c0f026057677535bdfeec42b
5
5
  SHA512:
6
- metadata.gz: a54b1d94889ead1bc27dc09a2108b2fd20c05f99bbef023c96a1ed958fce67c9499eb618f722948629953120459ec94b5ff11137d4615ee26aa69cee2e751c44
7
- data.tar.gz: f9de6a03acd68640e38599fed629d37e46d5813727c250757369fd454e90f9ab4025862f163deb41837360dbe2ce869f4af23b4473c88ab8e737bab8916da5ab
6
+ metadata.gz: 6a7b506e17f400ef571d1132ad3b92b603a442fcb861714052b5aadd2d95ea15e155c3c92ad1320d9988a852dbefbbeb722fe0f9b432f3c8039c557eb829a192
7
+ data.tar.gz: 7c9b69ab4bd65fd1c1984f451e97c9e72acf56ecb2c2a6289d1cd2b47bb19e779035aef296b9b596399affbb2c9c1759cecef6da553b68519b364758b4a5ef0d
data/README.md CHANGED
@@ -108,7 +108,7 @@ global_banners:
108
108
  title: "Register to Vote"
109
109
  title_href: /register-to-vote
110
110
  text: "You must register to vote before the election"
111
- permanent: false
111
+ always_visible: false
112
112
  exclude_paths:
113
113
  - /find-your-local-electoral-office
114
114
  start_date: 2024/10/21
@@ -122,12 +122,12 @@ Each banner must include a `title`, `title_href`, `text`, and a valid `start_dat
122
122
  > `start_date` is **mandatory** here (unlike in recruitment banners) because it's
123
123
  > needed to create a banner_version to pass to the underlying component. This lets
124
124
  > the component reset the cookie that records how many times a banner has been seen
125
- > (by default banners are shown only three times, see the `permanent` option below.)
125
+ > (by default banners are shown only three times, see the `always_visible` option below.)
126
126
 
127
127
  Optional keys are:
128
128
  - `name` (an identifying name for this banner, not rendered
129
129
  anywhere)
130
- - `permanent` (defaults to false. If false, banner is hidden if the user
130
+ - `always_visible` (defaults to false. If false, banner is hidden if the user
131
131
  has consented to cookies and has seen this banner more than 3 times)
132
132
  - `exclude_paths` an array of paths on which the banner should not be shown.
133
133
  Note that the banner is never shown on the path it points to, this
@@ -2,9 +2,9 @@
2
2
  <% if global_banners.any? %>
3
3
  <%= render "govuk_publishing_components/components/global_banner", {
4
4
  title: global_banners.first.title,
5
- title_path: global_banners.first.title_href,
5
+ title_href: global_banners.first.title_href,
6
6
  text: global_banners.first.text,
7
- permanent: global_banners.first.permanent,
7
+ always_visible: global_banners.first.always_visible,
8
8
  banner_version: global_banners.first.version,
9
9
  } %>
10
10
  <% end %>
@@ -1,2 +1,9 @@
1
1
  # Check README.md for how to format this file
2
- global_banners: []
2
+ global_banners:
3
+ - name: Emergency Alerts
4
+ title: "Emergency Alerts"
5
+ title_href: /alerts
6
+ text: "Test on Sunday 7 September, 3pm"
7
+ always_visible: true
8
+ start_date: 2025/08/31
9
+ end_date: 2025/09/08
@@ -151,3 +151,48 @@ banners:
151
151
  - /government/organisations/hm-revenue-customs/about/recruitment
152
152
  start_date: 2025/08/08
153
153
  end_date: 2025/09/05
154
+ - name: HMRC banner - CXD New Employee 2025/08/13
155
+ suggestion_text: "Help improve GOV.UK"
156
+ suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
157
+ survey_url: https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_74GjifgnGv6GsMC?Source=BannerList_HMRC_new_employee
158
+ page_paths:
159
+ # government-frontend
160
+ - /new-employee/employee-information
161
+ start_date: 2025/08/13
162
+ end_date: 2025/10/08
163
+ - name: HMRC banner - CXD Get PAYE 2025/08/13
164
+ suggestion_text: "Help improve GOV.UK"
165
+ suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
166
+ survey_url: https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_74GjifgnGv6GsMC?Source=BannerList_HMRC_PAYE_forms_p45_p60
167
+ page_paths:
168
+ # government-frontend
169
+ - /get-paye-forms-p45-p60
170
+ start_date: 2025/08/13
171
+ end_date: 2025/10/08
172
+ - name: HMRC banner - CXD Payroll 2025/08/13
173
+ suggestion_text: "Help improve GOV.UK"
174
+ suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
175
+ survey_url: https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_74GjifgnGv6GsMC?Source=BannerList_HMRC_running_payroll
176
+ page_paths:
177
+ # government-frontend
178
+ - /running-payroll
179
+ start_date: 2025/08/13
180
+ end_date: 2025/10/08
181
+ - name: HMRC banner - CXD PAYE Checklist 2025/08/13
182
+ suggestion_text: "Help improve GOV.UK"
183
+ suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
184
+ survey_url: https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_74GjifgnGv6GsMC?Source=BannerList_HMRC_starter_checklist_for_PAYE
185
+ page_paths:
186
+ # frontend
187
+ - /guidance/starter-checklist-for-paye
188
+ start_date: 2025/08/13
189
+ end_date: 2025/10/08
190
+ - name: HMRC banner - CXD New Job 2025/08/13
191
+ suggestion_text: "Help improve GOV.UK"
192
+ suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
193
+ survey_url: https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_74GjifgnGv6GsMC?Source=BannerList_HMRC_Tell_HMRC_new_job_or_more_than_one_job
194
+ page_paths:
195
+ # frontend
196
+ - /guidance/tell-hmrc-if-you-have-a-new-job-or-more-than-one-job
197
+ start_date: 2025/08/13
198
+ end_date: 2025/10/08
@@ -16,7 +16,7 @@ module GovukWebBanners
16
16
  global_banners_data["global_banners"].map { |attributes| GlobalBanner.new(attributes:) }
17
17
  end
18
18
 
19
- attr_reader :name, :title, :title_href, :text, :start_date, :end_date, :show_arrows, :permanent, :exclude_paths
19
+ attr_reader :name, :title, :title_href, :text, :start_date, :end_date, :show_arrows, :always_visible, :exclude_paths
20
20
 
21
21
  def initialize(attributes:)
22
22
  @name = attributes["name"]
@@ -28,7 +28,7 @@ module GovukWebBanners
28
28
  @start_date = attributes["start_date"] ? ActiveSupport::TimeZone[GovukWebBanners::TIME_ZONE].parse(attributes["start_date"]) : nil
29
29
  @end_date = attributes["end_date"] ? ActiveSupport::TimeZone[GovukWebBanners::TIME_ZONE].parse(attributes["end_date"]) : Time.now + 10.years
30
30
  @show_arrows = attributes["show_arrows"] == "true"
31
- @permanent = attributes["permanent"] == "true"
31
+ @always_visible = attributes["always_visible"] == "true"
32
32
  @exclude_paths = attributes["exclude_paths"] || []
33
33
  @exclude_paths << title_href if title_href&.start_with?("/")
34
34
  end
@@ -1,3 +1,3 @@
1
1
  module GovukWebBanners
2
- VERSION = "1.6.0".freeze
2
+ VERSION = "1.8.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.6.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev