@truedat/lm 6.13.7 → 6.14.1
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 +4 -4
- package/src/components/NewRelationTag.js +29 -18
- package/src/components/RelationTags.js +31 -22
- package/src/components/__tests__/NewRelationTag.spec.js +3 -3
- package/src/components/__tests__/RelationTags.spec.js +14 -4
- package/src/components/__tests__/__snapshots__/NewRelationTag.spec.js.snap +148 -20
- package/src/components/__tests__/__snapshots__/RelationTags.spec.js.snap +135 -44
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/lm",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.14.1",
|
|
4
4
|
"description": "Truedat Link Manager",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@testing-library/jest-dom": "^5.16.5",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "6.
|
|
37
|
+
"@truedat/test": "6.14.1",
|
|
38
38
|
"babel-jest": "^28.1.0",
|
|
39
39
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
40
40
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@truedat/core": "6.
|
|
89
|
+
"@truedat/core": "6.14.1",
|
|
90
90
|
"path-to-regexp": "^1.7.0",
|
|
91
91
|
"prop-types": "^15.8.1",
|
|
92
92
|
"react-graph-vis": "1.0.6",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"react-dom": ">= 16.8.6 < 17",
|
|
108
108
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "13f8e92c333acf539f9978ea94db03174130cfb0"
|
|
111
111
|
}
|
|
@@ -1,30 +1,41 @@
|
|
|
1
1
|
import PropTypes from "prop-types";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Header, Icon, Container, Segment } from "semantic-ui-react";
|
|
4
|
-
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import { FormattedMessage, useIntl } from "react-intl";
|
|
5
5
|
import { connect } from "react-redux";
|
|
6
6
|
import { linkTo } from "@truedat/core/routes";
|
|
7
7
|
import { createRelationTag } from "../routines";
|
|
8
8
|
import RelationTagForm from "./RelationTagForm";
|
|
9
9
|
|
|
10
|
-
export const NewRelationTag = ({ createRelationTag }) =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<Header
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
export const NewRelationTag = ({ createRelationTag }) => {
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
12
|
+
return (
|
|
13
|
+
<Container text as={Segment}>
|
|
14
|
+
<Header as="h2">
|
|
15
|
+
<Icon
|
|
16
|
+
name={formatMessage({
|
|
17
|
+
id: "relationTags.header.icon",
|
|
18
|
+
defaultMessage: "cubes",
|
|
19
|
+
})}
|
|
18
20
|
/>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
21
|
+
<Header.Content>
|
|
22
|
+
<FormattedMessage
|
|
23
|
+
id="relationTags.actions.create"
|
|
24
|
+
defaultMessage="New Relation Type"
|
|
25
|
+
/>
|
|
26
|
+
</Header.Content>
|
|
27
|
+
</Header>
|
|
28
|
+
<RelationTagForm
|
|
29
|
+
onSubmit={(relationTag) => {
|
|
30
|
+
createRelationTag({
|
|
31
|
+
relationTag,
|
|
32
|
+
redirectUrl: linkTo.RELATION_TAGS(),
|
|
33
|
+
});
|
|
34
|
+
}}
|
|
35
|
+
/>
|
|
36
|
+
</Container>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
28
39
|
|
|
29
40
|
NewRelationTag.propTypes = {
|
|
30
41
|
createRelationTag: PropTypes.func,
|
|
@@ -1,30 +1,39 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Link } from "react-router-dom";
|
|
3
3
|
import { Button, Header, Icon, Segment } from "semantic-ui-react";
|
|
4
|
-
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import { FormattedMessage, useIntl } from "react-intl";
|
|
5
5
|
import { RELATION_TAGS_NEW } from "@truedat/core/routes";
|
|
6
6
|
import RelationTagCards from "./RelationTagCards";
|
|
7
7
|
|
|
8
|
-
export const RelationTags = () =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
8
|
+
export const RelationTags = () => {
|
|
9
|
+
const { formatMessage } = useIntl();
|
|
10
|
+
return (
|
|
11
|
+
<Segment>
|
|
12
|
+
<Header as="h2">
|
|
13
|
+
<Button
|
|
14
|
+
floated="right"
|
|
15
|
+
primary
|
|
16
|
+
as={Link}
|
|
17
|
+
to={RELATION_TAGS_NEW}
|
|
18
|
+
content={<FormattedMessage id="relationTags.actions.create" />}
|
|
19
|
+
/>
|
|
20
|
+
<Icon
|
|
21
|
+
name={formatMessage({
|
|
22
|
+
id: "relationTags.header.icon",
|
|
23
|
+
defaultMessage: "cubes",
|
|
24
|
+
})}
|
|
25
|
+
circular
|
|
26
|
+
/>
|
|
27
|
+
<Header.Content>
|
|
28
|
+
<FormattedMessage id="relationTags.header" />
|
|
29
|
+
<Header.Subheader>
|
|
30
|
+
<FormattedMessage id="relationTags.subheader" />
|
|
31
|
+
</Header.Subheader>
|
|
32
|
+
</Header.Content>
|
|
33
|
+
</Header>
|
|
34
|
+
<RelationTagCards />
|
|
35
|
+
</Segment>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
29
38
|
|
|
30
39
|
export default RelationTags;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
3
|
import { NewRelationTag } from "../NewRelationTag";
|
|
4
4
|
|
|
5
5
|
describe("<NewRelationTag />", () => {
|
|
6
6
|
it("matches the latest snapshot", () => {
|
|
7
|
-
const
|
|
8
|
-
expect(
|
|
7
|
+
const { container } = render(<NewRelationTag />);
|
|
8
|
+
expect(container).toMatchSnapshot();
|
|
9
9
|
});
|
|
10
10
|
});
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import RelationTags from "../RelationTags";
|
|
4
|
+
|
|
5
|
+
const relationTags = [
|
|
6
|
+
{ id: 1, value: { type: "tag1", target_type: "business_concept" } },
|
|
7
|
+
{ id: 2, value: { type: "tag2", target_type: "data_field" } },
|
|
8
|
+
{ id: 3, value: { type: "tag3", target_type: "ingest" } },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const renderOpts = {
|
|
12
|
+
state: { relationTags },
|
|
13
|
+
};
|
|
4
14
|
|
|
5
15
|
describe("<RelationTags />", () => {
|
|
6
16
|
it("matches the latest snapshot", () => {
|
|
7
|
-
const
|
|
8
|
-
expect(
|
|
17
|
+
const { container } = render(<RelationTags />, renderOpts);
|
|
18
|
+
expect(container).toMatchSnapshot();
|
|
9
19
|
});
|
|
10
20
|
});
|
|
@@ -1,26 +1,154 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<NewRelationTag /> matches the latest snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
<Header
|
|
9
|
-
as="h2"
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui segment ui text container"
|
|
10
7
|
>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
defaultMessage="New Relation Type"
|
|
18
|
-
id="relationTags.actions.create"
|
|
8
|
+
<h2
|
|
9
|
+
class="ui header"
|
|
10
|
+
>
|
|
11
|
+
<i
|
|
12
|
+
aria-hidden="true"
|
|
13
|
+
class="cubes icon"
|
|
19
14
|
/>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</
|
|
15
|
+
<div
|
|
16
|
+
class="content"
|
|
17
|
+
>
|
|
18
|
+
Create Relation Type
|
|
19
|
+
</div>
|
|
20
|
+
</h2>
|
|
21
|
+
<form
|
|
22
|
+
class="ui form"
|
|
23
|
+
>
|
|
24
|
+
<div
|
|
25
|
+
class="required field"
|
|
26
|
+
>
|
|
27
|
+
<label
|
|
28
|
+
for="type"
|
|
29
|
+
>
|
|
30
|
+
Type
|
|
31
|
+
</label>
|
|
32
|
+
<div
|
|
33
|
+
class="ui input"
|
|
34
|
+
>
|
|
35
|
+
<input
|
|
36
|
+
autocomplete="off"
|
|
37
|
+
id="type"
|
|
38
|
+
placeholder="Type"
|
|
39
|
+
required=""
|
|
40
|
+
type="text"
|
|
41
|
+
value=""
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div
|
|
46
|
+
class="required field"
|
|
47
|
+
>
|
|
48
|
+
<label
|
|
49
|
+
for="target_type"
|
|
50
|
+
>
|
|
51
|
+
Target type
|
|
52
|
+
</label>
|
|
53
|
+
<div
|
|
54
|
+
aria-expanded="false"
|
|
55
|
+
autocomplete="off"
|
|
56
|
+
class="ui selection dropdown"
|
|
57
|
+
id="target_type"
|
|
58
|
+
required=""
|
|
59
|
+
role="listbox"
|
|
60
|
+
tabindex="0"
|
|
61
|
+
>
|
|
62
|
+
<div
|
|
63
|
+
aria-atomic="true"
|
|
64
|
+
aria-live="polite"
|
|
65
|
+
class="divider default text"
|
|
66
|
+
role="alert"
|
|
67
|
+
>
|
|
68
|
+
Target type
|
|
69
|
+
</div>
|
|
70
|
+
<i
|
|
71
|
+
aria-hidden="true"
|
|
72
|
+
class="dropdown icon"
|
|
73
|
+
/>
|
|
74
|
+
<div
|
|
75
|
+
class="menu transition"
|
|
76
|
+
>
|
|
77
|
+
<div
|
|
78
|
+
aria-checked="false"
|
|
79
|
+
aria-selected="true"
|
|
80
|
+
class="selected item"
|
|
81
|
+
role="option"
|
|
82
|
+
style="pointer-events: all;"
|
|
83
|
+
>
|
|
84
|
+
<span
|
|
85
|
+
class="text"
|
|
86
|
+
>
|
|
87
|
+
Concept
|
|
88
|
+
</span>
|
|
89
|
+
</div>
|
|
90
|
+
<div
|
|
91
|
+
aria-checked="false"
|
|
92
|
+
aria-selected="false"
|
|
93
|
+
class="item"
|
|
94
|
+
role="option"
|
|
95
|
+
style="pointer-events: all;"
|
|
96
|
+
>
|
|
97
|
+
<span
|
|
98
|
+
class="text"
|
|
99
|
+
>
|
|
100
|
+
Ingest
|
|
101
|
+
</span>
|
|
102
|
+
</div>
|
|
103
|
+
<div
|
|
104
|
+
aria-checked="false"
|
|
105
|
+
aria-selected="false"
|
|
106
|
+
class="item"
|
|
107
|
+
role="option"
|
|
108
|
+
style="pointer-events: all;"
|
|
109
|
+
>
|
|
110
|
+
<span
|
|
111
|
+
class="text"
|
|
112
|
+
>
|
|
113
|
+
Implementations
|
|
114
|
+
</span>
|
|
115
|
+
</div>
|
|
116
|
+
<div
|
|
117
|
+
aria-checked="false"
|
|
118
|
+
aria-selected="false"
|
|
119
|
+
class="item"
|
|
120
|
+
role="option"
|
|
121
|
+
style="pointer-events: all;"
|
|
122
|
+
>
|
|
123
|
+
<span
|
|
124
|
+
class="text"
|
|
125
|
+
>
|
|
126
|
+
Structure
|
|
127
|
+
</span>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
<div
|
|
133
|
+
class="actions"
|
|
134
|
+
>
|
|
135
|
+
<button
|
|
136
|
+
class="ui primary disabled right floated button"
|
|
137
|
+
disabled=""
|
|
138
|
+
tabindex="-1"
|
|
139
|
+
type="submit"
|
|
140
|
+
>
|
|
141
|
+
Create
|
|
142
|
+
</button>
|
|
143
|
+
<a
|
|
144
|
+
class="ui secondary button"
|
|
145
|
+
href="/"
|
|
146
|
+
role="button"
|
|
147
|
+
>
|
|
148
|
+
Cancel
|
|
149
|
+
</a>
|
|
150
|
+
</div>
|
|
151
|
+
</form>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
26
154
|
`;
|
|
@@ -1,50 +1,141 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<RelationTags /> matches the latest snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui segment"
|
|
7
7
|
>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
content={
|
|
24
|
-
<Memo(MemoizedFormattedMessage)
|
|
25
|
-
id="relationTags.actions.create"
|
|
26
|
-
/>
|
|
27
|
-
}
|
|
28
|
-
floated="right"
|
|
29
|
-
primary={true}
|
|
30
|
-
to="/relationTags/new"
|
|
31
|
-
/>
|
|
32
|
-
<Icon
|
|
33
|
-
as="i"
|
|
34
|
-
circular={true}
|
|
35
|
-
name="cubes"
|
|
36
|
-
/>
|
|
37
|
-
<HeaderContent>
|
|
38
|
-
<MemoizedFormattedMessage
|
|
39
|
-
id="relationTags.header"
|
|
8
|
+
<h2
|
|
9
|
+
class="ui header"
|
|
10
|
+
>
|
|
11
|
+
<a
|
|
12
|
+
class="ui primary right floated button"
|
|
13
|
+
href="/relationTags/new"
|
|
14
|
+
role="button"
|
|
15
|
+
>
|
|
16
|
+
Create Relation Type
|
|
17
|
+
</a>
|
|
18
|
+
<i
|
|
19
|
+
aria-hidden="true"
|
|
20
|
+
class="cubes circular icon"
|
|
40
21
|
/>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
</
|
|
22
|
+
<div
|
|
23
|
+
class="content"
|
|
24
|
+
>
|
|
25
|
+
Relation Types
|
|
26
|
+
<div
|
|
27
|
+
class="sub header"
|
|
28
|
+
>
|
|
29
|
+
In this section you can manage Relation Types
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</h2>
|
|
33
|
+
<div
|
|
34
|
+
class="ui cards"
|
|
35
|
+
>
|
|
36
|
+
<div
|
|
37
|
+
class="ui card"
|
|
38
|
+
>
|
|
39
|
+
<div
|
|
40
|
+
class="content"
|
|
41
|
+
>
|
|
42
|
+
<div
|
|
43
|
+
class="header"
|
|
44
|
+
>
|
|
45
|
+
tag1
|
|
46
|
+
</div>
|
|
47
|
+
<div
|
|
48
|
+
class="description"
|
|
49
|
+
>
|
|
50
|
+
business_concept
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<div
|
|
54
|
+
class="extra content"
|
|
55
|
+
>
|
|
56
|
+
<div
|
|
57
|
+
class="ui actions"
|
|
58
|
+
>
|
|
59
|
+
<button
|
|
60
|
+
class="ui red basic icon button"
|
|
61
|
+
>
|
|
62
|
+
<i
|
|
63
|
+
aria-hidden="true"
|
|
64
|
+
class="trash icon"
|
|
65
|
+
/>
|
|
66
|
+
</button>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
<div
|
|
71
|
+
class="ui card"
|
|
72
|
+
>
|
|
73
|
+
<div
|
|
74
|
+
class="content"
|
|
75
|
+
>
|
|
76
|
+
<div
|
|
77
|
+
class="header"
|
|
78
|
+
>
|
|
79
|
+
tag2
|
|
80
|
+
</div>
|
|
81
|
+
<div
|
|
82
|
+
class="description"
|
|
83
|
+
>
|
|
84
|
+
data_field
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div
|
|
88
|
+
class="extra content"
|
|
89
|
+
>
|
|
90
|
+
<div
|
|
91
|
+
class="ui actions"
|
|
92
|
+
>
|
|
93
|
+
<button
|
|
94
|
+
class="ui red basic icon button"
|
|
95
|
+
>
|
|
96
|
+
<i
|
|
97
|
+
aria-hidden="true"
|
|
98
|
+
class="trash icon"
|
|
99
|
+
/>
|
|
100
|
+
</button>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
<div
|
|
105
|
+
class="ui card"
|
|
106
|
+
>
|
|
107
|
+
<div
|
|
108
|
+
class="content"
|
|
109
|
+
>
|
|
110
|
+
<div
|
|
111
|
+
class="header"
|
|
112
|
+
>
|
|
113
|
+
tag3
|
|
114
|
+
</div>
|
|
115
|
+
<div
|
|
116
|
+
class="description"
|
|
117
|
+
>
|
|
118
|
+
ingest
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
<div
|
|
122
|
+
class="extra content"
|
|
123
|
+
>
|
|
124
|
+
<div
|
|
125
|
+
class="ui actions"
|
|
126
|
+
>
|
|
127
|
+
<button
|
|
128
|
+
class="ui red basic icon button"
|
|
129
|
+
>
|
|
130
|
+
<i
|
|
131
|
+
aria-hidden="true"
|
|
132
|
+
class="trash icon"
|
|
133
|
+
/>
|
|
134
|
+
</button>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
50
141
|
`;
|