@truedat/dq 4.49.8 → 4.50.0

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,12 +1,30 @@
1
1
  # Changelog
2
2
 
3
- ## [4.49.6] 2022-10-08
3
+ ## [4.50.0] 2022-08-18
4
+
5
+ ## Changed
6
+
7
+ - [TD-5118] Disable submit buttons when update implementation
8
+
9
+ ## [4.49.10] 2022-08-16
10
+
11
+ ## Changed
12
+
13
+ - [TD-5070] Filter versioned rule implementations in rule implementation from rule loader
14
+
15
+ ## [4.49.9] 2022-08-12
16
+
17
+ ### Fixed
18
+
19
+ - [TD-5116] Fix `if` condition when value is 0 in implementation validations
20
+
21
+ ## [4.49.6] 2022-08-10
4
22
 
5
23
  ### Fixed
6
24
 
7
25
  - [TD-4945] User with permission can save or published on edition
8
26
 
9
- ## [4.48.13] 2022-26-07
27
+ ## [4.48.13] 2022-07-26
10
28
 
11
29
  ### Fixed
12
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "4.49.8",
3
+ "version": "4.50.0",
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.8",
97
- "@truedat/df": "4.49.8",
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": "74f5005d8059e15d346982d6b31c5b97e0dd8b79"
117
+ "gitHead": "2392ed87cfb39ef7b9326265f4bccf100b52153a"
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
  ],
@@ -277,7 +277,8 @@ export const RuleImplementationForm = ({
277
277
  : _.prop("name")(prevStep);
278
278
  };
279
279
 
280
- const isButtonDisabled = (currentStep) => !validStep(currentStep);
280
+ const isButtonDisabled = (currentStep) =>
281
+ !validStep(currentStep) || isSubmitting;
281
282
 
282
283
  const validStep = (stepName) => {
283
284
  return _.flow(
@@ -1,10 +1,15 @@
1
- import { createRuleImplementation } from "../routines";
1
+ import {
2
+ createRuleImplementation,
3
+ updateRuleImplementation,
4
+ } from "../routines";
2
5
 
3
6
  const ruleImplementationCreating = (state = false, { type }) => {
4
7
  switch (type) {
5
8
  case createRuleImplementation.TRIGGER:
9
+ case updateRuleImplementation.TRIGGER:
6
10
  return true;
7
11
  case createRuleImplementation.FULFILL:
12
+ case updateRuleImplementation.FULFILL:
8
13
  return false;
9
14
  default:
10
15
  return state;
@@ -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));