@truedat/df 7.1.1 → 7.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/df",
3
- "version": "7.1.1",
3
+ "version": "7.1.2",
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.5",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "7.1.1",
37
+ "@truedat/test": "7.1.2",
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",
@@ -87,8 +87,8 @@
87
87
  },
88
88
  "dependencies": {
89
89
  "@apollo/client": "^3.7.1",
90
- "@truedat/auth": "7.1.1",
91
- "@truedat/core": "7.1.1",
90
+ "@truedat/auth": "7.1.2",
91
+ "@truedat/core": "7.1.2",
92
92
  "decode-uri-component": "^0.2.2",
93
93
  "path-to-regexp": "^1.7.0",
94
94
  "prop-types": "^15.8.1",
@@ -109,5 +109,5 @@
109
109
  "react-dom": ">= 16.8.6 < 17",
110
110
  "semantic-ui-react": ">= 2.0.3 < 2.2"
111
111
  },
112
- "gitHead": "f7aef0d8ae70d610b20a38b77589c9e614ae5fbd"
112
+ "gitHead": "24074365350047cf138aa5a98e3fce8d6a499119"
113
113
  }
@@ -31,10 +31,12 @@ export const FieldViewerValue = ({
31
31
  }) => {
32
32
  switch (type) {
33
33
  case "url":
34
- return (
34
+ return value.url_value ? (
35
35
  <SafeLink className="ui mini button" href={value.url_value}>
36
- {value.url_name}
36
+ {value.url_name || value.url_value}
37
37
  </SafeLink>
38
+ ) : (
39
+ <Icon name="minus" as="i" color="grey" />
38
40
  );
39
41
  case "enriched_text":
40
42
  return <RichTextEditor readOnly value={value} />;
@@ -8,6 +8,16 @@ describe("<FieldViewerValue />", () => {
8
8
  value: { url_name: "name", url_value: "value" },
9
9
  type: "url",
10
10
  },
11
+ {
12
+ alternative: "without name",
13
+ value: { url_name: "", url_value: "value" },
14
+ type: "url",
15
+ },
16
+ {
17
+ alternative: "without value",
18
+ value: { url_name: "", url_value: "" },
19
+ type: "url",
20
+ },
11
21
  {
12
22
  values: { table_columns: [{ name: "col1" }] },
13
23
  value: [{ col1: "v1" }, { col1: "v2" }],
@@ -52,7 +62,9 @@ describe("<FieldViewerValue />", () => {
52
62
  ];
53
63
 
54
64
  testTypes.forEach((props) =>
55
- it(`matches the latest snapshot with type: ${props.type}`, () => {
65
+ it(`matches the latest snapshot with type: ${props.type}${
66
+ props.alternative ? " " + props.alternative : ""
67
+ }`, () => {
56
68
  const { container } = render(<FieldViewerValue {...props} />);
57
69
  expect(container).toMatchSnapshot();
58
70
  })
@@ -137,6 +137,27 @@ exports[`<FieldViewerValue /> matches the latest snapshot with type: url 1`] = `
137
137
  </div>
138
138
  `;
139
139
 
140
+ exports[`<FieldViewerValue /> matches the latest snapshot with type: url without name 1`] = `
141
+ <div>
142
+ <a
143
+ class="ui mini button"
144
+ style="color: red; background-color: yellow;"
145
+ title="value"
146
+ >
147
+ value
148
+ </a>
149
+ </div>
150
+ `;
151
+
152
+ exports[`<FieldViewerValue /> matches the latest snapshot with type: url without value 1`] = `
153
+ <div>
154
+ <i
155
+ aria-hidden="true"
156
+ class="grey minus icon"
157
+ />
158
+ </div>
159
+ `;
160
+
140
161
  exports[`<FieldViewerValue /> matches the latest snapshot with type: user 1`] = `
141
162
  <div>
142
163
  <div