@truedat/bg 4.54.7 → 4.54.9
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/CHANGELOG.md +7 -1
- package/package.json +5 -5
- package/src/concepts/components/ConceptsBulkUpdate.js +4 -5
- package/src/messages/en.js +1 -0
- package/src/messages/es.js +1 -0
- package/src/taxonomy/components/Domain.js +20 -4
- package/src/taxonomy/components/DomainImplementations.js +37 -0
- package/src/taxonomy/components/DomainRoutes.js +2 -0
- package/src/taxonomy/components/DomainTabs.js +24 -10
- package/src/taxonomy/components/__tests__/Domain.spec.js +16 -15
- package/src/taxonomy/components/__tests__/__snapshots__/Domain.spec.js.snap +91 -68
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.54.9] 2022-10-28
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- [TD-4977] Implementations tab in domain view
|
|
8
|
+
|
|
3
9
|
## [4.54.5] 2022-10-25
|
|
4
10
|
|
|
5
11
|
### Changed
|
|
@@ -43,7 +49,7 @@
|
|
|
43
49
|
|
|
44
50
|
### Added
|
|
45
51
|
|
|
46
|
-
- [TD-4975] Structures tab in
|
|
52
|
+
- [TD-4975] Structures tab in domain view
|
|
47
53
|
|
|
48
54
|
## [4.48.4] 2022-07-11
|
|
49
55
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/bg",
|
|
3
|
-
"version": "4.54.
|
|
3
|
+
"version": "4.54.9",
|
|
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.4",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "4.54.
|
|
37
|
+
"@truedat/test": "4.54.9",
|
|
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,8 +86,8 @@
|
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@truedat/core": "4.54.
|
|
90
|
-
"@truedat/df": "4.54.
|
|
89
|
+
"@truedat/core": "4.54.9",
|
|
90
|
+
"@truedat/df": "4.54.9",
|
|
91
91
|
"file-saver": "^2.0.5",
|
|
92
92
|
"moment": "^2.24.0",
|
|
93
93
|
"path-to-regexp": "^1.7.0",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"react-dom": ">= 16.8.6 < 17",
|
|
108
108
|
"semantic-ui-react": ">= 0.88.2 < 2.1"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "27f711249723050708a6f6f4de3ab5029069c4d7"
|
|
111
111
|
}
|
|
@@ -54,6 +54,9 @@ const actions = (handleSubmit) => [
|
|
|
54
54
|
onClick: handleSubmit,
|
|
55
55
|
},
|
|
56
56
|
];
|
|
57
|
+
|
|
58
|
+
const isEmptyValue = (value) => !_.isNumber(value) && _.isEmpty(value);
|
|
59
|
+
|
|
57
60
|
export class ConceptsBulkUpdate extends React.Component {
|
|
58
61
|
static propTypes = {
|
|
59
62
|
loading: PropTypes.bool,
|
|
@@ -90,10 +93,6 @@ export class ConceptsBulkUpdate extends React.Component {
|
|
|
90
93
|
|
|
91
94
|
isInvalid = () => _.negate(isValid)(this.state);
|
|
92
95
|
|
|
93
|
-
isEmptyNumberOrObject = (value) =>
|
|
94
|
-
(_.isNumber(value) && _.isNil(value)) ||
|
|
95
|
-
(!_.isNumber(value) && _.isEmpty(value));
|
|
96
|
-
|
|
97
96
|
handleSubmit = (e) => {
|
|
98
97
|
e.preventDefault();
|
|
99
98
|
const { applyTemplate, bulkUpdate } = this.props;
|
|
@@ -102,7 +101,7 @@ export class ConceptsBulkUpdate extends React.Component {
|
|
|
102
101
|
_.prop("content"),
|
|
103
102
|
(content) => applyTemplate(content, domain_id),
|
|
104
103
|
_.omit(fieldsToOmit),
|
|
105
|
-
_.omitBy(
|
|
104
|
+
_.omitBy(isEmptyValue)
|
|
106
105
|
)(this.state);
|
|
107
106
|
bulkUpdate({ update_attributes: { content, domain_id } });
|
|
108
107
|
};
|
package/src/messages/en.js
CHANGED
|
@@ -287,6 +287,7 @@ export default {
|
|
|
287
287
|
"tabs.bg.relations_data_field": "Linkage",
|
|
288
288
|
"tabs.concepts": "Concepts",
|
|
289
289
|
"tabs.domains": "Domains",
|
|
290
|
+
"tabs.implementations": "Data Quality",
|
|
290
291
|
"tabs.members": "Members",
|
|
291
292
|
"tabs.se.concepts": "Concepts",
|
|
292
293
|
"tabs.structures": "Structures",
|
package/src/messages/es.js
CHANGED
|
@@ -291,6 +291,7 @@ export default {
|
|
|
291
291
|
"tabs.bg.relations_data_field": "Vinculación",
|
|
292
292
|
"tabs.concepts": "Conceptos",
|
|
293
293
|
"tabs.domains": "Dominios",
|
|
294
|
+
"tabs.implementations": "Calidad",
|
|
294
295
|
"tabs.members": "Roles",
|
|
295
296
|
"tabs.se.concepts": "Conceptos",
|
|
296
297
|
"tabs.structures": "Estructuras",
|
|
@@ -4,9 +4,12 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import { connect } from "react-redux";
|
|
5
5
|
import { Route, Switch } from "react-router-dom";
|
|
6
6
|
import { Segment } from "semantic-ui-react";
|
|
7
|
+
import { Unauthorized } from "@truedat/core/components";
|
|
8
|
+
import { useAuthorized } from "@truedat/core/hooks";
|
|
7
9
|
import {
|
|
8
10
|
DOMAIN,
|
|
9
11
|
DOMAIN_CONCEPTS,
|
|
12
|
+
DOMAIN_IMPLEMENTATIONS,
|
|
10
13
|
DOMAIN_MEMBERS,
|
|
11
14
|
DOMAIN_STRUCTURES,
|
|
12
15
|
linkTo,
|
|
@@ -16,12 +19,16 @@ import DomainActions from "./DomainActions";
|
|
|
16
19
|
import DomainCards from "./DomainCards";
|
|
17
20
|
import DomainCrumbs from "./DomainCrumbs";
|
|
18
21
|
import DomainDetail from "./DomainDetail";
|
|
22
|
+
import DomainImplementations from "./DomainImplementations";
|
|
19
23
|
import DomainMembers from "./DomainMembers";
|
|
20
24
|
import DomainSearch from "./DomainSearch";
|
|
21
25
|
import DomainStructures from "./DomainStructures";
|
|
22
26
|
import DomainTabs from "./DomainTabs";
|
|
23
27
|
|
|
24
28
|
export const Domain = ({ hasChildren, domain, domainLoading }) => {
|
|
29
|
+
const ddAuthorized = useAuthorized("data_dictionary");
|
|
30
|
+
const dqAuthorized = useAuthorized("quality");
|
|
31
|
+
|
|
25
32
|
const actions = {
|
|
26
33
|
create: {
|
|
27
34
|
order: 1,
|
|
@@ -40,8 +47,8 @@ export const Domain = ({ hasChildren, domain, domainLoading }) => {
|
|
|
40
47
|
<Segment attached="bottom">
|
|
41
48
|
<Switch>
|
|
42
49
|
<Route
|
|
43
|
-
path={DOMAIN}
|
|
44
50
|
exact
|
|
51
|
+
path={DOMAIN}
|
|
45
52
|
render={() => (
|
|
46
53
|
<>
|
|
47
54
|
{hasChildren && <DomainSearch />}
|
|
@@ -51,19 +58,28 @@ export const Domain = ({ hasChildren, domain, domainLoading }) => {
|
|
|
51
58
|
)}
|
|
52
59
|
/>
|
|
53
60
|
<Route
|
|
61
|
+
exact
|
|
54
62
|
path={DOMAIN_MEMBERS}
|
|
55
63
|
render={() => <DomainMembers />}
|
|
56
|
-
exact
|
|
57
64
|
/>
|
|
58
65
|
<Route
|
|
66
|
+
exact
|
|
59
67
|
path={DOMAIN_CONCEPTS}
|
|
60
68
|
render={() => <DomainConcepts />}
|
|
61
|
-
exact
|
|
62
69
|
/>
|
|
63
70
|
<Route
|
|
71
|
+
exact
|
|
64
72
|
path={DOMAIN_STRUCTURES}
|
|
65
|
-
render={() =>
|
|
73
|
+
render={() =>
|
|
74
|
+
ddAuthorized ? <DomainStructures /> : <Unauthorized />
|
|
75
|
+
}
|
|
76
|
+
/>
|
|
77
|
+
<Route
|
|
66
78
|
exact
|
|
79
|
+
path={DOMAIN_IMPLEMENTATIONS}
|
|
80
|
+
render={() =>
|
|
81
|
+
dqAuthorized ? <DomainImplementations /> : <Unauthorized />
|
|
82
|
+
}
|
|
67
83
|
/>
|
|
68
84
|
</Switch>
|
|
69
85
|
</Segment>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { connect } from "react-redux";
|
|
4
|
+
|
|
5
|
+
const ImplementationFiltersLoader = React.lazy(() =>
|
|
6
|
+
import("@truedat/dq/components/ImplementationFiltersLoader")
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
const ImplementationsLoader = React.lazy(() =>
|
|
10
|
+
import("@truedat/dq/components/RuleImplementationsLoader")
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const ImplementationSearchResults = React.lazy(() =>
|
|
14
|
+
import("@truedat/dq/components/ImplementationSearchResults")
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const DomainImplementations = ({ domain = {} }) => {
|
|
18
|
+
const defaultFilters = {
|
|
19
|
+
taxonomy: [domain.id],
|
|
20
|
+
status: ["published"],
|
|
21
|
+
};
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<ImplementationFiltersLoader defaultFilters={defaultFilters} />
|
|
25
|
+
<ImplementationsLoader defaultFilters={defaultFilters} />
|
|
26
|
+
<ImplementationSearchResults embedded />
|
|
27
|
+
</>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
DomainImplementations.propTypes = {
|
|
32
|
+
domain: PropTypes.object.isRequired,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const mapStateToProps = ({ domain }) => ({ domain });
|
|
36
|
+
|
|
37
|
+
export default connect(mapStateToProps)(DomainImplementations);
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
DOMAINS_NEW,
|
|
10
10
|
DOMAINS_SEARCH,
|
|
11
11
|
DOMAIN_EDIT,
|
|
12
|
+
DOMAIN_IMPLEMENTATIONS,
|
|
12
13
|
DOMAIN_MEMBERS,
|
|
13
14
|
DOMAIN_MEMBERS_NEW,
|
|
14
15
|
DOMAIN_NEW,
|
|
@@ -33,6 +34,7 @@ const DomainRoutes = () => (
|
|
|
33
34
|
<Route component={DomainMembersLoader} />
|
|
34
35
|
<Route exact path={DOMAIN} component={Domain} />
|
|
35
36
|
<Route exact path={DOMAIN_CONCEPTS} component={Domain} />
|
|
37
|
+
<Route exact path={DOMAIN_IMPLEMENTATIONS} component={Domain} />
|
|
36
38
|
<Route exact path={DOMAIN_STRUCTURES} component={Domain} />
|
|
37
39
|
<Route exact path={DOMAIN_MEMBERS} component={Domain} />
|
|
38
40
|
<Route exact path={DOMAIN_EDIT} render={() => <EditDomain />} />
|
|
@@ -5,10 +5,11 @@ import { FormattedMessage } from "react-intl";
|
|
|
5
5
|
import { connect } from "react-redux";
|
|
6
6
|
import { Link } from "react-router-dom";
|
|
7
7
|
import { Menu } from "semantic-ui-react";
|
|
8
|
-
import { usePath } from "@truedat/core/hooks";
|
|
8
|
+
import { useAuthorized, usePath } from "@truedat/core/hooks";
|
|
9
9
|
import {
|
|
10
10
|
DOMAIN,
|
|
11
11
|
DOMAIN_CONCEPTS,
|
|
12
|
+
DOMAIN_IMPLEMENTATIONS,
|
|
12
13
|
DOMAIN_MEMBERS,
|
|
13
14
|
DOMAIN_STRUCTURES,
|
|
14
15
|
linkTo,
|
|
@@ -16,6 +17,8 @@ import {
|
|
|
16
17
|
|
|
17
18
|
const DomainTabs = ({ domain }) => {
|
|
18
19
|
const path = usePath();
|
|
20
|
+
const ddAuthorized = useAuthorized("data_dictionary");
|
|
21
|
+
const dqAuthorized = useAuthorized("quality");
|
|
19
22
|
const id = domain?.id;
|
|
20
23
|
return (
|
|
21
24
|
<Menu attached="top" pointing secondary tabular>
|
|
@@ -43,15 +46,26 @@ const DomainTabs = ({ domain }) => {
|
|
|
43
46
|
>
|
|
44
47
|
<FormattedMessage id="tabs.concepts" />
|
|
45
48
|
</Menu.Item>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
{ddAuthorized ? (
|
|
50
|
+
<Menu.Item
|
|
51
|
+
active={path === DOMAIN_STRUCTURES}
|
|
52
|
+
as={Link}
|
|
53
|
+
to={linkTo.DOMAIN_STRUCTURES({ id })}
|
|
54
|
+
replace
|
|
55
|
+
>
|
|
56
|
+
<FormattedMessage id="tabs.structures" />
|
|
57
|
+
</Menu.Item>
|
|
58
|
+
) : null}
|
|
59
|
+
{dqAuthorized ? (
|
|
60
|
+
<Menu.Item
|
|
61
|
+
active={path === DOMAIN_IMPLEMENTATIONS}
|
|
62
|
+
as={Link}
|
|
63
|
+
to={linkTo.DOMAIN_IMPLEMENTATIONS({ id })}
|
|
64
|
+
replace
|
|
65
|
+
>
|
|
66
|
+
<FormattedMessage id="tabs.implementations" />
|
|
67
|
+
</Menu.Item>
|
|
68
|
+
) : null}
|
|
55
69
|
</Menu>
|
|
56
70
|
);
|
|
57
71
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import Domain from "../Domain";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
jest.mock("@truedat/core/hooks", () => ({
|
|
6
|
+
useAuthorized: jest.fn(() => true),
|
|
7
|
+
usePath: jest.fn(() => "/domains/:id"),
|
|
8
|
+
}));
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
describe("<Domain />", () => {
|
|
11
|
+
const renderOpts = {
|
|
12
|
+
state: {
|
|
13
|
+
domainLoading: false,
|
|
14
|
+
domain: { id: 3, name: "DOMAIN NAME" },
|
|
15
|
+
},
|
|
16
|
+
};
|
|
14
17
|
|
|
15
|
-
it("matches the latest snapshot
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const wrapper = shallow(<Domain {...props} />);
|
|
19
|
-
expect(wrapper).toMatchSnapshot();
|
|
18
|
+
it("matches the latest snapshot", () => {
|
|
19
|
+
const { container } = render(<Domain />, renderOpts);
|
|
20
|
+
expect(container).toMatchSnapshot();
|
|
20
21
|
});
|
|
21
22
|
});
|
|
@@ -1,73 +1,96 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`<Domain /> matches the latest snapshot
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
exports[`<Domain /> matches the latest snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui breadcrumb"
|
|
7
|
+
>
|
|
8
|
+
<a
|
|
9
|
+
class="section"
|
|
10
|
+
href="/domains"
|
|
11
11
|
>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
12
|
+
Taxonomy
|
|
13
|
+
</a>
|
|
14
|
+
<i
|
|
15
|
+
aria-hidden="true"
|
|
16
|
+
class="right angle icon divider"
|
|
17
|
+
/>
|
|
18
|
+
<div
|
|
19
|
+
class="active section"
|
|
20
|
+
>
|
|
21
|
+
DOMAIN NAME
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div
|
|
25
|
+
class="ui segment"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
class="ui grid"
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
class="eight wide column"
|
|
32
|
+
>
|
|
33
|
+
<h2
|
|
34
|
+
class="ui header"
|
|
35
|
+
>
|
|
36
|
+
<i
|
|
37
|
+
aria-hidden="true"
|
|
38
|
+
class="cube icon"
|
|
39
|
+
/>
|
|
40
|
+
<div
|
|
41
|
+
class="content"
|
|
42
|
+
>
|
|
43
|
+
DOMAIN NAME
|
|
44
|
+
<div
|
|
45
|
+
class="sub header"
|
|
46
|
+
>
|
|
47
|
+
Domain
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</h2>
|
|
51
|
+
</div>
|
|
52
|
+
<div
|
|
53
|
+
class="right aligned eight wide column"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
<p />
|
|
57
|
+
<div
|
|
58
|
+
class="ui pointing secondary top attached tabular menu"
|
|
47
59
|
>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
60
|
+
<a
|
|
61
|
+
class="active item"
|
|
62
|
+
href="/domains/3"
|
|
63
|
+
>
|
|
64
|
+
Subdomains
|
|
65
|
+
</a>
|
|
66
|
+
<a
|
|
67
|
+
class="item"
|
|
68
|
+
href="/domains/3/members"
|
|
69
|
+
>
|
|
70
|
+
Members
|
|
71
|
+
</a>
|
|
72
|
+
<a
|
|
73
|
+
class="item"
|
|
74
|
+
href="/domains/3/concepts"
|
|
75
|
+
>
|
|
76
|
+
Concepts
|
|
77
|
+
</a>
|
|
78
|
+
<a
|
|
79
|
+
class="item"
|
|
80
|
+
href="/domains/3/structures"
|
|
81
|
+
>
|
|
82
|
+
Structures
|
|
83
|
+
</a>
|
|
84
|
+
<a
|
|
85
|
+
class="item"
|
|
86
|
+
href="/domains/3/implementations"
|
|
87
|
+
>
|
|
88
|
+
Data Quality
|
|
89
|
+
</a>
|
|
90
|
+
</div>
|
|
91
|
+
<div
|
|
92
|
+
class="ui bottom attached segment"
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
73
96
|
`;
|