@truedat/lm 8.5.6 → 8.5.8

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.6",
3
+ "version": "8.5.8",
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.6",
57
+ "@truedat/test": "8.5.8",
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": "41e5e6138f5622558bae4151e720c040c4581162"
89
+ "gitHead": "61ad9443b3d822d30dcfa977f5fad3494b3ed5b4"
90
90
  }
@@ -84,6 +84,7 @@ export const ImplementationLinks = ({
84
84
  <Button
85
85
  floated="right"
86
86
  primary
87
+ icon="linkify"
87
88
  as={Link}
88
89
  to={linkTo.IMPLEMENTATION_CONCEPT_LINKS_NEW({
89
90
  implementation_id: implementation_id,
@@ -123,6 +123,7 @@ export const QualityControlConcepts = ({ qualityControl, actions }) => {
123
123
  <Button
124
124
  floated="right"
125
125
  primary
126
+ icon="linkify"
126
127
  as={Link}
127
128
  to={linkTo.QUALITY_CONTROL_CONCEPT_LINKS_NEW({
128
129
  id: qualityControl?.id,
@@ -146,6 +146,7 @@ export const QualityControlStructures = ({ qualityControl, actions }) => {
146
146
  <Button
147
147
  floated="right"
148
148
  primary
149
+ icon="linkify"
149
150
  as={Link}
150
151
  to={linkTo.QUALITY_CONTROL_STRUCTURE_LINKS_NEW({
151
152
  id: qualityControl?.id,
@@ -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;
@@ -55,7 +57,7 @@ export const StructureLinks = ({
55
57
 
56
58
  const columns = _.every(
57
59
  (structureLink) => _.isEmpty(structureLink.tags),
58
- structureLinks
60
+ structureLinks,
59
61
  )
60
62
  ? structureLinkColumnsWithoutTags
61
63
  : structureLinkColumnsWithTags;
@@ -79,21 +81,20 @@ export const StructureLinks = ({
79
81
  <Button
80
82
  floated="right"
81
83
  primary
84
+ icon="linkify"
82
85
  as={Link}
83
86
  to={linkTo.STRUCTURE_LINKS_NEW({ id })}
84
87
  content={<FormattedMessage id="links.actions.create" />}
85
88
  />
86
89
  {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>
90
+ <SuggestLinkButton
91
+ floated="right"
92
+ onSubmit={(prompt) =>
93
+ navigate(linkTo.STRUCTURE_LINKS_CONCEPTS_SUGGEST({ id }), {
94
+ state: { prompt },
95
+ })
96
+ }
97
+ />
97
98
  )}
98
99
  </Grid.Column>
99
100
  )}
@@ -120,7 +121,7 @@ StructureLinks.propTypes = {
120
121
  const mapStateToProps = (state) => ({
121
122
  structure: state.structure,
122
123
  structureLinks: _.sortBy(accentInsensitivePathOrder("name"))(
123
- getStructureToConceptLinks(state)
124
+ getStructureToConceptLinks(state),
124
125
  ),
125
126
  canCreateLink: _.has("create_link")(state.structureActions),
126
127
  canSuggestConceptLink: _.has("suggest_concept_link")(state.structureActions),
@@ -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>
@@ -164,7 +164,7 @@ exports[`<ConceptStructureLinkForm /> matches the latest snapshot 1`] = `
164
164
  actions.create
165
165
  </button>
166
166
  <a
167
- class="ui secondary button"
167
+ class="ui secondary button td-icon-text-control"
168
168
  data-discover="true"
169
169
  href="/"
170
170
  role="button"
@@ -17,6 +17,10 @@ exports[`<ImplementationLinks /> matches the latest snapshot 1`] = `
17
17
  href="/implementations/4/links/concepts/new"
18
18
  role="button"
19
19
  >
20
+ <i
21
+ aria-hidden="true"
22
+ class="linkify icon"
23
+ />
20
24
  create
21
25
  </a>
22
26
  </div>
@@ -122,6 +126,10 @@ exports[`<ImplementationLinks /> matches the latest snapshot when implementation
122
126
  href="/implementations/4/links/concepts/new"
123
127
  role="button"
124
128
  >
129
+ <i
130
+ aria-hidden="true"
131
+ class="linkify icon"
132
+ />
125
133
  create
126
134
  </a>
127
135
  </div>
@@ -286,7 +286,7 @@ exports[`<ImplementationRelationForm /> matches the latest snapshot 1`] = `
286
286
  actions.create
287
287
  </button>
288
288
  <a
289
- class="ui secondary button"
289
+ class="ui secondary button td-icon-text-control"
290
290
  data-discover="true"
291
291
  href="/"
292
292
  role="button"
@@ -154,7 +154,7 @@ exports[`<NewRelationTag /> matches the latest snapshot 1`] = `
154
154
  actions.create
155
155
  </button>
156
156
  <a
157
- class="ui secondary button"
157
+ class="ui secondary button td-icon-text-control"
158
158
  data-discover="true"
159
159
  href="/"
160
160
  role="button"
@@ -16,6 +16,10 @@ exports[`<QualityControlConcepts /> matches the latest snapshot 1`] = `
16
16
  href="/qualityControls/10/version/1/links/concepts/new"
17
17
  role="button"
18
18
  >
19
+ <i
20
+ aria-hidden="true"
21
+ class="linkify icon"
22
+ />
19
23
  links.actions.create
20
24
  </a>
21
25
  </div>
@@ -16,6 +16,10 @@ exports[`<QualityControlStructures /> matches the latest snapshot 1`] = `
16
16
  href="/qualityControls/10/version/1/links/structures/new"
17
17
  role="button"
18
18
  >
19
+ <i
20
+ aria-hidden="true"
21
+ class="linkify icon"
22
+ />
19
23
  links.actions.create
20
24
  </a>
21
25
  </div>
@@ -138,7 +138,7 @@ exports[`<RelationTagForm /> matches the latest snapshot 1`] = `
138
138
  actions.create
139
139
  </button>
140
140
  <a
141
- class="ui secondary button"
141
+ class="ui secondary button td-icon-text-control"
142
142
  data-discover="true"
143
143
  href="/"
144
144
  role="button"
@@ -223,7 +223,7 @@ exports[`<StructureRelationForm /> matches the latest snapshot 1`] = `
223
223
  Create
224
224
  </button>
225
225
  <a
226
- class="ui secondary button"
226
+ class="ui secondary button td-icon-text-control"
227
227
  data-discover="true"
228
228
  href="/"
229
229
  role="button"