@truedat/bg 7.2.11 → 7.3.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 +6 -6
- package/src/concepts/components/ConceptCompleteness.js +51 -27
- package/src/concepts/components/ConceptCreate.js +30 -40
- package/src/concepts/components/ConceptEdit.js +17 -24
- package/src/concepts/components/ConceptForm.js +259 -97
- package/src/concepts/components/__tests__/ConceptForm.spec.js +4 -6
- package/src/concepts/components/__tests__/__snapshots__/ConceptEdit.spec.js.snap +105 -98
- package/src/concepts/components/__tests__/__snapshots__/ConceptForm.spec.js.snap +283 -143
- package/src/concepts/components/ConceptFormTabs.js +0 -75
- package/src/concepts/components/ConceptForms.js +0 -200
|
@@ -2,216 +2,356 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`<ConceptForm /> with multiple templates matches the latest snapshot 1`] = `
|
|
4
4
|
<div>
|
|
5
|
+
<h2
|
|
6
|
+
class="ui header"
|
|
7
|
+
style=""
|
|
8
|
+
>
|
|
9
|
+
<i
|
|
10
|
+
aria-hidden="true"
|
|
11
|
+
class="book icon"
|
|
12
|
+
/>
|
|
13
|
+
<div
|
|
14
|
+
class="content"
|
|
15
|
+
>
|
|
16
|
+
New Concept
|
|
17
|
+
</div>
|
|
18
|
+
</h2>
|
|
5
19
|
<form
|
|
6
20
|
class="ui form"
|
|
7
21
|
style=""
|
|
8
22
|
>
|
|
9
23
|
<div
|
|
10
|
-
class="
|
|
24
|
+
class="ui grid"
|
|
11
25
|
>
|
|
12
|
-
<label>
|
|
13
|
-
Domain
|
|
14
|
-
</label>
|
|
15
26
|
<div
|
|
16
|
-
|
|
17
|
-
aria-expanded="false"
|
|
18
|
-
aria-multiselectable="false"
|
|
19
|
-
class="ui disabled floating dropdown"
|
|
20
|
-
required=""
|
|
21
|
-
role="listbox"
|
|
22
|
-
tabindex="-1"
|
|
27
|
+
class="two column row"
|
|
23
28
|
>
|
|
24
29
|
<div
|
|
25
|
-
class="
|
|
26
|
-
>
|
|
27
|
-
fooDomain
|
|
28
|
-
</div>
|
|
29
|
-
<i
|
|
30
|
-
aria-hidden="true"
|
|
31
|
-
class="dropdown icon"
|
|
32
|
-
/>
|
|
33
|
-
<div
|
|
34
|
-
class="menu transition"
|
|
30
|
+
class="column"
|
|
35
31
|
>
|
|
36
32
|
<div
|
|
37
|
-
class="
|
|
38
|
-
>
|
|
39
|
-
<input
|
|
40
|
-
type="text"
|
|
41
|
-
/>
|
|
42
|
-
<i
|
|
43
|
-
aria-hidden="true"
|
|
44
|
-
class="search icon"
|
|
45
|
-
/>
|
|
46
|
-
</div>
|
|
47
|
-
<div
|
|
48
|
-
class="scrolling menu transition"
|
|
33
|
+
class="required field fix-dropdown-selector "
|
|
49
34
|
>
|
|
35
|
+
<label>
|
|
36
|
+
Domain
|
|
37
|
+
</label>
|
|
50
38
|
<div
|
|
51
|
-
aria-
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
aria-disabled="false"
|
|
40
|
+
aria-expanded="false"
|
|
41
|
+
aria-multiselectable="false"
|
|
42
|
+
class="ui floating dropdown"
|
|
43
|
+
required=""
|
|
44
|
+
role="listbox"
|
|
45
|
+
tabindex="0"
|
|
54
46
|
>
|
|
55
47
|
<div
|
|
56
|
-
class="
|
|
57
|
-
style="margin-left: 0px; padding-left: 5px;"
|
|
48
|
+
class="ui label"
|
|
58
49
|
>
|
|
50
|
+
fooDomain
|
|
59
51
|
<i
|
|
60
52
|
aria-hidden="true"
|
|
61
|
-
class="
|
|
53
|
+
class="delete icon"
|
|
62
54
|
/>
|
|
63
|
-
<span
|
|
64
|
-
style="opacity: 1;"
|
|
65
|
-
title="barDomain"
|
|
66
|
-
>
|
|
67
|
-
barDomain
|
|
68
|
-
</span>
|
|
69
55
|
</div>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
role="option"
|
|
75
|
-
>
|
|
56
|
+
<i
|
|
57
|
+
aria-hidden="true"
|
|
58
|
+
class="dropdown icon"
|
|
59
|
+
/>
|
|
76
60
|
<div
|
|
77
|
-
class="
|
|
78
|
-
style="margin-left: 0px; padding-left: 25px;"
|
|
61
|
+
class="menu transition"
|
|
79
62
|
>
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
63
|
+
<div
|
|
64
|
+
class="ui fluid left icon input search "
|
|
65
|
+
>
|
|
66
|
+
<input
|
|
67
|
+
type="text"
|
|
68
|
+
/>
|
|
69
|
+
<i
|
|
70
|
+
aria-hidden="true"
|
|
71
|
+
class="search icon"
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
<div
|
|
75
|
+
class="scrolling menu transition"
|
|
83
76
|
>
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
<div
|
|
78
|
+
aria-selected="false"
|
|
79
|
+
class="item"
|
|
80
|
+
role="option"
|
|
81
|
+
>
|
|
82
|
+
<div
|
|
83
|
+
class="item-content"
|
|
84
|
+
style="margin-left: 0px; padding-left: 5px;"
|
|
85
|
+
>
|
|
86
|
+
<i
|
|
87
|
+
aria-hidden="true"
|
|
88
|
+
class="chevron right icon"
|
|
89
|
+
/>
|
|
90
|
+
<span
|
|
91
|
+
style="opacity: 1;"
|
|
92
|
+
title="barDomain"
|
|
93
|
+
>
|
|
94
|
+
barDomain
|
|
95
|
+
</span>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<div
|
|
99
|
+
aria-selected="false"
|
|
100
|
+
class="item"
|
|
101
|
+
role="option"
|
|
102
|
+
>
|
|
103
|
+
<div
|
|
104
|
+
class="item-content"
|
|
105
|
+
style="margin-left: 0px; padding-left: 25px;"
|
|
106
|
+
>
|
|
107
|
+
<span
|
|
108
|
+
style="opacity: 1;"
|
|
109
|
+
title="bazDomain"
|
|
110
|
+
>
|
|
111
|
+
bazDomain
|
|
112
|
+
</span>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
<div
|
|
116
|
+
aria-selected="true"
|
|
117
|
+
class="selected item"
|
|
118
|
+
role="option"
|
|
119
|
+
>
|
|
120
|
+
<div
|
|
121
|
+
class="item-content"
|
|
122
|
+
style="margin-left: 0px; padding-left: 25px;"
|
|
123
|
+
>
|
|
124
|
+
<span
|
|
125
|
+
style="opacity: 1;"
|
|
126
|
+
title="fooDomain"
|
|
127
|
+
>
|
|
128
|
+
fooDomain
|
|
129
|
+
</span>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
86
133
|
</div>
|
|
87
134
|
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
<div
|
|
138
|
+
class="column"
|
|
139
|
+
/>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<div
|
|
143
|
+
class="ui grid"
|
|
144
|
+
style="display: block;"
|
|
145
|
+
>
|
|
146
|
+
<div
|
|
147
|
+
class="two column row"
|
|
148
|
+
>
|
|
149
|
+
<div
|
|
150
|
+
class="column"
|
|
151
|
+
>
|
|
152
|
+
<div
|
|
153
|
+
class="required field"
|
|
154
|
+
>
|
|
155
|
+
<label>
|
|
156
|
+
Template
|
|
157
|
+
<div
|
|
158
|
+
class="ui left pointing label"
|
|
159
|
+
>
|
|
160
|
+
Empty required field
|
|
161
|
+
</div>
|
|
162
|
+
</label>
|
|
88
163
|
<div
|
|
89
|
-
|
|
90
|
-
class="selected item"
|
|
91
|
-
role="option"
|
|
164
|
+
class="field"
|
|
92
165
|
>
|
|
93
166
|
<div
|
|
94
|
-
|
|
95
|
-
|
|
167
|
+
aria-busy="false"
|
|
168
|
+
aria-expanded="false"
|
|
169
|
+
class="ui search selection dropdown"
|
|
170
|
+
name="template"
|
|
171
|
+
role="combobox"
|
|
96
172
|
>
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
173
|
+
<input
|
|
174
|
+
aria-autocomplete="list"
|
|
175
|
+
autocomplete="off"
|
|
176
|
+
class="search"
|
|
177
|
+
tabindex="0"
|
|
178
|
+
type="text"
|
|
179
|
+
value=""
|
|
180
|
+
/>
|
|
181
|
+
<div
|
|
182
|
+
aria-atomic="true"
|
|
183
|
+
aria-live="polite"
|
|
184
|
+
class="divider default text"
|
|
185
|
+
role="alert"
|
|
186
|
+
>
|
|
187
|
+
Select a template...
|
|
188
|
+
</div>
|
|
189
|
+
<i
|
|
190
|
+
aria-hidden="true"
|
|
191
|
+
class="dropdown icon"
|
|
192
|
+
/>
|
|
193
|
+
<div
|
|
194
|
+
class="menu transition"
|
|
195
|
+
role="listbox"
|
|
100
196
|
>
|
|
101
|
-
|
|
102
|
-
|
|
197
|
+
<div
|
|
198
|
+
aria-checked="false"
|
|
199
|
+
aria-selected="true"
|
|
200
|
+
class="selected item"
|
|
201
|
+
role="option"
|
|
202
|
+
style="pointer-events: all;"
|
|
203
|
+
>
|
|
204
|
+
<span
|
|
205
|
+
class="text"
|
|
206
|
+
>
|
|
207
|
+
template1
|
|
208
|
+
</span>
|
|
209
|
+
</div>
|
|
210
|
+
<div
|
|
211
|
+
aria-checked="false"
|
|
212
|
+
aria-selected="false"
|
|
213
|
+
class="item"
|
|
214
|
+
role="option"
|
|
215
|
+
style="pointer-events: all;"
|
|
216
|
+
>
|
|
217
|
+
<span
|
|
218
|
+
class="text"
|
|
219
|
+
>
|
|
220
|
+
template2
|
|
221
|
+
</span>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
103
224
|
</div>
|
|
104
225
|
</div>
|
|
105
226
|
</div>
|
|
106
227
|
</div>
|
|
228
|
+
<div
|
|
229
|
+
class="column"
|
|
230
|
+
/>
|
|
107
231
|
</div>
|
|
108
232
|
</div>
|
|
109
233
|
<div
|
|
110
|
-
class="
|
|
234
|
+
class="ui grid"
|
|
235
|
+
style="background: white;"
|
|
111
236
|
>
|
|
112
|
-
<
|
|
113
|
-
|
|
237
|
+
<div
|
|
238
|
+
class="two column row"
|
|
239
|
+
>
|
|
114
240
|
<div
|
|
115
|
-
class="
|
|
241
|
+
class="column"
|
|
116
242
|
>
|
|
117
|
-
|
|
243
|
+
<div
|
|
244
|
+
attached="top"
|
|
245
|
+
>
|
|
246
|
+
<div
|
|
247
|
+
class="ui attached tabular menu"
|
|
248
|
+
>
|
|
249
|
+
<a
|
|
250
|
+
class="active item"
|
|
251
|
+
>
|
|
252
|
+
English
|
|
253
|
+
</a>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
118
256
|
</div>
|
|
119
|
-
</label>
|
|
120
|
-
<div
|
|
121
|
-
class="field"
|
|
122
|
-
>
|
|
123
257
|
<div
|
|
124
|
-
class="
|
|
258
|
+
class="column"
|
|
125
259
|
>
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
260
|
+
<div
|
|
261
|
+
attached="top"
|
|
262
|
+
class="attached-tab"
|
|
263
|
+
>
|
|
264
|
+
<div
|
|
265
|
+
class="ui attached tabular menu"
|
|
266
|
+
>
|
|
267
|
+
<a
|
|
268
|
+
class="item"
|
|
269
|
+
>
|
|
270
|
+
Spanish
|
|
271
|
+
</a>
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
131
274
|
</div>
|
|
132
275
|
</div>
|
|
133
276
|
</div>
|
|
134
277
|
<div
|
|
135
|
-
class="
|
|
278
|
+
class="ui bottom attached segment attached-segment"
|
|
136
279
|
>
|
|
137
|
-
<label>
|
|
138
|
-
Template
|
|
139
|
-
<div
|
|
140
|
-
class="ui left pointing label"
|
|
141
|
-
>
|
|
142
|
-
Empty required field
|
|
143
|
-
</div>
|
|
144
|
-
</label>
|
|
145
280
|
<div
|
|
146
|
-
class="
|
|
281
|
+
class="ui grid translation-tabs-grid"
|
|
147
282
|
>
|
|
148
283
|
<div
|
|
149
|
-
|
|
150
|
-
aria-disabled="true"
|
|
151
|
-
aria-expanded="false"
|
|
152
|
-
class="ui disabled search selection dropdown"
|
|
153
|
-
name="template"
|
|
154
|
-
role="combobox"
|
|
284
|
+
class="two column row"
|
|
155
285
|
>
|
|
156
|
-
<input
|
|
157
|
-
aria-autocomplete="list"
|
|
158
|
-
autocomplete="off"
|
|
159
|
-
class="search"
|
|
160
|
-
tabindex="-1"
|
|
161
|
-
type="text"
|
|
162
|
-
value=""
|
|
163
|
-
/>
|
|
164
|
-
<div
|
|
165
|
-
aria-atomic="true"
|
|
166
|
-
aria-live="polite"
|
|
167
|
-
class="divider default text"
|
|
168
|
-
role="alert"
|
|
169
|
-
>
|
|
170
|
-
Select a template...
|
|
171
|
-
</div>
|
|
172
|
-
<i
|
|
173
|
-
aria-hidden="true"
|
|
174
|
-
class="dropdown icon"
|
|
175
|
-
/>
|
|
176
286
|
<div
|
|
177
|
-
class="
|
|
178
|
-
role="listbox"
|
|
287
|
+
class="column"
|
|
179
288
|
>
|
|
180
289
|
<div
|
|
181
|
-
|
|
182
|
-
aria-selected="true"
|
|
183
|
-
class="selected item"
|
|
184
|
-
role="option"
|
|
185
|
-
style="pointer-events: all;"
|
|
290
|
+
class="required field"
|
|
186
291
|
>
|
|
187
|
-
<
|
|
188
|
-
|
|
292
|
+
<label>
|
|
293
|
+
concepts.props.name
|
|
294
|
+
</label>
|
|
295
|
+
<div
|
|
296
|
+
class="field"
|
|
189
297
|
>
|
|
190
|
-
|
|
191
|
-
|
|
298
|
+
<div
|
|
299
|
+
class="ui input"
|
|
300
|
+
>
|
|
301
|
+
<input
|
|
302
|
+
name="name"
|
|
303
|
+
type="text"
|
|
304
|
+
value=""
|
|
305
|
+
/>
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
192
308
|
</div>
|
|
309
|
+
</div>
|
|
310
|
+
<div
|
|
311
|
+
class="column"
|
|
312
|
+
>
|
|
193
313
|
<div
|
|
194
|
-
|
|
195
|
-
aria-selected="false"
|
|
196
|
-
class="item"
|
|
197
|
-
role="option"
|
|
198
|
-
style="pointer-events: all;"
|
|
314
|
+
class="field"
|
|
199
315
|
>
|
|
200
|
-
<
|
|
201
|
-
|
|
316
|
+
<label>
|
|
317
|
+
concepts.props.name
|
|
318
|
+
</label>
|
|
319
|
+
<div
|
|
320
|
+
class="field"
|
|
202
321
|
>
|
|
203
|
-
|
|
204
|
-
|
|
322
|
+
<div
|
|
323
|
+
class="ui input"
|
|
324
|
+
>
|
|
325
|
+
<input
|
|
326
|
+
name="name"
|
|
327
|
+
type="text"
|
|
328
|
+
value=""
|
|
329
|
+
/>
|
|
330
|
+
</div>
|
|
331
|
+
</div>
|
|
205
332
|
</div>
|
|
206
333
|
</div>
|
|
207
334
|
</div>
|
|
208
335
|
</div>
|
|
209
336
|
</div>
|
|
210
|
-
<
|
|
211
|
-
class="
|
|
337
|
+
<div
|
|
338
|
+
class="concept-forms-actions actions"
|
|
212
339
|
>
|
|
213
|
-
|
|
214
|
-
|
|
340
|
+
<a
|
|
341
|
+
class="ui secondary button"
|
|
342
|
+
href="/"
|
|
343
|
+
role="button"
|
|
344
|
+
>
|
|
345
|
+
Cancel
|
|
346
|
+
</a>
|
|
347
|
+
<button
|
|
348
|
+
class="ui primary disabled button"
|
|
349
|
+
disabled=""
|
|
350
|
+
tabindex="-1"
|
|
351
|
+
>
|
|
352
|
+
Create
|
|
353
|
+
</button>
|
|
354
|
+
</div>
|
|
215
355
|
</form>
|
|
216
356
|
</div>
|
|
217
357
|
`;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import { Grid, Tab } from "semantic-ui-react";
|
|
5
|
-
import { useIntl } from "react-intl";
|
|
6
|
-
import ConceptForm from "./ConceptForm";
|
|
7
|
-
|
|
8
|
-
const ConceptFormTabs = ({
|
|
9
|
-
domainId,
|
|
10
|
-
template,
|
|
11
|
-
langs,
|
|
12
|
-
conceptActionLoading,
|
|
13
|
-
i18nConcept,
|
|
14
|
-
noTranslatableFields = [],
|
|
15
|
-
actionKey,
|
|
16
|
-
onChangeDomainId,
|
|
17
|
-
onChangeName,
|
|
18
|
-
onChangeTemplate,
|
|
19
|
-
onChangeConceptContent,
|
|
20
|
-
}) => {
|
|
21
|
-
const { formatMessage } = useIntl();
|
|
22
|
-
|
|
23
|
-
const defaultContent = _.flow(
|
|
24
|
-
_.find("is_default"),
|
|
25
|
-
_.get("content"),
|
|
26
|
-
_.pickBy((_value, key) => _.includes(key)(noTranslatableFields))
|
|
27
|
-
)(i18nConcept);
|
|
28
|
-
|
|
29
|
-
const panes = _.map((locale) => {
|
|
30
|
-
const { lang, name, local_name, is_required, is_default } = locale;
|
|
31
|
-
return {
|
|
32
|
-
menuItem: `${formatMessage({
|
|
33
|
-
id: `i18n.messages.locale.${lang}`,
|
|
34
|
-
defaultMessage: `${name} ( ${local_name} )`,
|
|
35
|
-
})} ${is_required && !is_default ? "*" : ""}`,
|
|
36
|
-
render: () => (
|
|
37
|
-
<ConceptForm
|
|
38
|
-
domainId={domainId}
|
|
39
|
-
template={template}
|
|
40
|
-
concept={i18nConcept[lang]}
|
|
41
|
-
defaultContent={defaultContent}
|
|
42
|
-
noTranslatableFields={noTranslatableFields}
|
|
43
|
-
onChangeDomainId={onChangeDomainId}
|
|
44
|
-
onChangeName={onChangeName}
|
|
45
|
-
onChangeTemplate={onChangeTemplate}
|
|
46
|
-
onChangeConceptContent={onChangeConceptContent}
|
|
47
|
-
actionKey={actionKey}
|
|
48
|
-
conceptActionLoading={conceptActionLoading}
|
|
49
|
-
/>
|
|
50
|
-
),
|
|
51
|
-
};
|
|
52
|
-
})(langs);
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<Grid.Column>
|
|
56
|
-
<Tab className="concept-forms-tab" panes={panes} />
|
|
57
|
-
</Grid.Column>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
ConceptFormTabs.propTypes = {
|
|
62
|
-
domainId: PropTypes.number,
|
|
63
|
-
template: PropTypes.object,
|
|
64
|
-
langs: PropTypes.object,
|
|
65
|
-
actionKey: PropTypes.string,
|
|
66
|
-
conceptActionLoading: PropTypes.string,
|
|
67
|
-
i18nConcept: PropTypes.object,
|
|
68
|
-
noTranslatableFields: PropTypes.arrayOf(PropTypes.string),
|
|
69
|
-
onChangeDomainId: PropTypes.func,
|
|
70
|
-
onChangeName: PropTypes.func,
|
|
71
|
-
onChangeTemplate: PropTypes.func,
|
|
72
|
-
onChangeConceptContent: PropTypes.func,
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export default ConceptFormTabs;
|