@planning-inspectorate/dynamic-forms 1.9.1 → 1.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planning-inspectorate/dynamic-forms",
3
- "version": "1.9.1",
3
+ "version": "1.10.0",
4
4
  "description": "This package is for building GDS forms using a configuration-based approach.",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -86,6 +86,21 @@
86
86
  type: "submit",
87
87
  attributes: { "data-cy":"button-save-and-continue"}
88
88
  }) }}
89
+ {% if extraActionButtons|length %}
90
+ {% for extraActionButton in extraActionButtons %}
91
+ {{ govukButton({
92
+ text: extraActionButton.text,
93
+ type: extraActionButton.type,
94
+ href: extraActionButton.href,
95
+ attributes: {
96
+ "formaction": extraActionButton.formaction or "",
97
+ "data-cy": "button-" + extraActionButton.text|lower|replace(" ", "-"),
98
+ "name": extraActionButton.text|lower|replace(" ", "-")
99
+ },
100
+ classes: extraActionButton.classes or "govuk-button--secondary"
101
+ }) }}
102
+ {% endfor %}
103
+ {% endif %}
89
104
  </form>
90
105
  </div>
91
106
  </div>
@@ -17,6 +17,7 @@ export default class RadioQuestion extends OptionsQuestion {
17
17
  * @param {Array.<import('../../questions/options-question.js').Option>} params.options
18
18
  * @param {Array.<import('../../questions/question.js').BaseValidator>} [params.validators]
19
19
  * @param {boolean} [params.editable]
20
+ * @param {Object<string, any>} [params.viewData]
20
21
  * @param {import('../../questions/question-types.js').ActionLink} [params.actionLink]
21
22
  */
22
23
  constructor({
@@ -34,7 +35,8 @@ export default class RadioQuestion extends OptionsQuestion {
34
35
  options,
35
36
  validators,
36
37
  actionLink,
37
- editable
38
+ editable,
39
+ viewData
38
40
  }) {
39
41
  super({
40
42
  title,
@@ -48,7 +50,8 @@ export default class RadioQuestion extends OptionsQuestion {
48
50
  options,
49
51
  validators,
50
52
  actionLink,
51
- editable
53
+ editable,
54
+ viewData
52
55
  });
53
56
 
54
57
  this.html = html;