@truedat/df 4.48.4 → 4.48.5
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 +7 -1
- package/package.json +4 -4
- package/src/components/DynamicFieldValue.js +8 -6
- package/src/components/EditableDynamicFieldValue.js +8 -6
- package/src/components/FieldViewerValue.js +36 -14
- package/src/components/__tests__/FieldGroupCopy.spec.js +3 -3
- package/src/components/__tests__/FieldViewerValue.spec.js +5 -13
- package/src/components/__tests__/__snapshots__/FieldGroupCopy.spec.js.snap +178 -332
- package/src/components/__tests__/__snapshots__/FieldViewerValue.spec.js.snap +119 -982
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.48.5] 2022-07-11
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- [TD-5018] Support localization of fixed values
|
|
8
|
+
|
|
3
9
|
## [4.48.4] 2022-07-11
|
|
4
10
|
|
|
5
11
|
### Changed
|
|
6
12
|
|
|
7
|
-
- [TD-
|
|
13
|
+
- [TD-5018] Support localization of fixed values
|
|
8
14
|
|
|
9
15
|
## [4.48.2] 2022-07-08
|
|
10
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/df",
|
|
3
|
-
"version": "4.48.
|
|
3
|
+
"version": "4.48.5",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
]
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@truedat/auth": "4.48.
|
|
91
|
-
"@truedat/core": "4.48.
|
|
90
|
+
"@truedat/auth": "4.48.5",
|
|
91
|
+
"@truedat/core": "4.48.5",
|
|
92
92
|
"axios": "^0.19.2",
|
|
93
93
|
"path-to-regexp": "^1.7.0",
|
|
94
94
|
"prop-types": "^15.8.1",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"react-dom": ">= 16.8.6 < 17",
|
|
108
108
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "668fb37a5ca8a3ca4d3009d9b6d218a8bec75d66"
|
|
111
111
|
}
|
|
@@ -32,26 +32,28 @@ export const DynamicFieldValue = ({
|
|
|
32
32
|
)
|
|
33
33
|
) : _.isArray(value) ? (
|
|
34
34
|
type == "table" ? (
|
|
35
|
-
<FieldViewerValue
|
|
35
|
+
<FieldViewerValue type={type} value={value} values={values} />
|
|
36
36
|
) : type == "system" ? (
|
|
37
37
|
<SystemPreview value={value} />
|
|
38
38
|
) : (
|
|
39
|
-
|
|
39
|
+
value.map((v, i) => (
|
|
40
40
|
<FieldViewerValue
|
|
41
41
|
key={i}
|
|
42
|
-
|
|
43
|
-
type={type}
|
|
42
|
+
label={label}
|
|
44
43
|
multiple
|
|
44
|
+
type={type}
|
|
45
|
+
value={v}
|
|
45
46
|
values={values}
|
|
46
47
|
/>
|
|
47
|
-
))
|
|
48
|
+
))
|
|
48
49
|
)
|
|
49
50
|
) : widget === "password" ? (
|
|
50
51
|
"*****"
|
|
51
52
|
) : (
|
|
52
53
|
<FieldViewerValue
|
|
53
|
-
|
|
54
|
+
label={label}
|
|
54
55
|
type={type}
|
|
56
|
+
value={value}
|
|
55
57
|
values={values}
|
|
56
58
|
widget={widget}
|
|
57
59
|
/>
|
|
@@ -93,26 +93,28 @@ export const EditableDynamicFieldValue = (props) => {
|
|
|
93
93
|
)
|
|
94
94
|
) : _.isArray(value) ? (
|
|
95
95
|
type == "table" ? (
|
|
96
|
-
<FieldViewerValue
|
|
96
|
+
<FieldViewerValue type={type} value={value} values={values} />
|
|
97
97
|
) : type == "system" ? (
|
|
98
98
|
<SystemPreview value={value} />
|
|
99
99
|
) : (
|
|
100
|
-
|
|
100
|
+
value.map((v, i) => (
|
|
101
101
|
<FieldViewerValue
|
|
102
102
|
key={i}
|
|
103
|
-
|
|
104
|
-
type={type}
|
|
103
|
+
label={label}
|
|
105
104
|
multiple
|
|
105
|
+
type={type}
|
|
106
|
+
value={v}
|
|
106
107
|
values={values}
|
|
107
108
|
/>
|
|
108
|
-
))
|
|
109
|
+
))
|
|
109
110
|
)
|
|
110
111
|
) : widget === "password" ? (
|
|
111
112
|
"*****"
|
|
112
113
|
) : (
|
|
113
114
|
<FieldViewerValue
|
|
114
|
-
|
|
115
|
+
label={label}
|
|
115
116
|
type={type}
|
|
117
|
+
value={value}
|
|
116
118
|
values={values}
|
|
117
119
|
widget={widget}
|
|
118
120
|
/>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
3
4
|
import { Icon, Label, Table } from "semantic-ui-react";
|
|
4
5
|
import { SafeLink, RichTextEditor } from "@truedat/core/components";
|
|
5
6
|
import DomainPreview from "./widgets/DomainPreview";
|
|
@@ -8,7 +9,27 @@ import ImagePreview from "./widgets/ImagePreview";
|
|
|
8
9
|
import SystemPreview from "./widgets/SystemPreview";
|
|
9
10
|
import "../styles/fieldGroupDetail.less";
|
|
10
11
|
|
|
11
|
-
export const
|
|
12
|
+
export const LocalizedFieldValue = ({ label, value }) => {
|
|
13
|
+
const { formatMessage } = useIntl();
|
|
14
|
+
return formatMessage({
|
|
15
|
+
id: `fields.${label}.${value}`,
|
|
16
|
+
defaultMessage: value,
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
LocalizedFieldValue.propTypes = {
|
|
21
|
+
label: PropTypes.string,
|
|
22
|
+
value: PropTypes.any,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const FieldViewerValue = ({
|
|
26
|
+
label,
|
|
27
|
+
multiple,
|
|
28
|
+
type,
|
|
29
|
+
value,
|
|
30
|
+
values,
|
|
31
|
+
widget,
|
|
32
|
+
}) => {
|
|
12
33
|
switch (type) {
|
|
13
34
|
case "url":
|
|
14
35
|
return (
|
|
@@ -67,29 +88,30 @@ export const FieldViewerValue = ({ value, type, multiple, values, widget }) => {
|
|
|
67
88
|
case "date":
|
|
68
89
|
case "datetime":
|
|
69
90
|
default:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
91
|
+
return multiple ? (
|
|
92
|
+
<Label>
|
|
93
|
+
<LocalizedFieldValue label={label} value={value} />
|
|
94
|
+
</Label>
|
|
95
|
+
) : (
|
|
74
96
|
<div
|
|
75
|
-
className={
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.trim()}
|
|
97
|
+
className={
|
|
98
|
+
widget === "identifier"
|
|
99
|
+
? "default-value identifier-value"
|
|
100
|
+
: "default-value"
|
|
101
|
+
}
|
|
81
102
|
>
|
|
82
|
-
{value}
|
|
103
|
+
<LocalizedFieldValue label={label} value={value} />
|
|
83
104
|
</div>
|
|
84
105
|
);
|
|
85
106
|
}
|
|
86
107
|
};
|
|
87
108
|
|
|
88
109
|
FieldViewerValue.propTypes = {
|
|
89
|
-
|
|
110
|
+
label: PropTypes.string,
|
|
111
|
+
multiple: PropTypes.bool,
|
|
90
112
|
type: PropTypes.string,
|
|
113
|
+
value: PropTypes.any,
|
|
91
114
|
values: PropTypes.any,
|
|
92
|
-
multiple: PropTypes.bool,
|
|
93
115
|
widget: PropTypes.string,
|
|
94
116
|
};
|
|
95
117
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
3
|
import { FieldGroupCopy } from "../FieldGroupCopy";
|
|
4
4
|
|
|
5
5
|
describe("<FieldGroupCopy />", () => {
|
|
@@ -8,7 +8,7 @@ describe("<FieldGroupCopy />", () => {
|
|
|
8
8
|
const props = { value };
|
|
9
9
|
|
|
10
10
|
it("matches the latest snapshot", () => {
|
|
11
|
-
const
|
|
12
|
-
expect(
|
|
11
|
+
const { container } = render(<FieldGroupCopy {...props} />);
|
|
12
|
+
expect(container).toMatchSnapshot();
|
|
13
13
|
});
|
|
14
14
|
});
|
|
@@ -3,14 +3,6 @@ import { render } from "@truedat/test/render";
|
|
|
3
3
|
import { FieldViewerValue } from "../FieldViewerValue";
|
|
4
4
|
|
|
5
5
|
describe("<FieldViewerValue />", () => {
|
|
6
|
-
const renderOpts = {
|
|
7
|
-
messages: {
|
|
8
|
-
en: {
|
|
9
|
-
"widget.copy.error.jsonformat": "Error: copy has wrong format",
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
6
|
const testTypes = [
|
|
15
7
|
{
|
|
16
8
|
value: { url_name: "name", url_value: "value" },
|
|
@@ -65,18 +57,18 @@ describe("<FieldViewerValue />", () => {
|
|
|
65
57
|
|
|
66
58
|
testTypes.forEach((props) =>
|
|
67
59
|
it(`matches the latest snapshot with type: ${props.type}`, () => {
|
|
68
|
-
const
|
|
69
|
-
expect(
|
|
60
|
+
const { container } = render(<FieldViewerValue {...props} />);
|
|
61
|
+
expect(container).toMatchSnapshot();
|
|
70
62
|
})
|
|
71
63
|
);
|
|
72
64
|
|
|
73
65
|
it("matches the latest snapshot for multiple", () => {
|
|
74
66
|
const props = {
|
|
75
|
-
value:
|
|
67
|
+
value: "a",
|
|
76
68
|
multiple: true,
|
|
77
69
|
type: "string",
|
|
78
70
|
};
|
|
79
|
-
const
|
|
80
|
-
expect(
|
|
71
|
+
const { container } = render(<FieldViewerValue {...props} />);
|
|
72
|
+
expect(container).toMatchSnapshot();
|
|
81
73
|
});
|
|
82
74
|
});
|