@truedat/bg 7.1.5 → 7.1.6
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 +6 -6
- package/src/concepts/components/ConceptsLinkDecorator.js +33 -0
- package/src/concepts/components/__tests__/ConceptsLinkDecorator.spec.js +15 -0
- package/src/concepts/components/__tests__/__snapshots__/ConceptsLinkDecorator.spec.js.snap +20 -0
- package/src/concepts/components/index.js +2 -3
- package/src/concepts/relations/components/ConceptImplementationLinks.js +4 -2
- package/src/concepts/relations/components/__tests__/ConceptImplementationLinks.spec.js +7 -0
- package/src/concepts/relations/components/__tests__/__snapshots__/ConceptImplementationLinks.spec.js.snap +318 -342
- package/src/concepts/relations/selectors/__tests__/getBusinessConceptsLinksToImplementationsColumns.spec.js +23 -0
- package/src/concepts/relations/selectors/getBusinessConceptsLinksToImplementationsColumns.js +117 -0
- package/src/concepts/relations/selectors/index.js +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/bg",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.6",
|
|
4
4
|
"description": "Truedat Web Business Glossary",
|
|
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": "7.1.
|
|
37
|
+
"@truedat/test": "7.1.6",
|
|
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,9 +86,9 @@
|
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@truedat/core": "7.1.
|
|
90
|
-
"@truedat/df": "7.1.
|
|
91
|
-
"@truedat/lm": "7.1.
|
|
89
|
+
"@truedat/core": "7.1.6",
|
|
90
|
+
"@truedat/df": "7.1.6",
|
|
91
|
+
"@truedat/lm": "7.1.6",
|
|
92
92
|
"decode-uri-component": "^0.2.2",
|
|
93
93
|
"file-saver": "^2.0.5",
|
|
94
94
|
"moment": "^2.29.4",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"react-dom": ">= 16.8.6 < 17",
|
|
112
112
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
113
113
|
},
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "0d15ef9da4d597618a5e3543ad2173e3d76f258b"
|
|
115
115
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { Link } from "react-router-dom";
|
|
5
|
+
import { linkTo } from "@truedat/core/routes";
|
|
6
|
+
import ArrayDecorator from "@truedat/core/components/ArrayDecorator";
|
|
7
|
+
|
|
8
|
+
export const ConceptsLinkDecorator = (concepts) => {
|
|
9
|
+
if (_.isEmpty(concepts)) return null;
|
|
10
|
+
|
|
11
|
+
const [{ id, name }, ...remainingConcepts] = concepts;
|
|
12
|
+
const remainingNames = remainingConcepts.map(({ name }) => name);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<Link
|
|
17
|
+
to={linkTo.CONCEPT_VERSION({
|
|
18
|
+
business_concept_id: id,
|
|
19
|
+
id: "current",
|
|
20
|
+
})}
|
|
21
|
+
>
|
|
22
|
+
{name}
|
|
23
|
+
</Link>
|
|
24
|
+
{ArrayDecorator(0, ", ")(remainingNames)}
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
ConceptsLinkDecorator.propTypes = {
|
|
30
|
+
concepts: PropTypes.array,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default ConceptsLinkDecorator;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import { ConceptsLinkDecorator } from "../ConceptsLinkDecorator";
|
|
4
|
+
|
|
5
|
+
describe("<ConceptsLinkDecorator />", () => {
|
|
6
|
+
const concepts = [
|
|
7
|
+
{ id: 1, name: "concept1" },
|
|
8
|
+
{ id: 2, name: "concept2" },
|
|
9
|
+
{ id: 3, name: "concept3" },
|
|
10
|
+
];
|
|
11
|
+
it("matches the latest snapshot", () => {
|
|
12
|
+
const { container } = render(<>{ConceptsLinkDecorator(concepts)}</>);
|
|
13
|
+
expect(container).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<ConceptsLinkDecorator /> matches the latest snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<a
|
|
6
|
+
href="/concepts/1/versions/current"
|
|
7
|
+
>
|
|
8
|
+
concept1
|
|
9
|
+
</a>
|
|
10
|
+
<div>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
class="ui label"
|
|
14
|
+
>
|
|
15
|
+
+
|
|
16
|
+
2
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
`;
|
|
@@ -11,8 +11,10 @@ import {
|
|
|
11
11
|
IMPLEMENTATION_NEW,
|
|
12
12
|
IMPLEMENTATION_NEW_RAW,
|
|
13
13
|
} from "@truedat/core/routes";
|
|
14
|
-
import {
|
|
15
|
-
|
|
14
|
+
import {
|
|
15
|
+
getConceptImplementationLinks,
|
|
16
|
+
getBusinessConceptsLinksToImplementationsColumns,
|
|
17
|
+
} from "../selectors";
|
|
16
18
|
|
|
17
19
|
const RuleImplementationsTable = React.lazy(() =>
|
|
18
20
|
import("@truedat/dq/components/RuleImplementationsTable")
|
|
@@ -3,6 +3,7 @@ import React, { Suspense } from "react";
|
|
|
3
3
|
import { render } from "@truedat/test/render";
|
|
4
4
|
import en from "../../../../messages/en";
|
|
5
5
|
import { ConceptImplementationLinks } from "../ConceptImplementationLinks";
|
|
6
|
+
import { getBusinessConceptsLinksToImplementationsColumns } from "../../selectors";
|
|
6
7
|
|
|
7
8
|
jest.mock("react-router-dom", () => ({
|
|
8
9
|
...jest.requireActual("react-router-dom"),
|
|
@@ -12,6 +13,8 @@ jest.mock("react-router-dom", () => ({
|
|
|
12
13
|
}),
|
|
13
14
|
}));
|
|
14
15
|
|
|
16
|
+
const columns = getBusinessConceptsLinksToImplementationsColumns({});
|
|
17
|
+
|
|
15
18
|
const messages = {
|
|
16
19
|
en: {
|
|
17
20
|
...en,
|
|
@@ -38,6 +41,7 @@ describe("<ConceptImplementationLinks />", () => {
|
|
|
38
41
|
["group", [{ implementation_key: "foo", id: "1" }]],
|
|
39
42
|
["deleted", []],
|
|
40
43
|
],
|
|
44
|
+
columns,
|
|
41
45
|
};
|
|
42
46
|
const renderOpts = { messages };
|
|
43
47
|
const { container } = render(
|
|
@@ -56,6 +60,7 @@ describe("<ConceptImplementationLinks />", () => {
|
|
|
56
60
|
["group", [{ implementation_key: "foo", id: "1" }]],
|
|
57
61
|
["deleted", []],
|
|
58
62
|
],
|
|
63
|
+
columns,
|
|
59
64
|
createRawImplementation: { method: "POST" },
|
|
60
65
|
createLinkImplementation: { method: "POST" },
|
|
61
66
|
createImplementation: { method: "POST" },
|
|
@@ -76,6 +81,7 @@ describe("<ConceptImplementationLinks />", () => {
|
|
|
76
81
|
["○", [{ implementation_key: "foo", id: "1" }]],
|
|
77
82
|
["deleted", [{ implementation_key: "bar", id: "2" }]],
|
|
78
83
|
],
|
|
84
|
+
columns,
|
|
79
85
|
createRawImplementation: { method: "POST" },
|
|
80
86
|
createLinkImplementation: { method: "POST" },
|
|
81
87
|
createImplementation: { method: "POST" },
|
|
@@ -96,6 +102,7 @@ describe("<ConceptImplementationLinks />", () => {
|
|
|
96
102
|
createRawImplementation: { method: "POST" },
|
|
97
103
|
createLinkImplementation: { method: "POST" },
|
|
98
104
|
createImplementation: { method: "POST" },
|
|
105
|
+
columns,
|
|
99
106
|
};
|
|
100
107
|
const { container } = render(
|
|
101
108
|
<Suspense fallback={null}>
|
|
@@ -38,130 +38,122 @@ exports[`<ConceptImplementationLinks /> show create implementations buttons when
|
|
|
38
38
|
>
|
|
39
39
|
group
|
|
40
40
|
</h3>
|
|
41
|
-
<
|
|
42
|
-
class="
|
|
41
|
+
<div
|
|
42
|
+
class="implementations-table-overflow"
|
|
43
43
|
>
|
|
44
|
-
<
|
|
45
|
-
class=""
|
|
44
|
+
<table
|
|
45
|
+
class="ui sortable table"
|
|
46
46
|
>
|
|
47
|
-
<
|
|
47
|
+
<thead
|
|
48
48
|
class=""
|
|
49
49
|
>
|
|
50
|
-
<
|
|
51
|
-
class="
|
|
52
|
-
>
|
|
53
|
-
Implementation
|
|
54
|
-
</th>
|
|
55
|
-
<th
|
|
56
|
-
class="two wide"
|
|
57
|
-
>
|
|
58
|
-
Rule
|
|
59
|
-
</th>
|
|
60
|
-
<th
|
|
61
|
-
class="two wide"
|
|
62
|
-
>
|
|
63
|
-
Status
|
|
64
|
-
</th>
|
|
65
|
-
<th
|
|
66
|
-
class="two wide"
|
|
67
|
-
>
|
|
68
|
-
Concepts
|
|
69
|
-
</th>
|
|
70
|
-
<th
|
|
71
|
-
class="two wide"
|
|
72
|
-
>
|
|
73
|
-
Last execution
|
|
74
|
-
</th>
|
|
75
|
-
<th
|
|
76
|
-
class="two wide"
|
|
77
|
-
>
|
|
78
|
-
Result Type
|
|
79
|
-
</th>
|
|
80
|
-
<th
|
|
81
|
-
class="one wide"
|
|
82
|
-
>
|
|
83
|
-
Minimum
|
|
84
|
-
</th>
|
|
85
|
-
<th
|
|
86
|
-
class="one wide"
|
|
87
|
-
>
|
|
88
|
-
Goal
|
|
89
|
-
</th>
|
|
90
|
-
<th
|
|
91
|
-
class="two wide"
|
|
92
|
-
>
|
|
93
|
-
Result
|
|
94
|
-
</th>
|
|
95
|
-
<th
|
|
96
|
-
class="ascending sorted disabled"
|
|
97
|
-
>
|
|
98
|
-
Inserted At
|
|
99
|
-
</th>
|
|
100
|
-
<th
|
|
101
|
-
class="ascending sorted disabled"
|
|
50
|
+
<tr
|
|
51
|
+
class=""
|
|
102
52
|
>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
53
|
+
<th
|
|
54
|
+
class="two wide ascending sorted disabled"
|
|
55
|
+
>
|
|
56
|
+
Implementation
|
|
57
|
+
</th>
|
|
58
|
+
<th
|
|
59
|
+
class="two wide ascending sorted disabled"
|
|
60
|
+
>
|
|
61
|
+
Rule
|
|
62
|
+
</th>
|
|
63
|
+
<th
|
|
64
|
+
class="two wide ascending sorted disabled"
|
|
65
|
+
>
|
|
66
|
+
Status
|
|
67
|
+
</th>
|
|
68
|
+
<th
|
|
69
|
+
class="two wide ascending sorted disabled"
|
|
70
|
+
>
|
|
71
|
+
Last execution
|
|
72
|
+
</th>
|
|
73
|
+
<th
|
|
74
|
+
class="two wide ascending sorted disabled"
|
|
75
|
+
>
|
|
76
|
+
Result Type
|
|
77
|
+
</th>
|
|
78
|
+
<th
|
|
79
|
+
class="one wide ascending sorted disabled"
|
|
80
|
+
>
|
|
81
|
+
Minimum
|
|
82
|
+
</th>
|
|
83
|
+
<th
|
|
84
|
+
class="one wide ascending sorted disabled"
|
|
85
|
+
>
|
|
86
|
+
Goal
|
|
87
|
+
</th>
|
|
88
|
+
<th
|
|
89
|
+
class="two wide ascending sorted disabled"
|
|
90
|
+
>
|
|
91
|
+
Result
|
|
92
|
+
</th>
|
|
93
|
+
<th
|
|
94
|
+
class="ascending sorted disabled"
|
|
95
|
+
>
|
|
96
|
+
Inserted At
|
|
97
|
+
</th>
|
|
98
|
+
<th
|
|
99
|
+
class="ascending sorted disabled"
|
|
100
|
+
>
|
|
101
|
+
Updated At
|
|
102
|
+
</th>
|
|
103
|
+
</tr>
|
|
104
|
+
</thead>
|
|
105
|
+
<tbody
|
|
111
106
|
class=""
|
|
112
107
|
>
|
|
113
|
-
<
|
|
108
|
+
<tr
|
|
114
109
|
class=""
|
|
115
110
|
>
|
|
116
|
-
<
|
|
117
|
-
|
|
111
|
+
<td
|
|
112
|
+
class=""
|
|
118
113
|
>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
</tr>
|
|
163
|
-
</tbody>
|
|
164
|
-
</table>
|
|
114
|
+
<a
|
|
115
|
+
href="/implementations/1"
|
|
116
|
+
>
|
|
117
|
+
foo
|
|
118
|
+
</a>
|
|
119
|
+
</td>
|
|
120
|
+
<td
|
|
121
|
+
class=""
|
|
122
|
+
/>
|
|
123
|
+
<td
|
|
124
|
+
class=""
|
|
125
|
+
>
|
|
126
|
+
ruleImplementation.status.undefined
|
|
127
|
+
</td>
|
|
128
|
+
<td
|
|
129
|
+
class=""
|
|
130
|
+
/>
|
|
131
|
+
<td
|
|
132
|
+
class=""
|
|
133
|
+
/>
|
|
134
|
+
<td
|
|
135
|
+
class="right aligned"
|
|
136
|
+
>
|
|
137
|
+
undefined%
|
|
138
|
+
</td>
|
|
139
|
+
<td
|
|
140
|
+
class="right aligned"
|
|
141
|
+
>
|
|
142
|
+
undefined%
|
|
143
|
+
</td>
|
|
144
|
+
<td
|
|
145
|
+
class="center aligned"
|
|
146
|
+
/>
|
|
147
|
+
<td
|
|
148
|
+
class=""
|
|
149
|
+
/>
|
|
150
|
+
<td
|
|
151
|
+
class=""
|
|
152
|
+
/>
|
|
153
|
+
</tr>
|
|
154
|
+
</tbody>
|
|
155
|
+
</table>
|
|
156
|
+
</div>
|
|
165
157
|
</div>
|
|
166
158
|
</div>
|
|
167
159
|
</div>
|
|
@@ -183,130 +175,122 @@ exports[`<ConceptImplementationLinks /> show implementations with groups 1`] = `
|
|
|
183
175
|
>
|
|
184
176
|
Link to Implementation
|
|
185
177
|
</h3>
|
|
186
|
-
<
|
|
187
|
-
class="
|
|
178
|
+
<div
|
|
179
|
+
class="implementations-table-overflow"
|
|
188
180
|
>
|
|
189
|
-
<
|
|
190
|
-
class=""
|
|
181
|
+
<table
|
|
182
|
+
class="ui sortable table"
|
|
191
183
|
>
|
|
192
|
-
<
|
|
184
|
+
<thead
|
|
193
185
|
class=""
|
|
194
186
|
>
|
|
195
|
-
<
|
|
196
|
-
class="
|
|
197
|
-
>
|
|
198
|
-
Implementation
|
|
199
|
-
</th>
|
|
200
|
-
<th
|
|
201
|
-
class="two wide"
|
|
202
|
-
>
|
|
203
|
-
Rule
|
|
204
|
-
</th>
|
|
205
|
-
<th
|
|
206
|
-
class="two wide"
|
|
207
|
-
>
|
|
208
|
-
Status
|
|
209
|
-
</th>
|
|
210
|
-
<th
|
|
211
|
-
class="two wide"
|
|
212
|
-
>
|
|
213
|
-
Concepts
|
|
214
|
-
</th>
|
|
215
|
-
<th
|
|
216
|
-
class="two wide"
|
|
217
|
-
>
|
|
218
|
-
Last execution
|
|
219
|
-
</th>
|
|
220
|
-
<th
|
|
221
|
-
class="two wide"
|
|
222
|
-
>
|
|
223
|
-
Result Type
|
|
224
|
-
</th>
|
|
225
|
-
<th
|
|
226
|
-
class="one wide"
|
|
227
|
-
>
|
|
228
|
-
Minimum
|
|
229
|
-
</th>
|
|
230
|
-
<th
|
|
231
|
-
class="one wide"
|
|
232
|
-
>
|
|
233
|
-
Goal
|
|
234
|
-
</th>
|
|
235
|
-
<th
|
|
236
|
-
class="two wide"
|
|
237
|
-
>
|
|
238
|
-
Result
|
|
239
|
-
</th>
|
|
240
|
-
<th
|
|
241
|
-
class="ascending sorted disabled"
|
|
242
|
-
>
|
|
243
|
-
Inserted At
|
|
244
|
-
</th>
|
|
245
|
-
<th
|
|
246
|
-
class="ascending sorted disabled"
|
|
187
|
+
<tr
|
|
188
|
+
class=""
|
|
247
189
|
>
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
190
|
+
<th
|
|
191
|
+
class="two wide ascending sorted disabled"
|
|
192
|
+
>
|
|
193
|
+
Implementation
|
|
194
|
+
</th>
|
|
195
|
+
<th
|
|
196
|
+
class="two wide ascending sorted disabled"
|
|
197
|
+
>
|
|
198
|
+
Rule
|
|
199
|
+
</th>
|
|
200
|
+
<th
|
|
201
|
+
class="two wide ascending sorted disabled"
|
|
202
|
+
>
|
|
203
|
+
Status
|
|
204
|
+
</th>
|
|
205
|
+
<th
|
|
206
|
+
class="two wide ascending sorted disabled"
|
|
207
|
+
>
|
|
208
|
+
Last execution
|
|
209
|
+
</th>
|
|
210
|
+
<th
|
|
211
|
+
class="two wide ascending sorted disabled"
|
|
212
|
+
>
|
|
213
|
+
Result Type
|
|
214
|
+
</th>
|
|
215
|
+
<th
|
|
216
|
+
class="one wide ascending sorted disabled"
|
|
217
|
+
>
|
|
218
|
+
Minimum
|
|
219
|
+
</th>
|
|
220
|
+
<th
|
|
221
|
+
class="one wide ascending sorted disabled"
|
|
222
|
+
>
|
|
223
|
+
Goal
|
|
224
|
+
</th>
|
|
225
|
+
<th
|
|
226
|
+
class="two wide ascending sorted disabled"
|
|
227
|
+
>
|
|
228
|
+
Result
|
|
229
|
+
</th>
|
|
230
|
+
<th
|
|
231
|
+
class="ascending sorted disabled"
|
|
232
|
+
>
|
|
233
|
+
Inserted At
|
|
234
|
+
</th>
|
|
235
|
+
<th
|
|
236
|
+
class="ascending sorted disabled"
|
|
237
|
+
>
|
|
238
|
+
Updated At
|
|
239
|
+
</th>
|
|
240
|
+
</tr>
|
|
241
|
+
</thead>
|
|
242
|
+
<tbody
|
|
256
243
|
class=""
|
|
257
244
|
>
|
|
258
|
-
<
|
|
245
|
+
<tr
|
|
259
246
|
class=""
|
|
260
247
|
>
|
|
261
|
-
<
|
|
262
|
-
|
|
248
|
+
<td
|
|
249
|
+
class=""
|
|
263
250
|
>
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
<
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
</tr>
|
|
308
|
-
</tbody>
|
|
309
|
-
</table>
|
|
251
|
+
<a
|
|
252
|
+
href="/implementations/1"
|
|
253
|
+
>
|
|
254
|
+
foo
|
|
255
|
+
</a>
|
|
256
|
+
</td>
|
|
257
|
+
<td
|
|
258
|
+
class=""
|
|
259
|
+
/>
|
|
260
|
+
<td
|
|
261
|
+
class=""
|
|
262
|
+
>
|
|
263
|
+
ruleImplementation.status.undefined
|
|
264
|
+
</td>
|
|
265
|
+
<td
|
|
266
|
+
class=""
|
|
267
|
+
/>
|
|
268
|
+
<td
|
|
269
|
+
class=""
|
|
270
|
+
/>
|
|
271
|
+
<td
|
|
272
|
+
class="right aligned"
|
|
273
|
+
>
|
|
274
|
+
undefined%
|
|
275
|
+
</td>
|
|
276
|
+
<td
|
|
277
|
+
class="right aligned"
|
|
278
|
+
>
|
|
279
|
+
undefined%
|
|
280
|
+
</td>
|
|
281
|
+
<td
|
|
282
|
+
class="center aligned"
|
|
283
|
+
/>
|
|
284
|
+
<td
|
|
285
|
+
class=""
|
|
286
|
+
/>
|
|
287
|
+
<td
|
|
288
|
+
class=""
|
|
289
|
+
/>
|
|
290
|
+
</tr>
|
|
291
|
+
</tbody>
|
|
292
|
+
</table>
|
|
293
|
+
</div>
|
|
310
294
|
</div>
|
|
311
295
|
<div
|
|
312
296
|
class="ui vertical segment"
|
|
@@ -316,130 +300,122 @@ exports[`<ConceptImplementationLinks /> show implementations with groups 1`] = `
|
|
|
316
300
|
>
|
|
317
301
|
Deleted Implementations
|
|
318
302
|
</h3>
|
|
319
|
-
<
|
|
320
|
-
class="
|
|
303
|
+
<div
|
|
304
|
+
class="implementations-table-overflow"
|
|
321
305
|
>
|
|
322
|
-
<
|
|
323
|
-
class=""
|
|
306
|
+
<table
|
|
307
|
+
class="ui sortable table"
|
|
324
308
|
>
|
|
325
|
-
<
|
|
309
|
+
<thead
|
|
326
310
|
class=""
|
|
327
311
|
>
|
|
328
|
-
<
|
|
329
|
-
class="
|
|
330
|
-
>
|
|
331
|
-
Implementation
|
|
332
|
-
</th>
|
|
333
|
-
<th
|
|
334
|
-
class="two wide"
|
|
335
|
-
>
|
|
336
|
-
Rule
|
|
337
|
-
</th>
|
|
338
|
-
<th
|
|
339
|
-
class="two wide"
|
|
340
|
-
>
|
|
341
|
-
Status
|
|
342
|
-
</th>
|
|
343
|
-
<th
|
|
344
|
-
class="two wide"
|
|
345
|
-
>
|
|
346
|
-
Concepts
|
|
347
|
-
</th>
|
|
348
|
-
<th
|
|
349
|
-
class="two wide"
|
|
350
|
-
>
|
|
351
|
-
Last execution
|
|
352
|
-
</th>
|
|
353
|
-
<th
|
|
354
|
-
class="two wide"
|
|
355
|
-
>
|
|
356
|
-
Result Type
|
|
357
|
-
</th>
|
|
358
|
-
<th
|
|
359
|
-
class="one wide"
|
|
360
|
-
>
|
|
361
|
-
Minimum
|
|
362
|
-
</th>
|
|
363
|
-
<th
|
|
364
|
-
class="one wide"
|
|
365
|
-
>
|
|
366
|
-
Goal
|
|
367
|
-
</th>
|
|
368
|
-
<th
|
|
369
|
-
class="two wide"
|
|
370
|
-
>
|
|
371
|
-
Result
|
|
372
|
-
</th>
|
|
373
|
-
<th
|
|
374
|
-
class="ascending sorted disabled"
|
|
375
|
-
>
|
|
376
|
-
Inserted At
|
|
377
|
-
</th>
|
|
378
|
-
<th
|
|
379
|
-
class="ascending sorted disabled"
|
|
312
|
+
<tr
|
|
313
|
+
class=""
|
|
380
314
|
>
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
315
|
+
<th
|
|
316
|
+
class="two wide ascending sorted disabled"
|
|
317
|
+
>
|
|
318
|
+
Implementation
|
|
319
|
+
</th>
|
|
320
|
+
<th
|
|
321
|
+
class="two wide ascending sorted disabled"
|
|
322
|
+
>
|
|
323
|
+
Rule
|
|
324
|
+
</th>
|
|
325
|
+
<th
|
|
326
|
+
class="two wide ascending sorted disabled"
|
|
327
|
+
>
|
|
328
|
+
Status
|
|
329
|
+
</th>
|
|
330
|
+
<th
|
|
331
|
+
class="two wide ascending sorted disabled"
|
|
332
|
+
>
|
|
333
|
+
Last execution
|
|
334
|
+
</th>
|
|
335
|
+
<th
|
|
336
|
+
class="two wide ascending sorted disabled"
|
|
337
|
+
>
|
|
338
|
+
Result Type
|
|
339
|
+
</th>
|
|
340
|
+
<th
|
|
341
|
+
class="one wide ascending sorted disabled"
|
|
342
|
+
>
|
|
343
|
+
Minimum
|
|
344
|
+
</th>
|
|
345
|
+
<th
|
|
346
|
+
class="one wide ascending sorted disabled"
|
|
347
|
+
>
|
|
348
|
+
Goal
|
|
349
|
+
</th>
|
|
350
|
+
<th
|
|
351
|
+
class="two wide ascending sorted disabled"
|
|
352
|
+
>
|
|
353
|
+
Result
|
|
354
|
+
</th>
|
|
355
|
+
<th
|
|
356
|
+
class="ascending sorted disabled"
|
|
357
|
+
>
|
|
358
|
+
Inserted At
|
|
359
|
+
</th>
|
|
360
|
+
<th
|
|
361
|
+
class="ascending sorted disabled"
|
|
362
|
+
>
|
|
363
|
+
Updated At
|
|
364
|
+
</th>
|
|
365
|
+
</tr>
|
|
366
|
+
</thead>
|
|
367
|
+
<tbody
|
|
389
368
|
class=""
|
|
390
369
|
>
|
|
391
|
-
<
|
|
370
|
+
<tr
|
|
392
371
|
class=""
|
|
393
372
|
>
|
|
394
|
-
<
|
|
395
|
-
|
|
373
|
+
<td
|
|
374
|
+
class=""
|
|
396
375
|
>
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
<
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
</tr>
|
|
441
|
-
</tbody>
|
|
442
|
-
</table>
|
|
376
|
+
<a
|
|
377
|
+
href="/implementations/2"
|
|
378
|
+
>
|
|
379
|
+
bar
|
|
380
|
+
</a>
|
|
381
|
+
</td>
|
|
382
|
+
<td
|
|
383
|
+
class=""
|
|
384
|
+
/>
|
|
385
|
+
<td
|
|
386
|
+
class=""
|
|
387
|
+
>
|
|
388
|
+
ruleImplementation.status.undefined
|
|
389
|
+
</td>
|
|
390
|
+
<td
|
|
391
|
+
class=""
|
|
392
|
+
/>
|
|
393
|
+
<td
|
|
394
|
+
class=""
|
|
395
|
+
/>
|
|
396
|
+
<td
|
|
397
|
+
class="right aligned"
|
|
398
|
+
>
|
|
399
|
+
undefined%
|
|
400
|
+
</td>
|
|
401
|
+
<td
|
|
402
|
+
class="right aligned"
|
|
403
|
+
>
|
|
404
|
+
undefined%
|
|
405
|
+
</td>
|
|
406
|
+
<td
|
|
407
|
+
class="center aligned"
|
|
408
|
+
/>
|
|
409
|
+
<td
|
|
410
|
+
class=""
|
|
411
|
+
/>
|
|
412
|
+
<td
|
|
413
|
+
class=""
|
|
414
|
+
/>
|
|
415
|
+
</tr>
|
|
416
|
+
</tbody>
|
|
417
|
+
</table>
|
|
418
|
+
</div>
|
|
443
419
|
</div>
|
|
444
420
|
</div>
|
|
445
421
|
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getBusinessConceptsLinksToImplementationsColumns,
|
|
3
|
+
defaultBusinessConceptsLinksToImplementationsColumns,
|
|
4
|
+
} from "..";
|
|
5
|
+
|
|
6
|
+
describe("selectors: getBusinessConceptsLinksToImplementationsColumns", () => {
|
|
7
|
+
it("should return custom businessConceptsLinksToImplementationsColumns when present", () => {
|
|
8
|
+
const businessConceptsLinksToImplementationsColumns = [{ name: "test" }];
|
|
9
|
+
const res = getBusinessConceptsLinksToImplementationsColumns({
|
|
10
|
+
businessConceptsLinksToImplementationsColumns,
|
|
11
|
+
});
|
|
12
|
+
expect(res).toHaveLength(1);
|
|
13
|
+
expect(res).toEqual(businessConceptsLinksToImplementationsColumns);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it("should return default getBusinessConceptsLinksToImplementationsColumns when no customized", () => {
|
|
17
|
+
const res = getBusinessConceptsLinksToImplementationsColumns({});
|
|
18
|
+
|
|
19
|
+
expect(res).toHaveLength(
|
|
20
|
+
defaultBusinessConceptsLinksToImplementationsColumns.length
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { createSelector } from "reselect";
|
|
4
|
+
import { FormattedMessage } from "react-intl";
|
|
5
|
+
import { Link } from "react-router-dom";
|
|
6
|
+
import DateTime from "@truedat/core/components/DateTime";
|
|
7
|
+
import { formatNumber } from "@truedat/core/services/format";
|
|
8
|
+
import { linkTo } from "@truedat/core/routes";
|
|
9
|
+
import RuleLink from "@truedat/dq/components/RuleLink";
|
|
10
|
+
import RuleResultDecorator from "@truedat/dq/components/RuleResultDecorator";
|
|
11
|
+
import RuleImplementationLink from "@truedat/dq/components/RuleImplementationLink";
|
|
12
|
+
|
|
13
|
+
const translateDecorator = (id) =>
|
|
14
|
+
id ? <FormattedMessage id={id} defaultMessage={id} /> : null;
|
|
15
|
+
|
|
16
|
+
const resultTypeDecorator = (result, result_type, resultType) =>
|
|
17
|
+
_.defaultTo(result_type)(resultType) === "errors_number"
|
|
18
|
+
? formatNumber(result)
|
|
19
|
+
: `${result}%`;
|
|
20
|
+
|
|
21
|
+
export const defaultBusinessConceptsLinksToImplementationsColumns = [
|
|
22
|
+
{
|
|
23
|
+
name: "implementation_key",
|
|
24
|
+
fieldSelector: _.pick(["id", "implementation_key", "rule_id"]),
|
|
25
|
+
fieldDecorator: RuleImplementationLink,
|
|
26
|
+
width: 2,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "rule",
|
|
30
|
+
fieldSelector: ({ rule, rule_id: id }) => ({ id, name: rule?.name }),
|
|
31
|
+
fieldDecorator: RuleLink,
|
|
32
|
+
width: 2,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "status",
|
|
36
|
+
fieldSelector: ({ status }) =>
|
|
37
|
+
translateDecorator(`ruleImplementation.status.${status}`),
|
|
38
|
+
width: 2,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "last_execution_at",
|
|
42
|
+
fieldSelector: ({ execution_result_info }) => ({
|
|
43
|
+
value: execution_result_info?.date,
|
|
44
|
+
}),
|
|
45
|
+
fieldDecorator: DateTime,
|
|
46
|
+
width: 2,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "result_type",
|
|
50
|
+
fieldDecorator: (value) =>
|
|
51
|
+
_.isNil(value)
|
|
52
|
+
? null
|
|
53
|
+
: translateDecorator(`ruleImplementations.props.result_type.${value}`),
|
|
54
|
+
width: 2,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "minimum",
|
|
58
|
+
fieldSelector: _.pick(["minimum", "result_type"]),
|
|
59
|
+
fieldDecorator: (field) =>
|
|
60
|
+
resultTypeDecorator(field.minimum, field.result_type),
|
|
61
|
+
textAlign: "right",
|
|
62
|
+
width: 1,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "goal",
|
|
66
|
+
fieldSelector: _.pick(["goal", "result_type"]),
|
|
67
|
+
fieldDecorator: (field) =>
|
|
68
|
+
resultTypeDecorator(field.goal, field.result_type),
|
|
69
|
+
textAlign: "right",
|
|
70
|
+
width: 1,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "result",
|
|
74
|
+
fieldSelector: (ruleImplementation) => ({
|
|
75
|
+
ruleResult: ruleImplementation?.execution_result_info,
|
|
76
|
+
ruleImplementation,
|
|
77
|
+
}),
|
|
78
|
+
fieldDecorator: RuleResultDecorator,
|
|
79
|
+
textAlign: "center",
|
|
80
|
+
width: 2,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "inserted_at",
|
|
84
|
+
fieldSelector: ({ inserted_at }) => ({ value: inserted_at }),
|
|
85
|
+
fieldDecorator: DateTime,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "updated_at",
|
|
89
|
+
fieldSelector: ({ updated_at }) => ({ value: updated_at }),
|
|
90
|
+
fieldDecorator: DateTime,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "related_by",
|
|
94
|
+
fieldSelector: _.pick(["business_concept_id", "business_concept_name"]),
|
|
95
|
+
fieldDecorator: ({ business_concept_id, business_concept_name }) => {
|
|
96
|
+
return _.isEmpty(business_concept_id) ? (
|
|
97
|
+
<></>
|
|
98
|
+
) : (
|
|
99
|
+
<Link
|
|
100
|
+
to={linkTo.CONCEPT_VERSION({
|
|
101
|
+
business_concept_id: business_concept_id,
|
|
102
|
+
id: "current",
|
|
103
|
+
})}
|
|
104
|
+
>
|
|
105
|
+
{business_concept_name}
|
|
106
|
+
</Link>
|
|
107
|
+
);
|
|
108
|
+
},
|
|
109
|
+
hideOn: (implementations) =>
|
|
110
|
+
!_.some("business_concept_id")(implementations),
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
export const getBusinessConceptsLinksToImplementationsColumns = createSelector(
|
|
115
|
+
_.prop("businessConceptsLinksToImplementationsColumns"),
|
|
116
|
+
_.defaultTo(defaultBusinessConceptsLinksToImplementationsColumns)
|
|
117
|
+
);
|
|
@@ -6,3 +6,8 @@ export {
|
|
|
6
6
|
} from "./getConceptRelations";
|
|
7
7
|
export { getConceptLinks } from "./getConceptLinks";
|
|
8
8
|
export { getConceptImplementationLinks } from "./getConceptImplementationLinks";
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
getBusinessConceptsLinksToImplementationsColumns,
|
|
12
|
+
defaultBusinessConceptsLinksToImplementationsColumns,
|
|
13
|
+
} from "./getBusinessConceptsLinksToImplementationsColumns";
|