@truedat/lm 7.5.7 → 7.5.10

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.
Files changed (71) hide show
  1. package/index.js +5 -0
  2. package/package.json +43 -67
  3. package/src/components/ConceptImplementationLink.js +1 -2
  4. package/src/components/ConceptLink.js +2 -3
  5. package/src/components/ConceptLinkTags.js +0 -1
  6. package/src/components/ConceptStructureLinkForm.js +3 -3
  7. package/src/components/ConfirmDeleteRelation.js +0 -1
  8. package/src/components/ImplementationLinkRow.js +0 -1
  9. package/src/components/ImplementationLinks.js +1 -2
  10. package/src/components/ImplementationRelationForm.js +5 -8
  11. package/src/components/LinksPane.js +0 -1
  12. package/src/components/NewRelationTag.js +0 -1
  13. package/src/components/RelationActions.js +3 -4
  14. package/src/components/RelationGraph.js +1 -1
  15. package/src/components/RelationGraphDepth.js +6 -3
  16. package/src/components/RelationRoutes.js +16 -25
  17. package/src/components/RelationRow.js +6 -7
  18. package/src/components/RelationTagCards.js +2 -2
  19. package/src/components/RelationTagForm.js +0 -2
  20. package/src/components/RelationTags.js +1 -2
  21. package/src/components/RelationTagsLoader.js +2 -2
  22. package/src/components/Relations.js +0 -1
  23. package/src/components/RelationsGraphLoader.js +0 -1
  24. package/src/components/StructureLinkRow.js +0 -1
  25. package/src/components/StructureLinks.js +1 -2
  26. package/src/components/StructureRelationForm.js +5 -9
  27. package/src/components/TagTypeDropdownSelector.js +1 -1
  28. package/src/components/TagTypeSelector.js +0 -2
  29. package/src/components/__tests__/ConceptImplementationLink.spec.js +0 -1
  30. package/src/components/__tests__/ConceptLinkTags.spec.js +7 -9
  31. package/src/components/__tests__/ConceptStructureLinkForm.spec.js +68 -20
  32. package/src/components/__tests__/ConfirmDeleteRelation.spec.js +0 -1
  33. package/src/components/__tests__/ImplementationLinkRow.spec.js +0 -1
  34. package/src/components/__tests__/ImplementationLinks.spec.js +0 -1
  35. package/src/components/__tests__/ImplementationRelationForm.spec.js +45 -73
  36. package/src/components/__tests__/LinksPane.spec.js +0 -1
  37. package/src/components/__tests__/NewRelationTag.spec.js +0 -1
  38. package/src/components/__tests__/RelationActions.spec.js +14 -15
  39. package/src/components/__tests__/RelationRoutes.spec.js +59 -7
  40. package/src/components/__tests__/RelationRow.spec.js +46 -23
  41. package/src/components/__tests__/RelationTagCards.spec.js +0 -1
  42. package/src/components/__tests__/RelationTagForm.spec.js +26 -37
  43. package/src/components/__tests__/RelationTags.spec.js +0 -1
  44. package/src/components/__tests__/RelationTagsLoader.spec.js +6 -6
  45. package/src/components/__tests__/Relations.spec.js +19 -17
  46. package/src/components/__tests__/RelationsGraphLoader.spec.js +32 -26
  47. package/src/components/__tests__/RelationsLoader.spec.js +19 -19
  48. package/src/components/__tests__/StructureRelationForm.spec.js +41 -42
  49. package/src/components/__tests__/TagTypeSelector.spec.js +7 -13
  50. package/src/components/__tests__/__snapshots__/ConceptImplementationLink.spec.js.snap +1 -0
  51. package/src/components/__tests__/__snapshots__/ConceptLinkTags.spec.js.snap +12 -20
  52. package/src/components/__tests__/__snapshots__/ConceptStructureLinkForm.spec.js.snap +170 -19
  53. package/src/components/__tests__/__snapshots__/ImplementationLinks.spec.js.snap +4 -0
  54. package/src/components/__tests__/__snapshots__/ImplementationRelationForm.spec.js.snap +13 -13
  55. package/src/components/__tests__/__snapshots__/NewRelationTag.spec.js.snap +12 -11
  56. package/src/components/__tests__/__snapshots__/RelationActions.spec.js.snap +1 -1
  57. package/src/components/__tests__/__snapshots__/RelationRoutes.spec.js.snap +21 -5
  58. package/src/components/__tests__/__snapshots__/RelationRow.spec.js.snap +7 -1
  59. package/src/components/__tests__/__snapshots__/RelationTagCards.spec.js.snap +0 -1
  60. package/src/components/__tests__/__snapshots__/RelationTagForm.spec.js.snap +11 -10
  61. package/src/components/__tests__/__snapshots__/RelationTags.spec.js.snap +1 -1
  62. package/src/components/__tests__/__snapshots__/RelationTagsLoader.spec.js.snap +1 -1
  63. package/src/components/__tests__/__snapshots__/Relations.spec.js.snap +36 -27
  64. package/src/components/__tests__/__snapshots__/RelationsGraphLoader.spec.js.snap +1 -25
  65. package/src/components/__tests__/__snapshots__/StructureRelationForm.spec.js.snap +1 -1
  66. package/src/components/__tests__/__snapshots__/TagTypeSelector.spec.js.snap +11 -14
  67. package/src/hooks/useTags.js +1 -1
  68. package/src/sagas/__tests__/fetchRelationsGraph.spec.js +2 -2
  69. package/src/sagas/fetchRelationsGraph.js +1 -1
  70. package/src/selectors/getStructureLinks.js +1 -1
  71. package/src/services/relationGraphTraversal.js +3 -3
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { default as components } from "./src/components";
2
+ export { default as routines } from "./src/routines";
3
+ export { default as reducers } from "./src/reducers";
4
+ export { default as sagas } from "./src/sagas";
5
+ export { default } from "./src";
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@truedat/lm",
3
- "version": "7.5.7",
3
+ "version": "7.5.10",
4
4
  "description": "Truedat Link Manager",
5
5
  "sideEffects": false,
6
- "jsnext:main": "src/index.js",
7
6
  "module": "src/index.js",
8
7
  "files": [
9
- "src"
8
+ "src",
9
+ "index.js"
10
10
  ],
11
11
  "author": "Bluetab Solutions",
12
12
  "license": "GPL-3.0",
@@ -15,64 +15,25 @@
15
15
  },
16
16
  "scripts": {
17
17
  "clean": "rimraf yarn-error.log",
18
- "debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
19
18
  "test": "TZ=UTC jest --coverage",
20
- "test:watch": "TZ=UTC jest --watch",
21
19
  "eslint": "eslint src/**",
22
20
  "eslint:fix": "eslint --fix src/**"
23
21
  },
24
- "devDependencies": {
25
- "@babel/cli": "^7.19.3",
26
- "@babel/core": "^7.20.5",
27
- "@babel/plugin-proposal-class-properties": "^7.18.6",
28
- "@babel/plugin-proposal-object-rest-spread": "^7.20.2",
29
- "@babel/plugin-proposal-optional-chaining": "^7.18.9",
30
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
31
- "@babel/plugin-transform-modules-commonjs": "^7.19.6",
32
- "@babel/preset-env": "^7.20.2",
33
- "@babel/preset-react": "^7.18.6",
34
- "@testing-library/jest-dom": "^5.16.5",
35
- "@testing-library/react": "^12.0.0",
36
- "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "7.5.7",
38
- "babel-jest": "^28.1.0",
39
- "babel-plugin-dynamic-import-node": "^2.3.3",
40
- "babel-plugin-lodash": "^3.3.4",
41
- "babel-plugin-react-intl": "^5.1.18",
42
- "babel-plugin-transform-semantic-ui-react-imports": "^1.4.1",
43
- "enzyme": "^3.11.0",
44
- "enzyme-to-json": "^3.6.2",
45
- "identity-obj-proxy": "^3.0.0",
46
- "jest": "^29.0.0",
47
- "jest-environment-jsdom": "^29.0.0",
48
- "react": "^16.14.0",
49
- "react-dom": "^16.14.0",
50
- "redux-saga-test-plan": "^4.0.4",
51
- "rimraf": "^3.0.2",
52
- "semantic-ui-react": "^2.1.4"
53
- },
54
22
  "jest": {
55
23
  "maxWorkers": "50%",
56
24
  "testTimeout": 10000,
57
25
  "moduleDirectories": [
58
- "<rootDir>/src",
59
- "../../node_modules"
60
- ],
61
- "setupFilesAfterEnv": [
62
- "@truedat/test/setup"
26
+ "<rootDir>/src"
63
27
  ],
64
28
  "moduleNameMapper": {
65
29
  "\\.(css|less|png)$": "identity-obj-proxy",
66
30
  "^@truedat/([^/]+)$": "<rootDir>/../$1/src/index",
67
31
  "^@truedat/([^/]+)/(.*)$": "<rootDir>/../$1/src/$2"
68
32
  },
69
- "snapshotSerializers": [
70
- "enzyme-to-json/serializer"
33
+ "setupFilesAfterEnv": [
34
+ "@truedat/test/setup"
71
35
  ],
72
36
  "testEnvironment": "jsdom",
73
- "testPathIgnorePatterns": [
74
- "<rootDir>/node_modules/"
75
- ],
76
37
  "transform": {
77
38
  "\\.js$": [
78
39
  "babel-jest",
@@ -80,32 +41,47 @@
80
41
  "rootMode": "upward"
81
42
  }
82
43
  ]
83
- },
84
- "transformIgnorePatterns": [
85
- "/node_modules/(?!@truedat).*"
86
- ]
44
+ }
45
+ },
46
+ "devDependencies": {
47
+ "@testing-library/dom": "^10.4.0",
48
+ "@testing-library/jest-dom": "^6.6.3",
49
+ "@testing-library/react": "^16.2.0",
50
+ "@testing-library/user-event": "^14.6.1",
51
+ "@truedat/test": "7.5.10",
52
+ "identity-obj-proxy": "^3.0.0",
53
+ "jest": "^29.7.0",
54
+ "redux-saga-test-plan": "^4.0.6"
87
55
  },
88
56
  "dependencies": {
89
- "@truedat/core": "7.5.7",
90
- "path-to-regexp": "^1.7.0",
57
+ "@apollo/client": "^3.13.5",
58
+ "axios": "^1.8.4",
59
+ "graphql": "^16.10.0",
60
+ "is-hotkey": "^0.2.0",
61
+ "is-url": "^1.2.4",
62
+ "lodash": "^4.17.21",
63
+ "moment": "^2.30.1",
64
+ "path-to-regexp": "^8.2.0",
91
65
  "prop-types": "^15.8.1",
92
- "react-graph-vis": "1.0.6",
93
- "react-hook-form": "^7.30.0",
94
- "react-intl": "^5.20.10",
66
+ "query-string": "^7.1.2",
67
+ "react": "^19.0.0",
68
+ "react-csv": "^2.2.2",
69
+ "react-dom": "^19.0.0",
70
+ "react-dropzone": "^14.3.8",
71
+ "react-graph-vis": "1.0.7",
72
+ "react-hook-form": "^7.54.2",
73
+ "react-intl": "^7.1.10",
74
+ "react-moment": "^1.1.3",
95
75
  "react-rangeslider": "^2.2.0",
96
- "react-redux": "^7.2.4",
97
- "react-router-dom": "^5.2.0",
98
- "redux": "^4.1.1",
99
- "redux-saga": "^1.2.1",
76
+ "react-redux": "^9.2.0",
77
+ "react-router": "^7.4.0",
78
+ "redux": "^5.0.1",
79
+ "redux-saga": "^1.3.0",
100
80
  "redux-saga-routines": "^3.2.3",
101
- "semantic-ui-react": "^2.1.4",
102
- "vis-data": "^7.1.2",
103
- "vis-network": "^9.0.0"
104
- },
105
- "peerDependencies": {
106
- "react": ">= 16.8.6 < 17",
107
- "react-dom": ">= 16.8.6 < 17",
108
- "semantic-ui-react": ">= 2.0.3 < 2.2"
81
+ "reselect": "^5.1.1",
82
+ "semantic-ui-calendar-react": "^0.15.3",
83
+ "semantic-ui-react": "^3.0.0-beta.2",
84
+ "swr": "^2.3.3"
109
85
  },
110
- "gitHead": "01b1e4eb176b2c491750b524988e32094413515c"
86
+ "gitHead": "8a8c49e9d5d6bb4e5f2b503b063bfd6dd20a503d"
111
87
  }
@@ -1,5 +1,4 @@
1
- import React from "react";
2
- import { Link } from "react-router-dom";
1
+ import { Link } from "react-router";
3
2
  import PropTypes from "prop-types";
4
3
  import { linkTo } from "@truedat/core/routes";
5
4
 
@@ -1,5 +1,4 @@
1
- import React from "react";
2
- import { Link } from "react-router-dom";
1
+ import { Link } from "react-router";
3
2
  import PropTypes from "prop-types";
4
3
  import { linkTo } from "@truedat/core/routes";
5
4
 
@@ -13,7 +12,7 @@ export const ConceptLink = ({ resource_id: business_concept_id, name }) => (
13
12
 
14
13
  ConceptLink.propTypes = {
15
14
  resource_id: PropTypes.number,
16
- name: PropTypes.string
15
+ name: PropTypes.string,
17
16
  };
18
17
 
19
18
  export default ConceptLink;
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import PropTypes from "prop-types";
3
2
  import { FormattedMessage } from "react-intl";
4
3
 
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import React, { useState, useEffect } from "react";
2
+ import { lazy, useState, useEffect } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
5
  import { Button, Divider } from "semantic-ui-react";
@@ -14,8 +14,8 @@ import {
14
14
  } from "../routines";
15
15
  import TagTypeDropdownSelector from "./TagTypeDropdownSelector";
16
16
 
17
- const StructureSelector = React.lazy(() =>
18
- import("@truedat/dd/components/StructureSelector")
17
+ const StructureSelector = lazy(
18
+ () => import("@truedat/dd/components/StructureSelector")
19
19
  );
20
20
 
21
21
  export const ConceptStructureLinkForm = ({
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import PropTypes from "prop-types";
3
2
  import { connect } from "react-redux";
4
3
  import { Button, Icon } from "semantic-ui-react";
@@ -1,5 +1,4 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { Table } from "semantic-ui-react";
5
4
  import { columnDecorator } from "@truedat/core/services";
@@ -1,10 +1,9 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { connect } from "react-redux";
5
4
  import { Table, Icon, Button, Grid, Segment, Header } from "semantic-ui-react";
6
5
  import { FormattedMessage } from "react-intl";
7
- import { Link } from "react-router-dom";
6
+ import { Link } from "react-router";
8
7
  import { linkTo } from "@truedat/core/routes";
9
8
  import { accentInsensitivePathOrder } from "@truedat/core/services/sort";
10
9
  import { getImplementationToConceptLinks } from "../selectors/getImplementationToConceptLinks";
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import React, { useState } from "react";
2
+ import { lazy, useState } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
5
  import { useIntl } from "react-intl";
@@ -10,12 +10,12 @@ import { makeTagOptionsSelector } from "@truedat/core/selectors";
10
10
  import { linkConcept } from "../routines";
11
11
  import RelationTagsLoader from "./RelationTagsLoader";
12
12
 
13
- const TagTypeDropdownSelector = React.lazy(() =>
14
- import("@truedat/lm/components/TagTypeDropdownSelector")
13
+ const TagTypeDropdownSelector = lazy(
14
+ () => import("@truedat/lm/components/TagTypeDropdownSelector")
15
15
  );
16
16
 
17
- const ConceptSelector = React.lazy(() =>
18
- import("@truedat/bg/concepts/relations/components/ConceptSelector")
17
+ const ConceptSelector = lazy(
18
+ () => import("@truedat/bg/concepts/relations/components/ConceptSelector")
19
19
  );
20
20
 
21
21
  const filters = {
@@ -64,7 +64,6 @@ export const ImplementationRelationForm = ({
64
64
  id: "implementations.relation.new.header",
65
65
  })}
66
66
  />
67
-
68
67
  {!_.isEmpty(tagOptions) ? (
69
68
  <Form.Field className="concept-relation-form">
70
69
  <TagTypeDropdownSelector options={tagOptions} />
@@ -75,7 +74,6 @@ export const ImplementationRelationForm = ({
75
74
  handleConceptSelected={handleConceptSelected}
76
75
  defaultFilters={filters}
77
76
  />
78
-
79
77
  <div className="actions">
80
78
  <Button
81
79
  primary
@@ -84,7 +82,6 @@ export const ImplementationRelationForm = ({
84
82
  loading={conceptLinking}
85
83
  onClick={handleSubmit}
86
84
  />
87
-
88
85
  <HistoryBackButton
89
86
  content={formatMessage({ id: "actions.cancel" })}
90
87
  disabled={conceptLinking}
@@ -1,5 +1,4 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { Table, Header, Grid } from "semantic-ui-react";
5
4
  import { FormattedMessage } from "react-intl";
@@ -1,5 +1,4 @@
1
1
  import PropTypes from "prop-types";
2
- import React from "react";
3
2
  import { Header, Icon, Container, Segment } from "semantic-ui-react";
4
3
  import { FormattedMessage, useIntl } from "react-intl";
5
4
  import { connect } from "react-redux";
@@ -1,9 +1,8 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { connect } from "react-redux";
5
4
  import { Button } from "semantic-ui-react";
6
- import { Link, useLocation } from "react-router-dom";
5
+ import { Link, useLocation } from "react-router";
7
6
  import { FormattedMessage } from "react-intl";
8
7
 
9
8
  export const RelationActions = ({ addConceptRelation }) => {
@@ -24,12 +23,12 @@ export const RelationActions = ({ addConceptRelation }) => {
24
23
  };
25
24
 
26
25
  RelationActions.propTypes = {
27
- addConceptRelation: PropTypes.bool
26
+ addConceptRelation: PropTypes.bool,
28
27
  };
29
28
 
30
29
  const mapStateToProps = ({ relationsActions }) => ({
31
30
  addConceptRelation:
32
- !_.isEmpty(relationsActions) && _.has("create")(relationsActions)
31
+ !_.isEmpty(relationsActions) && _.has("create")(relationsActions),
33
32
  });
34
33
 
35
34
  export default connect(mapStateToProps)(RelationActions);
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import React, { useState } from "react";
2
+ import { useState } from "react";
3
3
  import { useIntl } from "react-intl";
4
4
  import PropTypes from "prop-types";
5
5
  import Graph from "react-graph-vis";
@@ -1,11 +1,14 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { Segment } from "semantic-ui-react";
5
- import Slider from "react-rangeslider";
6
- import "react-rangeslider/lib/index.css";
4
+ // import Slider from "react-rangeslider";
5
+ // import "react-rangeslider/lib/index.css";
7
6
  import { FormattedMessage } from "react-intl";
8
7
 
8
+ const Slider = () => {
9
+ return <div>Slider</div>;
10
+ };
11
+
9
12
  export const RelationGraphDepth = ({ onChange, depth, maxDepth }) => {
10
13
  return _.isUndefined(maxDepth) ? null : (
11
14
  <Segment className={`graph-depth ${maxDepth == 0 ? "disabled" : ""}`}>
@@ -1,36 +1,27 @@
1
1
  import React from "react";
2
- import { Route, Switch } from "react-router-dom";
3
- import { Unauthorized } from "@truedat/core/components";
4
- import { useAuthorized } from "@truedat/core/hooks";
2
+ import { Routes, Route } from "react-router";
3
+ import { ProtectedRoute, Loader } from "@truedat/core/router";
5
4
  import { RELATION_TAGS, RELATION_TAGS_NEW } from "@truedat/core/routes";
6
5
  import NewRelationTag from "./NewRelationTag";
7
6
  import RelationTags from "./RelationTags";
8
7
  import RelationTagsLoader from "./RelationTagsLoader";
9
8
 
10
9
  export const RelationRoutes = () => {
11
- const authorized = useAuthorized();
12
-
13
10
  return (
14
- <Route
15
- path={RELATION_TAGS}
16
- render={() =>
17
- authorized ? (
18
- <>
19
- <Route path={RELATION_TAGS} component={RelationTagsLoader} exact />
20
- <Route path={RELATION_TAGS} component={RelationTags} exact />
21
- <Switch>
22
- <Route
23
- path={RELATION_TAGS_NEW}
24
- component={NewRelationTag}
25
- exact
26
- />
27
- </Switch>
28
- </>
29
- ) : (
30
- <Unauthorized />
31
- )
32
- }
33
- />
11
+ <Routes>
12
+ <Route path={"relationTags"} element={<ProtectedRoute />}>
13
+ <Route
14
+ index
15
+ element={
16
+ <Loader loaders={<RelationTagsLoader />}>
17
+ <RelationTags />
18
+ </Loader>
19
+ }
20
+ />
21
+ <Route path={"new"} element={<NewRelationTag />} />
22
+ </Route>
23
+ <Route path={"*"} element={null} />
24
+ </Routes>
34
25
  );
35
26
  };
36
27
 
@@ -1,14 +1,13 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { FormattedMessage } from "react-intl";
5
4
  import { connect } from "react-redux";
6
- import { useHistory } from "react-router-dom";
5
+ import { useNavigate } from "react-router";
7
6
  import { Table, Icon, Label } from "semantic-ui-react";
8
7
  import { ConfirmModal } from "@truedat/core/components";
9
8
  import { deleteRelation } from "../routines";
10
9
 
11
- const goToResource = ({ history, relationPath }) => history.push(relationPath);
10
+ const goToResource = ({ navigate, relationPath }) => navigate(relationPath);
12
11
 
13
12
  export const RelationRow = ({
14
13
  id,
@@ -18,7 +17,7 @@ export const RelationRow = ({
18
17
  tags,
19
18
  relationPath,
20
19
  }) => {
21
- const history = useHistory();
20
+ const navigate = useNavigate();
22
21
  if (_.isEmpty(relationContext)) return null;
23
22
  else {
24
23
  const { target, source } = relationContext;
@@ -49,11 +48,11 @@ export const RelationRow = ({
49
48
  <Table.Row className="selectable_row">
50
49
  <Table.Cell
51
50
  content={source.name}
52
- onClick={() => goToResource({ history, relationPath })}
51
+ onClick={() => goToResource({ navigate, relationPath })}
53
52
  />
54
53
  <Table.Cell
55
54
  textAlign="center"
56
- onClick={() => goToResource({ history, relationPath })}
55
+ onClick={() => goToResource({ navigate, relationPath })}
57
56
  >
58
57
  {_.isEmpty(tags) ? (
59
58
  <Label>-</Label>
@@ -66,7 +65,7 @@ export const RelationRow = ({
66
65
  <Table.Cell
67
66
  textAlign="center"
68
67
  content={target.name}
69
- onClick={() => goToResource({ history, relationPath })}
68
+ onClick={() => goToResource({ navigate, relationPath })}
70
69
  />
71
70
  <Table.Cell textAlign="center">
72
71
  {canDeleteRelation && (
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import { createRef } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { connect } from "react-redux";
4
4
  import { Button, Card, Checkbox, Icon } from "semantic-ui-react";
@@ -20,7 +20,7 @@ export const RelationTagCards = ({
20
20
  <>
21
21
  <Card.Group>
22
22
  {relationTags.map((tag, i) => {
23
- const ref = React.createRef(); // Crea una referencia para el checkbox
23
+ const ref = createRef(); // Crea una referencia para el checkbox
24
24
  return (
25
25
  <Card key={i}>
26
26
  <Card.Content>
@@ -1,5 +1,4 @@
1
1
  import PropTypes from "prop-types";
2
- import React from "react";
3
2
  import { Button, Form } from "semantic-ui-react";
4
3
  import { useForm, Controller } from "react-hook-form";
5
4
  import { useIntl } from "react-intl";
@@ -121,7 +120,6 @@ export const RelationTagForm = ({ relationTag, isSubmitting, onSubmit }) => {
121
120
  )}
122
121
  />
123
122
  ) : null}
124
-
125
123
  <div className="actions">
126
124
  <Button
127
125
  content={formatMessage({ id: "actions.create" })}
@@ -1,5 +1,4 @@
1
- import React from "react";
2
- import { Link } from "react-router-dom";
1
+ import { Link } from "react-router";
3
2
  import { Button, Header, Icon, Segment } from "semantic-ui-react";
4
3
  import { FormattedMessage, useIntl } from "react-intl";
5
4
  import { RELATION_TAGS_NEW } from "@truedat/core/routes";
@@ -1,9 +1,9 @@
1
- import React from "react";
1
+ import { Component } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { connect } from "react-redux";
4
4
  import { clearRelationTags, fetchRelationTags } from "../routines";
5
5
 
6
- export class RelationTagsLoader extends React.Component {
6
+ export class RelationTagsLoader extends Component {
7
7
  static propTypes = {
8
8
  fetchRelationTags: PropTypes.func,
9
9
  clearRelationTags: PropTypes.func,
@@ -1,5 +1,4 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { Segment, Grid, Table } from "semantic-ui-react";
5
4
  import { FormattedMessage } from "react-intl";
@@ -1,5 +1,4 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { useEffect } from "react";
5
4
  import { connect } from "react-redux";
@@ -1,5 +1,4 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { Table } from "semantic-ui-react";
5
4
  import { columnDecorator } from "@truedat/core/services";
@@ -1,10 +1,9 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { connect } from "react-redux";
5
4
  import { Table, Button, Grid } from "semantic-ui-react";
6
5
  import { FormattedMessage } from "react-intl";
7
- import { Link } from "react-router-dom";
6
+ import { Link } from "react-router";
8
7
  import { linkTo } from "@truedat/core/routes";
9
8
  import { accentInsensitivePathOrder } from "@truedat/core/services/sort";
10
9
  import { getStructureToConceptLinks } from "../selectors/getStructureLinks";
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import React, { useState } from "react";
2
+ import { lazy, useState } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { FormattedMessage } from "react-intl";
5
5
  import { connect } from "react-redux";
@@ -10,12 +10,12 @@ import { linkTo } from "@truedat/core/routes";
10
10
  import { linkConcept } from "../routines";
11
11
  import RelationTagsLoader from "./RelationTagsLoader";
12
12
 
13
- const ConceptSelector = React.lazy(() =>
14
- import("@truedat/bg/concepts/relations/components/ConceptSelector")
13
+ const ConceptSelector = lazy(
14
+ () => import("@truedat/bg/concepts/relations/components/ConceptSelector")
15
15
  );
16
16
 
17
- const TagTypeDropdownSelector = React.lazy(() =>
18
- import("@truedat/lm/components/TagTypeDropdownSelector")
17
+ const TagTypeDropdownSelector = lazy(
18
+ () => import("@truedat/lm/components/TagTypeDropdownSelector")
19
19
  );
20
20
 
21
21
  const filters = {
@@ -57,19 +57,16 @@ export const StructureRelationForm = ({
57
57
  as="h4"
58
58
  content={<FormattedMessage id="structures.relation.new.header" />}
59
59
  />
60
-
61
60
  {!_.isEmpty(tagOptions) ? (
62
61
  <Form.Field className="concept-relation-form">
63
62
  <TagTypeDropdownSelector options={tagOptions} />
64
63
  </Form.Field>
65
64
  ) : null}
66
-
67
65
  <ConceptSelector
68
66
  selectedConcept={selectedConcept}
69
67
  handleConceptSelected={handleConceptSelected}
70
68
  defaultFilters={filters}
71
69
  />
72
-
73
70
  <div className="actions">
74
71
  <Button
75
72
  primary
@@ -78,7 +75,6 @@ export const StructureRelationForm = ({
78
75
  loading={conceptLinking}
79
76
  onClick={handleSubmit}
80
77
  />
81
-
82
78
  <HistoryBackButton
83
79
  content={<FormattedMessage id="actions.cancel" />}
84
80
  />
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import React, { useEffect, useState } from "react";
2
+ import { useEffect, useState } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { Form, Dropdown } from "semantic-ui-react";
5
5
  import { FormattedMessage, useIntl } from "react-intl";
@@ -1,5 +1,4 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { Form, Checkbox } from "semantic-ui-react";
5
4
  import { FormattedMessage, useIntl } from "react-intl";
@@ -35,7 +34,6 @@ export const TagTypeSelector = ({
35
34
  <label>
36
35
  <FormattedMessage id="relations.relationType" />
37
36
  </label>
38
-
39
37
  {options &&
40
38
  options.map((option, key) => (
41
39
  <div
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { render } from "@truedat/test/render";
3
2
  import { ConceptImplementationLink } from "../ConceptImplementationLink";
4
3
 
@@ -1,16 +1,14 @@
1
- import _ from "lodash/fp";
2
- import React from "react";
3
- import { render } from "@truedat/test/render";
4
- import { shallow } from "enzyme";
1
+ import { render, waitForLoad } from "@truedat/test/render";
5
2
 
6
3
  import ConceptLinkTags from "../ConceptLinkTags";
7
4
 
8
- describe("ConceptLinkTags", () => {
9
- it("matches the latest snapshot", () => {
10
- const link = {
5
+ describe("<ConceptLinkTags />", () => {
6
+ it("matches the latest snapshot", async () => {
7
+ const props = {
11
8
  tags: ["otro tipo", "business_concept_to_field_master"],
12
9
  };
13
- const wrapper = shallow(<ConceptLinkTags {...link} />);
14
- expect(wrapper).toMatchSnapshot();
10
+ const rendered = render(<ConceptLinkTags {...props} />);
11
+ await waitForLoad(rendered);
12
+ expect(rendered.container).toMatchSnapshot();
15
13
  });
16
14
  });