@backstage/plugin-catalog-graph 0.2.19 → 0.2.20

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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # @backstage/plugin-catalog-graph
2
2
 
3
+ ## 0.2.20
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/core-components@0.11.0
9
+ - @backstage/core-plugin-api@1.0.5
10
+ - @backstage/plugin-catalog-react@1.1.3
11
+
12
+ ## 0.2.20-next.1
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+ - @backstage/plugin-catalog-react@1.1.3-next.2
18
+ - @backstage/core-components@0.11.0-next.2
19
+
20
+ ## 0.2.20-next.0
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies
25
+ - @backstage/core-plugin-api@1.0.5-next.0
26
+ - @backstage/plugin-catalog-react@1.1.3-next.0
27
+ - @backstage/core-components@0.10.1-next.0
28
+
3
29
  ## 0.2.19
4
30
 
5
31
  ### Patch Changes
@@ -48,18 +48,28 @@ const CatalogGraphCard = (props) => {
48
48
  const navigate = useNavigate();
49
49
  const classes = useStyles({ height });
50
50
  const analytics = useAnalytics();
51
- const onNodeClick = useCallback((node, _) => {
52
- var _a;
53
- const nodeEntityName = parseEntityRef(node.id);
54
- const path = catalogEntityRoute({
55
- kind: nodeEntityName.kind.toLocaleLowerCase("en-US"),
56
- namespace: nodeEntityName.namespace.toLocaleLowerCase("en-US"),
57
- name: nodeEntityName.name
58
- });
59
- analytics.captureEvent("click", (_a = node.title) != null ? _a : humanizeEntityRef(nodeEntityName), { attributes: { to: path } });
60
- navigate(path);
61
- }, [catalogEntityRoute, navigate, analytics]);
62
- const catalogGraphParams = qs.stringify({ rootEntityRefs: [stringifyEntityRef(entity)] }, { arrayFormat: "brackets", addQueryPrefix: true });
51
+ const onNodeClick = useCallback(
52
+ (node, _) => {
53
+ var _a;
54
+ const nodeEntityName = parseEntityRef(node.id);
55
+ const path = catalogEntityRoute({
56
+ kind: nodeEntityName.kind.toLocaleLowerCase("en-US"),
57
+ namespace: nodeEntityName.namespace.toLocaleLowerCase("en-US"),
58
+ name: nodeEntityName.name
59
+ });
60
+ analytics.captureEvent(
61
+ "click",
62
+ (_a = node.title) != null ? _a : humanizeEntityRef(nodeEntityName),
63
+ { attributes: { to: path } }
64
+ );
65
+ navigate(path);
66
+ },
67
+ [catalogEntityRoute, navigate, analytics]
68
+ );
69
+ const catalogGraphParams = qs.stringify(
70
+ { rootEntityRefs: [stringifyEntityRef(entity)] },
71
+ { arrayFormat: "brackets", addQueryPrefix: true }
72
+ );
63
73
  const catalogGraphUrl = `${catalogGraphRoute()}${catalogGraphParams}`;
64
74
  return /* @__PURE__ */ React.createElement(InfoCard, {
65
75
  title,
@@ -86,4 +96,4 @@ const CatalogGraphCard = (props) => {
86
96
  };
87
97
 
88
98
  export { CatalogGraphCard };
89
- //# sourceMappingURL=index-5294ed16.esm.js.map
99
+ //# sourceMappingURL=index-05b530c3.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-5294ed16.esm.js","sources":["../../src/components/CatalogGraphCard/CatalogGraphCard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n getCompoundEntityRef,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\nimport { useAnalytics, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n humanizeEntityRef,\n useEntity,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { makeStyles, Theme } from '@material-ui/core';\nimport qs from 'qs';\nimport React, { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router';\nimport { catalogGraphRouteRef } from '../../routes';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n RelationPairs,\n} from '../EntityRelationsGraph';\n\nconst useStyles = makeStyles<Theme, { height: number | undefined }>({\n card: ({ height }) => ({\n display: 'flex',\n flexDirection: 'column',\n maxHeight: height,\n minHeight: height,\n }),\n graph: {\n flex: 1,\n minHeight: 0,\n },\n});\n\nexport const CatalogGraphCard = (props: {\n variant?: InfoCardVariants;\n relationPairs?: RelationPairs;\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n direction?: Direction;\n height?: number;\n title?: string;\n zoom?: 'enabled' | 'disabled' | 'enable-on-click';\n}) => {\n const {\n variant = 'gridItem',\n relationPairs = ALL_RELATION_PAIRS,\n maxDepth = 1,\n unidirectional = true,\n mergeRelations = true,\n kinds,\n relations,\n direction = Direction.LEFT_RIGHT,\n height,\n title = 'Relations',\n zoom = 'enable-on-click',\n } = props;\n\n const { entity } = useEntity();\n const entityName = getCompoundEntityRef(entity);\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const catalogGraphRoute = useRouteRef(catalogGraphRouteRef);\n const navigate = useNavigate();\n const classes = useStyles({ height });\n const analytics = useAnalytics();\n\n const onNodeClick = useCallback(\n (node: EntityNode, _: MouseEvent<unknown>) => {\n const nodeEntityName = parseEntityRef(node.id);\n const path = catalogEntityRoute({\n kind: nodeEntityName.kind.toLocaleLowerCase('en-US'),\n namespace: nodeEntityName.namespace.toLocaleLowerCase('en-US'),\n name: nodeEntityName.name,\n });\n analytics.captureEvent(\n 'click',\n node.title ?? humanizeEntityRef(nodeEntityName),\n { attributes: { to: path } },\n );\n navigate(path);\n },\n [catalogEntityRoute, navigate, analytics],\n );\n\n const catalogGraphParams = qs.stringify(\n { rootEntityRefs: [stringifyEntityRef(entity)] },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n const catalogGraphUrl = `${catalogGraphRoute()}${catalogGraphParams}`;\n\n return (\n <InfoCard\n title={title}\n cardClassName={classes.card}\n variant={variant}\n noPadding\n deepLink={{\n title: 'View graph',\n link: catalogGraphUrl,\n }}\n >\n <EntityRelationsGraph\n rootEntityNames={entityName}\n maxDepth={maxDepth}\n unidirectional={unidirectional}\n mergeRelations={mergeRelations}\n kinds={kinds}\n relations={relations}\n direction={direction}\n onNodeClick={onNodeClick}\n className={classes.graph}\n relationPairs={relationPairs}\n zoom={zoom}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAsBA,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM;AACzB,IAAI,OAAO,EAAE,MAAM;AACnB,IAAI,aAAa,EAAE,QAAQ;AAC3B,IAAI,SAAS,EAAE,MAAM;AACrB,IAAI,SAAS,EAAE,MAAM;AACrB,GAAG,CAAC;AACJ,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,SAAS,EAAE,CAAC;AAChB,GAAG;AACH,CAAC,CAAC,CAAC;AACS,MAAC,gBAAgB,GAAG,CAAC,KAAK,KAAK;AAC3C,EAAE,MAAM;AACR,IAAI,OAAO,GAAG,UAAU;AACxB,IAAI,aAAa,GAAG,kBAAkB;AACtC,IAAI,QAAQ,GAAG,CAAC;AAChB,IAAI,cAAc,GAAG,IAAI;AACzB,IAAI,cAAc,GAAG,IAAI;AACzB,IAAI,KAAK;AACT,IAAI,SAAS;AACb,IAAI,SAAS,GAAG,SAAS,CAAC,UAAU;AACpC,IAAI,MAAM;AACV,IAAI,KAAK,GAAG,WAAW;AACvB,IAAI,IAAI,GAAG,iBAAiB;AAC5B,GAAG,GAAG,KAAK,CAAC;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,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/I,EAAE,MAAM,eAAe,GAAG,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC;AACxE,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE;AACvD,IAAI,KAAK;AACT,IAAI,aAAa,EAAE,OAAO,CAAC,IAAI;AAC/B,IAAI,OAAO;AACX,IAAI,SAAS,EAAE,IAAI;AACnB,IAAI,QAAQ,EAAE;AACd,MAAM,KAAK,EAAE,YAAY;AACzB,MAAM,IAAI,EAAE,eAAe;AAC3B,KAAK;AACL,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,oBAAoB,EAAE;AAC/D,IAAI,eAAe,EAAE,UAAU;AAC/B,IAAI,QAAQ;AACZ,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,IAAI,KAAK;AACT,IAAI,SAAS;AACb,IAAI,SAAS;AACb,IAAI,WAAW;AACf,IAAI,SAAS,EAAE,OAAO,CAAC,KAAK;AAC5B,IAAI,aAAa;AACjB,IAAI,IAAI;AACR,GAAG,CAAC,CAAC,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"index-05b530c3.esm.js","sources":["../../src/components/CatalogGraphCard/CatalogGraphCard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n getCompoundEntityRef,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\nimport { useAnalytics, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n humanizeEntityRef,\n useEntity,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { makeStyles, Theme } from '@material-ui/core';\nimport qs from 'qs';\nimport React, { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router';\nimport { catalogGraphRouteRef } from '../../routes';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n RelationPairs,\n} from '../EntityRelationsGraph';\n\nconst useStyles = makeStyles<Theme, { height: number | undefined }>({\n card: ({ height }) => ({\n display: 'flex',\n flexDirection: 'column',\n maxHeight: height,\n minHeight: height,\n }),\n graph: {\n flex: 1,\n minHeight: 0,\n },\n});\n\nexport const CatalogGraphCard = (props: {\n variant?: InfoCardVariants;\n relationPairs?: RelationPairs;\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n direction?: Direction;\n height?: number;\n title?: string;\n zoom?: 'enabled' | 'disabled' | 'enable-on-click';\n}) => {\n const {\n variant = 'gridItem',\n relationPairs = ALL_RELATION_PAIRS,\n maxDepth = 1,\n unidirectional = true,\n mergeRelations = true,\n kinds,\n relations,\n direction = Direction.LEFT_RIGHT,\n height,\n title = 'Relations',\n zoom = 'enable-on-click',\n } = props;\n\n const { entity } = useEntity();\n const entityName = getCompoundEntityRef(entity);\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const catalogGraphRoute = useRouteRef(catalogGraphRouteRef);\n const navigate = useNavigate();\n const classes = useStyles({ height });\n const analytics = useAnalytics();\n\n const onNodeClick = useCallback(\n (node: EntityNode, _: MouseEvent<unknown>) => {\n const nodeEntityName = parseEntityRef(node.id);\n const path = catalogEntityRoute({\n kind: nodeEntityName.kind.toLocaleLowerCase('en-US'),\n namespace: nodeEntityName.namespace.toLocaleLowerCase('en-US'),\n name: nodeEntityName.name,\n });\n analytics.captureEvent(\n 'click',\n node.title ?? humanizeEntityRef(nodeEntityName),\n { attributes: { to: path } },\n );\n navigate(path);\n },\n [catalogEntityRoute, navigate, analytics],\n );\n\n const catalogGraphParams = qs.stringify(\n { rootEntityRefs: [stringifyEntityRef(entity)] },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n const catalogGraphUrl = `${catalogGraphRoute()}${catalogGraphParams}`;\n\n return (\n <InfoCard\n title={title}\n cardClassName={classes.card}\n variant={variant}\n noPadding\n deepLink={{\n title: 'View graph',\n link: catalogGraphUrl,\n }}\n >\n <EntityRelationsGraph\n rootEntityNames={entityName}\n maxDepth={maxDepth}\n unidirectional={unidirectional}\n mergeRelations={mergeRelations}\n kinds={kinds}\n relations={relations}\n direction={direction}\n onNodeClick={onNodeClick}\n className={classes.graph}\n relationPairs={relationPairs}\n zoom={zoom}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAsBA,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM;AACzB,IAAI,OAAO,EAAE,MAAM;AACnB,IAAI,aAAa,EAAE,QAAQ;AAC3B,IAAI,SAAS,EAAE,MAAM;AACrB,IAAI,SAAS,EAAE,MAAM;AACrB,GAAG,CAAC;AACJ,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,SAAS,EAAE,CAAC;AAChB,GAAG;AACH,CAAC,CAAC,CAAC;AACS,MAAC,gBAAgB,GAAG,CAAC,KAAK,KAAK;AAC3C,EAAE,MAAM;AACR,IAAI,OAAO,GAAG,UAAU;AACxB,IAAI,aAAa,GAAG,kBAAkB;AACtC,IAAI,QAAQ,GAAG,CAAC;AAChB,IAAI,cAAc,GAAG,IAAI;AACzB,IAAI,cAAc,GAAG,IAAI;AACzB,IAAI,KAAK;AACT,IA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AAI,EAAE,EAAE;AACpC,OAAO,CAAC;AACR,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;AACrB,KAAK;AACL,IAAI,CAAC,kBAAkB,EAAE,QAAQ,EAAE,SAAS,CAAC;AAC7C,GAAG,CAAC;AACJ,EAAE,MAAM,kBAAkB,GAAG,EAAE,CAAC,SAAS;AACzC,IAAI,EAAE,cAAc,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,EAAE;AACpD,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE;AACrD,GAAG,CAAC;AACJ,EAAE,MAAM,eAAe,GAAG,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC;AACxE,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE;AACvD,IAAI,KAAK;AACT,IAAI,aAAa,EAAE,OAAO,CAAC,IAAI;AAC/B,IAAI,OAAO;AACX,IAAI,SAAS,EAAE,IAAI;AACnB,IAAI,QAAQ,EAAE;AACd,MAAM,KAAK,EAAE,YAAY;AACzB,MAAM,IAAI,EAAE,eAAe;AAC3B,KAAK;AACL,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,oBAAoB,EAAE;AAC/D,IAAI,eAAe,EAAE,UAAU;AAC/B,IAAI,QAAQ;AACZ,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,IAAI,KAAK;AACT,IAAI,SAAS;AACb,IAAI,SAAS;AACb,IAAI,WAAW;AACf,IAAI,SAAS,EAAE,OAAO,CAAC,KAAK;AAC5B,IAAI,aAAa;AACjB,IAAI,IAAI;AACR,GAAG,CAAC,CAAC,CAAC;AACN;;;;"}
@@ -54,10 +54,13 @@ const useStyles$4 = makeStyles({
54
54
  });
55
55
  const MaxDepthFilter = ({ value, onChange }) => {
56
56
  const classes = useStyles$4();
57
- const handleChange = useCallback((event) => {
58
- const v = Number(event.target.value);
59
- onChange(v <= 0 ? Number.POSITIVE_INFINITY : v);
60
- }, [onChange]);
57
+ const handleChange = useCallback(
58
+ (event) => {
59
+ const v = Number(event.target.value);
60
+ onChange(v <= 0 ? Number.POSITIVE_INFINITY : v);
61
+ },
62
+ [onChange]
63
+ );
61
64
  const reset = useCallback(() => {
62
65
  onChange(Number.POSITIVE_INFINITY);
63
66
  }, [onChange]);
@@ -111,10 +114,18 @@ const SelectedKindsFilter = ({ value, onChange }) => {
111
114
  });
112
115
  }
113
116
  }, [error, alertApi]);
114
- const normalizedKinds = useMemo(() => kinds ? kinds.map((k) => k.toLocaleLowerCase("en-US")) : kinds, [kinds]);
115
- const handleChange = useCallback((_, v) => {
116
- onChange(normalizedKinds && normalizedKinds.every((r) => v.includes(r)) ? void 0 : v);
117
- }, [normalizedKinds, onChange]);
117
+ const normalizedKinds = useMemo(
118
+ () => kinds ? kinds.map((k) => k.toLocaleLowerCase("en-US")) : kinds,
119
+ [kinds]
120
+ );
121
+ const handleChange = useCallback(
122
+ (_, v) => {
123
+ onChange(
124
+ normalizedKinds && normalizedKinds.every((r) => v.includes(r)) ? void 0 : v
125
+ );
126
+ },
127
+ [normalizedKinds, onChange]
128
+ );
118
129
  const handleEmpty = useCallback(() => {
119
130
  onChange((value == null ? void 0 : value.length) ? value : void 0);
120
131
  }, [value, onChange]);
@@ -178,9 +189,12 @@ const SelectedRelationsFilter = ({
178
189
  }) => {
179
190
  const classes = useStyles$2();
180
191
  const relations = useMemo(() => relationPairs.flat(), [relationPairs]);
181
- const handleChange = useCallback((_, v) => {
182
- onChange(relations.every((r) => v.includes(r)) ? void 0 : v);
183
- }, [relations, onChange]);
192
+ const handleChange = useCallback(
193
+ (_, v) => {
194
+ onChange(relations.every((r) => v.includes(r)) ? void 0 : v);
195
+ },
196
+ [relations, onChange]
197
+ );
184
198
  const handleEmpty = useCallback(() => {
185
199
  onChange((value == null ? void 0 : value.length) ? value : void 0);
186
200
  }, [value, onChange]);
@@ -230,9 +244,12 @@ const useStyles$1 = makeStyles({
230
244
  });
231
245
  const SwitchFilter = ({ label, value, onChange }) => {
232
246
  const classes = useStyles$1();
233
- const handleChange = useCallback((event) => {
234
- onChange(event.target.checked);
235
- }, [onChange]);
247
+ const handleChange = useCallback(
248
+ (event) => {
249
+ onChange(event.target.checked);
250
+ },
251
+ [onChange]
252
+ );
236
253
  return /* @__PURE__ */ React.createElement(Box, {
237
254
  pb: 1,
238
255
  pt: 1
@@ -252,37 +269,59 @@ function useCatalogGraphPage({
252
269
  initialState = {}
253
270
  }) {
254
271
  const location = useLocation();
255
- const query = useMemo(() => qs.parse(location.search, { arrayLimit: 0, ignoreQueryPrefix: true }) || {}, [location.search]);
256
- const [rootEntityNames, setRootEntityNames] = useState(() => {
257
- var _a;
258
- return (Array.isArray(query.rootEntityRefs) ? query.rootEntityRefs : (_a = initialState == null ? void 0 : initialState.rootEntityRefs) != null ? _a : []).map((r) => parseEntityRef(r));
259
- });
260
- const [maxDepth, setMaxDepth] = useState(() => {
261
- var _a;
262
- return typeof query.maxDepth === "string" ? parseMaxDepth(query.maxDepth) : (_a = initialState == null ? void 0 : initialState.maxDepth) != null ? _a : Number.POSITIVE_INFINITY;
263
- });
264
- const [selectedRelations, setSelectedRelations] = useState(() => Array.isArray(query.selectedRelations) ? query.selectedRelations : initialState == null ? void 0 : initialState.selectedRelations);
265
- const [selectedKinds, setSelectedKinds] = useState(() => {
266
- var _a;
267
- return (_a = Array.isArray(query.selectedKinds) ? query.selectedKinds : initialState == null ? void 0 : initialState.selectedKinds) == null ? void 0 : _a.map((k) => k.toLocaleLowerCase("en-US"));
268
- });
269
- const [unidirectional, setUnidirectional] = useState(() => {
270
- var _a;
271
- return typeof query.unidirectional === "string" ? query.unidirectional === "true" : (_a = initialState == null ? void 0 : initialState.unidirectional) != null ? _a : true;
272
- });
273
- const [mergeRelations, setMergeRelations] = useState(() => {
274
- var _a;
275
- return typeof query.mergeRelations === "string" ? query.mergeRelations === "true" : (_a = initialState == null ? void 0 : initialState.mergeRelations) != null ? _a : true;
276
- });
277
- const [direction, setDirection] = useState(() => {
278
- var _a;
279
- return typeof query.direction === "string" ? query.direction : (_a = initialState == null ? void 0 : initialState.direction) != null ? _a : Direction.LEFT_RIGHT;
280
- });
281
- const [showFilters, setShowFilters] = useState(() => {
282
- var _a;
283
- return typeof query.showFilters === "string" ? query.showFilters === "true" : (_a = initialState == null ? void 0 : initialState.showFilters) != null ? _a : true;
284
- });
285
- const toggleShowFilters = useCallback(() => setShowFilters((s) => !s), [setShowFilters]);
272
+ const query = useMemo(
273
+ () => qs.parse(location.search, { arrayLimit: 0, ignoreQueryPrefix: true }) || {},
274
+ [location.search]
275
+ );
276
+ const [rootEntityNames, setRootEntityNames] = useState(
277
+ () => {
278
+ var _a;
279
+ return (Array.isArray(query.rootEntityRefs) ? query.rootEntityRefs : (_a = initialState == null ? void 0 : initialState.rootEntityRefs) != null ? _a : []).map((r) => parseEntityRef(r));
280
+ }
281
+ );
282
+ const [maxDepth, setMaxDepth] = useState(
283
+ () => {
284
+ var _a;
285
+ return typeof query.maxDepth === "string" ? parseMaxDepth(query.maxDepth) : (_a = initialState == null ? void 0 : initialState.maxDepth) != null ? _a : Number.POSITIVE_INFINITY;
286
+ }
287
+ );
288
+ const [selectedRelations, setSelectedRelations] = useState(
289
+ () => Array.isArray(query.selectedRelations) ? query.selectedRelations : initialState == null ? void 0 : initialState.selectedRelations
290
+ );
291
+ const [selectedKinds, setSelectedKinds] = useState(
292
+ () => {
293
+ var _a;
294
+ return (_a = Array.isArray(query.selectedKinds) ? query.selectedKinds : initialState == null ? void 0 : initialState.selectedKinds) == null ? void 0 : _a.map((k) => k.toLocaleLowerCase("en-US"));
295
+ }
296
+ );
297
+ const [unidirectional, setUnidirectional] = useState(
298
+ () => {
299
+ var _a;
300
+ return typeof query.unidirectional === "string" ? query.unidirectional === "true" : (_a = initialState == null ? void 0 : initialState.unidirectional) != null ? _a : true;
301
+ }
302
+ );
303
+ const [mergeRelations, setMergeRelations] = useState(
304
+ () => {
305
+ var _a;
306
+ return typeof query.mergeRelations === "string" ? query.mergeRelations === "true" : (_a = initialState == null ? void 0 : initialState.mergeRelations) != null ? _a : true;
307
+ }
308
+ );
309
+ const [direction, setDirection] = useState(
310
+ () => {
311
+ var _a;
312
+ return typeof query.direction === "string" ? query.direction : (_a = initialState == null ? void 0 : initialState.direction) != null ? _a : Direction.LEFT_RIGHT;
313
+ }
314
+ );
315
+ const [showFilters, setShowFilters] = useState(
316
+ () => {
317
+ var _a;
318
+ return typeof query.showFilters === "string" ? query.showFilters === "true" : (_a = initialState == null ? void 0 : initialState.showFilters) != null ? _a : true;
319
+ }
320
+ );
321
+ const toggleShowFilters = useCallback(
322
+ () => setShowFilters((s) => !s),
323
+ [setShowFilters]
324
+ );
286
325
  const prevQueryParams = usePrevious(location.search);
287
326
  useEffect(() => {
288
327
  if (location.search === prevQueryParams) {
@@ -325,19 +364,24 @@ function useCatalogGraphPage({
325
364
  setDirection,
326
365
  setShowFilters
327
366
  ]);
328
- const previousRootEntityRefs = usePrevious(rootEntityNames.map((e) => stringifyEntityRef(e)));
367
+ const previousRootEntityRefs = usePrevious(
368
+ rootEntityNames.map((e) => stringifyEntityRef(e))
369
+ );
329
370
  useEffect(() => {
330
371
  const rootEntityRefs = rootEntityNames.map((e) => stringifyEntityRef(e));
331
- const newParams = qs.stringify({
332
- rootEntityRefs,
333
- maxDepth: isFinite(maxDepth) ? maxDepth : "\u221E",
334
- selectedKinds,
335
- selectedRelations,
336
- unidirectional,
337
- mergeRelations,
338
- direction,
339
- showFilters
340
- }, { arrayFormat: "brackets", addQueryPrefix: true });
372
+ const newParams = qs.stringify(
373
+ {
374
+ rootEntityRefs,
375
+ maxDepth: isFinite(maxDepth) ? maxDepth : "\u221E",
376
+ selectedKinds,
377
+ selectedRelations,
378
+ unidirectional,
379
+ mergeRelations,
380
+ direction,
381
+ showFilters
382
+ },
383
+ { arrayFormat: "brackets", addQueryPrefix: true }
384
+ );
341
385
  const newUrl = `${window.location.pathname}${newParams}`;
342
386
  if (!previousRootEntityRefs || rootEntityRefs.length === previousRootEntityRefs.length && rootEntityRefs.every((v, i) => v === previousRootEntityRefs[i])) {
343
387
  window.history.replaceState(null, document.title, newUrl);
@@ -453,22 +497,32 @@ const CatalogGraphPage = (props) => {
453
497
  toggleShowFilters
454
498
  } = useCatalogGraphPage({ initialState });
455
499
  const analytics = useAnalytics();
456
- const onNodeClick = useCallback((node, event) => {
457
- var _a, _b;
458
- const nodeEntityName = parseEntityRef(node.id);
459
- if (event.shiftKey) {
460
- const path = catalogEntityRoute({
461
- kind: nodeEntityName.kind.toLocaleLowerCase("en-US"),
462
- namespace: nodeEntityName.namespace.toLocaleLowerCase("en-US"),
463
- name: nodeEntityName.name
464
- });
465
- analytics.captureEvent("click", (_a = node.title) != null ? _a : humanizeEntityRef(nodeEntityName), { attributes: { to: path } });
466
- navigate(path);
467
- } else {
468
- analytics.captureEvent("click", (_b = node.title) != null ? _b : humanizeEntityRef(nodeEntityName));
469
- setRootEntityNames([nodeEntityName]);
470
- }
471
- }, [catalogEntityRoute, navigate, setRootEntityNames, analytics]);
500
+ const onNodeClick = useCallback(
501
+ (node, event) => {
502
+ var _a, _b;
503
+ const nodeEntityName = parseEntityRef(node.id);
504
+ if (event.shiftKey) {
505
+ const path = catalogEntityRoute({
506
+ kind: nodeEntityName.kind.toLocaleLowerCase("en-US"),
507
+ namespace: nodeEntityName.namespace.toLocaleLowerCase("en-US"),
508
+ name: nodeEntityName.name
509
+ });
510
+ analytics.captureEvent(
511
+ "click",
512
+ (_a = node.title) != null ? _a : humanizeEntityRef(nodeEntityName),
513
+ { attributes: { to: path } }
514
+ );
515
+ navigate(path);
516
+ } else {
517
+ analytics.captureEvent(
518
+ "click",
519
+ (_b = node.title) != null ? _b : humanizeEntityRef(nodeEntityName)
520
+ );
521
+ setRootEntityNames([nodeEntityName]);
522
+ }
523
+ },
524
+ [catalogEntityRoute, navigate, setRootEntityNames, analytics]
525
+ );
472
526
  return /* @__PURE__ */ React.createElement(Page, {
473
527
  themeId: "home"
474
528
  }, /* @__PURE__ */ React.createElement(Header, {
@@ -542,4 +596,4 @@ const CatalogGraphPage = (props) => {
542
596
  };
543
597
 
544
598
  export { CatalogGraphPage };
545
- //# sourceMappingURL=index-97452b61.esm.js.map
599
+ //# sourceMappingURL=index-13b9a6d5.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-97452b61.esm.js","sources":["../../src/components/CatalogGraphPage/DirectionFilter.tsx","../../src/components/CatalogGraphPage/MaxDepthFilter.tsx","../../src/components/CatalogGraphPage/SelectedKindsFilter.tsx","../../src/components/CatalogGraphPage/SelectedRelationsFilter.tsx","../../src/components/CatalogGraphPage/SwitchFilter.tsx","../../src/components/CatalogGraphPage/useCatalogGraphPage.ts","../../src/components/CatalogGraphPage/CatalogGraphPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Select } from '@backstage/core-components';\nimport { Box } from '@material-ui/core';\nimport React, { useCallback } from 'react';\nimport { Direction } from '../EntityRelationsGraph';\n\nconst DIRECTION_DISPLAY_NAMES = {\n [Direction.LEFT_RIGHT]: 'Left to right',\n [Direction.RIGHT_LEFT]: 'Right to left',\n [Direction.TOP_BOTTOM]: 'Top to bottom',\n [Direction.BOTTOM_TOP]: 'Bottom to top',\n};\n\nexport type Props = {\n value: Direction;\n onChange: (value: Direction) => void;\n};\n\nexport const DirectionFilter = ({ value, onChange }: Props) => {\n const handleChange = useCallback(v => onChange(v as Direction), [onChange]);\n\n return (\n <Box pb={1} pt={1}>\n <Select\n label=\"Direction\"\n selected={value}\n items={Object.values(Direction).map(v => ({\n label: DIRECTION_DISPLAY_NAMES[v],\n value: v,\n }))}\n onChange={handleChange}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Box,\n FormControl,\n IconButton,\n InputAdornment,\n makeStyles,\n OutlinedInput,\n Typography,\n} from '@material-ui/core';\nimport ClearIcon from '@material-ui/icons/Clear';\nimport React, { useCallback } from 'react';\n\nexport type Props = {\n value: number;\n onChange: (value: number) => void;\n};\n\nconst useStyles = makeStyles({\n formControl: {\n width: '100%',\n maxWidth: 300,\n },\n});\n\nexport const MaxDepthFilter = ({ value, onChange }: Props) => {\n const classes = useStyles();\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const v = Number(event.target.value);\n onChange(v <= 0 ? Number.POSITIVE_INFINITY : v);\n },\n [onChange],\n );\n\n const reset = useCallback(() => {\n onChange(Number.POSITIVE_INFINITY);\n }, [onChange]);\n\n return (\n <Box pb={1} pt={1}>\n <FormControl variant=\"outlined\" className={classes.formControl}>\n <Typography variant=\"button\">Max Depth</Typography>\n <OutlinedInput\n type=\"number\"\n placeholder=\"∞ Infinite\"\n value={isFinite(value) ? value : ''}\n onChange={handleChange}\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"clear max depth\"\n onClick={reset}\n edge=\"end\"\n >\n <ClearIcon />\n </IconButton>\n </InputAdornment>\n }\n inputProps={{\n 'aria-label': 'maxp',\n }}\n labelWidth={0}\n />\n </FormControl>\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\n\nconst useStyles = makeStyles({\n formControl: {\n maxWidth: 300,\n },\n});\n\nexport type Props = {\n value: string[] | undefined;\n onChange: (value: string[] | undefined) => void;\n};\n\nexport const SelectedKindsFilter = ({ value, onChange }: Props) => {\n const classes = useStyles();\n const alertApi = useApi(alertApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n const { error, value: kinds } = useAsync(async () => {\n return await catalogApi\n .getEntityFacets({ facets: ['kind'] })\n .then(response => response.facets.kind?.map(f => f.value).sort() || []);\n });\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load entity kinds`,\n severity: 'error',\n });\n }\n }, [error, alertApi]);\n\n const normalizedKinds = useMemo(\n () => (kinds ? kinds.map(k => k.toLocaleLowerCase('en-US')) : kinds),\n [kinds],\n );\n\n const handleChange = useCallback(\n (_: unknown, v: string[]) => {\n onChange(\n normalizedKinds && normalizedKinds.every(r => v.includes(r))\n ? undefined\n : v,\n );\n },\n [normalizedKinds, onChange],\n );\n\n const handleEmpty = useCallback(() => {\n onChange(value?.length ? value : undefined);\n }, [value, onChange]);\n\n if (!kinds?.length || !normalizedKinds?.length || error) {\n return <></>;\n }\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Kinds</Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label=\"Kinds\"\n options={normalizedKinds}\n value={value ?? normalizedKinds}\n getOptionLabel={k => kinds[normalizedKinds.indexOf(k)] ?? k}\n onChange={handleChange}\n onBlur={handleEmpty}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={<CheckBoxOutlineBlankIcon fontSize=\"small\" />}\n checkedIcon={<CheckBoxIcon fontSize=\"small\" />}\n checked={selected}\n />\n }\n label={kinds[normalizedKinds.indexOf(option)] ?? option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"selected-kinds-expand\" />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useCallback, useMemo } from 'react';\nimport { RelationPairs } from '../EntityRelationsGraph';\n\nconst useStyles = makeStyles({\n formControl: {\n maxWidth: 300,\n },\n});\n\nexport type Props = {\n relationPairs: RelationPairs;\n value: string[] | undefined;\n onChange: (value: string[] | undefined) => void;\n};\n\nexport const SelectedRelationsFilter = ({\n relationPairs,\n value,\n onChange,\n}: Props) => {\n const classes = useStyles();\n const relations = useMemo(() => relationPairs.flat(), [relationPairs]);\n\n const handleChange = useCallback(\n (_: unknown, v: string[]) => {\n onChange(relations.every(r => v.includes(r)) ? undefined : v);\n },\n [relations, onChange],\n );\n\n const handleEmpty = useCallback(() => {\n onChange(value?.length ? value : undefined);\n }, [value, onChange]);\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Relations</Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label=\"Relations\"\n options={relations}\n value={value ?? relations}\n onChange={handleChange}\n onBlur={handleEmpty}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={<CheckBoxOutlineBlankIcon fontSize=\"small\" />}\n checkedIcon={<CheckBoxIcon fontSize=\"small\" />}\n checked={selected}\n />\n }\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"selected-relations-expand\" />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Box, FormControlLabel, makeStyles, Switch } from '@material-ui/core';\nimport React, { useCallback } from 'react';\n\nexport type Props = {\n label: string;\n value: boolean;\n onChange: (value: boolean) => void;\n};\n\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n maxWidth: 300,\n },\n});\n\nexport const SwitchFilter = ({ label, value, onChange }: Props) => {\n const classes = useStyles();\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange(event.target.checked);\n },\n [onChange],\n );\n\n return (\n <Box pb={1} pt={1}>\n <FormControlLabel\n control={\n <Switch\n checked={value}\n onChange={handleChange}\n name={label}\n color=\"primary\"\n />\n }\n label={label}\n className={classes.root}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n CompoundEntityRef,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport qs from 'qs';\nimport {\n Dispatch,\n DispatchWithoutAction,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { useLocation } from 'react-router';\nimport usePrevious from 'react-use/lib/usePrevious';\nimport { Direction } from '../EntityRelationsGraph';\n\nexport type CatalogGraphPageValue = {\n rootEntityNames: CompoundEntityRef[];\n setRootEntityNames: Dispatch<React.SetStateAction<CompoundEntityRef[]>>;\n maxDepth: number;\n setMaxDepth: Dispatch<React.SetStateAction<number>>;\n selectedRelations: string[] | undefined;\n setSelectedRelations: Dispatch<React.SetStateAction<string[] | undefined>>;\n selectedKinds: string[] | undefined;\n setSelectedKinds: Dispatch<React.SetStateAction<string[] | undefined>>;\n unidirectional: boolean;\n setUnidirectional: Dispatch<React.SetStateAction<boolean>>;\n mergeRelations: boolean;\n setMergeRelations: Dispatch<React.SetStateAction<boolean>>;\n direction: Direction;\n setDirection: Dispatch<React.SetStateAction<Direction>>;\n showFilters: boolean;\n toggleShowFilters: DispatchWithoutAction;\n};\n\nexport function useCatalogGraphPage({\n initialState = {},\n}: {\n initialState?: {\n selectedRelations?: string[] | undefined;\n selectedKinds?: string[] | undefined;\n rootEntityRefs?: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n direction?: Direction;\n showFilters?: boolean;\n };\n}): CatalogGraphPageValue {\n const location = useLocation();\n const query = useMemo(\n () =>\n (qs.parse(location.search, { arrayLimit: 0, ignoreQueryPrefix: true }) ||\n {}) as {\n selectedRelations?: string[] | string;\n selectedKinds?: string[] | string;\n rootEntityRefs?: string[] | string;\n maxDepth?: string[] | string;\n unidirectional?: string[] | string;\n mergeRelations?: string[] | string;\n direction?: string[] | Direction;\n showFilters?: string[] | string;\n },\n [location.search],\n );\n\n // Initial state\n const [rootEntityNames, setRootEntityNames] = useState<CompoundEntityRef[]>(\n () =>\n (Array.isArray(query.rootEntityRefs)\n ? query.rootEntityRefs\n : initialState?.rootEntityRefs ?? []\n ).map(r => parseEntityRef(r)),\n );\n const [maxDepth, setMaxDepth] = useState<number>(() =>\n typeof query.maxDepth === 'string'\n ? parseMaxDepth(query.maxDepth)\n : initialState?.maxDepth ?? Number.POSITIVE_INFINITY,\n );\n const [selectedRelations, setSelectedRelations] = useState<\n string[] | undefined\n >(() =>\n Array.isArray(query.selectedRelations)\n ? query.selectedRelations\n : initialState?.selectedRelations,\n );\n const [selectedKinds, setSelectedKinds] = useState<string[] | undefined>(() =>\n (Array.isArray(query.selectedKinds)\n ? query.selectedKinds\n : initialState?.selectedKinds\n )?.map(k => k.toLocaleLowerCase('en-US')),\n );\n const [unidirectional, setUnidirectional] = useState<boolean>(() =>\n typeof query.unidirectional === 'string'\n ? query.unidirectional === 'true'\n : initialState?.unidirectional ?? true,\n );\n const [mergeRelations, setMergeRelations] = useState<boolean>(() =>\n typeof query.mergeRelations === 'string'\n ? query.mergeRelations === 'true'\n : initialState?.mergeRelations ?? true,\n );\n const [direction, setDirection] = useState<Direction>(() =>\n typeof query.direction === 'string'\n ? query.direction\n : initialState?.direction ?? Direction.LEFT_RIGHT,\n );\n const [showFilters, setShowFilters] = useState<boolean>(() =>\n typeof query.showFilters === 'string'\n ? query.showFilters === 'true'\n : initialState?.showFilters ?? true,\n );\n const toggleShowFilters = useCallback(\n () => setShowFilters(s => !s),\n [setShowFilters],\n );\n\n // Update from query parameters\n const prevQueryParams = usePrevious(location.search);\n useEffect(() => {\n // Only respond to changes to url query params\n if (location.search === prevQueryParams) {\n return;\n }\n\n if (Array.isArray(query.rootEntityRefs)) {\n setRootEntityNames(query.rootEntityRefs.map(r => parseEntityRef(r)));\n }\n\n if (typeof query.maxDepth === 'string') {\n setMaxDepth(parseMaxDepth(query.maxDepth));\n }\n\n if (Array.isArray(query.selectedKinds)) {\n setSelectedKinds(query.selectedKinds);\n }\n\n if (Array.isArray(query.selectedRelations)) {\n setSelectedRelations(query.selectedRelations);\n }\n\n if (typeof query.unidirectional === 'string') {\n setUnidirectional(query.unidirectional === 'true');\n }\n\n if (typeof query.mergeRelations === 'string') {\n setMergeRelations(query.mergeRelations === 'true');\n }\n\n if (typeof query.direction === 'string') {\n setDirection(query.direction);\n }\n\n if (typeof query.showFilters === 'string') {\n setShowFilters(query.showFilters === 'true');\n }\n }, [\n prevQueryParams,\n location.search,\n query,\n setRootEntityNames,\n setMaxDepth,\n setSelectedKinds,\n setSelectedRelations,\n setUnidirectional,\n setMergeRelations,\n setDirection,\n setShowFilters,\n ]);\n\n // Update query parameters\n const previousRootEntityRefs = usePrevious(\n rootEntityNames.map(e => stringifyEntityRef(e)),\n );\n\n useEffect(() => {\n const rootEntityRefs = rootEntityNames.map(e => stringifyEntityRef(e));\n const newParams = qs.stringify(\n {\n rootEntityRefs,\n maxDepth: isFinite(maxDepth) ? maxDepth : '∞',\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n const newUrl = `${window.location.pathname}${newParams}`;\n\n // We directly manipulate window history here in order to not re-render\n // infinitely (state => location => state => etc). The intention of this\n // code is just to ensure the right query/filters are loaded when a user\n // clicks the \"back\" button after clicking a result.\n // Only push a new history entry if we switched to another entity, but not\n // if we just changed a viewer setting.\n if (\n !previousRootEntityRefs ||\n (rootEntityRefs.length === previousRootEntityRefs.length &&\n rootEntityRefs.every((v, i) => v === previousRootEntityRefs[i]))\n ) {\n window.history.replaceState(null, document.title, newUrl);\n } else {\n window.history.pushState(null, document.title, newUrl);\n }\n }, [\n rootEntityNames,\n maxDepth,\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n previousRootEntityRefs,\n ]);\n\n return {\n rootEntityNames,\n setRootEntityNames,\n maxDepth,\n setMaxDepth,\n selectedRelations,\n setSelectedRelations,\n selectedKinds,\n setSelectedKinds,\n unidirectional,\n setUnidirectional,\n mergeRelations,\n setMergeRelations,\n direction,\n setDirection,\n showFilters,\n toggleShowFilters,\n };\n}\n\nfunction parseMaxDepth(value: string): number {\n return value === '∞' ? Number.POSITIVE_INFINITY : Number(value);\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport {\n Content,\n ContentHeader,\n Header,\n Page,\n SupportButton,\n} from '@backstage/core-components';\nimport { useAnalytics, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n entityRouteRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport { Grid, makeStyles, Paper, Typography } from '@material-ui/core';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport ZoomOutMap from '@material-ui/icons/ZoomOutMap';\nimport { ToggleButton } from '@material-ui/lab';\nimport React, { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n RelationPairs,\n} from '../EntityRelationsGraph';\nimport { DirectionFilter } from './DirectionFilter';\nimport { MaxDepthFilter } from './MaxDepthFilter';\nimport { SelectedKindsFilter } from './SelectedKindsFilter';\nimport { SelectedRelationsFilter } from './SelectedRelationsFilter';\nimport { SwitchFilter } from './SwitchFilter';\nimport { useCatalogGraphPage } from './useCatalogGraphPage';\n\nconst useStyles = makeStyles(theme => ({\n content: {\n minHeight: 0,\n },\n container: {\n height: '100%',\n maxHeight: '100%',\n minHeight: 0,\n },\n fullHeight: {\n maxHeight: '100%',\n display: 'flex',\n minHeight: 0,\n },\n graphWrapper: {\n position: 'relative',\n flex: 1,\n minHeight: 0,\n display: 'flex',\n },\n graph: {\n flex: 1,\n minHeight: 0,\n },\n legend: {\n position: 'absolute',\n bottom: 0,\n right: 0,\n padding: theme.spacing(1),\n '& .icon': {\n verticalAlign: 'bottom',\n },\n },\n filters: {\n display: 'grid',\n gridGap: theme.spacing(1),\n gridAutoRows: 'auto',\n [theme.breakpoints.up('lg')]: {\n display: 'block',\n },\n [theme.breakpoints.only('md')]: {\n gridTemplateColumns: 'repeat(3, 1fr)',\n },\n [theme.breakpoints.only('sm')]: {\n gridTemplateColumns: 'repeat(2, 1fr)',\n },\n [theme.breakpoints.down('xs')]: {\n gridTemplateColumns: 'repeat(1, 1fr)',\n },\n },\n}));\n\nexport const CatalogGraphPage = (props: {\n relationPairs?: RelationPairs;\n initialState?: {\n selectedRelations?: string[];\n selectedKinds?: string[];\n rootEntityRefs?: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n direction?: Direction;\n showFilters?: boolean;\n };\n}) => {\n const { relationPairs = ALL_RELATION_PAIRS, initialState } = props;\n\n const navigate = useNavigate();\n const classes = useStyles();\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const {\n maxDepth,\n setMaxDepth,\n selectedKinds,\n setSelectedKinds,\n selectedRelations,\n setSelectedRelations,\n unidirectional,\n setUnidirectional,\n mergeRelations,\n setMergeRelations,\n direction,\n setDirection,\n rootEntityNames,\n setRootEntityNames,\n showFilters,\n toggleShowFilters,\n } = useCatalogGraphPage({ initialState });\n const analytics = useAnalytics();\n const onNodeClick = useCallback(\n (node: EntityNode, event: MouseEvent<unknown>) => {\n const nodeEntityName = parseEntityRef(node.id);\n\n if (event.shiftKey) {\n const path = catalogEntityRoute({\n kind: nodeEntityName.kind.toLocaleLowerCase('en-US'),\n namespace: nodeEntityName.namespace.toLocaleLowerCase('en-US'),\n name: nodeEntityName.name,\n });\n\n analytics.captureEvent(\n 'click',\n node.title ?? humanizeEntityRef(nodeEntityName),\n { attributes: { to: path } },\n );\n navigate(path);\n } else {\n analytics.captureEvent(\n 'click',\n node.title ?? humanizeEntityRef(nodeEntityName),\n );\n setRootEntityNames([nodeEntityName]);\n }\n },\n [catalogEntityRoute, navigate, setRootEntityNames, analytics],\n );\n\n return (\n <Page themeId=\"home\">\n <Header\n title=\"Catalog Graph\"\n subtitle={rootEntityNames.map(e => humanizeEntityRef(e)).join(', ')}\n />\n <Content stretch className={classes.content}>\n <ContentHeader\n titleComponent={\n <ToggleButton\n value=\"show filters\"\n selected={showFilters}\n onChange={() => toggleShowFilters()}\n >\n <FilterListIcon /> Filters\n </ToggleButton>\n }\n >\n <SupportButton>\n Start tracking your component in by adding it to the software\n catalog.\n </SupportButton>\n </ContentHeader>\n <Grid container alignItems=\"stretch\" className={classes.container}>\n {showFilters && (\n <Grid item xs={12} lg={2} className={classes.filters}>\n <MaxDepthFilter value={maxDepth} onChange={setMaxDepth} />\n <SelectedKindsFilter\n value={selectedKinds}\n onChange={setSelectedKinds}\n />\n <SelectedRelationsFilter\n value={selectedRelations}\n onChange={setSelectedRelations}\n relationPairs={relationPairs}\n />\n <DirectionFilter value={direction} onChange={setDirection} />\n <SwitchFilter\n value={unidirectional}\n onChange={setUnidirectional}\n label=\"Simplified\"\n />\n <SwitchFilter\n value={mergeRelations}\n onChange={setMergeRelations}\n label=\"Merge Relations\"\n />\n </Grid>\n )}\n <Grid item xs className={classes.fullHeight}>\n <Paper className={classes.graphWrapper}>\n <Typography\n variant=\"caption\"\n color=\"textSecondary\"\n display=\"block\"\n className={classes.legend}\n >\n <ZoomOutMap className=\"icon\" /> Use pinch &amp; zoom to move\n around the diagram. Click to change active node, shift click to\n navigate to entity.\n </Typography>\n <EntityRelationsGraph\n rootEntityNames={rootEntityNames}\n maxDepth={maxDepth}\n kinds={\n selectedKinds && selectedKinds.length > 0\n ? selectedKinds\n : undefined\n }\n relations={\n selectedRelations && selectedRelations.length > 0\n ? selectedRelations\n : undefined\n }\n mergeRelations={mergeRelations}\n unidirectional={unidirectional}\n onNodeClick={onNodeClick}\n direction={direction}\n relationPairs={relationPairs}\n className={classes.graph}\n zoom=\"enabled\"\n />\n </Paper>\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,uBAAuB,GAAG;AAChC,EAAE,CAAC,SAAS,CAAC,UAAU,GAAG,eAAe;AACzC,EAAE,CAAC,SAAS,CAAC,UAAU,GAAG,eAAe;AACzC,EAAE,CAAC,SAAS,CAAC,UAAU,GAAG,eAAe;AACzC,EAAE,CAAC,SAAS,CAAC,UAAU,GAAG,eAAe;AACzC,CAAC,CAAC;AACK,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK;AACxD,EAAE,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnE,EAAE,uB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CAAC,MAAM;AAC7B,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,UAAU,EAAE;AACrD,IAAI,SAAS,EAAE,MAAM;AACrB,GAAG,CAAC,EAAE,+GAA+G,CAAC,kBAAkB,KAAK,CAAC,aAAa,CAAC,oBAAoB,EAAE;AAClL,IAAI,eAAe;AACnB,IAAI,QAAQ;AACZ,IAAI,KAAK,EAAE,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,GAAG,aAAa,GAAG,KAAK,CAAC;AAC7E,IAAI,SAAS,EAAE,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,GAAG,iBAAiB,GAAG,KAAK,CAAC;AAC7F,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,IAAI,WAAW;AACf,IAAI,SAAS;AACb,IAAI,aAAa;AACjB,IAAI,SAAS,EAAE,OAAO,CAAC,KAAK;AAC5B,IAAI,IAAI,EAAE,SAAS;AACnB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACV;;;;"}
1
+ {"version":3,"file":"index-13b9a6d5.esm.js","sources":["../../src/components/CatalogGraphPage/DirectionFilter.tsx","../../src/components/CatalogGraphPage/MaxDepthFilter.tsx","../../src/components/CatalogGraphPage/SelectedKindsFilter.tsx","../../src/components/CatalogGraphPage/SelectedRelationsFilter.tsx","../../src/components/CatalogGraphPage/SwitchFilter.tsx","../../src/components/CatalogGraphPage/useCatalogGraphPage.ts","../../src/components/CatalogGraphPage/CatalogGraphPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Select } from '@backstage/core-components';\nimport { Box } from '@material-ui/core';\nimport React, { useCallback } from 'react';\nimport { Direction } from '../EntityRelationsGraph';\n\nconst DIRECTION_DISPLAY_NAMES = {\n [Direction.LEFT_RIGHT]: 'Left to right',\n [Direction.RIGHT_LEFT]: 'Right to left',\n [Direction.TOP_BOTTOM]: 'Top to bottom',\n [Direction.BOTTOM_TOP]: 'Bottom to top',\n};\n\nexport type Props = {\n value: Direction;\n onChange: (value: Direction) => void;\n};\n\nexport const DirectionFilter = ({ value, onChange }: Props) => {\n const handleChange = useCallback(v => onChange(v as Direction), [onChange]);\n\n return (\n <Box pb={1} pt={1}>\n <Select\n label=\"Direction\"\n selected={value}\n items={Object.values(Direction).map(v => ({\n label: DIRECTION_DISPLAY_NAMES[v],\n value: v,\n }))}\n onChange={handleChange}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Box,\n FormControl,\n IconButton,\n InputAdornment,\n makeStyles,\n OutlinedInput,\n Typography,\n} from '@material-ui/core';\nimport ClearIcon from '@material-ui/icons/Clear';\nimport React, { useCallback } from 'react';\n\nexport type Props = {\n value: number;\n onChange: (value: number) => void;\n};\n\nconst useStyles = makeStyles({\n formControl: {\n width: '100%',\n maxWidth: 300,\n },\n});\n\nexport const MaxDepthFilter = ({ value, onChange }: Props) => {\n const classes = useStyles();\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const v = Number(event.target.value);\n onChange(v <= 0 ? Number.POSITIVE_INFINITY : v);\n },\n [onChange],\n );\n\n const reset = useCallback(() => {\n onChange(Number.POSITIVE_INFINITY);\n }, [onChange]);\n\n return (\n <Box pb={1} pt={1}>\n <FormControl variant=\"outlined\" className={classes.formControl}>\n <Typography variant=\"button\">Max Depth</Typography>\n <OutlinedInput\n type=\"number\"\n placeholder=\"∞ Infinite\"\n value={isFinite(value) ? value : ''}\n onChange={handleChange}\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"clear max depth\"\n onClick={reset}\n edge=\"end\"\n >\n <ClearIcon />\n </IconButton>\n </InputAdornment>\n }\n inputProps={{\n 'aria-label': 'maxp',\n }}\n labelWidth={0}\n />\n </FormControl>\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\n\nconst useStyles = makeStyles({\n formControl: {\n maxWidth: 300,\n },\n});\n\nexport type Props = {\n value: string[] | undefined;\n onChange: (value: string[] | undefined) => void;\n};\n\nexport const SelectedKindsFilter = ({ value, onChange }: Props) => {\n const classes = useStyles();\n const alertApi = useApi(alertApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n const { error, value: kinds } = useAsync(async () => {\n return await catalogApi\n .getEntityFacets({ facets: ['kind'] })\n .then(response => response.facets.kind?.map(f => f.value).sort() || []);\n });\n\n useEffect(() => {\n if (error) {\n alertApi.post({\n message: `Failed to load entity kinds`,\n severity: 'error',\n });\n }\n }, [error, alertApi]);\n\n const normalizedKinds = useMemo(\n () => (kinds ? kinds.map(k => k.toLocaleLowerCase('en-US')) : kinds),\n [kinds],\n );\n\n const handleChange = useCallback(\n (_: unknown, v: string[]) => {\n onChange(\n normalizedKinds && normalizedKinds.every(r => v.includes(r))\n ? undefined\n : v,\n );\n },\n [normalizedKinds, onChange],\n );\n\n const handleEmpty = useCallback(() => {\n onChange(value?.length ? value : undefined);\n }, [value, onChange]);\n\n if (!kinds?.length || !normalizedKinds?.length || error) {\n return <></>;\n }\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Kinds</Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label=\"Kinds\"\n options={normalizedKinds}\n value={value ?? normalizedKinds}\n getOptionLabel={k => kinds[normalizedKinds.indexOf(k)] ?? k}\n onChange={handleChange}\n onBlur={handleEmpty}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={<CheckBoxOutlineBlankIcon fontSize=\"small\" />}\n checkedIcon={<CheckBoxIcon fontSize=\"small\" />}\n checked={selected}\n />\n }\n label={kinds[normalizedKinds.indexOf(option)] ?? option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"selected-kinds-expand\" />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Box,\n Checkbox,\n FormControlLabel,\n makeStyles,\n TextField,\n Typography,\n} from '@material-ui/core';\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { Autocomplete } from '@material-ui/lab';\nimport React, { useCallback, useMemo } from 'react';\nimport { RelationPairs } from '../EntityRelationsGraph';\n\nconst useStyles = makeStyles({\n formControl: {\n maxWidth: 300,\n },\n});\n\nexport type Props = {\n relationPairs: RelationPairs;\n value: string[] | undefined;\n onChange: (value: string[] | undefined) => void;\n};\n\nexport const SelectedRelationsFilter = ({\n relationPairs,\n value,\n onChange,\n}: Props) => {\n const classes = useStyles();\n const relations = useMemo(() => relationPairs.flat(), [relationPairs]);\n\n const handleChange = useCallback(\n (_: unknown, v: string[]) => {\n onChange(relations.every(r => v.includes(r)) ? undefined : v);\n },\n [relations, onChange],\n );\n\n const handleEmpty = useCallback(() => {\n onChange(value?.length ? value : undefined);\n }, [value, onChange]);\n\n return (\n <Box pb={1} pt={1}>\n <Typography variant=\"button\">Relations</Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label=\"Relations\"\n options={relations}\n value={value ?? relations}\n onChange={handleChange}\n onBlur={handleEmpty}\n renderOption={(option, { selected }) => (\n <FormControlLabel\n control={\n <Checkbox\n icon={<CheckBoxOutlineBlankIcon fontSize=\"small\" />}\n checkedIcon={<CheckBoxIcon fontSize=\"small\" />}\n checked={selected}\n />\n }\n label={option}\n />\n )}\n size=\"small\"\n popupIcon={<ExpandMoreIcon data-testid=\"selected-relations-expand\" />}\n renderInput={params => <TextField {...params} variant=\"outlined\" />}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Box, FormControlLabel, makeStyles, Switch } from '@material-ui/core';\nimport React, { useCallback } from 'react';\n\nexport type Props = {\n label: string;\n value: boolean;\n onChange: (value: boolean) => void;\n};\n\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n maxWidth: 300,\n },\n});\n\nexport const SwitchFilter = ({ label, value, onChange }: Props) => {\n const classes = useStyles();\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n onChange(event.target.checked);\n },\n [onChange],\n );\n\n return (\n <Box pb={1} pt={1}>\n <FormControlLabel\n control={\n <Switch\n checked={value}\n onChange={handleChange}\n name={label}\n color=\"primary\"\n />\n }\n label={label}\n className={classes.root}\n />\n </Box>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n CompoundEntityRef,\n parseEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport qs from 'qs';\nimport {\n Dispatch,\n DispatchWithoutAction,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { useLocation } from 'react-router';\nimport usePrevious from 'react-use/lib/usePrevious';\nimport { Direction } from '../EntityRelationsGraph';\n\nexport type CatalogGraphPageValue = {\n rootEntityNames: CompoundEntityRef[];\n setRootEntityNames: Dispatch<React.SetStateAction<CompoundEntityRef[]>>;\n maxDepth: number;\n setMaxDepth: Dispatch<React.SetStateAction<number>>;\n selectedRelations: string[] | undefined;\n setSelectedRelations: Dispatch<React.SetStateAction<string[] | undefined>>;\n selectedKinds: string[] | undefined;\n setSelectedKinds: Dispatch<React.SetStateAction<string[] | undefined>>;\n unidirectional: boolean;\n setUnidirectional: Dispatch<React.SetStateAction<boolean>>;\n mergeRelations: boolean;\n setMergeRelations: Dispatch<React.SetStateAction<boolean>>;\n direction: Direction;\n setDirection: Dispatch<React.SetStateAction<Direction>>;\n showFilters: boolean;\n toggleShowFilters: DispatchWithoutAction;\n};\n\nexport function useCatalogGraphPage({\n initialState = {},\n}: {\n initialState?: {\n selectedRelations?: string[] | undefined;\n selectedKinds?: string[] | undefined;\n rootEntityRefs?: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n direction?: Direction;\n showFilters?: boolean;\n };\n}): CatalogGraphPageValue {\n const location = useLocation();\n const query = useMemo(\n () =>\n (qs.parse(location.search, { arrayLimit: 0, ignoreQueryPrefix: true }) ||\n {}) as {\n selectedRelations?: string[] | string;\n selectedKinds?: string[] | string;\n rootEntityRefs?: string[] | string;\n maxDepth?: string[] | string;\n unidirectional?: string[] | string;\n mergeRelations?: string[] | string;\n direction?: string[] | Direction;\n showFilters?: string[] | string;\n },\n [location.search],\n );\n\n // Initial state\n const [rootEntityNames, setRootEntityNames] = useState<CompoundEntityRef[]>(\n () =>\n (Array.isArray(query.rootEntityRefs)\n ? query.rootEntityRefs\n : initialState?.rootEntityRefs ?? []\n ).map(r => parseEntityRef(r)),\n );\n const [maxDepth, setMaxDepth] = useState<number>(() =>\n typeof query.maxDepth === 'string'\n ? parseMaxDepth(query.maxDepth)\n : initialState?.maxDepth ?? Number.POSITIVE_INFINITY,\n );\n const [selectedRelations, setSelectedRelations] = useState<\n string[] | undefined\n >(() =>\n Array.isArray(query.selectedRelations)\n ? query.selectedRelations\n : initialState?.selectedRelations,\n );\n const [selectedKinds, setSelectedKinds] = useState<string[] | undefined>(() =>\n (Array.isArray(query.selectedKinds)\n ? query.selectedKinds\n : initialState?.selectedKinds\n )?.map(k => k.toLocaleLowerCase('en-US')),\n );\n const [unidirectional, setUnidirectional] = useState<boolean>(() =>\n typeof query.unidirectional === 'string'\n ? query.unidirectional === 'true'\n : initialState?.unidirectional ?? true,\n );\n const [mergeRelations, setMergeRelations] = useState<boolean>(() =>\n typeof query.mergeRelations === 'string'\n ? query.mergeRelations === 'true'\n : initialState?.mergeRelations ?? true,\n );\n const [direction, setDirection] = useState<Direction>(() =>\n typeof query.direction === 'string'\n ? query.direction\n : initialState?.direction ?? Direction.LEFT_RIGHT,\n );\n const [showFilters, setShowFilters] = useState<boolean>(() =>\n typeof query.showFilters === 'string'\n ? query.showFilters === 'true'\n : initialState?.showFilters ?? true,\n );\n const toggleShowFilters = useCallback(\n () => setShowFilters(s => !s),\n [setShowFilters],\n );\n\n // Update from query parameters\n const prevQueryParams = usePrevious(location.search);\n useEffect(() => {\n // Only respond to changes to url query params\n if (location.search === prevQueryParams) {\n return;\n }\n\n if (Array.isArray(query.rootEntityRefs)) {\n setRootEntityNames(query.rootEntityRefs.map(r => parseEntityRef(r)));\n }\n\n if (typeof query.maxDepth === 'string') {\n setMaxDepth(parseMaxDepth(query.maxDepth));\n }\n\n if (Array.isArray(query.selectedKinds)) {\n setSelectedKinds(query.selectedKinds);\n }\n\n if (Array.isArray(query.selectedRelations)) {\n setSelectedRelations(query.selectedRelations);\n }\n\n if (typeof query.unidirectional === 'string') {\n setUnidirectional(query.unidirectional === 'true');\n }\n\n if (typeof query.mergeRelations === 'string') {\n setMergeRelations(query.mergeRelations === 'true');\n }\n\n if (typeof query.direction === 'string') {\n setDirection(query.direction);\n }\n\n if (typeof query.showFilters === 'string') {\n setShowFilters(query.showFilters === 'true');\n }\n }, [\n prevQueryParams,\n location.search,\n query,\n setRootEntityNames,\n setMaxDepth,\n setSelectedKinds,\n setSelectedRelations,\n setUnidirectional,\n setMergeRelations,\n setDirection,\n setShowFilters,\n ]);\n\n // Update query parameters\n const previousRootEntityRefs = usePrevious(\n rootEntityNames.map(e => stringifyEntityRef(e)),\n );\n\n useEffect(() => {\n const rootEntityRefs = rootEntityNames.map(e => stringifyEntityRef(e));\n const newParams = qs.stringify(\n {\n rootEntityRefs,\n maxDepth: isFinite(maxDepth) ? maxDepth : '∞',\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n const newUrl = `${window.location.pathname}${newParams}`;\n\n // We directly manipulate window history here in order to not re-render\n // infinitely (state => location => state => etc). The intention of this\n // code is just to ensure the right query/filters are loaded when a user\n // clicks the \"back\" button after clicking a result.\n // Only push a new history entry if we switched to another entity, but not\n // if we just changed a viewer setting.\n if (\n !previousRootEntityRefs ||\n (rootEntityRefs.length === previousRootEntityRefs.length &&\n rootEntityRefs.every((v, i) => v === previousRootEntityRefs[i]))\n ) {\n window.history.replaceState(null, document.title, newUrl);\n } else {\n window.history.pushState(null, document.title, newUrl);\n }\n }, [\n rootEntityNames,\n maxDepth,\n selectedKinds,\n selectedRelations,\n unidirectional,\n mergeRelations,\n direction,\n showFilters,\n previousRootEntityRefs,\n ]);\n\n return {\n rootEntityNames,\n setRootEntityNames,\n maxDepth,\n setMaxDepth,\n selectedRelations,\n setSelectedRelations,\n selectedKinds,\n setSelectedKinds,\n unidirectional,\n setUnidirectional,\n mergeRelations,\n setMergeRelations,\n direction,\n setDirection,\n showFilters,\n toggleShowFilters,\n };\n}\n\nfunction parseMaxDepth(value: string): number {\n return value === '∞' ? Number.POSITIVE_INFINITY : Number(value);\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport {\n Content,\n ContentHeader,\n Header,\n Page,\n SupportButton,\n} from '@backstage/core-components';\nimport { useAnalytics, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n entityRouteRef,\n humanizeEntityRef,\n} from '@backstage/plugin-catalog-react';\nimport { Grid, makeStyles, Paper, Typography } from '@material-ui/core';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport ZoomOutMap from '@material-ui/icons/ZoomOutMap';\nimport { ToggleButton } from '@material-ui/lab';\nimport React, { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n RelationPairs,\n} from '../EntityRelationsGraph';\nimport { DirectionFilter } from './DirectionFilter';\nimport { MaxDepthFilter } from './MaxDepthFilter';\nimport { SelectedKindsFilter } from './SelectedKindsFilter';\nimport { SelectedRelationsFilter } from './SelectedRelationsFilter';\nimport { SwitchFilter } from './SwitchFilter';\nimport { useCatalogGraphPage } from './useCatalogGraphPage';\n\nconst useStyles = makeStyles(theme => ({\n content: {\n minHeight: 0,\n },\n container: {\n height: '100%',\n maxHeight: '100%',\n minHeight: 0,\n },\n fullHeight: {\n maxHeight: '100%',\n display: 'flex',\n minHeight: 0,\n },\n graphWrapper: {\n position: 'relative',\n flex: 1,\n minHeight: 0,\n display: 'flex',\n },\n graph: {\n flex: 1,\n minHeight: 0,\n },\n legend: {\n position: 'absolute',\n bottom: 0,\n right: 0,\n padding: theme.spacing(1),\n '& .icon': {\n verticalAlign: 'bottom',\n },\n },\n filters: {\n display: 'grid',\n gridGap: theme.spacing(1),\n gridAutoRows: 'auto',\n [theme.breakpoints.up('lg')]: {\n display: 'block',\n },\n [theme.breakpoints.only('md')]: {\n gridTemplateColumns: 'repeat(3, 1fr)',\n },\n [theme.breakpoints.only('sm')]: {\n gridTemplateColumns: 'repeat(2, 1fr)',\n },\n [theme.breakpoints.down('xs')]: {\n gridTemplateColumns: 'repeat(1, 1fr)',\n },\n },\n}));\n\nexport const CatalogGraphPage = (props: {\n relationPairs?: RelationPairs;\n initialState?: {\n selectedRelations?: string[];\n selectedKinds?: string[];\n rootEntityRefs?: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n direction?: Direction;\n showFilters?: boolean;\n };\n}) => {\n const { relationPairs = ALL_RELATION_PAIRS, initialState } = props;\n\n const navigate = useNavigate();\n const classes = useStyles();\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const {\n maxDepth,\n setMaxDepth,\n selectedKinds,\n setSelectedKinds,\n selectedRelations,\n setSelectedRelations,\n unidirectional,\n setUnidirectional,\n mergeRelations,\n setMergeRelations,\n direction,\n setDirection,\n rootEntityNames,\n setRootEntityNames,\n showFilters,\n toggleShowFilters,\n } = useCatalogGraphPage({ initialState });\n const analytics = useAnalytics();\n const onNodeClick = useCallback(\n (node: EntityNode, event: MouseEvent<unknown>) => {\n const nodeEntityName = parseEntityRef(node.id);\n\n if (event.shiftKey) {\n const path = catalogEntityRoute({\n kind: nodeEntityName.kind.toLocaleLowerCase('en-US'),\n namespace: nodeEntityName.namespace.toLocaleLowerCase('en-US'),\n name: nodeEntityName.name,\n });\n\n analytics.captureEvent(\n 'click',\n node.title ?? humanizeEntityRef(nodeEntityName),\n { attributes: { to: path } },\n );\n navigate(path);\n } else {\n analytics.captureEvent(\n 'click',\n node.title ?? humanizeEntityRef(nodeEntityName),\n );\n setRootEntityNames([nodeEntityName]);\n }\n },\n [catalogEntityRoute, navigate, setRootEntityNames, analytics],\n );\n\n return (\n <Page themeId=\"home\">\n <Header\n title=\"Catalog Graph\"\n subtitle={rootEntityNames.map(e => humanizeEntityRef(e)).join(', ')}\n />\n <Content stretch className={classes.content}>\n <ContentHeader\n titleComponent={\n <ToggleButton\n value=\"show filters\"\n selected={showFilters}\n onChange={() => toggleShowFilters()}\n >\n <FilterListIcon /> Filters\n </ToggleButton>\n }\n >\n <SupportButton>\n Start tracking your component in by adding it to the software\n catalog.\n </SupportButton>\n </ContentHeader>\n <Grid container alignItems=\"stretch\" className={classes.container}>\n {showFilters && (\n <Grid item xs={12} lg={2} className={classes.filters}>\n <MaxDepthFilter value={maxDepth} onChange={setMaxDepth} />\n <SelectedKindsFilter\n value={selectedKinds}\n onChange={setSelectedKinds}\n />\n <SelectedRelationsFilter\n value={selectedRelations}\n onChange={setSelectedRelations}\n relationPairs={relationPairs}\n />\n <DirectionFilter value={direction} onChange={setDirection} />\n <SwitchFilter\n value={unidirectional}\n onChange={setUnidirectional}\n label=\"Simplified\"\n />\n <SwitchFilter\n value={mergeRelations}\n onChange={setMergeRelations}\n label=\"Merge Relations\"\n />\n </Grid>\n )}\n <Grid item xs className={classes.fullHeight}>\n <Paper className={classes.graphWrapper}>\n <Typography\n variant=\"caption\"\n color=\"textSecondary\"\n display=\"block\"\n className={classes.legend}\n >\n <ZoomOutMap className=\"icon\" /> Use pinch &amp; zoom to move\n around the diagram. Click to change active node, shift click to\n navigate to entity.\n </Typography>\n <EntityRelationsGraph\n rootEntityNames={rootEntityNames}\n maxDepth={maxDepth}\n kinds={\n selectedKinds && selectedKinds.length > 0\n ? selectedKinds\n : undefined\n }\n relations={\n selectedRelations && selectedRelations.length > 0\n ? selectedRelations\n : undefined\n }\n mergeRelations={mergeRelations}\n unidirectional={unidirectional}\n onNodeClick={onNodeClick}\n direction={direction}\n relationPairs={relationPairs}\n className={classes.graph}\n zoom=\"enabled\"\n />\n </Paper>\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA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,SAAS;AACb,IAAI,aAAa;AACjB,IAAI,SAAS,EAAE,OAAO,CAAC,KAAK;AAC5B,IAAI,IAAI,EAAE,SAAS;AACnB,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACV;;;;"}
package/dist/index.d.ts CHANGED
@@ -178,7 +178,7 @@ declare const catalogGraphPlugin: _backstage_core_plugin_api.BackstagePlugin<{
178
178
  kind: string;
179
179
  namespace: string;
180
180
  }, true>;
181
- }>;
181
+ }, {}>;
182
182
 
183
183
  /**
184
184
  * Route pointing to the standalone catalog graph page.
package/dist/index.esm.js CHANGED
@@ -111,7 +111,11 @@ function CustomNode({
111
111
  onClick,
112
112
  className: classNames(onClick && classes.clickable)
113
113
  }, /* @__PURE__ */ React.createElement("rect", {
114
- className: classNames(classes.node, color === "primary" && "primary", color === "secondary" && "secondary"),
114
+ className: classNames(
115
+ classes.node,
116
+ color === "primary" && "primary",
117
+ color === "secondary" && "secondary"
118
+ ),
115
119
  width: paddedWidth,
116
120
  height: paddedHeight,
117
121
  rx: 10
@@ -121,10 +125,20 @@ function CustomNode({
121
125
  x: padding,
122
126
  width: iconSize,
123
127
  height: iconSize,
124
- className: classNames(classes.text, focused && "focused", color === "primary" && "primary", color === "secondary" && "secondary")
128
+ className: classNames(
129
+ classes.text,
130
+ focused && "focused",
131
+ color === "primary" && "primary",
132
+ color === "secondary" && "secondary"
133
+ )
125
134
  }), /* @__PURE__ */ React.createElement("text", {
126
135
  ref: idRef,
127
- className: classNames(classes.text, focused && "focused", color === "primary" && "primary", color === "secondary" && "secondary"),
136
+ className: classNames(
137
+ classes.text,
138
+ focused && "focused",
139
+ color === "primary" && "primary",
140
+ color === "secondary" && "secondary"
141
+ ),
128
142
  y: paddedHeight / 2,
129
143
  x: paddedIconWidth + (width + padding * 2) / 2,
130
144
  textAnchor: "middle",
@@ -172,37 +186,44 @@ function useEntityStore() {
172
186
  }, [state, setEntities]);
173
187
  const [asyncState, fetch] = useAsyncFn(async () => {
174
188
  const { requestedEntities, outstandingEntities, cachedEntities } = state.current;
175
- await Promise.all(Array.from(requestedEntities).map((entityRef) => limiter(async () => {
176
- if (cachedEntities.has(entityRef)) {
177
- return;
178
- }
179
- if (outstandingEntities.has(entityRef)) {
180
- await outstandingEntities.get(entityRef);
181
- return;
182
- }
183
- const promise = catalogClient.getEntityByRef(entityRef);
184
- outstandingEntities.set(entityRef, promise);
185
- try {
186
- const entity = await promise;
187
- if (entity) {
188
- cachedEntities.set(entityRef, entity);
189
- updateEntities();
190
- }
191
- } finally {
192
- outstandingEntities.delete(entityRef);
193
- }
194
- })));
189
+ await Promise.all(
190
+ Array.from(requestedEntities).map(
191
+ (entityRef) => limiter(async () => {
192
+ if (cachedEntities.has(entityRef)) {
193
+ return;
194
+ }
195
+ if (outstandingEntities.has(entityRef)) {
196
+ await outstandingEntities.get(entityRef);
197
+ return;
198
+ }
199
+ const promise = catalogClient.getEntityByRef(entityRef);
200
+ outstandingEntities.set(entityRef, promise);
201
+ try {
202
+ const entity = await promise;
203
+ if (entity) {
204
+ cachedEntities.set(entityRef, entity);
205
+ updateEntities();
206
+ }
207
+ } finally {
208
+ outstandingEntities.delete(entityRef);
209
+ }
210
+ })
211
+ )
212
+ );
195
213
  }, [state, updateEntities]);
196
214
  const { loading, error } = asyncState;
197
- const requestEntities = useCallback((entityRefs) => {
198
- const n = new Set(entityRefs);
199
- const { requestedEntities } = state.current;
200
- if (n.size !== requestedEntities.size || Array.from(n).some((e) => !requestedEntities.has(e))) {
201
- state.current.requestedEntities = n;
202
- fetch();
203
- updateEntities();
204
- }
205
- }, [state, fetch, updateEntities]);
215
+ const requestEntities = useCallback(
216
+ (entityRefs) => {
217
+ const n = new Set(entityRefs);
218
+ const { requestedEntities } = state.current;
219
+ if (n.size !== requestedEntities.size || Array.from(n).some((e) => !requestedEntities.has(e))) {
220
+ state.current.requestedEntities = n;
221
+ fetch();
222
+ updateEntities();
223
+ }
224
+ },
225
+ [state, fetch, updateEntities]
226
+ );
206
227
  return {
207
228
  entities,
208
229
  loading,
@@ -230,7 +251,11 @@ function useEntityRelationGraph({
230
251
  processedEntityRefs.add(entityRef);
231
252
  if (entity && entity.relations) {
232
253
  for (const rel of entity.relations) {
233
- if ((!relations || relations.includes(rel.type)) && (!kinds || kinds.some((kind) => rel.targetRef.startsWith(`${kind.toLocaleLowerCase("en-US")}:`)))) {
254
+ if ((!relations || relations.includes(rel.type)) && (!kinds || kinds.some(
255
+ (kind) => rel.targetRef.startsWith(
256
+ `${kind.toLocaleLowerCase("en-US")}:`
257
+ )
258
+ ))) {
234
259
  if (!processedEntityRefs.has(rel.targetRef)) {
235
260
  nextDepthRefQueue.push(rel.targetRef);
236
261
  expectedEntities.add(rel.targetRef);
@@ -269,85 +294,93 @@ function useEntityRelationNodesAndEdges({
269
294
  relations
270
295
  }
271
296
  });
272
- useDebounce(() => {
273
- var _a;
274
- if (!entities || Object.keys(entities).length === 0) {
275
- setNodesAndEdges({});
276
- return;
277
- }
278
- const nodes = Object.entries(entities).map(([entityRef, entity]) => {
279
- var _a2, _b, _c;
280
- const focused = rootEntityRefs.includes(entityRef);
281
- const node = {
282
- id: entityRef,
283
- title: (_b = (_a2 = entity.metadata) == null ? void 0 : _a2.title) != null ? _b : void 0,
284
- kind: entity.kind,
285
- name: entity.metadata.name,
286
- namespace: (_c = entity.metadata.namespace) != null ? _c : DEFAULT_NAMESPACE,
287
- focused,
288
- color: focused ? "secondary" : "primary"
289
- };
290
- if (onNodeClick) {
291
- node.onClick = (event) => onNodeClick(node, event);
297
+ useDebounce(
298
+ () => {
299
+ var _a;
300
+ if (!entities || Object.keys(entities).length === 0) {
301
+ setNodesAndEdges({});
302
+ return;
292
303
  }
293
- return node;
294
- });
295
- const edges = [];
296
- const visitedNodes = /* @__PURE__ */ new Set();
297
- const nodeQueue = [...rootEntityRefs];
298
- while (nodeQueue.length > 0) {
299
- const entityRef = nodeQueue.pop();
300
- const entity = entities[entityRef];
301
- visitedNodes.add(entityRef);
302
- if (entity) {
303
- (_a = entity == null ? void 0 : entity.relations) == null ? void 0 : _a.forEach((rel) => {
304
- var _a2;
305
- if (!entities[rel.targetRef]) {
306
- return;
307
- }
308
- if (relations && !relations.includes(rel.type)) {
309
- return;
310
- }
311
- if (kinds && !kinds.some((kind) => rel.targetRef.startsWith(`${kind.toLocaleLowerCase("en-US")}:`))) {
312
- return;
313
- }
314
- if (!unidirectional || !visitedNodes.has(rel.targetRef)) {
315
- if (mergeRelations) {
316
- const pair = (_a2 = relationPairs.find(([l, r]) => l === rel.type || r === rel.type)) != null ? _a2 : [rel.type];
317
- const [left] = pair;
318
- edges.push({
319
- from: left === rel.type ? entityRef : rel.targetRef,
320
- to: left === rel.type ? rel.targetRef : entityRef,
321
- relations: pair,
322
- label: "visible"
323
- });
324
- } else {
325
- edges.push({
326
- from: entityRef,
327
- to: rel.targetRef,
328
- relations: [rel.type],
329
- label: "visible"
330
- });
304
+ const nodes = Object.entries(entities).map(([entityRef, entity]) => {
305
+ var _a2, _b, _c;
306
+ const focused = rootEntityRefs.includes(entityRef);
307
+ const node = {
308
+ id: entityRef,
309
+ title: (_b = (_a2 = entity.metadata) == null ? void 0 : _a2.title) != null ? _b : void 0,
310
+ kind: entity.kind,
311
+ name: entity.metadata.name,
312
+ namespace: (_c = entity.metadata.namespace) != null ? _c : DEFAULT_NAMESPACE,
313
+ focused,
314
+ color: focused ? "secondary" : "primary"
315
+ };
316
+ if (onNodeClick) {
317
+ node.onClick = (event) => onNodeClick(node, event);
318
+ }
319
+ return node;
320
+ });
321
+ const edges = [];
322
+ const visitedNodes = /* @__PURE__ */ new Set();
323
+ const nodeQueue = [...rootEntityRefs];
324
+ while (nodeQueue.length > 0) {
325
+ const entityRef = nodeQueue.pop();
326
+ const entity = entities[entityRef];
327
+ visitedNodes.add(entityRef);
328
+ if (entity) {
329
+ (_a = entity == null ? void 0 : entity.relations) == null ? void 0 : _a.forEach((rel) => {
330
+ var _a2;
331
+ if (!entities[rel.targetRef]) {
332
+ return;
331
333
  }
332
- }
333
- if (!visitedNodes.has(rel.targetRef)) {
334
- nodeQueue.push(rel.targetRef);
335
- visitedNodes.add(rel.targetRef);
336
- }
337
- });
334
+ if (relations && !relations.includes(rel.type)) {
335
+ return;
336
+ }
337
+ if (kinds && !kinds.some(
338
+ (kind) => rel.targetRef.startsWith(`${kind.toLocaleLowerCase("en-US")}:`)
339
+ )) {
340
+ return;
341
+ }
342
+ if (!unidirectional || !visitedNodes.has(rel.targetRef)) {
343
+ if (mergeRelations) {
344
+ const pair = (_a2 = relationPairs.find(
345
+ ([l, r]) => l === rel.type || r === rel.type
346
+ )) != null ? _a2 : [rel.type];
347
+ const [left] = pair;
348
+ edges.push({
349
+ from: left === rel.type ? entityRef : rel.targetRef,
350
+ to: left === rel.type ? rel.targetRef : entityRef,
351
+ relations: pair,
352
+ label: "visible"
353
+ });
354
+ } else {
355
+ edges.push({
356
+ from: entityRef,
357
+ to: rel.targetRef,
358
+ relations: [rel.type],
359
+ label: "visible"
360
+ });
361
+ }
362
+ }
363
+ if (!visitedNodes.has(rel.targetRef)) {
364
+ nodeQueue.push(rel.targetRef);
365
+ visitedNodes.add(rel.targetRef);
366
+ }
367
+ });
368
+ }
338
369
  }
339
- }
340
- setNodesAndEdges({ nodes, edges });
341
- }, 100, [
342
- entities,
343
- rootEntityRefs,
344
- kinds,
345
- relations,
346
- unidirectional,
347
- mergeRelations,
348
- onNodeClick,
349
- relationPairs
350
- ]);
370
+ setNodesAndEdges({ nodes, edges });
371
+ },
372
+ 100,
373
+ [
374
+ entities,
375
+ rootEntityRefs,
376
+ kinds,
377
+ relations,
378
+ unidirectional,
379
+ mergeRelations,
380
+ onNodeClick,
381
+ relationPairs
382
+ ]
383
+ );
351
384
  return {
352
385
  loading,
353
386
  error,
@@ -401,7 +434,10 @@ const EntityRelationsGraph = (props) => {
401
434
  } = props;
402
435
  const theme = useTheme();
403
436
  const classes = useStyles();
404
- const rootEntityRefs = useMemo(() => (Array.isArray(rootEntityNames) ? rootEntityNames : [rootEntityNames]).map((e) => stringifyEntityRef(e)), [rootEntityNames]);
437
+ const rootEntityRefs = useMemo(
438
+ () => (Array.isArray(rootEntityNames) ? rootEntityNames : [rootEntityNames]).map((e) => stringifyEntityRef(e)),
439
+ [rootEntityNames]
440
+ );
405
441
  const errorApi = useApi(errorApiRef);
406
442
  const { loading, error, nodes, edges } = useEntityRelationNodesAndEdges({
407
443
  rootEntityRefs,
@@ -456,17 +492,21 @@ const catalogGraphPlugin = createPlugin({
456
492
  }
457
493
  });
458
494
 
459
- const EntityCatalogGraphCard = catalogGraphPlugin.provide(createComponentExtension({
460
- name: "EntityCatalogGraphCard",
461
- component: {
462
- lazy: () => import('./esm/index-5294ed16.esm.js').then((m) => m.CatalogGraphCard)
463
- }
464
- }));
465
- const CatalogGraphPage = catalogGraphPlugin.provide(createRoutableExtension({
466
- name: "CatalogGraphPage",
467
- component: () => import('./esm/index-97452b61.esm.js').then((m) => m.CatalogGraphPage),
468
- mountPoint: catalogGraphRouteRef
469
- }));
495
+ const EntityCatalogGraphCard = catalogGraphPlugin.provide(
496
+ createComponentExtension({
497
+ name: "EntityCatalogGraphCard",
498
+ component: {
499
+ lazy: () => import('./esm/index-05b530c3.esm.js').then((m) => m.CatalogGraphCard)
500
+ }
501
+ })
502
+ );
503
+ const CatalogGraphPage = catalogGraphPlugin.provide(
504
+ createRoutableExtension({
505
+ name: "CatalogGraphPage",
506
+ component: () => import('./esm/index-13b9a6d5.esm.js').then((m) => m.CatalogGraphPage),
507
+ mountPoint: catalogGraphRouteRef
508
+ })
509
+ );
470
510
 
471
511
  export { ALL_RELATION_PAIRS, CatalogGraphPage, Direction, EntityCatalogGraphCard, EntityRelationsGraph, catalogGraphPlugin, catalogGraphRouteRef };
472
512
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/components/EntityRelationsGraph/CustomLabel.tsx","../src/components/EntityRelationsGraph/EntityKindIcon.tsx","../src/components/EntityRelationsGraph/CustomNode.tsx","../src/components/EntityRelationsGraph/relations.ts","../src/components/EntityRelationsGraph/types.ts","../src/components/EntityRelationsGraph/useEntityStore.ts","../src/components/EntityRelationsGraph/useEntityRelationGraph.ts","../src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts","../src/components/EntityRelationsGraph/EntityRelationsGraph.tsx","../src/routes.ts","../src/plugin.ts","../src/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { BackstageTheme } from '@backstage/theme';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport React from 'react';\nimport { EntityEdgeData } from './types';\nimport classNames from 'classnames';\n\nconst useStyles = makeStyles((theme: BackstageTheme) => ({\n text: {\n fill: theme.palette.textContrast,\n },\n secondary: {\n fill: theme.palette.textSubtle,\n },\n}));\n\nexport function CustomLabel({\n edge: { relations },\n}: DependencyGraphTypes.RenderLabelProps<EntityEdgeData>) {\n const classes = useStyles();\n return (\n <text className={classes.text} textAnchor=\"middle\">\n {relations.map((r, i) => (\n <tspan key={r} className={classNames(i > 0 && classes.secondary)}>\n {i > 0 && <tspan> / </tspan>}\n {r}\n </tspan>\n ))}\n </text>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useApp } from '@backstage/core-plugin-api';\nimport WorkIcon from '@material-ui/icons/Work';\nimport React from 'react';\n\nexport function EntityKindIcon({\n kind,\n ...props\n}: {\n kind: string;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n className?: string;\n}) {\n const app = useApp();\n const Icon =\n app.getSystemIcon(`kind:${kind.toLocaleLowerCase('en-US')}`) ?? WorkIcon;\n return <Icon {...props} />;\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { humanizeEntityRef } from '@backstage/plugin-catalog-react';\nimport { BackstageTheme } from '@backstage/theme';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\nimport { EntityKindIcon } from './EntityKindIcon';\nimport { EntityNodeData } from './types';\n\nconst useStyles = makeStyles((theme: BackstageTheme) => ({\n node: {\n fill: theme.palette.grey[300],\n stroke: theme.palette.grey[300],\n\n '&.primary': {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n '&.secondary': {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n },\n text: {\n fill: theme.palette.getContrastText(theme.palette.grey[300]),\n\n '&.primary': {\n fill: theme.palette.primary.contrastText,\n },\n '&.secondary': {\n fill: theme.palette.secondary.contrastText,\n },\n '&.focused': {\n fontWeight: 'bold',\n },\n },\n clickable: {\n cursor: 'pointer',\n },\n}));\n\nexport function CustomNode({\n node: {\n id,\n kind,\n namespace,\n name,\n color = 'default',\n focused,\n title,\n onClick,\n },\n}: DependencyGraphTypes.RenderNodeProps<EntityNodeData>) {\n const classes = useStyles();\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const idRef = useRef<SVGTextElement | null>(null);\n\n useLayoutEffect(() => {\n // set the width to the length of the ID\n if (idRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n idRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n\n if (renderedHeight !== height || renderedWidth !== width) {\n setWidth(renderedWidth);\n setHeight(renderedHeight);\n }\n }\n }, [width, height]);\n\n const padding = 10;\n const iconSize = height;\n const paddedIconWidth = kind ? iconSize + padding : 0;\n const paddedWidth = paddedIconWidth + width + padding * 2;\n const paddedHeight = height + padding * 2;\n\n const displayTitle =\n title ??\n (kind && name && namespace\n ? humanizeEntityRef({ kind, name, namespace })\n : id);\n\n return (\n <g onClick={onClick} className={classNames(onClick && classes.clickable)}>\n <rect\n className={classNames(\n classes.node,\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n width={paddedWidth}\n height={paddedHeight}\n rx={10}\n />\n {kind && (\n <EntityKindIcon\n kind={kind}\n y={padding}\n x={padding}\n width={iconSize}\n height={iconSize}\n className={classNames(\n classes.text,\n focused && 'focused',\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n />\n )}\n <text\n ref={idRef}\n className={classNames(\n classes.text,\n focused && 'focused',\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n y={paddedHeight / 2}\n x={paddedIconWidth + (width + padding * 2) / 2}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {displayTitle}\n </text>\n </g>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n RELATION_API_CONSUMED_BY,\n RELATION_API_PROVIDED_BY,\n RELATION_CHILD_OF,\n RELATION_CONSUMES_API,\n RELATION_DEPENDENCY_OF,\n RELATION_DEPENDS_ON,\n RELATION_HAS_MEMBER,\n RELATION_HAS_PART,\n RELATION_MEMBER_OF,\n RELATION_OWNED_BY,\n RELATION_OWNER_OF,\n RELATION_PARENT_OF,\n RELATION_PART_OF,\n RELATION_PROVIDES_API,\n} from '@backstage/catalog-model';\n\n/**\n * A pair of two relations that describe the opposite of each other. The first\n * relation is considered as the primary relation.\n *\n * @public\n */\nexport type RelationPairs = [string, string][];\n\n// TODO: This file only contains the pairs for the built-in relations.\n// How to implement this when custom relations are used? Right now you can pass\n// the relations everywhere.\n// Another option is to move this into @backstage/catalog-model\n\n/**\n * A list of pairs of entity relations, used to define which relations are\n * merged together and which the primary relation is.\n *\n * @public\n */\nexport const ALL_RELATION_PAIRS: RelationPairs = [\n [RELATION_OWNER_OF, RELATION_OWNED_BY],\n [RELATION_CONSUMES_API, RELATION_API_CONSUMED_BY],\n [RELATION_API_PROVIDED_BY, RELATION_PROVIDES_API],\n [RELATION_HAS_PART, RELATION_PART_OF],\n [RELATION_PARENT_OF, RELATION_CHILD_OF],\n [RELATION_HAS_MEMBER, RELATION_MEMBER_OF],\n [RELATION_DEPENDS_ON, RELATION_DEPENDENCY_OF],\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { MouseEventHandler } from 'react';\n\n/**\n * Additional Data for entities.\n *\n * @public\n */\nexport type EntityEdgeData = {\n /**\n * Up to two relations that are connecting an entity.\n */\n relations: string[];\n /**\n * Whether the entity is visible or not.\n */\n // Not used, but has to be non empty to draw a label at all!\n label: 'visible';\n};\n\n/**\n * Edge between two entities.\n *\n * @public\n */\nexport type EntityEdge = DependencyGraphTypes.DependencyEdge<EntityEdgeData>;\n\n/**\n * Additional data for Entity Node\n *\n * @public\n */\nexport type EntityNodeData = {\n /**\n * Name of the entity.\n */\n name: string;\n /**\n * Optional kind of the entity.\n */\n kind?: string;\n /**\n * Optional title of the entity.\n */\n title?: string;\n /**\n * Namespace of the entity.\n */\n namespace: string;\n /**\n * Whether the entity is focused, optional, defaults to false. Focused\n * entities are highlighted in the graph.\n */\n focused?: boolean;\n /**\n * Optional color of the entity, defaults to 'default'.\n */\n color?: 'primary' | 'secondary' | 'default';\n /**\n * Optional click handler.\n */\n onClick?: MouseEventHandler<unknown>;\n};\n\n/**\n * Node representing an entity.\n *\n * @public\n */\nexport type EntityNode = DependencyGraphTypes.DependencyNode<EntityNodeData>;\n\n/**\n * Render direction of the graph.\n *\n * @public\n */\nexport enum Direction {\n /**\n * Top to bottom.\n */\n TOP_BOTTOM = 'TB',\n /**\n * Bottom to top.\n */\n BOTTOM_TOP = 'BT',\n /**\n * Left to right.\n */\n LEFT_RIGHT = 'LR',\n /**\n * Right to left.\n */\n RIGHT_LEFT = 'RL',\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport limiterFactory from 'p-limit';\nimport { Dispatch, useCallback, useRef, useState } from 'react';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\n\n// TODO: This is a good use case for a graphql API, once it is available in the\n// future.\n\nconst limiter = limiterFactory(10);\n\n/**\n * Ensures that a set of requested entities is loaded.\n */\nexport function useEntityStore(): {\n entities: { [ref: string]: Entity };\n loading: boolean;\n error?: Error;\n requestEntities: Dispatch<string[]>;\n} {\n const catalogClient = useApi(catalogApiRef);\n const state = useRef({\n requestedEntities: new Set<string>(),\n outstandingEntities: new Map<string, Promise<Entity | undefined>>(),\n cachedEntities: new Map<string, Entity>(),\n });\n const [entities, setEntities] = useState<{\n [ref: string]: Entity;\n }>({});\n\n const updateEntities = useCallback(() => {\n const { cachedEntities, requestedEntities } = state.current;\n const filteredEntities: { [ref: string]: Entity } = {};\n requestedEntities.forEach(entityRef => {\n const entity = cachedEntities.get(entityRef);\n\n if (entity) {\n filteredEntities[entityRef] = entity;\n }\n });\n setEntities(filteredEntities);\n }, [state, setEntities]);\n\n const [asyncState, fetch] = useAsyncFn(async () => {\n const { requestedEntities, outstandingEntities, cachedEntities } =\n state.current;\n\n await Promise.all(\n Array.from(requestedEntities).map(entityRef =>\n limiter(async () => {\n if (cachedEntities.has(entityRef)) {\n return;\n }\n\n if (outstandingEntities.has(entityRef)) {\n await outstandingEntities.get(entityRef);\n return;\n }\n\n const promise = catalogClient.getEntityByRef(entityRef);\n\n outstandingEntities.set(entityRef, promise);\n\n try {\n const entity = await promise;\n\n if (entity) {\n cachedEntities.set(entityRef, entity);\n updateEntities();\n }\n } finally {\n outstandingEntities.delete(entityRef);\n }\n }),\n ),\n );\n }, [state, updateEntities]);\n const { loading, error } = asyncState;\n\n const requestEntities = useCallback(\n (entityRefs: string[]) => {\n const n = new Set(entityRefs);\n const { requestedEntities } = state.current;\n\n if (\n n.size !== requestedEntities.size ||\n Array.from(n).some(e => !requestedEntities.has(e))\n ) {\n state.current.requestedEntities = n;\n fetch();\n updateEntities();\n }\n },\n [state, fetch, updateEntities],\n );\n\n return {\n entities,\n loading,\n error,\n requestEntities,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport { useEffect } from 'react';\nimport { useEntityStore } from './useEntityStore';\n\n/**\n * Discover the graph of entities connected by relations, starting from a set of\n * root entities. Filters are used to select which relations to includes.\n * Returns all discovered entities once they are loaded.\n */\nexport function useEntityRelationGraph({\n rootEntityRefs,\n filter: { maxDepth = Number.POSITIVE_INFINITY, relations, kinds } = {},\n}: {\n rootEntityRefs: string[];\n filter?: {\n maxDepth?: number;\n relations?: string[];\n kinds?: string[];\n };\n}): {\n entities?: { [ref: string]: Entity };\n loading: boolean;\n error?: Error;\n} {\n const { entities, loading, error, requestEntities } = useEntityStore();\n\n useEffect(() => {\n const expectedEntities = new Set([...rootEntityRefs]);\n const processedEntityRefs = new Set<string>();\n\n let nextDepthRefQueue = [...rootEntityRefs];\n let depth = 0;\n\n while (\n nextDepthRefQueue.length > 0 &&\n (!isFinite(maxDepth) || depth < maxDepth)\n ) {\n const entityRefQueue = nextDepthRefQueue;\n nextDepthRefQueue = [];\n\n while (entityRefQueue.length > 0) {\n const entityRef = entityRefQueue.shift()!;\n const entity = entities[entityRef];\n\n processedEntityRefs.add(entityRef);\n\n if (entity && entity.relations) {\n for (const rel of entity.relations) {\n if (\n (!relations || relations.includes(rel.type)) &&\n (!kinds ||\n kinds.some(kind =>\n rel.targetRef.startsWith(\n `${kind.toLocaleLowerCase('en-US')}:`,\n ),\n ))\n ) {\n if (!processedEntityRefs.has(rel.targetRef)) {\n nextDepthRefQueue.push(rel.targetRef);\n expectedEntities.add(rel.targetRef);\n }\n }\n }\n }\n }\n\n ++depth;\n }\n\n requestEntities([...expectedEntities]);\n }, [entities, rootEntityRefs, maxDepth, relations, kinds, requestEntities]);\n\n return {\n entities,\n loading,\n error,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DEFAULT_NAMESPACE } from '@backstage/catalog-model';\nimport { MouseEvent, useState } from 'react';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport { RelationPairs, ALL_RELATION_PAIRS } from './relations';\nimport { EntityEdge, EntityNode } from './types';\nimport { useEntityRelationGraph } from './useEntityRelationGraph';\n\n/**\n * Generate nodes and edges to render the entity graph.\n */\nexport function useEntityRelationNodesAndEdges({\n rootEntityRefs,\n maxDepth = Number.POSITIVE_INFINITY,\n unidirectional = true,\n mergeRelations = true,\n kinds,\n relations,\n onNodeClick,\n relationPairs = ALL_RELATION_PAIRS,\n}: {\n rootEntityRefs: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n onNodeClick?: (value: EntityNode, event: MouseEvent<unknown>) => void;\n relationPairs?: RelationPairs;\n}): {\n loading: boolean;\n nodes?: EntityNode[];\n edges?: EntityEdge[];\n error?: Error;\n} {\n const [nodesAndEdges, setNodesAndEdges] = useState<{\n nodes?: EntityNode[];\n edges?: EntityEdge[];\n }>({});\n const { entities, loading, error } = useEntityRelationGraph({\n rootEntityRefs,\n filter: {\n maxDepth,\n kinds,\n relations,\n },\n });\n\n useDebounce(\n () => {\n if (!entities || Object.keys(entities).length === 0) {\n setNodesAndEdges({});\n return;\n }\n\n const nodes = Object.entries(entities).map(([entityRef, entity]) => {\n const focused = rootEntityRefs.includes(entityRef);\n const node: EntityNode = {\n id: entityRef,\n title: entity.metadata?.title ?? undefined,\n kind: entity.kind,\n name: entity.metadata.name,\n namespace: entity.metadata.namespace ?? DEFAULT_NAMESPACE,\n focused,\n color: focused ? 'secondary' : 'primary',\n };\n\n if (onNodeClick) {\n node.onClick = event => onNodeClick(node, event);\n }\n\n return node;\n });\n\n const edges: EntityEdge[] = [];\n const visitedNodes = new Set<string>();\n const nodeQueue = [...rootEntityRefs];\n\n while (nodeQueue.length > 0) {\n const entityRef = nodeQueue.pop()!;\n const entity = entities[entityRef];\n visitedNodes.add(entityRef);\n\n if (entity) {\n entity?.relations?.forEach(rel => {\n // Check if the related entity should be displayed, if not, ignore\n // the relation too\n if (!entities[rel.targetRef]) {\n return;\n }\n\n if (relations && !relations.includes(rel.type)) {\n return;\n }\n\n if (\n kinds &&\n !kinds.some(kind =>\n rel.targetRef.startsWith(`${kind.toLocaleLowerCase('en-US')}:`),\n )\n ) {\n return;\n }\n\n if (!unidirectional || !visitedNodes.has(rel.targetRef)) {\n if (mergeRelations) {\n const pair = relationPairs.find(\n ([l, r]) => l === rel.type || r === rel.type,\n ) ?? [rel.type];\n const [left] = pair;\n\n edges.push({\n from: left === rel.type ? entityRef : rel.targetRef,\n to: left === rel.type ? rel.targetRef : entityRef,\n relations: pair,\n label: 'visible',\n });\n } else {\n edges.push({\n from: entityRef,\n to: rel.targetRef,\n relations: [rel.type],\n label: 'visible',\n });\n }\n }\n\n if (!visitedNodes.has(rel.targetRef)) {\n nodeQueue.push(rel.targetRef);\n visitedNodes.add(rel.targetRef);\n }\n });\n }\n }\n\n setNodesAndEdges({ nodes, edges });\n },\n 100,\n [\n entities,\n rootEntityRefs,\n kinds,\n relations,\n unidirectional,\n mergeRelations,\n onNodeClick,\n relationPairs,\n ],\n );\n\n return {\n loading,\n error,\n ...nodesAndEdges,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n DependencyGraph,\n DependencyGraphTypes,\n} from '@backstage/core-components';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { CircularProgress, makeStyles, useTheme } from '@material-ui/core';\nimport classNames from 'classnames';\nimport React, { MouseEvent, useEffect, useMemo } from 'react';\nimport { CustomLabel } from './CustomLabel';\nimport { CustomNode } from './CustomNode';\nimport { ALL_RELATION_PAIRS, RelationPairs } from './relations';\nimport { Direction, EntityEdge, EntityNode } from './types';\nimport { useEntityRelationNodesAndEdges } from './useEntityRelationNodesAndEdges';\n\nconst useStyles = makeStyles(theme => ({\n progress: {\n position: 'absolute',\n left: '50%',\n top: '50%',\n marginLeft: '-20px',\n marginTop: '-20px',\n },\n container: {\n position: 'relative',\n width: '100%',\n display: 'flex',\n flexDirection: 'column',\n },\n graph: {\n width: '100%',\n flex: 1,\n // Right now there is no good way to style edges between nodes, we have to\n // fallback to these hacks:\n '& path[marker-end]': {\n transition: 'filter 0.1s ease-in-out',\n },\n '& path[marker-end]:hover': {\n filter: `drop-shadow(2px 2px 4px ${theme.palette.primary.dark});`,\n },\n '& g[data-testid=label]': {\n transition: 'transform 0s',\n },\n },\n}));\n\n/**\n * Core building block for custom entity relations diagrams.\n *\n * @public\n */\nexport const EntityRelationsGraph = (props: {\n rootEntityNames: CompoundEntityRef | CompoundEntityRef[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n direction?: Direction;\n onNodeClick?: (value: EntityNode, event: MouseEvent<unknown>) => void;\n relationPairs?: RelationPairs;\n className?: string;\n zoom?: 'enabled' | 'disabled' | 'enable-on-click';\n renderNode?: DependencyGraphTypes.RenderNodeFunction<EntityNode>;\n renderLabel?: DependencyGraphTypes.RenderLabelFunction<EntityEdge>;\n}) => {\n const {\n rootEntityNames,\n maxDepth = Number.POSITIVE_INFINITY,\n unidirectional = true,\n mergeRelations = true,\n kinds,\n relations,\n direction = Direction.LEFT_RIGHT,\n onNodeClick,\n relationPairs = ALL_RELATION_PAIRS,\n className,\n zoom = 'enabled',\n renderNode,\n renderLabel,\n } = props;\n\n const theme = useTheme();\n const classes = useStyles();\n const rootEntityRefs = useMemo(\n () =>\n (Array.isArray(rootEntityNames)\n ? rootEntityNames\n : [rootEntityNames]\n ).map(e => stringifyEntityRef(e)),\n [rootEntityNames],\n );\n const errorApi = useApi(errorApiRef);\n const { loading, error, nodes, edges } = useEntityRelationNodesAndEdges({\n rootEntityRefs,\n maxDepth,\n unidirectional,\n mergeRelations,\n kinds,\n relations,\n onNodeClick,\n relationPairs,\n });\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [errorApi, error]);\n\n return (\n <div className={classNames(classes.container, className)}>\n {loading && <CircularProgress className={classes.progress} />}\n {nodes && edges && (\n <DependencyGraph\n nodes={nodes}\n edges={edges}\n renderNode={renderNode || CustomNode}\n renderLabel={renderLabel || CustomLabel}\n direction={direction}\n className={classes.graph}\n paddingX={theme.spacing(4)}\n paddingY={theme.spacing(4)}\n labelPosition={DependencyGraphTypes.LabelPosition.RIGHT}\n labelOffset={theme.spacing(1)}\n zoom={zoom}\n />\n )}\n </div>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\n/**\n * Route pointing to the standalone catalog graph page.\n *\n * @public\n */\nexport const catalogGraphRouteRef = createRouteRef({\n id: 'catalog-graph',\n});\n\n/**\n * Route pointing to the entity page.\n * Used to navigate from the graph to an entity.\n *\n * @public\n * @deprecated This route is no longer used and can be removed\n */\nexport const catalogEntityRouteRef = createExternalRouteRef({\n id: 'catalog-entity',\n params: ['namespace', 'kind', 'name'],\n optional: true,\n});\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createPlugin } from '@backstage/core-plugin-api';\nimport { catalogEntityRouteRef, catalogGraphRouteRef } from './routes';\n\n/**\n * Catalog Graph Plugin instance.\n * @public\n */\nexport const catalogGraphPlugin = createPlugin({\n id: 'catalog-graph',\n routes: {\n catalogGraph: catalogGraphRouteRef,\n },\n externalRoutes: {\n catalogEntity: catalogEntityRouteRef,\n },\n});\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createComponentExtension,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\nimport { catalogGraphPlugin } from './plugin';\nimport { catalogGraphRouteRef } from './routes';\n\n/**\n * A card that displays the directly related entities to the current entity.\n *\n * @public\n */\nexport const EntityCatalogGraphCard = catalogGraphPlugin.provide(\n createComponentExtension({\n name: 'EntityCatalogGraphCard',\n component: {\n lazy: () =>\n import('./components/CatalogGraphCard').then(m => m.CatalogGraphCard),\n },\n }),\n);\n\n/**\n * A standalone page that can be added to your application providing a viewer\n * for your entities and their relations.\n *\n * @public\n */\nexport const CatalogGraphPage = catalogGraphPlugin.provide(\n createRoutableExtension({\n name: 'CatalogGraphPage',\n component: () =>\n import('./components/CatalogGraphPage').then(m => m.CatalogGraphPage),\n mountPoint: catalogGraphRouteRef,\n }),\n);\n"],"names":["useStyles","makeStyles"],"mappings":";;;;;;;;;;;;;;AAGA,MAAMA,WAAS,GAAG,UAAU,CAAC,CAAC,KAAK,MAAM;AACzC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;AACpC,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU;AAClC,GAAG;AACH,CAAC,CAAC,CAAC,CAAC;AACG,SAAS,WAAW,CAAC;AAC5B,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE;AACrB,CAAC,EAAE;AACH,EAAE,MAAM,OAAO,GAAGA,WAAS,EAAE,CAAC;AAC9B,EAAE,uBAAuB,KAAK,CAAC,aAAa,CA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H,CAAC,CAAC,EAAE;AACQ,MAAC,gBAAgB,GAAG,kBAAkB,CAAC,OAAO,CAAC,uBAAuB,CAAC;AACnF,EAAE,IAAI,EAAE,kBAAkB;AAC1B,EAAE,SAAS,EAAE,MAAM,OAAO,6BAA+B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC;AAC1F,EAAE,UAAU,EAAE,oBAAoB;AAClC,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/components/EntityRelationsGraph/CustomLabel.tsx","../src/components/EntityRelationsGraph/EntityKindIcon.tsx","../src/components/EntityRelationsGraph/CustomNode.tsx","../src/components/EntityRelationsGraph/relations.ts","../src/components/EntityRelationsGraph/types.ts","../src/components/EntityRelationsGraph/useEntityStore.ts","../src/components/EntityRelationsGraph/useEntityRelationGraph.ts","../src/components/EntityRelationsGraph/useEntityRelationNodesAndEdges.ts","../src/components/EntityRelationsGraph/EntityRelationsGraph.tsx","../src/routes.ts","../src/plugin.ts","../src/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { BackstageTheme } from '@backstage/theme';\nimport makeStyles from '@material-ui/core/styles/makeStyles';\nimport React from 'react';\nimport { EntityEdgeData } from './types';\nimport classNames from 'classnames';\n\nconst useStyles = makeStyles((theme: BackstageTheme) => ({\n text: {\n fill: theme.palette.textContrast,\n },\n secondary: {\n fill: theme.palette.textSubtle,\n },\n}));\n\nexport function CustomLabel({\n edge: { relations },\n}: DependencyGraphTypes.RenderLabelProps<EntityEdgeData>) {\n const classes = useStyles();\n return (\n <text className={classes.text} textAnchor=\"middle\">\n {relations.map((r, i) => (\n <tspan key={r} className={classNames(i > 0 && classes.secondary)}>\n {i > 0 && <tspan> / </tspan>}\n {r}\n </tspan>\n ))}\n </text>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useApp } from '@backstage/core-plugin-api';\nimport WorkIcon from '@material-ui/icons/Work';\nimport React from 'react';\n\nexport function EntityKindIcon({\n kind,\n ...props\n}: {\n kind: string;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n className?: string;\n}) {\n const app = useApp();\n const Icon =\n app.getSystemIcon(`kind:${kind.toLocaleLowerCase('en-US')}`) ?? WorkIcon;\n return <Icon {...props} />;\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { humanizeEntityRef } from '@backstage/plugin-catalog-react';\nimport { BackstageTheme } from '@backstage/theme';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport React, { useLayoutEffect, useRef, useState } from 'react';\nimport { EntityKindIcon } from './EntityKindIcon';\nimport { EntityNodeData } from './types';\n\nconst useStyles = makeStyles((theme: BackstageTheme) => ({\n node: {\n fill: theme.palette.grey[300],\n stroke: theme.palette.grey[300],\n\n '&.primary': {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n '&.secondary': {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n },\n text: {\n fill: theme.palette.getContrastText(theme.palette.grey[300]),\n\n '&.primary': {\n fill: theme.palette.primary.contrastText,\n },\n '&.secondary': {\n fill: theme.palette.secondary.contrastText,\n },\n '&.focused': {\n fontWeight: 'bold',\n },\n },\n clickable: {\n cursor: 'pointer',\n },\n}));\n\nexport function CustomNode({\n node: {\n id,\n kind,\n namespace,\n name,\n color = 'default',\n focused,\n title,\n onClick,\n },\n}: DependencyGraphTypes.RenderNodeProps<EntityNodeData>) {\n const classes = useStyles();\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const idRef = useRef<SVGTextElement | null>(null);\n\n useLayoutEffect(() => {\n // set the width to the length of the ID\n if (idRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n idRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n\n if (renderedHeight !== height || renderedWidth !== width) {\n setWidth(renderedWidth);\n setHeight(renderedHeight);\n }\n }\n }, [width, height]);\n\n const padding = 10;\n const iconSize = height;\n const paddedIconWidth = kind ? iconSize + padding : 0;\n const paddedWidth = paddedIconWidth + width + padding * 2;\n const paddedHeight = height + padding * 2;\n\n const displayTitle =\n title ??\n (kind && name && namespace\n ? humanizeEntityRef({ kind, name, namespace })\n : id);\n\n return (\n <g onClick={onClick} className={classNames(onClick && classes.clickable)}>\n <rect\n className={classNames(\n classes.node,\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n width={paddedWidth}\n height={paddedHeight}\n rx={10}\n />\n {kind && (\n <EntityKindIcon\n kind={kind}\n y={padding}\n x={padding}\n width={iconSize}\n height={iconSize}\n className={classNames(\n classes.text,\n focused && 'focused',\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n />\n )}\n <text\n ref={idRef}\n className={classNames(\n classes.text,\n focused && 'focused',\n color === 'primary' && 'primary',\n color === 'secondary' && 'secondary',\n )}\n y={paddedHeight / 2}\n x={paddedIconWidth + (width + padding * 2) / 2}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {displayTitle}\n </text>\n </g>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n RELATION_API_CONSUMED_BY,\n RELATION_API_PROVIDED_BY,\n RELATION_CHILD_OF,\n RELATION_CONSUMES_API,\n RELATION_DEPENDENCY_OF,\n RELATION_DEPENDS_ON,\n RELATION_HAS_MEMBER,\n RELATION_HAS_PART,\n RELATION_MEMBER_OF,\n RELATION_OWNED_BY,\n RELATION_OWNER_OF,\n RELATION_PARENT_OF,\n RELATION_PART_OF,\n RELATION_PROVIDES_API,\n} from '@backstage/catalog-model';\n\n/**\n * A pair of two relations that describe the opposite of each other. The first\n * relation is considered as the primary relation.\n *\n * @public\n */\nexport type RelationPairs = [string, string][];\n\n// TODO: This file only contains the pairs for the built-in relations.\n// How to implement this when custom relations are used? Right now you can pass\n// the relations everywhere.\n// Another option is to move this into @backstage/catalog-model\n\n/**\n * A list of pairs of entity relations, used to define which relations are\n * merged together and which the primary relation is.\n *\n * @public\n */\nexport const ALL_RELATION_PAIRS: RelationPairs = [\n [RELATION_OWNER_OF, RELATION_OWNED_BY],\n [RELATION_CONSUMES_API, RELATION_API_CONSUMED_BY],\n [RELATION_API_PROVIDED_BY, RELATION_PROVIDES_API],\n [RELATION_HAS_PART, RELATION_PART_OF],\n [RELATION_PARENT_OF, RELATION_CHILD_OF],\n [RELATION_HAS_MEMBER, RELATION_MEMBER_OF],\n [RELATION_DEPENDS_ON, RELATION_DEPENDENCY_OF],\n];\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DependencyGraphTypes } from '@backstage/core-components';\nimport { MouseEventHandler } from 'react';\n\n/**\n * Additional Data for entities.\n *\n * @public\n */\nexport type EntityEdgeData = {\n /**\n * Up to two relations that are connecting an entity.\n */\n relations: string[];\n /**\n * Whether the entity is visible or not.\n */\n // Not used, but has to be non empty to draw a label at all!\n label: 'visible';\n};\n\n/**\n * Edge between two entities.\n *\n * @public\n */\nexport type EntityEdge = DependencyGraphTypes.DependencyEdge<EntityEdgeData>;\n\n/**\n * Additional data for Entity Node\n *\n * @public\n */\nexport type EntityNodeData = {\n /**\n * Name of the entity.\n */\n name: string;\n /**\n * Optional kind of the entity.\n */\n kind?: string;\n /**\n * Optional title of the entity.\n */\n title?: string;\n /**\n * Namespace of the entity.\n */\n namespace: string;\n /**\n * Whether the entity is focused, optional, defaults to false. Focused\n * entities are highlighted in the graph.\n */\n focused?: boolean;\n /**\n * Optional color of the entity, defaults to 'default'.\n */\n color?: 'primary' | 'secondary' | 'default';\n /**\n * Optional click handler.\n */\n onClick?: MouseEventHandler<unknown>;\n};\n\n/**\n * Node representing an entity.\n *\n * @public\n */\nexport type EntityNode = DependencyGraphTypes.DependencyNode<EntityNodeData>;\n\n/**\n * Render direction of the graph.\n *\n * @public\n */\nexport enum Direction {\n /**\n * Top to bottom.\n */\n TOP_BOTTOM = 'TB',\n /**\n * Bottom to top.\n */\n BOTTOM_TOP = 'BT',\n /**\n * Left to right.\n */\n LEFT_RIGHT = 'LR',\n /**\n * Right to left.\n */\n RIGHT_LEFT = 'RL',\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport limiterFactory from 'p-limit';\nimport { Dispatch, useCallback, useRef, useState } from 'react';\nimport useAsyncFn from 'react-use/lib/useAsyncFn';\n\n// TODO: This is a good use case for a graphql API, once it is available in the\n// future.\n\nconst limiter = limiterFactory(10);\n\n/**\n * Ensures that a set of requested entities is loaded.\n */\nexport function useEntityStore(): {\n entities: { [ref: string]: Entity };\n loading: boolean;\n error?: Error;\n requestEntities: Dispatch<string[]>;\n} {\n const catalogClient = useApi(catalogApiRef);\n const state = useRef({\n requestedEntities: new Set<string>(),\n outstandingEntities: new Map<string, Promise<Entity | undefined>>(),\n cachedEntities: new Map<string, Entity>(),\n });\n const [entities, setEntities] = useState<{\n [ref: string]: Entity;\n }>({});\n\n const updateEntities = useCallback(() => {\n const { cachedEntities, requestedEntities } = state.current;\n const filteredEntities: { [ref: string]: Entity } = {};\n requestedEntities.forEach(entityRef => {\n const entity = cachedEntities.get(entityRef);\n\n if (entity) {\n filteredEntities[entityRef] = entity;\n }\n });\n setEntities(filteredEntities);\n }, [state, setEntities]);\n\n const [asyncState, fetch] = useAsyncFn(async () => {\n const { requestedEntities, outstandingEntities, cachedEntities } =\n state.current;\n\n await Promise.all(\n Array.from(requestedEntities).map(entityRef =>\n limiter(async () => {\n if (cachedEntities.has(entityRef)) {\n return;\n }\n\n if (outstandingEntities.has(entityRef)) {\n await outstandingEntities.get(entityRef);\n return;\n }\n\n const promise = catalogClient.getEntityByRef(entityRef);\n\n outstandingEntities.set(entityRef, promise);\n\n try {\n const entity = await promise;\n\n if (entity) {\n cachedEntities.set(entityRef, entity);\n updateEntities();\n }\n } finally {\n outstandingEntities.delete(entityRef);\n }\n }),\n ),\n );\n }, [state, updateEntities]);\n const { loading, error } = asyncState;\n\n const requestEntities = useCallback(\n (entityRefs: string[]) => {\n const n = new Set(entityRefs);\n const { requestedEntities } = state.current;\n\n if (\n n.size !== requestedEntities.size ||\n Array.from(n).some(e => !requestedEntities.has(e))\n ) {\n state.current.requestedEntities = n;\n fetch();\n updateEntities();\n }\n },\n [state, fetch, updateEntities],\n );\n\n return {\n entities,\n loading,\n error,\n requestEntities,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport { useEffect } from 'react';\nimport { useEntityStore } from './useEntityStore';\n\n/**\n * Discover the graph of entities connected by relations, starting from a set of\n * root entities. Filters are used to select which relations to includes.\n * Returns all discovered entities once they are loaded.\n */\nexport function useEntityRelationGraph({\n rootEntityRefs,\n filter: { maxDepth = Number.POSITIVE_INFINITY, relations, kinds } = {},\n}: {\n rootEntityRefs: string[];\n filter?: {\n maxDepth?: number;\n relations?: string[];\n kinds?: string[];\n };\n}): {\n entities?: { [ref: string]: Entity };\n loading: boolean;\n error?: Error;\n} {\n const { entities, loading, error, requestEntities } = useEntityStore();\n\n useEffect(() => {\n const expectedEntities = new Set([...rootEntityRefs]);\n const processedEntityRefs = new Set<string>();\n\n let nextDepthRefQueue = [...rootEntityRefs];\n let depth = 0;\n\n while (\n nextDepthRefQueue.length > 0 &&\n (!isFinite(maxDepth) || depth < maxDepth)\n ) {\n const entityRefQueue = nextDepthRefQueue;\n nextDepthRefQueue = [];\n\n while (entityRefQueue.length > 0) {\n const entityRef = entityRefQueue.shift()!;\n const entity = entities[entityRef];\n\n processedEntityRefs.add(entityRef);\n\n if (entity && entity.relations) {\n for (const rel of entity.relations) {\n if (\n (!relations || relations.includes(rel.type)) &&\n (!kinds ||\n kinds.some(kind =>\n rel.targetRef.startsWith(\n `${kind.toLocaleLowerCase('en-US')}:`,\n ),\n ))\n ) {\n if (!processedEntityRefs.has(rel.targetRef)) {\n nextDepthRefQueue.push(rel.targetRef);\n expectedEntities.add(rel.targetRef);\n }\n }\n }\n }\n }\n\n ++depth;\n }\n\n requestEntities([...expectedEntities]);\n }, [entities, rootEntityRefs, maxDepth, relations, kinds, requestEntities]);\n\n return {\n entities,\n loading,\n error,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DEFAULT_NAMESPACE } from '@backstage/catalog-model';\nimport { MouseEvent, useState } from 'react';\nimport useDebounce from 'react-use/lib/useDebounce';\nimport { RelationPairs, ALL_RELATION_PAIRS } from './relations';\nimport { EntityEdge, EntityNode } from './types';\nimport { useEntityRelationGraph } from './useEntityRelationGraph';\n\n/**\n * Generate nodes and edges to render the entity graph.\n */\nexport function useEntityRelationNodesAndEdges({\n rootEntityRefs,\n maxDepth = Number.POSITIVE_INFINITY,\n unidirectional = true,\n mergeRelations = true,\n kinds,\n relations,\n onNodeClick,\n relationPairs = ALL_RELATION_PAIRS,\n}: {\n rootEntityRefs: string[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n onNodeClick?: (value: EntityNode, event: MouseEvent<unknown>) => void;\n relationPairs?: RelationPairs;\n}): {\n loading: boolean;\n nodes?: EntityNode[];\n edges?: EntityEdge[];\n error?: Error;\n} {\n const [nodesAndEdges, setNodesAndEdges] = useState<{\n nodes?: EntityNode[];\n edges?: EntityEdge[];\n }>({});\n const { entities, loading, error } = useEntityRelationGraph({\n rootEntityRefs,\n filter: {\n maxDepth,\n kinds,\n relations,\n },\n });\n\n useDebounce(\n () => {\n if (!entities || Object.keys(entities).length === 0) {\n setNodesAndEdges({});\n return;\n }\n\n const nodes = Object.entries(entities).map(([entityRef, entity]) => {\n const focused = rootEntityRefs.includes(entityRef);\n const node: EntityNode = {\n id: entityRef,\n title: entity.metadata?.title ?? undefined,\n kind: entity.kind,\n name: entity.metadata.name,\n namespace: entity.metadata.namespace ?? DEFAULT_NAMESPACE,\n focused,\n color: focused ? 'secondary' : 'primary',\n };\n\n if (onNodeClick) {\n node.onClick = event => onNodeClick(node, event);\n }\n\n return node;\n });\n\n const edges: EntityEdge[] = [];\n const visitedNodes = new Set<string>();\n const nodeQueue = [...rootEntityRefs];\n\n while (nodeQueue.length > 0) {\n const entityRef = nodeQueue.pop()!;\n const entity = entities[entityRef];\n visitedNodes.add(entityRef);\n\n if (entity) {\n entity?.relations?.forEach(rel => {\n // Check if the related entity should be displayed, if not, ignore\n // the relation too\n if (!entities[rel.targetRef]) {\n return;\n }\n\n if (relations && !relations.includes(rel.type)) {\n return;\n }\n\n if (\n kinds &&\n !kinds.some(kind =>\n rel.targetRef.startsWith(`${kind.toLocaleLowerCase('en-US')}:`),\n )\n ) {\n return;\n }\n\n if (!unidirectional || !visitedNodes.has(rel.targetRef)) {\n if (mergeRelations) {\n const pair = relationPairs.find(\n ([l, r]) => l === rel.type || r === rel.type,\n ) ?? [rel.type];\n const [left] = pair;\n\n edges.push({\n from: left === rel.type ? entityRef : rel.targetRef,\n to: left === rel.type ? rel.targetRef : entityRef,\n relations: pair,\n label: 'visible',\n });\n } else {\n edges.push({\n from: entityRef,\n to: rel.targetRef,\n relations: [rel.type],\n label: 'visible',\n });\n }\n }\n\n if (!visitedNodes.has(rel.targetRef)) {\n nodeQueue.push(rel.targetRef);\n visitedNodes.add(rel.targetRef);\n }\n });\n }\n }\n\n setNodesAndEdges({ nodes, edges });\n },\n 100,\n [\n entities,\n rootEntityRefs,\n kinds,\n relations,\n unidirectional,\n mergeRelations,\n onNodeClick,\n relationPairs,\n ],\n );\n\n return {\n loading,\n error,\n ...nodesAndEdges,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n DependencyGraph,\n DependencyGraphTypes,\n} from '@backstage/core-components';\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { CircularProgress, makeStyles, useTheme } from '@material-ui/core';\nimport classNames from 'classnames';\nimport React, { MouseEvent, useEffect, useMemo } from 'react';\nimport { CustomLabel } from './CustomLabel';\nimport { CustomNode } from './CustomNode';\nimport { ALL_RELATION_PAIRS, RelationPairs } from './relations';\nimport { Direction, EntityEdge, EntityNode } from './types';\nimport { useEntityRelationNodesAndEdges } from './useEntityRelationNodesAndEdges';\n\nconst useStyles = makeStyles(theme => ({\n progress: {\n position: 'absolute',\n left: '50%',\n top: '50%',\n marginLeft: '-20px',\n marginTop: '-20px',\n },\n container: {\n position: 'relative',\n width: '100%',\n display: 'flex',\n flexDirection: 'column',\n },\n graph: {\n width: '100%',\n flex: 1,\n // Right now there is no good way to style edges between nodes, we have to\n // fallback to these hacks:\n '& path[marker-end]': {\n transition: 'filter 0.1s ease-in-out',\n },\n '& path[marker-end]:hover': {\n filter: `drop-shadow(2px 2px 4px ${theme.palette.primary.dark});`,\n },\n '& g[data-testid=label]': {\n transition: 'transform 0s',\n },\n },\n}));\n\n/**\n * Core building block for custom entity relations diagrams.\n *\n * @public\n */\nexport const EntityRelationsGraph = (props: {\n rootEntityNames: CompoundEntityRef | CompoundEntityRef[];\n maxDepth?: number;\n unidirectional?: boolean;\n mergeRelations?: boolean;\n kinds?: string[];\n relations?: string[];\n direction?: Direction;\n onNodeClick?: (value: EntityNode, event: MouseEvent<unknown>) => void;\n relationPairs?: RelationPairs;\n className?: string;\n zoom?: 'enabled' | 'disabled' | 'enable-on-click';\n renderNode?: DependencyGraphTypes.RenderNodeFunction<EntityNode>;\n renderLabel?: DependencyGraphTypes.RenderLabelFunction<EntityEdge>;\n}) => {\n const {\n rootEntityNames,\n maxDepth = Number.POSITIVE_INFINITY,\n unidirectional = true,\n mergeRelations = true,\n kinds,\n relations,\n direction = Direction.LEFT_RIGHT,\n onNodeClick,\n relationPairs = ALL_RELATION_PAIRS,\n className,\n zoom = 'enabled',\n renderNode,\n renderLabel,\n } = props;\n\n const theme = useTheme();\n const classes = useStyles();\n const rootEntityRefs = useMemo(\n () =>\n (Array.isArray(rootEntityNames)\n ? rootEntityNames\n : [rootEntityNames]\n ).map(e => stringifyEntityRef(e)),\n [rootEntityNames],\n );\n const errorApi = useApi(errorApiRef);\n const { loading, error, nodes, edges } = useEntityRelationNodesAndEdges({\n rootEntityRefs,\n maxDepth,\n unidirectional,\n mergeRelations,\n kinds,\n relations,\n onNodeClick,\n relationPairs,\n });\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [errorApi, error]);\n\n return (\n <div className={classNames(classes.container, className)}>\n {loading && <CircularProgress className={classes.progress} />}\n {nodes && edges && (\n <DependencyGraph\n nodes={nodes}\n edges={edges}\n renderNode={renderNode || CustomNode}\n renderLabel={renderLabel || CustomLabel}\n direction={direction}\n className={classes.graph}\n paddingX={theme.spacing(4)}\n paddingY={theme.spacing(4)}\n labelPosition={DependencyGraphTypes.LabelPosition.RIGHT}\n labelOffset={theme.spacing(1)}\n zoom={zoom}\n />\n )}\n </div>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\n/**\n * Route pointing to the standalone catalog graph page.\n *\n * @public\n */\nexport const catalogGraphRouteRef = createRouteRef({\n id: 'catalog-graph',\n});\n\n/**\n * Route pointing to the entity page.\n * Used to navigate from the graph to an entity.\n *\n * @public\n * @deprecated This route is no longer used and can be removed\n */\nexport const catalogEntityRouteRef = createExternalRouteRef({\n id: 'catalog-entity',\n params: ['namespace', 'kind', 'name'],\n optional: true,\n});\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createPlugin } from '@backstage/core-plugin-api';\nimport { catalogEntityRouteRef, catalogGraphRouteRef } from './routes';\n\n/**\n * Catalog Graph Plugin instance.\n * @public\n */\nexport const catalogGraphPlugin = createPlugin({\n id: 'catalog-graph',\n routes: {\n catalogGraph: catalogGraphRouteRef,\n },\n externalRoutes: {\n catalogEntity: catalogEntityRouteRef,\n },\n});\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createComponentExtension,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\nimport { catalogGraphPlugin } from './plugin';\nimport { catalogGraphRouteRef } from './routes';\n\n/**\n * A card that displays the directly related entities to the current entity.\n *\n * @public\n */\nexport const EntityCatalogGraphCard = catalogGraphPlugin.provide(\n createComponentExtension({\n name: 'EntityCatalogGraphCard',\n component: {\n lazy: () =>\n import('./components/CatalogGraphCard').then(m => m.CatalogGraphCard),\n },\n }),\n);\n\n/**\n * A standalone page that can be added to your application providing a viewer\n * for your entities and their relations.\n *\n * @public\n */\nexport const CatalogGraphPage = catalogGraphPlugin.provide(\n createRoutableExtension({\n name: 'CatalogGraphPage',\n component: () =>\n import('./components/CatalogGraphPage').then(m => m.CatalogGraphPage),\n mountPoint: catalogGraphRouteRef,\n }),\n);\n"],"names":["useStyles","makeStyles"],"mappings":";;;;;;;;;;;;;;AAGA,MAAMA,WAAS,GAAG,UAAU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qBAAqB,GAAG,sBAAsB,CAAC;AAC5D,EAAE,EAAE,EAAE,gBAAgB;AACtB,EAAE,MAAM,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC;AACvC,EAAE,QAAQ,EAAE,IAAI;AAChB,CAAC,CAAC;;ACTU,MAAC,kBAAkB,GAAG,YAAY,CAAC;AAC/C,EAAE,EAAE,EAAE,eAAe;AACrB,EAAE,MAAM,EAAE;AACV,IAAI,YAAY,EAAE,oBAAoB;AACtC,GAAG;AACH,EAAE,cAAc,EAAE;AAClB,IAAI,aAAa,EAAE,qBAAqB;AACxC,GAAG;AACH,CAAC;;ACJW,MAAC,sBAAsB,GAAG,kBAAkB,CAAC,OAAO;AAChE,EAAE,wBAAwB,CAAC;AAC3B,IAAI,IAAI,EAAE,wBAAwB;AAClC,IAAI,SAAS,EAAE;AACf,MAAM,IAAI,EAAE,MAAM,OAAO,6BAA+B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC;AACzF,KAAK;AACL,GAAG,CAAC;AACJ,EAAE;AACU,MAAC,gBAAgB,GAAG,kBAAkB,CAAC,OAAO;AAC1D,EAAE,uBAAuB,CAAC;AAC1B,IAAI,IAAI,EAAE,kBAAkB;AAC5B,IAAI,SAAS,EAAE,MAAM,OAAO,6BAA+B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC;AAC5F,IAAI,UAAU,EAAE,oBAAoB;AACpC,GAAG,CAAC;AACJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-graph",
3
- "version": "0.2.19",
3
+ "version": "0.2.20",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -26,9 +26,9 @@
26
26
  "dependencies": {
27
27
  "@backstage/catalog-client": "^1.0.4",
28
28
  "@backstage/catalog-model": "^1.1.0",
29
- "@backstage/core-components": "^0.10.0",
30
- "@backstage/core-plugin-api": "^1.0.4",
31
- "@backstage/plugin-catalog-react": "^1.1.2",
29
+ "@backstage/core-components": "^0.11.0",
30
+ "@backstage/core-plugin-api": "^1.0.5",
31
+ "@backstage/plugin-catalog-react": "^1.1.3",
32
32
  "@backstage/theme": "^0.2.16",
33
33
  "@material-ui/core": "^4.12.2",
34
34
  "@material-ui/icons": "^4.9.1",
@@ -45,11 +45,11 @@
45
45
  "react": "^16.13.1 || ^17.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@backstage/cli": "^0.18.0",
49
- "@backstage/core-app-api": "^1.0.4",
50
- "@backstage/dev-utils": "^1.0.4",
51
- "@backstage/plugin-catalog": "^1.4.0",
52
- "@backstage/test-utils": "^1.1.2",
48
+ "@backstage/cli": "^0.18.1",
49
+ "@backstage/core-app-api": "^1.0.5",
50
+ "@backstage/dev-utils": "^1.0.5",
51
+ "@backstage/plugin-catalog": "^1.5.0",
52
+ "@backstage/test-utils": "^1.1.3",
53
53
  "@backstage/types": "^1.0.0",
54
54
  "@testing-library/jest-dom": "^5.10.1",
55
55
  "@testing-library/react": "^12.1.3",
@@ -60,5 +60,5 @@
60
60
  "files": [
61
61
  "dist"
62
62
  ],
63
- "gitHead": "999878d8f1ae30f6a15925816af2016cb9d717a1"
63
+ "gitHead": "a12f6269e3bf224aa7f52475be9152bc52addeed"
64
64
  }