@truedat/lm 6.3.3 → 6.3.5

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.3.3",
3
+ "version": "6.3.5",
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.3.3",
37
+ "@truedat/test": "6.3.4",
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.3.3",
89
+ "@truedat/core": "6.3.5",
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": "ee40175932833d26f2d0ca297ce5a3a26fb71cb2"
110
+ "gitHead": "2cacdf1fc99746cb4f8dca7d770662c0d96c5bb7"
111
111
  }
@@ -8,35 +8,79 @@ import en from "../../messages/en";
8
8
 
9
9
  const linkConcept = jest.fn();
10
10
 
11
- const domain = {
12
- external_id: "foo domain",
13
- id: 381,
14
- name: "foo domain",
11
+ const data = {
12
+ data: [
13
+ {
14
+ _actions: { can_create_structure_link: true },
15
+ business_concept_id: 2,
16
+ domain: {
17
+ external_id: "foo domain",
18
+ id: 381,
19
+ name: "foo domain",
20
+ },
21
+ id: 12355,
22
+ name: "foo concept",
23
+ status: "published",
24
+ last_change_at: "2020-01-01T00:00:00.000Z",
25
+ },
26
+ {
27
+ _actions: { can_create_structure_link: true },
28
+ business_concept_id: 123,
29
+ domain: {
30
+ external_id: "foo domain",
31
+ id: 381,
32
+ name: "foo domain",
33
+ },
34
+ id: 12290,
35
+ name: "bar concept",
36
+ status: "draft",
37
+ last_change_at: "2020-01-01T00:00:00.000Z",
38
+ },
39
+ ],
15
40
  };
16
41
 
42
+ const filterData = {
43
+ data: {
44
+ some: {
45
+ values: ["some_xxx", "some_yyy", "some_xwy"],
46
+ },
47
+ },
48
+ };
49
+
50
+ jest.mock("@truedat/bg/concepts/hooks/useConcepts", () => {
51
+ const originalModule = jest.requireActual(
52
+ "@truedat/bg/concepts/hooks/useConcepts"
53
+ );
54
+
55
+ return {
56
+ __esModule: true,
57
+ ...originalModule,
58
+ useConceptFilters: () => ({
59
+ trigger: () => ({
60
+ then: (callback) =>
61
+ callback({
62
+ data: filterData,
63
+ }),
64
+ }),
65
+ }),
66
+ useConceptVersionsSearch: () => ({
67
+ trigger: () => ({
68
+ then: (callback) =>
69
+ callback({
70
+ data,
71
+ headers: {},
72
+ }),
73
+ }),
74
+ }),
75
+ };
76
+ });
77
+
17
78
  const tagOptions = [
18
79
  { id: 1, text: "relates_to", value: 0 },
19
80
  { id: 2, text: "text", value: 1 },
20
81
  ];
21
82
 
22
- const concepts = [
23
- {
24
- _actions: { can_create_structure_link: true },
25
- business_concept_id: 2,
26
- domain: domain,
27
- id: 12355,
28
- name: "foo concept",
29
- status: "published",
30
- },
31
- {
32
- _actions: { can_create_structure_link: true },
33
- business_concept_id: 123,
34
- domain: domain,
35
- id: 12290,
36
- name: "bar concept",
37
- status: "draft",
38
- },
39
- ];
83
+ const concepts = [];
40
84
 
41
85
  const props = {
42
86
  implementation: { rule_id: 2, id: 4, implementation_ref: 1 },
@@ -63,20 +107,19 @@ const renderOpts = {
63
107
  "search.applied_filters": "Applied Filters",
64
108
  "conceptRelations.relatedConcept": "Related Concept",
65
109
  "concepts.search.placeholder": "Search",
110
+ "concepts.search.placeholder": "Search",
111
+ "search.placeholder": "Search...",
112
+ "concepts.search.results.empty": "No concepts found",
66
113
  },
67
114
  },
68
- state: {
69
- concepts,
70
- conceptActiveFilters: { filter: "some" },
71
- },
115
+ // state: {},
72
116
  fallback: "lazy",
73
117
  };
74
118
 
75
119
  describe("<ImplementationRelationForm />", () => {
76
120
  it("matches the latest snapshot", async () => {
77
- const { container, getByText } = render(
121
+ const { container, getByText, queryByText } = render(
78
122
  <ImplementationRelationForm {...props} />,
79
-
80
123
  renderOpts
81
124
  );
82
125
 
@@ -86,6 +129,7 @@ describe("<ImplementationRelationForm />", () => {
86
129
  },
87
130
  { timeout: 60000 }
88
131
  );
132
+ userEvent.click(await queryByText(/some/));
89
133
  expect(container).toMatchSnapshot();
90
134
  });
91
135
 
@@ -8,30 +8,72 @@ import en from "../../messages/en";
8
8
 
9
9
  const linkConcept = jest.fn();
10
10
 
11
- const domain = {
12
- external_id: "foo domain",
13
- id: 381,
14
- name: "foo domain",
11
+ const data = {
12
+ data: [
13
+ {
14
+ _actions: { can_create_structure_link: true },
15
+ business_concept_id: 2,
16
+ domain: {
17
+ external_id: "foo domain",
18
+ id: 381,
19
+ name: "foo domain",
20
+ },
21
+ id: 12355,
22
+ name: "foo concept",
23
+ status: "published",
24
+ last_change_at: "2020-01-01T00:00:00.000Z",
25
+ },
26
+ {
27
+ _actions: { can_create_structure_link: true },
28
+ business_concept_id: 123,
29
+ domain: {
30
+ external_id: "foo domain",
31
+ id: 381,
32
+ name: "foo domain",
33
+ },
34
+ id: 12290,
35
+ name: "bar concept",
36
+ status: "draft",
37
+ last_change_at: "2020-01-01T00:00:00.000Z",
38
+ },
39
+ ],
15
40
  };
16
41
 
17
- const concepts = [
18
- {
19
- _actions: { can_create_structure_link: true },
20
- business_concept_id: 2,
21
- domain: domain,
22
- id: 12355,
23
- name: "foo concept",
24
- status: "published",
42
+ const filterData = {
43
+ data: {
44
+ some: {
45
+ values: ["some_xxx", "some_yyy", "some_xwy"],
46
+ },
25
47
  },
26
- {
27
- _actions: { can_create_structure_link: true },
28
- business_concept_id: 123,
29
- domain: domain,
30
- id: 12290,
31
- name: "bar concept",
32
- status: "draft",
33
- },
34
- ];
48
+ };
49
+
50
+ jest.mock("@truedat/bg/concepts/hooks/useConcepts", () => {
51
+ const originalModule = jest.requireActual(
52
+ "@truedat/bg/concepts/hooks/useConcepts"
53
+ );
54
+
55
+ return {
56
+ __esModule: true,
57
+ ...originalModule,
58
+ useConceptFilters: () => ({
59
+ trigger: () => ({
60
+ then: (callback) =>
61
+ callback({
62
+ data: filterData,
63
+ }),
64
+ }),
65
+ }),
66
+ useConceptVersionsSearch: () => ({
67
+ trigger: () => ({
68
+ then: (callback) =>
69
+ callback({
70
+ data,
71
+ headers: {},
72
+ }),
73
+ }),
74
+ }),
75
+ };
76
+ });
35
77
 
36
78
  const tagOptions = [
37
79
  { id: 1, text: "relates_to", value: 0 },
@@ -65,16 +107,14 @@ const messages = {
65
107
  "search.applied_filters": "Applied Filters",
66
108
  "conceptRelations.relatedConcept": "Related Concept",
67
109
  "concepts.search.placeholder": "Search",
110
+ "search.placeholder": "Search...",
111
+ "concepts.search.results.empty": "No concepts found",
68
112
  },
69
113
  };
70
114
 
71
115
  const renderOpts = {
72
116
  messages,
73
- state: {
74
- structure,
75
- concepts,
76
- conceptActiveFilters: { filter: "some" },
77
- },
117
+ state: { structure },
78
118
  fallback: "lazy",
79
119
  };
80
120
 
@@ -84,7 +84,7 @@ exports[`<ImplementationRelationForm /> matches the latest snapshot 1`] = `
84
84
  class="ui action left icon input"
85
85
  >
86
86
  <input
87
- placeholder="Search"
87
+ placeholder="Search..."
88
88
  type="text"
89
89
  value=""
90
90
  />
@@ -93,8 +93,10 @@ exports[`<ImplementationRelationForm /> matches the latest snapshot 1`] = `
93
93
  class="search link icon"
94
94
  />
95
95
  <div
96
- aria-expanded="false"
97
- class="ui button floating labeled scrolling dropdown icon"
96
+ aria-busy="false"
97
+ aria-disabled="false"
98
+ aria-expanded="true"
99
+ class="ui active visible button floating labeled scrolling dropdown icon"
98
100
  role="listbox"
99
101
  tabindex="0"
100
102
  >
@@ -111,7 +113,7 @@ exports[`<ImplementationRelationForm /> matches the latest snapshot 1`] = `
111
113
  class="filter icon"
112
114
  />
113
115
  <div
114
- class="menu transition"
116
+ class="menu transition visible"
115
117
  >
116
118
  <div
117
119
  class="item"
@@ -133,23 +135,57 @@ exports[`<ImplementationRelationForm /> matches the latest snapshot 1`] = `
133
135
  Applied Filters
134
136
  </div>
135
137
  <div
136
- aria-expanded="false"
137
- class="ui floating item scrolling dropdown"
138
+ aria-expanded="true"
139
+ class="ui active visible floating item scrolling dropdown"
138
140
  role="listbox"
139
141
  tabindex="0"
140
142
  >
141
143
  <div
142
144
  class="ui label"
143
145
  >
144
- filter
146
+ some
145
147
  <i
146
148
  aria-hidden="true"
147
149
  class="delete icon"
148
150
  />
149
151
  </div>
150
152
  <div
151
- class="menu transition dimmable"
152
- />
153
+ class="menu transition dimmable visible"
154
+ >
155
+ <div
156
+ aria-checked="false"
157
+ class="item"
158
+ role="option"
159
+ >
160
+ <i
161
+ aria-hidden="true"
162
+ class="square outline icon"
163
+ />
164
+ some_xwy
165
+ </div>
166
+ <div
167
+ aria-checked="false"
168
+ class="item"
169
+ role="option"
170
+ >
171
+ <i
172
+ aria-hidden="true"
173
+ class="square outline icon"
174
+ />
175
+ some_xxx
176
+ </div>
177
+ <div
178
+ aria-checked="false"
179
+ class="item"
180
+ role="option"
181
+ >
182
+ <i
183
+ aria-hidden="true"
184
+ class="square outline icon"
185
+ />
186
+ some_yyy
187
+ </div>
188
+ </div>
153
189
  </div>
154
190
  <a
155
191
  class="resetFilters"
@@ -80,7 +80,7 @@ exports[`<StructureRelationForm /> matches the latest snapshot 1`] = `
80
80
  class="ui action left icon input"
81
81
  >
82
82
  <input
83
- placeholder="Search"
83
+ placeholder="Search..."
84
84
  type="text"
85
85
  value=""
86
86
  />
@@ -89,6 +89,8 @@ exports[`<StructureRelationForm /> matches the latest snapshot 1`] = `
89
89
  class="search link icon"
90
90
  />
91
91
  <div
92
+ aria-busy="false"
93
+ aria-disabled="false"
92
94
  aria-expanded="false"
93
95
  class="ui button floating labeled scrolling dropdown icon"
94
96
  role="listbox"
@@ -117,47 +119,22 @@ exports[`<StructureRelationForm /> matches the latest snapshot 1`] = `
117
119
  (reset filters)
118
120
  </em>
119
121
  </div>
122
+ <div
123
+ class="item"
124
+ role="option"
125
+ >
126
+ <span
127
+ class="text"
128
+ >
129
+ some
130
+ </span>
131
+ </div>
120
132
  </div>
121
133
  </div>
122
134
  </div>
123
135
  <div
124
136
  class="selectedFilters"
125
- >
126
- <div
127
- class="appliedFilters"
128
- >
129
- Applied Filters
130
- </div>
131
- <div
132
- aria-expanded="false"
133
- class="ui floating item scrolling dropdown"
134
- role="listbox"
135
- tabindex="0"
136
- >
137
- <div
138
- class="ui label"
139
- >
140
- filter
141
- <i
142
- aria-hidden="true"
143
- class="delete icon"
144
- />
145
- </div>
146
- <div
147
- class="menu transition dimmable"
148
- />
149
- </div>
150
- <a
151
- class="resetFilters"
152
- >
153
- Clear Filters
154
- </a>
155
- <a
156
- class="resetFilters"
157
- >
158
- Save Filters
159
- </a>
160
- </div>
137
+ />
161
138
  <table
162
139
  class="ui small selectable table"
163
140
  >