@truedat/dq 4.56.0 → 4.56.2
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 +4 -4
- package/src/components/ConditionSummary.js +5 -5
- package/src/components/NewRuleImplementation.js +15 -14
- package/src/components/__tests__/ConditionSummary.spec.js +12 -1
- package/src/components/__tests__/__fixtures__/NewRuleImplementationProps.js +11 -0
- package/src/components/__tests__/__snapshots__/ConditionSummary.spec.js.snap +1 -0
- package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +26 -7
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dq",
|
|
3
|
-
"version": "4.56.
|
|
3
|
+
"version": "4.56.2",
|
|
4
4
|
"description": "Truedat Web Data Quality Module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -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.2",
|
|
97
|
+
"@truedat/df": "4.56.2",
|
|
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": "d76f2da5ed4892e557e4aa159d4e9ff009e0e853"
|
|
118
118
|
}
|
|
@@ -125,11 +125,11 @@ OperatorMessage.propTypes = {
|
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
const ConditionCell = ({ row, alias, validationPopulationCondition }) => {
|
|
128
|
-
const alias_text =
|
|
129
|
-
_.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
133
|
const values = getValues(row);
|
|
134
134
|
const operator = _.prop("operator")(row);
|
|
135
135
|
const { formatMessage } = useIntl();
|
|
@@ -358,7 +358,7 @@ export const NewRuleImplementation = ({
|
|
|
358
358
|
}
|
|
359
359
|
);
|
|
360
360
|
|
|
361
|
-
const
|
|
361
|
+
const withAliasText = (dataset) => {
|
|
362
362
|
const duplicatedStructures = _.flow(
|
|
363
363
|
_.groupBy("structure.id"),
|
|
364
364
|
_.pickBy((x) => x.length > 1),
|
|
@@ -366,23 +366,24 @@ export const NewRuleImplementation = ({
|
|
|
366
366
|
_.map(Number)
|
|
367
367
|
)(dataset);
|
|
368
368
|
return _.map((ds) =>
|
|
369
|
-
_.
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
...ds,
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
369
|
+
_.path("alias.text")(ds)
|
|
370
|
+
? ds
|
|
371
|
+
: {
|
|
372
|
+
...ds,
|
|
373
|
+
alias: {
|
|
374
|
+
...ds.alias,
|
|
375
|
+
text:
|
|
376
|
+
_.has("structure.id")(ds) &&
|
|
377
|
+
_.includes(ds.structure.id)(duplicatedStructures)
|
|
378
|
+
? `${ds.structure?.name} (${ds.alias?.index})`
|
|
379
|
+
: `${ds.structure?.name}`,
|
|
380
|
+
},
|
|
381
|
+
}
|
|
381
382
|
)(dataset);
|
|
382
383
|
};
|
|
383
384
|
|
|
384
385
|
const setDataset = (dataset) => {
|
|
385
|
-
const cleanDataset =
|
|
386
|
+
const cleanDataset = withAliasText(dataset);
|
|
386
387
|
//remove invalid references of fields in validations and populations after dataset edition
|
|
387
388
|
const datasetStructures = _.map(_.path("structure.id"))(cleanDataset);
|
|
388
389
|
const all_fields = _.flow(
|
|
@@ -5,7 +5,12 @@ import { ConditionSummary } from "../ConditionSummary";
|
|
|
5
5
|
describe("<ConditionSummary />", () => {
|
|
6
6
|
const rows = [
|
|
7
7
|
{
|
|
8
|
-
structure: {
|
|
8
|
+
structure: {
|
|
9
|
+
field_type: "string",
|
|
10
|
+
name: "Mes",
|
|
11
|
+
id: 2598,
|
|
12
|
+
parent_index: 1,
|
|
13
|
+
},
|
|
9
14
|
operator: { name: "in_list", value_type: "string_list" },
|
|
10
15
|
value: [{ raw: ["4", "5", "6"] }],
|
|
11
16
|
},
|
|
@@ -14,6 +19,12 @@ describe("<ConditionSummary />", () => {
|
|
|
14
19
|
icon: "setting",
|
|
15
20
|
type: "filters",
|
|
16
21
|
rows,
|
|
22
|
+
alias: [
|
|
23
|
+
{
|
|
24
|
+
index: 1,
|
|
25
|
+
text: "foo_alias",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
17
28
|
};
|
|
18
29
|
const renderOpts = {
|
|
19
30
|
messages: {
|
|
@@ -37,6 +37,10 @@ export const newRuleImplementationProps = {
|
|
|
37
37
|
ruleImplementationProps: {
|
|
38
38
|
dataset: [
|
|
39
39
|
{
|
|
40
|
+
alias: {
|
|
41
|
+
index: 1,
|
|
42
|
+
text: "FS",
|
|
43
|
+
},
|
|
40
44
|
clauses: [],
|
|
41
45
|
structure: {
|
|
42
46
|
external_id: "/data/example.txt",
|
|
@@ -53,6 +57,10 @@ export const newRuleImplementationProps = {
|
|
|
53
57
|
},
|
|
54
58
|
},
|
|
55
59
|
{
|
|
60
|
+
alias: {
|
|
61
|
+
index: 2,
|
|
62
|
+
text: "table2",
|
|
63
|
+
},
|
|
56
64
|
clauses: [
|
|
57
65
|
{
|
|
58
66
|
left: {
|
|
@@ -67,6 +75,7 @@ export const newRuleImplementationProps = {
|
|
|
67
75
|
tablename: "table2",
|
|
68
76
|
type: "string",
|
|
69
77
|
},
|
|
78
|
+
parent_index: 2,
|
|
70
79
|
name: "capital",
|
|
71
80
|
path: ["bucket", "table2"],
|
|
72
81
|
system: {
|
|
@@ -82,6 +91,7 @@ export const newRuleImplementationProps = {
|
|
|
82
91
|
metadata: {
|
|
83
92
|
metadata: { order: "8" },
|
|
84
93
|
},
|
|
94
|
+
parent_index: 1,
|
|
85
95
|
name: "external",
|
|
86
96
|
path: ["Main", "example.txt"],
|
|
87
97
|
system: {
|
|
@@ -112,6 +122,7 @@ export const newRuleImplementationProps = {
|
|
|
112
122
|
},
|
|
113
123
|
type: "Table",
|
|
114
124
|
},
|
|
125
|
+
join_type: "inner"
|
|
115
126
|
},
|
|
116
127
|
],
|
|
117
128
|
deleted_at: null,
|
|
@@ -494,7 +494,7 @@ exports[`<NewRuleImplementation /> calculate aliases when not informed 1`] = `
|
|
|
494
494
|
</a>
|
|
495
495
|
<span>
|
|
496
496
|
(
|
|
497
|
-
|
|
497
|
+
FS
|
|
498
498
|
)
|
|
499
499
|
</span>
|
|
500
500
|
</td>
|
|
@@ -520,7 +520,7 @@ exports[`<NewRuleImplementation /> calculate aliases when not informed 1`] = `
|
|
|
520
520
|
</a>
|
|
521
521
|
<span>
|
|
522
522
|
(
|
|
523
|
-
table2
|
|
523
|
+
table2
|
|
524
524
|
)
|
|
525
525
|
</span>
|
|
526
526
|
<div
|
|
@@ -532,6 +532,25 @@ exports[`<NewRuleImplementation /> calculate aliases when not informed 1`] = `
|
|
|
532
532
|
class="item"
|
|
533
533
|
role="listitem"
|
|
534
534
|
>
|
|
535
|
+
<div
|
|
536
|
+
class="header"
|
|
537
|
+
>
|
|
538
|
+
Union type
|
|
539
|
+
</div>
|
|
540
|
+
<div
|
|
541
|
+
class="join_type"
|
|
542
|
+
>
|
|
543
|
+
<div
|
|
544
|
+
class="circle circle-left"
|
|
545
|
+
>
|
|
546
|
+
<div
|
|
547
|
+
class="circle circle-center fill"
|
|
548
|
+
/>
|
|
549
|
+
</div>
|
|
550
|
+
<div
|
|
551
|
+
class="circle circle-right"
|
|
552
|
+
/>
|
|
553
|
+
</div>
|
|
535
554
|
<div
|
|
536
555
|
class="header"
|
|
537
556
|
>
|
|
@@ -542,10 +561,10 @@ exports[`<NewRuleImplementation /> calculate aliases when not informed 1`] = `
|
|
|
542
561
|
class="item"
|
|
543
562
|
role="listitem"
|
|
544
563
|
>
|
|
545
|
-
(table2
|
|
564
|
+
(table2).capital
|
|
546
565
|
=
|
|
547
566
|
|
|
548
|
-
(
|
|
567
|
+
(FS).external
|
|
549
568
|
</div>
|
|
550
569
|
</div>
|
|
551
570
|
</td>
|
|
@@ -610,7 +629,7 @@ exports[`<NewRuleImplementation /> calculate aliases when not informed 1`] = `
|
|
|
610
629
|
<span
|
|
611
630
|
class="highlighted"
|
|
612
631
|
>
|
|
613
|
-
(table2
|
|
632
|
+
(table2).
|
|
614
633
|
|
|
615
634
|
"descripcion"
|
|
616
635
|
</span>
|
|
@@ -700,7 +719,7 @@ exports[`<NewRuleImplementation /> calculate aliases when not informed 1`] = `
|
|
|
700
719
|
<span
|
|
701
720
|
class="highlighted"
|
|
702
721
|
>
|
|
703
|
-
(
|
|
722
|
+
(FS).
|
|
704
723
|
|
|
705
724
|
"agent"
|
|
706
725
|
</span>
|
|
@@ -775,7 +794,7 @@ exports[`<NewRuleImplementation /> calculate aliases when not informed 1`] = `
|
|
|
775
794
|
<span
|
|
776
795
|
class="highlighted"
|
|
777
796
|
>
|
|
778
|
-
(
|
|
797
|
+
(FS).
|
|
779
798
|
|
|
780
799
|
"agent"
|
|
781
800
|
</span>
|