@truedat/dq 4.33.10 → 4.34.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/CHANGELOG.md +7 -0
- package/package.json +5 -5
- package/src/components/ConditionSummary.js +23 -21
- package/src/components/ExecutionDetails.js +11 -14
- package/src/components/ExecutionGroup.js +24 -15
- package/src/components/ImplementationResultBar.js +80 -0
- package/src/components/ImplementationSummary.js +33 -72
- package/src/components/InformationSummary.js +68 -0
- package/src/components/NewRuleImplementation.js +12 -0
- package/src/components/RuleForm.js +0 -178
- package/src/components/RuleImplementation.js +10 -6
- package/src/components/RuleImplementationProperties.js +31 -64
- package/src/components/RuleImplementationResults.js +87 -53
- package/src/components/RuleProperties.js +1 -10
- package/src/components/RuleResultDecorator.js +43 -26
- package/src/components/RuleResultRow.js +4 -1
- package/src/components/RuleRoutes.js +0 -13
- package/src/components/RuleSummary.js +15 -2
- package/src/components/__tests__/ExecutionGroup.spec.js +11 -7
- package/src/components/__tests__/ImplementationResultBar.spec.js +98 -0
- package/src/components/__tests__/ImplementationSummary.spec.js +9 -26
- package/src/components/__tests__/InformationSummary.spec.js +35 -0
- package/src/components/__tests__/NewRuleImplementation.spec.js +1 -1
- package/src/components/__tests__/RuleForm.spec.js +0 -191
- package/src/components/__tests__/RuleImplementation.spec.js +1 -0
- package/src/components/__tests__/RuleImplementationProperties.spec.js +23 -33
- package/src/components/__tests__/RuleProperties.spec.js +7 -9
- package/src/components/__tests__/RuleResultDecorator.spec.js +17 -11
- package/src/components/__tests__/RuleResultRow.spec.js +25 -46
- package/src/components/__tests__/RuleRow.spec.js +0 -4
- package/src/components/__tests__/RuleSummary.spec.js +6 -6
- package/src/components/__tests__/Rules.spec.js +15 -39
- package/src/components/__tests__/__snapshots__/ConditionSummary.spec.js.snap +55 -51
- package/src/components/__tests__/__snapshots__/ExecutionGroup.spec.js.snap +5 -4
- package/src/components/__tests__/__snapshots__/ImplementationResultBar.spec.js.snap +141 -0
- package/src/components/__tests__/__snapshots__/ImplementationSummary.spec.js.snap +194 -457
- package/src/components/__tests__/__snapshots__/InformationSummary.spec.js.snap +185 -0
- package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +6 -0
- package/src/components/__tests__/__snapshots__/RuleForm.spec.js.snap +0 -148
- package/src/components/__tests__/__snapshots__/RuleImplementation.spec.js.snap +20 -0
- package/src/components/__tests__/__snapshots__/RuleImplementationProperties.spec.js.snap +43 -49
- package/src/components/__tests__/__snapshots__/RuleImplementationResults.spec.js.snap +63 -61
- package/src/components/__tests__/__snapshots__/RuleProperties.spec.js.snap +0 -1
- package/src/components/__tests__/__snapshots__/RuleRow.spec.js.snap +0 -28
- package/src/components/__tests__/__snapshots__/Rules.spec.js.snap +0 -101
- package/src/components/ruleImplementationForm/InformationForm.js +5 -5
- package/src/components/ruleImplementationForm/LimitsForm.js +142 -0
- package/src/components/ruleImplementationForm/RuleImplementationForm.js +14 -4
- package/src/components/ruleImplementationForm/RuleImplementationRawForm.js +16 -6
- package/src/components/ruleImplementationForm/__tests__/LimitsForm.spec.js +186 -0
- package/src/components/ruleImplementationForm/__tests__/RuleImplementationRawForm.spec.js +42 -35
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/LimitsForm.spec.js.snap +1104 -0
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationForm.spec.js.snap +4 -1
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationRawForm.spec.js.snap +12 -1
- package/src/components/ruleImplementationForm/limitsValidation.js +72 -0
- package/src/messages/en.js +130 -71
- package/src/messages/es.js +253 -180
- package/src/reducers/__tests__/rule.spec.js +2 -4
- package/src/reducers/__tests__/ruleImplementation.spec.js +2 -0
- package/src/reducers/__tests__/ruleImplementations.spec.js +12 -8
- package/src/reducers/rule.js +0 -3
- package/src/reducers/ruleImplementation.js +3 -0
- package/src/reducers/ruleImplementations.js +3 -0
- package/src/selectors/getRuleImplementationColumns.js +38 -3
- package/src/selectors/ruleColumnsSelector.js +0 -31
- package/src/styles/ruleSummary.less +17 -10
|
@@ -20,18 +20,16 @@ describe("reducers: rule", () => {
|
|
|
20
20
|
current_business_concept_version: { name: "alfalfa", id: 1234 },
|
|
21
21
|
name: "rule1",
|
|
22
22
|
description: "desc1",
|
|
23
|
-
goal: 10,
|
|
24
|
-
minimum: 1,
|
|
25
23
|
active: false,
|
|
26
24
|
domain_id: 1,
|
|
27
|
-
domain: { id: 1, name: "foo", external_id: "bar" }
|
|
25
|
+
domain: { id: 1, name: "foo", external_id: "bar" },
|
|
28
26
|
};
|
|
29
27
|
const payload = { data: someRule };
|
|
30
28
|
|
|
31
29
|
expect(
|
|
32
30
|
rule(fooState, {
|
|
33
31
|
type: fetchRule.SUCCESS,
|
|
34
|
-
payload
|
|
32
|
+
payload,
|
|
35
33
|
})
|
|
36
34
|
).toMatchObject(someRule);
|
|
37
35
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clearRuleImplementations,
|
|
3
3
|
fetchRuleImplementations,
|
|
4
|
-
searchRuleImplementations
|
|
4
|
+
searchRuleImplementations,
|
|
5
5
|
} from "../../routines";
|
|
6
6
|
import { ruleImplementations } from "..";
|
|
7
7
|
|
|
@@ -9,12 +9,16 @@ const fooState = { foo: "bar" };
|
|
|
9
9
|
const data = [
|
|
10
10
|
{
|
|
11
11
|
id: 1,
|
|
12
|
-
implementation_key: "RuleImplementations 1"
|
|
12
|
+
implementation_key: "RuleImplementations 1",
|
|
13
|
+
goal: 10,
|
|
14
|
+
minimum: 1,
|
|
13
15
|
},
|
|
14
16
|
{
|
|
15
17
|
id: 2,
|
|
16
|
-
implementation_key: "RuleImplementations 2"
|
|
17
|
-
|
|
18
|
+
implementation_key: "RuleImplementations 2",
|
|
19
|
+
goal: 10,
|
|
20
|
+
minimum: 1,
|
|
21
|
+
},
|
|
18
22
|
];
|
|
19
23
|
|
|
20
24
|
describe("reducers: ruleImplementations", () => {
|
|
@@ -27,7 +31,7 @@ describe("reducers: ruleImplementations", () => {
|
|
|
27
31
|
it("should handle the fetchRuleImplementations.TRIGGER action", () => {
|
|
28
32
|
expect(
|
|
29
33
|
ruleImplementations(fooState, {
|
|
30
|
-
type: fetchRuleImplementations.TRIGGER
|
|
34
|
+
type: fetchRuleImplementations.TRIGGER,
|
|
31
35
|
})
|
|
32
36
|
).toMatchObject(initialState);
|
|
33
37
|
});
|
|
@@ -38,7 +42,7 @@ describe("reducers: ruleImplementations", () => {
|
|
|
38
42
|
expect(
|
|
39
43
|
ruleImplementations(fooState, {
|
|
40
44
|
type: fetchRuleImplementations.SUCCESS,
|
|
41
|
-
payload
|
|
45
|
+
payload,
|
|
42
46
|
})
|
|
43
47
|
).toMatchObject(data);
|
|
44
48
|
});
|
|
@@ -49,7 +53,7 @@ describe("reducers: ruleImplementations", () => {
|
|
|
49
53
|
expect(
|
|
50
54
|
ruleImplementations(fooState, {
|
|
51
55
|
type: searchRuleImplementations.SUCCESS,
|
|
52
|
-
payload
|
|
56
|
+
payload,
|
|
53
57
|
})
|
|
54
58
|
).toMatchObject(data);
|
|
55
59
|
});
|
|
@@ -57,7 +61,7 @@ describe("reducers: ruleImplementations", () => {
|
|
|
57
61
|
it("should handle the clearRuleImplementations.TRIGGER action", () => {
|
|
58
62
|
expect(
|
|
59
63
|
ruleImplementations(fooState, {
|
|
60
|
-
type: clearRuleImplementations.TRIGGER
|
|
64
|
+
type: clearRuleImplementations.TRIGGER,
|
|
61
65
|
})
|
|
62
66
|
).toMatchObject(initialState);
|
|
63
67
|
});
|
package/src/reducers/rule.js
CHANGED
|
@@ -13,13 +13,10 @@ const pickFields = _.pick([
|
|
|
13
13
|
"current_business_concept_version",
|
|
14
14
|
"name",
|
|
15
15
|
"description",
|
|
16
|
-
"goal",
|
|
17
|
-
"minimum",
|
|
18
16
|
"system_values",
|
|
19
17
|
"type_params",
|
|
20
18
|
"df_name",
|
|
21
19
|
"df_content",
|
|
22
|
-
"result_type"
|
|
23
20
|
]);
|
|
24
21
|
|
|
25
22
|
const rule = (state = initialState, { type, payload }) => {
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { createSelector } from "reselect";
|
|
4
|
+
import { FormattedMessage } from "react-intl";
|
|
3
5
|
import DateTime from "@truedat/core/components/DateTime";
|
|
6
|
+
import { formatNumber } from "@truedat/core/services/format";
|
|
4
7
|
import RuleResultDecorator from "../components/RuleResultDecorator";
|
|
5
8
|
import RuleImplementationLink from "../components/RuleImplementationLink";
|
|
6
9
|
import RuleLink from "../components/RuleLink";
|
|
7
10
|
|
|
11
|
+
const translateDecorator = (id) => <FormattedMessage id={id} />;
|
|
12
|
+
|
|
13
|
+
const resultTypeDecorator = (result, result_type) =>
|
|
14
|
+
result_type === "errors_number" ? formatNumber(result) : `${result}%`;
|
|
15
|
+
|
|
8
16
|
export const defaultImplementationColumns = [
|
|
9
17
|
{
|
|
10
18
|
name: "implementation_key",
|
|
@@ -35,11 +43,38 @@ export const defaultImplementationColumns = [
|
|
|
35
43
|
sort: { name: "execution_result_info.date" },
|
|
36
44
|
width: 2,
|
|
37
45
|
},
|
|
46
|
+
{
|
|
47
|
+
name: "result_type",
|
|
48
|
+
fieldDecorator: (value) =>
|
|
49
|
+
_.isNil(value)
|
|
50
|
+
? null
|
|
51
|
+
: translateDecorator(`ruleImplementations.props.result_type.${value}`),
|
|
52
|
+
sort: { name: "result_type.raw" },
|
|
53
|
+
width: 2,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "minimum",
|
|
57
|
+
fieldSelector: _.pick(["minimum", "result_type"]),
|
|
58
|
+
fieldDecorator: (field) =>
|
|
59
|
+
resultTypeDecorator(field.minimum, field.result_type),
|
|
60
|
+
sort: { name: "minimum" },
|
|
61
|
+
textAlign: "right",
|
|
62
|
+
width: 1,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "goal",
|
|
66
|
+
fieldSelector: _.pick(["goal", "result_type"]),
|
|
67
|
+
fieldDecorator: (field) =>
|
|
68
|
+
resultTypeDecorator(field.goal, field.result_type),
|
|
69
|
+
sort: { name: "goal" },
|
|
70
|
+
textAlign: "right",
|
|
71
|
+
width: 1,
|
|
72
|
+
},
|
|
38
73
|
{
|
|
39
74
|
name: "result",
|
|
40
|
-
fieldSelector: (
|
|
41
|
-
ruleResult,
|
|
42
|
-
|
|
75
|
+
fieldSelector: (ruleImplementation) => ({
|
|
76
|
+
ruleResult: ruleImplementation?.execution_result_info,
|
|
77
|
+
ruleImplementation,
|
|
43
78
|
}),
|
|
44
79
|
fieldDecorator: RuleResultDecorator,
|
|
45
80
|
textAlign: "center",
|
|
@@ -3,14 +3,10 @@ import React from "react";
|
|
|
3
3
|
import { Label } from "semantic-ui-react";
|
|
4
4
|
import { FormattedMessage } from "react-intl";
|
|
5
5
|
import { createSelector } from "reselect";
|
|
6
|
-
import { formatNumber } from "@truedat/core/services/format";
|
|
7
6
|
import RuleLink from "../components/RuleLink";
|
|
8
7
|
|
|
9
8
|
const translateDecorator = (id) => <FormattedMessage id={id} />;
|
|
10
9
|
|
|
11
|
-
const resultTypeDecorator = (result, result_type) =>
|
|
12
|
-
result_type === "errors_number" ? formatNumber(result) : `${result}%`;
|
|
13
|
-
|
|
14
10
|
export const dynamicDecorator = (field) => (
|
|
15
11
|
<>
|
|
16
12
|
{field &&
|
|
@@ -52,33 +48,6 @@ export const defaultRuleColumns = () => [
|
|
|
52
48
|
sort: { name: "current_business_concept_version.name.raw" },
|
|
53
49
|
width: 3,
|
|
54
50
|
},
|
|
55
|
-
{
|
|
56
|
-
name: "result_type",
|
|
57
|
-
fieldDecorator: (value) =>
|
|
58
|
-
_.isNil(value)
|
|
59
|
-
? null
|
|
60
|
-
: translateDecorator(`rule.props.result_type.${value}`),
|
|
61
|
-
sort: { name: "result_type.raw" },
|
|
62
|
-
width: 2,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: "minimum",
|
|
66
|
-
fieldSelector: _.pick(["minimum", "result_type"]),
|
|
67
|
-
fieldDecorator: (field) =>
|
|
68
|
-
resultTypeDecorator(field.minimum, field.result_type),
|
|
69
|
-
sort: { name: "minimum" },
|
|
70
|
-
textAlign: "right",
|
|
71
|
-
width: 1,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: "goal.list",
|
|
75
|
-
fieldSelector: _.pick(["goal", "result_type"]),
|
|
76
|
-
fieldDecorator: (field) =>
|
|
77
|
-
resultTypeDecorator(field.goal, field.result_type),
|
|
78
|
-
sort: { name: "goal" },
|
|
79
|
-
textAlign: "right",
|
|
80
|
-
width: 1,
|
|
81
|
-
},
|
|
82
51
|
];
|
|
83
52
|
|
|
84
53
|
export const optionalRuleColumns = [
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
height: 18px;
|
|
8
8
|
border-radius: 9px;
|
|
9
9
|
margin: 0px auto;
|
|
10
|
-
>span>span {
|
|
10
|
+
> span > span {
|
|
11
11
|
color: white;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -21,39 +21,46 @@
|
|
|
21
21
|
transition: all 100ms ease-in-out;
|
|
22
22
|
overflow: hidden;
|
|
23
23
|
|
|
24
|
-
span:first-child{
|
|
24
|
+
span:first-child {
|
|
25
25
|
margin-left: 0px;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
span:last-child{
|
|
28
|
+
span:last-child {
|
|
29
29
|
margin-right: 0px;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
span{
|
|
32
|
+
span {
|
|
33
33
|
margin: 1px;
|
|
34
34
|
cursor: default;
|
|
35
35
|
color: transparent;
|
|
36
36
|
text-align: center;
|
|
37
37
|
font-size: 10px;
|
|
38
38
|
line-height: 15px;
|
|
39
|
+
white-space: pre;
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
.rule-summary {
|
|
43
44
|
@import "~semantic-ui-less/definitions/globals/site";
|
|
44
45
|
.over-goal-color {
|
|
45
|
-
|
|
46
|
+
background-color: @overGoalRuleColor;
|
|
46
47
|
}
|
|
47
48
|
.under-goal-color {
|
|
48
|
-
|
|
49
|
+
background-color: @underGoalRuleColor;
|
|
49
50
|
}
|
|
50
51
|
.under-minimum-color {
|
|
51
|
-
|
|
52
|
+
background-color: @underMinimumRuleColor;
|
|
52
53
|
}
|
|
53
54
|
.not-executed-color {
|
|
54
|
-
|
|
55
|
+
background-color: @notExecutedRuleColor;
|
|
55
56
|
}
|
|
56
57
|
.failed-color {
|
|
57
|
-
|
|
58
|
+
background-color: @failedRuleColor;
|
|
58
59
|
}
|
|
59
|
-
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.pointer {
|
|
63
|
+
span {
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
}
|
|
66
|
+
}
|