@truedat/bg 7.5.12 → 7.5.13

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": "7.5.12",
3
+ "version": "7.5.13",
4
4
  "description": "Truedat Web Business Glossary",
5
5
  "sideEffects": false,
6
6
  "module": "src/index.js",
@@ -48,7 +48,7 @@
48
48
  "@testing-library/jest-dom": "^6.6.3",
49
49
  "@testing-library/react": "^16.3.0",
50
50
  "@testing-library/user-event": "^14.6.1",
51
- "@truedat/test": "7.5.12",
51
+ "@truedat/test": "7.5.13",
52
52
  "identity-obj-proxy": "^3.0.0",
53
53
  "jest": "^29.7.0",
54
54
  "redux-saga-test-plan": "^4.0.6"
@@ -82,5 +82,5 @@
82
82
  "semantic-ui-react": "^3.0.0-beta.2",
83
83
  "swr": "^2.3.3"
84
84
  },
85
- "gitHead": "1476061ceb9ed15e0bacec71e20d695a0cd57986"
85
+ "gitHead": "83de799e59c0d13d4d52812070d232d24f0b5f82"
86
86
  }
@@ -235,6 +235,7 @@ const hiddenActions = [
235
235
  "set_confidential",
236
236
  "update_domain",
237
237
  "actions",
238
+ "suggest_structure_link",
238
239
  ];
239
240
 
240
241
  const editUrl = (conceptActions, concept) =>
@@ -4,7 +4,7 @@ import PropTypes from "prop-types";
4
4
  import { useIntl } from "react-intl";
5
5
  import { connect } from "react-redux";
6
6
  import { Button } from "semantic-ui-react";
7
- import { Link } from "react-router";
7
+ import { Link, useParams } from "react-router";
8
8
  import { linkTo } from "@truedat/core/routes";
9
9
  import { Checkbox } from "semantic-ui-react";
10
10
 
@@ -15,8 +15,10 @@ export const ConceptLinksActions = ({
15
15
  createLinkUrl,
16
16
  grantView,
17
17
  onGrantViewChange,
18
+ canSuggestLinks,
18
19
  }) => {
19
20
  const { formatMessage } = useIntl();
21
+ const params = useParams();
20
22
 
21
23
  return createLinkUrl ? (
22
24
  <div style={{ float: "right" }}>
@@ -33,6 +35,15 @@ export const ConceptLinksActions = ({
33
35
  <ConceptLinkstRequestGrantButton disabled={!grantView} />
34
36
  </Fragment>
35
37
  ) : null}
38
+ {canSuggestLinks && (
39
+ <Button
40
+ secondary
41
+ as={Link}
42
+ icon="lightbulb outline"
43
+ content={formatMessage({ id: "links.actions.suggest" })}
44
+ to={linkTo.CONCEPT_LINKS_STRUCTURES_SUGGEST(params)}
45
+ />
46
+ )}
36
47
  <Button
37
48
  primary
38
49
  as={Link}
@@ -48,6 +59,7 @@ ConceptLinksActions.propTypes = {
48
59
  createLinkUrl: PropTypes.string,
49
60
  grantView: PropTypes.bool,
50
61
  onGrantViewChange: PropTypes.func,
62
+ canSuggestLinks: PropTypes.bool,
51
63
  };
52
64
 
53
65
  const mapStateToProps = ({ conceptActions, conceptActionLoading, concept }) => {
@@ -56,6 +68,8 @@ const mapStateToProps = ({ conceptActions, conceptActionLoading, concept }) => {
56
68
  _.has("create_structure_link")(conceptActions) && _.has("id")(concept)
57
69
  ? linkTo.CONCEPT_LINKS_STRUCTURES_NEW(concept)
58
70
  : null,
71
+ canSuggestLinks:
72
+ _.has("suggest_structure_link")(conceptActions) && _.has("id")(concept),
59
73
  conceptActionLoading,
60
74
  canManageGrantRequests: concept.actions?.manage_grant_requests,
61
75
  };
@@ -3,13 +3,6 @@ import React from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { Route, Routes } from "react-router";
5
5
  import { connect } from "react-redux";
6
- import {
7
- CONCEPT_LINKS_CONCEPTS,
8
- CONCEPT_LINKS_CONCEPTS_NEW,
9
- CONCEPT_LINKS_STRUCTURES,
10
- CONCEPT_LINKS_STRUCTURES_NEW,
11
- CONCEPT_LINKS_IMPLEMENTATIONS,
12
- } from "@truedat/core/routes";
13
6
  import ConceptStructureLinks from "./ConceptStructureLinks";
14
7
  import ConceptRelations from "./ConceptRelations";
15
8
  import ConceptRelationForm from "./ConceptRelationForm";
@@ -19,6 +12,10 @@ const ConceptStructureLinkForm = React.lazy(
19
12
  () => import("@truedat/lm/components/ConceptStructureLinkForm")
20
13
  );
21
14
 
15
+ const ConceptSuggestionLinkForm = React.lazy(
16
+ () => import("@truedat/lm/components/ConceptSuggestionLinkForm")
17
+ );
18
+
22
19
  const StructureTypesLoader = React.lazy(
23
20
  () => import("@truedat/dd/components/StructureTypesLoader")
24
21
  );
@@ -37,6 +34,7 @@ export const ConceptRelationsRoutes = ({ conceptLoaded, relationsLoading }) => {
37
34
  }
38
35
  />
39
36
  <Route path="new" element={<ConceptStructureLinkForm />} />
37
+ <Route path="suggest" element={<ConceptSuggestionLinkForm />} />
40
38
  </Route>
41
39
  <Route path="concepts">
42
40
  <Route index element={<ConceptRelations />} />
@@ -54,12 +54,14 @@ const ConceptStructureLinksSegment = ({ groups, visible }) => {
54
54
  </Grid.Row>
55
55
  </Grid>
56
56
  ) : (
57
- <LinksPane
58
- groups={groups}
59
- sourceType="concept"
60
- targetType="structure"
61
- linksActions={LinksActions}
62
- />
57
+ <>
58
+ <LinksPane
59
+ groups={groups}
60
+ sourceType="concept"
61
+ targetType="structure"
62
+ linksActions={LinksActions}
63
+ />
64
+ </>
63
65
  )}
64
66
  </Segment>
65
67
  );