@truedat/dd 4.42.2 → 4.42.5
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 +6 -0
- package/package.json +6 -6
- package/src/components/LineageGraph.js +147 -73
- package/src/components/LineageLink.js +22 -4
- package/src/messages/en.js +2 -0
- package/src/messages/es.js +2 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "4.42.
|
|
3
|
+
"version": "4.42.5",
|
|
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.42.
|
|
37
|
+
"@truedat/test": "4.42.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.42.
|
|
88
|
-
"@truedat/core": "4.42.
|
|
89
|
-
"@truedat/df": "4.42.
|
|
87
|
+
"@truedat/auth": "4.42.5",
|
|
88
|
+
"@truedat/core": "4.42.5",
|
|
89
|
+
"@truedat/df": "4.42.5",
|
|
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": "77641b0e3a7555a6f6c4c0649ff7b6164292b4b0"
|
|
111
111
|
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import React, { useRef, useEffect, useReducer } from "react";
|
|
2
|
+
import React, { useRef, useEffect, useReducer, useState } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { connect } from "react-redux";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Dimmer,
|
|
7
|
+
Loader,
|
|
8
|
+
Segment,
|
|
9
|
+
Header,
|
|
10
|
+
Button,
|
|
11
|
+
Grid,
|
|
12
|
+
Divider,
|
|
13
|
+
} from "semantic-ui-react";
|
|
6
14
|
import svgPanZoom from "svg-pan-zoom";
|
|
7
15
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
16
|
+
|
|
8
17
|
import {
|
|
9
18
|
clearNode,
|
|
10
19
|
selectNode,
|
|
@@ -64,6 +73,9 @@ export const LineageGraph = ({
|
|
|
64
73
|
const [state, dispatch] = useReducer(reducer, initialState);
|
|
65
74
|
const { selectedNode, hover, svg } = state;
|
|
66
75
|
|
|
76
|
+
const [metadata, setMetadata] = useState(null);
|
|
77
|
+
const [selectedLink, selectLink] = useState(null);
|
|
78
|
+
|
|
67
79
|
useEffect(() => {
|
|
68
80
|
// Anything in here is fired on component mount.
|
|
69
81
|
return () => cancelPoll();
|
|
@@ -84,78 +96,108 @@ export const LineageGraph = ({
|
|
|
84
96
|
const { formatMessage } = useIntl();
|
|
85
97
|
|
|
86
98
|
return (
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
id="lineage.graph.loading"
|
|
93
|
-
defaultMessage={"Analyzing..."}
|
|
94
|
-
/>
|
|
95
|
-
{loadingInfo?.data?.graph_hash && loadingInfo?.data?.status && (
|
|
96
|
-
<p>
|
|
97
|
-
{formatMessage({
|
|
98
|
-
id:
|
|
99
|
-
_.toLower(loadingInfo?.data?.status) === "already_started"
|
|
100
|
-
? "lineage.graph.loading.background.existing"
|
|
101
|
-
: _.toLower(loadingInfo?.data?.status) ===
|
|
102
|
-
"just_started" &&
|
|
103
|
-
"lineage.graph.loading.background.launched",
|
|
104
|
-
})}
|
|
105
|
-
</p>
|
|
106
|
-
)}
|
|
107
|
-
{loadingInfo?.data?.graph_hash && (
|
|
108
|
-
<p>
|
|
109
|
-
Graph hash:{" "}
|
|
110
|
-
<span className="graph-hash">
|
|
111
|
-
{loadingInfo?.data?.graph_hash}
|
|
112
|
-
</span>
|
|
113
|
-
</p>
|
|
114
|
-
)}
|
|
115
|
-
<p>
|
|
116
|
-
{loadingInfo?.data?.retry &&
|
|
117
|
-
formatMessage(
|
|
118
|
-
{ id: "lineage.graph.loading.polling" },
|
|
119
|
-
{ retry: loadingInfo?.data?.retry }
|
|
120
|
-
)}
|
|
121
|
-
</p>
|
|
122
|
-
</Loader>
|
|
123
|
-
</Dimmer>
|
|
124
|
-
<svg
|
|
125
|
-
width="100%"
|
|
126
|
-
height={height}
|
|
127
|
-
ref={ref}
|
|
128
|
-
onClick={() => dispatch(selectNode.trigger(null))}
|
|
99
|
+
<Grid>
|
|
100
|
+
<Grid.Row columns={2}>
|
|
101
|
+
<Grid.Column
|
|
102
|
+
width={_.isNull(metadata) ? 16 : 12}
|
|
103
|
+
style={_.isNull(metadata) ? {} : { "padding-right": 0 }}
|
|
129
104
|
>
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
105
|
+
<Dimmer.Dimmable dimmed={loading} className="dl">
|
|
106
|
+
<Dimmer active={loading} inverted>
|
|
107
|
+
<Loader size="large">
|
|
108
|
+
<FormattedMessage
|
|
109
|
+
id="lineage.graph.loading"
|
|
110
|
+
defaultMessage={"Analyzing..."}
|
|
111
|
+
/>
|
|
112
|
+
{loadingInfo?.data?.graph_hash && loadingInfo?.data?.status && (
|
|
113
|
+
<p>
|
|
114
|
+
{formatMessage({
|
|
115
|
+
id:
|
|
116
|
+
_.toLower(loadingInfo?.data?.status) ===
|
|
117
|
+
"already_started"
|
|
118
|
+
? "lineage.graph.loading.background.existing"
|
|
119
|
+
: _.toLower(loadingInfo?.data?.status) ===
|
|
120
|
+
"just_started" &&
|
|
121
|
+
"lineage.graph.loading.background.launched",
|
|
122
|
+
})}
|
|
123
|
+
</p>
|
|
124
|
+
)}
|
|
125
|
+
{loadingInfo?.data?.graph_hash && (
|
|
126
|
+
<p>
|
|
127
|
+
Graph hash:{" "}
|
|
128
|
+
<span className="graph-hash">
|
|
129
|
+
{loadingInfo?.data?.graph_hash}
|
|
130
|
+
</span>
|
|
131
|
+
</p>
|
|
132
|
+
)}
|
|
133
|
+
<p>
|
|
134
|
+
{loadingInfo?.data?.retry &&
|
|
135
|
+
formatMessage(
|
|
136
|
+
{ id: "lineage.graph.loading.polling" },
|
|
137
|
+
{ retry: loadingInfo?.data?.retry }
|
|
138
|
+
)}
|
|
139
|
+
</p>
|
|
140
|
+
</Loader>
|
|
141
|
+
</Dimmer>
|
|
142
|
+
<svg
|
|
143
|
+
width="100%"
|
|
144
|
+
height={height}
|
|
145
|
+
ref={ref}
|
|
146
|
+
onClick={() => dispatch(selectNode.trigger(null))}
|
|
147
|
+
style={{ border: "1px solid #d4d4d5", borderRadius: "5px" }}
|
|
148
|
+
>
|
|
149
|
+
<LineageDefs />
|
|
150
|
+
<g className="svg-pan-zoom_viewport">
|
|
151
|
+
{_.map.convert({ cap: false })((g, i) => (
|
|
152
|
+
<LineageGroup
|
|
153
|
+
key={i}
|
|
154
|
+
active={hover === g.id}
|
|
155
|
+
onHover={onHover(g.id)}
|
|
156
|
+
onClick={onSelect(g)}
|
|
157
|
+
selected={selectedNode === g}
|
|
158
|
+
{...g}
|
|
159
|
+
/>
|
|
160
|
+
))(groups)}
|
|
161
|
+
{_.map.convert({ cap: false })((g, i) => (
|
|
162
|
+
<LineageResource
|
|
163
|
+
key={i}
|
|
164
|
+
active={hover === g.id}
|
|
165
|
+
onHover={onHover(g.id)}
|
|
166
|
+
onClick={onSelect(g)}
|
|
167
|
+
selected={selectedNode === g}
|
|
168
|
+
{...g}
|
|
169
|
+
/>
|
|
170
|
+
))(resources)}
|
|
171
|
+
{_.map.convert({ cap: false })((p, i) => (
|
|
172
|
+
<LineageLink
|
|
173
|
+
key={i}
|
|
174
|
+
active
|
|
175
|
+
selected={selectedLink === i}
|
|
176
|
+
path={p.path}
|
|
177
|
+
metadata={p.metadata}
|
|
178
|
+
onClick={(metadata) => {
|
|
179
|
+
setMetadata(metadata);
|
|
180
|
+
selectLink(i);
|
|
181
|
+
}}
|
|
182
|
+
/>
|
|
183
|
+
))(paths)}
|
|
184
|
+
</g>
|
|
185
|
+
</svg>
|
|
186
|
+
</Dimmer.Dimmable>
|
|
187
|
+
</Grid.Column>
|
|
188
|
+
{_.isNull(metadata) ? null : (
|
|
189
|
+
<Grid.Column width={4} style={{ maxHeight: 300 }}>
|
|
190
|
+
<LinageMetadata
|
|
191
|
+
metadata={metadata}
|
|
192
|
+
onClose={() => {
|
|
193
|
+
setMetadata(null);
|
|
194
|
+
selectLink(null);
|
|
195
|
+
}}
|
|
196
|
+
/>
|
|
197
|
+
</Grid.Column>
|
|
198
|
+
)}
|
|
199
|
+
</Grid.Row>
|
|
200
|
+
</Grid>
|
|
159
201
|
);
|
|
160
202
|
};
|
|
161
203
|
|
|
@@ -186,3 +228,35 @@ const mapStateToProps = (
|
|
|
186
228
|
export default connect(mapStateToProps, { clearNode, cancelPoll })(
|
|
187
229
|
LineageGraph
|
|
188
230
|
);
|
|
231
|
+
|
|
232
|
+
export const LinageMetadata = ({ metadata, onClose }) => {
|
|
233
|
+
const { formatMessage } = useIntl();
|
|
234
|
+
const content = _.flow(
|
|
235
|
+
_.toPairs,
|
|
236
|
+
_.map(([key, value]) => (
|
|
237
|
+
<div key={key}>
|
|
238
|
+
<b>{key}:</b>
|
|
239
|
+
<p>{value}</p>
|
|
240
|
+
<Divider fitted />
|
|
241
|
+
</div>
|
|
242
|
+
))
|
|
243
|
+
)(metadata);
|
|
244
|
+
|
|
245
|
+
return (
|
|
246
|
+
<Segment secondary>
|
|
247
|
+
<Header>
|
|
248
|
+
{" "}
|
|
249
|
+
{formatMessage({ id: "lineage.graph.metadata.header" })}{" "}
|
|
250
|
+
</Header>
|
|
251
|
+
<div style={{ maxHeight: "400px", overflowY: "auto" }}>{content}</div>
|
|
252
|
+
<Button
|
|
253
|
+
onClick={onClose}
|
|
254
|
+
content={formatMessage({ id: "lineage.graph.metadata.close.button" })}
|
|
255
|
+
/>
|
|
256
|
+
</Segment>
|
|
257
|
+
);
|
|
258
|
+
};
|
|
259
|
+
LinageMetadata.propTypes = {
|
|
260
|
+
metadata: PropTypes.object,
|
|
261
|
+
onClose: PropTypes.func,
|
|
262
|
+
};
|
|
@@ -1,13 +1,31 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import PropTypes from "prop-types";
|
|
3
4
|
|
|
4
|
-
export const LineageLink = ({
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
export const LineageLink = ({
|
|
6
|
+
active = false,
|
|
7
|
+
path,
|
|
8
|
+
metadata,
|
|
9
|
+
onClick,
|
|
10
|
+
selected,
|
|
11
|
+
}) => {
|
|
12
|
+
return _.isUndefined(metadata) ? (
|
|
13
|
+
<path className={active ? "active link" : "link"} d={path} />
|
|
14
|
+
) : (
|
|
15
|
+
<path
|
|
16
|
+
className={
|
|
17
|
+
active ? (selected ? "active link metadata" : "link metadata") : "link"
|
|
18
|
+
}
|
|
19
|
+
d={path}
|
|
20
|
+
onClick={() => onClick(metadata)}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
7
24
|
|
|
8
25
|
LineageLink.propTypes = {
|
|
9
26
|
active: PropTypes.bool,
|
|
10
|
-
path: PropTypes.string.isRequired
|
|
27
|
+
path: PropTypes.string.isRequired,
|
|
28
|
+
onClick: PropTypes.func,
|
|
11
29
|
};
|
|
12
30
|
|
|
13
31
|
export default LineageLink;
|
package/src/messages/en.js
CHANGED
|
@@ -129,6 +129,8 @@ export default {
|
|
|
129
129
|
"lineage.graph.status.just_started": "Just started",
|
|
130
130
|
"lineage.graph.status.started": "Started",
|
|
131
131
|
"lineage.graph.status.timed_out": "Timed out",
|
|
132
|
+
"lineage.graph.metadata.header": "Information",
|
|
133
|
+
"lineage.graph.metadata.close.button": "Close",
|
|
132
134
|
"lineage.group.placeholder": "Select Top Level Structure",
|
|
133
135
|
"lineage.resources.placeholder": "Select Child Structures",
|
|
134
136
|
"lineage.subgroup.placeholder": "Select Child Structure",
|
package/src/messages/es.js
CHANGED
|
@@ -132,6 +132,8 @@ export default {
|
|
|
132
132
|
"lineage.graph.status.just_started": "Acaba de iniciarse",
|
|
133
133
|
"lineage.graph.status.started": "Iniciado",
|
|
134
134
|
"lineage.graph.status.timed_out": "Tiempo de espera máximo sobrepasado",
|
|
135
|
+
"lineage.graph.metadata.header": "Información",
|
|
136
|
+
"lineage.graph.metadata.close.button": "Cerrar",
|
|
135
137
|
"lineage.group.placeholder": "Seleccionar Estructura Padre",
|
|
136
138
|
"lineage.resources.placeholder": "Seleccionar Estructuras Hijos",
|
|
137
139
|
"lineage.subgroup.placeholder": "Seleccionar Estructura Hijo",
|