@truedat/dq 4.51.7 → 4.52.1

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,11 +1,18 @@
1
1
  # Changelog
2
2
 
3
- ## [4.51.7] 2022-09-21
3
+ ## [4.52.1] 2022-09-21
4
4
 
5
5
  ### Fixed
6
6
 
7
7
  - [TD-5164] RuleEventDecorator exception if quality_events is empty
8
8
 
9
+ ## [4.52.0] 2022-09-20
10
+
11
+ ### Fixed
12
+
13
+ - [TD-5135] Error in implementation audit component when field value is an
14
+ object
15
+
9
16
  ## [4.51.3] 2022-09-16
10
17
 
11
18
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "4.51.7",
3
+ "version": "4.52.1",
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.51.6",
37
+ "@truedat/test": "4.52.0",
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.51.6",
97
- "@truedat/df": "4.51.6",
96
+ "@truedat/core": "4.52.0",
97
+ "@truedat/df": "4.52.0",
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": "6f13ba98bcb7ca657e3e8043dfdc5e6716862aa7"
117
+ "gitHead": "3eea3b93dcb8dc264af0779fd621971216f0e8aa"
118
118
  }
@@ -1,26 +1,30 @@
1
- import { flow, last, prop, sortBy } from "lodash/fp";
1
+ import { flow, last, prop, propOr, sortBy } from "lodash/fp";
2
2
  import React from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { Icon } from "semantic-ui-react";
5
5
 
6
+ const PENDING = { name: "info circle", color: "green" };
7
+
6
8
  export const icons = {
7
- PENDING: { name: "info circle", color: "green" },
9
+ PENDING,
8
10
  STARTED: { name: "play circle outline", color: "green" },
9
11
  SUCCEEDED: { name: "check circle outline", color: "green" },
10
12
  FAILED: { name: "warning circle", color: "red" },
11
13
  };
12
- export const RuleResultDecorator = ({ _embedded }) => {
14
+
15
+ export const RuleEventDecorator = ({ _embedded }) => {
13
16
  const event = flow(
17
+ propOr([], "quality_events"),
14
18
  sortBy("inserted_at"),
15
19
  last,
16
20
  prop("type")
17
- )(_embedded?.quality_events);
18
- const icon = icons[event] || { name: "question circle outline" };
21
+ )(_embedded);
22
+ const icon = propOr(PENDING, event)(icons);
19
23
  return <Icon size="large" {...icon} />;
20
24
  };
21
25
 
22
- RuleResultDecorator.propTypes = {
26
+ RuleEventDecorator.propTypes = {
23
27
  _embedded: PropTypes.object,
24
28
  };
25
29
 
26
- export default RuleResultDecorator;
30
+ export default RuleEventDecorator;
@@ -29,7 +29,7 @@ export const RuleImplementationEventRow = ({
29
29
  text
30
30
  content={formatMessage(
31
31
  { id: "ruleImplementations.events.action_" + action },
32
- [field, value]
32
+ [field, _.isObject(value) ? JSON.stringify(value) : value]
33
33
  )}
34
34
  />
35
35
  ))}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { render } from "@truedat/test/render";
3
+ import { RuleEventDecorator } from "../RuleEventDecorator";
4
+
5
+ describe("<RuleEventDecorator />", () => {
6
+ it("matches latest snapshot (no events)", () => {
7
+ const { container } = render(<RuleEventDecorator />);
8
+ expect(container).toMatchSnapshot();
9
+ });
10
+ });
@@ -20,23 +20,22 @@ describe("<RuleImplementationEvents />", () => {
20
20
  ts: "2019-09-12T02:00:00Z",
21
21
  payload: [{ field: "bar", action: "deprecated" }],
22
22
  },
23
- ];
24
- const renderOpts = {
25
- messages: {
26
- en: {
27
- "ruleImplementations.events.action_deprecated": "deprecated",
28
- "ruleImplementations.events.action_restored": "restored",
29
- },
23
+ {
24
+ id: 3,
25
+ service: "service",
26
+ event: "implementation_changed",
27
+ resource_id: 100,
28
+ ts: "2019-09-12T02:00:00Z",
29
+ payload: [
30
+ { field: "bar", action: "changed", value: { id: 123, name: "foo" } },
31
+ ],
30
32
  },
31
- };
33
+ ];
32
34
 
33
35
  const props = { events };
34
36
 
35
37
  it("matches the latest snapshot", () => {
36
- const { container } = render(
37
- <RuleImplementationEvents {...props} />,
38
- renderOpts
39
- );
38
+ const { container } = render(<RuleImplementationEvents {...props} />);
40
39
  expect(container).toMatchSnapshot();
41
40
  });
42
41
  });
@@ -92,7 +92,7 @@ exports[`<ExecutionGroup /> matches the latest snapshot 1`] = `
92
92
  >
93
93
  <i
94
94
  aria-hidden="true"
95
- class="question circle outline large icon"
95
+ class="green info circle large icon"
96
96
  />
97
97
  </td>
98
98
  <td
@@ -0,0 +1,10 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<RuleEventDecorator /> matches latest snapshot (no events) 1`] = `
4
+ <div>
5
+ <i
6
+ aria-hidden="true"
7
+ class="green info circle large icon"
8
+ />
9
+ </div>
10
+ `;
@@ -34,7 +34,7 @@ exports[`<RuleImplementationEvents /> matches the latest snapshot 1`] = `
34
34
  <div
35
35
  class="text extra"
36
36
  >
37
- restored
37
+ Implementation restored
38
38
  </div>
39
39
  </div>
40
40
  </div>
@@ -64,7 +64,37 @@ exports[`<RuleImplementationEvents /> matches the latest snapshot 1`] = `
64
64
  <div
65
65
  class="text extra"
66
66
  >
67
- deprecated
67
+ Implementation deprecated
68
+ </div>
69
+ </div>
70
+ </div>
71
+ <div
72
+ class="event"
73
+ >
74
+ <div
75
+ class="content"
76
+ >
77
+ <div
78
+ class="summary"
79
+ >
80
+ <a
81
+ class="user"
82
+ />
83
+
84
+ <div
85
+ class="date"
86
+ >
87
+ <time
88
+ datetime="1568253600000"
89
+ >
90
+ 2019-09-12 02:00
91
+ </time>
92
+ </div>
93
+ </div>
94
+ <div
95
+ class="text extra"
96
+ >
97
+ Field bar changed to {"id":123,"name":"foo"}
68
98
  </div>
69
99
  </div>
70
100
  </div>