@truedat/dq 4.40.3 → 4.40.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": "4.40.3",
3
+ "version": "4.40.4",
4
4
  "description": "Truedat Web Data Quality Module",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -31,7 +31,7 @@
31
31
  "@babel/plugin-transform-modules-commonjs": "^7.15.0",
32
32
  "@babel/preset-env": "^7.15.0",
33
33
  "@babel/preset-react": "^7.14.5",
34
- "@truedat/test": "4.40.3",
34
+ "@truedat/test": "4.40.4",
35
35
  "babel-jest": "^27.0.6",
36
36
  "babel-plugin-dynamic-import-node": "^2.3.3",
37
37
  "babel-plugin-lodash": "^3.3.4",
@@ -82,8 +82,8 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@apollo/client": "^3.4.10",
85
- "@truedat/core": "4.40.3",
86
- "@truedat/df": "4.40.3",
85
+ "@truedat/core": "4.40.4",
86
+ "@truedat/df": "4.40.4",
87
87
  "axios": "^0.19.2",
88
88
  "graphql": "^15.5.3",
89
89
  "path-to-regexp": "^1.7.0",
@@ -103,5 +103,5 @@
103
103
  "react-dom": ">= 16.8.6 < 17",
104
104
  "semantic-ui-react": ">= 0.88.2 < 2.1"
105
105
  },
106
- "gitHead": "03104a28941b568007ad53b85874ff58225eaa6a"
106
+ "gitHead": "e9f62f91507d810f91963967a5f3afa20100c1b9"
107
107
  }
@@ -16,7 +16,12 @@ import {
16
16
  linkTo,
17
17
  } from "@truedat/core/routes";
18
18
 
19
- export const RuleImplementationTabs = ({ rule, ruleImplementation, match }) => {
19
+ export const RuleImplementationTabs = ({
20
+ rule,
21
+ ruleImplementation,
22
+ match,
23
+ canCreateLink,
24
+ }) => {
20
25
  const latest_rule_id = _.flow(
21
26
  _.pathOr([], "results"),
22
27
  _.head,
@@ -39,17 +44,18 @@ export const RuleImplementationTabs = ({ rule, ruleImplementation, match }) => {
39
44
  <FormattedMessage id="tabs.dq.ruleImplementation" />
40
45
  </Menu.Item>
41
46
 
42
- <Menu.Item
43
- active={match.path === IMPLEMENTATION_CONCEPT_LINKS}
44
- as={Link}
45
- to={linkTo.IMPLEMENTATION_CONCEPT_LINKS({
46
- id: rule.id,
47
- implementation_id: ruleImplementation.id,
48
- })}
49
- >
50
- <FormattedMessage id="tabs.dq.implementation.links" />
51
- </Menu.Item>
52
-
47
+ {canCreateLink && (
48
+ <Menu.Item
49
+ active={match.path === IMPLEMENTATION_CONCEPT_LINKS}
50
+ as={Link}
51
+ to={linkTo.IMPLEMENTATION_CONCEPT_LINKS({
52
+ id: rule.id,
53
+ implementation_id: ruleImplementation.id,
54
+ })}
55
+ >
56
+ <FormattedMessage id="tabs.dq.implementation.links" />
57
+ </Menu.Item>
58
+ )}
53
59
  <Menu.Item
54
60
  active={match.path === RULE_IMPLEMENTATION_RESULTS}
55
61
  as={Link}
@@ -91,11 +97,17 @@ RuleImplementationTabs.propTypes = {
91
97
  rule: PropTypes.object,
92
98
  ruleImplementation: PropTypes.object,
93
99
  match: PropTypes.object,
100
+ canCreateLink: PropTypes.bool,
94
101
  };
95
102
 
96
- const mapStateToProps = ({ rule, ruleImplementation }) => ({
103
+ const mapStateToProps = ({
104
+ rule,
105
+ ruleImplementation,
106
+ implementationActions,
107
+ }) => ({
97
108
  rule,
98
109
  ruleImplementation,
110
+ canCreateLink: _.propOr(false, "link_concept")(implementationActions),
99
111
  });
100
112
 
101
113
  export default compose(
@@ -14,6 +14,7 @@ const state = {
14
14
  manage_quality_rule_implementations: true,
15
15
  manage_quality_rules: true,
16
16
  },
17
+ implementationActions: { link_concept: true },
17
18
  };
18
19
 
19
20
  const renderOpts = {
@@ -19,6 +19,7 @@ describe("<RuleImplementationTabs />", () => {
19
19
  rule: { id: 8 },
20
20
  ruleImplementation: { id: 1 },
21
21
  match: { path: "" },
22
+ canCreateLink: true,
22
23
  };
23
24
  it("matches the latest snapshot", () => {
24
25
  const { container } = render(