@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
|
@@ -9,7 +9,7 @@ import { RuleImplementationRawForm } from "../RuleImplementationRawForm";
|
|
|
9
9
|
jest.spyOn(React, "useContext").mockImplementation(() => intl);
|
|
10
10
|
jest.mock("react-router-dom", () => ({
|
|
11
11
|
...jest.requireActual("react-router-dom"),
|
|
12
|
-
useHistory: () => ({ push: jest.fn() })
|
|
12
|
+
useHistory: () => ({ push: jest.fn() }),
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
15
|
describe("<RuleImplementationRawForm />", () => {
|
|
@@ -20,36 +20,42 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
20
20
|
{
|
|
21
21
|
id: 1,
|
|
22
22
|
config: { alias: "source1", job_types: ["quality"] },
|
|
23
|
-
external_id: "ext_id_1"
|
|
23
|
+
external_id: "ext_id_1",
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
id: 2,
|
|
27
27
|
config: {
|
|
28
28
|
alias: "source2",
|
|
29
29
|
job_types: ["quality"],
|
|
30
|
-
databases: ["db1", "db2"]
|
|
30
|
+
databases: ["db1", "db2"],
|
|
31
31
|
},
|
|
32
|
-
external_id: "ext_id_2"
|
|
32
|
+
external_id: "ext_id_2",
|
|
33
33
|
},
|
|
34
|
-
{ id: 3, config: {}, external_id: "ext_id_3" }
|
|
34
|
+
{ id: 3, config: {}, external_id: "ext_id_3" },
|
|
35
35
|
];
|
|
36
36
|
const setImplementationRawContent = jest.fn();
|
|
37
37
|
|
|
38
38
|
const props = {
|
|
39
39
|
implementationKey: "",
|
|
40
40
|
setImplementationKey: jest.fn(),
|
|
41
|
-
ruleImplementation: {
|
|
41
|
+
ruleImplementation: {
|
|
42
|
+
id: 1,
|
|
43
|
+
executable: true,
|
|
44
|
+
goal: "10",
|
|
45
|
+
minimum: "1",
|
|
46
|
+
result_type: "percentage",
|
|
47
|
+
},
|
|
42
48
|
rawContent: {
|
|
43
49
|
dataset: "",
|
|
44
50
|
source_id: 1,
|
|
45
51
|
population: "",
|
|
46
|
-
validations: ""
|
|
52
|
+
validations: "",
|
|
47
53
|
},
|
|
48
54
|
setImplementationRawContent: setImplementationRawContent,
|
|
49
55
|
handleSubmit,
|
|
50
56
|
isSubmitting,
|
|
51
57
|
sources,
|
|
52
|
-
onChange
|
|
58
|
+
onChange,
|
|
53
59
|
};
|
|
54
60
|
|
|
55
61
|
it("matches the latest snapshot", () => {
|
|
@@ -63,8 +69,8 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
63
69
|
rawContent: {
|
|
64
70
|
dataset: "cliente c join address a on c.address_id=a.id",
|
|
65
71
|
population: "",
|
|
66
|
-
validations: "a.city='MADRID'"
|
|
67
|
-
}
|
|
72
|
+
validations: "a.city='MADRID'",
|
|
73
|
+
},
|
|
68
74
|
};
|
|
69
75
|
|
|
70
76
|
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
@@ -79,8 +85,8 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
79
85
|
dataset: "cliente c join address a on c.address_id=a.id",
|
|
80
86
|
source_id: 2,
|
|
81
87
|
population: "",
|
|
82
|
-
validations: "a.city='MADRID'"
|
|
83
|
-
}
|
|
88
|
+
validations: "a.city='MADRID'",
|
|
89
|
+
},
|
|
84
90
|
};
|
|
85
91
|
|
|
86
92
|
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
@@ -95,8 +101,8 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
95
101
|
dataset: "cliente c join address a on c.address_id=a.id",
|
|
96
102
|
source_id: 1,
|
|
97
103
|
population: "",
|
|
98
|
-
validations: "a.city='MADRID'"
|
|
99
|
-
}
|
|
104
|
+
validations: "a.city='MADRID'",
|
|
105
|
+
},
|
|
100
106
|
};
|
|
101
107
|
|
|
102
108
|
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
@@ -112,8 +118,10 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
112
118
|
source_id: 2,
|
|
113
119
|
database: "db2",
|
|
114
120
|
population: "",
|
|
115
|
-
validations: "a.city='MADRID'"
|
|
116
|
-
}
|
|
121
|
+
validations: "a.city='MADRID'",
|
|
122
|
+
},
|
|
123
|
+
template: { id: 1 },
|
|
124
|
+
dfContent: {},
|
|
117
125
|
};
|
|
118
126
|
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
119
127
|
const submitButton = wrapper.find("FormButton[type='submit']");
|
|
@@ -127,8 +135,8 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
127
135
|
dataset: "address a on c.address_id=a.id",
|
|
128
136
|
source_id: 2,
|
|
129
137
|
population: "",
|
|
130
|
-
validations: "a.city='MADRID'"
|
|
131
|
-
}
|
|
138
|
+
validations: "a.city='MADRID'",
|
|
139
|
+
},
|
|
132
140
|
};
|
|
133
141
|
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
134
142
|
const submitButton = wrapper.find("FormButton[type='submit']");
|
|
@@ -138,12 +146,9 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
138
146
|
it("calls setImplementationRawContent when filling raw content input fields", () => {
|
|
139
147
|
const wrapper = shallow(<RuleImplementationRawForm {...props} />);
|
|
140
148
|
expect(setImplementationRawContent.mock.calls).toHaveLength(0);
|
|
141
|
-
wrapper
|
|
142
|
-
.
|
|
143
|
-
|
|
144
|
-
.simulate("change", null, {
|
|
145
|
-
value: "cliente c join address a on c.address_id=a.id"
|
|
146
|
-
});
|
|
149
|
+
wrapper.find("FormTextArea").at(0).simulate("change", null, {
|
|
150
|
+
value: "cliente c join address a on c.address_id=a.id",
|
|
151
|
+
});
|
|
147
152
|
expect(setImplementationRawContent.mock.calls).toHaveLength(1);
|
|
148
153
|
});
|
|
149
154
|
|
|
@@ -151,7 +156,7 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
151
156
|
const setImplementationRawContent = jest.fn();
|
|
152
157
|
const customProps = {
|
|
153
158
|
...props,
|
|
154
|
-
setImplementationRawContent
|
|
159
|
+
setImplementationRawContent,
|
|
155
160
|
};
|
|
156
161
|
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
157
162
|
|
|
@@ -160,7 +165,7 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
160
165
|
.find("FormDropdown[name='source_id']")
|
|
161
166
|
.at(0)
|
|
162
167
|
.simulate("change", null, {
|
|
163
|
-
value: 2
|
|
168
|
+
value: 2,
|
|
164
169
|
});
|
|
165
170
|
expect(setImplementationRawContent.mock.calls).toHaveLength(1);
|
|
166
171
|
expect(setImplementationRawContent).toHaveBeenCalledWith({
|
|
@@ -168,7 +173,7 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
168
173
|
dataset: "",
|
|
169
174
|
population: "",
|
|
170
175
|
source_id: 2,
|
|
171
|
-
validations: ""
|
|
176
|
+
validations: "",
|
|
172
177
|
});
|
|
173
178
|
});
|
|
174
179
|
|
|
@@ -179,8 +184,10 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
179
184
|
dataset: "cliente c join address a on c.address_id=a.id",
|
|
180
185
|
source_id: 1,
|
|
181
186
|
population: "",
|
|
182
|
-
validations: "a.city='MADRID'"
|
|
183
|
-
}
|
|
187
|
+
validations: "a.city='MADRID'",
|
|
188
|
+
},
|
|
189
|
+
template: { id: 1 },
|
|
190
|
+
dfContent: {},
|
|
184
191
|
};
|
|
185
192
|
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
186
193
|
const submitButton = wrapper.find("FormButton[type='submit']");
|
|
@@ -193,8 +200,8 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
193
200
|
rawContent: {
|
|
194
201
|
dataset: "insert into cliente c join address a on c.address_id=a.id",
|
|
195
202
|
population: "",
|
|
196
|
-
validations: "a.city='MADRID'"
|
|
197
|
-
}
|
|
203
|
+
validations: "a.city='MADRID'",
|
|
204
|
+
},
|
|
198
205
|
};
|
|
199
206
|
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
200
207
|
const submitButton = wrapper.find("FormButton[type='submit']");
|
|
@@ -208,8 +215,8 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
208
215
|
dataset: "insert into cliente c join address a on c.address_id=a.id",
|
|
209
216
|
source_id: 1,
|
|
210
217
|
population: "",
|
|
211
|
-
validations: "a.city='MADRID'"
|
|
212
|
-
}
|
|
218
|
+
validations: "a.city='MADRID'",
|
|
219
|
+
},
|
|
213
220
|
};
|
|
214
221
|
const wrapper = shallow(<RuleImplementationRawForm {...customProps} />);
|
|
215
222
|
const datasetTextArea = wrapper.find("FormTextArea").at(0);
|
|
@@ -219,7 +226,7 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
219
226
|
id="ruleImplementationRawForm.rawText.error"
|
|
220
227
|
values={{ invalid_content: <i>insert</i> }}
|
|
221
228
|
/>
|
|
222
|
-
)
|
|
229
|
+
),
|
|
223
230
|
});
|
|
224
231
|
});
|
|
225
232
|
|
|
@@ -228,7 +235,7 @@ describe("<RuleImplementationRawForm />", () => {
|
|
|
228
235
|
const radio = wrapper.find({ name: "executable" }).at(0);
|
|
229
236
|
|
|
230
237
|
radio.simulate("change", null, {
|
|
231
|
-
checked: false
|
|
238
|
+
checked: false,
|
|
232
239
|
});
|
|
233
240
|
|
|
234
241
|
expect(onChange).toHaveBeenCalledWith("executable", false);
|