@truedat/bg 5.13.8 → 5.14.0

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.13.8",
3
+ "version": "5.14.0",
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.13.8",
90
- "@truedat/df": "5.13.8",
91
- "@truedat/lm": "5.13.8",
89
+ "@truedat/core": "5.14.0",
90
+ "@truedat/df": "5.14.0",
91
+ "@truedat/lm": "5.14.0",
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": "7df525b7a8d6029a2b2878b63e869923d8515622"
114
+ "gitHead": "f1e5448ad078ffe2eece70dabf785f2dc295f0e9"
115
115
  }
@@ -22,13 +22,14 @@ export const ConceptImplementationLinks = ({
22
22
  createImplementation,
23
23
  createLinkImplementation,
24
24
  createRawImplementation,
25
+ visible,
25
26
  }) => {
26
27
  const params = useParams();
27
28
  const { formatMessage } = useIntl();
28
29
  return (
29
30
  <Segment attached="bottom">
30
31
  <div style={{ height: "40px" }}>
31
- {createRawImplementation && createLinkImplementation ? (
32
+ {createRawImplementation && visible && createLinkImplementation ? (
32
33
  <Button
33
34
  floated="right"
34
35
  as={Link}
@@ -41,7 +42,7 @@ export const ConceptImplementationLinks = ({
41
42
  })}
42
43
  />
43
44
  ) : null}
44
- {createImplementation && createLinkImplementation ? (
45
+ {createImplementation && visible && createLinkImplementation ? (
45
46
  <Button
46
47
  floated="right"
47
48
  primary
@@ -89,6 +90,7 @@ ConceptImplementationLinks.propTypes = {
89
90
  createImplementation: PropTypes.object,
90
91
  createLinkImplementation: PropTypes.object,
91
92
  createRawImplementation: PropTypes.object,
93
+ visible: PropTypes.bool,
92
94
  };
93
95
 
94
96
  const mapStateToProps = (state) => ({
@@ -102,6 +104,7 @@ const mapStateToProps = (state) => ({
102
104
  createRawImplementation: _.prop("create_raw_implementation")(
103
105
  state.conceptPermissions
104
106
  ),
107
+ visible: _.prop("status")(state.concept) != "deprecated",
105
108
  });
106
109
 
107
110
  export default connect(mapStateToProps)(ConceptImplementationLinks);
@@ -51,6 +51,7 @@ export const ConceptRelations = ({
51
51
  concept,
52
52
  relationsGraph,
53
53
  initialDepth,
54
+ visible,
54
55
  }) => {
55
56
  const { formatMessage } = useIntl();
56
57
  const history = useHistory();
@@ -140,11 +141,7 @@ export const ConceptRelations = ({
140
141
  );
141
142
 
142
143
  // eslint-disable-next-line prettier/prettier
143
- _.flow(
144
- graphDistinctTags,
145
- tagsToOptions,
146
- setTagsOptions
147
- )(relationsGraph);
144
+ _.flow(graphDistinctTags, tagsToOptions, setTagsOptions)(relationsGraph);
148
145
  }, [relationsGraph]);
149
146
 
150
147
  return (
@@ -199,7 +196,7 @@ export const ConceptRelations = ({
199
196
  </Button>
200
197
  </Button.Group>
201
198
  ) : null}
202
- <ConceptRelationActions />
199
+ ,{visible ? <ConceptRelationActions /> : null}
203
200
  </div>
204
201
 
205
202
  {conceptRelations ? (
@@ -250,6 +247,7 @@ ConceptRelations.propTypes = {
250
247
  concept: PropTypes.object,
251
248
  relationsGraph: PropTypes.object,
252
249
  initialDepth: PropTypes.number,
250
+ visible: PropTypes.bool,
253
251
  };
254
252
 
255
253
  const sortByDirectionAndTag = (concept) => {
@@ -264,7 +262,7 @@ const mapStateToProps = (state) => ({
264
262
  conceptRelations: sortByDirectionAndTag(state.concept)(
265
263
  getConceptToConceptRelations(state)
266
264
  ),
267
- concept: state.concept,
265
+ visible: _.prop("status")(state.concept) != "deprecated",
268
266
  relationsLoading: state.relationsLoading,
269
267
  relationsGraph: state.relationsGraph,
270
268
  initialDepth: state.conceptGraphInitialDepth,
@@ -1,3 +1,4 @@
1
+ import _ from "lodash/fp";
1
2
  import React from "react";
2
3
  import PropTypes from "prop-types";
3
4
  import { connect } from "react-redux";
@@ -7,23 +8,29 @@ import ConceptLinksActions from "./ConceptLinksActions";
7
8
 
8
9
  const LinksPane = React.lazy(() => import("@truedat/lm/components/LinksPane"));
9
10
 
10
- export const ConceptStructureLinksPane = ({ groups }) => (
11
- <Segment attached="bottom">
12
- <LinksPane
13
- groups={groups}
14
- sourceType="concept"
15
- targetType="structure"
16
- linksActions={<ConceptLinksActions />}
17
- />
18
- </Segment>
19
- );
11
+ export const ConceptStructureLinksPane = ({ groups, visible }) => {
12
+ const LinksActions = visible ? <ConceptLinksActions /> : null;
13
+
14
+ return (
15
+ <Segment attached="bottom">
16
+ <LinksPane
17
+ groups={groups}
18
+ sourceType="concept"
19
+ targetType="structure"
20
+ linksActions={LinksActions}
21
+ />
22
+ </Segment>
23
+ );
24
+ };
20
25
 
21
26
  ConceptStructureLinksPane.propTypes = {
22
- groups: PropTypes.array
27
+ groups: PropTypes.array,
28
+ visible: PropTypes.bool,
23
29
  };
24
30
 
25
- const mapStateToProps = state => ({
26
- groups: getConceptLinks(state)
31
+ const mapStateToProps = (state) => ({
32
+ groups: getConceptLinks(state),
33
+ visible: _.prop("status")(state.concept) != "deprecated",
27
34
  });
28
35
 
29
36
  export default connect(mapStateToProps)(ConceptStructureLinksPane);
@@ -29,22 +29,7 @@ exports[`<ConceptImplementationLinks /> show create implementations buttons when
29
29
  >
30
30
  <div
31
31
  style="height: 40px;"
32
- >
33
- <a
34
- class="ui right floated button"
35
- href="/implementations/new_raw?business_concept_id=6483&id=12345"
36
- role="button"
37
- >
38
- Create Raw Implementation
39
- </a>
40
- <a
41
- class="ui primary right floated button"
42
- href="/implementations/new?business_concept_id=6483&id=12345"
43
- role="button"
44
- >
45
- Create Implementation
46
- </a>
47
- </div>
32
+ />
48
33
  <div
49
34
  class="ui vertical segment"
50
35
  >
@@ -189,22 +174,7 @@ exports[`<ConceptImplementationLinks /> show implementations with groups 1`] = `
189
174
  >
190
175
  <div
191
176
  style="height: 40px;"
192
- >
193
- <a
194
- class="ui right floated button"
195
- href="/implementations/new_raw?business_concept_id=6483&id=12345"
196
- role="button"
197
- >
198
- Create Raw Implementation
199
- </a>
200
- <a
201
- class="ui primary right floated button"
202
- href="/implementations/new?business_concept_id=6483&id=12345"
203
- role="button"
204
- >
205
- Create Implementation
206
- </a>
207
- </div>
177
+ />
208
178
  <div
209
179
  class="ui vertical segment"
210
180
  >
@@ -482,22 +452,7 @@ exports[`<ConceptImplementationLinks /> when don't have any implementation 1`] =
482
452
  >
483
453
  <div
484
454
  style="height: 40px;"
485
- >
486
- <a
487
- class="ui right floated button"
488
- href="/implementations/new_raw?business_concept_id=6483&id=12345"
489
- role="button"
490
- >
491
- Create Raw Implementation
492
- </a>
493
- <a
494
- class="ui primary right floated button"
495
- href="/implementations/new?business_concept_id=6483&id=12345"
496
- role="button"
497
- >
498
- Create Implementation
499
- </a>
500
- </div>
455
+ />
501
456
  <div
502
457
  class="ui message"
503
458
  >
@@ -44,7 +44,7 @@ exports[`<ConceptRelations /> matches the latest snapshot 1`] = `
44
44
  <div
45
45
  className="implementation-actions"
46
46
  >
47
- <Connect(ConceptRelationActions) />
47
+ ,
48
48
  </div>
49
49
  <Table
50
50
  as="table"
@@ -24,7 +24,7 @@ exports[`<ConceptStructureLinksPane /> matches the latest snapshot 1`] = `
24
24
  ],
25
25
  ]
26
26
  }
27
- linksActions={<Memo(Connect(ConceptLinksActions)) />}
27
+ linksActions={null}
28
28
  sourceType="concept"
29
29
  targetType="structure"
30
30
  />