@truedat/dd 4.40.4 → 4.40.7
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 +12 -0
- package/package.json +6 -6
- package/src/components/GrantRequestApprovalForm.js +1 -2
- package/src/components/StructureItem.js +9 -4
- package/src/components/__tests__/GrantRequestApprovalForm.spec.js +0 -2
- package/src/components/__tests__/StructureItem.spec.js +6 -4
- package/src/components/__tests__/__snapshots__/StructureItem.spec.js.snap +3 -0
- package/src/components/__tests__/__snapshots__/StructureNavClassified.spec.js.snap +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.40.7] 2022-03-18
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- [TD-4435] Display full name of structures in Data Catalog
|
|
8
|
+
|
|
9
|
+
## [4.40.6] 2022-03-17
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- [TD-4500] Remove unnecessary domain_id attribute on GrantRequestApprovalForm
|
|
14
|
+
|
|
3
15
|
## [4.40.2] 2022-03-14
|
|
4
16
|
|
|
5
17
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "4.40.
|
|
3
|
+
"version": "4.40.7",
|
|
4
4
|
"description": "Truedat Web Data Dictionary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@testing-library/jest-dom": "^5.14.1",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "4.40.
|
|
37
|
+
"@truedat/test": "4.40.5",
|
|
38
38
|
"babel-jest": "^27.0.6",
|
|
39
39
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
40
40
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@truedat/auth": "4.40.
|
|
88
|
-
"@truedat/core": "4.40.
|
|
89
|
-
"@truedat/df": "4.40.
|
|
87
|
+
"@truedat/auth": "4.40.7",
|
|
88
|
+
"@truedat/core": "4.40.7",
|
|
89
|
+
"@truedat/df": "4.40.7",
|
|
90
90
|
"lodash": "^4.17.21",
|
|
91
91
|
"path-to-regexp": "^1.7.0",
|
|
92
92
|
"prop-types": "^15.7.2",
|
|
@@ -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": "57ce60d30f6238ab63207ae402dfc0bc0e5c934a"
|
|
111
111
|
}
|
|
@@ -30,10 +30,9 @@ export const GrantRequestApprovalForm = ({
|
|
|
30
30
|
)(grantRequest);
|
|
31
31
|
|
|
32
32
|
const onSubmit = (formValues) => {
|
|
33
|
-
const { id
|
|
33
|
+
const { id } = grantRequest;
|
|
34
34
|
const approval = {
|
|
35
35
|
...formValues,
|
|
36
|
-
domain_id,
|
|
37
36
|
is_rejection: isRejection,
|
|
38
37
|
};
|
|
39
38
|
createGrantRequestApproval({
|
|
@@ -10,14 +10,15 @@ import { STRUCTURES, linkTo } from "@truedat/core/routes";
|
|
|
10
10
|
const getIcon = (formatMessage, type) =>
|
|
11
11
|
formatMessage({
|
|
12
12
|
id: `structure.type.${type}.icon`,
|
|
13
|
-
defaultMessage: "question circle outline"
|
|
13
|
+
defaultMessage: "question circle outline",
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
export const StructureItem = ({ name, id, type, active, deleted_at }) => {
|
|
17
17
|
const { formatMessage } = useIntl();
|
|
18
18
|
return (
|
|
19
19
|
<List.Item
|
|
20
|
-
as={active ?
|
|
20
|
+
as={active ? "a" : Link}
|
|
21
|
+
title={name}
|
|
21
22
|
to={
|
|
22
23
|
active
|
|
23
24
|
? undefined
|
|
@@ -39,8 +40,11 @@ export const StructureItem = ({ name, id, type, active, deleted_at }) => {
|
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
StructureItem.propTypes = {
|
|
43
|
+
active: PropTypes.bool,
|
|
44
|
+
deleted_at: PropTypes.string,
|
|
45
|
+
id: PropTypes.number,
|
|
42
46
|
name: PropTypes.string,
|
|
43
|
-
|
|
47
|
+
type: PropTypes.string,
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
export const mapStateToProps = (
|
|
@@ -50,7 +54,8 @@ export const mapStateToProps = (
|
|
|
50
54
|
const id = data_structure_id || structureId;
|
|
51
55
|
return {
|
|
52
56
|
id: id,
|
|
53
|
-
active:
|
|
57
|
+
active:
|
|
58
|
+
type !== "system" && _.isFinite(id) && _.propEq("id", id)(structure),
|
|
54
59
|
};
|
|
55
60
|
};
|
|
56
61
|
|
|
@@ -7,7 +7,6 @@ import { GrantRequestApprovalForm } from "../GrantRequestApprovalForm";
|
|
|
7
7
|
describe("<GrantRequestApprovalForm />", () => {
|
|
8
8
|
const grantRequest = {
|
|
9
9
|
id: 3,
|
|
10
|
-
domain_id: 8,
|
|
11
10
|
pending_roles: ["role1", "role2"],
|
|
12
11
|
};
|
|
13
12
|
const createGrantRequestApproval = jest.fn();
|
|
@@ -77,7 +76,6 @@ describe("<GrantRequestApprovalForm />", () => {
|
|
|
77
76
|
expect.objectContaining({
|
|
78
77
|
grantRequestId: 3,
|
|
79
78
|
approval: {
|
|
80
|
-
domain_id: 8,
|
|
81
79
|
is_rejection: false,
|
|
82
80
|
role: "role1",
|
|
83
81
|
comment: "comment",
|
|
@@ -36,14 +36,16 @@ describe("<StructureItem />", () => {
|
|
|
36
36
|
const wrapper = shallow(<StructureItem {...props} />);
|
|
37
37
|
expect(wrapper.prop("as")).toBe(Link);
|
|
38
38
|
expect(wrapper.prop("to")).toEqual("/structures");
|
|
39
|
+
expect(wrapper.prop("title")).toBeTruthy();
|
|
39
40
|
});
|
|
40
41
|
|
|
41
|
-
it("renders as an
|
|
42
|
+
it("renders as an anchor tag if active is true", () => {
|
|
42
43
|
const props = { id, name, active: true };
|
|
43
44
|
const wrapper = shallow(<StructureItem {...props} />);
|
|
44
|
-
expect(wrapper.prop("as")).
|
|
45
|
+
expect(wrapper.prop("as")).toBe("a");
|
|
45
46
|
expect(wrapper.prop("to")).toBeUndefined();
|
|
46
47
|
expect(wrapper.prop("active")).toBeTruthy();
|
|
48
|
+
expect(wrapper.prop("title")).toBeTruthy();
|
|
47
49
|
});
|
|
48
50
|
|
|
49
51
|
describe("mapStateToProps", () => {
|
|
@@ -55,7 +57,7 @@ describe("<StructureItem />", () => {
|
|
|
55
57
|
|
|
56
58
|
expect(mapStateToProps(state, ownProps)).toMatchObject({
|
|
57
59
|
id: data_structure_id,
|
|
58
|
-
active: false
|
|
60
|
+
active: false,
|
|
59
61
|
});
|
|
60
62
|
});
|
|
61
63
|
|
|
@@ -65,7 +67,7 @@ describe("<StructureItem />", () => {
|
|
|
65
67
|
const state = { structure };
|
|
66
68
|
|
|
67
69
|
expect(mapStateToProps(state, ownProps)).toMatchObject({
|
|
68
|
-
active: true
|
|
70
|
+
active: true,
|
|
69
71
|
});
|
|
70
72
|
});
|
|
71
73
|
});
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
exports[`<StructureItem /> matches the latest snapshot (active state) 1`] = `
|
|
4
4
|
<ListItem
|
|
5
5
|
active={true}
|
|
6
|
+
as="a"
|
|
7
|
+
title="foo"
|
|
6
8
|
>
|
|
7
9
|
<ListIcon
|
|
8
10
|
name="question circle outline"
|
|
@@ -32,6 +34,7 @@ exports[`<StructureItem /> matches the latest snapshot 1`] = `
|
|
|
32
34
|
"render": [Function],
|
|
33
35
|
}
|
|
34
36
|
}
|
|
37
|
+
title="foo"
|
|
35
38
|
to="/structures/1"
|
|
36
39
|
>
|
|
37
40
|
<ListIcon
|
|
@@ -20,7 +20,7 @@ exports[`<StructureNavClassified /> matches the latest snapshot (leaf class expa
|
|
|
20
20
|
</div>
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
23
|
-
<
|
|
23
|
+
<a
|
|
24
24
|
class="active item"
|
|
25
25
|
role="listitem"
|
|
26
26
|
>
|
|
@@ -35,7 +35,7 @@ exports[`<StructureNavClassified /> matches the latest snapshot (leaf class expa
|
|
|
35
35
|
class="description"
|
|
36
36
|
/>
|
|
37
37
|
</div>
|
|
38
|
-
</
|
|
38
|
+
</a>
|
|
39
39
|
<div
|
|
40
40
|
class="item"
|
|
41
41
|
role="listitem"
|