@truedat/dq 4.49.7 → 4.49.10

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.49.10] 2022-08-16
4
+
5
+ ## Changed
6
+
7
+ - [TD-5070] Filter versioned rule implementations in rule implementation from rule loader
8
+
9
+ ## [4.49.9] 2022-08-12
10
+
11
+ ### Fixed
12
+
13
+ - [TD-5116] Fix `if` condition when value is 0 in implementation validations
14
+
3
15
  ## [4.49.6] 2022-10-08
4
16
 
5
17
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "4.49.7",
3
+ "version": "4.49.10",
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.6.4",
96
- "@truedat/core": "4.49.7",
97
- "@truedat/df": "4.49.7",
96
+ "@truedat/core": "4.49.10",
97
+ "@truedat/df": "4.49.10",
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": "e57a27c689a1e18026fe5b8a02d9414d5ea70337"
117
+ "gitHead": "fb6fcd549a722d777d692f2938dbc991c72dd3a1"
118
118
  }
@@ -25,7 +25,7 @@ const updateDatasetKey = (data) =>
25
25
 
26
26
  // object either field, raw value, list of fields, list of raw values
27
27
  const updateValueKeyContent = (value) => {
28
- if (value?.id || value?.raw || value?.fields) {
28
+ if (value?.id || _.negate(_.isUndefined)(value?.raw) || value?.fields) {
29
29
  return value?.id || value?.type === "reference_dataset_field"
30
30
  ? _.pick(["id", "parent_index", "name", "type"])(value)
31
31
  : _.pick(["raw", "fields"])(value);
@@ -16,7 +16,14 @@ export const RuleImplementationsFromRuleLoader = ({
16
16
  const { id } = useParams();
17
17
  useEffect(() => {
18
18
  if (id) {
19
- fetchRuleImplementations({ id });
19
+ fetchRuleImplementations({
20
+ id,
21
+ filters: {
22
+ must_not: {
23
+ status: ["versioned"],
24
+ },
25
+ },
26
+ });
20
27
  }
21
28
  }, [clearRuleImplementations, fetchRuleImplementations, id]);
22
29
 
@@ -32,7 +32,10 @@ describe("<RuleImplementationsFromRuleLoader />", () => {
32
32
  const wrapper = mount(<RuleImplementationsFromRuleLoader {...props} />);
33
33
  expect(clearRuleImplementations).toHaveBeenCalledTimes(0);
34
34
  expect(fetchRuleImplementations).toHaveBeenCalledTimes(1);
35
- expect(fetchRuleImplementations).toHaveBeenCalledWith({ id: 1 });
35
+ expect(fetchRuleImplementations).toHaveBeenCalledWith({
36
+ id: 1,
37
+ filters: { must_not: { status: ["versioned"] } },
38
+ });
36
39
  wrapper.unmount();
37
40
  expect(clearRuleImplementations).toHaveBeenCalledTimes(1);
38
41
  expect(fetchRuleImplementations).toHaveBeenCalledTimes(1);
@@ -13,6 +13,13 @@ exports[`<RuleImplementationsFromRuleLoader /> matches the latest snapshot 1`] =
13
13
  "calls": Array [
14
14
  Array [
15
15
  Object {
16
+ "filters": Object {
17
+ "must_not": Object {
18
+ "status": Array [
19
+ "versioned",
20
+ ],
21
+ },
22
+ },
16
23
  "id": 1,
17
24
  },
18
25
  ],
@@ -4,11 +4,19 @@ import { apiJsonPost, JSON_OPTS } from "@truedat/core/services/api";
4
4
  import { fetchRuleImplementations } from "../routines";
5
5
  import { API_RULE_IMPLEMENTATIONS_FROM_RULE } from "../api";
6
6
 
7
- const fetchPayload = (deleted) => (deleted ? { status: "deleted" } : {});
7
+ const fetchPayload = (deleted, filters) => {
8
+ const statusPayload = deleted ? { status: "deleted" } : {};
9
+ const filtersPayload = filters ? { filters } : {};
10
+
11
+ return {
12
+ ...statusPayload,
13
+ ...filtersPayload,
14
+ };
15
+ };
8
16
 
9
17
  export function* fetchRuleImplementationsSaga({ payload }) {
10
18
  try {
11
- const { id, deleted } = payload;
19
+ const { id, deleted, filters } = payload;
12
20
  const url = compile(API_RULE_IMPLEMENTATIONS_FROM_RULE)({ id });
13
21
 
14
22
  yield put(fetchRuleImplementations.request());
@@ -16,7 +24,7 @@ export function* fetchRuleImplementationsSaga({ payload }) {
16
24
  const { data } = yield call(
17
25
  apiJsonPost,
18
26
  url,
19
- fetchPayload(deleted),
27
+ fetchPayload(deleted, filters),
20
28
  JSON_OPTS
21
29
  );
22
30
  yield put(fetchRuleImplementations.success(data));