@truedat/dq 6.16.3 → 6.16.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": "6.16.3",
3
+ "version": "6.16.4",
4
4
  "description": "Truedat Web Data Quality Module",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -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": "9ac7bd2ddab3f16be28269b3203e568c269cbd0e"
121
+ "gitHead": "ecf57a30185b9e353b6e2692702b5599e4425edb"
122
122
  }
@@ -118,7 +118,10 @@ ConceptRules.propTypes = {
118
118
 
119
119
  const mapStateToProps = ({ conceptRules, concept, conceptRulesActions }) => ({
120
120
  concept,
121
- conceptRules: _.reject("deleted_at")(conceptRules),
121
+ conceptRules: _.flow(
122
+ _.reject("deleted_at"),
123
+ _.orderBy(["business_concept_id", "df_name"], ["desc", "asc"])
124
+ )(conceptRules),
122
125
  showExpandableColumn: _.some("business_concept_name")(conceptRules),
123
126
  createRuleUrl: conceptRulesActions?.create
124
127
  ? linkTo.CONCEPT_RULES_NEW(concept)
@@ -25,7 +25,7 @@ export const ImplementationStructureLinksActions = ({
25
25
 
26
26
  ImplementationStructureLinksActions.propTypes = {
27
27
  implementation_id: PropTypes.number,
28
- canCreateLink: PropTypes.bool,
28
+ canCreateLink: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
29
29
  };
30
30
 
31
31
  const mapStateToProps = (state) => ({
@@ -7,8 +7,8 @@ import { Checkbox, Table, Header, Icon } from "semantic-ui-react";
7
7
  import { useIntl } from "react-intl";
8
8
  import { sortImplementations } from "../routines";
9
9
  import {
10
+ getBusinessConceptsLinksToImplementationsColumns,
10
11
  getRuleImplementationColumns,
11
- getRuleImplementationExpandableColumns,
12
12
  } from "../selectors";
13
13
  import RuleImplementationRow from "./RuleImplementationRow";
14
14
 
@@ -130,8 +130,14 @@ RuleImplementationsTable.propTypes = {
130
130
  };
131
131
 
132
132
  const mapStateToProps = (state, props) => ({
133
- columns: _.propOr(getRuleImplementationColumns(state), "columns")(props),
134
- ruleImplementations: props.ruleImplementations || state.ruleImplementations,
133
+ columns: _.some("business_concept_id")(
134
+ props.ruleImplementations || state.ruleImplementations
135
+ )
136
+ ? getBusinessConceptsLinksToImplementationsColumns(state)
137
+ : getRuleImplementationColumns(state),
138
+ ruleImplementations: _.orderBy(["business_concept_id", "implementation_key"])(
139
+ ["desc", "asc"]
140
+ )(props.ruleImplementations || state.ruleImplementations),
135
141
  ruleImplementationsLoading: state.ruleImplementationsLoading,
136
142
  implementationsSort: _.path("ruleImplementationQuery.sort")(state),
137
143
  });
@@ -9,6 +9,8 @@ describe("<ConceptRules />", () => {
9
9
  active: true,
10
10
  name: "foo",
11
11
  id: 1,
12
+ business_concept_id: 1,
13
+ business_concept_name: "foo foo",
12
14
  },
13
15
  {
14
16
  active: true,
@@ -34,6 +36,8 @@ describe("<ConceptRules />", () => {
34
36
  "concepts.rules.empty": "empty",
35
37
  "concepts.rules.name": "name",
36
38
  "concepts.rules.status": "status",
39
+ "concepts.rules.expandable": "Linked by",
40
+ "concepts.rule.create": "Create",
37
41
  },
38
42
  },
39
43
  };
@@ -59,4 +63,25 @@ describe("<ConceptRules />", () => {
59
63
  expect(container).toMatchSnapshot();
60
64
  expect(queryByText(/empty/)).toBeTruthy();
61
65
  });
66
+
67
+ it("renders expandable", async () => {
68
+ const newProps = {
69
+ ...props,
70
+ showExpandableColumn: true,
71
+ };
72
+ const { queryByText } = render(<ConceptRules {...newProps} />, renderOpts);
73
+
74
+ expect(queryByText(/Linked by/)).toBeTruthy();
75
+ });
76
+
77
+ it("renders create url", async () => {
78
+ const newProps = {
79
+ ...props,
80
+ createRuleUrl: "/url/create",
81
+ visible: true,
82
+ };
83
+ const { queryByText } = render(<ConceptRules {...newProps} />, renderOpts);
84
+
85
+ expect(queryByText(/Create/)).toBeTruthy();
86
+ });
62
87
  });