@truedat/bg 6.13.4 → 6.13.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 +5 -5
- package/src/messages/en.js +0 -1
- package/src/messages/es.js +0 -1
- package/src/taxonomy/components/Domain.js +65 -67
- package/src/taxonomy/components/DomainCards.js +97 -0
- package/src/taxonomy/components/DomainDetail.js +0 -7
- package/src/taxonomy/components/DomainTabs.js +10 -0
- package/src/taxonomy/components/Domains.js +2 -2
- package/src/taxonomy/components/DomainsActions.js +4 -2
- package/src/taxonomy/components/__tests__/Domain.spec.js +1 -1
- package/src/taxonomy/components/__tests__/DomainCards.spec.js +30 -0
- package/src/taxonomy/components/__tests__/__snapshots__/Domain.spec.js.snap +68 -137
- package/src/taxonomy/components/__tests__/__snapshots__/DomainCards.spec.js.snap +160 -0
- package/src/taxonomy/components/__tests__/__snapshots__/DomainDetail.spec.js.snap +0 -7
- package/src/taxonomy/components/__tests__/__snapshots__/Domains.spec.js.snap +9 -1
- package/src/taxonomy/components/__tests__/__snapshots__/DomainsActions.spec.js.snap +5 -1
- package/src/hooks/useDomains.js +0 -12
- package/src/taxonomy/components/DomainBranches.js +0 -28
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/bg",
|
|
3
|
-
"version": "6.13.
|
|
3
|
+
"version": "6.13.6",
|
|
4
4
|
"description": "Truedat Web Business Glossary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@truedat/core": "6.13.
|
|
90
|
-
"@truedat/df": "6.13.
|
|
91
|
-
"@truedat/lm": "6.13.
|
|
89
|
+
"@truedat/core": "6.13.6",
|
|
90
|
+
"@truedat/df": "6.13.6",
|
|
91
|
+
"@truedat/lm": "6.13.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": "3e5fdfd0487864d1ffe38f8ede69d3076ba1ed6f"
|
|
115
115
|
}
|
package/src/messages/en.js
CHANGED
|
@@ -284,7 +284,6 @@ export default {
|
|
|
284
284
|
"domain.selector.placeholder": "Select a domain...",
|
|
285
285
|
"domains.actions.create": "New Domain",
|
|
286
286
|
"domains.search.placeholder": "Search domains...",
|
|
287
|
-
"domains.search.error.fields": "Search fields not valid",
|
|
288
287
|
"domains.search.results.count": "{count} domains found:",
|
|
289
288
|
"domains.search.results.empty": "No domains found",
|
|
290
289
|
"domains.subheader": "Manage governance structure and data domains",
|
package/src/messages/es.js
CHANGED
|
@@ -287,7 +287,6 @@ export default {
|
|
|
287
287
|
"domain.selector.placeholder": "Selecciona un dominio...",
|
|
288
288
|
"domains.actions.create": "Nuevo dominio",
|
|
289
289
|
"domains.search.placeholder": "Buscar dominios...",
|
|
290
|
-
"domains.search.error.fields": "Campos de búsqueda no válidos",
|
|
291
290
|
"domains.search.results.count": "{count} dominios encontrados:",
|
|
292
291
|
"domains.search.results.empty": "Ningún dominio encontrado",
|
|
293
292
|
"domains.subheader":
|
|
@@ -2,11 +2,12 @@ import _ from "lodash/fp";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { connect } from "react-redux";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Route, Switch } from "react-router-dom";
|
|
6
|
+
import { Segment } from "semantic-ui-react";
|
|
7
7
|
import { Unauthorized } from "@truedat/core/components";
|
|
8
8
|
import { useAuthorized } from "@truedat/core/hooks";
|
|
9
9
|
import {
|
|
10
|
+
DOMAIN,
|
|
10
11
|
DOMAIN_CONCEPTS,
|
|
11
12
|
DOMAIN_IMPLEMENTATIONS,
|
|
12
13
|
DOMAIN_MEMBERS,
|
|
@@ -14,92 +15,89 @@ import {
|
|
|
14
15
|
linkTo,
|
|
15
16
|
} from "@truedat/core/routes";
|
|
16
17
|
import UserSearchFiltersLoader from "@truedat/dd/components/UserSearchFiltersLoader";
|
|
17
|
-
import { BranchViewer } from "@truedat/core/components/";
|
|
18
18
|
import DomainConcepts from "../../concepts/components/DomainConcepts";
|
|
19
|
-
import
|
|
19
|
+
import DomainActions from "./DomainActions";
|
|
20
|
+
import DomainCards from "./DomainCards";
|
|
20
21
|
import DomainCrumbs from "./DomainCrumbs";
|
|
21
22
|
import DomainDetail from "./DomainDetail";
|
|
22
23
|
import DomainImplementations from "./DomainImplementations";
|
|
23
24
|
import DomainMembers from "./DomainMembers";
|
|
25
|
+
import DomainSearch from "./DomainSearch";
|
|
24
26
|
import DomainStructures from "./DomainStructures";
|
|
25
27
|
import DomainTabs from "./DomainTabs";
|
|
26
28
|
|
|
27
|
-
export const Domain = ({ domain, domainLoading }) => {
|
|
29
|
+
export const Domain = ({ hasChildren, domain, domainLoading }) => {
|
|
28
30
|
const ddAuthorized = useAuthorized("data_dictionary");
|
|
29
31
|
const dqAuthorized = useAuthorized("quality");
|
|
30
|
-
const history = useHistory();
|
|
31
|
-
const { data: domains } = useDomains();
|
|
32
32
|
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const actions = {
|
|
34
|
+
create: {
|
|
35
|
+
order: 1,
|
|
36
|
+
icon: "cube",
|
|
37
|
+
messageId: "domain.actions.create",
|
|
38
|
+
action: (id) => linkTo.DOMAIN_NEW({ id }),
|
|
39
|
+
},
|
|
35
40
|
};
|
|
36
41
|
|
|
37
42
|
return domainLoading ? null : domain && domain.id ? (
|
|
38
43
|
<>
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
<DomainCrumbs />
|
|
45
|
+
<Segment>
|
|
46
|
+
<DomainDetail />
|
|
47
|
+
<DomainTabs />
|
|
48
|
+
<Segment attached="bottom">
|
|
49
|
+
<Switch>
|
|
50
|
+
<Route
|
|
51
|
+
exact
|
|
52
|
+
path={DOMAIN}
|
|
53
|
+
render={() => (
|
|
54
|
+
<>
|
|
55
|
+
{hasChildren && <DomainSearch />}
|
|
56
|
+
<DomainActions availableActions={actions} />
|
|
57
|
+
<DomainCards />
|
|
58
|
+
</>
|
|
59
|
+
)}
|
|
51
60
|
/>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
/>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
) : (
|
|
87
|
-
<Unauthorized />
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
/>
|
|
91
|
-
</Switch>
|
|
92
|
-
</Segment>
|
|
93
|
-
</Segment>
|
|
94
|
-
</>
|
|
95
|
-
</Grid.Column>
|
|
96
|
-
</Grid.Row>
|
|
97
|
-
</Grid>
|
|
61
|
+
<Route
|
|
62
|
+
exact
|
|
63
|
+
path={DOMAIN_MEMBERS}
|
|
64
|
+
render={() => <DomainMembers />}
|
|
65
|
+
/>
|
|
66
|
+
<Route
|
|
67
|
+
exact
|
|
68
|
+
path={DOMAIN_CONCEPTS}
|
|
69
|
+
render={() => <DomainConcepts />}
|
|
70
|
+
/>
|
|
71
|
+
<Route
|
|
72
|
+
exact
|
|
73
|
+
path={DOMAIN_STRUCTURES}
|
|
74
|
+
render={() =>
|
|
75
|
+
ddAuthorized ? <DomainStructures /> : <Unauthorized />
|
|
76
|
+
}
|
|
77
|
+
/>
|
|
78
|
+
<Route
|
|
79
|
+
exact
|
|
80
|
+
path={DOMAIN_IMPLEMENTATIONS}
|
|
81
|
+
render={() =>
|
|
82
|
+
dqAuthorized ? (
|
|
83
|
+
<>
|
|
84
|
+
<UserSearchFiltersLoader scope="rule_implementation" />
|
|
85
|
+
<DomainImplementations />
|
|
86
|
+
</>
|
|
87
|
+
) : (
|
|
88
|
+
<Unauthorized />
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
/>
|
|
92
|
+
</Switch>
|
|
93
|
+
</Segment>
|
|
94
|
+
</Segment>
|
|
98
95
|
</>
|
|
99
96
|
) : null;
|
|
100
97
|
};
|
|
101
98
|
|
|
102
99
|
Domain.propTypes = {
|
|
100
|
+
hasChildren: PropTypes.bool,
|
|
103
101
|
domain: PropTypes.object,
|
|
104
102
|
domainLoading: PropTypes.bool,
|
|
105
103
|
};
|
|
@@ -0,0 +1,97 @@
|
|
|
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 { Card, Header, Icon, Message, Divider } from "semantic-ui-react";
|
|
6
|
+
import { connect } from "react-redux";
|
|
7
|
+
import { FormattedMessage, useIntl } from "react-intl";
|
|
8
|
+
import { linkTo } from "@truedat/core/routes";
|
|
9
|
+
import { getVisibleDomains } from "../selectors";
|
|
10
|
+
|
|
11
|
+
export const DomainCard = ({
|
|
12
|
+
id,
|
|
13
|
+
name,
|
|
14
|
+
type,
|
|
15
|
+
description,
|
|
16
|
+
childCount,
|
|
17
|
+
domain_group
|
|
18
|
+
}) => (
|
|
19
|
+
<Card key={id} link as={Link} to={linkTo.DOMAIN({ id })}>
|
|
20
|
+
<Card.Content>
|
|
21
|
+
<Card.Header>
|
|
22
|
+
<Icon name="cube" />
|
|
23
|
+
{name}
|
|
24
|
+
</Card.Header>
|
|
25
|
+
<Card.Meta>
|
|
26
|
+
{_.get("name")(domain_group) && (
|
|
27
|
+
<>
|
|
28
|
+
<Icon name="object group" /> {_.get("name")(domain_group)}
|
|
29
|
+
<br />
|
|
30
|
+
</>
|
|
31
|
+
)}
|
|
32
|
+
<span>{type || <FormattedMessage id="domain" />}</span>
|
|
33
|
+
</Card.Meta>
|
|
34
|
+
</Card.Content>
|
|
35
|
+
<Card.Content description={description} />
|
|
36
|
+
<Card.Content extra>
|
|
37
|
+
<Icon name="cubes" />
|
|
38
|
+
<FormattedMessage
|
|
39
|
+
id="domain.props.children"
|
|
40
|
+
values={{ count: childCount }}
|
|
41
|
+
/>
|
|
42
|
+
</Card.Content>
|
|
43
|
+
</Card>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
DomainCard.propTypes = {
|
|
47
|
+
id: PropTypes.number,
|
|
48
|
+
name: PropTypes.string,
|
|
49
|
+
type: PropTypes.string,
|
|
50
|
+
childCount: PropTypes.number,
|
|
51
|
+
description: PropTypes.string,
|
|
52
|
+
domain_group: PropTypes.object
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const DomainCards = ({ visibleDomains, domainsFilter, domain }) => {
|
|
56
|
+
const { formatMessage } = useIntl();
|
|
57
|
+
return (
|
|
58
|
+
<>
|
|
59
|
+
<Divider hidden />
|
|
60
|
+
{domainsFilter && (
|
|
61
|
+
<Header as="h4">
|
|
62
|
+
<Icon name="search" />
|
|
63
|
+
<Header.Content>
|
|
64
|
+
{visibleDomains.length == 0 && (
|
|
65
|
+
<FormattedMessage id="domains.search.results.empty" />
|
|
66
|
+
)}
|
|
67
|
+
{visibleDomains.length > 0 && (
|
|
68
|
+
<FormattedMessage
|
|
69
|
+
id="domains.search.results.count"
|
|
70
|
+
values={{ count: visibleDomains.length }}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
73
|
+
</Header.Content>
|
|
74
|
+
</Header>
|
|
75
|
+
)}
|
|
76
|
+
{_.isEmpty(visibleDomains) && domain && domain.id && (
|
|
77
|
+
<Message header={formatMessage({ id: "domain.children.empty" })} />
|
|
78
|
+
)}
|
|
79
|
+
<Card.Group>{visibleDomains.map(DomainCard)}</Card.Group>
|
|
80
|
+
</>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
DomainCards.propTypes = {
|
|
85
|
+
visibleDomains: PropTypes.array,
|
|
86
|
+
domainsFilter: PropTypes.string,
|
|
87
|
+
domain: PropTypes.object
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const mapStateToProps = state => ({
|
|
91
|
+
visibleDomains: getVisibleDomains(state),
|
|
92
|
+
domainsLoading: state.domainsLoading,
|
|
93
|
+
domainsFilter: state.domainsFilter,
|
|
94
|
+
domain: state.domain
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export default connect(mapStateToProps)(DomainCards);
|
|
@@ -10,13 +10,6 @@ import DomainActions from "./DomainActions";
|
|
|
10
10
|
|
|
11
11
|
export const DomainDetail = ({ type, name, description, domain_group }) => {
|
|
12
12
|
const available_actions = {
|
|
13
|
-
create: {
|
|
14
|
-
order: 1,
|
|
15
|
-
icon: "cube",
|
|
16
|
-
messageId: "domain.actions.create",
|
|
17
|
-
action: (id) => linkTo.DOMAIN_NEW({ id }),
|
|
18
|
-
floated: null,
|
|
19
|
-
},
|
|
20
13
|
update: {
|
|
21
14
|
order: 2,
|
|
22
15
|
icon: "edit",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import PropTypes from "prop-types";
|
|
3
4
|
import { FormattedMessage } from "react-intl";
|
|
@@ -6,6 +7,7 @@ import { Link } from "react-router-dom";
|
|
|
6
7
|
import { Menu } from "semantic-ui-react";
|
|
7
8
|
import { useAuthorized, usePath } from "@truedat/core/hooks";
|
|
8
9
|
import {
|
|
10
|
+
DOMAIN,
|
|
9
11
|
DOMAIN_CONCEPTS,
|
|
10
12
|
DOMAIN_IMPLEMENTATIONS,
|
|
11
13
|
DOMAIN_MEMBERS,
|
|
@@ -20,6 +22,14 @@ const DomainTabs = ({ domain }) => {
|
|
|
20
22
|
const id = domain?.id;
|
|
21
23
|
return (
|
|
22
24
|
<Menu attached="top" pointing secondary tabular>
|
|
25
|
+
<Menu.Item
|
|
26
|
+
active={path === DOMAIN}
|
|
27
|
+
as={Link}
|
|
28
|
+
to={linkTo.DOMAIN(domain)}
|
|
29
|
+
replace
|
|
30
|
+
>
|
|
31
|
+
<FormattedMessage id="tabs.subdomains" />
|
|
32
|
+
</Menu.Item>
|
|
23
33
|
<Menu.Item
|
|
24
34
|
active={path === DOMAIN_MEMBERS}
|
|
25
35
|
as={Link}
|
|
@@ -6,7 +6,7 @@ import { Route, Switch } from "react-router-dom";
|
|
|
6
6
|
import { Header, Icon, Segment } from "semantic-ui-react";
|
|
7
7
|
import { DOMAINS, DOMAINS_NEW } from "@truedat/core/routes";
|
|
8
8
|
import { createDomain } from "../routines";
|
|
9
|
-
import
|
|
9
|
+
import DomainCards from "./DomainCards";
|
|
10
10
|
import DomainForm from "./DomainForm";
|
|
11
11
|
import DomainsActions from "./DomainsActions";
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ export const Domains = ({ domainsLoading, createDomain }) => (
|
|
|
24
24
|
<Segment attached="bottom" loading={domainsLoading}>
|
|
25
25
|
<DomainsActions />
|
|
26
26
|
<Switch>
|
|
27
|
-
<Route path={DOMAINS} component={
|
|
27
|
+
<Route path={DOMAINS} component={DomainCards} exact />
|
|
28
28
|
<Route
|
|
29
29
|
exact
|
|
30
30
|
path={DOMAINS_NEW}
|
|
@@ -6,11 +6,13 @@ import { connect } from "react-redux";
|
|
|
6
6
|
import { Link } from "react-router-dom";
|
|
7
7
|
import { Button } from "semantic-ui-react";
|
|
8
8
|
import { DOMAINS_NEW } from "@truedat/core/routes";
|
|
9
|
+
import DomainSearch from "./DomainSearch";
|
|
9
10
|
|
|
10
11
|
export const DomainsActions = ({ createUrl }) => {
|
|
11
12
|
const { formatMessage } = useIntl();
|
|
12
13
|
return (
|
|
13
14
|
<>
|
|
15
|
+
<DomainSearch />
|
|
14
16
|
{createUrl && (
|
|
15
17
|
<Button
|
|
16
18
|
floated="right"
|
|
@@ -26,14 +28,14 @@ export const DomainsActions = ({ createUrl }) => {
|
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
DomainsActions.propTypes = {
|
|
29
|
-
createUrl: PropTypes.string
|
|
31
|
+
createUrl: PropTypes.string
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
const mapStateToProps = ({ domainsActions }) => ({
|
|
33
35
|
createUrl:
|
|
34
36
|
!_.isEmpty(domainsActions) && _.has("create")(domainsActions)
|
|
35
37
|
? DOMAINS_NEW
|
|
36
|
-
: undefined
|
|
38
|
+
: undefined
|
|
37
39
|
});
|
|
38
40
|
|
|
39
41
|
export default connect(mapStateToProps)(DomainsActions);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { shallow } from "enzyme";
|
|
3
|
+
import { intl } from "@truedat/test/intl-stub";
|
|
4
|
+
import { DomainCards } from "../DomainCards";
|
|
5
|
+
|
|
6
|
+
// workaround for enzyme issue with React.useContext
|
|
7
|
+
// see https://github.com/airbnb/enzyme/issues/2176#issuecomment-532361526
|
|
8
|
+
jest.spyOn(React, "useContext").mockImplementation(() => intl);
|
|
9
|
+
|
|
10
|
+
describe("<DomainCards />", () => {
|
|
11
|
+
const domainsFilter = "d";
|
|
12
|
+
|
|
13
|
+
it("matches the latest snapshot", () => {
|
|
14
|
+
const visibleDomains = [
|
|
15
|
+
{ id: 1, name: "domain1" },
|
|
16
|
+
{ id: 2, name: "domain2" }
|
|
17
|
+
];
|
|
18
|
+
const props = { visibleDomains, domainsFilter };
|
|
19
|
+
const wrapper = shallow(<DomainCards {...props} />);
|
|
20
|
+
expect(wrapper).toMatchSnapshot();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("matches the latest snapshot (no subdomains)", () => {
|
|
24
|
+
const domain = { id: 1 };
|
|
25
|
+
const visibleDomains = [];
|
|
26
|
+
const props = { domain, visibleDomains, domainsFilter };
|
|
27
|
+
const wrapper = shallow(<DomainCards {...props} />);
|
|
28
|
+
expect(wrapper).toMatchSnapshot();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -3,163 +3,94 @@
|
|
|
3
3
|
exports[`<Domain /> matches the latest snapshot 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<div
|
|
6
|
-
class="ui
|
|
6
|
+
class="ui breadcrumb"
|
|
7
|
+
>
|
|
8
|
+
<a
|
|
9
|
+
class="section"
|
|
10
|
+
href="/domains"
|
|
11
|
+
>
|
|
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"
|
|
7
26
|
>
|
|
8
27
|
<div
|
|
9
|
-
class="
|
|
28
|
+
class="ui grid"
|
|
10
29
|
>
|
|
11
30
|
<div
|
|
12
|
-
class="
|
|
31
|
+
class="eight wide column"
|
|
13
32
|
>
|
|
14
|
-
<
|
|
15
|
-
class="ui
|
|
33
|
+
<h2
|
|
34
|
+
class="ui header"
|
|
16
35
|
>
|
|
17
|
-
<a
|
|
18
|
-
class="section"
|
|
19
|
-
href="/domains"
|
|
20
|
-
>
|
|
21
|
-
Taxonomy
|
|
22
|
-
</a>
|
|
23
36
|
<i
|
|
24
37
|
aria-hidden="true"
|
|
25
|
-
class="
|
|
38
|
+
class="cube icon"
|
|
26
39
|
/>
|
|
27
40
|
<div
|
|
28
|
-
class="
|
|
41
|
+
class="content"
|
|
29
42
|
>
|
|
30
43
|
DOMAIN NAME
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
<div
|
|
36
|
-
class="row"
|
|
37
|
-
>
|
|
38
|
-
<div
|
|
39
|
-
class="four wide column"
|
|
40
|
-
>
|
|
41
|
-
<div
|
|
42
|
-
class="ui segment"
|
|
43
|
-
style="overflow: auto;"
|
|
44
|
-
>
|
|
45
|
-
<div
|
|
46
|
-
class="ui grid"
|
|
47
|
-
>
|
|
48
44
|
<div
|
|
49
|
-
class="
|
|
45
|
+
class="sub header"
|
|
50
46
|
>
|
|
51
|
-
|
|
52
|
-
class="sixteen wide column"
|
|
53
|
-
>
|
|
54
|
-
<div
|
|
55
|
-
class="ui icon input searchbox"
|
|
56
|
-
>
|
|
57
|
-
<input
|
|
58
|
-
placeholder="Search"
|
|
59
|
-
type="text"
|
|
60
|
-
value=""
|
|
61
|
-
/>
|
|
62
|
-
<i
|
|
63
|
-
aria-hidden="true"
|
|
64
|
-
class="search link icon"
|
|
65
|
-
/>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
<div
|
|
70
|
-
class="row"
|
|
71
|
-
>
|
|
72
|
-
<div
|
|
73
|
-
class="sixteen wide column"
|
|
74
|
-
>
|
|
75
|
-
<h4
|
|
76
|
-
class="ui header"
|
|
77
|
-
>
|
|
78
|
-
<i
|
|
79
|
-
aria-hidden="true"
|
|
80
|
-
class="cube icon"
|
|
81
|
-
/>
|
|
82
|
-
<div
|
|
83
|
-
class="content"
|
|
84
|
-
>
|
|
85
|
-
There are no domains
|
|
86
|
-
</div>
|
|
87
|
-
</h4>
|
|
88
|
-
</div>
|
|
47
|
+
Domain
|
|
89
48
|
</div>
|
|
90
49
|
</div>
|
|
91
|
-
</
|
|
50
|
+
</h2>
|
|
92
51
|
</div>
|
|
93
52
|
<div
|
|
94
|
-
class="
|
|
53
|
+
class="right aligned eight wide column"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
<p />
|
|
57
|
+
<div
|
|
58
|
+
class="ui pointing secondary top attached tabular menu"
|
|
59
|
+
>
|
|
60
|
+
<a
|
|
61
|
+
class="active item"
|
|
62
|
+
href="/domains/3"
|
|
95
63
|
>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</h2>
|
|
123
|
-
</div>
|
|
124
|
-
<div
|
|
125
|
-
class="right aligned eight wide column"
|
|
126
|
-
/>
|
|
127
|
-
</div>
|
|
128
|
-
<p />
|
|
129
|
-
<div
|
|
130
|
-
class="ui pointing secondary top attached tabular menu"
|
|
131
|
-
>
|
|
132
|
-
<a
|
|
133
|
-
class="active item"
|
|
134
|
-
href="/domains/3/members"
|
|
135
|
-
>
|
|
136
|
-
Members
|
|
137
|
-
</a>
|
|
138
|
-
<a
|
|
139
|
-
class="item"
|
|
140
|
-
href="/domains/3/concepts"
|
|
141
|
-
>
|
|
142
|
-
Concepts
|
|
143
|
-
</a>
|
|
144
|
-
<a
|
|
145
|
-
class="item"
|
|
146
|
-
href="/domains/3/structures"
|
|
147
|
-
>
|
|
148
|
-
Structures
|
|
149
|
-
</a>
|
|
150
|
-
<a
|
|
151
|
-
class="item"
|
|
152
|
-
href="/domains/3/implementations"
|
|
153
|
-
>
|
|
154
|
-
Data Quality
|
|
155
|
-
</a>
|
|
156
|
-
</div>
|
|
157
|
-
<div
|
|
158
|
-
class="ui bottom attached segment"
|
|
159
|
-
/>
|
|
160
|
-
</div>
|
|
161
|
-
</div>
|
|
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>
|
|
162
90
|
</div>
|
|
91
|
+
<div
|
|
92
|
+
class="ui bottom attached segment"
|
|
93
|
+
/>
|
|
163
94
|
</div>
|
|
164
95
|
</div>
|
|
165
96
|
`;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<DomainCards /> matches the latest snapshot (no subdomains) 1`] = `
|
|
4
|
+
<Fragment>
|
|
5
|
+
<Divider
|
|
6
|
+
hidden={true}
|
|
7
|
+
/>
|
|
8
|
+
<Header
|
|
9
|
+
as="h4"
|
|
10
|
+
>
|
|
11
|
+
<Icon
|
|
12
|
+
as="i"
|
|
13
|
+
name="search"
|
|
14
|
+
/>
|
|
15
|
+
<HeaderContent>
|
|
16
|
+
<MemoizedFormattedMessage
|
|
17
|
+
id="domains.search.results.empty"
|
|
18
|
+
/>
|
|
19
|
+
</HeaderContent>
|
|
20
|
+
</Header>
|
|
21
|
+
<Message
|
|
22
|
+
header="domain.children.empty"
|
|
23
|
+
/>
|
|
24
|
+
<CardGroup />
|
|
25
|
+
</Fragment>
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
exports[`<DomainCards /> matches the latest snapshot 1`] = `
|
|
29
|
+
<Fragment>
|
|
30
|
+
<Divider
|
|
31
|
+
hidden={true}
|
|
32
|
+
/>
|
|
33
|
+
<Header
|
|
34
|
+
as="h4"
|
|
35
|
+
>
|
|
36
|
+
<Icon
|
|
37
|
+
as="i"
|
|
38
|
+
name="search"
|
|
39
|
+
/>
|
|
40
|
+
<HeaderContent>
|
|
41
|
+
<MemoizedFormattedMessage
|
|
42
|
+
id="domains.search.results.count"
|
|
43
|
+
values={
|
|
44
|
+
{
|
|
45
|
+
"count": 2,
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
49
|
+
</HeaderContent>
|
|
50
|
+
</Header>
|
|
51
|
+
<CardGroup>
|
|
52
|
+
<Card
|
|
53
|
+
as={
|
|
54
|
+
{
|
|
55
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
56
|
+
"displayName": "Link",
|
|
57
|
+
"propTypes": {
|
|
58
|
+
"innerRef": [Function],
|
|
59
|
+
"onClick": [Function],
|
|
60
|
+
"replace": [Function],
|
|
61
|
+
"target": [Function],
|
|
62
|
+
"to": [Function],
|
|
63
|
+
},
|
|
64
|
+
"render": [Function],
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
key="1"
|
|
68
|
+
link={true}
|
|
69
|
+
to="/domains/1"
|
|
70
|
+
>
|
|
71
|
+
<CardContent>
|
|
72
|
+
<CardHeader>
|
|
73
|
+
<Icon
|
|
74
|
+
as="i"
|
|
75
|
+
name="cube"
|
|
76
|
+
/>
|
|
77
|
+
domain1
|
|
78
|
+
</CardHeader>
|
|
79
|
+
<CardMeta>
|
|
80
|
+
<span>
|
|
81
|
+
<MemoizedFormattedMessage
|
|
82
|
+
id="domain"
|
|
83
|
+
/>
|
|
84
|
+
</span>
|
|
85
|
+
</CardMeta>
|
|
86
|
+
</CardContent>
|
|
87
|
+
<CardContent />
|
|
88
|
+
<CardContent
|
|
89
|
+
extra={true}
|
|
90
|
+
>
|
|
91
|
+
<Icon
|
|
92
|
+
as="i"
|
|
93
|
+
name="cubes"
|
|
94
|
+
/>
|
|
95
|
+
<MemoizedFormattedMessage
|
|
96
|
+
id="domain.props.children"
|
|
97
|
+
values={
|
|
98
|
+
{
|
|
99
|
+
"count": undefined,
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/>
|
|
103
|
+
</CardContent>
|
|
104
|
+
</Card>
|
|
105
|
+
<Card
|
|
106
|
+
as={
|
|
107
|
+
{
|
|
108
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
109
|
+
"displayName": "Link",
|
|
110
|
+
"propTypes": {
|
|
111
|
+
"innerRef": [Function],
|
|
112
|
+
"onClick": [Function],
|
|
113
|
+
"replace": [Function],
|
|
114
|
+
"target": [Function],
|
|
115
|
+
"to": [Function],
|
|
116
|
+
},
|
|
117
|
+
"render": [Function],
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
key="2"
|
|
121
|
+
link={true}
|
|
122
|
+
to="/domains/2"
|
|
123
|
+
>
|
|
124
|
+
<CardContent>
|
|
125
|
+
<CardHeader>
|
|
126
|
+
<Icon
|
|
127
|
+
as="i"
|
|
128
|
+
name="cube"
|
|
129
|
+
/>
|
|
130
|
+
domain2
|
|
131
|
+
</CardHeader>
|
|
132
|
+
<CardMeta>
|
|
133
|
+
<span>
|
|
134
|
+
<MemoizedFormattedMessage
|
|
135
|
+
id="domain"
|
|
136
|
+
/>
|
|
137
|
+
</span>
|
|
138
|
+
</CardMeta>
|
|
139
|
+
</CardContent>
|
|
140
|
+
<CardContent />
|
|
141
|
+
<CardContent
|
|
142
|
+
extra={true}
|
|
143
|
+
>
|
|
144
|
+
<Icon
|
|
145
|
+
as="i"
|
|
146
|
+
name="cubes"
|
|
147
|
+
/>
|
|
148
|
+
<MemoizedFormattedMessage
|
|
149
|
+
id="domain.props.children"
|
|
150
|
+
values={
|
|
151
|
+
{
|
|
152
|
+
"count": undefined,
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/>
|
|
156
|
+
</CardContent>
|
|
157
|
+
</Card>
|
|
158
|
+
</CardGroup>
|
|
159
|
+
</Fragment>
|
|
160
|
+
`;
|
|
@@ -28,13 +28,6 @@ exports[`<DomainDetail /> matches the latest snapshot 1`] = `
|
|
|
28
28
|
<Connect(DomainActions)
|
|
29
29
|
availableActions={
|
|
30
30
|
{
|
|
31
|
-
"create": {
|
|
32
|
-
"action": [Function],
|
|
33
|
-
"floated": null,
|
|
34
|
-
"icon": "cube",
|
|
35
|
-
"messageId": "domain.actions.create",
|
|
36
|
-
"order": 1,
|
|
37
|
-
},
|
|
38
31
|
"deleteOption": true,
|
|
39
32
|
"update": {
|
|
40
33
|
"action": [Function],
|
|
@@ -28,7 +28,15 @@ exports[`<Domains /> matches the latest snapshot 1`] = `
|
|
|
28
28
|
<Connect(DomainsActions) />
|
|
29
29
|
<Switch>
|
|
30
30
|
<Route
|
|
31
|
-
component={
|
|
31
|
+
component={
|
|
32
|
+
{
|
|
33
|
+
"$$typeof": Symbol(react.memo),
|
|
34
|
+
"WrappedComponent": [Function],
|
|
35
|
+
"compare": null,
|
|
36
|
+
"displayName": "Connect(DomainCards)",
|
|
37
|
+
"type": [Function],
|
|
38
|
+
}
|
|
39
|
+
}
|
|
32
40
|
exact={true}
|
|
33
41
|
path="/domains"
|
|
34
42
|
/>
|
package/src/hooks/useDomains.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
|
-
import { compile } from "path-to-regexp";
|
|
3
|
-
import useSWR from "swr";
|
|
4
|
-
import { apiJson } from "@truedat/core/services/api";
|
|
5
|
-
import { API_DOMAIN, API_DOMAINS } from "../taxonomy/api";
|
|
6
|
-
|
|
7
|
-
export const useDomains = () => {
|
|
8
|
-
const toApiPath = compile(API_DOMAINS, "api");
|
|
9
|
-
const url = toApiPath();
|
|
10
|
-
const { data, error } = useSWR(url, apiJson);
|
|
11
|
-
return { data: data?.data?.data, error, loading: !error && !data };
|
|
12
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { useHistory } from "react-router-dom";
|
|
4
|
-
import { Grid } from "semantic-ui-react";
|
|
5
|
-
import { linkTo } from "@truedat/core/routes";
|
|
6
|
-
import { BranchViewer } from "@truedat/core/components/";
|
|
7
|
-
import { useDomains } from "../../hooks/useDomains";
|
|
8
|
-
|
|
9
|
-
export default function DomainBranches() {
|
|
10
|
-
const { data: domains } = useDomains();
|
|
11
|
-
const history = useHistory();
|
|
12
|
-
|
|
13
|
-
const handleRedirect = (id) => {
|
|
14
|
-
history.push(linkTo.DOMAIN_MEMBERS({ id }));
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<>
|
|
19
|
-
<Grid>
|
|
20
|
-
<Grid.Row>
|
|
21
|
-
<Grid.Column width={4}>
|
|
22
|
-
<BranchViewer branches={domains} handleRedirect={handleRedirect} />
|
|
23
|
-
</Grid.Column>
|
|
24
|
-
</Grid.Row>
|
|
25
|
-
</Grid>
|
|
26
|
-
</>
|
|
27
|
-
);
|
|
28
|
-
}
|