@truedat/dq 4.43.0 → 4.43.3
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 +22 -3
- package/package.json +5 -5
- package/src/api.js +2 -0
- package/src/components/ConditionSummary.js +1 -0
- package/src/components/FieldSummary.js +86 -0
- package/src/components/ImplementationSummary.js +11 -1
- package/src/components/NewRemediation.js +27 -20
- package/src/components/NewRuleImplementation.js +42 -6
- package/src/components/RemediationPlan.js +47 -78
- package/src/components/RuleImplementationProperties.js +2 -1
- package/src/components/RuleImplementationResultTabs.js +113 -0
- package/src/components/RuleImplementationResults.js +1 -1
- package/src/components/RuleResult.js +108 -0
- package/src/components/{ExecutionDetails.js → RuleResultDetails.js} +4 -21
- package/src/components/RuleResultRemediationLoader.js +44 -0
- package/src/components/RuleResultRemediations.js +47 -0
- package/src/components/RuleResultRow.js +0 -3
- package/src/components/RuleResultSegmentRow.js +83 -0
- package/src/components/RuleResultSegments.js +102 -0
- package/src/components/RuleResultSegmentsLoader.js +34 -0
- package/src/components/RuleResultsRoutes.js +73 -0
- package/src/components/RuleRoutes.js +4 -14
- package/src/components/RuleSelector.js +5 -2
- package/src/components/__test_samples__/NewRuleImplementationProps.js +22 -2
- package/src/components/__tests__/ExecutionDetails.spec.js +5 -5
- package/src/components/__tests__/NewRuleImplementation.spec.js +27 -7
- package/src/components/__tests__/RuleResultSegmentsLoader.spec.js +32 -0
- package/src/components/__tests__/__snapshots__/ExecutionDetails.spec.js.snap +2 -30
- package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +1211 -1217
- package/src/components/__tests__/__snapshots__/RuleImplementationProperties.spec.js.snap +1 -0
- package/src/components/index.js +2 -2
- package/src/components/ruleImplementationForm/DatasetForm.js +4 -1
- package/src/components/ruleImplementationForm/FieldsGrid.js +57 -0
- package/src/components/ruleImplementationForm/FieldsGroup.js +107 -0
- package/src/components/ruleImplementationForm/RuleImplementationForm.js +45 -0
- package/src/components/ruleImplementationForm/SegmentsForm.js +35 -0
- package/src/components/ruleImplementationForm/__tests__/DataSetForm.spec.js +0 -1
- package/src/components/ruleImplementationForm/__tests__/RuleImplementationForm.spec.js +27 -10
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationForm.spec.js.snap +315 -91
- package/src/messages/en.js +7 -0
- package/src/messages/es.js +7 -0
- package/src/reducers/__tests__/segmentResult.spec.js +46 -0
- package/src/reducers/index.js +2 -0
- package/src/reducers/ruleImplementation.js +1 -0
- package/src/reducers/segmentResults.js +19 -0
- package/src/routines.js +3 -0
- package/src/sagas/__tests__/fetchSegmentResults.spec.js +78 -0
- package/src/sagas/fetchSegmentResults.js +30 -0
- package/src/sagas/index.js +3 -0
- package/src/services/encodeRawContent.js +5 -5
- package/src/styles/remediationPlan.less +5 -0
- package/src/styles/ruleImplementationForm/DatasetForm.less +5 -0
|
@@ -31,7 +31,8 @@ import {
|
|
|
31
31
|
getImplementationStructuresLoaded,
|
|
32
32
|
} from "../selectors";
|
|
33
33
|
import EditRule from "./EditRule";
|
|
34
|
-
import
|
|
34
|
+
import RuleResultDetails from "./RuleResultDetails";
|
|
35
|
+
import RuleResultsRoutes from "./RuleResultsRoutes";
|
|
35
36
|
import ImplementationStructures from "./ImplementationStructures";
|
|
36
37
|
import ImplementationStructuresNew from "./ImplementationStructuresNew";
|
|
37
38
|
import MoveImplementation from "./MoveImplementation";
|
|
@@ -415,27 +416,16 @@ const ImplementationRoutes = ({
|
|
|
415
416
|
<Segment>
|
|
416
417
|
{ruleLoaded && ruleImplementationLoaded && (
|
|
417
418
|
<RuleImplementation>
|
|
418
|
-
<
|
|
419
|
+
<RuleResultDetails ruleResultId={latest.id} />
|
|
419
420
|
</RuleImplementation>
|
|
420
421
|
)}
|
|
421
422
|
</Segment>
|
|
422
423
|
</>
|
|
423
424
|
)}
|
|
424
425
|
/>
|
|
425
|
-
|
|
426
426
|
<Route
|
|
427
|
-
exact
|
|
428
427
|
path={RULE_IMPLEMENTATION_RESULT_DETAILS}
|
|
429
|
-
render={() =>
|
|
430
|
-
<>
|
|
431
|
-
<Segment>
|
|
432
|
-
<>
|
|
433
|
-
<RuleCrumbs />
|
|
434
|
-
<ExecutionDetails />
|
|
435
|
-
</>
|
|
436
|
-
</Segment>
|
|
437
|
-
</>
|
|
438
|
-
)}
|
|
428
|
+
render={() => <RuleResultsRoutes />}
|
|
439
429
|
/>
|
|
440
430
|
</>
|
|
441
431
|
)}
|
|
@@ -29,14 +29,17 @@ export const RuleSelector = ({ rules, control, loading }) => {
|
|
|
29
29
|
control={control}
|
|
30
30
|
name="rule_id"
|
|
31
31
|
rules={{ required: true }}
|
|
32
|
-
render={({
|
|
32
|
+
render={({
|
|
33
|
+
field: { onBlur, onChange, value },
|
|
34
|
+
fieldState: { error },
|
|
35
|
+
}) => (
|
|
33
36
|
<Form.Select
|
|
34
37
|
label={{
|
|
35
38
|
children: formatMessage({ id: "rule" }),
|
|
36
39
|
htmlFor: "rule_id",
|
|
37
40
|
}}
|
|
38
41
|
deburr
|
|
39
|
-
error={
|
|
42
|
+
error={!!error}
|
|
40
43
|
loading={loading}
|
|
41
44
|
onBlur={onBlur}
|
|
42
45
|
onChange={(_e, { value }) => onChange(value)}
|
|
@@ -239,9 +239,29 @@ export const newRuleImplementationProps = {
|
|
|
239
239
|
],
|
|
240
240
|
},
|
|
241
241
|
],
|
|
242
|
+
segments: [
|
|
243
|
+
{
|
|
244
|
+
structure: {
|
|
245
|
+
external_id:
|
|
246
|
+
"/home/alberto/projects/connectors/td-connector-txt-files/data/########_D_PELAYO_POLIZAS_20201202033016_I.txt[Agencia]",
|
|
247
|
+
id: 4814766,
|
|
248
|
+
metadata: {
|
|
249
|
+
order: "6",
|
|
250
|
+
},
|
|
251
|
+
name: "Agencia",
|
|
252
|
+
path: ["Area_Vida", "########_D_PELAYO_POLIZAS_20201202033016_I.txt"],
|
|
253
|
+
system: {
|
|
254
|
+
external_id: "file_system",
|
|
255
|
+
id: 33,
|
|
256
|
+
name: "File System",
|
|
257
|
+
},
|
|
258
|
+
type: "Column",
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
],
|
|
242
262
|
result_type: "errors_number",
|
|
243
|
-
minimum:
|
|
244
|
-
goal:
|
|
263
|
+
minimum: 20,
|
|
264
|
+
goal: 10,
|
|
245
265
|
raw_content: {},
|
|
246
266
|
},
|
|
247
267
|
ruleImplementationRaw: {},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Suspense } from "react";
|
|
2
2
|
import { render } from "@truedat/test/render";
|
|
3
3
|
import messages from "@truedat/dq/messages";
|
|
4
|
-
import {
|
|
4
|
+
import { RuleResultDetails } from "../RuleResultDetails";
|
|
5
5
|
|
|
6
6
|
jest.mock("react-router-dom", () => ({
|
|
7
7
|
...jest.requireActual("react-router-dom"),
|
|
@@ -18,7 +18,7 @@ const renderOpts = {
|
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
describe("<
|
|
21
|
+
describe("<RuleResultDetails>", () => {
|
|
22
22
|
it("matches the latest snapshot", () => {
|
|
23
23
|
const props = {
|
|
24
24
|
ruleImplementation: {
|
|
@@ -27,7 +27,7 @@ describe("<ExecutionDetails>", () => {
|
|
|
27
27
|
};
|
|
28
28
|
const { container } = render(
|
|
29
29
|
<Suspense fallback={null}>
|
|
30
|
-
<
|
|
30
|
+
<RuleResultDetails {...props} />
|
|
31
31
|
</Suspense>,
|
|
32
32
|
renderOpts
|
|
33
33
|
);
|
|
@@ -51,7 +51,7 @@ describe("<ExecutionDetails>", () => {
|
|
|
51
51
|
};
|
|
52
52
|
const { getByText } = render(
|
|
53
53
|
<Suspense fallback={null}>
|
|
54
|
-
<
|
|
54
|
+
<RuleResultDetails {...props} />
|
|
55
55
|
</Suspense>,
|
|
56
56
|
renderOpts
|
|
57
57
|
);
|
|
@@ -67,7 +67,7 @@ describe("<ExecutionDetails>", () => {
|
|
|
67
67
|
};
|
|
68
68
|
const { container } = render(
|
|
69
69
|
<Suspense fallback={null}>
|
|
70
|
-
<
|
|
70
|
+
<RuleResultDetails {...propsWithoutDetails} />
|
|
71
71
|
</Suspense>,
|
|
72
72
|
renderOpts
|
|
73
73
|
);
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { shallow } from "enzyme";
|
|
1
|
+
import React, { Suspense } from "react";
|
|
2
|
+
// import { shallow } from "enzyme";
|
|
3
|
+
import { render } from "@truedat/test/render";
|
|
3
4
|
import { NewRuleImplementation } from "../NewRuleImplementation";
|
|
4
5
|
import { newRuleImplementationProps } from "../__test_samples__/NewRuleImplementationProps";
|
|
6
|
+
import messages from "../../messages/en";
|
|
5
7
|
|
|
6
8
|
describe("<NewRuleImplementation />", () => {
|
|
9
|
+
const renderOpts = {
|
|
10
|
+
messages: { en: messages },
|
|
11
|
+
state: { ruleImplementationCreating: false },
|
|
12
|
+
};
|
|
13
|
+
|
|
7
14
|
const createRuleImplementation = jest.fn();
|
|
8
15
|
const updateRuleImplementation = jest.fn();
|
|
9
16
|
const sources = [{ id: 1, external_id: "foo", config: { alias: ["foo"] } }];
|
|
@@ -16,14 +23,27 @@ describe("<NewRuleImplementation />", () => {
|
|
|
16
23
|
};
|
|
17
24
|
|
|
18
25
|
it("matches the latest snapshot", () => {
|
|
19
|
-
const
|
|
20
|
-
|
|
26
|
+
const { container } = render(
|
|
27
|
+
<Suspense fallback={null}>
|
|
28
|
+
<NewRuleImplementation {...props} />
|
|
29
|
+
</Suspense>,
|
|
30
|
+
renderOpts
|
|
31
|
+
);
|
|
32
|
+
expect(container).toMatchSnapshot();
|
|
21
33
|
});
|
|
22
34
|
|
|
23
35
|
it("calculate aliases when not informed", () => {
|
|
24
|
-
const
|
|
25
|
-
|
|
36
|
+
const applyTemplate = jest.fn();
|
|
37
|
+
const props = {
|
|
38
|
+
...newRuleImplementationProps,
|
|
39
|
+
applyTemplate: applyTemplate,
|
|
40
|
+
};
|
|
41
|
+
const { container } = render(
|
|
42
|
+
<Suspense fallback={null}>
|
|
43
|
+
<NewRuleImplementation {...props} />
|
|
44
|
+
</Suspense>,
|
|
45
|
+
renderOpts
|
|
26
46
|
);
|
|
27
|
-
expect(
|
|
47
|
+
expect(container).toMatchSnapshot();
|
|
28
48
|
});
|
|
29
49
|
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { mount } from "enzyme";
|
|
3
|
+
import { RuleResultSegmentsLoader } from "../RuleResultSegmentsLoader";
|
|
4
|
+
|
|
5
|
+
jest.mock("react-router-dom", () => ({
|
|
6
|
+
...jest.requireActual("react-router-dom"),
|
|
7
|
+
useParams: () => ({ rule_result_id: 123 }),
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
describe("<RuleResultSegmentsLoader />", () => {
|
|
11
|
+
it("calls fetchSegmentResults when component mounts but not when it unmounts", () => {
|
|
12
|
+
const props = {
|
|
13
|
+
clearSegmentResults: jest.fn(),
|
|
14
|
+
fetchSegmentResults: jest.fn(),
|
|
15
|
+
};
|
|
16
|
+
const wrapper = mount(<RuleResultSegmentsLoader {...props} />);
|
|
17
|
+
expect(props.fetchSegmentResults.mock.calls.length).toBe(1);
|
|
18
|
+
wrapper.unmount();
|
|
19
|
+
expect(props.fetchSegmentResults.mock.calls.length).toBe(1);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("calls clearSegmentResults when component unmounts but not when it mounts", () => {
|
|
23
|
+
const props = {
|
|
24
|
+
clearSegmentResults: jest.fn(),
|
|
25
|
+
fetchSegmentResults: jest.fn(),
|
|
26
|
+
};
|
|
27
|
+
const wrapper = mount(<RuleResultSegmentsLoader {...props} />);
|
|
28
|
+
expect(props.clearSegmentResults.mock.calls.length).toBe(0);
|
|
29
|
+
wrapper.unmount();
|
|
30
|
+
expect(props.clearSegmentResults.mock.calls.length).toBe(1);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<
|
|
3
|
+
exports[`<RuleResultDetails> matches the latest snapshot 1`] = `
|
|
4
4
|
<div>
|
|
5
|
-
<h2
|
|
6
|
-
class="ui header"
|
|
7
|
-
style="display: none;"
|
|
8
|
-
>
|
|
9
|
-
<i
|
|
10
|
-
aria-hidden="true"
|
|
11
|
-
class="chart pie circular icon"
|
|
12
|
-
/>
|
|
13
|
-
<div
|
|
14
|
-
class="content"
|
|
15
|
-
>
|
|
16
|
-
Rule execution result
|
|
17
|
-
</div>
|
|
18
|
-
</h2>
|
|
19
5
|
<table
|
|
20
6
|
class="ui table implementation-results medium"
|
|
21
|
-
style="display: none;"
|
|
22
7
|
>
|
|
23
8
|
<thead
|
|
24
9
|
class=""
|
|
@@ -128,21 +113,8 @@ exports[`<ExecutionDetails> matches the latest snapshot 1`] = `
|
|
|
128
113
|
</div>
|
|
129
114
|
`;
|
|
130
115
|
|
|
131
|
-
exports[`<
|
|
116
|
+
exports[`<RuleResultDetails> without details 1`] = `
|
|
132
117
|
<div>
|
|
133
|
-
<h2
|
|
134
|
-
class="ui header"
|
|
135
|
-
>
|
|
136
|
-
<i
|
|
137
|
-
aria-hidden="true"
|
|
138
|
-
class="chart pie circular icon"
|
|
139
|
-
/>
|
|
140
|
-
<div
|
|
141
|
-
class="content"
|
|
142
|
-
>
|
|
143
|
-
Rule execution result
|
|
144
|
-
</div>
|
|
145
|
-
</h2>
|
|
146
118
|
<table
|
|
147
119
|
class="ui table implementation-results medium"
|
|
148
120
|
>
|