@truedat/bg 4.54.8 → 4.54.10

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 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 Domain's view
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.8",
3
+ "version": "4.54.10",
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.8",
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.8",
90
- "@truedat/df": "4.54.8",
89
+ "@truedat/core": "4.54.9",
90
+ "@truedat/df": "4.54.10",
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": "f2274cf8a260efe11653e9e9132962cf0162c4c2"
110
+ "gitHead": "9821d62fc45875b958908d2dcec5aea90960ab4d"
111
111
  }
@@ -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",
@@ -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={() => <DomainStructures />}
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
- <Menu.Item
48
- active={path === DOMAIN_STRUCTURES}
49
- as={Link}
50
- to={linkTo.DOMAIN_STRUCTURES({ id })}
51
- replace
52
- >
53
- <FormattedMessage id="tabs.structures" />
54
- </Menu.Item>
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 { shallow } from "enzyme";
3
- import { Domain } from "../Domain";
2
+ import { render } from "@truedat/test/render";
3
+ import Domain from "../Domain";
4
4
 
5
- describe("<Domain />", () => {
6
- const domainLoading = false;
5
+ jest.mock("@truedat/core/hooks", () => ({
6
+ useAuthorized: jest.fn(() => true),
7
+ usePath: jest.fn(() => "/domains/:id"),
8
+ }));
7
9
 
8
- it("matches the latest snapshot (no subdomains)", () => {
9
- const domain = { id: 3, name: "domain", childCount: 0 };
10
- const props = { domain, domainLoading };
11
- const wrapper = shallow(<Domain {...props} />);
12
- expect(wrapper).toMatchSnapshot();
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 (with subdomains)", () => {
16
- const domain = { id: 3, name: "domain", childCount: 5 };
17
- const props = { domain, domainLoading };
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 (no subdomains) 1`] = `
4
- <Fragment>
5
- <Connect(DomainCrumbs) />
6
- <Segment>
7
- <Connect(DomainDetail) />
8
- <Connect(DomainTabs) />
9
- <Segment
10
- attached="bottom"
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
- <Switch>
13
- <Route
14
- exact={true}
15
- path="/domains/:id"
16
- render={[Function]}
17
- />
18
- <Route
19
- exact={true}
20
- path="/domains/:id/members"
21
- render={[Function]}
22
- />
23
- <Route
24
- exact={true}
25
- path="/domains/:id/concepts"
26
- render={[Function]}
27
- />
28
- <Route
29
- exact={true}
30
- path="/domains/:id/structures"
31
- render={[Function]}
32
- />
33
- </Switch>
34
- </Segment>
35
- </Segment>
36
- </Fragment>
37
- `;
38
-
39
- exports[`<Domain /> matches the latest snapshot (with subdomains) 1`] = `
40
- <Fragment>
41
- <Connect(DomainCrumbs) />
42
- <Segment>
43
- <Connect(DomainDetail) />
44
- <Connect(DomainTabs) />
45
- <Segment
46
- attached="bottom"
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
- <Switch>
49
- <Route
50
- exact={true}
51
- path="/domains/:id"
52
- render={[Function]}
53
- />
54
- <Route
55
- exact={true}
56
- path="/domains/:id/members"
57
- render={[Function]}
58
- />
59
- <Route
60
- exact={true}
61
- path="/domains/:id/concepts"
62
- render={[Function]}
63
- />
64
- <Route
65
- exact={true}
66
- path="/domains/:id/structures"
67
- render={[Function]}
68
- />
69
- </Switch>
70
- </Segment>
71
- </Segment>
72
- </Fragment>
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
  `;