@truedat/bg 5.14.1 → 5.14.3

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.14.1",
3
+ "version": "5.14.3",
4
4
  "description": "Truedat Web Business Glossary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -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": "a4ee212708f281ed1bbe15431e6d8731a55f2d29"
114
+ "gitHead": "10488297b3b272c8d1732df2c8176778d1d42684"
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">
@@ -196,7 +199,7 @@ export const ConceptRelations = ({
196
199
  </Button>
197
200
  </Button.Group>
198
201
  ) : null}
199
- ,{visible ? <ConceptRelationActions /> : null}
202
+ {visible ? <ConceptRelationActions /> : null}
200
203
  </div>
201
204
 
202
205
  {conceptRelations ? (
@@ -262,6 +265,7 @@ const mapStateToProps = (state) => ({
262
265
  conceptRelations: sortByDirectionAndTag(state.concept)(
263
266
  getConceptToConceptRelations(state)
264
267
  ),
268
+ concept: state.concept,
265
269
  visible: _.prop("status")(state.concept) != "deprecated",
266
270
  relationsLoading: state.relationsLoading,
267
271
  relationsGraph: state.relationsGraph,
@@ -43,9 +43,7 @@ exports[`<ConceptRelations /> matches the latest snapshot 1`] = `
43
43
  </div>
44
44
  <div
45
45
  className="implementation-actions"
46
- >
47
- ,
48
- </div>
46
+ />
49
47
  <Table
50
48
  as="table"
51
49
  selectable={true}