@truedat/lm 7.5.9 → 7.5.11
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/index.js +5 -0
- package/package.json +43 -67
- package/src/components/ConceptImplementationLink.js +1 -2
- package/src/components/ConceptLink.js +2 -3
- package/src/components/ConceptLinkTags.js +0 -1
- package/src/components/ConceptStructureLinkForm.js +3 -3
- package/src/components/ConfirmDeleteRelation.js +0 -1
- package/src/components/ImplementationLinkRow.js +0 -1
- package/src/components/ImplementationLinks.js +1 -2
- package/src/components/ImplementationRelationForm.js +5 -8
- package/src/components/LinksPane.js +0 -1
- package/src/components/NewRelationTag.js +0 -1
- package/src/components/RelationActions.js +3 -4
- package/src/components/RelationGraph.js +17 -104
- package/src/components/RelationGraphDepth.js +0 -1
- package/src/components/RelationRoutes.js +16 -25
- package/src/components/RelationRow.js +6 -7
- package/src/components/RelationTagCards.js +3 -4
- package/src/components/RelationTagForm.js +0 -2
- package/src/components/RelationTags.js +1 -2
- package/src/components/RelationTagsLoader.js +2 -2
- package/src/components/Relations.js +0 -1
- package/src/components/RelationsGraphLoader.js +0 -1
- package/src/components/StructureLinkRow.js +0 -1
- package/src/components/StructureLinks.js +1 -2
- package/src/components/StructureRelationForm.js +5 -9
- package/src/components/TagTypeDropdownSelector.js +1 -1
- package/src/components/TagTypeSelector.js +0 -2
- package/src/components/__tests__/ConceptImplementationLink.spec.js +0 -1
- package/src/components/__tests__/ConceptLinkTags.spec.js +7 -9
- package/src/components/__tests__/ConceptStructureLinkForm.spec.js +68 -20
- package/src/components/__tests__/ConfirmDeleteRelation.spec.js +0 -1
- package/src/components/__tests__/ImplementationLinkRow.spec.js +0 -1
- package/src/components/__tests__/ImplementationLinks.spec.js +0 -1
- package/src/components/__tests__/ImplementationRelationForm.spec.js +45 -73
- package/src/components/__tests__/LinksPane.spec.js +0 -1
- package/src/components/__tests__/NewRelationTag.spec.js +0 -1
- package/src/components/__tests__/RelationActions.spec.js +14 -15
- package/src/components/__tests__/RelationRoutes.spec.js +59 -7
- package/src/components/__tests__/RelationRow.spec.js +46 -23
- package/src/components/__tests__/RelationTagCards.spec.js +0 -1
- package/src/components/__tests__/RelationTagForm.spec.js +26 -37
- package/src/components/__tests__/RelationTags.spec.js +0 -1
- package/src/components/__tests__/RelationTagsLoader.spec.js +6 -6
- package/src/components/__tests__/Relations.spec.js +19 -17
- package/src/components/__tests__/RelationsGraphLoader.spec.js +32 -26
- package/src/components/__tests__/RelationsLoader.spec.js +19 -19
- package/src/components/__tests__/StructureRelationForm.spec.js +41 -42
- package/src/components/__tests__/TagTypeSelector.spec.js +7 -13
- package/src/components/__tests__/__snapshots__/ConceptImplementationLink.spec.js.snap +1 -0
- package/src/components/__tests__/__snapshots__/ConceptLinkTags.spec.js.snap +12 -20
- package/src/components/__tests__/__snapshots__/ConceptStructureLinkForm.spec.js.snap +170 -19
- package/src/components/__tests__/__snapshots__/ImplementationLinks.spec.js.snap +4 -0
- package/src/components/__tests__/__snapshots__/ImplementationRelationForm.spec.js.snap +13 -13
- package/src/components/__tests__/__snapshots__/NewRelationTag.spec.js.snap +12 -11
- package/src/components/__tests__/__snapshots__/RelationActions.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/RelationRoutes.spec.js.snap +21 -5
- package/src/components/__tests__/__snapshots__/RelationRow.spec.js.snap +7 -1
- package/src/components/__tests__/__snapshots__/RelationTagCards.spec.js.snap +0 -1
- package/src/components/__tests__/__snapshots__/RelationTagForm.spec.js.snap +11 -10
- package/src/components/__tests__/__snapshots__/RelationTags.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/RelationTagsLoader.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/Relations.spec.js.snap +36 -27
- package/src/components/__tests__/__snapshots__/RelationsGraphLoader.spec.js.snap +1 -25
- package/src/components/__tests__/__snapshots__/StructureRelationForm.spec.js.snap +1 -1
- package/src/components/__tests__/__snapshots__/TagTypeSelector.spec.js.snap +11 -14
- package/src/hooks/useTags.js +1 -1
- package/src/sagas/__tests__/fetchRelationsGraph.spec.js +2 -2
- package/src/sagas/deleteRelation.js +1 -1
- package/src/sagas/fetchRelationsGraph.js +1 -1
- package/src/sagas/updateRelationTag.js +1 -1
- package/src/selectors/getStructureLinks.js +1 -1
- package/src/services/relationGraphTraversal.js +3 -3
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/lm",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.11",
|
|
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.9",
|
|
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
|
-
"
|
|
70
|
-
"
|
|
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
|
-
|
|
85
|
-
|
|
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.11",
|
|
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
|
-
"@
|
|
90
|
-
"
|
|
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
|
-
"
|
|
93
|
-
"react
|
|
94
|
-
"react-
|
|
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": "^
|
|
97
|
-
"react-router
|
|
98
|
-
"redux": "^
|
|
99
|
-
"redux-saga": "^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
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
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": "
|
|
86
|
+
"gitHead": "cbb92d5206752fe2add4195432b0401da17a0f23"
|
|
111
87
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
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 =
|
|
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,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
|
|
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
|
|
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 =
|
|
14
|
-
import("@truedat/lm/components/TagTypeDropdownSelector")
|
|
13
|
+
const TagTypeDropdownSelector = lazy(
|
|
14
|
+
() => import("@truedat/lm/components/TagTypeDropdownSelector")
|
|
15
15
|
);
|
|
16
16
|
|
|
17
|
-
const ConceptSelector =
|
|
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,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
|
|
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,43 +1,35 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { useState } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import Graph from "
|
|
5
|
+
import { Graph } from "@truedat/core/components";
|
|
6
6
|
|
|
7
7
|
export const RelationGraph = ({ navigate, currentId, relationsGraph }) => {
|
|
8
8
|
const { formatMessage } = useIntl();
|
|
9
|
-
const [network, setNetwork] = useState({});
|
|
10
9
|
|
|
11
10
|
const nodes = _.flow(
|
|
12
11
|
_.get("nodes"),
|
|
13
|
-
_.map(({ id, name: label }) => ({
|
|
12
|
+
_.map(({ id, name: label, resource_id }) => ({
|
|
14
13
|
id,
|
|
15
|
-
label,
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
data: { label },
|
|
15
|
+
resource_id,
|
|
16
|
+
style:
|
|
18
17
|
currentId === id
|
|
19
18
|
? {
|
|
20
19
|
background: "#ed5c17",
|
|
21
|
-
border: "black",
|
|
22
|
-
}
|
|
23
|
-
: null,
|
|
24
|
-
|
|
25
|
-
font:
|
|
26
|
-
currentId === id
|
|
27
|
-
? {
|
|
28
20
|
color: "white",
|
|
29
|
-
|
|
30
|
-
face: "Lato, Helvetica Neue, Arial, Helvetica, sans-serif",
|
|
21
|
+
fontWeight: "bold",
|
|
31
22
|
}
|
|
32
|
-
:
|
|
23
|
+
: { cursor: "pointer" },
|
|
33
24
|
}))
|
|
34
25
|
)(relationsGraph);
|
|
35
26
|
|
|
36
27
|
const edges = _.flow(
|
|
37
28
|
_.get("edges"),
|
|
38
|
-
_.map(({ source_id:
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
_.map(({ id: id, source_id: source, target_id: target, tags }) => ({
|
|
30
|
+
id,
|
|
31
|
+
source,
|
|
32
|
+
target,
|
|
41
33
|
label: _.flow(
|
|
42
34
|
_.map((tag) =>
|
|
43
35
|
formatMessage({
|
|
@@ -50,92 +42,13 @@ export const RelationGraph = ({ navigate, currentId, relationsGraph }) => {
|
|
|
50
42
|
}))
|
|
51
43
|
)(relationsGraph);
|
|
52
44
|
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
height: "99%",
|
|
56
|
-
width: "99%",
|
|
57
|
-
layout: {
|
|
58
|
-
hierarchical: {
|
|
59
|
-
direction: "UD",
|
|
60
|
-
sortMethod: "directed",
|
|
61
|
-
levelSeparation: 170,
|
|
62
|
-
edgeMinimization: false,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
edges: {
|
|
66
|
-
color: "#000000",
|
|
67
|
-
smooth: true,
|
|
68
|
-
font: {
|
|
69
|
-
face: "Lato, Helvetica Neue, Arial, Helvetica, sans-serif",
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
nodes: {
|
|
73
|
-
shape: "box",
|
|
74
|
-
margin: 10,
|
|
75
|
-
color: {
|
|
76
|
-
background: "white",
|
|
77
|
-
border: "grey",
|
|
78
|
-
},
|
|
79
|
-
widthConstraint: {
|
|
80
|
-
maximum: 200,
|
|
81
|
-
minimum: 100,
|
|
82
|
-
},
|
|
83
|
-
font: {
|
|
84
|
-
face: "Lato, Helvetica Neue, Arial, Helvetica, sans-serif",
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
physics: {
|
|
88
|
-
hierarchicalRepulsion: {
|
|
89
|
-
nodeDistance: 250,
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
interaction: {
|
|
93
|
-
hover: true,
|
|
94
|
-
},
|
|
45
|
+
const onClick = (_, { resource_id }) => {
|
|
46
|
+
if (navigate) navigate({ resource_id });
|
|
95
47
|
};
|
|
96
48
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (!_.isEmpty(nodes)) {
|
|
101
|
-
const nodeId = _.head(nodes);
|
|
102
|
-
if (navigate)
|
|
103
|
-
navigate(
|
|
104
|
-
_.flow(
|
|
105
|
-
_.getOr([], "nodes"),
|
|
106
|
-
_.find({ id: nodeId })
|
|
107
|
-
)(relationsGraph),
|
|
108
|
-
_.isEmpty(edges)
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
hoverNode: (event) => {
|
|
113
|
-
const { node } = event;
|
|
114
|
-
if (node !== currentId) {
|
|
115
|
-
const style = _.path("canvas.frame.style")(network);
|
|
116
|
-
style.setProperty("cursor", "pointer");
|
|
117
|
-
setNetwork(network);
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
blurNode: () => {
|
|
121
|
-
const style = _.path("canvas.frame.style")(network);
|
|
122
|
-
style.setProperty("cursor", "default");
|
|
123
|
-
setNetwork(network);
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
return (
|
|
127
|
-
<>
|
|
128
|
-
{!_.isEmpty(relationsGraph) && (
|
|
129
|
-
<Graph
|
|
130
|
-
graph={{ nodes, edges }}
|
|
131
|
-
options={options}
|
|
132
|
-
events={events}
|
|
133
|
-
style={{ height: "640px" }}
|
|
134
|
-
getNetwork={setNetwork}
|
|
135
|
-
/>
|
|
136
|
-
)}
|
|
137
|
-
</>
|
|
138
|
-
);
|
|
49
|
+
return !_.isEmpty(relationsGraph) ? (
|
|
50
|
+
<Graph nodes={nodes} edges={edges} onNodeClick={onClick} />
|
|
51
|
+
) : null;
|
|
139
52
|
};
|
|
140
53
|
|
|
141
54
|
RelationGraph.propTypes = {
|
|
@@ -1,36 +1,27 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
|
-
<
|
|
15
|
-
path={
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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 {
|
|
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 = ({
|
|
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
|
|
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({
|
|
51
|
+
onClick={() => goToResource({ navigate, relationPath })}
|
|
53
52
|
/>
|
|
54
53
|
<Table.Cell
|
|
55
54
|
textAlign="center"
|
|
56
|
-
onClick={() => goToResource({
|
|
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({
|
|
68
|
+
onClick={() => goToResource({ navigate, relationPath })}
|
|
70
69
|
/>
|
|
71
70
|
<Table.Cell textAlign="center">
|
|
72
71
|
{canDeleteRelation && (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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";
|
|
@@ -13,14 +13,13 @@ export const RelationTagCards = ({
|
|
|
13
13
|
relationTagsLoading,
|
|
14
14
|
}) => {
|
|
15
15
|
const { formatMessage } = useIntl();
|
|
16
|
-
|
|
17
16
|
if (relationTagsLoading) return <div />;
|
|
18
17
|
|
|
19
18
|
return (
|
|
20
19
|
<>
|
|
21
20
|
<Card.Group>
|
|
22
21
|
{relationTags.map((tag, i) => {
|
|
23
|
-
const ref =
|
|
22
|
+
const ref = createRef(); // Crea una referencia para el checkbox
|
|
24
23
|
return (
|
|
25
24
|
<Card key={i}>
|
|
26
25
|
<Card.Content>
|
|
@@ -75,7 +74,7 @@ export const RelationTagCards = ({
|
|
|
75
74
|
values={{ type: <i>{tag.value.type}</i> }}
|
|
76
75
|
/>
|
|
77
76
|
}
|
|
78
|
-
onConfirm={() => deleteRelationTag({ id: tag.id })}
|
|
77
|
+
onConfirm={() => deleteRelationTag({ id: `${tag.id}` })}
|
|
79
78
|
/>
|
|
80
79
|
</div>
|
|
81
80
|
</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
|
|
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
|
|
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
|
|
6
|
+
export class RelationTagsLoader extends Component {
|
|
7
7
|
static propTypes = {
|
|
8
8
|
fetchRelationTags: PropTypes.func,
|
|
9
9
|
clearRelationTags: PropTypes.func,
|