@planning-inspectorate/dynamic-forms 1.17.0 → 2.0.1

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.
Files changed (52) hide show
  1. package/.releaserc +14 -0
  2. package/README.md +68 -3
  3. package/package.json +2 -1
  4. package/src/components/address/index.njk +2 -19
  5. package/src/components/address/question.test.js +1 -1
  6. package/src/components/boolean/index.njk +4 -21
  7. package/src/components/checkbox/index.njk +3 -21
  8. package/src/components/conditional/textarea.njk +1 -1
  9. package/src/components/conditional/unit.njk +1 -1
  10. package/src/components/date/index.njk +3 -20
  11. package/src/components/date-period/index.njk +4 -21
  12. package/src/components/date-time/index.njk +4 -21
  13. package/src/components/identifier/index.njk +2 -19
  14. package/src/components/multi-field-input/index.njk +3 -20
  15. package/src/components/multi-field-input/question.test.js +3 -3
  16. package/src/components/number-entry/index.njk +7 -21
  17. package/src/components/radio/index.njk +8 -21
  18. package/src/components/select/index.njk +2 -19
  19. package/src/components/single-line-input/index.njk +4 -21
  20. package/src/components/task-list/index.njk +2 -8
  21. package/src/components/text-entry/index.njk +4 -21
  22. package/src/components/text-entry-redact/index.njk +2 -19
  23. package/src/components/text-entry-redact/question.test.js +4 -4
  24. package/src/components/unit-option-entry/index.njk +5 -20
  25. package/src/controller.js +2 -2
  26. package/src/controller.test.js +5 -5
  27. package/src/journey/journey.js +7 -7
  28. package/src/journey/journey.test.js +10 -10
  29. package/src/middleware/redirect-to-unanswered-question.test.js +1 -1
  30. package/src/validator/address-validator.js +1 -1
  31. package/src/validator/address-validator.test.js +1 -5
  32. package/test/journey.js +2 -2
  33. package/test/snapshots/add-insurance.html +1 -11
  34. package/test/snapshots/check-your-answers-not-started.html +0 -3
  35. package/test/snapshots/check-your-answers-with-answers.html +0 -3
  36. package/test/snapshots/companions.html +2 -15
  37. package/test/snapshots/departure-date.html +1 -11
  38. package/test/snapshots/holiday-activities.html +1 -11
  39. package/test/snapshots/holiday-arrival.html +2 -9
  40. package/test/snapshots/holiday-description.html +1 -11
  41. package/test/snapshots/holiday-destination.html +0 -10
  42. package/test/snapshots/holiday-period.html +2 -15
  43. package/test/snapshots/holiday-snack.html +1 -11
  44. package/test/snapshots/hotel-address.html +0 -7
  45. package/test/snapshots/luggage-weight-units.html +2 -17
  46. package/test/snapshots/nights.html +1 -12
  47. package/test/snapshots/secret-wish.html +0 -7
  48. package/test/snapshots/travel-class.html +1 -10
  49. package/test/snapshots/travel-insurance-type.html +0 -10
  50. package/test/views/layout-check-your-answers.njk +1 -1
  51. package/test/views/layout-journey.njk +1 -0
  52. package/test/views/layout-question.njk +0 -2
@@ -1,13 +1,6 @@
1
- <div class="govuk-grid-row">
2
- <div class="govuk-grid-column-two-thirds">
3
- </div>
4
- </div>
5
-
6
-
7
1
  <div class="govuk-grid-row">
8
2
  <div class="govuk-grid-column-two-thirds">
9
3
  <form action="" method="post" novalidate>
10
- <input type="hidden" name="_csrf" value="">
11
4
  <h1 class="govuk-heading-l">
12
5
  Describe your ideal holiday.
13
6
  </h1>
@@ -17,10 +10,7 @@
17
10
  <label class="govuk-label" for="holidayDescription">
18
11
  Description
19
12
  </label>
20
- <div id="holidayDescription-hint" class="govuk-hint">
21
-
22
- </div>
23
- <textarea class="govuk-textarea" id="holidayDescription" name="holidayDescription" rows="5" aria-describedby="holidayDescription-hint"></textarea>
13
+ <textarea class="govuk-textarea" id="holidayDescription" name="holidayDescription" rows="5"></textarea>
24
14
  </div>
25
15
 
26
16
 
@@ -1,13 +1,6 @@
1
- <div class="govuk-grid-row">
2
- <div class="govuk-grid-column-two-thirds">
3
- </div>
4
- </div>
5
-
6
-
7
1
  <div class="govuk-grid-row">
8
2
  <div class="govuk-grid-column-two-thirds">
9
3
  <form action="" method="post" novalidate>
10
- <input type="hidden" name="_csrf" value="">
11
4
 
12
5
 
13
6
  <fieldset class="govuk-fieldset">
@@ -17,9 +10,6 @@
17
10
  </h1>
18
11
  </legend>
19
12
 
20
- <p class="govuk-body"></p>
21
-
22
-
23
13
  <div class="govuk-form-group">
24
14
  <div class="govuk-radios govuk-radios" data-module="govuk-radios">
25
15
  <div class="govuk-radios__item">
@@ -1,13 +1,6 @@
1
- <div class="govuk-grid-row">
2
- <div class="govuk-grid-column-two-thirds">
3
- </div>
4
- </div>
5
-
6
-
7
1
  <div class="govuk-grid-row">
8
2
  <div class="govuk-grid-column-two-thirds">
9
3
  <form action="" method="post" novalidate>
10
- <input type="hidden" name="_csrf" value="">
11
4
 
12
5
  <fieldset class="govuk-fieldset">
13
6
  <legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
@@ -19,13 +12,10 @@
19
12
 
20
13
 
21
14
  <div class="govuk-form-group">
22
- <fieldset class="govuk-fieldset" role="group" aria-describedby="holidayPeriod_start-hint">
15
+ <fieldset class="govuk-fieldset" role="group">
23
16
  <legend class="govuk-fieldset__legend">
24
17
  Start
25
18
  </legend>
26
- <div id="holidayPeriod_start-hint" class="govuk-hint">
27
-
28
- </div>
29
19
  <div class="govuk-date-input" id="holidayPeriod_start">
30
20
  <div class="govuk-date-input__item">
31
21
  <div class="govuk-form-group">
@@ -57,13 +47,10 @@
57
47
 
58
48
 
59
49
  <div class="govuk-form-group">
60
- <fieldset class="govuk-fieldset" role="group" aria-describedby="holidayPeriod_end-hint">
50
+ <fieldset class="govuk-fieldset" role="group">
61
51
  <legend class="govuk-fieldset__legend">
62
52
  End
63
53
  </legend>
64
- <div id="holidayPeriod_end-hint" class="govuk-hint">
65
-
66
- </div>
67
54
  <div class="govuk-date-input" id="holidayPeriod_end">
68
55
  <div class="govuk-date-input__item">
69
56
  <div class="govuk-form-group">
@@ -1,13 +1,6 @@
1
- <div class="govuk-grid-row">
2
- <div class="govuk-grid-column-two-thirds">
3
- </div>
4
- </div>
5
-
6
-
7
1
  <div class="govuk-grid-row">
8
2
  <div class="govuk-grid-column-two-thirds">
9
3
  <form action="" method="post" novalidate>
10
- <input type="hidden" name="_csrf" value="">
11
4
  <h1 class="govuk-heading-l">
12
5
  What is your favourite snack to eat on holiday?
13
6
  </h1>
@@ -18,10 +11,7 @@
18
11
  <label class="govuk-label govuk-label" for="holidaySnack">
19
12
  Snack
20
13
  </label>
21
- <div id="holidaySnack-hint" class="govuk-hint">
22
-
23
- </div>
24
- <input class="govuk-input" id="holidaySnack" name="holidaySnack" type="text" value="" aria-describedby="holidaySnack-hint">
14
+ <input class="govuk-input" id="holidaySnack" name="holidaySnack" type="text" value="">
25
15
  </div>
26
16
 
27
17
 
@@ -1,13 +1,6 @@
1
- <div class="govuk-grid-row">
2
- <div class="govuk-grid-column-two-thirds">
3
- </div>
4
- </div>
5
-
6
-
7
1
  <div class="govuk-grid-row">
8
2
  <div class="govuk-grid-column-two-thirds">
9
3
  <form action="" method="post" novalidate>
10
- <input type="hidden" name="_csrf" value="">
11
4
  <fieldset class="govuk-fieldset">
12
5
  <legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
13
6
  <h1 class="govuk-fieldset__heading">
@@ -1,13 +1,6 @@
1
- <div class="govuk-grid-row">
2
- <div class="govuk-grid-column-two-thirds">
3
- </div>
4
- </div>
5
-
6
-
7
1
  <div class="govuk-grid-row">
8
2
  <div class="govuk-grid-column-two-thirds">
9
3
  <form action="" method="post" novalidate>
10
- <input type="hidden" name="_csrf" value="">
11
4
 
12
5
  <fieldset class="govuk-fieldset">
13
6
  <legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
@@ -16,8 +9,6 @@
16
9
  </h1>
17
10
  </legend>
18
11
 
19
- <p class="govuk-body"></p>
20
-
21
12
  <div class="govuk-form-group">
22
13
  <div class="govuk-radios govuk-radios" data-module="govuk-radios">
23
14
  <div class="govuk-radios__item">
@@ -31,11 +22,8 @@
31
22
  <label class="govuk-label" for="luggageWeightValue_kg">
32
23
  Weight in kilograms
33
24
  </label>
34
- <div id="luggageWeightValue_kg-hint" class="govuk-hint">
35
-
36
- </div>
37
25
  <div class="govuk-input__wrapper">
38
- <input class="govuk-input govuk-input--width-5" id="luggageWeightValue_kg" name="luggageWeightValue_kg" type="text" spellcheck="false" value="" aria-describedby="luggageWeightValue_kg-hint" inputmode="numeric">
26
+ <input class="govuk-input govuk-input--width-5" id="luggageWeightValue_kg" name="luggageWeightValue_kg" type="text" spellcheck="false" value="" inputmode="numeric">
39
27
  <div class="govuk-input__suffix" aria-hidden="true">kg</div>
40
28
  </div>
41
29
  </div>
@@ -51,11 +39,8 @@
51
39
  <label class="govuk-label" for="luggageWeightValue_lbs">
52
40
  Weight in pounds
53
41
  </label>
54
- <div id="luggageWeightValue_lbs-hint" class="govuk-hint">
55
-
56
- </div>
57
42
  <div class="govuk-input__wrapper">
58
- <input class="govuk-input govuk-input--width-5" id="luggageWeightValue_lbs" name="luggageWeightValue_lbs" type="text" spellcheck="false" value="" aria-describedby="luggageWeightValue_lbs-hint" inputmode="numeric">
43
+ <input class="govuk-input govuk-input--width-5" id="luggageWeightValue_lbs" name="luggageWeightValue_lbs" type="text" spellcheck="false" value="" inputmode="numeric">
59
44
  <div class="govuk-input__suffix" aria-hidden="true">lbs</div>
60
45
  </div>
61
46
  </div>
@@ -1,23 +1,12 @@
1
- <div class="govuk-grid-row">
2
- <div class="govuk-grid-column-two-thirds">
3
- </div>
4
- </div>
5
-
6
-
7
1
  <div class="govuk-grid-row">
8
2
  <div class="govuk-grid-column-two-thirds">
9
3
  <h1 class="govuk-heading-l">How many nights will you stay on holiday?</h1>
10
- <p class="govuk-body"></p>
11
4
  <form action="" method="post" novalidate>
12
- <input type="hidden" name="_csrf" value="">
13
5
  <div class="govuk-form-group">
14
6
  <label class="govuk-label" for="nights">
15
7
  Nights
16
8
  </label>
17
- <div id="nights-hint" class="govuk-hint">
18
-
19
- </div>
20
- <input class="govuk-input govuk-input--width-5" id="nights" name="nights" type="text" spellcheck="false" value="" aria-describedby="nights-hint" inputmode="numeric">
9
+ <input class="govuk-input govuk-input--width-5" id="nights" name="nights" type="text" spellcheck="false" value="" inputmode="numeric">
21
10
  </div>
22
11
 
23
12
  <button type="submit" class="govuk-button" data-module="govuk-button" data-cy="button-save-and-continue">
@@ -1,13 +1,6 @@
1
- <div class="govuk-grid-row">
2
- <div class="govuk-grid-column-two-thirds">
3
- </div>
4
- </div>
5
-
6
-
7
1
  <div class="govuk-grid-row">
8
2
  <div class="govuk-grid-column-two-thirds">
9
3
  <form action="" method="post" novalidate>
10
- <input type="hidden" name="_csrf" value="">
11
4
 
12
5
  <h1 class="govuk-label-wrapper">
13
6
  <label class="govuk-label govuk-label--l" for="secretWish">
@@ -1,9 +1,3 @@
1
- <div class="govuk-grid-row">
2
- <div class="govuk-grid-column-two-thirds">
3
- </div>
4
- </div>
5
-
6
-
7
1
  <div class="govuk-grid-row">
8
2
  <div class="govuk-grid-column-two-thirds">
9
3
  <form action="" method="POST" novalidate>
@@ -16,10 +10,7 @@
16
10
  Which class do you want to travel in?
17
11
  </label>
18
12
  </h1>
19
- <div id="travelClass-hint" class="govuk-hint">
20
-
21
- </div>
22
- <select class="govuk-select" id="travelClass" name="travelClass" aria-describedby="travelClass-hint">
13
+ <select class="govuk-select" id="travelClass" name="travelClass">
23
14
  <option value="economy" data-cy="answer-economy">Economy</option>
24
15
  <option value="business" data-cy="answer-business">Business</option>
25
16
  <option value="first" data-cy="answer-first">First Class</option>
@@ -1,13 +1,6 @@
1
- <div class="govuk-grid-row">
2
- <div class="govuk-grid-column-two-thirds">
3
- </div>
4
- </div>
5
-
6
-
7
1
  <div class="govuk-grid-row">
8
2
  <div class="govuk-grid-column-two-thirds">
9
3
  <form action="" method="post" novalidate>
10
- <input type="hidden" name="_csrf" value="">
11
4
 
12
5
 
13
6
  <fieldset class="govuk-fieldset">
@@ -17,9 +10,6 @@
17
10
  </h1>
18
11
  </legend>
19
12
 
20
- <p class="govuk-body"></p>
21
-
22
-
23
13
  <div class="govuk-form-group">
24
14
  <div class="govuk-radios govuk-radios" data-module="govuk-radios">
25
15
  <div class="govuk-radios__item">
@@ -1 +1 @@
1
- {% extends "components/task-list/index.njk" %}
1
+ {% block dynTaskList %}{% endblock %}
@@ -0,0 +1 @@
1
+ {% block dynQuestionContent %}{% endblock %}
@@ -1,2 +0,0 @@
1
- {% block before_content %}{% endblock %}
2
- {% block content %}{% endblock %}