govuk_publishing_components 28.6.0 → 28.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/assets/javascripts/govuk_publishing_components/analytics/page-content.js +3 -3
- data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +7 -6
- data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +1796 -911
- data/app/models/govuk_publishing_components/component_docs.rb +4 -1
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -1
- data/app/views/govuk_publishing_components/components/_button.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_input.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_search.html.erb +2 -4
- data/app/views/govuk_publishing_components/components/_select.html.erb +15 -43
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +7 -8
- data/app/views/govuk_publishing_components/components/docs/attachment.yml +11 -0
- data/app/views/govuk_publishing_components/components/docs/select.yml +1 -1
- data/config/initializers/assets.rb +1 -0
- data/lib/govuk_publishing_components/presenters/attachment.rb +23 -0
- data/lib/govuk_publishing_components/presenters/select_helper.rb +85 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/govuk_publishing_components.rb +1 -1
- metadata +7 -37
- data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +0 -100
- data/lib/govuk_publishing_components/presenters/select.rb +0 -43
- data/lib/tasks/govuk_publishing_components_tasks.rake +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56d5f41976b37b95a3d00db9c7375f7d500879dc0715134227b7f3e935b88ecf
|
4
|
+
data.tar.gz: debdecb330a017f20cabbdc4a2635709f3101a1c9ab7c95043a4cf12283258e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a27ffd2c2449ac670a5726512a140d379cd960371107afe40a4d563a3d15f054280a23dbd01acbd2734047628b91d1b2baee7d7405c680ba87122a1b4c5cc6f
|
7
|
+
data.tar.gz: 1a8d05393b71c257a6dc2af490515a61ce5680aec77ba96b16bd0e4cd64b7ced87be26d9db70f1315426f9b71687c0ac06bf7897c3409968a11f9be40e89c847
|
data/README.md
CHANGED
@@ -29,10 +29,10 @@ To run JavaScript tests (only):
|
|
29
29
|
|
30
30
|
```sh
|
31
31
|
# run JS tests in browser
|
32
|
-
|
32
|
+
yarn run jasmine:browser
|
33
33
|
|
34
34
|
# run JS tests on command line
|
35
|
-
|
35
|
+
yarn run jasmine:ci
|
36
36
|
```
|
37
37
|
|
38
38
|
### Further documentation
|
@@ -14,7 +14,7 @@
|
|
14
14
|
case isDocumentCollectionPage():
|
15
15
|
return document.querySelectorAll('.document-collection .group-title').length
|
16
16
|
case isMainstreamBrowsePage():
|
17
|
-
return countVisible(document.querySelectorAll('#subsection ul')) || document.querySelectorAll('#section ul').length
|
17
|
+
return countVisible(document.querySelectorAll('#subsection ul')) || document.querySelectorAll('#section ul').length || document.querySelectorAll('#root ul').length
|
18
18
|
case isTopicPage():
|
19
19
|
return document.querySelectorAll('.topics-page nav.index-list').length
|
20
20
|
case isPolicyAreaPage():
|
@@ -45,7 +45,7 @@
|
|
45
45
|
case isDocumentCollectionPage():
|
46
46
|
return document.querySelectorAll('.document-collection .group-document-list li a').length
|
47
47
|
case isMainstreamBrowsePage():
|
48
|
-
return countVisible(document.querySelectorAll('#subsection ul a')) || document.querySelectorAll('#section ul a').length
|
48
|
+
return countVisible(document.querySelectorAll('#subsection ul a')) || document.querySelectorAll('#section ul a').length || document.querySelectorAll('#root ul a').length
|
49
49
|
case isTopicPage():
|
50
50
|
return document.querySelectorAll('.topics-page .index-list ul a').length ||
|
51
51
|
document.querySelectorAll('.topics-page .topics ul a').length
|
@@ -71,7 +71,7 @@
|
|
71
71
|
function getMetaAttribute (selector) {
|
72
72
|
var element = document.querySelector(selector)
|
73
73
|
if (element) {
|
74
|
-
return element.getAttribute('content')
|
74
|
+
return element.getAttribute('content').toLowerCase()
|
75
75
|
}
|
76
76
|
}
|
77
77
|
|
@@ -87,22 +87,23 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
87
87
|
var params = new FormData($form)
|
88
88
|
params = new URLSearchParams(params).toString()
|
89
89
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
xhr.onreadystatechange = function () {
|
94
|
-
if (xhr.readyState === 4 && xhr.status === 200) {
|
90
|
+
this.done = function () {
|
91
|
+
if (xhr.status === 200) {
|
95
92
|
this.trackEvent(this.getTrackEventParams($form))
|
96
93
|
this.showFormSuccess(xhr.message)
|
97
94
|
this.revealInitialPrompt()
|
98
95
|
this.setInitialAriaAttributes()
|
99
|
-
this.activeForm.hidden
|
96
|
+
this.activeForm.hidden = true
|
100
97
|
} else {
|
101
98
|
this.showError(xhr)
|
102
99
|
this.enableSubmitFormButton($form)
|
103
100
|
}
|
104
101
|
}.bind(this)
|
105
102
|
|
103
|
+
xhr.addEventListener('loadend', this.done)
|
104
|
+
xhr.open('POST', url, true)
|
105
|
+
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
|
106
|
+
|
106
107
|
this.disableSubmitFormButton($form)
|
107
108
|
xhr.send(params)
|
108
109
|
}.bind(this))
|