govuk_web_banners 0.1.0 → 0.2.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: da77b3f454b15e59feb67dd5e9bf18fef636b3bda1bf874d049c8df3b6399ac1
4
- data.tar.gz: 7c2ccf8b6bf5cdfba1a0aea1580f31c8ed24b9f9d2238dddf3c020ddbe418250
3
+ metadata.gz: e90dcafd54461fe4a723458faccd96d342d6d4d4ad26451ea38431b94d56c2b4
4
+ data.tar.gz: c12a85485ac267611ca6096fd3185bbb9c84123fb106f0102d9f88e872aeda11
5
5
  SHA512:
6
- metadata.gz: 20fe2fe0e6c23f98145a36ce5e5139ff3c8f7d58f1e6d53e13731ddfafa13b712917fc13b1aadccaf76fe2d291254377e3691ed3d4292e293d681bd0f2167102
7
- data.tar.gz: 30cd8b18cb423dd66517abb9ff6a58cdcba830ea76bc0d81376564b1680865ad751b7853eaa09c5157afe837273cf31e1a64a5b0b3bfc575343b1806de2720e5
6
+ metadata.gz: 68690f93a35d664a9d6ed0103b6082987196a190b8089005ca0b6fe7a0cf3892106836f6e27c1f0bd033edf33dc9c9ddc5994cad80cca419ea5c2cf95cee6d1c
7
+ data.tar.gz: a40d8c454e7b64ade2254e18c6ef09965b0023b1d79223771177c703d0182b9ffb14e7db63d3048223b1f054d4431b0bdee3aa589bf8f432895fea9600148a84
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # GovukWebBanners
2
- Proof of Concept for centralising handling of Recruitment, Global, and Emergency banners (currently spread across apps)
2
+ Proof of Concept for centralising handling of Recruitment, Global, and Emergency
3
+ banners (currently spread across apps)
3
4
 
4
5
  ## Usage
5
- Currently, supports recruitment banners
6
+ Currently supports recruitment banners
6
7
 
7
8
  ## Adding the gem to your application
8
9
  Add this line to your application's Gemfile:
@@ -27,20 +28,35 @@ Add the JS dependencies to your existing asset dependencies file:
27
28
  //= require govuk_web_banners/dependencies
28
29
  ```
29
30
 
30
- Add a call to the partial in the layout or view that you want banners to appear in:
31
+ ## Adding recruitment banners
32
+
33
+ Add a call to the partial in the layout or view that you want banners to appear
34
+ in (typically recruitment banners should be in the layout, below the breadcrumbs
35
+ and just above the `main` element):
31
36
 
32
37
  ```
33
38
  <%= render "govuk_web_banners/recruitment_banner" %>
34
39
  ```
35
40
 
36
- You should make sure this line is above the call to render_component_stylesheets call if your
37
- app is using individual component stylesheets.
41
+ ### Required stylesheets
42
+
43
+ If you are using individual component stylesheets in your app, you should make
44
+ sure the call to the recruitment_banner partial is above the call to
45
+ render_component_stylesheets in your layout.
46
+
47
+ If you are _not_ using individual component stylesheets in your app, you will
48
+ have to make sure the intervention component's styles are included in your
49
+ application stylesheet:
50
+
51
+ `@import "govuk_publishing_components/components/intervention"`
38
52
 
39
53
  ## Updating banner information in the gem
40
54
 
41
- Data for the current set of live banners can be found at `config/govuk_web_banners/recruitment_banners.yml`. To
42
- add a banner to the config, add an entry under the banners: array. Note that this array must always be valid,
43
- so if there are no banners in the file, it must contain at least `banners: []`
55
+ Data for the current set of live banners can be found at
56
+ `config/govuk_web_banners/recruitment_banners.yml`. To add a banner to the
57
+ config, add an entry under the banners: array. Note that this array must always
58
+ be valid, so if there are no banners in the file, it must contain at least
59
+ `banners: []`
44
60
 
45
61
  ### Example banner entry
46
62
 
@@ -57,32 +73,40 @@ banners:
57
73
  end_date: 18/11/2024
58
74
  ```
59
75
 
60
- The required keys are `suggestion_text`, `suggestion_link_text`, and `survey_url` (the values to appear in the
61
- banner), and `page_paths` (an array of paths on which the banner should be shown).
76
+ The required keys are `suggestion_text`, `suggestion_link_text`, and
77
+ `survey_url` (the values to appear in the banner), and `page_paths` (an array of
78
+ paths on which the banner should be shown).
62
79
 
63
- Optional keys are `name` (an identifying name for this banner, not rendered anywhere), and `start_date` / `end_date`
64
- (the banner becomes active at the start of the day specified as `start_date`, and stops at the *start* of the day
65
- specified as `end_date`). Start and end dates must be in the DD/MM/YYYY format parsable as a YAML -> Date.
80
+ Optional keys are `name` (an identifying name for this banner, not rendered
81
+ anywhere), and `start_date` / `end_date` (the banner becomes active at the start
82
+ of the day specified as `start_date`, and stops at the *start* of the day
83
+ specified as `end_date`). Start and end dates must be in the DD/MM/YYYY format
84
+ parsable as a YAML -> Date.
66
85
 
67
86
  ### Keeping the config file valid and tidy
68
87
 
69
- The config file will be checked during CI, so an invalid file can't be released as a gem and we are forced
70
- to make sure it's kept tidy. These checks include:
88
+ The config file will be checked during CI, so an invalid file can't be released
89
+ as a gem and we are forced to make sure it's kept tidy. These checks include:
71
90
 
72
91
  * the banners array must be a valid YAML array
73
- * all banners have a suggestion_text, suggestion_link_text, survey_url and page_paths
74
- * the same page_path is not present on two banners that are active at the same time
92
+ * all banners have a suggestion_text, suggestion_link_text, survey_url and
93
+ page_paths
94
+ * the same page_path is not present on two banners that are active at the same
95
+ time
75
96
  * paths must start with a forward-slash (/)
76
97
 
77
98
  It will also display warnings (but not fail CI)
78
99
 
79
- * if there are banners that have expired - you are encouraged to remove obsolete config, but it will not
80
- prevent you merging changes.
81
- * if page_paths point to pages that are not currently live on GOV.UK - this may be intentional (if the banner
82
- is for a page that isn't yet published), or it may indicate a typo in the path.
100
+ * if there are banners that have expired - you are encouraged to remove obsolete
101
+ config, but it will not prevent you merging changes.
102
+ * if page_paths point to pages that are not currently live on GOV.UK - this may
103
+ be intentional (if the banner is for a page that isn't yet published), or it
104
+ may indicate a typo in the path.
83
105
 
84
- Note that some of this validation code is in the lib/govuk_web_banners/validators path, which
85
- should be tested to ensure the checking is valid, but will not be bundled into the released gem.
106
+ Note that some of this validation code is in the
107
+ lib/govuk_web_banners/validators path, which should be tested to ensure the
108
+ checking is valid, but will not be bundled into the released gem.
86
109
 
87
110
  ## License
88
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
111
+ The gem is available as open source under the terms of the [MIT
112
+ License](https://opensource.org/licenses/MIT).
@@ -1,5 +1,6 @@
1
1
  # Example usage of adding a banner to the banners list
2
2
 
3
+ # banners:
3
4
  # - name: Banner 1
4
5
  # suggestion_text: "Help improve GOV.UK"
5
6
  # suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
@@ -14,4 +15,33 @@
14
15
  #
15
16
  # Note that this file must contain a valid banners array, so if there are no banners
16
17
  # currently included, the file should at least contain banners: []
17
- banners: []
18
+ banners:
19
+ - name: AI banner 11/11/2024
20
+ suggestion_text: "Help improve GOV.UK"
21
+ suggestion_link_text: "Sign up to take part in user research (opens in a new tab)"
22
+ survey_url: https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_2bggmg6xlelrO0S
23
+ page_paths:
24
+ # government frontend:
25
+ - /self-assessment-tax-returns
26
+ - /working-for-yourself
27
+ - /self-employed-records
28
+ - /expenses-if-youre-self-employed
29
+ - /first-company-accounts-and-return
30
+ - /what-is-the-construction-industry-scheme
31
+ - /capital-allowances
32
+ - /simpler-income-tax-cash-basis
33
+ - /expenses-and-benefits-a-to-z
34
+ - /capital-gains-tax
35
+ - /directors-loans
36
+ - /self-assessment-tax-return-forms
37
+ - /running-a-limited-company
38
+ - /calculate-tax-on-company-cars
39
+ - /introduction-to-business-rates
40
+ - /calculate-your-business-rates
41
+ - /apply-for-business-rate-relief
42
+ - /stop-being-self-employed
43
+ - /tax-codes
44
+ # finder-frontend:
45
+ - /business-finance-support
46
+ start_date: 11/11/2024
47
+ end_date: 06/01/2025
@@ -1,3 +1,3 @@
1
1
  module GovukWebBanners
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_web_banners
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.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: 2024-11-25 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_publishing_components