@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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.56.2] 2022-11-24
4
+
5
+ ### Changed
6
+
7
+ - [TD-5247] Display the name of the table together with field in implementations
8
+ details
9
+
3
10
  ## [4.54.12] 2022-11-14
4
11
 
5
12
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "4.56.0",
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.0",
97
- "@truedat/df": "4.56.0",
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": "17277e6b9438363c6baa26f8975a2ab585a61f76"
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 = _.flow(
129
- _.find({ index: row.structure?.parent_index }),
130
- _.propOr(null, "text")
131
- )(alias);
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 withoutUnusedAliasText = (dataset) => {
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
- _.has("structure.id")(ds) &&
370
- _.includes(ds.structure.id)(duplicatedStructures)
371
- ? _.path("alias.text")(ds)
372
- ? ds
373
- : {
374
- ...ds,
375
- alias: {
376
- ...ds.alias,
377
- text: `${ds.structure.name} (${ds.alias.index})`,
378
- },
379
- }
380
- : { ...ds, alias: { ...ds.alias, text: null } }
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 = withoutUnusedAliasText(dataset);
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: { field_type: "string", name: "Mes", id: 2598 },
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,
@@ -59,6 +59,7 @@ exports[`<ConditionSummary /> matches the latest snapshot 1`] = `
59
59
  <span
60
60
  class="highlighted"
61
61
  >
62
+ (foo_alias).
62
63
 
63
64
  "Mes"
64
65
  </span>
@@ -494,7 +494,7 @@ exports[`<NewRuleImplementation /> calculate aliases when not informed 1`] = `
494
494
  </a>
495
495
  <span>
496
496
  (
497
- example.txt (0)
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 (1)
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 (1)).capital
564
+ (table2).capital
546
565
  =
547
566
 
548
- (example.txt (0)).external
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 (1)).
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
- (example.txt (0)).
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
- (example.txt (0)).
797
+ (FS).
779
798
 
780
799
  "agent"
781
800
  </span>