@truedat/dq 4.48.1 → 4.48.2
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/__tests__/__snapshots__/RemediationPlan.spec.js.snap +6 -2
- package/src/components/DropdownI18n.js +0 -92
- package/src/components/__tests__/DropdownI18n.spec.js +0 -31
- package/src/components/__tests__/__snapshots__/DropdownI18n.spec.js.snap +0 -21
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dq",
|
|
3
|
-
"version": "4.48.
|
|
3
|
+
"version": "4.48.2",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@apollo/client": "^3.6.4",
|
|
91
|
-
"@truedat/core": "4.48.
|
|
92
|
-
"@truedat/df": "4.48.
|
|
91
|
+
"@truedat/core": "4.48.2",
|
|
92
|
+
"@truedat/df": "4.48.2",
|
|
93
93
|
"axios": "^0.19.2",
|
|
94
94
|
"graphql": "^15.5.3",
|
|
95
95
|
"path-to-regexp": "^1.7.0",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"react-dom": ">= 16.8.6 < 17",
|
|
111
111
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "93133e957332713e64c97eecdf45cc283c29bd32"
|
|
114
114
|
}
|
|
@@ -31,9 +31,13 @@ exports[`<RemediationPlan /> matches the latest snapshot 1`] = `
|
|
|
31
31
|
class="ui negative message"
|
|
32
32
|
>
|
|
33
33
|
<div
|
|
34
|
-
class="
|
|
34
|
+
class="content"
|
|
35
35
|
>
|
|
36
|
-
|
|
36
|
+
<div
|
|
37
|
+
class="header"
|
|
38
|
+
>
|
|
39
|
+
Error: Invalid template
|
|
40
|
+
</div>
|
|
37
41
|
</div>
|
|
38
42
|
</div>
|
|
39
43
|
</div>
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import { Form } from "semantic-ui-react";
|
|
5
|
-
import { useIntl } from "react-intl";
|
|
6
|
-
|
|
7
|
-
const toOptions = (
|
|
8
|
-
formatMessage,
|
|
9
|
-
property,
|
|
10
|
-
translateValues,
|
|
11
|
-
sortBy
|
|
12
|
-
) => values =>
|
|
13
|
-
_.flow(
|
|
14
|
-
_.map(v => ({
|
|
15
|
-
text: formatMessage({ id: `${property}.${v}`, defaultMessage: v }),
|
|
16
|
-
value: v
|
|
17
|
-
})),
|
|
18
|
-
sortBy ? _.sortBy(sortBy) : _.identity,
|
|
19
|
-
_.map(translateValues ? ({ text }) => ({ text, value: text }) : _.identity),
|
|
20
|
-
_.map.convert({ cap: false })(({ text, value }, key) => ({
|
|
21
|
-
key,
|
|
22
|
-
text,
|
|
23
|
-
value
|
|
24
|
-
}))
|
|
25
|
-
)(values);
|
|
26
|
-
|
|
27
|
-
export const DropdownI18n = ({
|
|
28
|
-
allowAdditions,
|
|
29
|
-
basic,
|
|
30
|
-
label,
|
|
31
|
-
multiple,
|
|
32
|
-
name,
|
|
33
|
-
onAddItem,
|
|
34
|
-
onChange,
|
|
35
|
-
property,
|
|
36
|
-
required,
|
|
37
|
-
search,
|
|
38
|
-
selection,
|
|
39
|
-
sortBy,
|
|
40
|
-
translateValues = false,
|
|
41
|
-
value,
|
|
42
|
-
values
|
|
43
|
-
}) => {
|
|
44
|
-
const { formatMessage } = useIntl();
|
|
45
|
-
return (
|
|
46
|
-
<Form.Dropdown
|
|
47
|
-
allowAdditions={allowAdditions}
|
|
48
|
-
basic={basic}
|
|
49
|
-
label={
|
|
50
|
-
label ? formatMessage({ id: label, defaultMessage: label }) : false
|
|
51
|
-
}
|
|
52
|
-
multiple={multiple}
|
|
53
|
-
name={name}
|
|
54
|
-
onAddItem={onAddItem}
|
|
55
|
-
onChange={onChange}
|
|
56
|
-
options={toOptions(
|
|
57
|
-
formatMessage,
|
|
58
|
-
property,
|
|
59
|
-
translateValues,
|
|
60
|
-
sortBy
|
|
61
|
-
)(values)}
|
|
62
|
-
placeholder={formatMessage({
|
|
63
|
-
id: `${property}.placeholder`,
|
|
64
|
-
defaultMessage: " "
|
|
65
|
-
})}
|
|
66
|
-
required={required}
|
|
67
|
-
search={search}
|
|
68
|
-
selection={selection}
|
|
69
|
-
value={value}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
DropdownI18n.propTypes = {
|
|
75
|
-
allowAdditions: PropTypes.bool,
|
|
76
|
-
basic: PropTypes.bool,
|
|
77
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
78
|
-
multiple: PropTypes.bool,
|
|
79
|
-
name: PropTypes.string,
|
|
80
|
-
onAddItem: PropTypes.func,
|
|
81
|
-
onChange: PropTypes.func,
|
|
82
|
-
property: PropTypes.string,
|
|
83
|
-
required: PropTypes.bool,
|
|
84
|
-
search: PropTypes.bool,
|
|
85
|
-
selection: PropTypes.bool,
|
|
86
|
-
sortBy: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
|
87
|
-
translateValues: PropTypes.bool,
|
|
88
|
-
value: PropTypes.string,
|
|
89
|
-
values: PropTypes.arrayOf(PropTypes.string)
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export default DropdownI18n;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { shallow } from "enzyme";
|
|
3
|
-
import { intl } from "@truedat/test/intl-stub";
|
|
4
|
-
import { DropdownI18n } from "../DropdownI18n";
|
|
5
|
-
|
|
6
|
-
// workaround for enzyme issue with React.useContext
|
|
7
|
-
// see https://github.com/airbnb/enzyme/issues/2176#issuecomment-532361526
|
|
8
|
-
jest.spyOn(React, "useContext").mockImplementation(() => intl);
|
|
9
|
-
|
|
10
|
-
describe("<DropdownI18n />", () => {
|
|
11
|
-
const props = {
|
|
12
|
-
allowAdditions: true,
|
|
13
|
-
basic: true,
|
|
14
|
-
label: "label",
|
|
15
|
-
multiple: true,
|
|
16
|
-
name: "name",
|
|
17
|
-
onChange: jest.fn(),
|
|
18
|
-
onAddItem: jest.fn(),
|
|
19
|
-
options: ["foo", "bar", "baz"],
|
|
20
|
-
property: "some.i18n.prop",
|
|
21
|
-
required: true,
|
|
22
|
-
search: true,
|
|
23
|
-
selection: true,
|
|
24
|
-
value: "foo"
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
it("matches the latest snapshot", () => {
|
|
28
|
-
const wrapper = shallow(<DropdownI18n {...props} />);
|
|
29
|
-
expect(wrapper).toMatchSnapshot();
|
|
30
|
-
});
|
|
31
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`<DropdownI18n /> matches the latest snapshot 1`] = `
|
|
4
|
-
<FormDropdown
|
|
5
|
-
allowAdditions={true}
|
|
6
|
-
as={[Function]}
|
|
7
|
-
basic={true}
|
|
8
|
-
control={[Function]}
|
|
9
|
-
label="label"
|
|
10
|
-
multiple={true}
|
|
11
|
-
name="name"
|
|
12
|
-
onAddItem={[MockFunction]}
|
|
13
|
-
onChange={[MockFunction]}
|
|
14
|
-
options={Array []}
|
|
15
|
-
placeholder=" "
|
|
16
|
-
required={true}
|
|
17
|
-
search={true}
|
|
18
|
-
selection={true}
|
|
19
|
-
value="foo"
|
|
20
|
-
/>
|
|
21
|
-
`;
|