@backstage/plugin-catalog-graph 0.2.24-next.0 → 0.2.24-next.2
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 +25 -0
- package/dist/esm/{index-cb0bde74.esm.js → index-95a557a2.esm.js} +207 -216
- package/dist/esm/{index-cb0bde74.esm.js.map → index-95a557a2.esm.js.map} +1 -1
- package/dist/esm/{index-ce1d8556.esm.js → index-bc044dc0.esm.js} +30 -23
- package/dist/esm/{index-ce1d8556.esm.js.map → index-bc044dc0.esm.js.map} +1 -1
- package/dist/index.esm.js +66 -68
- package/dist/index.esm.js.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-graph
|
|
2
2
|
|
|
3
|
+
## 0.2.24-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 454f2e90db: Set the default `maxDepth` prop for `EntityRelationsGraph` to a smaller value to provide better readability.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/core-plugin-api@1.2.0-next.2
|
|
10
|
+
- @backstage/core-components@0.12.1-next.2
|
|
11
|
+
- @backstage/plugin-catalog-react@1.2.2-next.2
|
|
12
|
+
- @backstage/catalog-client@1.2.0-next.1
|
|
13
|
+
- @backstage/catalog-model@1.1.4-next.1
|
|
14
|
+
- @backstage/theme@0.2.16
|
|
15
|
+
|
|
16
|
+
## 0.2.24-next.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @backstage/core-components@0.12.1-next.1
|
|
22
|
+
- @backstage/core-plugin-api@1.1.1-next.1
|
|
23
|
+
- @backstage/plugin-catalog-react@1.2.2-next.1
|
|
24
|
+
- @backstage/catalog-client@1.2.0-next.1
|
|
25
|
+
- @backstage/catalog-model@1.1.4-next.1
|
|
26
|
+
- @backstage/theme@0.2.16
|
|
27
|
+
|
|
3
28
|
## 0.2.24-next.0
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -31,18 +31,18 @@ const CURVE_DISPLAY_NAMES = {
|
|
|
31
31
|
const curves = ["curveMonotoneX", "curveStepBefore"];
|
|
32
32
|
const CurveFilter = ({ value, onChange }) => {
|
|
33
33
|
const handleChange = useCallback((v) => onChange(v), [onChange]);
|
|
34
|
-
return /* @__PURE__ */ React.createElement(Box, {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
return /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(
|
|
35
|
+
Select,
|
|
36
|
+
{
|
|
37
|
+
label: "Curve",
|
|
38
|
+
selected: value,
|
|
39
|
+
items: curves.map((v) => ({
|
|
40
|
+
label: CURVE_DISPLAY_NAMES[v],
|
|
41
|
+
value: v
|
|
42
|
+
})),
|
|
43
|
+
onChange: handleChange
|
|
44
|
+
}
|
|
45
|
+
));
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
const DIRECTION_DISPLAY_NAMES = {
|
|
@@ -53,18 +53,18 @@ const DIRECTION_DISPLAY_NAMES = {
|
|
|
53
53
|
};
|
|
54
54
|
const DirectionFilter = ({ value, onChange }) => {
|
|
55
55
|
const handleChange = useCallback((v) => onChange(v), [onChange]);
|
|
56
|
-
return /* @__PURE__ */ React.createElement(Box, {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
return /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(
|
|
57
|
+
Select,
|
|
58
|
+
{
|
|
59
|
+
label: "Direction",
|
|
60
|
+
selected: value,
|
|
61
|
+
items: Object.values(Direction).map((v) => ({
|
|
62
|
+
label: DIRECTION_DISPLAY_NAMES[v],
|
|
63
|
+
value: v
|
|
64
|
+
})),
|
|
65
|
+
onChange: handleChange
|
|
66
|
+
}
|
|
67
|
+
));
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
const useStyles$4 = makeStyles(
|
|
@@ -99,31 +99,28 @@ const MaxDepthFilter = ({ value, onChange }) => {
|
|
|
99
99
|
setCurrentValue(Number.POSITIVE_INFINITY);
|
|
100
100
|
onChangeRef.current(Number.POSITIVE_INFINITY);
|
|
101
101
|
}, [onChangeRef]);
|
|
102
|
-
return /* @__PURE__ */ React.createElement(Box, {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
labelWidth: 0
|
|
126
|
-
})));
|
|
102
|
+
return /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(FormControl, { variant: "outlined", className: classes.formControl }, /* @__PURE__ */ React.createElement(Typography, { variant: "button" }, "Max Depth"), /* @__PURE__ */ React.createElement(
|
|
103
|
+
OutlinedInput,
|
|
104
|
+
{
|
|
105
|
+
type: "number",
|
|
106
|
+
placeholder: "\u221E Infinite",
|
|
107
|
+
value: Number.isFinite(currentValue) ? String(currentValue) : "",
|
|
108
|
+
onChange: handleChange,
|
|
109
|
+
endAdornment: /* @__PURE__ */ React.createElement(InputAdornment, { position: "end" }, /* @__PURE__ */ React.createElement(
|
|
110
|
+
IconButton,
|
|
111
|
+
{
|
|
112
|
+
"aria-label": "clear max depth",
|
|
113
|
+
onClick: reset,
|
|
114
|
+
edge: "end"
|
|
115
|
+
},
|
|
116
|
+
/* @__PURE__ */ React.createElement(ClearIcon, null)
|
|
117
|
+
)),
|
|
118
|
+
inputProps: {
|
|
119
|
+
"aria-label": "maxp"
|
|
120
|
+
},
|
|
121
|
+
labelWidth: 0
|
|
122
|
+
}
|
|
123
|
+
)));
|
|
127
124
|
};
|
|
128
125
|
|
|
129
126
|
const useStyles$3 = makeStyles(
|
|
@@ -170,49 +167,44 @@ const SelectedKindsFilter = ({ value, onChange }) => {
|
|
|
170
167
|
if (!(kinds == null ? void 0 : kinds.length) || !(normalizedKinds == null ? void 0 : normalizedKinds.length) || error) {
|
|
171
168
|
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
172
169
|
}
|
|
173
|
-
return /* @__PURE__ */ React.createElement(Box, {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, {
|
|
212
|
-
...params,
|
|
213
|
-
variant: "outlined"
|
|
214
|
-
})
|
|
215
|
-
}));
|
|
170
|
+
return /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "button" }, "Kinds"), /* @__PURE__ */ React.createElement(
|
|
171
|
+
Autocomplete,
|
|
172
|
+
{
|
|
173
|
+
className: classes.formControl,
|
|
174
|
+
multiple: true,
|
|
175
|
+
limitTags: 4,
|
|
176
|
+
disableCloseOnSelect: true,
|
|
177
|
+
"aria-label": "Kinds",
|
|
178
|
+
options: normalizedKinds,
|
|
179
|
+
value: value != null ? value : normalizedKinds,
|
|
180
|
+
getOptionLabel: (k) => {
|
|
181
|
+
var _a;
|
|
182
|
+
return (_a = kinds[normalizedKinds.indexOf(k)]) != null ? _a : k;
|
|
183
|
+
},
|
|
184
|
+
onChange: handleChange,
|
|
185
|
+
onBlur: handleEmpty,
|
|
186
|
+
renderOption: (option, { selected }) => {
|
|
187
|
+
var _a;
|
|
188
|
+
return /* @__PURE__ */ React.createElement(
|
|
189
|
+
FormControlLabel,
|
|
190
|
+
{
|
|
191
|
+
control: /* @__PURE__ */ React.createElement(
|
|
192
|
+
Checkbox,
|
|
193
|
+
{
|
|
194
|
+
icon: /* @__PURE__ */ React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" }),
|
|
195
|
+
checkedIcon: /* @__PURE__ */ React.createElement(CheckBoxIcon, { fontSize: "small" }),
|
|
196
|
+
checked: selected
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
label: (_a = kinds[normalizedKinds.indexOf(option)]) != null ? _a : option
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
},
|
|
203
|
+
size: "small",
|
|
204
|
+
popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, { "data-testid": "selected-kinds-expand" }),
|
|
205
|
+
renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, { ...params, variant: "outlined" })
|
|
206
|
+
}
|
|
207
|
+
));
|
|
216
208
|
};
|
|
217
209
|
|
|
218
210
|
const useStyles$2 = makeStyles(
|
|
@@ -239,42 +231,37 @@ const SelectedRelationsFilter = ({
|
|
|
239
231
|
const handleEmpty = useCallback(() => {
|
|
240
232
|
onChange((value == null ? void 0 : value.length) ? value : void 0);
|
|
241
233
|
}, [value, onChange]);
|
|
242
|
-
return /* @__PURE__ */ React.createElement(Box, {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, {
|
|
274
|
-
...params,
|
|
275
|
-
variant: "outlined"
|
|
276
|
-
})
|
|
277
|
-
}));
|
|
234
|
+
return /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(Typography, { variant: "button" }, "Relations"), /* @__PURE__ */ React.createElement(
|
|
235
|
+
Autocomplete,
|
|
236
|
+
{
|
|
237
|
+
className: classes.formControl,
|
|
238
|
+
multiple: true,
|
|
239
|
+
limitTags: 4,
|
|
240
|
+
disableCloseOnSelect: true,
|
|
241
|
+
"aria-label": "Relations",
|
|
242
|
+
options: relations,
|
|
243
|
+
value: value != null ? value : relations,
|
|
244
|
+
onChange: handleChange,
|
|
245
|
+
onBlur: handleEmpty,
|
|
246
|
+
renderOption: (option, { selected }) => /* @__PURE__ */ React.createElement(
|
|
247
|
+
FormControlLabel,
|
|
248
|
+
{
|
|
249
|
+
control: /* @__PURE__ */ React.createElement(
|
|
250
|
+
Checkbox,
|
|
251
|
+
{
|
|
252
|
+
icon: /* @__PURE__ */ React.createElement(CheckBoxOutlineBlankIcon, { fontSize: "small" }),
|
|
253
|
+
checkedIcon: /* @__PURE__ */ React.createElement(CheckBoxIcon, { fontSize: "small" }),
|
|
254
|
+
checked: selected
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
label: option
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
size: "small",
|
|
261
|
+
popupIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, { "data-testid": "selected-relations-expand" }),
|
|
262
|
+
renderInput: (params) => /* @__PURE__ */ React.createElement(TextField, { ...params, variant: "outlined" })
|
|
263
|
+
}
|
|
264
|
+
));
|
|
278
265
|
};
|
|
279
266
|
|
|
280
267
|
const useStyles$1 = makeStyles(
|
|
@@ -294,19 +281,22 @@ const SwitchFilter = ({ label, value, onChange }) => {
|
|
|
294
281
|
},
|
|
295
282
|
[onChange]
|
|
296
283
|
);
|
|
297
|
-
return /* @__PURE__ */ React.createElement(Box, {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
284
|
+
return /* @__PURE__ */ React.createElement(Box, { pb: 1, pt: 1 }, /* @__PURE__ */ React.createElement(
|
|
285
|
+
FormControlLabel,
|
|
286
|
+
{
|
|
287
|
+
control: /* @__PURE__ */ React.createElement(
|
|
288
|
+
Switch,
|
|
289
|
+
{
|
|
290
|
+
checked: value,
|
|
291
|
+
onChange: handleChange,
|
|
292
|
+
name: label,
|
|
293
|
+
color: "primary"
|
|
294
|
+
}
|
|
295
|
+
),
|
|
296
|
+
label,
|
|
297
|
+
className: classes.root
|
|
298
|
+
}
|
|
299
|
+
));
|
|
310
300
|
};
|
|
311
301
|
|
|
312
302
|
function useCatalogGraphPage({
|
|
@@ -580,81 +570,82 @@ const CatalogGraphPage = (props) => {
|
|
|
580
570
|
},
|
|
581
571
|
[catalogEntityRoute, navigate, setRootEntityNames, analytics]
|
|
582
572
|
);
|
|
583
|
-
return /* @__PURE__ */ React.createElement(Page, {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
573
|
+
return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(
|
|
574
|
+
Header,
|
|
575
|
+
{
|
|
576
|
+
title: "Catalog Graph",
|
|
577
|
+
subtitle: rootEntityNames.map((e) => humanizeEntityRef(e)).join(", ")
|
|
578
|
+
}
|
|
579
|
+
), /* @__PURE__ */ React.createElement(Content, { stretch: true, className: classes.content }, /* @__PURE__ */ React.createElement(
|
|
580
|
+
ContentHeader,
|
|
581
|
+
{
|
|
582
|
+
titleComponent: /* @__PURE__ */ React.createElement(
|
|
583
|
+
ToggleButton,
|
|
584
|
+
{
|
|
585
|
+
value: "show filters",
|
|
586
|
+
selected: showFilters,
|
|
587
|
+
onChange: () => toggleShowFilters()
|
|
588
|
+
},
|
|
589
|
+
/* @__PURE__ */ React.createElement(FilterListIcon, null),
|
|
590
|
+
" Filters"
|
|
591
|
+
)
|
|
592
|
+
},
|
|
593
|
+
/* @__PURE__ */ React.createElement(SupportButton, null, "Start tracking your component in by adding it to the software catalog.")
|
|
594
|
+
), /* @__PURE__ */ React.createElement(Grid, { container: true, alignItems: "stretch", className: classes.container }, showFilters && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12, lg: 2, className: classes.filters }, /* @__PURE__ */ React.createElement(MaxDepthFilter, { value: maxDepth, onChange: setMaxDepth }), /* @__PURE__ */ React.createElement(
|
|
595
|
+
SelectedKindsFilter,
|
|
596
|
+
{
|
|
597
|
+
value: selectedKinds,
|
|
598
|
+
onChange: setSelectedKinds
|
|
599
|
+
}
|
|
600
|
+
), /* @__PURE__ */ React.createElement(
|
|
601
|
+
SelectedRelationsFilter,
|
|
602
|
+
{
|
|
603
|
+
value: selectedRelations,
|
|
604
|
+
onChange: setSelectedRelations,
|
|
605
|
+
relationPairs
|
|
606
|
+
}
|
|
607
|
+
), /* @__PURE__ */ React.createElement(DirectionFilter, { value: direction, onChange: setDirection }), /* @__PURE__ */ React.createElement(CurveFilter, { value: curve, onChange: setCurve }), /* @__PURE__ */ React.createElement(
|
|
608
|
+
SwitchFilter,
|
|
609
|
+
{
|
|
610
|
+
value: unidirectional,
|
|
611
|
+
onChange: setUnidirectional,
|
|
612
|
+
label: "Simplified"
|
|
613
|
+
}
|
|
614
|
+
), /* @__PURE__ */ React.createElement(
|
|
615
|
+
SwitchFilter,
|
|
616
|
+
{
|
|
617
|
+
value: mergeRelations,
|
|
618
|
+
onChange: setMergeRelations,
|
|
619
|
+
label: "Merge Relations"
|
|
620
|
+
}
|
|
621
|
+
)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true, className: classes.fullHeight }, /* @__PURE__ */ React.createElement(Paper, { className: classes.graphWrapper }, /* @__PURE__ */ React.createElement(
|
|
622
|
+
Typography,
|
|
623
|
+
{
|
|
624
|
+
variant: "caption",
|
|
625
|
+
color: "textSecondary",
|
|
626
|
+
display: "block",
|
|
627
|
+
className: classes.legend
|
|
628
|
+
},
|
|
629
|
+
/* @__PURE__ */ React.createElement(ZoomOutMap, { className: "icon" }),
|
|
630
|
+
" Use pinch & zoom to move around the diagram. Click to change active node, shift click to navigate to entity."
|
|
631
|
+
), /* @__PURE__ */ React.createElement(
|
|
632
|
+
EntityRelationsGraph,
|
|
633
|
+
{
|
|
634
|
+
rootEntityNames,
|
|
635
|
+
maxDepth,
|
|
636
|
+
kinds: selectedKinds && selectedKinds.length > 0 ? selectedKinds : void 0,
|
|
637
|
+
relations: selectedRelations && selectedRelations.length > 0 ? selectedRelations : void 0,
|
|
638
|
+
mergeRelations,
|
|
639
|
+
unidirectional,
|
|
640
|
+
onNodeClick,
|
|
641
|
+
direction,
|
|
642
|
+
relationPairs,
|
|
643
|
+
className: classes.graph,
|
|
644
|
+
zoom: "enabled",
|
|
645
|
+
curve
|
|
646
|
+
}
|
|
647
|
+
))))));
|
|
657
648
|
};
|
|
658
649
|
|
|
659
650
|
export { CatalogGraphPage };
|
|
660
|
-
//# sourceMappingURL=index-
|
|
651
|
+
//# sourceMappingURL=index-95a557a2.esm.js.map
|