@ukhomeoffice/cop-react-form-renderer 6.16.0-beta → 6.16.0-delta

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 (13) hide show
  1. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-component-with-nested-questions-visible-elsewhere.json +118 -0
  2. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-nested-answers-hidden-by-option-visible-elsewhere.json +113 -0
  3. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-page-nested-component.json +26003 -0
  4. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-component-with-nested-questions-visible-elsewhere.json +12 -0
  5. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-nested-answers-hidden-by-option-visible-elsewhere.json +12 -0
  6. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-page-nested-component.json +63 -0
  7. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-component-with-nested-questions-visible-elsewhere-removed.json +11 -0
  8. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-nested-answers-hidden-by-option-visible-elsewhere-removed.json +12 -0
  9. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-page-nested-component.json +63 -0
  10. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.js +17 -14
  11. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.test.js +31 -0
  12. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.js +44 -35
  13. package/package.json +2 -2
@@ -0,0 +1,118 @@
1
+ {
2
+ "id": "example-form",
3
+ "cleanseHiddenData": true,
4
+ "version": "0.0.1",
5
+ "name": "example-form",
6
+ "title": "Example form",
7
+ "type": "form",
8
+ "components": [
9
+ {
10
+ "id": "alpha",
11
+ "fieldId": "alpha",
12
+ "label": "Alpha",
13
+ "type": "text"
14
+ },
15
+ {
16
+ "id": "bravo",
17
+ "fieldId": "bravo",
18
+ "label": "Bravo",
19
+ "type": "text"
20
+ },
21
+ {
22
+ "id": "person",
23
+ "fieldId": "person",
24
+ "type": "container",
25
+ "components": [
26
+ {
27
+ "id": "telephone_visible",
28
+ "fieldId": "telephone",
29
+ "label": "telephone_visible",
30
+ "type": "text"
31
+ },
32
+ {
33
+ "id": "telephoneKnown",
34
+ "fieldId": "telephoneKnown",
35
+ "type": "radios",
36
+ "data": {
37
+ "options": [
38
+ {
39
+ "value": "yes",
40
+ "label": "Yes",
41
+ "nested": [
42
+ {
43
+ "id": "telephone",
44
+ "fieldId": "telephone",
45
+ "type": "text",
46
+ "label": "Telephone",
47
+ "required": true
48
+ }
49
+ ]
50
+ },
51
+ {
52
+ "value": "no",
53
+ "label": "No"
54
+ }
55
+ ]
56
+ },
57
+ "show_when": {
58
+ "op": "=",
59
+ "field": "bravo",
60
+ "value": "NOT-bravo-value"
61
+ }
62
+ },
63
+ {
64
+ "id": "name",
65
+ "fieldId": "name",
66
+ "label": "Name",
67
+ "type": "text"
68
+ }
69
+ ]
70
+ },
71
+ {
72
+ "id": "gamma",
73
+ "fieldId": "gamma",
74
+ "label": "Gamma",
75
+ "type": "text"
76
+ },
77
+ {
78
+ "id": "epsilon",
79
+ "fieldId": "epsilon",
80
+ "label": "Epsilon",
81
+ "type": "text"
82
+ }
83
+ ],
84
+ "pages": [
85
+ {
86
+ "id": "general",
87
+ "name": "general",
88
+ "title": "General information",
89
+ "components": [
90
+ {
91
+ "use": "alpha"
92
+ },
93
+ {
94
+ "use": "bravo"
95
+ },
96
+ {
97
+ "use": "person"
98
+ },
99
+ {
100
+ "use": "gamma"
101
+ },
102
+ {
103
+ "use": "epsilon"
104
+ }
105
+ ],
106
+ "actions": [
107
+ "submit",
108
+ {
109
+ "type": "cancel",
110
+ "page": "",
111
+ "validate": false,
112
+ "classModifiers": "secondary",
113
+ "label": "Cancel"
114
+ }
115
+ ]
116
+ }
117
+ ]
118
+ }
@@ -0,0 +1,113 @@
1
+ {
2
+ "id": "example-form",
3
+ "cleanseHiddenData": true,
4
+ "version": "0.0.1",
5
+ "name": "example-form",
6
+ "title": "Example form",
7
+ "type": "form",
8
+ "components": [
9
+ {
10
+ "id": "alpha",
11
+ "fieldId": "alpha",
12
+ "label": "Alpha",
13
+ "type": "text"
14
+ },
15
+ {
16
+ "id": "bravo",
17
+ "fieldId": "bravo",
18
+ "label": "Bravo",
19
+ "type": "text"
20
+ },
21
+ {
22
+ "id": "person",
23
+ "fieldId": "person",
24
+ "type": "container",
25
+ "components": [
26
+ {
27
+ "id": "telephone_visible",
28
+ "fieldId": "telephone",
29
+ "label": "telephone_visible",
30
+ "type": "text"
31
+ },
32
+ {
33
+ "id": "telephoneKnown",
34
+ "fieldId": "telephoneKnown",
35
+ "type": "radios",
36
+ "data": {
37
+ "options": [
38
+ {
39
+ "value": "yes",
40
+ "label": "Yes",
41
+ "nested": [
42
+ {
43
+ "id": "telephone",
44
+ "fieldId": "telephone",
45
+ "type": "text",
46
+ "label": "Telephone",
47
+ "required": true
48
+ }
49
+ ]
50
+ },
51
+ {
52
+ "value": "no",
53
+ "label": "No"
54
+ }
55
+ ]
56
+ }
57
+ },
58
+ {
59
+ "id": "name",
60
+ "fieldId": "name",
61
+ "label": "Name",
62
+ "type": "text"
63
+ }
64
+ ]
65
+ },
66
+ {
67
+ "id": "gamma",
68
+ "fieldId": "gamma",
69
+ "label": "Gamma",
70
+ "type": "text"
71
+ },
72
+ {
73
+ "id": "epsilon",
74
+ "fieldId": "epsilon",
75
+ "label": "Epsilon",
76
+ "type": "text"
77
+ }
78
+ ],
79
+ "pages": [
80
+ {
81
+ "id": "general",
82
+ "name": "general",
83
+ "title": "General information",
84
+ "components": [
85
+ {
86
+ "use": "alpha"
87
+ },
88
+ {
89
+ "use": "bravo"
90
+ },
91
+ {
92
+ "use": "person"
93
+ },
94
+ {
95
+ "use": "gamma"
96
+ },
97
+ {
98
+ "use": "epsilon"
99
+ }
100
+ ],
101
+ "actions": [
102
+ "submit",
103
+ {
104
+ "type": "cancel",
105
+ "page": "",
106
+ "validate": false,
107
+ "classModifiers": "secondary",
108
+ "label": "Cancel"
109
+ }
110
+ ]
111
+ }
112
+ ]
113
+ }