govuk_publishing_components 38.3.1 → 38.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 174edc8aff1507967b48ea3efcec2a79d56c22adbf64f5414d2d758603fb0ef5
4
- data.tar.gz: 0ce85ca601099c9341c2e956fef04e5fb1dbea78ffdc298a997e287423d21c8e
3
+ metadata.gz: b4722ee8913bce56729719e8dde26b88d7958e23fd8c6177a12bcfb67b91a0c6
4
+ data.tar.gz: 77afa0a3c76a84f04523dbd435d18dc92feb1615a106efe301e3e9e78f743c69
5
5
  SHA512:
6
- metadata.gz: d47f8dd957ff9d95f2c118aa7d747e4c43ef7dbf95dc80636d6c2583e925235370ca0f246d1be53bb83bf8bf90633e46e859c79fadf303779a886567c76e1528
7
- data.tar.gz: 9e38d46ac5722147f3f48ffecb1d5d08b3ae93ca4117c48792a3e8903561a84947e7c1d5e32d3d66ef1413519bf7c30e8bb8424b54d2af0b3d005c5cd93a6bca
6
+ metadata.gz: 8861808afb26f285beb8cf3c8a91bd19a7cf076b44a784bf6da5167e24e10c643eb744bd5c0b87cbaf65c358d525a81441fd25d477e14c16b7233428b2fd7e61
7
+ data.tar.gz: 4baa708a0bede0ac54705a63d0fc2bc2a8d957ccae3d4b59b35e2dd8fa75ce62db1e4a7b0c4f6bedbf3c3e1751878732112b0fef1beba648a2a5d4a3abf5287b
@@ -26,7 +26,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
26
26
  Feedback.prototype.init = function () {
27
27
  this.setInitialAriaAttributes()
28
28
  this.setHiddenValues()
29
-
29
+ this.setSurveyPath()
30
30
  this.prompt.hidden = false
31
31
  for (var k = 0; k < this.promptQuestions.length; k++) {
32
32
  this.promptQuestions[k].hidden = false
@@ -151,6 +151,21 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
151
151
  this.somethingIsWrongForm.appendChild(this.timerHoneyPot)
152
152
  }
153
153
 
154
+ // This getter is needed for spyOn in tests
155
+ Feedback.prototype.getPagePath = function () {
156
+ return window.location.pathname
157
+ }
158
+
159
+ Feedback.prototype.setSurveyPath = function () {
160
+ var surveyLink = this.$module.querySelector('#survey_explanation a')
161
+
162
+ if (surveyLink) {
163
+ var pathWithoutEmailPII = this.getPagePath().replace(/[^\s=?&]+(?:@|%40)[^\s=?&]+/, '[email]')
164
+ var encodedPath = encodeURI(pathWithoutEmailPII)
165
+ surveyLink.setAttribute('href', 'https://www.smartsurvey.co.uk/s/gov-uk-banner/?c=' + encodedPath)
166
+ }
167
+ }
168
+
154
169
  Feedback.prototype.updateAriaAttributes = function (linkClicked) {
155
170
  linkClicked.setAttribute('aria-expanded', true)
156
171
  }
@@ -10,7 +10,7 @@
10
10
  <h3 class="gem-c-feedback__form-heading"><%= t("components.feedback.help_us_improve_govuk") %></h3>
11
11
  <p id="survey_explanation" class="gem-c-feedback__form-paragraph">
12
12
  <%= t("components.feedback.more_about_visit") %>
13
- <a href="https://www.smartsurvey.co.uk/s/gov-uk-banner/?c=<%= path_without_pii %>" class="govuk-link">Please fill in this survey</a>.
13
+ <a href="https://www.smartsurvey.co.uk/s/gov-uk-banner/?c=no-js" class="govuk-link" target="_blank" rel="noopener noreferrer external">Please fill in this survey (opens in a new tab)</a>.
14
14
  </p>
15
15
  <button
16
16
  class="govuk-button govuk-button--secondary js-close-form"
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "38.3.1".freeze
2
+ VERSION = "38.3.2".freeze
3
3
  end
@@ -103,9 +103,9 @@ or equivalently:
103
103
 
104
104
  This will create a new build for axe, called `axe.<lang>.js` and `axe.<lang>.min.js`. If you want to build all localized versions, simply pass in `--all-lang` instead. If you want to build multiple localized versions (but not all of them), you can pass in a comma-separated list of languages to the `--lang` flag, like `--lang=nl,ja`.
105
105
 
106
- To create a new translation for axe, start by running `grunt translate --lang=<langcode>`. This will create a json file fin the `./locales` directory, with the default English text in it for you to translate. Alternatively, you could copy `./locales/_template.json`. We welcome any localization for axe-core. For details on how to contribute, see the Contributing section below. For details on the message syntax, see [Check Message Template](/doc/check-message-template.md).
106
+ To create a new translation for axe, start by running `grunt translate --lang=<langcode>`. This will create a json file in the `./locales` directory, with the default English text in it for you to translate. Alternatively, you could copy `./locales/_template.json`. We welcome any localization for axe-core. For details on how to contribute, see the Contributing section below. For details on the message syntax, see [Check Message Template](/doc/check-message-template.md).
107
107
 
108
- To update existing translation file, re-run `grunt translate --lang=<langcode>`. This will add new messages used in English and remove messages which were not used in English.
108
+ To update an existing translation file, re-run `grunt translate --lang=<langcode>`. This will add new messages used in English and remove messages which were not used in English.
109
109
 
110
110
  Additionally, locale can be applied at runtime by passing a `locale` object to `axe.configure()`. The locale object must be of the same shape as existing locales in the `./locales` directory. For example:
111
111