@truedat/df 4.47.9 → 4.48.3
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/CHANGELOG.md +6 -0
- package/package.json +4 -4
- package/src/components/DynamicFieldValue.js +52 -44
- package/src/components/DynamicForm.js +18 -13
- package/src/components/DynamicFormViewer.js +22 -20
- package/src/components/EditableDynamicFieldValue.js +21 -22
- package/src/components/FieldGroupSegment.js +2 -2
- package/src/components/FieldGroupSubSegment/__tests__/FieldGroupSubSegment.spec.js +22 -22
- package/src/components/FieldGroupSubSegment/__tests__/__snapshots__/FieldGroupSubSegment.spec.js.snap +4 -4
- package/src/components/FieldGroupSubSegment/handleCopyModule.js +18 -18
- package/src/components/__tests__/__snapshots__/DynamicForm.spec.js.snap +74 -80
- package/src/components/widgets/CheckboxField.js +17 -9
- package/src/components/widgets/DynamicField.js +3 -1
- package/src/components/widgets/RadioField.js +16 -8
- package/src/components/widgets/__tests__/CheckboxField.spec.js +4 -7
- package/src/components/widgets/__tests__/RadioField.spec.js +3 -3
- package/src/components/widgets/__tests__/__snapshots__/CheckboxField.spec.js.snap +12 -2
- package/src/components/widgets/__tests__/__snapshots__/RadioField.spec.js.snap +2 -0
- package/src/selectors/__tests__/getOptions.spec.js +2 -2
- package/src/selectors/getOptions.js +1 -1
- package/src/templates/components/Template.js +7 -2
- package/src/templates/components/TemplateCard.js +2 -1
- package/src/templates/components/__tests__/Template.spec.js +12 -10
- package/src/templates/components/__tests__/__snapshots__/Template.spec.js.snap +278 -27
- package/src/templates/components/templateForm/ActiveGroupForm.js +8 -7
- package/src/templates/components/templateForm/ConditionalFieldForm.js +12 -4
- package/src/templates/components/templateForm/GroupsList.js +2 -2
- package/src/templates/components/templateForm/__tests__/__snapshots__/ActiveGroupForm.spec.js.snap +1 -1
- package/src/templates/utils/__tests__/parseFieldOptions.spec.js +5 -5
- package/src/templates/utils/__tests__/parseGroups.spec.js +10 -4
- package/src/templates/utils/parseFieldOptions.js +4 -5
- package/src/templates/utils/parseGroups.js +2 -3
|
@@ -1,33 +1,284 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<Template /> matches the latest snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui breadcrumb"
|
|
7
|
+
>
|
|
8
|
+
<a
|
|
9
|
+
class="section"
|
|
10
|
+
href="/templates"
|
|
11
11
|
>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<HeaderContent>
|
|
18
|
-
Label
|
|
19
|
-
</HeaderContent>
|
|
20
|
-
</Header>
|
|
21
|
-
<Connect(TemplateForm)
|
|
22
|
-
editMode={true}
|
|
23
|
-
onSubmit={[MockFunction]}
|
|
24
|
-
template={
|
|
25
|
-
Object {
|
|
26
|
-
"id": 1,
|
|
27
|
-
"label": "Label",
|
|
28
|
-
}
|
|
29
|
-
}
|
|
12
|
+
Templates
|
|
13
|
+
</a>
|
|
14
|
+
<i
|
|
15
|
+
aria-hidden="true"
|
|
16
|
+
class="right angle icon divider"
|
|
30
17
|
/>
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
<div
|
|
19
|
+
class="active section"
|
|
20
|
+
>
|
|
21
|
+
My Template
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div
|
|
25
|
+
class="ui segment"
|
|
26
|
+
>
|
|
27
|
+
<h2
|
|
28
|
+
class="ui header"
|
|
29
|
+
>
|
|
30
|
+
<i
|
|
31
|
+
aria-hidden="true"
|
|
32
|
+
class="file code outline circular icon"
|
|
33
|
+
/>
|
|
34
|
+
<div
|
|
35
|
+
class="content"
|
|
36
|
+
>
|
|
37
|
+
My Template
|
|
38
|
+
<div
|
|
39
|
+
class="sub header"
|
|
40
|
+
>
|
|
41
|
+
template1
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</h2>
|
|
45
|
+
<form
|
|
46
|
+
class="ui form"
|
|
47
|
+
>
|
|
48
|
+
<div
|
|
49
|
+
class="ui horizontal divider"
|
|
50
|
+
>
|
|
51
|
+
<h4
|
|
52
|
+
class="ui header"
|
|
53
|
+
>
|
|
54
|
+
Template
|
|
55
|
+
</h4>
|
|
56
|
+
</div>
|
|
57
|
+
<div
|
|
58
|
+
class="fields"
|
|
59
|
+
>
|
|
60
|
+
<div
|
|
61
|
+
class="required six wide field"
|
|
62
|
+
>
|
|
63
|
+
<label>
|
|
64
|
+
Name
|
|
65
|
+
</label>
|
|
66
|
+
<div
|
|
67
|
+
class="ui input"
|
|
68
|
+
>
|
|
69
|
+
<input
|
|
70
|
+
name="name"
|
|
71
|
+
required=""
|
|
72
|
+
type="text"
|
|
73
|
+
value="template1"
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<div
|
|
78
|
+
class="required six wide field"
|
|
79
|
+
>
|
|
80
|
+
<label>
|
|
81
|
+
Label
|
|
82
|
+
</label>
|
|
83
|
+
<div
|
|
84
|
+
class="ui input"
|
|
85
|
+
>
|
|
86
|
+
<input
|
|
87
|
+
name="label"
|
|
88
|
+
required=""
|
|
89
|
+
type="text"
|
|
90
|
+
value="My Template"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
<div
|
|
95
|
+
class="required four wide field"
|
|
96
|
+
>
|
|
97
|
+
<label>
|
|
98
|
+
Scope
|
|
99
|
+
</label>
|
|
100
|
+
<div
|
|
101
|
+
aria-expanded="false"
|
|
102
|
+
class="ui selection dropdown"
|
|
103
|
+
name="scope"
|
|
104
|
+
required=""
|
|
105
|
+
role="listbox"
|
|
106
|
+
tabindex="0"
|
|
107
|
+
>
|
|
108
|
+
<div
|
|
109
|
+
aria-atomic="true"
|
|
110
|
+
aria-live="polite"
|
|
111
|
+
class="divider default text"
|
|
112
|
+
role="alert"
|
|
113
|
+
>
|
|
114
|
+
Select scope...
|
|
115
|
+
</div>
|
|
116
|
+
<i
|
|
117
|
+
aria-hidden="true"
|
|
118
|
+
class="dropdown icon"
|
|
119
|
+
/>
|
|
120
|
+
<div
|
|
121
|
+
class="menu transition"
|
|
122
|
+
>
|
|
123
|
+
<div
|
|
124
|
+
aria-checked="false"
|
|
125
|
+
aria-selected="true"
|
|
126
|
+
class="selected item"
|
|
127
|
+
role="option"
|
|
128
|
+
style="pointer-events: all;"
|
|
129
|
+
>
|
|
130
|
+
<span
|
|
131
|
+
class="text"
|
|
132
|
+
>
|
|
133
|
+
Business Concept
|
|
134
|
+
</span>
|
|
135
|
+
</div>
|
|
136
|
+
<div
|
|
137
|
+
aria-checked="false"
|
|
138
|
+
aria-selected="false"
|
|
139
|
+
class="item"
|
|
140
|
+
role="option"
|
|
141
|
+
style="pointer-events: all;"
|
|
142
|
+
>
|
|
143
|
+
<span
|
|
144
|
+
class="text"
|
|
145
|
+
>
|
|
146
|
+
Data Catalog
|
|
147
|
+
</span>
|
|
148
|
+
</div>
|
|
149
|
+
<div
|
|
150
|
+
aria-checked="false"
|
|
151
|
+
aria-selected="false"
|
|
152
|
+
class="item"
|
|
153
|
+
role="option"
|
|
154
|
+
style="pointer-events: all;"
|
|
155
|
+
>
|
|
156
|
+
<span
|
|
157
|
+
class="text"
|
|
158
|
+
>
|
|
159
|
+
Data Request
|
|
160
|
+
</span>
|
|
161
|
+
</div>
|
|
162
|
+
<div
|
|
163
|
+
aria-checked="false"
|
|
164
|
+
aria-selected="false"
|
|
165
|
+
class="item"
|
|
166
|
+
role="option"
|
|
167
|
+
style="pointer-events: all;"
|
|
168
|
+
>
|
|
169
|
+
<span
|
|
170
|
+
class="text"
|
|
171
|
+
>
|
|
172
|
+
Grants
|
|
173
|
+
</span>
|
|
174
|
+
</div>
|
|
175
|
+
<div
|
|
176
|
+
aria-checked="false"
|
|
177
|
+
aria-selected="false"
|
|
178
|
+
class="item"
|
|
179
|
+
role="option"
|
|
180
|
+
style="pointer-events: all;"
|
|
181
|
+
>
|
|
182
|
+
<span
|
|
183
|
+
class="text"
|
|
184
|
+
>
|
|
185
|
+
Quality Executions
|
|
186
|
+
</span>
|
|
187
|
+
</div>
|
|
188
|
+
<div
|
|
189
|
+
aria-checked="false"
|
|
190
|
+
aria-selected="false"
|
|
191
|
+
class="item"
|
|
192
|
+
role="option"
|
|
193
|
+
style="pointer-events: all;"
|
|
194
|
+
>
|
|
195
|
+
<span
|
|
196
|
+
class="text"
|
|
197
|
+
>
|
|
198
|
+
Quality Implementation
|
|
199
|
+
</span>
|
|
200
|
+
</div>
|
|
201
|
+
<div
|
|
202
|
+
aria-checked="false"
|
|
203
|
+
aria-selected="false"
|
|
204
|
+
class="item"
|
|
205
|
+
role="option"
|
|
206
|
+
style="pointer-events: all;"
|
|
207
|
+
>
|
|
208
|
+
<span
|
|
209
|
+
class="text"
|
|
210
|
+
>
|
|
211
|
+
Quality Rule
|
|
212
|
+
</span>
|
|
213
|
+
</div>
|
|
214
|
+
<div
|
|
215
|
+
aria-checked="false"
|
|
216
|
+
aria-selected="false"
|
|
217
|
+
class="item"
|
|
218
|
+
role="option"
|
|
219
|
+
style="pointer-events: all;"
|
|
220
|
+
>
|
|
221
|
+
<span
|
|
222
|
+
class="text"
|
|
223
|
+
>
|
|
224
|
+
Remediation plan
|
|
225
|
+
</span>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
<div
|
|
232
|
+
class="ui horizontal divider"
|
|
233
|
+
>
|
|
234
|
+
<h4
|
|
235
|
+
class="ui header"
|
|
236
|
+
>
|
|
237
|
+
Field Groups
|
|
238
|
+
</h4>
|
|
239
|
+
</div>
|
|
240
|
+
<div
|
|
241
|
+
class="ui grid"
|
|
242
|
+
>
|
|
243
|
+
<div
|
|
244
|
+
class="four wide column"
|
|
245
|
+
>
|
|
246
|
+
<div
|
|
247
|
+
class="ui pointing vertical menu"
|
|
248
|
+
>
|
|
249
|
+
<a
|
|
250
|
+
class="item"
|
|
251
|
+
>
|
|
252
|
+
<i
|
|
253
|
+
aria-hidden="true"
|
|
254
|
+
class="square plus icon"
|
|
255
|
+
/>
|
|
256
|
+
Add Group
|
|
257
|
+
</a>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
<div
|
|
261
|
+
class="twelve wide column"
|
|
262
|
+
/>
|
|
263
|
+
</div>
|
|
264
|
+
<div
|
|
265
|
+
class="ui divider"
|
|
266
|
+
/>
|
|
267
|
+
<div
|
|
268
|
+
class="actions"
|
|
269
|
+
>
|
|
270
|
+
<button
|
|
271
|
+
class="ui negative button"
|
|
272
|
+
>
|
|
273
|
+
Delete
|
|
274
|
+
</button>
|
|
275
|
+
<button
|
|
276
|
+
class="ui primary button"
|
|
277
|
+
>
|
|
278
|
+
Save
|
|
279
|
+
</button>
|
|
280
|
+
</div>
|
|
281
|
+
</form>
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
33
284
|
`;
|
|
@@ -52,8 +52,8 @@ export const ActiveGroupForm = ({
|
|
|
52
52
|
|
|
53
53
|
const handleAddField = () => {
|
|
54
54
|
const newField = {
|
|
55
|
-
name:
|
|
56
|
-
label:
|
|
55
|
+
name: "new_field",
|
|
56
|
+
label: "New Field",
|
|
57
57
|
widget: "string",
|
|
58
58
|
cardinality: "?",
|
|
59
59
|
type: "string",
|
|
@@ -144,7 +144,7 @@ export const ActiveGroupForm = ({
|
|
|
144
144
|
/>
|
|
145
145
|
<Accordion
|
|
146
146
|
panels={_.map.convert({ cap: false })((field, i) => ({
|
|
147
|
-
key:
|
|
147
|
+
key: i,
|
|
148
148
|
title: {
|
|
149
149
|
content: (
|
|
150
150
|
<>
|
|
@@ -158,10 +158,11 @@ export const ActiveGroupForm = ({
|
|
|
158
158
|
)}
|
|
159
159
|
{field.label}
|
|
160
160
|
</Label>
|
|
161
|
-
{
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
{_.isEmpty(_.prop(field.name)(dependencies))
|
|
162
|
+
? null
|
|
163
|
+
: _.map(({ label, name }) => (
|
|
164
|
+
<Label key={name}>{label}</Label>
|
|
165
|
+
))(_.prop(field.name)(dependencies))}
|
|
165
166
|
</>
|
|
166
167
|
),
|
|
167
168
|
},
|
|
@@ -11,15 +11,23 @@ const fieldsToOptions = (fields, fieldName) =>
|
|
|
11
11
|
(f) =>
|
|
12
12
|
!nilOrEmpty(_.pathOr([], "values.fixed")(f)) && f.name !== fieldName
|
|
13
13
|
),
|
|
14
|
-
_.map(
|
|
14
|
+
_.map.convert({ cap: false })(({ label: text, name: value }, key) => ({
|
|
15
|
+
text,
|
|
16
|
+
value,
|
|
17
|
+
key: key,
|
|
18
|
+
}))
|
|
15
19
|
)(fields);
|
|
16
20
|
const valuesToOptions = (fields, value) =>
|
|
17
21
|
value !== ""
|
|
18
22
|
? _.flow(
|
|
19
|
-
_.find(
|
|
23
|
+
_.find({ name: value }),
|
|
20
24
|
_.propOr([], "values.fixed"),
|
|
21
|
-
_.
|
|
22
|
-
_.map(
|
|
25
|
+
_.reject(_.isNil),
|
|
26
|
+
_.map.convert({ cap: false })((v, key) => ({
|
|
27
|
+
text: v,
|
|
28
|
+
value: v,
|
|
29
|
+
key,
|
|
30
|
+
}))
|
|
23
31
|
)(fields)
|
|
24
32
|
: [];
|
|
25
33
|
|
|
@@ -7,7 +7,7 @@ export const GroupsList = ({
|
|
|
7
7
|
groups,
|
|
8
8
|
activeGroup,
|
|
9
9
|
onAddGroup,
|
|
10
|
-
onSelectGroup
|
|
10
|
+
onSelectGroup,
|
|
11
11
|
}) => {
|
|
12
12
|
const { formatMessage } = useIntl();
|
|
13
13
|
return (
|
|
@@ -38,7 +38,7 @@ GroupsList.propTypes = {
|
|
|
38
38
|
onAddGroup: PropTypes.func.isRequired,
|
|
39
39
|
onSelectGroup: PropTypes.func.isRequired,
|
|
40
40
|
groups: PropTypes.array,
|
|
41
|
-
activeGroup: PropTypes.number
|
|
41
|
+
activeGroup: PropTypes.number,
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export default GroupsList;
|
|
@@ -26,7 +26,7 @@ describe("utils: parseFieldOptions", () => {
|
|
|
26
26
|
expect(result).toEqual({
|
|
27
27
|
...field,
|
|
28
28
|
value: "1",
|
|
29
|
-
|
|
29
|
+
parsedValues: [
|
|
30
30
|
{ text: "1", value: "1" },
|
|
31
31
|
{ text: "3", value: "3" },
|
|
32
32
|
],
|
|
@@ -45,7 +45,7 @@ describe("utils: parseFieldOptions", () => {
|
|
|
45
45
|
expect(result).toEqual({
|
|
46
46
|
...field,
|
|
47
47
|
value: "b",
|
|
48
|
-
|
|
48
|
+
parsedValues: [
|
|
49
49
|
{ text: "a", value: "a" },
|
|
50
50
|
{ text: "b", value: "b" },
|
|
51
51
|
{ text: "c", value: "c" },
|
|
@@ -68,7 +68,7 @@ describe("utils: parseFieldOptions", () => {
|
|
|
68
68
|
expect(result).toEqual({
|
|
69
69
|
...field,
|
|
70
70
|
value: "a",
|
|
71
|
-
|
|
71
|
+
parsedValues: [
|
|
72
72
|
{ text: "a", value: "a" },
|
|
73
73
|
{ text: "b", value: "b" },
|
|
74
74
|
],
|
|
@@ -88,7 +88,7 @@ describe("utils: parseFieldOptions", () => {
|
|
|
88
88
|
expect(result).toEqual({
|
|
89
89
|
...field,
|
|
90
90
|
value: "y",
|
|
91
|
-
|
|
91
|
+
parsedValues: [
|
|
92
92
|
{ text: "x", value: "x" },
|
|
93
93
|
{ text: "y", value: "y" },
|
|
94
94
|
{ text: "z", value: "z" },
|
|
@@ -111,7 +111,7 @@ describe("utils: parseFieldOptions", () => {
|
|
|
111
111
|
expect(result).toEqual({
|
|
112
112
|
...field,
|
|
113
113
|
value: "bar",
|
|
114
|
-
|
|
114
|
+
parsedValues: [
|
|
115
115
|
{ text: "foo", value: "foo" },
|
|
116
116
|
{ text: "bar", value: "bar" },
|
|
117
117
|
],
|
|
@@ -30,6 +30,7 @@ describe("utils: parseGroups", () => {
|
|
|
30
30
|
},
|
|
31
31
|
]);
|
|
32
32
|
});
|
|
33
|
+
|
|
33
34
|
it("omits fields", () => {
|
|
34
35
|
const template = {
|
|
35
36
|
content: [
|
|
@@ -49,6 +50,7 @@ describe("utils: parseGroups", () => {
|
|
|
49
50
|
},
|
|
50
51
|
]);
|
|
51
52
|
});
|
|
53
|
+
|
|
52
54
|
it("hides dependant fields and parses values", () => {
|
|
53
55
|
const template = {
|
|
54
56
|
content: [
|
|
@@ -70,7 +72,7 @@ describe("utils: parseGroups", () => {
|
|
|
70
72
|
fields: [
|
|
71
73
|
{
|
|
72
74
|
name: "parent",
|
|
73
|
-
|
|
75
|
+
parsedValues: [
|
|
74
76
|
{ text: "a", value: "a" },
|
|
75
77
|
{ text: "b", value: "b" },
|
|
76
78
|
],
|
|
@@ -89,6 +91,7 @@ describe("utils: parseGroups", () => {
|
|
|
89
91
|
},
|
|
90
92
|
]);
|
|
91
93
|
});
|
|
94
|
+
|
|
92
95
|
it("hides dependant fields of multiple values", () => {
|
|
93
96
|
const template = {
|
|
94
97
|
content: [
|
|
@@ -109,7 +112,7 @@ describe("utils: parseGroups", () => {
|
|
|
109
112
|
fields: [
|
|
110
113
|
{
|
|
111
114
|
name: "parent",
|
|
112
|
-
|
|
115
|
+
parsedValues: [
|
|
113
116
|
{ text: "a", value: "a" },
|
|
114
117
|
{ text: "b", value: "b" },
|
|
115
118
|
{ text: "c", value: "c" },
|
|
@@ -123,6 +126,7 @@ describe("utils: parseGroups", () => {
|
|
|
123
126
|
},
|
|
124
127
|
]);
|
|
125
128
|
});
|
|
129
|
+
|
|
126
130
|
it("hides fields of switch type", () => {
|
|
127
131
|
const template = {
|
|
128
132
|
content: [
|
|
@@ -154,7 +158,7 @@ describe("utils: parseGroups", () => {
|
|
|
154
158
|
fields: [
|
|
155
159
|
{
|
|
156
160
|
name: "parent",
|
|
157
|
-
|
|
161
|
+
parsedValues: [
|
|
158
162
|
{ text: "a", value: "a" },
|
|
159
163
|
{ text: "b", value: "b" },
|
|
160
164
|
],
|
|
@@ -167,7 +171,7 @@ describe("utils: parseGroups", () => {
|
|
|
167
171
|
values: {
|
|
168
172
|
switch: { on: "parent", values: { b: "1" } },
|
|
169
173
|
},
|
|
170
|
-
|
|
174
|
+
parsedValues: [{ text: "1", value: "1" }],
|
|
171
175
|
value: "1",
|
|
172
176
|
required: false,
|
|
173
177
|
},
|
|
@@ -176,6 +180,7 @@ describe("utils: parseGroups", () => {
|
|
|
176
180
|
},
|
|
177
181
|
]);
|
|
178
182
|
});
|
|
183
|
+
|
|
179
184
|
it("filters groups without fields", () => {
|
|
180
185
|
const template = {
|
|
181
186
|
content: [
|
|
@@ -195,6 +200,7 @@ describe("utils: parseGroups", () => {
|
|
|
195
200
|
},
|
|
196
201
|
]);
|
|
197
202
|
});
|
|
203
|
+
|
|
198
204
|
it("enriches isSecret", () => {
|
|
199
205
|
const template = {
|
|
200
206
|
content: [
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
+
|
|
2
3
|
const stringToValueTextList = _.map((v) => ({ value: v, text: v }));
|
|
3
4
|
|
|
4
|
-
const parseFieldOptions = (content, selectedDomain) => (field) => {
|
|
5
|
+
export const parseFieldOptions = (content, selectedDomain) => (field) => {
|
|
5
6
|
const value = _.prop(field?.name)(content);
|
|
6
7
|
if (!field?.values) return { ...field, value };
|
|
7
8
|
|
|
@@ -44,7 +45,7 @@ const parseFieldOptions = (content, selectedDomain) => (field) => {
|
|
|
44
45
|
stringToValueTextList
|
|
45
46
|
);
|
|
46
47
|
|
|
47
|
-
const
|
|
48
|
+
const parsedValues = _.flow(
|
|
48
49
|
_.get("values"),
|
|
49
50
|
_.cond([
|
|
50
51
|
[_.has("switch"), parseSwitch],
|
|
@@ -55,7 +56,5 @@ const parseFieldOptions = (content, selectedDomain) => (field) => {
|
|
|
55
56
|
[_.has("domain"), parseDomain],
|
|
56
57
|
])
|
|
57
58
|
)(field);
|
|
58
|
-
return { ...field, value,
|
|
59
|
+
return { ...field, value, parsedValues };
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
-
export { parseFieldOptions };
|
|
@@ -17,13 +17,13 @@ const checkDependency = (field, content) => {
|
|
|
17
17
|
const enrichIsSecret = (isSecret) => (field) =>
|
|
18
18
|
isSecret ? { ...field, isSecret } : field;
|
|
19
19
|
|
|
20
|
-
const parseGroups = (template, content, fieldsToOmit, selectedDomain) =>
|
|
20
|
+
export const parseGroups = (template, content, fieldsToOmit, selectedDomain) =>
|
|
21
21
|
_.flow(
|
|
22
22
|
_.getOr([], "content"),
|
|
23
23
|
_.map((group) => {
|
|
24
24
|
const fields = _.flow(
|
|
25
25
|
_.get("fields"),
|
|
26
|
-
_.
|
|
26
|
+
_.reject((field) => _.includes(fieldsToOmit)(field?.name)),
|
|
27
27
|
_.filter(
|
|
28
28
|
(field) =>
|
|
29
29
|
(!("depends" in field) ||
|
|
@@ -40,4 +40,3 @@ const parseGroups = (template, content, fieldsToOmit, selectedDomain) =>
|
|
|
40
40
|
}),
|
|
41
41
|
_.filter(({ fields }) => _.negate(_.isEmpty)(fields))
|
|
42
42
|
)(template);
|
|
43
|
-
export { parseGroups };
|