@truedat/dq 5.6.2 → 5.6.4

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/dq",
3
- "version": "5.6.2",
3
+ "version": "5.6.4",
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": "5.6.2",
37
+ "@truedat/test": "5.6.4",
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",
@@ -92,8 +92,8 @@
92
92
  },
93
93
  "dependencies": {
94
94
  "@apollo/client": "^3.7.1",
95
- "@truedat/core": "5.6.2",
96
- "@truedat/df": "5.6.2",
95
+ "@truedat/core": "5.6.4",
96
+ "@truedat/df": "5.6.4",
97
97
  "decode-uri-component": "^0.2.2",
98
98
  "graphql": "^15.5.3",
99
99
  "moment": "^2.29.4",
@@ -118,5 +118,5 @@
118
118
  "react-dom": ">= 16.8.6 < 17",
119
119
  "semantic-ui-react": ">= 2.0.3 < 2.2"
120
120
  },
121
- "gitHead": "a667767fbb979e9c12142aabad58f49d3fb68fea"
121
+ "gitHead": "fbecd33735354811f674678337ae16aaa15b4794"
122
122
  }
@@ -21,6 +21,7 @@ import {
21
21
  getRuleImplementationSelectedFilterActiveValues,
22
22
  getRuleImplementationSelectedFilters,
23
23
  getRuleImplementationSelectedFilterValues,
24
+ getRuleImplementationFilterTypes,
24
25
  } from "../selectors";
25
26
 
26
27
  const translations = (formatMessage) => ({
@@ -47,6 +48,7 @@ export const mapStateToProps = (state, ownProps) => {
47
48
 
48
49
  return {
49
50
  loading,
51
+ filterTypes: getRuleImplementationFilterTypes(state),
50
52
  selectedFilter,
51
53
  selectedFilters: getRuleImplementationSelectedFilters(state),
52
54
  selectedFilterActiveValues:
@@ -20,6 +20,7 @@ import {
20
20
  getRuleSelectedFilterActiveValues,
21
21
  getRuleSelectedFilters,
22
22
  getRuleSelectedFilterValues,
23
+ getRuleFilterTypes,
23
24
  } from "../selectors";
24
25
 
25
26
  const translations = (formatMessage) => ({
@@ -44,6 +45,7 @@ export const mapStateToProps = (state, ownProps) => {
44
45
 
45
46
  return {
46
47
  loading,
48
+ filterTypes: getRuleFilterTypes(state),
47
49
  selectedFilter,
48
50
  selectedFilters: getRuleSelectedFilters(state),
49
51
  selectedFilterActiveValues: getRuleSelectedFilterActiveValues(state),
@@ -1,7 +1,7 @@
1
1
  import _ from "lodash/fp";
2
2
  import {
3
3
  clearImplementationFilters,
4
- fetchImplementationFilters
4
+ fetchImplementationFilters,
5
5
  } from "../../routines";
6
6
  import { ruleImplementationFilters } from "..";
7
7
 
@@ -17,25 +17,20 @@ describe("reducers: ruleImplementationFilters", () => {
17
17
  it("should handle the clearImplementationFilters.TRIGGER action", () => {
18
18
  expect(
19
19
  ruleImplementationFilters(fooState, {
20
- type: clearImplementationFilters.TRIGGER
21
- })
22
- ).toEqual(initialState);
23
- });
24
-
25
- it("should handle the fetchImplementationFilters.REQUEST action", () => {
26
- expect(
27
- ruleImplementationFilters(fooState, {
28
- type: fetchImplementationFilters.REQUEST
20
+ type: clearImplementationFilters.TRIGGER,
29
21
  })
30
22
  ).toEqual(initialState);
31
23
  });
32
24
 
33
25
  it("should handle the fetchImplementationFilters.SUCCESS action", () => {
34
- const data = { filter1: ["value1", "value2"], filter2: ["value1"] };
26
+ const data = {
27
+ filter1: { values: ["value1", "value2"] },
28
+ filter2: { values: ["value1"] },
29
+ };
35
30
  expect(
36
31
  ruleImplementationFilters(fooState, {
37
32
  type: fetchImplementationFilters.SUCCESS,
38
- payload: { data: { data } }
33
+ payload: { data: { data } },
39
34
  })
40
35
  ).toEqual(data);
41
36
  });
@@ -7,10 +7,11 @@ const ruleFilters = (state = initialState, { type, payload }) => {
7
7
  switch (type) {
8
8
  case clearRuleFilters.TRIGGER:
9
9
  return initialState;
10
- case fetchRuleFilters.REQUEST:
11
- return initialState;
12
10
  case fetchRuleFilters.SUCCESS:
13
- return _.flow(_.propOr({}, "data.data"), _.omitBy(_.isEmpty))(payload);
11
+ return _.flow(
12
+ _.propOr({}, "data.data"),
13
+ _.omitBy(_.flow(_.getOr([], "values"), _.isEmpty))
14
+ )(payload);
14
15
  default:
15
16
  return state;
16
17
  }
@@ -10,10 +10,11 @@ const ruleImplementationFilters = (state = initialState, { type, payload }) => {
10
10
  switch (type) {
11
11
  case clearImplementationFilters.TRIGGER:
12
12
  return initialState;
13
- case fetchImplementationFilters.REQUEST:
14
- return initialState;
15
13
  case fetchImplementationFilters.SUCCESS:
16
- return _.flow(_.propOr({}, "data.data"), _.omitBy(_.isEmpty))(payload);
14
+ return _.flow(
15
+ _.propOr({}, "data.data"),
16
+ _.omitBy(_.flow(_.getOr([], "values"), _.isEmpty))
17
+ )(payload);
17
18
  default:
18
19
  return state;
19
20
  }
@@ -1,8 +1,8 @@
1
1
  import { getRuleImplementationAvailableFilters } from "..";
2
2
 
3
- const foo = ["foo1", "foo2"];
4
- const bar = ["bar1", "bar2"];
5
- const baz = ["baz1", "baz2"];
3
+ const foo = { values: ["foo1", "foo2"] };
4
+ const bar = { values: ["bar1", "bar2"] };
5
+ const baz = { values: ["baz1", "baz2"] };
6
6
 
7
7
  describe("selectors: getRuleImplementationAvailableFilters", () => {
8
8
  const ruleImplementationFilters = { foo, bar, baz };
@@ -12,7 +12,7 @@ describe("selectors: getRuleImplementationAvailableFilters", () => {
12
12
  it("should return the keys of the ruleImplementation filters which are not currently active", () => {
13
13
  expect(getRuleImplementationAvailableFilters(state)).toEqual([
14
14
  "foo",
15
- "bar"
15
+ "bar",
16
16
  ]);
17
17
  });
18
18
  });
@@ -1,8 +1,8 @@
1
1
  import { getRuleImplementationSelectedFilterValues } from "..";
2
2
 
3
- const foo = ["foo1", "foo2"];
4
- const bar = ["bar1", "bar2"];
5
- const baz = ["baz1", "baz2"];
3
+ const foo = { values: ["foo1", "foo2"] };
4
+ const bar = { values: ["bar1", "bar2"] };
5
+ const baz = { values: ["baz1", "baz2"] };
6
6
 
7
7
  describe("selectors: getRuleImplementationSelectedFilterValues", () => {
8
8
  const ruleImplementationFilters = { foo, bar, baz };
@@ -10,6 +10,8 @@ describe("selectors: getRuleImplementationSelectedFilterValues", () => {
10
10
  const state = { ruleImplementationFilters, ruleImplementationSelectedFilter };
11
11
 
12
12
  it("should return the values of the currently selected ruleImplementation filters", () => {
13
- expect(getRuleImplementationSelectedFilterValues(state)).toEqual(foo);
13
+ expect(getRuleImplementationSelectedFilterValues(state)).toEqual(
14
+ foo.values
15
+ );
14
16
  });
15
17
  });
@@ -8,7 +8,7 @@ export const getRuleAvailableFilters = createSelector(
8
8
  [getRuleFilters, getRuleSelectedFilters],
9
9
  (ruleFilters, ruleSelectedFilters) =>
10
10
  _.flow(
11
- _.omitBy(values => _.size(values) < 2),
11
+ _.omitBy(({ values }) => _.size(values) < 2),
12
12
  _.keys,
13
13
  _.without(ruleSelectedFilters)
14
14
  )(ruleFilters)
@@ -0,0 +1,7 @@
1
+ import _ from "lodash/fp";
2
+ import { createSelector } from "reselect";
3
+
4
+ export const getRuleFilterTypes = createSelector(
5
+ _.prop("ruleFilters"),
6
+ _.mapValues("type")
7
+ );
@@ -9,7 +9,7 @@ export const getRuleImplementationAvailableFilters = createSelector(
9
9
  getRuleImplementationSelectedFilters,
10
10
  (implementationFilters, implementationSelectedFilters) =>
11
11
  _.flow(
12
- _.omitBy(values => _.size(values) < 2),
12
+ _.omitBy(({ values }) => _.size(values) < 2),
13
13
  _.keys,
14
14
  _.without(implementationSelectedFilters)
15
15
  )(implementationFilters)
@@ -0,0 +1,7 @@
1
+ import _ from "lodash/fp";
2
+ import { createSelector } from "reselect";
3
+
4
+ export const getRuleImplementationFilterTypes = createSelector(
5
+ _.prop("ruleImplementationFilters"),
6
+ _.mapValues("type")
7
+ );
@@ -9,7 +9,7 @@ export const getRuleImplementationSelectedFilterValues = createSelector(
9
9
  ],
10
10
  (implementationSelectedFilter, implementationFilters) =>
11
11
  _.flow(
12
- _.propOr([], implementationSelectedFilter),
13
- formatFilterValues(implementationSelectedFilter)
12
+ _.propOr({ values: [] }, implementationSelectedFilter),
13
+ formatFilterValues
14
14
  )(implementationFilters)
15
15
  );
@@ -6,7 +6,7 @@ export const getRuleSelectedFilterValues = createSelector(
6
6
  [_.prop("ruleSelectedFilter"), _.prop("ruleFilters")],
7
7
  (ruleSelectedFilter, ruleFilters) =>
8
8
  _.flow(
9
- _.propOr([], ruleSelectedFilter),
10
- formatFilterValues(ruleSelectedFilter)
9
+ _.propOr({ values: [] }, ruleSelectedFilter),
10
+ formatFilterValues
11
11
  )(ruleFilters)
12
12
  );
@@ -1,6 +1,7 @@
1
1
  export { datasetDefaultFiltersSelector } from "./datasetDefaultFiltersSelector";
2
2
  export { getImplementationsExecution } from "./getImplementationsExecution";
3
3
  export { getRuleAvailableFilters } from "./getRuleAvailableFilters";
4
+ export { getRuleFilterTypes } from "./getRuleFilterTypes";
4
5
  export { getRuleSelectedFilters } from "./getRuleSelectedFilters";
5
6
  export { getRuleSelectedFilterActiveValues } from "./getRuleSelectedFilterActiveValues";
6
7
  export { getRuleSelectedFilterValues } from "./getRuleSelectedFilterValues";
@@ -24,6 +25,7 @@ export {
24
25
  } from "./getRuleImplementationColumns";
25
26
  export { getPreviousRuleImplementationQuery } from "./getPreviousRuleImplementationQuery";
26
27
  export { getRuleImplementationAvailableFilters } from "./getRuleImplementationAvailableFilters";
28
+ export { getRuleImplementationFilterTypes } from "./getRuleImplementationFilterTypes";
27
29
  export { getRuleImplementationSelectedFilters } from "./getRuleImplementationSelectedFilters";
28
30
  export { getRuleImplementationSelectedFilterValues } from "./getRuleImplementationSelectedFilterValues";
29
31
  export { getRuleImplementationSelectedFilterActiveValues } from "./getRuleImplementationSelectedFilterActiveValues";