@truedat/df 6.1.4 → 6.2.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": "@truedat/df",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@testing-library/jest-dom": "^5.16.5",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "6.
|
|
37
|
+
"@truedat/test": "6.2.0",
|
|
38
38
|
"babel-jest": "^28.1.0",
|
|
39
39
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
40
40
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@apollo/client": "^3.7.1",
|
|
90
|
-
"@truedat/auth": "6.
|
|
91
|
-
"@truedat/core": "6.
|
|
90
|
+
"@truedat/auth": "6.2.0",
|
|
91
|
+
"@truedat/core": "6.2.0",
|
|
92
92
|
"decode-uri-component": "^0.2.2",
|
|
93
93
|
"path-to-regexp": "^1.7.0",
|
|
94
94
|
"prop-types": "^15.8.1",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"react-dom": ">= 16.8.6 < 17",
|
|
110
110
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "5c10ee429997ab081477edf0679547eb4bc11f9b"
|
|
113
113
|
}
|
|
@@ -16,6 +16,7 @@ export const DynamicForm = ({
|
|
|
16
16
|
onChange,
|
|
17
17
|
selectedDomain,
|
|
18
18
|
template,
|
|
19
|
+
noTranslatableFields,
|
|
19
20
|
}) => {
|
|
20
21
|
const { formatMessage } = useIntl();
|
|
21
22
|
const domainId = selectedDomain?.id;
|
|
@@ -51,7 +52,6 @@ export const DynamicForm = ({
|
|
|
51
52
|
return parsedGroups.map(({ name, fields }, i) => (
|
|
52
53
|
<FieldGroupSegment
|
|
53
54
|
key={i}
|
|
54
|
-
onFieldChange={handleChange}
|
|
55
55
|
name={
|
|
56
56
|
name
|
|
57
57
|
? formatMessage({
|
|
@@ -60,8 +60,10 @@ export const DynamicForm = ({
|
|
|
60
60
|
})
|
|
61
61
|
: null
|
|
62
62
|
}
|
|
63
|
+
noTranslatableFields={noTranslatableFields}
|
|
63
64
|
scope={template?.scope}
|
|
64
65
|
fields={fields}
|
|
66
|
+
onFieldChange={handleChange}
|
|
65
67
|
isModification={isModification}
|
|
66
68
|
/>
|
|
67
69
|
));
|
|
@@ -76,6 +78,7 @@ DynamicForm.propTypes = {
|
|
|
76
78
|
onChange: PropTypes.func,
|
|
77
79
|
selectedDomain: PropTypes.object,
|
|
78
80
|
template: PropTypes.object,
|
|
81
|
+
noTranslatableFields: PropTypes.array,
|
|
79
82
|
};
|
|
80
83
|
|
|
81
84
|
const makeMapStateToProps = () => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import PropTypes from "prop-types";
|
|
3
4
|
import { Segment, Header } from "semantic-ui-react";
|
|
@@ -9,6 +10,7 @@ export const FieldGroupSegment = ({
|
|
|
9
10
|
fields,
|
|
10
11
|
isModification,
|
|
11
12
|
name,
|
|
13
|
+
noTranslatableFields,
|
|
12
14
|
onFieldChange,
|
|
13
15
|
}) => (
|
|
14
16
|
<Segment>
|
|
@@ -26,7 +28,10 @@ export const FieldGroupSegment = ({
|
|
|
26
28
|
) : (
|
|
27
29
|
<DynamicField
|
|
28
30
|
scope={scope}
|
|
29
|
-
field={
|
|
31
|
+
field={{
|
|
32
|
+
...field,
|
|
33
|
+
disabled: _.includes(field.name)(noTranslatableFields),
|
|
34
|
+
}}
|
|
30
35
|
fields={fields}
|
|
31
36
|
isModification={isModification}
|
|
32
37
|
key={i}
|
|
@@ -43,6 +48,7 @@ FieldGroupSegment.propTypes = {
|
|
|
43
48
|
name: PropTypes.string,
|
|
44
49
|
onFieldChange: PropTypes.func,
|
|
45
50
|
scope: PropTypes.string,
|
|
51
|
+
noTranslatableFields: PropTypes.array,
|
|
46
52
|
};
|
|
47
53
|
|
|
48
54
|
export default FieldGroupSegment;
|
|
@@ -12,6 +12,8 @@ export default function SelectableDynamicForm({
|
|
|
12
12
|
hideLabel,
|
|
13
13
|
isModification,
|
|
14
14
|
name,
|
|
15
|
+
noTranslatableFields,
|
|
16
|
+
actionKey,
|
|
15
17
|
onChange,
|
|
16
18
|
onNameChange,
|
|
17
19
|
onTemplateChange = () => {},
|
|
@@ -19,8 +21,11 @@ export default function SelectableDynamicForm({
|
|
|
19
21
|
required,
|
|
20
22
|
scope,
|
|
21
23
|
disabled,
|
|
24
|
+
disableSelector,
|
|
25
|
+
selectedTemplate,
|
|
22
26
|
}) {
|
|
23
|
-
const [
|
|
27
|
+
const [thisTemplate, setThisTemplate] = useState();
|
|
28
|
+
const template = selectedTemplate || thisTemplate;
|
|
24
29
|
const domain = _.size(domainIds) > 0 ? { id: _.head(domainIds) } : null;
|
|
25
30
|
|
|
26
31
|
const handleChange = (content, currentTemplate = template) => {
|
|
@@ -41,7 +46,7 @@ export default function SelectableDynamicForm({
|
|
|
41
46
|
template ? applyTemplate(template)(content, domain?.id) : {},
|
|
42
47
|
template
|
|
43
48
|
);
|
|
44
|
-
|
|
49
|
+
setThisTemplate(template);
|
|
45
50
|
};
|
|
46
51
|
|
|
47
52
|
const handleSelected = (_e, { template }) => {
|
|
@@ -51,31 +56,35 @@ export default function SelectableDynamicForm({
|
|
|
51
56
|
template ? applyTemplate(template)(content, domain?.id) : {},
|
|
52
57
|
template
|
|
53
58
|
);
|
|
54
|
-
|
|
59
|
+
setThisTemplate(template);
|
|
55
60
|
};
|
|
56
61
|
|
|
57
62
|
return (
|
|
58
63
|
<>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
{!actionKey || actionKey == "create" ? (
|
|
65
|
+
<TemplateSelector
|
|
66
|
+
scope={scope}
|
|
67
|
+
domainIds={domainIds}
|
|
68
|
+
hideLabel={hideLabel}
|
|
69
|
+
onChange={handleSelected}
|
|
70
|
+
onLoad={handleLoad}
|
|
71
|
+
placeholder={placeholder}
|
|
72
|
+
required={required}
|
|
73
|
+
selectedValue={template?.id}
|
|
74
|
+
disabled={disabled || disableSelector}
|
|
75
|
+
/>
|
|
76
|
+
) : null}
|
|
77
|
+
|
|
70
78
|
{!disabled && template ? (
|
|
71
79
|
<>
|
|
72
80
|
{header}
|
|
73
81
|
<DynamicForm
|
|
74
82
|
content={content}
|
|
75
|
-
isModification={isModification}
|
|
76
|
-
onChange={handleChange}
|
|
77
83
|
selectedDomain={domain}
|
|
78
84
|
template={template}
|
|
85
|
+
noTranslatableFields={noTranslatableFields}
|
|
86
|
+
isModification={isModification}
|
|
87
|
+
onChange={handleChange}
|
|
79
88
|
/>
|
|
80
89
|
</>
|
|
81
90
|
) : null}
|
|
@@ -90,6 +99,8 @@ SelectableDynamicForm.propTypes = {
|
|
|
90
99
|
hideLabel: PropTypes.bool,
|
|
91
100
|
isModification: PropTypes.bool,
|
|
92
101
|
name: PropTypes.string,
|
|
102
|
+
noTranslatableFields: PropTypes.array,
|
|
103
|
+
actionKey: PropTypes.string,
|
|
93
104
|
onChange: PropTypes.func,
|
|
94
105
|
onNameChange: PropTypes.func,
|
|
95
106
|
onTemplateChange: PropTypes.func,
|
|
@@ -97,4 +108,6 @@ SelectableDynamicForm.propTypes = {
|
|
|
97
108
|
required: PropTypes.bool,
|
|
98
109
|
scope: PropTypes.string,
|
|
99
110
|
disabled: PropTypes.bool,
|
|
111
|
+
disableSelector: PropTypes.bool,
|
|
112
|
+
selectedTemplate: PropTypes.object,
|
|
100
113
|
};
|
|
@@ -74,13 +74,17 @@ export const DynamicField = ({
|
|
|
74
74
|
description,
|
|
75
75
|
value,
|
|
76
76
|
editable = true,
|
|
77
|
+
disabled = false,
|
|
77
78
|
...fieldProps
|
|
78
79
|
},
|
|
79
80
|
isModification,
|
|
80
81
|
onChange,
|
|
81
82
|
scope,
|
|
82
83
|
}) => (
|
|
83
|
-
<Form.Field
|
|
84
|
+
<Form.Field
|
|
85
|
+
disabled={(!editable && isModification) || disabled}
|
|
86
|
+
data-testid="form-field"
|
|
87
|
+
>
|
|
84
88
|
<label>
|
|
85
89
|
{(label && fieldProps.type != "hierarchy") ||
|
|
86
90
|
(fieldProps.type == "hierarchy" &&
|