@truedat/dd 7.6.4 → 7.7.1
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.1",
|
|
4
4
|
"description": "Truedat Web Data Dictionary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@testing-library/jest-dom": "^6.6.3",
|
|
49
49
|
"@testing-library/react": "^16.3.0",
|
|
50
50
|
"@testing-library/user-event": "^14.6.1",
|
|
51
|
-
"@truedat/test": "7.
|
|
51
|
+
"@truedat/test": "7.7.1",
|
|
52
52
|
"identity-obj-proxy": "^3.0.0",
|
|
53
53
|
"jest": "^29.7.0",
|
|
54
54
|
"redux-saga-test-plan": "^4.0.6"
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"svg-pan-zoom": "^3.6.2",
|
|
84
84
|
"swr": "^2.3.3"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "b0bbab1ace5acb5a0c670137a51d21456f5eecae"
|
|
87
87
|
}
|
|
@@ -11,6 +11,7 @@ export const StructureRow = ({
|
|
|
11
11
|
active,
|
|
12
12
|
disabled,
|
|
13
13
|
positive,
|
|
14
|
+
origin,
|
|
14
15
|
grantable,
|
|
15
16
|
}) =>
|
|
16
17
|
_.isEmpty(columns) || _.isEmpty(structure) ? null : (
|
|
@@ -22,7 +23,10 @@ export const StructureRow = ({
|
|
|
22
23
|
className: "structure-cell-overflow",
|
|
23
24
|
})}
|
|
24
25
|
textAlign={column.textAlign}
|
|
25
|
-
content={columnDecorator(column)(
|
|
26
|
+
content={columnDecorator(column)({
|
|
27
|
+
...structure,
|
|
28
|
+
linkOrigin: origin,
|
|
29
|
+
})}
|
|
26
30
|
onClick={() => onClick && onClick(structure)}
|
|
27
31
|
/>
|
|
28
32
|
))}
|
|
@@ -41,6 +45,7 @@ StructureRow.propTypes = {
|
|
|
41
45
|
active: PropTypes.bool,
|
|
42
46
|
disabled: PropTypes.bool,
|
|
43
47
|
positive: PropTypes.bool,
|
|
48
|
+
origin: PropTypes.string,
|
|
44
49
|
grantable: PropTypes.bool,
|
|
45
50
|
};
|
|
46
51
|
|
|
@@ -16,6 +16,17 @@ const isPositive = (links, id) => {
|
|
|
16
16
|
return link ? true : false;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
const getOrigin = (links, id) => {
|
|
20
|
+
return _.flow(
|
|
21
|
+
_.find(
|
|
22
|
+
(link) =>
|
|
23
|
+
_.propEq("target_id", id)(link) &&
|
|
24
|
+
_.propEq("target_type", "data_structure")(link)
|
|
25
|
+
),
|
|
26
|
+
_.get("origin")
|
|
27
|
+
)(links);
|
|
28
|
+
};
|
|
29
|
+
|
|
19
30
|
export const StructuresTable = ({
|
|
20
31
|
columns: overwriteColumns,
|
|
21
32
|
grantable,
|
|
@@ -52,7 +63,8 @@ export const StructuresTable = ({
|
|
|
52
63
|
: [selectedStructure, ...structures]
|
|
53
64
|
: structures;
|
|
54
65
|
const headerRow = (
|
|
55
|
-
<Table.Row>
|
|
66
|
+
<Table.Row>
|
|
67
|
+
{columns.map((column, key) => (
|
|
56
68
|
<Table.HeaderCell
|
|
57
69
|
key={key}
|
|
58
70
|
content={
|
|
@@ -67,9 +79,11 @@ export const StructuresTable = ({
|
|
|
67
79
|
onClick={() => handleSortSelection(_.path("sort.name")(column))}
|
|
68
80
|
width={_.propOr(1, "width")(column)}
|
|
69
81
|
/>
|
|
70
|
-
))}
|
|
82
|
+
))}
|
|
83
|
+
{grantable && (
|
|
71
84
|
<Table.HeaderCell textAlign="center">Request grant</Table.HeaderCell>
|
|
72
|
-
)}
|
|
85
|
+
)}
|
|
86
|
+
</Table.Row>
|
|
73
87
|
);
|
|
74
88
|
|
|
75
89
|
const renderBodyRow = (s, i) => (
|
|
@@ -79,6 +93,7 @@ export const StructuresTable = ({
|
|
|
79
93
|
structure={s}
|
|
80
94
|
active={selectedStructure && _.propEq("id", s.id)(selectedStructure)}
|
|
81
95
|
positive={isPositive(links, s.id)}
|
|
96
|
+
origin={getOrigin(links, s.id)}
|
|
82
97
|
onClick={onStructureSelected}
|
|
83
98
|
grantable={grantable}
|
|
84
99
|
/>
|
|
@@ -3,6 +3,7 @@ import { createSelector } from "reselect";
|
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import { linkTo } from "@truedat/core/routes";
|
|
5
5
|
import { Link } from "react-router";
|
|
6
|
+
import { OriginIcon } from "@truedat/core/components/OriginLabel";
|
|
6
7
|
import Moment from "react-moment";
|
|
7
8
|
|
|
8
9
|
const StructureLink = (structure) =>
|
|
@@ -85,6 +86,13 @@ const rawName = {
|
|
|
85
86
|
name: "name",
|
|
86
87
|
sort: { name: "name.sort" },
|
|
87
88
|
width: 2,
|
|
89
|
+
fieldSelector: _.identity,
|
|
90
|
+
fieldDecorator: ({ name, linkOrigin }) => (
|
|
91
|
+
<>
|
|
92
|
+
{name}
|
|
93
|
+
<OriginIcon origin={linkOrigin} />
|
|
94
|
+
</>
|
|
95
|
+
),
|
|
88
96
|
};
|
|
89
97
|
export const defaultColumnsForStructureSelector = createSelector(
|
|
90
98
|
(state) => structureColumnsSelector(state, null, null),
|