@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/lm",
3
- "version": "6.13.7",
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.8.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.13.7",
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": "9137d2a416d46886163ac2de4875761d52e6a2e8"
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
- <Container text as={Segment}>
12
- <Header as="h2">
13
- <Icon name="cubes" />
14
- <Header.Content>
15
- <FormattedMessage
16
- id="relationTags.actions.create"
17
- defaultMessage="New Relation Type"
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
- </Header.Content>
20
- </Header>
21
- <RelationTagForm
22
- onSubmit={(relationTag) => {
23
- createRelationTag({ relationTag, redirectUrl: linkTo.RELATION_TAGS() });
24
- }}
25
- />
26
- </Container>
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
- <Segment>
10
- <Header as="h2">
11
- <Button
12
- floated="right"
13
- primary
14
- as={Link}
15
- to={RELATION_TAGS_NEW}
16
- content={<FormattedMessage id="relationTags.actions.create" />}
17
- />
18
- <Icon name="cubes" circular />
19
- <Header.Content>
20
- <FormattedMessage id="relationTags.header" />
21
- <Header.Subheader>
22
- <FormattedMessage id="relationTags.subheader" />
23
- </Header.Subheader>
24
- </Header.Content>
25
- </Header>
26
- <RelationTagCards />
27
- </Segment>
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 { shallow } from "enzyme";
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 wrapper = shallow(<NewRelationTag />);
8
- expect(wrapper).toMatchSnapshot();
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 { shallow } from "enzyme";
3
- import { RelationTags } from "../RelationTags";
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 wrapper = shallow(<RelationTags />);
8
- expect(wrapper).toMatchSnapshot();
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
- <Container
5
- as={[Function]}
6
- text={true}
7
- >
8
- <Header
9
- as="h2"
4
+ <div>
5
+ <div
6
+ class="ui segment ui text container"
10
7
  >
11
- <Icon
12
- as="i"
13
- name="cubes"
14
- />
15
- <HeaderContent>
16
- <MemoizedFormattedMessage
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
- </HeaderContent>
21
- </Header>
22
- <Connect(RelationTagForm)
23
- onSubmit={[Function]}
24
- />
25
- </Container>
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
- <Segment>
5
- <Header
6
- as="h2"
4
+ <div>
5
+ <div
6
+ class="ui segment"
7
7
  >
8
- <Button
9
- as={
10
- {
11
- "$$typeof": Symbol(react.forward_ref),
12
- "displayName": "Link",
13
- "propTypes": {
14
- "innerRef": [Function],
15
- "onClick": [Function],
16
- "replace": [Function],
17
- "target": [Function],
18
- "to": [Function],
19
- },
20
- "render": [Function],
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
- <HeaderSubheader>
42
- <MemoizedFormattedMessage
43
- id="relationTags.subheader"
44
- />
45
- </HeaderSubheader>
46
- </HeaderContent>
47
- </Header>
48
- <Connect(RelationTagCards) />
49
- </Segment>
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
  `;