@truedat/dq 5.9.4 → 5.9.6
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/dq",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.6",
|
|
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": "5.9.
|
|
37
|
+
"@truedat/test": "5.9.6",
|
|
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",
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"@apollo/client": "^3.7.1",
|
|
95
|
-
"@truedat/core": "5.9.
|
|
96
|
-
"@truedat/df": "5.9.
|
|
95
|
+
"@truedat/core": "5.9.6",
|
|
96
|
+
"@truedat/df": "5.9.6",
|
|
97
97
|
"decode-uri-component": "^0.2.2",
|
|
98
98
|
"graphql": "^15.5.3",
|
|
99
99
|
"moment": "^2.29.4",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"react-dom": ">= 16.8.6 < 17",
|
|
119
119
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "9f323fd84b59cac49e60b9cf0e441efc192465de"
|
|
122
122
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defaultTo, has, isNil } from "lodash/fp";
|
|
1
|
+
import _, { defaultTo, has, isNil } from "lodash/fp";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { Icon } from "semantic-ui-react";
|
|
@@ -38,6 +38,34 @@ export const calculateResultDecoration = ({
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const { resultType, result_type } = ruleImplementation;
|
|
41
|
+
const { errors, records, result: ruleResultPercentage } = ruleResult || {};
|
|
42
|
+
|
|
43
|
+
const executionInfoIsObject = _.flow(
|
|
44
|
+
_.prop("execution_result_info"),
|
|
45
|
+
_.isObject
|
|
46
|
+
);
|
|
47
|
+
const notEmptyResults = _.flow(
|
|
48
|
+
_.prop("results"),
|
|
49
|
+
(results) => _.isArray(results) && !_.isEmpty(results)
|
|
50
|
+
);
|
|
51
|
+
const firstResult = _.flow(_.prop("results"), _.first);
|
|
52
|
+
const defaultValue = { goal: null, minimum: null };
|
|
53
|
+
|
|
54
|
+
const { goal, minimum } = _.cond([
|
|
55
|
+
[executionInfoIsObject, _.prop("execution_result_info")],
|
|
56
|
+
[notEmptyResults, firstResult],
|
|
57
|
+
[_.stubTrue, () => defaultValue],
|
|
58
|
+
])(ruleImplementation);
|
|
59
|
+
|
|
60
|
+
const colorParams = {
|
|
61
|
+
errors: errors,
|
|
62
|
+
result: ruleResultPercentage,
|
|
63
|
+
minimum: minimum,
|
|
64
|
+
goal: goal,
|
|
65
|
+
result_type: result_type,
|
|
66
|
+
records: records,
|
|
67
|
+
};
|
|
68
|
+
|
|
41
69
|
const type = defaultTo(result_type)(resultType);
|
|
42
70
|
const result =
|
|
43
71
|
type === "errors_number"
|
|
@@ -51,7 +79,9 @@ export const calculateResultDecoration = ({
|
|
|
51
79
|
{ result, date: <DateTime value={date} /> }
|
|
52
80
|
)
|
|
53
81
|
: formatMessage({ id: `quality.result.${type}.description` }, { result });
|
|
54
|
-
|
|
82
|
+
|
|
83
|
+
const color = selectColor(colorParams);
|
|
84
|
+
|
|
55
85
|
const iconTitle = ruleResult?.result_text
|
|
56
86
|
? formatMessage({
|
|
57
87
|
id: ruleResult?.result_text,
|
|
@@ -5,9 +5,11 @@ import ImplementationResultBar from "../ImplementationResultBar";
|
|
|
5
5
|
const implementation = {
|
|
6
6
|
id: 1,
|
|
7
7
|
rule_id: 8,
|
|
8
|
-
goal: 80,
|
|
9
|
-
minimum: 50,
|
|
10
8
|
result_type: "percentage",
|
|
9
|
+
execution_result_info: {
|
|
10
|
+
goal: 80,
|
|
11
|
+
minimum: 50,
|
|
12
|
+
},
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
describe("<ImplementationResultBar />", () => {
|
|
@@ -41,7 +43,9 @@ describe("<ImplementationResultBar />", () => {
|
|
|
41
43
|
const props = {
|
|
42
44
|
implementation: {
|
|
43
45
|
...implementation,
|
|
44
|
-
results: [
|
|
46
|
+
results: [
|
|
47
|
+
{ date: "2021-07-19T00:01:20Z", result: "40", goal: 80, minimum: 50 },
|
|
48
|
+
],
|
|
45
49
|
},
|
|
46
50
|
};
|
|
47
51
|
const { container } = render(<ImplementationResultBar {...props} />);
|
|
@@ -14,7 +14,7 @@ exports[`<RuleResultDecorator /> decorates a percentage result 1`] = `
|
|
|
14
14
|
<div>
|
|
15
15
|
<i
|
|
16
16
|
aria-hidden="true"
|
|
17
|
-
class="
|
|
17
|
+
class="grey circle icon"
|
|
18
18
|
title="Something happened"
|
|
19
19
|
/>
|
|
20
20
|
42%
|
|
@@ -25,7 +25,7 @@ exports[`<RuleResultDecorator /> decorates an error count result 1`] = `
|
|
|
25
25
|
<div>
|
|
26
26
|
<i
|
|
27
27
|
aria-hidden="true"
|
|
28
|
-
class="
|
|
28
|
+
class="grey circle icon"
|
|
29
29
|
title="Something happened"
|
|
30
30
|
/>
|
|
31
31
|
1,234 errors
|