govuk_publishing_components 63.3.1 → 64.0.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 +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-form-tracker.js +2 -0
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +8 -34
- data/app/assets/javascripts/govuk_publishing_components/dependencies.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/domain-config.js +5 -10
- data/app/assets/javascripts/govuk_publishing_components/lib/cookie-settings.js +4 -15
- data/app/controllers/govuk_publishing_components/application_controller.rb +0 -5
- data/app/models/govuk_publishing_components/audit_applications.rb +0 -4
- data/app/models/govuk_publishing_components/audit_comparer.rb +1 -4
- data/app/views/govuk_publishing_components/applications_page/show.html.erb +0 -1
- data/app/views/govuk_publishing_components/audit/_applications.html.erb +0 -8
- data/app/views/govuk_publishing_components/audit/show.html.erb +1 -6
- data/app/views/govuk_publishing_components/component_guide/example.html.erb +1 -1
- data/app/views/govuk_publishing_components/component_guide/preview.html.erb +1 -1
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_add_another.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_app_promo_banner.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_attachment_link.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_back_link.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_back_to_top_link.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_big_number.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_button.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_cards.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_character_count.html.erb +0 -3
- data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_contents_list_with_body.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_contextual_guidance.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_cross_service_header.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_date_input.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_details.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_emergency_banner.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_error_alert.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_error_message.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_error_summary.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_feedback.html.erb +0 -3
- data/app/views/govuk_publishing_components/components/_fieldset.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_figure.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_file_upload.html.erb +0 -3
- data/app/views/govuk_publishing_components/components/_glance_metric.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_global_banner.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_govspeak.html.erb +0 -5
- data/app/views/govuk_publishing_components/components/_govspeak_html_publication.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_heading.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_hint.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_input.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_inset_text.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_inverse_header.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_label.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_lead_paragraph.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_modal_dialogue.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_notice.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_option_select.html.erb +0 -3
- data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_pagination.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_panel.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_password_input.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_phase_banner.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_published_dates.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_radio.html.erb +0 -3
- data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_reorderable_list.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_search.html.erb +0 -3
- data/app/views/govuk_publishing_components/components/_search_with_autocomplete.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_secondary_navigation.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_select.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_select_with_search.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_service_navigation.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_signup_link.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_skip_link.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +0 -1
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_success_alert.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_summary_banner.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_summary_card.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_summary_list.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_table.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_tabs.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_tag.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_textarea.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/_warning_text.html.erb +0 -2
- data/app/views/govuk_publishing_components/components/docs/govspeak_html_publication.yml +0 -2
- data/app/views/govuk_publishing_components/components/docs/organisation_logo.yml +4 -7
- data/lib/govuk_publishing_components/config.rb +0 -6
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +0 -2
- data/lib/govuk_publishing_components/presenters/organisation_logo_helper.rb +11 -13
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/govuk_publishing_components.rb +0 -5
- metadata +1 -9
- data/app/assets/javascripts/govuk_publishing_components/single-consent-functions.js +0 -59
- data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +0 -78
- data/node_modules/govuk-single-consent/README.md +0 -157
- data/node_modules/govuk-single-consent/dist/singleconsent.cjs.js +0 -419
- data/node_modules/govuk-single-consent/dist/singleconsent.esm.js +0 -417
- data/node_modules/govuk-single-consent/dist/singleconsent.iife.js +0 -431
- data/node_modules/govuk-single-consent/dist/singleconsent.iife.min.js +0 -1
- data/node_modules/govuk-single-consent/package.json +0 -56
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 16c3c262e09722b90a73a068ab44323e447d40e7c833b0ef9e060bf113f776f2
|
|
4
|
+
data.tar.gz: 38303d6dd5e90633a3b7a75126f0b1fcfc51c522417f9efc4f365992cc878171
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b590dce6cb9e0f0d0b53a0921579325699c0f6911c0bc3aa619293fedaa455bce9b41769c1fb95a662c7210ecb059faff660f50a0f0ac3620124f6151e4fcc7b
|
|
7
|
+
data.tar.gz: 0b1fbb803c88a2147aa091c46453d44c51ed35612a76f1d7815544a8858fd3f15bf432240ed7766d8831e2111e85597635b51d0157961aaba79eaedefd15ddbb
|
|
@@ -159,6 +159,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
159
159
|
this.redacted = true
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
+
} else if (inputType === 'file') {
|
|
163
|
+
input.answer = elem.files.length + ' files chosen'
|
|
162
164
|
} else {
|
|
163
165
|
// remove the input from those gathered as it has no value
|
|
164
166
|
inputs.splice(i, 1)
|
|
@@ -15,12 +15,6 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
15
15
|
this.$module.setCookieConsent = this.setCookieConsent.bind(this)
|
|
16
16
|
this.$module.rejectCookieConsent = this.rejectCookieConsent.bind(this)
|
|
17
17
|
this.setupCookieMessage()
|
|
18
|
-
|
|
19
|
-
if (window.GOVUK.useSingleConsentApi) {
|
|
20
|
-
window.addEventListener('hide-cookie-banner', this.$module.hideCookieMessage)
|
|
21
|
-
window.addEventListener('show-cookie-banner', this.$module.showCookieMessage)
|
|
22
|
-
window.GOVUK.singleConsent.init()
|
|
23
|
-
}
|
|
24
18
|
}
|
|
25
19
|
|
|
26
20
|
CookieBanner.prototype.setupCookieMessage = function () {
|
|
@@ -41,13 +35,10 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
41
35
|
this.$rejectCookiesButton.addEventListener('click', this.$module.rejectCookieConsent)
|
|
42
36
|
}
|
|
43
37
|
|
|
44
|
-
|
|
45
|
-
this.showCookieMessage()
|
|
46
|
-
}
|
|
38
|
+
this.showCookieMessage()
|
|
47
39
|
}
|
|
48
40
|
|
|
49
41
|
CookieBanner.prototype.showCookieMessage = function () {
|
|
50
|
-
window.removeEventListener('show-cookie-banner', this.$module.showCookieMessage)
|
|
51
42
|
// Show the cookie banner if not in the cookie settings page or in an iframe
|
|
52
43
|
if (!this.isInCookiesPage() && !this.isInIframe()) {
|
|
53
44
|
var shouldHaveCookieMessage = (this.$module && window.GOVUK.cookie('cookies_preferences_set') !== 'true')
|
|
@@ -57,9 +48,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
57
48
|
|
|
58
49
|
// Set the default consent cookie if it isn't already present
|
|
59
50
|
if (!window.GOVUK.cookie('cookies_policy')) {
|
|
60
|
-
|
|
61
|
-
window.GOVUK.setDefaultConsentCookie()
|
|
62
|
-
}
|
|
51
|
+
window.GOVUK.setDefaultConsentCookie()
|
|
63
52
|
}
|
|
64
53
|
|
|
65
54
|
window.GOVUK.deleteUnconsentedCookies()
|
|
@@ -68,12 +57,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
68
57
|
}
|
|
69
58
|
|
|
70
59
|
CookieBanner.prototype.hideCookieMessage = function (event) {
|
|
71
|
-
window.removeEventListener('hide-cookie-banner', this.$module.hideCookieMessage)
|
|
72
60
|
if (this.$module) {
|
|
73
61
|
this.$module.hidden = true
|
|
74
|
-
|
|
75
|
-
window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
|
|
76
|
-
}
|
|
62
|
+
window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
|
|
77
63
|
}
|
|
78
64
|
|
|
79
65
|
if (event.target) {
|
|
@@ -85,31 +71,19 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
85
71
|
if (this.$acceptCookiesButton.getAttribute('data-cookie-types') === 'all') {
|
|
86
72
|
this.$module.querySelector('.gem-c-cookie-banner__confirmation-message--accepted').hidden = false
|
|
87
73
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} else {
|
|
91
|
-
window.GOVUK.approveAllCookieTypes()
|
|
92
|
-
window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
|
|
93
|
-
}
|
|
94
|
-
|
|
74
|
+
window.GOVUK.approveAllCookieTypes()
|
|
75
|
+
window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
|
|
95
76
|
this.$module.showConfirmationMessage()
|
|
96
77
|
this.$module.cookieBannerConfirmationMessage.focus()
|
|
97
|
-
|
|
98
|
-
if (!window.GOVUK.useSingleConsentApi) {
|
|
99
|
-
window.GOVUK.triggerEvent(window, 'cookie-consent')
|
|
100
|
-
}
|
|
78
|
+
window.GOVUK.triggerEvent(window, 'cookie-consent')
|
|
101
79
|
}
|
|
102
80
|
|
|
103
81
|
CookieBanner.prototype.rejectCookieConsent = function () {
|
|
104
82
|
this.$module.querySelector('.gem-c-cookie-banner__confirmation-message--rejected').hidden = false
|
|
105
83
|
this.$module.showConfirmationMessage()
|
|
106
84
|
this.$module.cookieBannerConfirmationMessage.focus()
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
} else {
|
|
110
|
-
window.GOVUK.setDefaultConsentCookie()
|
|
111
|
-
window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
|
|
112
|
-
}
|
|
85
|
+
window.GOVUK.setDefaultConsentCookie()
|
|
86
|
+
window.GOVUK.cookie('cookies_preferences_set', 'true', { days: 365 })
|
|
113
87
|
}
|
|
114
88
|
|
|
115
89
|
CookieBanner.prototype.showConfirmationMessage = function () {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-env */
|
|
2
2
|
|
|
3
3
|
// This adds in javascript that initialises components and dependencies
|
|
4
|
-
//
|
|
4
|
+
// in public frontend applications.
|
|
5
5
|
// = require ./modules.js
|
|
6
6
|
|
|
7
7
|
document.addEventListener('DOMContentLoaded', function () {
|
|
@@ -13,8 +13,7 @@ window.GOVUK.vars.domains = [
|
|
|
13
13
|
initialiseGA4: true,
|
|
14
14
|
id: 'GTM-MG7HG5W',
|
|
15
15
|
auth: 'bRiZ-jiEHtw6hHpGd6dF9w',
|
|
16
|
-
preview: 'env-3'
|
|
17
|
-
consentApiUrl: 'staging'
|
|
16
|
+
preview: 'env-3'
|
|
18
17
|
},
|
|
19
18
|
{
|
|
20
19
|
name: 'production',
|
|
@@ -24,8 +23,7 @@ window.GOVUK.vars.domains = [
|
|
|
24
23
|
'assets.publishing.service.gov.uk'
|
|
25
24
|
],
|
|
26
25
|
initialiseGA4: true,
|
|
27
|
-
id: 'GTM-MG7HG5W'
|
|
28
|
-
consentApiUrl: 'production'
|
|
26
|
+
id: 'GTM-MG7HG5W'
|
|
29
27
|
},
|
|
30
28
|
{
|
|
31
29
|
name: 'staging',
|
|
@@ -37,8 +35,7 @@ window.GOVUK.vars.domains = [
|
|
|
37
35
|
initialiseGA4: true,
|
|
38
36
|
id: 'GTM-MG7HG5W',
|
|
39
37
|
auth: 'oJWs562CxSIjZKn_GlB5Bw',
|
|
40
|
-
preview: 'env-5'
|
|
41
|
-
consentApiUrl: 'staging'
|
|
38
|
+
preview: 'env-5'
|
|
42
39
|
},
|
|
43
40
|
{
|
|
44
41
|
name: 'integration',
|
|
@@ -50,8 +47,7 @@ window.GOVUK.vars.domains = [
|
|
|
50
47
|
initialiseGA4: true,
|
|
51
48
|
id: 'GTM-MG7HG5W',
|
|
52
49
|
auth: 'C7iYdcsOlYgGmiUJjZKrHQ',
|
|
53
|
-
preview: 'env-4'
|
|
54
|
-
consentApiUrl: 'staging'
|
|
50
|
+
preview: 'env-4'
|
|
55
51
|
},
|
|
56
52
|
{
|
|
57
53
|
name: 'devdocs',
|
|
@@ -59,7 +55,6 @@ window.GOVUK.vars.domains = [
|
|
|
59
55
|
'docs.publishing.service.gov.uk'
|
|
60
56
|
],
|
|
61
57
|
initialiseGA4: true,
|
|
62
|
-
id: 'GTM-TNKCK97'
|
|
63
|
-
consentApiUrl: 'production'
|
|
58
|
+
id: 'GTM-TNKCK97'
|
|
64
59
|
}
|
|
65
60
|
]
|
|
@@ -12,18 +12,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
12
12
|
document.querySelector('form[data-module=cookie-settings]')
|
|
13
13
|
.addEventListener('submit', this.$module.submitSettingsForm)
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
window.GOVUK.singleConsent.init(this.setInitialFormValues.bind(this))
|
|
17
|
-
} else {
|
|
18
|
-
this.setInitialFormValues()
|
|
19
|
-
}
|
|
15
|
+
this.setInitialFormValues()
|
|
20
16
|
}
|
|
21
17
|
|
|
22
18
|
CookieSettings.prototype.setInitialFormValues = function () {
|
|
23
19
|
if (!window.GOVUK.cookie('cookies_policy')) {
|
|
24
|
-
|
|
25
|
-
window.GOVUK.setDefaultConsentCookie()
|
|
26
|
-
}
|
|
20
|
+
window.GOVUK.setDefaultConsentCookie()
|
|
27
21
|
}
|
|
28
22
|
|
|
29
23
|
var currentConsentCookie = window.GOVUK.cookie('cookies_policy')
|
|
@@ -68,13 +62,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
68
62
|
}
|
|
69
63
|
}
|
|
70
64
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} else {
|
|
74
|
-
window.GOVUK.setConsentCookie(options)
|
|
75
|
-
window.GOVUK.setCookie('cookies_preferences_set', true, { days: 365 })
|
|
76
|
-
}
|
|
77
|
-
|
|
65
|
+
window.GOVUK.setConsentCookie(options)
|
|
66
|
+
window.GOVUK.setCookie('cookies_preferences_set', true, { days: 365 })
|
|
78
67
|
this.showConfirmationMessage()
|
|
79
68
|
return false
|
|
80
69
|
}
|
|
@@ -3,16 +3,11 @@ module GovukPublishingComponents
|
|
|
3
3
|
helper ::Rails.application.helpers
|
|
4
4
|
protect_from_forgery with: :exception
|
|
5
5
|
before_action :set_x_frame_options_header
|
|
6
|
-
before_action :set_disable_slimmer_header
|
|
7
6
|
|
|
8
7
|
private
|
|
9
8
|
|
|
10
9
|
def set_x_frame_options_header
|
|
11
10
|
response.headers["X-Frame-Options"] = "ALLOWALL"
|
|
12
11
|
end
|
|
13
|
-
|
|
14
|
-
def set_disable_slimmer_header
|
|
15
|
-
response.headers["X-Slimmer-Skip"] = "true"
|
|
16
|
-
end
|
|
17
12
|
end
|
|
18
13
|
end
|
|
@@ -19,8 +19,6 @@ module GovukPublishingComponents
|
|
|
19
19
|
find_components = /(?<=govuk_publishing_components\/components\/)[a-zA-Z_-]+(?=['"])/
|
|
20
20
|
|
|
21
21
|
@find_all_stylesheets = /@import ["']{1}govuk_publishing_components\/all_components/ # if using the all stylesheets option
|
|
22
|
-
@find_individual_asset_model = /render_component_stylesheets/ # if using per page component asset loading
|
|
23
|
-
@uses_individual_asset_model = false
|
|
24
22
|
find_stylesheets = /(?<=@import ["']{1}govuk_publishing_components\/components\/)(?!print\/)+[a-zA-Z_-]+(?=['"])/
|
|
25
23
|
|
|
26
24
|
@find_all_javascripts = /\/\/ *= require govuk_publishing_components\/all_components/
|
|
@@ -80,7 +78,6 @@ module GovukPublishingComponents
|
|
|
80
78
|
jquery_references: @jquery_references.flatten.uniq.sort,
|
|
81
79
|
component_locations: @component_locations,
|
|
82
80
|
helper_references: @helper_references,
|
|
83
|
-
uses_individual_asset_model: @uses_individual_asset_model,
|
|
84
81
|
application_components: application_components || [],
|
|
85
82
|
}
|
|
86
83
|
end
|
|
@@ -144,7 +141,6 @@ module GovukPublishingComponents
|
|
|
144
141
|
return %w[all] if src.match(@find_all_stylesheets) && type == "stylesheet"
|
|
145
142
|
return %w[all] if src.match(@find_all_javascripts) && type == "javascript"
|
|
146
143
|
|
|
147
|
-
@uses_individual_asset_model = true if src.match(@find_individual_asset_model) && type == "template"
|
|
148
144
|
matches = src.scan(find)
|
|
149
145
|
return [] unless matches.any?
|
|
150
146
|
|
|
@@ -23,7 +23,6 @@ module GovukPublishingComponents
|
|
|
23
23
|
|
|
24
24
|
results.each do |result|
|
|
25
25
|
if result[:application_found]
|
|
26
|
-
@current_uses_individual_asset_model = result[:uses_individual_asset_model]
|
|
27
26
|
templates = result[:components_found].find { |c| c[:location] == "template" }
|
|
28
27
|
stylesheets = result[:components_found].find { |c| c[:location] == "stylesheet" }
|
|
29
28
|
javascripts = result[:components_found].find { |c| c[:location] == "javascript" }
|
|
@@ -69,7 +68,6 @@ module GovukPublishingComponents
|
|
|
69
68
|
jquery_references: result[:jquery_references],
|
|
70
69
|
component_locations: result[:component_locations],
|
|
71
70
|
helper_references: result[:helper_references],
|
|
72
|
-
uses_individual_asset_model: result[:uses_individual_asset_model],
|
|
73
71
|
application_components: result[:application_components],
|
|
74
72
|
}
|
|
75
73
|
else
|
|
@@ -127,8 +125,7 @@ module GovukPublishingComponents
|
|
|
127
125
|
asset_in_gem = false
|
|
128
126
|
end
|
|
129
127
|
|
|
130
|
-
|
|
131
|
-
raise_warning = asset_in_gem && !suppress_warning
|
|
128
|
+
raise_warning = asset_in_gem
|
|
132
129
|
|
|
133
130
|
# this raises a warning if the asset exists and isn't included in the application
|
|
134
131
|
warnings << create_warning(component, "Included in #{first_location} but not #{second_location}") if raise_warning
|
|
@@ -37,12 +37,6 @@
|
|
|
37
37
|
<% github_link = "https://github.com/alphagov/" + application[:dir] + "/blob/main/" %>
|
|
38
38
|
|
|
39
39
|
<% if @other_applications %>
|
|
40
|
-
<% if application[:uses_individual_asset_model] %>
|
|
41
|
-
<%= render "govuk_publishing_components/components/warning_text", {
|
|
42
|
-
text: raw("This application uses <a class=\"govuk-link\" href=\"https://github.com/alphagov/govuk_publishing_components/blob/main/docs/set-up-individual-component-css-loading.md\">per page asset loading</a> for components. Warnings about missing stylesheets have been suppressed."),
|
|
43
|
-
} %>
|
|
44
|
-
<% end %>
|
|
45
|
-
|
|
46
40
|
<% application[:warnings].each do |warning| %>
|
|
47
41
|
<p class="govuk-body">
|
|
48
42
|
<strong class="govuk-tag">Warn</strong>
|
|
@@ -67,8 +61,6 @@
|
|
|
67
61
|
<% content = capture do %>
|
|
68
62
|
<% if item[:value].length > 0 %>
|
|
69
63
|
<%= item[:value].join(", ") %>
|
|
70
|
-
<% elsif application[:uses_individual_asset_model] && item[:name] == "In stylesheets" %>
|
|
71
|
-
Uses per page component asset loading
|
|
72
64
|
<% else %>
|
|
73
65
|
None
|
|
74
66
|
<% end %>
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
<%
|
|
2
|
-
add_gem_component_stylesheet("table")
|
|
3
|
-
add_gem_component_stylesheet("select")
|
|
4
|
-
add_gem_component_stylesheet("summary-list")
|
|
5
|
-
content_for :title, "Component audit"
|
|
6
|
-
%>
|
|
1
|
+
<% content_for :title, "Component audit" %>
|
|
7
2
|
|
|
8
3
|
<%= render "govuk_publishing_components/components/back_link", {
|
|
9
4
|
href: "/component-guide",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<% content_for :title, "#{@component_example.name} example - #{@component_doc.name} component" %>
|
|
2
2
|
<% content_for :application_stylesheet do %>
|
|
3
|
-
<% if @component_doc.source == "application"
|
|
3
|
+
<% if @component_doc.source == "application" %>
|
|
4
4
|
<%= render "application_stylesheet" %>
|
|
5
5
|
<% end %>
|
|
6
6
|
<% end %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<% content_for :title, "#{@component_doc.name} component" %>
|
|
2
2
|
<% content_for :application_stylesheet do %>
|
|
3
|
-
<% if @component_doc.source == "application"
|
|
3
|
+
<% if @component_doc.source == "application" %>
|
|
4
4
|
<%= render "application_stylesheet" %>
|
|
5
5
|
<% end %>
|
|
6
6
|
<% end %>
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
<%
|
|
2
|
-
add_gem_component_stylesheet("button")
|
|
3
|
-
add_gem_component_stylesheet("feedback")
|
|
4
|
-
|
|
5
2
|
email_regex = /[^\s=\/?&]+(?:@|%40)[^\s=\/?&]+/
|
|
6
3
|
url_without_pii = request.original_url.gsub(email_regex, "[email]").encode
|
|
7
4
|
path_without_pii = request.fullpath.gsub(email_regex, "[email]").encode
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
<%
|
|
2
|
-
add_gem_component_stylesheet("govspeak")
|
|
3
|
-
add_gem_component_stylesheet("attachment-link")
|
|
4
|
-
add_gem_component_stylesheet("attachment")
|
|
5
|
-
add_gem_component_stylesheet("details")
|
|
6
|
-
|
|
7
2
|
inverse ||= false
|
|
8
3
|
local_assigns[:margin_bottom] ||= 0
|
|
9
4
|
direction_class = "gem-c-govspeak--direction-#{direction}" if local_assigns.include?(:direction)
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
<%
|
|
2
|
-
add_gem_component_stylesheet("govspeak-html-publication")
|
|
3
|
-
|
|
4
2
|
govspeak_locals = {}
|
|
5
3
|
govspeak_locals[:content] = local_assigns.fetch(:content) if local_assigns.include?(:content)
|
|
6
4
|
govspeak_locals[:direction] = local_assigns.fetch(:direction) if local_assigns.include?(:direction)
|