@truedat/dq 8.8.8 → 8.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "8.8.8",
3
+ "version": "8.9.1",
4
4
  "description": "Truedat Web Data Quality Module",
5
5
  "sideEffects": false,
6
6
  "module": "src/index.js",
@@ -56,7 +56,7 @@
56
56
  "@testing-library/jest-dom": "^6.6.3",
57
57
  "@testing-library/react": "^16.3.0",
58
58
  "@testing-library/user-event": "^14.6.1",
59
- "@truedat/test": "8.8.8",
59
+ "@truedat/test": "8.9.1",
60
60
  "identity-obj-proxy": "^3.0.0",
61
61
  "jest": "^29.7.0",
62
62
  "redux-saga-test-plan": "^4.0.6"
@@ -89,5 +89,5 @@
89
89
  "semantic-ui-react": "^3.0.0-beta.2",
90
90
  "swr": "^2.3.3"
91
91
  },
92
- "gitHead": "850b1a20250c39f4781aea0174aeebd383898eea"
92
+ "gitHead": "778d7597a979b8c64dd2bbd5d512fd7c4a24b453"
93
93
  }
@@ -1,14 +1,19 @@
1
+ import _ from "lodash/fp";
1
2
  import { useActiveRoute } from "@truedat/core/hooks";
2
3
  import { useParams } from "react-router";
4
+ import { useIntl } from "react-intl";
3
5
  import { useSelector } from "react-redux";
4
6
  import PropTypes from "prop-types";
5
7
  import { Segment } from "semantic-ui-react";
6
8
  import { SearchContextProvider } from "@truedat/core/search/SearchContext";
9
+ import { StructureFilterItem } from "@truedat/core/components";
7
10
  import { getRiSubscopes } from "@truedat/core/selectors";
8
11
  import {
9
12
  IMPLEMENTATIONS,
10
13
  IMPLEMENTATIONS_BY_SUBSCOPE,
11
14
  } from "@truedat/core/routes";
15
+ import { StructuresLoader } from "@truedat/dd/components";
16
+ import { searchStructures } from "@truedat/dd/routines";
12
17
  import {
13
18
  useRuleImplementationFilters,
14
19
  useRuleImplementationSearch,
@@ -19,12 +24,15 @@ import ImplementationFiltersLoader from "./ImplementationFiltersLoader";
19
24
  import ImplementationSearchResults from "./ImplementationSearchResults";
20
25
 
21
26
  export const Implementations = ({ defaultFilters }) => {
27
+ const { formatMessage } = useIntl();
22
28
  const { subscope } = useParams();
23
29
  const isImplementations = useActiveRoute(IMPLEMENTATIONS);
24
30
  const isImplementationsBySubscope = useActiveRoute(
25
31
  IMPLEMENTATIONS_BY_SUBSCOPE,
26
32
  );
27
33
  const riSubscopes = useSelector(getRiSubscopes);
34
+ const structures = useSelector((state) => state.structures);
35
+ const structureQuery = useSelector((state) => state.structureQuery?.query);
28
36
 
29
37
  // eslint-disable-next-line fp/no-let
30
38
  let filtersWithSubscope = { ...defaultFilters };
@@ -47,6 +55,18 @@ export const Implementations = ({ defaultFilters }) => {
47
55
  };
48
56
  }
49
57
 
58
+ const searchFiltersPropsMapping = {
59
+ linked_structures_ids: {
60
+ query: structureQuery,
61
+ searchCallback: searchStructures,
62
+ options: structures,
63
+ placeholder: formatMessage({ id: "structures.search.placeholder" }),
64
+ FilterDataLoader: StructuresLoader,
65
+ loaderProps: { pageSize: 50 },
66
+ FilterItem: StructureFilterItem,
67
+ },
68
+ };
69
+
50
70
  const searchProps = {
51
71
  initialSortColumn: "implementation_key.raw",
52
72
  initialSortDirection: "ascending",
@@ -57,6 +77,7 @@ export const Implementations = ({ defaultFilters }) => {
57
77
  userFilterScope: "rule_implementation",
58
78
  defaultFilters: filtersWithSubscope,
59
79
  useDomainSearchFilter: true,
80
+ searchFiltersPropsMapping,
60
81
  };
61
82
 
62
83
  return (