@truedat/bg 4.52.0 → 4.52.3
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 -0
- package/package.json +2 -2
- package/src/concepts/relations/components/ConceptImplementationLinks.js +25 -51
- package/src/concepts/relations/components/ImplementationLinksAction.js +0 -35
- package/src/concepts/relations/components/__tests__/ImplementationLinksAction.spec.js +0 -31
- package/src/concepts/relations/components/__tests__/__snapshots__/ImplementationLinksAction.spec.js.snap +0 -10
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/bg",
|
|
3
|
-
"version": "4.52.
|
|
3
|
+
"version": "4.52.3",
|
|
4
4
|
"description": "Truedat Web Business Glossary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -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": "64a180a3031aa1e24fdfe1db18b5773e43e20486"
|
|
111
111
|
}
|
|
@@ -2,70 +2,44 @@ 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 { Segment, Header
|
|
5
|
+
import { Segment, Header } from "semantic-ui-react";
|
|
6
6
|
import { FormattedMessage } from "react-intl";
|
|
7
7
|
import { getConceptImplementationLinks } from "../selectors";
|
|
8
|
-
import { conceptLinkAction } from "../routines";
|
|
9
|
-
import ImplementationLinksAction from "./ImplementationLinksAction";
|
|
10
8
|
|
|
11
9
|
const RuleImplementationsTable = React.lazy(() =>
|
|
12
10
|
import("@truedat/dq/components/RuleImplementationsTable")
|
|
13
11
|
);
|
|
14
12
|
|
|
15
|
-
export const ConceptImplementationLinks = ({ groups
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<FormattedMessage
|
|
39
|
-
id={"implementationDeletedRelation.table.title"}
|
|
40
|
-
/>
|
|
41
|
-
) : tag === "\uffee" ? (
|
|
42
|
-
<FormattedMessage id={"implementationRelation.table.title"} />
|
|
43
|
-
) : (
|
|
44
|
-
tag
|
|
45
|
-
)}
|
|
46
|
-
</Header>
|
|
47
|
-
<RuleImplementationsTable
|
|
48
|
-
ruleImplementations={implementations}
|
|
49
|
-
withoutColumns={["business_concept"]}
|
|
50
|
-
additionalColumns={additionalColumns}
|
|
51
|
-
additionalCells={additionalCells}
|
|
52
|
-
/>
|
|
53
|
-
</Segment>
|
|
54
|
-
)
|
|
55
|
-
)}
|
|
56
|
-
</Segment>
|
|
57
|
-
);
|
|
58
|
-
};
|
|
13
|
+
export const ConceptImplementationLinks = ({ groups }) => (
|
|
14
|
+
<Segment attached="bottom">
|
|
15
|
+
{groups.map(([tag, implementations], key) =>
|
|
16
|
+
_.isEmpty(implementations) ? null : (
|
|
17
|
+
<Segment vertical key={key}>
|
|
18
|
+
<Header as="h3">
|
|
19
|
+
{tag === "deleted" ? (
|
|
20
|
+
<FormattedMessage id="implementationDeletedRelation.table.title" />
|
|
21
|
+
) : tag === "\uffee" ? (
|
|
22
|
+
<FormattedMessage id="implementationRelation.table.title" />
|
|
23
|
+
) : (
|
|
24
|
+
tag
|
|
25
|
+
)}
|
|
26
|
+
</Header>
|
|
27
|
+
<RuleImplementationsTable
|
|
28
|
+
ruleImplementations={implementations}
|
|
29
|
+
withoutColumns={["business_concept"]}
|
|
30
|
+
/>
|
|
31
|
+
</Segment>
|
|
32
|
+
)
|
|
33
|
+
)}
|
|
34
|
+
</Segment>
|
|
35
|
+
);
|
|
59
36
|
|
|
60
37
|
ConceptImplementationLinks.propTypes = {
|
|
61
38
|
groups: PropTypes.array,
|
|
62
|
-
conceptLinkAction: PropTypes.object,
|
|
63
39
|
};
|
|
64
40
|
|
|
65
41
|
const mapStateToProps = (state) => ({
|
|
66
42
|
groups: getConceptImplementationLinks(state),
|
|
67
43
|
});
|
|
68
44
|
|
|
69
|
-
export default connect(mapStateToProps
|
|
70
|
-
conceptLinkAction,
|
|
71
|
-
})(ConceptImplementationLinks);
|
|
45
|
+
export default connect(mapStateToProps)(ConceptImplementationLinks);
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import { useIntl } from "react-intl";
|
|
5
|
-
import { Icon } from "semantic-ui-react";
|
|
6
|
-
import { ConfirmModal } from "@truedat/core/components";
|
|
7
|
-
|
|
8
|
-
export const ImplementationLinksAction = ({ _actions: actions, doDelete }) => {
|
|
9
|
-
const { formatMessage } = useIntl();
|
|
10
|
-
const deleteAction = _.prop("delete")(actions);
|
|
11
|
-
return deleteAction ? (
|
|
12
|
-
<>
|
|
13
|
-
<ConfirmModal
|
|
14
|
-
icon="trash"
|
|
15
|
-
trigger={<Icon name="trash alternate outline" color="red" />}
|
|
16
|
-
header={formatMessage({
|
|
17
|
-
id: `conceptRelation.implementation.actions.delete.confirmation.header`,
|
|
18
|
-
})}
|
|
19
|
-
content={formatMessage({
|
|
20
|
-
id: `conceptRelation.implementation.actions.delete.confirmation.content`,
|
|
21
|
-
})}
|
|
22
|
-
onConfirm={() => doDelete(deleteAction)}
|
|
23
|
-
onOpen={(e) => e.stopPropagation()}
|
|
24
|
-
onClose={(e) => e.stopPropagation()}
|
|
25
|
-
/>
|
|
26
|
-
</>
|
|
27
|
-
) : null;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
ImplementationLinksAction.propTypes = {
|
|
31
|
-
doDelete: PropTypes.func,
|
|
32
|
-
_actions: PropTypes.object,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default ImplementationLinksAction;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
|
-
import React, { Suspense } from "react";
|
|
3
|
-
import { render } from "@truedat/test/render";
|
|
4
|
-
import { ImplementationLinksAction } from "../ImplementationLinksAction";
|
|
5
|
-
|
|
6
|
-
describe("<ImplementationLinksAction />", () => {
|
|
7
|
-
const renderOpts = {
|
|
8
|
-
messages: {
|
|
9
|
-
en: {
|
|
10
|
-
"conceptRelation.implementation.actions.delete.confirmation.header":
|
|
11
|
-
"Delete Link Implementation",
|
|
12
|
-
"conceptRelation.implementation.actions.delete.confirmation.content":
|
|
13
|
-
"You are going to delete this link. Are you sure?",
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
const props = {
|
|
18
|
-
id: 1,
|
|
19
|
-
_actions: { delete: { foo: "bar" } },
|
|
20
|
-
doDelete: jest.fn(),
|
|
21
|
-
};
|
|
22
|
-
it("matches the latest snapshot", () => {
|
|
23
|
-
const { container } = render(
|
|
24
|
-
<Suspense fallback={null}>
|
|
25
|
-
<ImplementationLinksAction {...props} />
|
|
26
|
-
</Suspense>,
|
|
27
|
-
renderOpts
|
|
28
|
-
);
|
|
29
|
-
expect(container).toMatchSnapshot();
|
|
30
|
-
});
|
|
31
|
-
});
|