@truedat/lm 8.5.4 → 8.5.7

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/lm",
3
- "version": "8.5.4",
3
+ "version": "8.5.7",
4
4
  "description": "Truedat Link Manager",
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -54,7 +54,7 @@
54
54
  "@testing-library/jest-dom": "^6.6.3",
55
55
  "@testing-library/react": "^16.3.0",
56
56
  "@testing-library/user-event": "^14.6.1",
57
- "@truedat/test": "8.5.4",
57
+ "@truedat/test": "8.5.7",
58
58
  "identity-obj-proxy": "^3.0.0",
59
59
  "jest": "^29.7.0",
60
60
  "redux-saga-test-plan": "^4.0.6"
@@ -86,5 +86,5 @@
86
86
  "semantic-ui-react": "^3.0.0-beta.2",
87
87
  "swr": "^2.3.3"
88
88
  },
89
- "gitHead": "75272567eb3ec948a5cdeb8346ef9cacac58267f"
89
+ "gitHead": "871357888d97c203cf009a04878e0277cff6af9b"
90
90
  }
@@ -3,7 +3,7 @@ import PropTypes from "prop-types";
3
3
  import { connect } from "react-redux";
4
4
  import { Table, Button, Grid } from "semantic-ui-react";
5
5
  import { FormattedMessage } from "react-intl";
6
- import { Link } from "react-router";
6
+ import { Link, useNavigate } from "react-router";
7
7
  import { linkTo } from "@truedat/core/routes";
8
8
  import { accentInsensitivePathOrder } from "@truedat/core/services/sort";
9
9
  import { getStructureToConceptLinks } from "../selectors/getStructureLinks";
@@ -12,14 +12,16 @@ import ConceptLinkTags from "../components/ConceptLinkTags";
12
12
  import StructureLinkRow from "./StructureLinkRow";
13
13
  import { useQuery } from "@apollo/client";
14
14
  import { DATA_STRUCTURE_VERSION_LINKS_QUERY } from "@truedat/dd/api/queries";
15
+ import SuggestLinkButton from "@truedat/ai/components/SuggestLinkButton";
15
16
 
16
17
  export const StructureLinks = ({
17
18
  structure,
18
19
  canCreateLink,
19
20
  canSuggestConceptLink,
20
21
  }) => {
22
+ const navigate = useNavigate();
21
23
  const { data } = useQuery(DATA_STRUCTURE_VERSION_LINKS_QUERY, {
22
- fetchPolicy: "network-only",
24
+ fetchPolicy: "network-only",
23
25
  variables: { dataStructureId: structure.id, version: "latest" },
24
26
  });
25
27
  const structureLinks = data?.dataStructureVersion.links;
@@ -84,16 +86,14 @@ export const StructureLinks = ({
84
86
  content={<FormattedMessage id="links.actions.create" />}
85
87
  />
86
88
  {canSuggestConceptLink && (
87
- <Grid.Column width={16}>
88
- <Button
89
- floated="right"
90
- icon="lightbulb outline"
91
- secondary
92
- as={Link}
93
- to={linkTo.STRUCTURE_LINKS_CONCEPTS_SUGGEST({ id })}
94
- content={<FormattedMessage id="links.actions.suggest" />}
95
- />
96
- </Grid.Column>
89
+ <SuggestLinkButton
90
+ floated="right"
91
+ onSubmit={(prompt) =>
92
+ navigate(linkTo.STRUCTURE_LINKS_CONCEPTS_SUGGEST({ id }), {
93
+ state: { prompt },
94
+ })
95
+ }
96
+ />
97
97
  )}
98
98
  </Grid.Column>
99
99
  )}
@@ -13,7 +13,7 @@ import { linkConcept, clearSelectedRelationTags } from "../routines";
13
13
  import TagTypeDropdownSelector from "./TagTypeDropdownSelector";
14
14
  import RelationTagsLoader from "./RelationTagsLoader";
15
15
 
16
- const ConceptSuggestions = React.lazy(() => import("@truedat/bg/concepts/components/ConceptSuggestions"));
16
+ const ConceptSuggestions = React.lazy(() => import("@truedat/ai/components/ConceptSuggestions"));
17
17
 
18
18
  const selectTagOptions = makeTagOptionsSelector("data_field");
19
19
 
@@ -25,7 +25,7 @@ jest.mock("react-intl", () => ({
25
25
 
26
26
 
27
27
  // Mock components
28
- jest.mock("@truedat/bg/concepts/components/ConceptSuggestions", () =>
28
+ jest.mock("@truedat/ai/components/ConceptSuggestions", () =>
29
29
  jest.fn((props) => {
30
30
  return (
31
31
  <div>