@truedat/bg 5.15.0 → 5.15.2

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/bg",
3
- "version": "5.15.0",
3
+ "version": "5.15.2",
4
4
  "description": "Truedat Web Business Glossary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -86,9 +86,9 @@
86
86
  ]
87
87
  },
88
88
  "dependencies": {
89
- "@truedat/core": "5.15.0",
90
- "@truedat/df": "5.15.0",
91
- "@truedat/lm": "5.15.0",
89
+ "@truedat/core": "5.15.2",
90
+ "@truedat/df": "5.15.2",
91
+ "@truedat/lm": "5.15.2",
92
92
  "decode-uri-component": "^0.2.2",
93
93
  "file-saver": "^2.0.5",
94
94
  "moment": "^2.29.4",
@@ -111,5 +111,5 @@
111
111
  "react-dom": ">= 16.8.6 < 17",
112
112
  "semantic-ui-react": ">= 2.0.3 < 2.2"
113
113
  },
114
- "gitHead": "93bcd66804df32821aa0d563b863774554a39047"
114
+ "gitHead": "c1454a0ebd579263c17b3abea9715fc1ca3cf9ae"
115
115
  }
@@ -8,7 +8,6 @@ import {
8
8
  Segment,
9
9
  Grid,
10
10
  Icon,
11
- Popup,
12
11
  Table,
13
12
  } from "semantic-ui-react";
14
13
  import { FormattedMessage, useIntl } from "react-intl";
@@ -50,7 +49,7 @@ export const ConceptRelations = ({
50
49
  conceptRelations,
51
50
  concept,
52
51
  relationsGraph,
53
- initialDepth,
52
+ initialDepth = Infinity,
54
53
  visible,
55
54
  }) => {
56
55
  const { formatMessage } = useIntl();
@@ -75,7 +74,7 @@ export const ConceptRelations = ({
75
74
  setAllowedTags(value);
76
75
  };
77
76
 
78
- const [depth, setDepth] = useState(initialDepth || Infinity);
77
+ const [depth, setDepth] = useState(initialDepth);
79
78
  const [maxDepth, setMaxDepth] = useState(0);
80
79
  const [currentId, setCurrentId] = useState();
81
80
  const [tagOptions, setTagsOptions] = useState([]);
@@ -101,9 +100,13 @@ export const ConceptRelations = ({
101
100
  );
102
101
 
103
102
  setMaxDepth(newMaxDepth);
104
- setDepth(newMaxDepth);
103
+ setDepth(
104
+ _.isEmpty(traversalTags)
105
+ ? Math.min(initialDepth, newMaxDepth)
106
+ : newMaxDepth
107
+ );
105
108
  }
106
- }, [relationsGraph, currentId, traversalTags]);
109
+ }, [relationsGraph, currentId, traversalTags, initialDepth]);
107
110
 
108
111
  useEffect(() => {
109
112
  /* just a little optimization to avoid generating a graph if no limitations
@@ -142,7 +145,7 @@ export const ConceptRelations = ({
142
145
 
143
146
  // eslint-disable-next-line prettier/prettier
144
147
  _.flow(graphDistinctTags, tagsToOptions, setTagsOptions)(relationsGraph);
145
- }, [relationsGraph]);
148
+ }, [relationsGraph, formatMessage]);
146
149
 
147
150
  return (
148
151
  <Segment attached="bottom">