hof 21.0.0-instrumentation-beta.0 → 21.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/.github/workflows/automate-publish.yml +1 -1
  2. package/.github/workflows/automate-tag.yml +4 -4
  3. package/.nyc_output/39365c14-40b7-4634-b733-940b72a11984.json +1 -0
  4. package/.nyc_output/processinfo/39365c14-40b7-4634-b733-940b72a11984.json +1 -0
  5. package/.nyc_output/processinfo/index.json +1 -1
  6. package/CHANGELOG.md +21 -0
  7. package/README.md +340 -256
  8. package/build/tasks/sass/index.js +3 -1
  9. package/build/tasks/watch/index.js +1 -1
  10. package/codeReviewChecklist.md +22 -0
  11. package/components/combine-and-loop-fields/Readme.md +42 -0
  12. package/components/combine-and-loop-fields/index.js +156 -0
  13. package/components/date/index.js +3 -1
  14. package/components/date/templates/date.html +15 -12
  15. package/components/homeoffice-countries/index.js +22 -0
  16. package/components/index.js +2 -0
  17. package/components/notify/notify.js +2 -2
  18. package/components/summary/index.js +3 -2
  19. package/config/builder-defaults.js +3 -1
  20. package/config/component-defaults.js +13 -0
  21. package/config/hof-defaults.js +8 -0
  22. package/controller/controller.js +57 -1
  23. package/controller/formatting/formatters.js +12 -0
  24. package/controller/validation/index.js +2 -1
  25. package/controller/validation/validators.js +4 -0
  26. package/frontend/govuk-template/build/config.js +2 -2
  27. package/frontend/govuk-template/build/govuk_template.html +102 -0
  28. package/frontend/govuk-template/build/index.js +2 -2
  29. package/frontend/govuk-template/govuk_template_generated.html +102 -0
  30. package/frontend/govuk-template/index.js +4 -4
  31. package/frontend/template-mixins/mixins/template-mixins.js +40 -11
  32. package/frontend/template-mixins/partials/forms/checkbox-group.html +47 -0
  33. package/frontend/template-mixins/partials/forms/checkbox.html +9 -4
  34. package/frontend/template-mixins/partials/forms/input-submit.html +1 -1
  35. package/frontend/template-mixins/partials/forms/input-text-date.html +37 -0
  36. package/frontend/template-mixins/partials/forms/input-text-group.html +15 -10
  37. package/frontend/template-mixins/partials/forms/option-group.html +42 -26
  38. package/frontend/template-mixins/partials/forms/select.html +10 -5
  39. package/frontend/template-mixins/partials/forms/textarea-group.html +37 -23
  40. package/frontend/template-mixins/partials/mixins/panel.html +3 -4
  41. package/frontend/template-partials/views/accessibility.html +4 -4
  42. package/frontend/template-partials/views/cookies.html +1 -1
  43. package/frontend/template-partials/views/layout.html +24 -17
  44. package/frontend/template-partials/views/partials/back.html +1 -1
  45. package/frontend/template-partials/views/partials/bullet-list.html +1 -1
  46. package/frontend/template-partials/views/partials/confirmation-alert.html +4 -3
  47. package/frontend/template-partials/views/partials/continue.html +1 -1
  48. package/frontend/template-partials/views/partials/cookie-banner.html +27 -24
  49. package/frontend/template-partials/views/partials/cookie-settings-radio.html +6 -6
  50. package/frontend/template-partials/views/partials/external-link.html +1 -1
  51. package/frontend/template-partials/views/partials/form.html +2 -1
  52. package/frontend/template-partials/views/partials/gatag.html +0 -1
  53. package/frontend/template-partials/views/partials/head.html +23 -0
  54. package/frontend/template-partials/views/partials/maincontent-left.html +4 -4
  55. package/frontend/template-partials/views/partials/navigation.html +7 -6
  56. package/frontend/template-partials/views/partials/session-cookies-table.html +6 -6
  57. package/frontend/template-partials/views/partials/summary-table-row.html +2 -2
  58. package/frontend/template-partials/views/partials/table.html +7 -7
  59. package/frontend/template-partials/views/partials/validation-list.html +2 -2
  60. package/frontend/template-partials/views/partials/validation-summary.html +14 -13
  61. package/frontend/template-partials/views/partials/warn.html +7 -0
  62. package/frontend/template-partials/views/session-timeout.html +3 -2
  63. package/frontend/themes/gov-uk/client-js/cookieSettings.js +1 -1
  64. package/frontend/themes/gov-uk/client-js/govuk-cookies.js +121 -0
  65. package/frontend/themes/gov-uk/client-js/index.js +6 -1
  66. package/frontend/themes/gov-uk/client-js/skip-to-main.js +19 -0
  67. package/frontend/themes/gov-uk/styles/_cookie-banner.scss +51 -1
  68. package/frontend/themes/gov-uk/styles/govuk.scss +4 -0
  69. package/frontend/themes/gov-uk/styles/modules/_validation.scss +5 -5
  70. package/frontend/toolkit/assets/javascript/character-count.js +4 -4
  71. package/frontend/toolkit/assets/javascript/progressive-reveal.js +3 -1
  72. package/frontend/toolkit/assets/javascript/validation.js +5 -1
  73. package/frontend/toolkit/assets/stylesheets/modules/_validation.scss +3 -3
  74. package/index.js +15 -2
  75. package/lib/ga-tag.js +33 -7
  76. package/lib/settings.js +18 -2
  77. package/middleware/cookies.js +2 -0
  78. package/middleware/errors.js +2 -3
  79. package/middleware/not-found.js +0 -3
  80. package/middleware/rate-limiter.js +1 -0
  81. package/model/apis/axios-settings.js +21 -0
  82. package/model/apis/html-to-pdf-converter.js +10 -8
  83. package/model/index.js +102 -87
  84. package/package.json +18 -17
  85. package/pull_request.md +16 -0
  86. package/sandbox/README.md +3 -3
  87. package/sandbox/apps/sandbox/fields.js +33 -11
  88. package/sandbox/apps/sandbox/index.js +4 -0
  89. package/sandbox/apps/sandbox/sections/summary-data-sections.js +3 -0
  90. package/sandbox/apps/sandbox/translations/en/default.json +220 -0
  91. package/sandbox/apps/sandbox/translations/src/en/fields.json +11 -4
  92. package/sandbox/apps/sandbox/translations/src/en/journey.json +4 -1
  93. package/sandbox/apps/sandbox/translations/src/en/pages.json +7 -25
  94. package/sandbox/apps/sandbox/translations/src/en/validation.json +5 -1
  95. package/sandbox/assets/js/index.js +1 -1
  96. package/sandbox/assets/scss/app.scss +16 -16
  97. package/sandbox/package.json +7 -2
  98. package/sandbox/public/css/app.css +9632 -0
  99. package/sandbox/public/images/icons/icon-caret-left.png +0 -0
  100. package/sandbox/public/images/icons/icon-complete.png +0 -0
  101. package/sandbox/public/images/icons/icon-cross-remove-sign.png +0 -0
  102. package/sandbox/public/js/bundle.js +46721 -0
  103. package/sandbox/server.js +2 -1
  104. package/sandbox/yarn.lock +249 -2
  105. package/wizard/index.js +0 -13
  106. package/wizard/middleware/check-progress.js +36 -1
  107. package/.nyc_output/4d5a4574-78fc-4fcb-9412-3658f6ce33ff.json +0 -1
  108. package/.nyc_output/processinfo/4d5a4574-78fc-4fcb-9412-3658f6ce33ff.json +0 -1
  109. package/frontend/govuk-template/govuk_template.html +0 -109
  110. package/frontend/themes/gov-uk/views/partials/form.html +0 -9
  111. package/frontend/themes/gov-uk/views/partials/forms/option-group.html +0 -28
  112. package/frontend/themes/gov-uk/views/partials/mixins/panel.html +0 -3
  113. package/frontend/themes/gov-uk/views/partials/validation-summary.html +0 -24
  114. package/middleware/monitor.js +0 -20
  115. package/sandbox/apps/sandbox/views/confirmation.html +0 -15
package/sandbox/server.js CHANGED
@@ -13,5 +13,6 @@ bootstrap({
13
13
  active: true
14
14
  }
15
15
  },
16
- getAccessibility: true
16
+ getAccessibility: true,
17
+ "port": 8082
17
18
  });
package/sandbox/yarn.lock CHANGED
@@ -2,14 +2,261 @@
2
2
  # yarn lockfile v1
3
3
 
4
4
 
5
- jquery@>=1.11, jquery@^3.6.0:
5
+ abbrev@1:
6
+ version "1.1.1"
7
+ resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
8
+ integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
9
+
10
+ anymatch@~3.1.2:
11
+ version "3.1.2"
12
+ resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
13
+ integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
14
+ dependencies:
15
+ normalize-path "^3.0.0"
16
+ picomatch "^2.0.4"
17
+
18
+ balanced-match@^1.0.0:
19
+ version "1.0.2"
20
+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
21
+ integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
22
+
23
+ binary-extensions@^2.0.0:
24
+ version "2.2.0"
25
+ resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
26
+ integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
27
+
28
+ brace-expansion@^1.1.7:
29
+ version "1.1.11"
30
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
31
+ integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
32
+ dependencies:
33
+ balanced-match "^1.0.0"
34
+ concat-map "0.0.1"
35
+
36
+ braces@~3.0.2:
37
+ version "3.0.3"
38
+ resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
39
+ integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
40
+ dependencies:
41
+ fill-range "^7.1.1"
42
+
43
+ "chokidar@>=3.0.0 <4.0.0", chokidar@^3.5.2:
44
+ version "3.5.3"
45
+ resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
46
+ integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
47
+ dependencies:
48
+ anymatch "~3.1.2"
49
+ braces "~3.0.2"
50
+ glob-parent "~5.1.2"
51
+ is-binary-path "~2.1.0"
52
+ is-glob "~4.0.1"
53
+ normalize-path "~3.0.0"
54
+ readdirp "~3.6.0"
55
+ optionalDependencies:
56
+ fsevents "~2.3.2"
57
+
58
+ concat-map@0.0.1:
59
+ version "0.0.1"
60
+ resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
61
+ integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
62
+
63
+ debug@^3.2.7:
64
+ version "3.2.7"
65
+ resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
66
+ integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==
67
+ dependencies:
68
+ ms "^2.1.1"
69
+
70
+ fill-range@^7.1.1:
71
+ version "7.1.1"
72
+ resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
73
+ integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
74
+ dependencies:
75
+ to-regex-range "^5.0.1"
76
+
77
+ fsevents@~2.3.2:
78
+ version "2.3.2"
79
+ resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
80
+ integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
81
+
82
+ glob-parent@~5.1.2:
83
+ version "5.1.2"
84
+ resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
85
+ integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
86
+ dependencies:
87
+ is-glob "^4.0.1"
88
+
89
+ govuk-frontend@3.14:
90
+ version "3.14.0"
91
+ resolved "https://registry.yarnpkg.com/govuk-frontend/-/govuk-frontend-3.14.0.tgz#d3a9c54437c08f5188f87b1f4480ba60e95c8eb6"
92
+ integrity sha512-y7FTuihCSA8Hty+e9h0uPhCoNanCAN+CLioNFlPmlbeHXpbi09VMyxTcH+XfnMPY4Cp++7096v0rLwwdapTXnA==
93
+
94
+ has-flag@^3.0.0:
95
+ version "3.0.0"
96
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
97
+ integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==
98
+
99
+ ignore-by-default@^1.0.1:
100
+ version "1.0.1"
101
+ resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09"
102
+ integrity sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==
103
+
104
+ immutable@^4.0.0:
105
+ version "4.1.0"
106
+ resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.1.0.tgz#f795787f0db780183307b9eb2091fcac1f6fafef"
107
+ integrity sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==
108
+
109
+ is-binary-path@~2.1.0:
110
+ version "2.1.0"
111
+ resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
112
+ integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
113
+ dependencies:
114
+ binary-extensions "^2.0.0"
115
+
116
+ is-extglob@^2.1.1:
117
+ version "2.1.1"
118
+ resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
119
+ integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
120
+
121
+ is-glob@^4.0.1, is-glob@~4.0.1:
122
+ version "4.0.3"
123
+ resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
124
+ integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
125
+ dependencies:
126
+ is-extglob "^2.1.1"
127
+
128
+ is-number@^7.0.0:
129
+ version "7.0.0"
130
+ resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
131
+ integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
132
+
133
+ jquery@>=1.11:
6
134
  version "3.6.0"
7
135
  resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.0.tgz#c72a09f15c1bdce142f49dbf1170bdf8adac2470"
8
136
  integrity sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==
9
137
 
138
+ jquery@^3.7.1:
139
+ version "3.7.1"
140
+ resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de"
141
+ integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==
142
+
143
+ minimatch@^3.0.4:
144
+ version "3.1.2"
145
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
146
+ integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
147
+ dependencies:
148
+ brace-expansion "^1.1.7"
149
+
150
+ ms@^2.1.1:
151
+ version "2.1.3"
152
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
153
+ integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
154
+
155
+ nodemon@^2.0.15:
156
+ version "2.0.19"
157
+ resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.19.tgz#cac175f74b9cb8b57e770d47841995eebe4488bd"
158
+ integrity sha512-4pv1f2bMDj0Eeg/MhGqxrtveeQ5/G/UVe9iO6uTZzjnRluSA4PVWf8CW99LUPwGB3eNIA7zUFoP77YuI7hOc0A==
159
+ dependencies:
160
+ chokidar "^3.5.2"
161
+ debug "^3.2.7"
162
+ ignore-by-default "^1.0.1"
163
+ minimatch "^3.0.4"
164
+ pstree.remy "^1.1.8"
165
+ semver "^5.7.1"
166
+ simple-update-notifier "^1.0.7"
167
+ supports-color "^5.5.0"
168
+ touch "^3.1.0"
169
+ undefsafe "^2.0.5"
170
+
171
+ nopt@~1.0.10:
172
+ version "1.0.10"
173
+ resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
174
+ integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==
175
+ dependencies:
176
+ abbrev "1"
177
+
178
+ normalize-path@^3.0.0, normalize-path@~3.0.0:
179
+ version "3.0.0"
180
+ resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
181
+ integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
182
+
183
+ picomatch@^2.0.4, picomatch@^2.2.1:
184
+ version "2.3.1"
185
+ resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
186
+ integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
187
+
188
+ pstree.remy@^1.1.8:
189
+ version "1.1.8"
190
+ resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a"
191
+ integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==
192
+
193
+ readdirp@~3.6.0:
194
+ version "3.6.0"
195
+ resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
196
+ integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
197
+ dependencies:
198
+ picomatch "^2.2.1"
199
+
200
+ sass@^1.53.0:
201
+ version "1.54.5"
202
+ resolved "https://registry.yarnpkg.com/sass/-/sass-1.54.5.tgz#93708f5560784f6ff2eab8542ade021a4a947b3a"
203
+ integrity sha512-p7DTOzxkUPa/63FU0R3KApkRHwcVZYC0PLnLm5iyZACyp15qSi32x7zVUhRdABAATmkALqgGrjCJAcWvobmhHw==
204
+ dependencies:
205
+ chokidar ">=3.0.0 <4.0.0"
206
+ immutable "^4.0.0"
207
+ source-map-js ">=0.6.2 <2.0.0"
208
+
209
+ semver@^5.7.1:
210
+ version "5.7.2"
211
+ resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
212
+ integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==
213
+
214
+ semver@~7.0.0:
215
+ version "7.0.0"
216
+ resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
217
+ integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==
218
+
219
+ simple-update-notifier@^1.0.7:
220
+ version "1.0.7"
221
+ resolved "https://registry.yarnpkg.com/simple-update-notifier/-/simple-update-notifier-1.0.7.tgz#7edf75c5bdd04f88828d632f762b2bc32996a9cc"
222
+ integrity sha512-BBKgR84BJQJm6WjWFMHgLVuo61FBDSj1z/xSFUIozqO6wO7ii0JxCqlIud7Enr/+LhlbNI0whErq96P2qHNWew==
223
+ dependencies:
224
+ semver "~7.0.0"
225
+
226
+ "source-map-js@>=0.6.2 <2.0.0":
227
+ version "1.0.2"
228
+ resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
229
+ integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
230
+
231
+ supports-color@^5.5.0:
232
+ version "5.5.0"
233
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
234
+ integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
235
+ dependencies:
236
+ has-flag "^3.0.0"
237
+
238
+ to-regex-range@^5.0.1:
239
+ version "5.0.1"
240
+ resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
241
+ integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
242
+ dependencies:
243
+ is-number "^7.0.0"
244
+
245
+ touch@^3.1.0:
246
+ version "3.1.0"
247
+ resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b"
248
+ integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==
249
+ dependencies:
250
+ nopt "~1.0.10"
251
+
10
252
  typeahead-aria@^1.0.4:
11
253
  version "1.0.4"
12
254
  resolved "https://registry.yarnpkg.com/typeahead-aria/-/typeahead-aria-1.0.4.tgz#d2829cc01c0226a367627f3098a468c4e0343f00"
13
- integrity sha1-0oKcwBwCJqNnYn8wmKRoxOA0PwA=
255
+ integrity sha512-6g0XtcM1AiPMlyXOuAb90Lg0WGi9PdbH68La7kUJmZwxUdpE80IC6tewBg0a/ug1Betoz1xCfEqTgkhuN6wo4w==
14
256
  dependencies:
15
257
  jquery ">=1.11"
258
+
259
+ undefsafe@^2.0.5:
260
+ version "2.0.5"
261
+ resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.5.tgz#38733b9327bdcd226db889fb723a6efd162e6e2c"
262
+ integrity sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==
package/wizard/index.js CHANGED
@@ -8,8 +8,6 @@ const FormController = require('../controller');
8
8
  const mix = require('mixwith').mix;
9
9
 
10
10
  const IncludedBehaviours = require('./behaviours');
11
- const Prometheus = require('prom-client');
12
- const monitor = require('../middleware/monitor');
13
11
 
14
12
  let count = 0;
15
13
 
@@ -35,10 +33,6 @@ const Wizard = (steps, fields, setts) => {
35
33
  controller: FormController
36
34
  }, setts || {});
37
35
 
38
- const metricsInterval = Prometheus.collectDefaultMetrics({
39
- labels: { FORM: process.title.toUpperCase()}
40
- });
41
-
42
36
  // prevent potentially conflicting session namespaces
43
37
  if (!settings.name) {
44
38
  settings.name = count;
@@ -52,12 +46,6 @@ const Wizard = (steps, fields, setts) => {
52
46
 
53
47
  app.use(require('./middleware/session'));
54
48
 
55
- app.get('/metrics', async (req, res) => {
56
- res.set('Content-Type', Prometheus.register.contentType);
57
- const out = await Prometheus.register.metrics();
58
- res.send(out);
59
- });
60
-
61
49
  let first;
62
50
 
63
51
  if (!steps['/']) {
@@ -115,7 +103,6 @@ const Wizard = (steps, fields, setts) => {
115
103
 
116
104
  app.route(route + settings.params)
117
105
  .all((req, res, next) => {
118
- monitor(req, res, res.statusCode);
119
106
  if (settings.translate) {
120
107
  req.translate = settings.translate;
121
108
  }
@@ -28,6 +28,41 @@ module.exports = (route, controller, steps, begin) => {
28
28
  return _.uniq(allSteps);
29
29
  };
30
30
 
31
+ // Gets all the possible routes
32
+ const walkAllPossibleSteps = (stepName, allStepsInService, allVisitedSteps) => {
33
+ const stepIncludingFieldsAndForks = allStepsInService[stepName];
34
+ if (!stepIncludingFieldsAndForks) { return; }
35
+
36
+ const forkTargets = _.map(stepIncludingFieldsAndForks.forks, 'target') || [];
37
+ const nextStep = stepIncludingFieldsAndForks.next || '';
38
+
39
+ // If there is no next step or fork, then we have reached the end of the journey
40
+ if (!forkTargets.length && !nextStep) {
41
+ allVisitedSteps.push(stepName);
42
+ // eslint-disable-next-line consistent-return
43
+ return _.uniq(allVisitedSteps);
44
+ }
45
+
46
+ const nextStepsAndForks = _.uniq(forkTargets.concat(nextStep));
47
+
48
+ // We need to transverse through all 'Next' and 'Forks' for this route
49
+ nextStepsAndForks.map(each => {
50
+ if (!allVisitedSteps.includes(each)) {
51
+ allVisitedSteps.push(each);
52
+ walkAllPossibleSteps(each, allStepsInService, allVisitedSteps);
53
+ }
54
+ });
55
+ };
56
+
57
+ // Create a list of all visited steps
58
+ const createAllVisitedSteps = (stepName, allStepsInService) => {
59
+ const allVisitedSteps = [stepName];
60
+ if (allStepsInService[stepName]) {
61
+ walkAllPossibleSteps(stepName, allStepsInService, allVisitedSteps);
62
+ }
63
+ return _.uniq(allVisitedSteps);
64
+ };
65
+
31
66
  const invalidateStep = (stepName, scopedSteps, sessionModel) => {
32
67
  debug('Invalidating', stepName);
33
68
  const step = scopedSteps[stepName] || {};
@@ -55,7 +90,7 @@ module.exports = (route, controller, steps, begin) => {
55
90
  debug('next', nextStep);
56
91
  debug('potential paths', potentialPaths);
57
92
  // if we're following a loop then allow the loop to be invalidated
58
- const whitelist = isLoop(nextStep, req.path) ? [route] : getAllPossibleSteps(nextStep, steps);
93
+ const whitelist = isLoop(nextStep, req.path) ? [route] : createAllVisitedSteps(nextStep, steps);
59
94
  // aggregate all potential journeys from the invalidating step
60
95
  const invalidateSteps = potentialPaths.reduce((arr, step) => arr.concat(getAllPossibleSteps(step, steps)), []);
61
96