@truedat/bg 6.13.3 → 6.13.4
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/hooks/useDomains.js +12 -0
- package/src/messages/en.js +1 -0
- package/src/messages/es.js +1 -0
- package/src/taxonomy/components/Domain.js +67 -65
- package/src/taxonomy/components/DomainBranches.js +28 -0
- package/src/taxonomy/components/DomainDetail.js +7 -0
- package/src/taxonomy/components/DomainTabs.js +0 -10
- package/src/taxonomy/components/Domains.js +2 -2
- package/src/taxonomy/components/DomainsActions.js +2 -4
- package/src/taxonomy/components/__tests__/Domain.spec.js +1 -1
- package/src/taxonomy/components/__tests__/__snapshots__/Domain.spec.js.snap +137 -68
- package/src/taxonomy/components/__tests__/__snapshots__/DomainDetail.spec.js.snap +7 -0
- package/src/taxonomy/components/__tests__/__snapshots__/Domains.spec.js.snap +1 -9
- package/src/taxonomy/components/__tests__/__snapshots__/DomainsActions.spec.js.snap +1 -5
- package/src/taxonomy/components/DomainCards.js +0 -97
- package/src/taxonomy/components/__tests__/DomainCards.spec.js +0 -30
- package/src/taxonomy/components/__tests__/__snapshots__/DomainCards.spec.js.snap +0 -160
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/bg",
|
|
3
|
-
"version": "6.13.
|
|
3
|
+
"version": "6.13.4",
|
|
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.4",
|
|
90
|
+
"@truedat/df": "6.13.4",
|
|
91
|
+
"@truedat/lm": "6.13.4",
|
|
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": "3fd777c739ce6c9c78d505a85877e0ef6059b19c"
|
|
115
115
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
package/src/messages/en.js
CHANGED
|
@@ -284,6 +284,7 @@ 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",
|
|
287
288
|
"domains.search.results.count": "{count} domains found:",
|
|
288
289
|
"domains.search.results.empty": "No domains found",
|
|
289
290
|
"domains.subheader": "Manage governance structure and data domains",
|
package/src/messages/es.js
CHANGED
|
@@ -287,6 +287,7 @@ 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",
|
|
290
291
|
"domains.search.results.count": "{count} dominios encontrados:",
|
|
291
292
|
"domains.search.results.empty": "Ningún dominio encontrado",
|
|
292
293
|
"domains.subheader":
|
|
@@ -2,12 +2,11 @@ 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 { Route, Switch } from "react-router-dom";
|
|
6
|
-
import { Segment } from "semantic-ui-react";
|
|
5
|
+
import { useHistory, Route, Switch } from "react-router-dom";
|
|
6
|
+
import { Grid, 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,
|
|
11
10
|
DOMAIN_CONCEPTS,
|
|
12
11
|
DOMAIN_IMPLEMENTATIONS,
|
|
13
12
|
DOMAIN_MEMBERS,
|
|
@@ -15,89 +14,92 @@ import {
|
|
|
15
14
|
linkTo,
|
|
16
15
|
} from "@truedat/core/routes";
|
|
17
16
|
import UserSearchFiltersLoader from "@truedat/dd/components/UserSearchFiltersLoader";
|
|
17
|
+
import { BranchViewer } from "@truedat/core/components/";
|
|
18
18
|
import DomainConcepts from "../../concepts/components/DomainConcepts";
|
|
19
|
-
import
|
|
20
|
-
import DomainCards from "./DomainCards";
|
|
19
|
+
import { useDomains } from "../../hooks/useDomains";
|
|
21
20
|
import DomainCrumbs from "./DomainCrumbs";
|
|
22
21
|
import DomainDetail from "./DomainDetail";
|
|
23
22
|
import DomainImplementations from "./DomainImplementations";
|
|
24
23
|
import DomainMembers from "./DomainMembers";
|
|
25
|
-
import DomainSearch from "./DomainSearch";
|
|
26
24
|
import DomainStructures from "./DomainStructures";
|
|
27
25
|
import DomainTabs from "./DomainTabs";
|
|
28
26
|
|
|
29
|
-
export const Domain = ({
|
|
27
|
+
export const Domain = ({ domain, domainLoading }) => {
|
|
30
28
|
const ddAuthorized = useAuthorized("data_dictionary");
|
|
31
29
|
const dqAuthorized = useAuthorized("quality");
|
|
30
|
+
const history = useHistory();
|
|
31
|
+
const { data: domains } = useDomains();
|
|
32
32
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
order: 1,
|
|
36
|
-
icon: "cube",
|
|
37
|
-
messageId: "domain.actions.create",
|
|
38
|
-
action: (id) => linkTo.DOMAIN_NEW({ id }),
|
|
39
|
-
},
|
|
33
|
+
const handleRedirect = (id) => {
|
|
34
|
+
history.push(linkTo.DOMAIN_MEMBERS({ id }));
|
|
40
35
|
};
|
|
41
36
|
|
|
42
37
|
return domainLoading ? null : domain && domain.id ? (
|
|
43
38
|
<>
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<DomainActions availableActions={actions} />
|
|
57
|
-
<DomainCards />
|
|
58
|
-
</>
|
|
59
|
-
)}
|
|
39
|
+
<Grid>
|
|
40
|
+
<Grid.Row>
|
|
41
|
+
<Grid.Column width={16}>
|
|
42
|
+
<DomainCrumbs />
|
|
43
|
+
</Grid.Column>
|
|
44
|
+
</Grid.Row>
|
|
45
|
+
<Grid.Row>
|
|
46
|
+
<Grid.Column width={4}>
|
|
47
|
+
<BranchViewer
|
|
48
|
+
branches={domains}
|
|
49
|
+
handleRedirect={handleRedirect}
|
|
50
|
+
idSelectedBranch={domain.id}
|
|
60
51
|
/>
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
52
|
+
</Grid.Column>
|
|
53
|
+
<Grid.Column width={12}>
|
|
54
|
+
<>
|
|
55
|
+
<Segment>
|
|
56
|
+
<DomainDetail />
|
|
57
|
+
<DomainTabs />
|
|
58
|
+
<Segment attached="bottom">
|
|
59
|
+
<Switch>
|
|
60
|
+
<Route
|
|
61
|
+
exact
|
|
62
|
+
path={DOMAIN_MEMBERS}
|
|
63
|
+
render={() => <DomainMembers />}
|
|
64
|
+
/>
|
|
65
|
+
<Route
|
|
66
|
+
exact
|
|
67
|
+
path={DOMAIN_CONCEPTS}
|
|
68
|
+
render={() => <DomainConcepts />}
|
|
69
|
+
/>
|
|
70
|
+
<Route
|
|
71
|
+
exact
|
|
72
|
+
path={DOMAIN_STRUCTURES}
|
|
73
|
+
render={() =>
|
|
74
|
+
ddAuthorized ? <DomainStructures /> : <Unauthorized />
|
|
75
|
+
}
|
|
76
|
+
/>
|
|
77
|
+
<Route
|
|
78
|
+
exact
|
|
79
|
+
path={DOMAIN_IMPLEMENTATIONS}
|
|
80
|
+
render={() =>
|
|
81
|
+
dqAuthorized ? (
|
|
82
|
+
<>
|
|
83
|
+
<UserSearchFiltersLoader scope="rule_implementation" />
|
|
84
|
+
<DomainImplementations />
|
|
85
|
+
</>
|
|
86
|
+
) : (
|
|
87
|
+
<Unauthorized />
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
/>
|
|
91
|
+
</Switch>
|
|
92
|
+
</Segment>
|
|
93
|
+
</Segment>
|
|
94
|
+
</>
|
|
95
|
+
</Grid.Column>
|
|
96
|
+
</Grid.Row>
|
|
97
|
+
</Grid>
|
|
95
98
|
</>
|
|
96
99
|
) : null;
|
|
97
100
|
};
|
|
98
101
|
|
|
99
102
|
Domain.propTypes = {
|
|
100
|
-
hasChildren: PropTypes.bool,
|
|
101
103
|
domain: PropTypes.object,
|
|
102
104
|
domainLoading: PropTypes.bool,
|
|
103
105
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
}
|
|
@@ -10,6 +10,13 @@ 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
|
+
},
|
|
13
20
|
update: {
|
|
14
21
|
order: 2,
|
|
15
22
|
icon: "edit",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { FormattedMessage } from "react-intl";
|
|
@@ -7,7 +6,6 @@ import { Link } from "react-router-dom";
|
|
|
7
6
|
import { Menu } from "semantic-ui-react";
|
|
8
7
|
import { useAuthorized, usePath } from "@truedat/core/hooks";
|
|
9
8
|
import {
|
|
10
|
-
DOMAIN,
|
|
11
9
|
DOMAIN_CONCEPTS,
|
|
12
10
|
DOMAIN_IMPLEMENTATIONS,
|
|
13
11
|
DOMAIN_MEMBERS,
|
|
@@ -22,14 +20,6 @@ const DomainTabs = ({ domain }) => {
|
|
|
22
20
|
const id = domain?.id;
|
|
23
21
|
return (
|
|
24
22
|
<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>
|
|
33
23
|
<Menu.Item
|
|
34
24
|
active={path === DOMAIN_MEMBERS}
|
|
35
25
|
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 DomainBranches from "./DomainBranches";
|
|
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={DomainBranches} exact />
|
|
28
28
|
<Route
|
|
29
29
|
exact
|
|
30
30
|
path={DOMAINS_NEW}
|
|
@@ -6,13 +6,11 @@ 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";
|
|
10
9
|
|
|
11
10
|
export const DomainsActions = ({ createUrl }) => {
|
|
12
11
|
const { formatMessage } = useIntl();
|
|
13
12
|
return (
|
|
14
13
|
<>
|
|
15
|
-
<DomainSearch />
|
|
16
14
|
{createUrl && (
|
|
17
15
|
<Button
|
|
18
16
|
floated="right"
|
|
@@ -28,14 +26,14 @@ export const DomainsActions = ({ createUrl }) => {
|
|
|
28
26
|
};
|
|
29
27
|
|
|
30
28
|
DomainsActions.propTypes = {
|
|
31
|
-
createUrl: PropTypes.string
|
|
29
|
+
createUrl: PropTypes.string,
|
|
32
30
|
};
|
|
33
31
|
|
|
34
32
|
const mapStateToProps = ({ domainsActions }) => ({
|
|
35
33
|
createUrl:
|
|
36
34
|
!_.isEmpty(domainsActions) && _.has("create")(domainsActions)
|
|
37
35
|
? DOMAINS_NEW
|
|
38
|
-
: undefined
|
|
36
|
+
: undefined,
|
|
39
37
|
});
|
|
40
38
|
|
|
41
39
|
export default connect(mapStateToProps)(DomainsActions);
|
|
@@ -3,94 +3,163 @@
|
|
|
3
3
|
exports[`<Domain /> matches the latest snapshot 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<div
|
|
6
|
-
class="ui
|
|
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"
|
|
6
|
+
class="ui grid"
|
|
26
7
|
>
|
|
27
8
|
<div
|
|
28
|
-
class="
|
|
9
|
+
class="row"
|
|
29
10
|
>
|
|
30
11
|
<div
|
|
31
|
-
class="
|
|
12
|
+
class="sixteen wide column"
|
|
32
13
|
>
|
|
33
|
-
<
|
|
34
|
-
class="ui
|
|
14
|
+
<div
|
|
15
|
+
class="ui breadcrumb"
|
|
35
16
|
>
|
|
17
|
+
<a
|
|
18
|
+
class="section"
|
|
19
|
+
href="/domains"
|
|
20
|
+
>
|
|
21
|
+
Taxonomy
|
|
22
|
+
</a>
|
|
36
23
|
<i
|
|
37
24
|
aria-hidden="true"
|
|
38
|
-
class="
|
|
25
|
+
class="right angle icon divider"
|
|
39
26
|
/>
|
|
40
27
|
<div
|
|
41
|
-
class="
|
|
28
|
+
class="active section"
|
|
42
29
|
>
|
|
43
30
|
DOMAIN NAME
|
|
44
|
-
<div
|
|
45
|
-
class="sub header"
|
|
46
|
-
>
|
|
47
|
-
Domain
|
|
48
|
-
</div>
|
|
49
31
|
</div>
|
|
50
|
-
</
|
|
32
|
+
</div>
|
|
51
33
|
</div>
|
|
52
|
-
<div
|
|
53
|
-
class="right aligned eight wide column"
|
|
54
|
-
/>
|
|
55
34
|
</div>
|
|
56
|
-
<p />
|
|
57
35
|
<div
|
|
58
|
-
class="
|
|
36
|
+
class="row"
|
|
59
37
|
>
|
|
60
|
-
<
|
|
61
|
-
class="
|
|
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"
|
|
38
|
+
<div
|
|
39
|
+
class="four wide column"
|
|
81
40
|
>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
41
|
+
<div
|
|
42
|
+
class="ui segment"
|
|
43
|
+
style="overflow: auto;"
|
|
44
|
+
>
|
|
45
|
+
<div
|
|
46
|
+
class="ui grid"
|
|
47
|
+
>
|
|
48
|
+
<div
|
|
49
|
+
class="row"
|
|
50
|
+
>
|
|
51
|
+
<div
|
|
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>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
<div
|
|
94
|
+
class="twelve wide column"
|
|
87
95
|
>
|
|
88
|
-
|
|
89
|
-
|
|
96
|
+
<div
|
|
97
|
+
class="ui segment"
|
|
98
|
+
>
|
|
99
|
+
<div
|
|
100
|
+
class="ui grid"
|
|
101
|
+
>
|
|
102
|
+
<div
|
|
103
|
+
class="eight wide column"
|
|
104
|
+
>
|
|
105
|
+
<h2
|
|
106
|
+
class="ui header"
|
|
107
|
+
>
|
|
108
|
+
<i
|
|
109
|
+
aria-hidden="true"
|
|
110
|
+
class="cube icon"
|
|
111
|
+
/>
|
|
112
|
+
<div
|
|
113
|
+
class="content"
|
|
114
|
+
>
|
|
115
|
+
DOMAIN NAME
|
|
116
|
+
<div
|
|
117
|
+
class="sub header"
|
|
118
|
+
>
|
|
119
|
+
Domain
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
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>
|
|
90
162
|
</div>
|
|
91
|
-
<div
|
|
92
|
-
class="ui bottom attached segment"
|
|
93
|
-
/>
|
|
94
163
|
</div>
|
|
95
164
|
</div>
|
|
96
165
|
`;
|
|
@@ -28,6 +28,13 @@ 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
|
+
},
|
|
31
38
|
"deleteOption": true,
|
|
32
39
|
"update": {
|
|
33
40
|
"action": [Function],
|
|
@@ -28,15 +28,7 @@ exports[`<Domains /> matches the latest snapshot 1`] = `
|
|
|
28
28
|
<Connect(DomainsActions) />
|
|
29
29
|
<Switch>
|
|
30
30
|
<Route
|
|
31
|
-
component={
|
|
32
|
-
{
|
|
33
|
-
"$$typeof": Symbol(react.memo),
|
|
34
|
-
"WrappedComponent": [Function],
|
|
35
|
-
"compare": null,
|
|
36
|
-
"displayName": "Connect(DomainCards)",
|
|
37
|
-
"type": [Function],
|
|
38
|
-
}
|
|
39
|
-
}
|
|
31
|
+
component={[Function]}
|
|
40
32
|
exact={true}
|
|
41
33
|
path="/domains"
|
|
42
34
|
/>
|
|
@@ -1,97 +0,0 @@
|
|
|
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);
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,160 +0,0 @@
|
|
|
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
|
-
`;
|