@truedat/dq 4.56.3 → 4.56.5
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 +12 -0
- package/package.json +5 -5
- package/src/components/ConditionSummary.js +35 -18
- package/src/components/__tests__/NewRuleImplementation.spec.js +24 -0
- package/src/components/__tests__/__snapshots__/ConditionSummary.spec.js.snap +1 -3
- package/src/components/__tests__/__snapshots__/ImplementationSummary.spec.js.snap +1 -2
- package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +5 -9
- package/src/components/ruleImplementationForm/FieldModifier.js +1 -0
- package/src/components/ruleImplementationForm/FiltersField.js +1 -0
- package/src/components/ruleImplementationForm/FiltersGrid.js +18 -7
- package/src/messages/en.js +5 -5
- package/src/messages/es.js +4 -4
- package/src/reducers/dqMessage.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.56.5] 2022-11-28
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- [TD-4711] Improve error reporting for implementation upload
|
|
8
|
+
|
|
9
|
+
## [4.56.4] 2022-11-26
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- [TD-5247] Keep table name if structure field dropdown item changes
|
|
14
|
+
|
|
3
15
|
## [4.56.3] 2022-11-24
|
|
4
16
|
|
|
5
17
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dq",
|
|
3
|
-
"version": "4.56.
|
|
3
|
+
"version": "4.56.5",
|
|
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.4",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "4.56.
|
|
37
|
+
"@truedat/test": "4.56.5",
|
|
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",
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
95
|
"@apollo/client": "^3.7.0",
|
|
96
|
-
"@truedat/core": "4.56.
|
|
97
|
-
"@truedat/df": "4.56.
|
|
96
|
+
"@truedat/core": "4.56.5",
|
|
97
|
+
"@truedat/df": "4.56.5",
|
|
98
98
|
"graphql": "^15.5.3",
|
|
99
99
|
"path-to-regexp": "^1.7.0",
|
|
100
100
|
"prop-types": "^15.8.1",
|
|
@@ -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": "004b5727c2454992c5c8a3e93de617b7dbb86009"
|
|
118
118
|
}
|
|
@@ -9,26 +9,31 @@ import { linkTo } from "@truedat/core/routes";
|
|
|
9
9
|
|
|
10
10
|
const concatValues = (values, link) => _.join(link)(values);
|
|
11
11
|
|
|
12
|
-
const LinkToStructure = ({ value }) =>
|
|
12
|
+
const LinkToStructure = ({ value, aliasArray }) =>
|
|
13
13
|
value?.id ? (
|
|
14
14
|
<Link to={linkTo.STRUCTURE({ id: value.id })}>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
<div className="highlighted">
|
|
16
|
+
{qualifySqlIdentifier({ aliasArray, value })}
|
|
17
|
+
</div>{" "}
|
|
18
18
|
</Link>
|
|
19
19
|
) : (
|
|
20
20
|
<span>{value.name}</span>
|
|
21
21
|
);
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
LinkToStructure.propTypes = {
|
|
24
|
+
value: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
25
|
+
aliasArray: PropTypes.array,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const FormattedLink = ({ value, aliasArray, operator = {} }) => {
|
|
24
29
|
switch (operator?.value_type) {
|
|
25
30
|
case "field":
|
|
26
|
-
return <LinkToStructure value={value} />;
|
|
31
|
+
return <LinkToStructure value={value} aliasArray={aliasArray} />;
|
|
27
32
|
case "field_list":
|
|
28
33
|
return (
|
|
29
34
|
<>
|
|
30
35
|
{_.map.convert({ cap: false })((v, i) => (
|
|
31
|
-
<LinkToStructure key={i} value={v} />
|
|
36
|
+
<LinkToStructure key={i} value={v} aliasArray={aliasArray} />
|
|
32
37
|
))(value)}
|
|
33
38
|
</>
|
|
34
39
|
);
|
|
@@ -49,6 +54,7 @@ const FormattedLink = ({ value, operator = {} }) => {
|
|
|
49
54
|
FormattedLink.propTypes = {
|
|
50
55
|
value: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
51
56
|
operator: PropTypes.object,
|
|
57
|
+
aliasArray: PropTypes.array,
|
|
52
58
|
};
|
|
53
59
|
|
|
54
60
|
const nilOrEmpty = (v) => _.isNil(v) || v === "";
|
|
@@ -101,7 +107,7 @@ export const getValues = ({ value = [], operator = {}, value_modifier }) => {
|
|
|
101
107
|
? valuesFromKeys(
|
|
102
108
|
defaultOrValue,
|
|
103
109
|
["name"],
|
|
104
|
-
["path", "id", "type", "parent_index"],
|
|
110
|
+
["path", "metadata", "id", "type", "parent_index"],
|
|
105
111
|
value_modifier
|
|
106
112
|
)
|
|
107
113
|
: valuesFromKeys(defaultOrValue, ["raw"], [], value_modifier);
|
|
@@ -124,12 +130,15 @@ OperatorMessage.propTypes = {
|
|
|
124
130
|
operator: PropTypes.object,
|
|
125
131
|
};
|
|
126
132
|
|
|
133
|
+
const qualifySqlIdentifier = ({ aliasArray, value }) =>
|
|
134
|
+
_.flow(
|
|
135
|
+
_.find({ index: value?.parent_index }),
|
|
136
|
+
_.propOr(null, "text"),
|
|
137
|
+
_.defaultTo(value?.metadata?.table || _.last(value?.path)),
|
|
138
|
+
(qualifier) => (qualifier ? `(${qualifier}).${value?.name}` : value?.name)
|
|
139
|
+
)(aliasArray);
|
|
140
|
+
|
|
127
141
|
const ConditionCell = ({ row, alias, validationPopulationCondition }) => {
|
|
128
|
-
const alias_text =
|
|
129
|
-
_.flow(
|
|
130
|
-
_.find({ index: row.structure?.parent_index }),
|
|
131
|
-
_.propOr(null, "text")
|
|
132
|
-
)(alias) || (row.structure ? _.last(row.structure.path) : null);
|
|
133
142
|
const values = getValues(row);
|
|
134
143
|
const operator = _.prop("operator")(row);
|
|
135
144
|
const { formatMessage } = useIntl();
|
|
@@ -154,8 +163,10 @@ const ConditionCell = ({ row, alias, validationPopulationCondition }) => {
|
|
|
154
163
|
})}
|
|
155
164
|
>
|
|
156
165
|
<span className="highlighted">
|
|
157
|
-
{
|
|
158
|
-
|
|
166
|
+
{qualifySqlIdentifier({
|
|
167
|
+
aliasArray: alias,
|
|
168
|
+
value: row.structure,
|
|
169
|
+
})}
|
|
159
170
|
</span>
|
|
160
171
|
</Link>
|
|
161
172
|
</>
|
|
@@ -190,8 +201,10 @@ const ConditionCell = ({ row, alias, validationPopulationCondition }) => {
|
|
|
190
201
|
})}
|
|
191
202
|
>
|
|
192
203
|
<span className="highlighted">
|
|
193
|
-
{
|
|
194
|
-
|
|
204
|
+
{qualifySqlIdentifier({
|
|
205
|
+
aliasArray: alias,
|
|
206
|
+
value: row,
|
|
207
|
+
})}
|
|
195
208
|
</span>
|
|
196
209
|
</Link>
|
|
197
210
|
) : (
|
|
@@ -214,7 +227,11 @@ const ConditionCell = ({ row, alias, validationPopulationCondition }) => {
|
|
|
214
227
|
<Table.Cell width={5}>
|
|
215
228
|
{_.map.convert({ cap: false })((value, i) => (
|
|
216
229
|
<Fragment key={i}>
|
|
217
|
-
<FormattedLink
|
|
230
|
+
<FormattedLink
|
|
231
|
+
value={value}
|
|
232
|
+
operator={operator}
|
|
233
|
+
aliasArray={alias}
|
|
234
|
+
/>
|
|
218
235
|
{i + 1 < _.size(values) && (
|
|
219
236
|
<span>
|
|
220
237
|
{" "}
|
|
@@ -266,6 +266,18 @@ describe("<NewRuleImplementation> NewRuleImplementation doSubmit", () => {
|
|
|
266
266
|
fields: [
|
|
267
267
|
{
|
|
268
268
|
id: 11127109,
|
|
269
|
+
metadata: {
|
|
270
|
+
data_type_class: "string",
|
|
271
|
+
database: "xe",
|
|
272
|
+
default: "None",
|
|
273
|
+
host: "localhost",
|
|
274
|
+
nullable: false,
|
|
275
|
+
order: "4",
|
|
276
|
+
precision: "25",
|
|
277
|
+
schema: "HR",
|
|
278
|
+
table: "EMPLOYEES",
|
|
279
|
+
type: "VARCHAR2",
|
|
280
|
+
},
|
|
269
281
|
name: "EMAIL",
|
|
270
282
|
parent_index: 4,
|
|
271
283
|
path: undefined,
|
|
@@ -273,6 +285,18 @@ describe("<NewRuleImplementation> NewRuleImplementation doSubmit", () => {
|
|
|
273
285
|
},
|
|
274
286
|
{
|
|
275
287
|
id: 11127116,
|
|
288
|
+
metadata: {
|
|
289
|
+
data_type_class: "string",
|
|
290
|
+
database: "xe",
|
|
291
|
+
default: "None",
|
|
292
|
+
host: "localhost",
|
|
293
|
+
nullable: true,
|
|
294
|
+
order: "5",
|
|
295
|
+
precision: "20",
|
|
296
|
+
schema: "HR",
|
|
297
|
+
table: "EMPLOYEES",
|
|
298
|
+
type: "VARCHAR2",
|
|
299
|
+
},
|
|
276
300
|
name: "PHONE_NUMBER",
|
|
277
301
|
parent_index: 4,
|
|
278
302
|
path: undefined,
|
|
@@ -629,9 +629,7 @@ exports[`<NewRuleImplementation /> calculate aliases when not informed 1`] = `
|
|
|
629
629
|
<span
|
|
630
630
|
class="highlighted"
|
|
631
631
|
>
|
|
632
|
-
(table2).
|
|
633
|
-
|
|
634
|
-
"descripcion"
|
|
632
|
+
(table2).descripcion
|
|
635
633
|
</span>
|
|
636
634
|
</a>
|
|
637
635
|
</td>
|
|
@@ -650,11 +648,11 @@ exports[`<NewRuleImplementation /> calculate aliases when not informed 1`] = `
|
|
|
650
648
|
<a
|
|
651
649
|
href="/structures/4814767"
|
|
652
650
|
>
|
|
653
|
-
<
|
|
651
|
+
<div
|
|
654
652
|
class="highlighted"
|
|
655
653
|
>
|
|
656
|
-
|
|
657
|
-
</
|
|
654
|
+
(FS).external
|
|
655
|
+
</div>
|
|
658
656
|
|
|
659
657
|
</a>
|
|
660
658
|
</td>
|
|
@@ -719,9 +717,7 @@ exports[`<NewRuleImplementation /> calculate aliases when not informed 1`] = `
|
|
|
719
717
|
<span
|
|
720
718
|
class="highlighted"
|
|
721
719
|
>
|
|
722
|
-
(FS).
|
|
723
|
-
|
|
724
|
-
"agent"
|
|
720
|
+
(FS).agent
|
|
725
721
|
</span>
|
|
726
722
|
</a>
|
|
727
723
|
</td>
|
|
@@ -25,7 +25,9 @@ export const FiltersGrid = ({
|
|
|
25
25
|
|
|
26
26
|
const onStructureChange = (index, value) => {
|
|
27
27
|
const structure = {
|
|
28
|
-
..._.pick(["field_type", "name", "parent_index", "type"])(
|
|
28
|
+
..._.pick(["field_type", "name", "parent_index", "type", "metadata"])(
|
|
29
|
+
value
|
|
30
|
+
),
|
|
29
31
|
id: value.data_structure_id,
|
|
30
32
|
};
|
|
31
33
|
setRowValue({
|
|
@@ -56,12 +58,21 @@ export const FiltersGrid = ({
|
|
|
56
58
|
});
|
|
57
59
|
};
|
|
58
60
|
|
|
59
|
-
const composeFieldValue = (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
const composeFieldValue = ({
|
|
62
|
+
data_structure_id,
|
|
63
|
+
id,
|
|
64
|
+
name,
|
|
65
|
+
path,
|
|
66
|
+
metadata,
|
|
67
|
+
parent_index,
|
|
68
|
+
type,
|
|
69
|
+
}) => ({
|
|
70
|
+
id: data_structure_id || id,
|
|
71
|
+
name,
|
|
72
|
+
path,
|
|
73
|
+
metadata,
|
|
74
|
+
parent_index,
|
|
75
|
+
type,
|
|
65
76
|
});
|
|
66
77
|
|
|
67
78
|
const composeValue = (value_type, value) => {
|
package/src/messages/en.js
CHANGED
|
@@ -572,10 +572,10 @@ export default {
|
|
|
572
572
|
"The implementation has not changed",
|
|
573
573
|
"ruleImplementations.upload.failed.header":
|
|
574
574
|
"Error uploading file. No rules have been created.",
|
|
575
|
-
"ruleImplementations.upload.failed.
|
|
576
|
-
"
|
|
575
|
+
"ruleImplementations.upload.failed.missing_required_columns":
|
|
576
|
+
"Missing required columns. Expected [{expected}]. Found [{found}].",
|
|
577
577
|
"ruleImplementations.upload.success.errors":
|
|
578
|
-
"Error in {implementation_key} attribute: {key} message: {message}
|
|
578
|
+
"Error in {implementation_key} attribute: {key} message: {message}",
|
|
579
579
|
"ruleImplementations.upload.success.header":
|
|
580
580
|
"Upload success! Loaded {count_ids} omitted {count_errors}",
|
|
581
581
|
"ruleResult": "Rule execution result",
|
|
@@ -614,10 +614,10 @@ export default {
|
|
|
614
614
|
"rules.searching": "Searching...",
|
|
615
615
|
"rules.upload.failed.header":
|
|
616
616
|
"Error uploading file. No rules have been created.",
|
|
617
|
-
"rules.upload.failed.
|
|
617
|
+
"rules.upload.failed.missing_required_columns":
|
|
618
618
|
"Missing required columns. Expected [{expected}]. Found [{found}].",
|
|
619
619
|
"rules.upload.success.errors":
|
|
620
|
-
"Error in {rule_name} attribute: {key} message: {message}
|
|
620
|
+
"Error in {rule_name} attribute: {key} message: {message}",
|
|
621
621
|
"rules.upload.success.header":
|
|
622
622
|
"Upload successful! Loaded {count_ids} omitted {count_errors}",
|
|
623
623
|
"segmentsForm.add.text": "Add Segment",
|
package/src/messages/es.js
CHANGED
|
@@ -593,10 +593,10 @@ export default {
|
|
|
593
593
|
"La implementación no ha cambiado",
|
|
594
594
|
"ruleImplementations.upload.failed.header":
|
|
595
595
|
"Error al subir el fichero. No se ha realizado ninguna inserción.",
|
|
596
|
-
"ruleImplementations.upload.failed.
|
|
596
|
+
"ruleImplementations.upload.failed.missing_required_columns":
|
|
597
597
|
"Faltan columnas obligatorias en el fichero. Esperado [{expected}]. Recibido [{found}].",
|
|
598
598
|
"ruleImplementations.upload.success.errors":
|
|
599
|
-
"Error en {
|
|
599
|
+
"Error en {implementation_key} atributo: {key} mensaje: {message}",
|
|
600
600
|
"ruleImplementations.upload.success.header":
|
|
601
601
|
"¡Fichero subido correctamente! subidos {count_ids} errores {count_errors}",
|
|
602
602
|
"ruleResult": "Resultado de ejecución de regla",
|
|
@@ -636,10 +636,10 @@ export default {
|
|
|
636
636
|
"rules.searching": "Buscando...",
|
|
637
637
|
"rules.upload.failed.header":
|
|
638
638
|
"Error al subir el fichero. No se ha realizado ninguna inserción.",
|
|
639
|
-
"rules.upload.failed.
|
|
639
|
+
"rules.upload.failed.missing_required_columns":
|
|
640
640
|
"Faltan columnas obligatorias en el fichero. Esperado [{expected}]. Recibido [{found}].",
|
|
641
641
|
"rules.upload.success.errors":
|
|
642
|
-
"Error en {rule_name} atributo: {key} mensaje: {message}
|
|
642
|
+
"Error en {rule_name} atributo: {key} mensaje: {message}",
|
|
643
643
|
"rules.upload.success.header":
|
|
644
644
|
"¡Fichero subido correctamente! subidos {count_ids} errores {count_errors}",
|
|
645
645
|
"segmentsForm.add.text": "Añadir segmentación",
|
|
@@ -61,12 +61,12 @@ const dqMessage = (state = initialState, { type, payload }) => {
|
|
|
61
61
|
const messagesImp = _.has("errors")(payload.data)
|
|
62
62
|
? _.flow(
|
|
63
63
|
_.propOr([], "errors"),
|
|
64
|
-
_.map((
|
|
64
|
+
_.map(({ implementation_key, message }) => ({
|
|
65
65
|
id: "ruleImplementations.upload.success.errors",
|
|
66
66
|
fields: {
|
|
67
|
-
|
|
68
|
-
key: Object.keys(
|
|
69
|
-
message:
|
|
67
|
+
implementation_key,
|
|
68
|
+
key: Object.keys(message)[0],
|
|
69
|
+
message: message[Object.keys(message)[0]][0],
|
|
70
70
|
},
|
|
71
71
|
defaultMessage:
|
|
72
72
|
"ruleImplementations.upload.success.errors.default",
|