@truedat/dq 4.52.0 → 4.52.1
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 +2 -2
- package/src/components/RuleEventDecorator.js +13 -9
- package/src/components/__tests__/RuleEventDecorator.spec.js +10 -0
- package/src/components/__tests__/__snapshots__/ExecutionGroup.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/RuleEventDecorator.spec.js.snap +10 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dq",
|
|
3
|
-
"version": "4.52.
|
|
3
|
+
"version": "4.52.1",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"react-dom": ">= 16.8.6 < 17",
|
|
115
115
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "3eea3b93dcb8dc264af0779fd621971216f0e8aa"
|
|
118
118
|
}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import { flow, last, prop, sortBy } from "lodash/fp";
|
|
1
|
+
import { flow, last, prop, propOr, sortBy } from "lodash/fp";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { Icon } from "semantic-ui-react";
|
|
5
5
|
|
|
6
|
+
const PENDING = { name: "info circle", color: "green" };
|
|
7
|
+
|
|
6
8
|
export const icons = {
|
|
7
|
-
PENDING
|
|
9
|
+
PENDING,
|
|
8
10
|
STARTED: { name: "play circle outline", color: "green" },
|
|
9
11
|
SUCCEEDED: { name: "check circle outline", color: "green" },
|
|
10
|
-
FAILED: { name: "warning circle", color: "red" }
|
|
12
|
+
FAILED: { name: "warning circle", color: "red" },
|
|
11
13
|
};
|
|
12
|
-
|
|
14
|
+
|
|
15
|
+
export const RuleEventDecorator = ({ _embedded }) => {
|
|
13
16
|
const event = flow(
|
|
17
|
+
propOr([], "quality_events"),
|
|
14
18
|
sortBy("inserted_at"),
|
|
15
19
|
last,
|
|
16
20
|
prop("type")
|
|
17
|
-
)(_embedded
|
|
18
|
-
const icon = icons
|
|
21
|
+
)(_embedded);
|
|
22
|
+
const icon = propOr(PENDING, event)(icons);
|
|
19
23
|
return <Icon size="large" {...icon} />;
|
|
20
24
|
};
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
_embedded: PropTypes.object
|
|
26
|
+
RuleEventDecorator.propTypes = {
|
|
27
|
+
_embedded: PropTypes.object,
|
|
24
28
|
};
|
|
25
29
|
|
|
26
|
-
export default
|
|
30
|
+
export default RuleEventDecorator;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import { RuleEventDecorator } from "../RuleEventDecorator";
|
|
4
|
+
|
|
5
|
+
describe("<RuleEventDecorator />", () => {
|
|
6
|
+
it("matches latest snapshot (no events)", () => {
|
|
7
|
+
const { container } = render(<RuleEventDecorator />);
|
|
8
|
+
expect(container).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
});
|