@truedat/dq 4.52.4 → 4.52.6

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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.52.5] 2022-09-30
4
+
5
+ - [TD-2430] Add join type selection when defining an implementation dataset
6
+
3
7
  ## [4.52.3] 2022-09-22
4
8
 
5
9
  ### Removed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "4.52.4",
3
+ "version": "4.52.6",
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.52.0",
37
+ "@truedat/test": "4.52.6",
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.6.4",
96
- "@truedat/core": "4.52.4",
97
- "@truedat/df": "4.52.4",
96
+ "@truedat/core": "4.52.6",
97
+ "@truedat/df": "4.52.6",
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": "c8fb8bfae18f39f7925c46e45b7818d02a5bc070"
117
+ "gitHead": "14204211010d6329f9f22071c95e7d9d6ce6b0f7"
118
118
  }
@@ -1,13 +1,14 @@
1
1
  import _ from "lodash/fp";
2
2
  import React from "react";
3
3
  import PropTypes from "prop-types";
4
- import { Header, Icon, Table, Segment, List } from "semantic-ui-react";
4
+ import { Header, Icon, List, Table, Segment } from "semantic-ui-react";
5
5
  import { Link } from "react-router-dom";
6
6
  import { FormattedMessage } from "react-intl";
7
7
  import { linkTo } from "@truedat/core/routes";
8
8
  import ConditionSummary, { empty, path } from "./ConditionSummary";
9
9
  import FieldSummary from "./FieldSummary";
10
10
  import InformationSummary from "./InformationSummary";
11
+ import { JoinTypeIcon } from "./JoinTypeIcon";
11
12
  import "../styles/ImplementationSummary.less";
12
13
 
13
14
  const defaults = [
@@ -63,6 +64,14 @@ const UnionSummary = ({ alias, row }) => {
63
64
  return empty(row) || !(row?.clauses && _.size(row?.clauses) > 0) ? null : (
64
65
  <List id="union-list">
65
66
  <List.Item>
67
+ {_.has("join_type")(row) ? (
68
+ <>
69
+ <List.Header>
70
+ <FormattedMessage id="structureSelector.union.type" />
71
+ </List.Header>
72
+ <JoinTypeIcon type={row.join_type} />
73
+ </>
74
+ ) : null}
66
75
  <List.Header>
67
76
  <FormattedMessage id="structureSelector.union.criteria" />
68
77
  </List.Header>
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
3
+
4
+ export const JoinTypeIcon = ({ type }) => {
5
+ switch (type) {
6
+ case "inner":
7
+ return (
8
+ <div className="join_type">
9
+ <div className="circle circle-left">
10
+ <div className="circle circle-center fill"></div>
11
+ </div>
12
+ <div className="circle circle-right"></div>
13
+ </div>
14
+ );
15
+ case "left":
16
+ return (
17
+ <div className="join_type">
18
+ <div className="circle circle-left fill">
19
+ <div className="circle circle-center fill"></div>
20
+ </div>
21
+ <div className="circle circle-right"></div>
22
+ </div>
23
+ );
24
+ case "right":
25
+ return (
26
+ <div className="join_type">
27
+ <div className="circle circle-left">
28
+ <div className="circle circle-center fill"></div>
29
+ </div>
30
+ <div className="circle circle-right fill"></div>
31
+ </div>
32
+ );
33
+ case "full_outer":
34
+ return (
35
+ <div className="join_type">
36
+ <div className="circle circle-left fill">
37
+ <div className="circle circle-center fill"></div>
38
+ </div>
39
+ <div className="circle circle-right fill"></div>
40
+ </div>
41
+ );
42
+ default:
43
+ return null;
44
+ }
45
+ };
46
+
47
+ JoinTypeIcon.propTypes = {
48
+ type: PropTypes.string.isRequired,
49
+ };
50
+
51
+ export default JoinTypeIcon;
@@ -44,7 +44,12 @@ export const DatasetForm = ({
44
44
  };
45
45
 
46
46
  const onChangeField = (index, value) => {
47
- const structureAttrs = _.pick(["structure", "clauses", "alias"])(value);
47
+ const structureAttrs = _.pick([
48
+ "structure",
49
+ "clauses",
50
+ "alias",
51
+ "join_type",
52
+ ])(value);
48
53
  setStructure({
49
54
  index,
50
55
  value: {
@@ -118,7 +123,8 @@ export const DatasetForm = ({
118
123
  return (
119
124
  <>
120
125
  {structures.map((structure, index) =>
121
- _.path("join_type")(structure) === "reference_dataset" ? (
126
+ _.path("structureType")(structure) === "reference_dataset" ||
127
+ _.path("structure.type")(structure) === "reference_dataset" ? (
122
128
  <ReferenceDatasetSelectorInputField
123
129
  key={index}
124
130
  onChange={(value) =>
@@ -168,7 +174,12 @@ export const DatasetForm = ({
168
174
  {_.isEmpty(availableReferenceDatasets) ? null : (
169
175
  <Button
170
176
  onClick={(e) => {
171
- setStructure({ value: { join_type: "reference_dataset" } });
177
+ setStructure({
178
+ value: {
179
+ join_type: "inner",
180
+ structureType: "reference_dataset",
181
+ },
182
+ });
172
183
  }}
173
184
  >
174
185
  {formatMessage({
@@ -608,6 +608,7 @@ export default {
608
608
  "structureFields.dropdown.label": "Select Field",
609
609
  "structureFields.dropdown.placeholder": "Fields",
610
610
  "structureSelector.union.criteria": "Union criteria",
611
+ "structureSelector.union.type": "Union type",
611
612
  "summary.link.and": "and",
612
613
  "tabs.dq.implementation.links.concepts": "Link to concepts",
613
614
  "tabs.dq.implementation.structures": "Structures",
@@ -630,6 +630,7 @@ export default {
630
630
  "structureFields.dropdown.label": "Seleccionar Campo",
631
631
  "structureFields.dropdown.placeholder": "Campos",
632
632
  "structureSelector.union.criteria": "Criterio de unión",
633
+ "structureSelector.union.type": "Tipo de unión",
633
634
  "summary.link.and": "y",
634
635
  "tabs.dq.implementation.links.concepts": "Conceptos relacionados",
635
636
  "tabs.dq.implementation.structures": "Estructuras",
@@ -0,0 +1,35 @@
1
+ .join_type{
2
+ display:inline-flex;
3
+ left: 25%;
4
+ }
5
+ .join_type .circle{
6
+ display:flex;
7
+ box-sizing: border-box;
8
+ width:20px;
9
+ height:20px;
10
+ border-radius:50%;
11
+ border: 2px solid black;
12
+ z-index: 1;
13
+ }
14
+ .join_type .circle.fill{
15
+ background:orange;
16
+ }
17
+ .join_type .circle.fill.white {
18
+ background:white;
19
+ }
20
+ .join_type .circle-left{
21
+ display:block;
22
+ overflow:hidden;
23
+ position:relative;
24
+ }
25
+ .join_type .circle-center{
26
+ top: -2px;
27
+ right: calc(-75% + 2px);
28
+ position:absolute;
29
+ }
30
+ .join_type .circle-right{
31
+ overflow:hidden;
32
+ position:relative;
33
+ right: 25%;
34
+ z-index: 0;
35
+ }