@backstage/plugin-catalog-graph 0.4.20 → 0.4.21-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/alpha.d.ts +26 -1
- package/dist/alpha.esm.js +1 -0
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/CatalogGraphCard/CatalogGraphCard.esm.js +5 -2
- package/dist/components/CatalogGraphCard/CatalogGraphCard.esm.js.map +1 -1
- package/dist/components/CatalogGraphPage/CatalogGraphPage.esm.js +11 -6
- package/dist/components/CatalogGraphPage/CatalogGraphPage.esm.js.map +1 -1
- package/dist/components/CatalogGraphPage/CurveFilter.esm.js +8 -5
- package/dist/components/CatalogGraphPage/CurveFilter.esm.js.map +1 -1
- package/dist/components/CatalogGraphPage/DirectionFilter.esm.js +10 -7
- package/dist/components/CatalogGraphPage/DirectionFilter.esm.js.map +1 -1
- package/dist/components/CatalogGraphPage/MaxDepthFilter.esm.js +8 -3
- package/dist/components/CatalogGraphPage/MaxDepthFilter.esm.js.map +1 -1
- package/dist/components/CatalogGraphPage/SelectedKindsFilter.esm.js +5 -2
- package/dist/components/CatalogGraphPage/SelectedKindsFilter.esm.js.map +1 -1
- package/dist/components/CatalogGraphPage/SelectedRelationsFilter.esm.js +5 -2
- package/dist/components/CatalogGraphPage/SelectedRelationsFilter.esm.js.map +1 -1
- package/dist/package.json.esm.js +1 -1
- package/dist/translation.esm.js +45 -0
- package/dist/translation.esm.js.map +1 -0
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-graph
|
|
2
2
|
|
|
3
|
+
## 0.4.21-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/catalog-model@1.7.5-next.0
|
|
9
|
+
- @backstage/plugin-catalog-react@1.19.1-next.1
|
|
10
|
+
- @backstage/catalog-client@1.10.2-next.0
|
|
11
|
+
- @backstage/core-components@0.17.4-next.1
|
|
12
|
+
- @backstage/core-plugin-api@1.10.9-next.0
|
|
13
|
+
- @backstage/core-compat-api@0.4.4-next.1
|
|
14
|
+
- @backstage/frontend-plugin-api@0.10.4-next.1
|
|
15
|
+
|
|
16
|
+
## 0.4.21-next.0
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- fe1a2f4: Catalog graph plugin support i18n
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
- @backstage/plugin-catalog-react@1.19.1-next.0
|
|
23
|
+
- @backstage/core-components@0.17.4-next.0
|
|
24
|
+
- @backstage/catalog-client@1.10.1
|
|
25
|
+
- @backstage/catalog-model@1.7.4
|
|
26
|
+
- @backstage/core-compat-api@0.4.4-next.0
|
|
27
|
+
- @backstage/core-plugin-api@1.10.8
|
|
28
|
+
- @backstage/frontend-plugin-api@0.10.4-next.0
|
|
29
|
+
- @backstage/types@1.2.1
|
|
30
|
+
|
|
3
31
|
## 0.4.20
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -4,6 +4,31 @@ import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalo
|
|
|
4
4
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
5
5
|
import { Direction } from '@backstage/plugin-catalog-graph';
|
|
6
6
|
|
|
7
|
+
/** @alpha */
|
|
8
|
+
declare const catalogGraphTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"catalog-graph", {
|
|
9
|
+
readonly "catalogGraphCard.title": "Relations";
|
|
10
|
+
readonly "catalogGraphCard.deepLinkTitle": "View graph";
|
|
11
|
+
readonly "catalogGraphPage.title": "Catalog Graph";
|
|
12
|
+
readonly "catalogGraphPage.filterToggleButtonTitle": "Filters";
|
|
13
|
+
readonly "catalogGraphPage.supportButtonDescription": "Start tracking your component in by adding it to the software catalog.";
|
|
14
|
+
readonly "catalogGraphPage.simplifiedSwitchLabel": "Simplified";
|
|
15
|
+
readonly "catalogGraphPage.mergeRelationsSwitchLabel": "Merge relations";
|
|
16
|
+
readonly "catalogGraphPage.zoomOutDescription": "Use pinch & zoom to move around the diagram. Click to change active node, shift click to navigate to entity.";
|
|
17
|
+
readonly "catalogGraphPage.curveFilter.title": "Curve";
|
|
18
|
+
readonly "catalogGraphPage.curveFilter.curveStepBefore": "Step Before";
|
|
19
|
+
readonly "catalogGraphPage.curveFilter.curveMonotoneX": "Monotone X";
|
|
20
|
+
readonly "catalogGraphPage.directionFilter.title": "Direction";
|
|
21
|
+
readonly "catalogGraphPage.directionFilter.leftToRight": "Left to right";
|
|
22
|
+
readonly "catalogGraphPage.directionFilter.rightToLeft": "Right to left";
|
|
23
|
+
readonly "catalogGraphPage.directionFilter.topToBottom": "Top to bottom";
|
|
24
|
+
readonly "catalogGraphPage.directionFilter.bottomToTop": "Bottom to top";
|
|
25
|
+
readonly "catalogGraphPage.maxDepthFilter.title": "Max depth";
|
|
26
|
+
readonly "catalogGraphPage.maxDepthFilter.inputPlaceholder": "∞ Infinite";
|
|
27
|
+
readonly "catalogGraphPage.maxDepthFilter.clearButtonAriaLabel": "clear max depth";
|
|
28
|
+
readonly "catalogGraphPage.selectedKindsFilter.title": "Kinds";
|
|
29
|
+
readonly "catalogGraphPage.selectedRelationsFilter.title": "Relations";
|
|
30
|
+
}>;
|
|
31
|
+
|
|
7
32
|
declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
8
33
|
catalogGraph: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
9
34
|
}, {
|
|
@@ -121,4 +146,4 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
121
146
|
}>;
|
|
122
147
|
}>;
|
|
123
148
|
|
|
124
|
-
export { _default as default };
|
|
149
|
+
export { catalogGraphTranslationRef, _default as default };
|
package/dist/alpha.esm.js
CHANGED
|
@@ -4,6 +4,7 @@ import { compatWrapper, convertLegacyRouteRef } from '@backstage/core-compat-api
|
|
|
4
4
|
import { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
5
5
|
import { catalogGraphRouteRef, catalogEntityRouteRef } from './routes.esm.js';
|
|
6
6
|
import { Direction } from '@backstage/plugin-catalog-graph';
|
|
7
|
+
export { catalogGraphTranslationRef } from './translation.esm.js';
|
|
7
8
|
|
|
8
9
|
const CatalogGraphEntityCard = EntityCardBlueprint.makeWithOverrides({
|
|
9
10
|
name: "relations",
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 createFrontendPlugin,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { catalogGraphRouteRef, catalogEntityRouteRef } from './routes';\nimport { Direction } from '@backstage/plugin-catalog-graph';\n\nconst CatalogGraphEntityCard = EntityCardBlueprint.makeWithOverrides({\n name: 'relations',\n config: {\n schema: {\n kinds: z => z.array(z.string()).optional(),\n relations: z => z.array(z.string()).optional(),\n maxDepth: z => z.number().optional(),\n unidirectional: z => z.boolean().optional(),\n mergeRelations: z => z.boolean().optional(),\n direction: z => z.nativeEnum(Direction).optional(),\n relationPairs: z => z.array(z.tuple([z.string(), z.string()])).optional(),\n zoom: z => z.enum(['enabled', 'disabled', 'enable-on-click']).optional(),\n curve: z => z.enum(['curveStepBefore', 'curveMonotoneX']).optional(),\n // Skipping a \"variant\" config for now, defaulting to \"gridItem\" in the component\n // For more details, see this comment: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n title: z => z.string().optional(),\n height: z => z.number().optional(),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () =>\n import('./components/CatalogGraphCard').then(m =>\n compatWrapper(<m.CatalogGraphCard {...config} />),\n ),\n });\n },\n});\n\nconst CatalogGraphPage = PageBlueprint.makeWithOverrides({\n config: {\n schema: {\n selectedKinds: z => z.array(z.string()).optional(),\n selectedRelations: z => z.array(z.string()).optional(),\n rootEntityRefs: z => z.array(z.string()).optional(),\n maxDepth: z => z.number().optional(),\n unidirectional: z => z.boolean().optional(),\n mergeRelations: z => z.boolean().optional(),\n direction: z => z.nativeEnum(Direction).optional(),\n showFilters: z => z.boolean().optional(),\n curve: z => z.enum(['curveStepBefore', 'curveMonotoneX']).optional(),\n kinds: z => z.array(z.string()).optional(),\n relations: z => z.array(z.string()).optional(),\n relationPairs: z => z.array(z.tuple([z.string(), z.string()])).optional(),\n zoom: z => z.enum(['enabled', 'disabled', 'enable-on-click']).optional(),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n defaultPath: '/catalog-graph',\n routeRef: convertLegacyRouteRef(catalogGraphRouteRef),\n loader: () =>\n import('./components/CatalogGraphPage').then(m =>\n compatWrapper(<m.CatalogGraphPage {...config} />),\n ),\n });\n },\n});\n\nexport default createFrontendPlugin({\n pluginId: 'catalog-graph',\n info: { packageJson: () => import('../package.json') },\n routes: {\n catalogGraph: convertLegacyRouteRef(catalogGraphRouteRef),\n },\n externalRoutes: {\n catalogEntity: convertLegacyRouteRef(catalogEntityRouteRef),\n },\n extensions: [CatalogGraphPage, CatalogGraphEntityCard],\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 createFrontendPlugin,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport { EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';\nimport { catalogGraphRouteRef, catalogEntityRouteRef } from './routes';\nimport { Direction } from '@backstage/plugin-catalog-graph';\n\nconst CatalogGraphEntityCard = EntityCardBlueprint.makeWithOverrides({\n name: 'relations',\n config: {\n schema: {\n kinds: z => z.array(z.string()).optional(),\n relations: z => z.array(z.string()).optional(),\n maxDepth: z => z.number().optional(),\n unidirectional: z => z.boolean().optional(),\n mergeRelations: z => z.boolean().optional(),\n direction: z => z.nativeEnum(Direction).optional(),\n relationPairs: z => z.array(z.tuple([z.string(), z.string()])).optional(),\n zoom: z => z.enum(['enabled', 'disabled', 'enable-on-click']).optional(),\n curve: z => z.enum(['curveStepBefore', 'curveMonotoneX']).optional(),\n // Skipping a \"variant\" config for now, defaulting to \"gridItem\" in the component\n // For more details, see this comment: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n title: z => z.string().optional(),\n height: z => z.number().optional(),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n loader: async () =>\n import('./components/CatalogGraphCard').then(m =>\n compatWrapper(<m.CatalogGraphCard {...config} />),\n ),\n });\n },\n});\n\nconst CatalogGraphPage = PageBlueprint.makeWithOverrides({\n config: {\n schema: {\n selectedKinds: z => z.array(z.string()).optional(),\n selectedRelations: z => z.array(z.string()).optional(),\n rootEntityRefs: z => z.array(z.string()).optional(),\n maxDepth: z => z.number().optional(),\n unidirectional: z => z.boolean().optional(),\n mergeRelations: z => z.boolean().optional(),\n direction: z => z.nativeEnum(Direction).optional(),\n showFilters: z => z.boolean().optional(),\n curve: z => z.enum(['curveStepBefore', 'curveMonotoneX']).optional(),\n kinds: z => z.array(z.string()).optional(),\n relations: z => z.array(z.string()).optional(),\n relationPairs: z => z.array(z.tuple([z.string(), z.string()])).optional(),\n zoom: z => z.enum(['enabled', 'disabled', 'enable-on-click']).optional(),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n defaultPath: '/catalog-graph',\n routeRef: convertLegacyRouteRef(catalogGraphRouteRef),\n loader: () =>\n import('./components/CatalogGraphPage').then(m =>\n compatWrapper(<m.CatalogGraphPage {...config} />),\n ),\n });\n },\n});\n\nexport default createFrontendPlugin({\n pluginId: 'catalog-graph',\n info: { packageJson: () => import('../package.json') },\n routes: {\n catalogGraph: convertLegacyRouteRef(catalogGraphRouteRef),\n },\n externalRoutes: {\n catalogEntity: convertLegacyRouteRef(catalogEntityRouteRef),\n },\n extensions: [CatalogGraphPage, CatalogGraphEntityCard],\n});\n\nexport { catalogGraphTranslationRef } from './translation';\n"],"names":[],"mappings":";;;;;;;;AA4BA,MAAM,sBAAA,GAAyB,oBAAoB,iBAAkB,CAAA;AAAA,EACnE,IAAM,EAAA,WAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,KAAA,EAAO,OAAK,CAAE,CAAA,KAAA,CAAM,EAAE,MAAO,EAAC,EAAE,QAAS,EAAA;AAAA,MACzC,SAAA,EAAW,OAAK,CAAE,CAAA,KAAA,CAAM,EAAE,MAAO,EAAC,EAAE,QAAS,EAAA;AAAA,MAC7C,QAAU,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,MACnC,cAAgB,EAAA,CAAA,CAAA,KAAK,CAAE,CA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AAA,eAAA,EAAiB,EAAE,MAAA,EAAU,EAAA;AACnC,IAAA,OAAO,eAAgB,CAAA;AAAA,MACrB,WAAa,EAAA,gBAAA;AAAA,MACb,QAAA,EAAU,sBAAsB,oBAAoB,CAAA;AAAA,MACpD,MAAQ,EAAA,MACN,OAAO,4CAA+B,CAAE,CAAA,IAAA;AAAA,QAAK,CAAA,CAAA,KAC3C,8BAAe,GAAA,CAAA,CAAA,CAAE,kBAAF,EAAoB,GAAG,QAAQ,CAAE;AAAA;AAClD,KACH,CAAA;AAAA;AAEL,CAAC,CAAA;AAED,YAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,eAAA;AAAA,EACV,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,uBAAiB,CAAE,EAAA;AAAA,EACrD,MAAQ,EAAA;AAAA,IACN,YAAA,EAAc,sBAAsB,oBAAoB;AAAA,GAC1D;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,aAAA,EAAe,sBAAsB,qBAAqB;AAAA,GAC5D;AAAA,EACA,UAAA,EAAY,CAAC,gBAAA,EAAkB,sBAAsB;AACvD,CAAC,CAAA;;;;"}
|
|
@@ -11,6 +11,8 @@ import { catalogGraphRouteRef } from '../../routes.esm.js';
|
|
|
11
11
|
import { EntityRelationsGraph } from '../EntityRelationsGraph/EntityRelationsGraph.esm.js';
|
|
12
12
|
import { ALL_RELATION_PAIRS } from '../EntityRelationsGraph/relations.esm.js';
|
|
13
13
|
import { Direction } from '../EntityRelationsGraph/types.esm.js';
|
|
14
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
15
|
+
import { catalogGraphTranslationRef } from '../../translation.esm.js';
|
|
14
16
|
|
|
15
17
|
const useStyles = makeStyles(
|
|
16
18
|
{
|
|
@@ -28,6 +30,7 @@ const useStyles = makeStyles(
|
|
|
28
30
|
{ name: "PluginCatalogGraphCatalogGraphCard" }
|
|
29
31
|
);
|
|
30
32
|
const CatalogGraphCard = (props) => {
|
|
33
|
+
const { t } = useTranslationRef(catalogGraphTranslationRef);
|
|
31
34
|
const {
|
|
32
35
|
variant = "gridItem",
|
|
33
36
|
relationPairs = ALL_RELATION_PAIRS,
|
|
@@ -43,7 +46,7 @@ const CatalogGraphCard = (props) => {
|
|
|
43
46
|
action,
|
|
44
47
|
rootEntityNames,
|
|
45
48
|
onNodeClick,
|
|
46
|
-
title = "
|
|
49
|
+
title = t("catalogGraphCard.title"),
|
|
47
50
|
zoom = "enable-on-click"
|
|
48
51
|
} = props;
|
|
49
52
|
const { entity } = useEntity();
|
|
@@ -92,7 +95,7 @@ const CatalogGraphCard = (props) => {
|
|
|
92
95
|
variant,
|
|
93
96
|
noPadding: true,
|
|
94
97
|
deepLink: {
|
|
95
|
-
title: "
|
|
98
|
+
title: t("catalogGraphCard.deepLinkTitle"),
|
|
96
99
|
link: catalogGraphUrl
|
|
97
100
|
},
|
|
98
101
|
children: /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogGraphCard.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/styles';\nimport qs from 'qs';\nimport { MouseEvent, ReactNode, useCallback, useMemo } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { catalogGraphRouteRef } from '../../routes';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n EntityRelationsGraphProps,\n} from '../EntityRelationsGraph';\n\n/** @public */\nexport type CatalogGraphCardClassKey = 'card' | 'graph';\n\nconst useStyles = makeStyles<Theme, { height: number | undefined }>(\n {\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 { name: 'PluginCatalogGraphCatalogGraphCard' },\n);\n\nexport const CatalogGraphCard = (\n props: Partial<EntityRelationsGraphProps> & {\n variant?: InfoCardVariants;\n height?: number;\n title?: string;\n action?: ReactNode;\n },\n) => {\n const {\n variant = 'gridItem',\n relationPairs = ALL_RELATION_PAIRS,\n maxDepth = 1,\n unidirectional = true,\n mergeRelations = true,\n direction = Direction.LEFT_RIGHT,\n kinds,\n relations,\n entityFilter,\n height,\n className,\n action,\n rootEntityNames,\n onNodeClick,\n title = '
|
|
1
|
+
{"version":3,"file":"CatalogGraphCard.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/styles';\nimport qs from 'qs';\nimport { MouseEvent, ReactNode, useCallback, useMemo } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { catalogGraphRouteRef } from '../../routes';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n EntityRelationsGraphProps,\n} from '../EntityRelationsGraph';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\n\n/** @public */\nexport type CatalogGraphCardClassKey = 'card' | 'graph';\n\nconst useStyles = makeStyles<Theme, { height: number | undefined }>(\n {\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 { name: 'PluginCatalogGraphCatalogGraphCard' },\n);\n\nexport const CatalogGraphCard = (\n props: Partial<EntityRelationsGraphProps> & {\n variant?: InfoCardVariants;\n height?: number;\n title?: string;\n action?: ReactNode;\n },\n) => {\n const { t } = useTranslationRef(catalogGraphTranslationRef);\n const {\n variant = 'gridItem',\n relationPairs = ALL_RELATION_PAIRS,\n maxDepth = 1,\n unidirectional = true,\n mergeRelations = true,\n direction = Direction.LEFT_RIGHT,\n kinds,\n relations,\n entityFilter,\n height,\n className,\n action,\n rootEntityNames,\n onNodeClick,\n title = t('catalogGraphCard.title'),\n zoom = 'enable-on-click',\n } = props;\n\n const { entity } = useEntity();\n const entityName = useMemo(() => getCompoundEntityRef(entity), [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 defaultOnNodeClick = 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.entity.metadata.title ?? humanizeEntityRef(nodeEntityName),\n { attributes: { to: path } },\n );\n navigate(path);\n },\n [catalogEntityRoute, navigate, analytics],\n );\n\n const catalogGraphParams = qs.stringify(\n {\n rootEntityRefs: [stringifyEntityRef(entity)],\n maxDepth: maxDepth,\n unidirectional,\n mergeRelations,\n selectedKinds: kinds,\n selectedRelations: relations,\n direction,\n },\n { arrayFormat: 'brackets', addQueryPrefix: true },\n );\n const catalogGraphUrl = `${catalogGraphRoute()}${catalogGraphParams}`;\n\n return (\n <InfoCard\n title={title}\n action={action}\n cardClassName={classes.card}\n variant={variant}\n noPadding\n deepLink={{\n title: t('catalogGraphCard.deepLinkTitle'),\n link: catalogGraphUrl,\n }}\n >\n <EntityRelationsGraph\n {...props}\n rootEntityNames={rootEntityNames || entityName}\n onNodeClick={onNodeClick || defaultOnNodeClick}\n className={className || classes.graph}\n maxDepth={maxDepth}\n unidirectional={unidirectional}\n mergeRelations={mergeRelations}\n direction={direction}\n relationPairs={relationPairs}\n entityFilter={entityFilter}\n zoom={zoom}\n />\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA8CA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,IAAM,EAAA,CAAC,EAAE,MAAA,EAAc,MAAA;AAAA,MACrB,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,QAAA;AAAA,MACf,SAAW,EAAA,MAAA;AAAA,MACX,SAAW,EAAA;AAAA,KACb,CAAA;AAAA,IACA,KAAO,EAAA;AAAA,MACL,IAAM,EAAA,CAAA;AAAA,MACN,SAAW,EAAA;AAAA;AACb,GACF;AAAA,EACA,EAAE,MAAM,oCAAqC;AAC/C,CAAA;AAEa,MAAA,gBAAA,GAA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;AAAA,UAC5B,SAAA,EAAW,aAAa,OAAQ,CAAA,KAAA;AAAA,UAChC,QAAA;AAAA,UACA,cAAA;AAAA,UACA,cAAA;AAAA,UACA,SAAA;AAAA,UACA,aAAA;AAAA,UACA,YAAA;AAAA,UACA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -21,6 +21,8 @@ import { SelectedKindsFilter } from './SelectedKindsFilter.esm.js';
|
|
|
21
21
|
import { SelectedRelationsFilter } from './SelectedRelationsFilter.esm.js';
|
|
22
22
|
import { SwitchFilter } from './SwitchFilter.esm.js';
|
|
23
23
|
import { useCatalogGraphPage } from './useCatalogGraphPage.esm.js';
|
|
24
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
25
|
+
import { catalogGraphTranslationRef } from '../../translation.esm.js';
|
|
24
26
|
|
|
25
27
|
const useStyles = makeStyles(
|
|
26
28
|
(theme) => ({
|
|
@@ -82,6 +84,7 @@ const CatalogGraphPage = (props) => {
|
|
|
82
84
|
initialState,
|
|
83
85
|
entityFilter
|
|
84
86
|
} = props;
|
|
87
|
+
const { t } = useTranslationRef(catalogGraphTranslationRef);
|
|
85
88
|
const navigate = useNavigate();
|
|
86
89
|
const classes = useStyles();
|
|
87
90
|
const catalogEntityRoute = useRouteRef(entityRouteRef);
|
|
@@ -135,7 +138,7 @@ const CatalogGraphPage = (props) => {
|
|
|
135
138
|
/* @__PURE__ */ jsx(
|
|
136
139
|
Header,
|
|
137
140
|
{
|
|
138
|
-
title: "
|
|
141
|
+
title: t("catalogGraphPage.title"),
|
|
139
142
|
subtitle: rootEntityNames.map((e) => humanizeEntityRef(e)).join(", ")
|
|
140
143
|
}
|
|
141
144
|
),
|
|
@@ -151,11 +154,12 @@ const CatalogGraphPage = (props) => {
|
|
|
151
154
|
onChange: () => toggleShowFilters(),
|
|
152
155
|
children: [
|
|
153
156
|
/* @__PURE__ */ jsx(FilterListIcon, {}),
|
|
154
|
-
"
|
|
157
|
+
" ",
|
|
158
|
+
t("catalogGraphPage.filterToggleButtonTitle")
|
|
155
159
|
]
|
|
156
160
|
}
|
|
157
161
|
),
|
|
158
|
-
children: /* @__PURE__ */ jsx(SupportButton, { children: "
|
|
162
|
+
children: /* @__PURE__ */ jsx(SupportButton, { children: t("catalogGraphPage.supportButtonDescription") })
|
|
159
163
|
}
|
|
160
164
|
),
|
|
161
165
|
/* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "stretch", className: classes.container, children: [
|
|
@@ -183,7 +187,7 @@ const CatalogGraphPage = (props) => {
|
|
|
183
187
|
{
|
|
184
188
|
value: unidirectional,
|
|
185
189
|
onChange: setUnidirectional,
|
|
186
|
-
label: "
|
|
190
|
+
label: t("catalogGraphPage.simplifiedSwitchLabel")
|
|
187
191
|
}
|
|
188
192
|
),
|
|
189
193
|
/* @__PURE__ */ jsx(
|
|
@@ -191,7 +195,7 @@ const CatalogGraphPage = (props) => {
|
|
|
191
195
|
{
|
|
192
196
|
value: mergeRelations,
|
|
193
197
|
onChange: setMergeRelations,
|
|
194
|
-
label: "
|
|
198
|
+
label: t("catalogGraphPage.mergeRelationsSwitchLabel")
|
|
195
199
|
}
|
|
196
200
|
)
|
|
197
201
|
] }),
|
|
@@ -205,7 +209,8 @@ const CatalogGraphPage = (props) => {
|
|
|
205
209
|
className: classes.legend,
|
|
206
210
|
children: [
|
|
207
211
|
/* @__PURE__ */ jsx(ZoomOutMap, { className: "icon" }),
|
|
208
|
-
"
|
|
212
|
+
" ",
|
|
213
|
+
t("catalogGraphPage.zoomOutDescription")
|
|
209
214
|
]
|
|
210
215
|
}
|
|
211
216
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogGraphPage.esm.js","sources":["../../../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 */\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 from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport ZoomOutMap from '@material-ui/icons/ZoomOutMap';\nimport ToggleButton from '@material-ui/lab/ToggleButton';\nimport { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n EntityRelationsGraphProps,\n} from '../EntityRelationsGraph';\nimport { CurveFilter } from './CurveFilter';\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\n/** @public */\nexport type CatalogGraphPageClassKey =\n | 'content'\n | 'container'\n | 'fullHeight'\n | 'graphWrapper'\n | 'graph'\n | 'legend'\n | 'filters';\n\nconst useStyles = makeStyles(\n 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 { name: 'PluginCatalogGraphCatalogGraphPage' },\n);\n\nexport const CatalogGraphPage = (\n props: {\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 curve?: 'curveStepBefore' | 'curveMonotoneX';\n };\n } & Partial<EntityRelationsGraphProps>,\n) => {\n const {\n relationPairs = ALL_RELATION_PAIRS,\n initialState,\n entityFilter,\n } = 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 curve,\n setCurve,\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.entity.metadata.title ?? humanizeEntityRef(nodeEntityName),\n { attributes: { to: path } },\n );\n navigate(path);\n } else {\n analytics.captureEvent(\n 'click',\n node.entity.metadata.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 <CurveFilter value={curve} onChange={setCurve} />\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 & zoom to move\n around the diagram. Click to change active node, shift click to\n navigate to entity.\n </Typography>\n <EntityRelationsGraph\n {...props}\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 entityFilter={entityFilter}\n className={classes.graph}\n zoom=\"enabled\"\n curve={curve}\n />\n </Paper>\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,OAAS,EAAA;AAAA,MACP,SAAW,EAAA;AAAA,KACb;AAAA,IACA,SAAW,EAAA;AAAA,MACT,MAAQ,EAAA,MAAA;AAAA,MACR,SAAW,EAAA,MAAA;AAAA,MACX,SAAW,EAAA;AAAA,KACb;AAAA,IACA,UAAY,EAAA;AAAA,MACV,SAAW,EAAA,MAAA;AAAA,MACX,OAAS,EAAA,MAAA;AAAA,MACT,SAAW,EAAA;AAAA,KACb;AAAA,IACA,YAAc,EAAA;AAAA,MACZ,QAAU,EAAA,UAAA;AAAA,MACV,IAAM,EAAA,CAAA;AAAA,MACN,SAAW,EAAA,CAAA;AAAA,MACX,OAAS,EAAA;AAAA,KACX;AAAA,IACA,KAAO,EAAA;AAAA,MACL,IAAM,EAAA,CAAA;AAAA,MACN,SAAW,EAAA;AAAA,KACb;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,QAAU,EAAA,UAAA;AAAA,MACV,MAAQ,EAAA,CAAA;AAAA,MACR,KAAO,EAAA,CAAA;AAAA,MACP,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACxB,SAAW,EAAA;AAAA,QACT,aAAe,EAAA;AAAA;AACjB,KACF;AAAA,IACA,OAAS,EAAA;AAAA,MACP,OAAS,EAAA,MAAA;AAAA,MACT,OAAA,E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GAAA,KAAA,CAAA;AAAA,cAEN,cAAA;AAAA,cACA,cAAA;AAAA,cACA,WAAA;AAAA,cACA,SAAA;AAAA,cACA,aAAA;AAAA,cACA,YAAA;AAAA,cACA,WAAW,OAAQ,CAAA,KAAA;AAAA,cACnB,IAAK,EAAA,SAAA;AAAA,cACL;AAAA;AAAA;AACF,SAAA,EACF,CACF,EAAA;AAAA,OACF,EAAA;AAAA,KACF,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
1
|
+
{"version":3,"file":"CatalogGraphPage.esm.js","sources":["../../../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 */\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 from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport ZoomOutMap from '@material-ui/icons/ZoomOutMap';\nimport ToggleButton from '@material-ui/lab/ToggleButton';\nimport { MouseEvent, useCallback } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport {\n ALL_RELATION_PAIRS,\n Direction,\n EntityNode,\n EntityRelationsGraph,\n EntityRelationsGraphProps,\n} from '../EntityRelationsGraph';\nimport { CurveFilter } from './CurveFilter';\nimport { DirectionFilter } from './DirectionFilter';\nimport { MaxDepthFilter } from './MaxDepthFilter';\nimport { SelectedKindsFilter } from './SelectedKindsFilter';\nimport { SelectedRelationsFilter } from './SelectedRelationsFilter';\nimport { SwitchFilter } from './SwitchFilter';\nimport { useCatalogGraphPage } from './useCatalogGraphPage';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\n\n/** @public */\nexport type CatalogGraphPageClassKey =\n | 'content'\n | 'container'\n | 'fullHeight'\n | 'graphWrapper'\n | 'graph'\n | 'legend'\n | 'filters';\n\nconst useStyles = makeStyles(\n 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 { name: 'PluginCatalogGraphCatalogGraphPage' },\n);\n\nexport const CatalogGraphPage = (\n props: {\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 curve?: 'curveStepBefore' | 'curveMonotoneX';\n };\n } & Partial<EntityRelationsGraphProps>,\n) => {\n const {\n relationPairs = ALL_RELATION_PAIRS,\n initialState,\n entityFilter,\n } = props;\n const { t } = useTranslationRef(catalogGraphTranslationRef);\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 curve,\n setCurve,\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.entity.metadata.title ?? humanizeEntityRef(nodeEntityName),\n { attributes: { to: path } },\n );\n navigate(path);\n } else {\n analytics.captureEvent(\n 'click',\n node.entity.metadata.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={t('catalogGraphPage.title')}\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 /> {t('catalogGraphPage.filterToggleButtonTitle')}\n </ToggleButton>\n }\n >\n <SupportButton>\n {t('catalogGraphPage.supportButtonDescription')}\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 <CurveFilter value={curve} onChange={setCurve} />\n <SwitchFilter\n value={unidirectional}\n onChange={setUnidirectional}\n label={t('catalogGraphPage.simplifiedSwitchLabel')}\n />\n <SwitchFilter\n value={mergeRelations}\n onChange={setMergeRelations}\n label={t('catalogGraphPage.mergeRelationsSwitchLabel')}\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\" />{' '}\n {t('catalogGraphPage.zoomOutDescription')}\n </Typography>\n <EntityRelationsGraph\n {...props}\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 entityFilter={entityFilter}\n className={classes.graph}\n zoom=\"enabled\"\n curve={curve}\n />\n </Paper>\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,OAAS,EAAA;AAAA,MACP,SAAW,EAAA;AAAA,KACb;AAAA,IACA,SAAW,EAAA;AAAA,MACT,MAAQ,EAAA,MAAA;AAAA,MACR,SAAW,EAAA,MAAA;AAAA,MACX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/jsx-runtime';
|
|
|
2
2
|
import { Select } from '@backstage/core-components';
|
|
3
3
|
import Box from '@material-ui/core/Box';
|
|
4
4
|
import { useCallback } from 'react';
|
|
5
|
+
import { catalogGraphTranslationRef } from '../../translation.esm.js';
|
|
6
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
5
7
|
|
|
6
|
-
const CURVE_DISPLAY_NAMES = {
|
|
7
|
-
curveMonotoneX: "Monotone X",
|
|
8
|
-
curveStepBefore: "Step Before"
|
|
9
|
-
};
|
|
10
8
|
const curves = ["curveMonotoneX", "curveStepBefore"];
|
|
11
9
|
const CurveFilter = ({ value, onChange }) => {
|
|
10
|
+
const { t } = useTranslationRef(catalogGraphTranslationRef);
|
|
11
|
+
const CURVE_DISPLAY_NAMES = {
|
|
12
|
+
curveMonotoneX: t("catalogGraphPage.curveFilter.curveMonotoneX"),
|
|
13
|
+
curveStepBefore: t("catalogGraphPage.curveFilter.curveStepBefore")
|
|
14
|
+
};
|
|
12
15
|
const handleChange = useCallback(
|
|
13
16
|
(v) => onChange(v),
|
|
14
17
|
[onChange]
|
|
@@ -16,7 +19,7 @@ const CurveFilter = ({ value, onChange }) => {
|
|
|
16
19
|
return /* @__PURE__ */ jsx(Box, { pb: 1, pt: 1, children: /* @__PURE__ */ jsx(
|
|
17
20
|
Select,
|
|
18
21
|
{
|
|
19
|
-
label: "
|
|
22
|
+
label: t("catalogGraphPage.curveFilter.title"),
|
|
20
23
|
selected: value,
|
|
21
24
|
items: curves.map((v) => ({
|
|
22
25
|
label: CURVE_DISPLAY_NAMES[v],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurveFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/CurveFilter.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, SelectedItems } from '@backstage/core-components';\nimport Box from '@material-ui/core/Box';\nimport { useCallback } from 'react';\
|
|
1
|
+
{"version":3,"file":"CurveFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/CurveFilter.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, SelectedItems } from '@backstage/core-components';\nimport Box from '@material-ui/core/Box';\nimport { useCallback } from 'react';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\n\ntype Curve = 'curveStepBefore' | 'curveMonotoneX';\n\nexport type Props = {\n value: Curve;\n onChange: (value: 'curveStepBefore' | 'curveMonotoneX') => void;\n};\n\nconst curves: Array<Curve> = ['curveMonotoneX', 'curveStepBefore'];\n\nexport const CurveFilter = ({ value, onChange }: Props) => {\n const { t } = useTranslationRef(catalogGraphTranslationRef);\n const CURVE_DISPLAY_NAMES: Record<Curve, string> = {\n curveMonotoneX: t('catalogGraphPage.curveFilter.curveMonotoneX'),\n curveStepBefore: t('catalogGraphPage.curveFilter.curveStepBefore'),\n };\n\n const handleChange = useCallback(\n (v: SelectedItems) => onChange(v as Curve),\n [onChange],\n );\n\n return (\n <Box pb={1} pt={1}>\n <Select\n label={t('catalogGraphPage.curveFilter.title')}\n selected={value}\n items={curves.map(v => ({\n label: CURVE_DISPLAY_NAMES[v],\n value: v,\n }))}\n onChange={handleChange}\n />\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA4BA,MAAM,MAAA,GAAuB,CAAC,gBAAA,EAAkB,iBAAiB,CAAA;AAE1D,MAAM,WAAc,GAAA,CAAC,EAAE,KAAA,EAAO,UAAsB,KAAA;AACzD,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA;AAC1D,EAAA,MAAM,mBAA6C,GAAA;AAAA,IACjD,cAAA,EAAgB,EAAE,6CAA6C,CAAA;AAAA,IAC/D,eAAA,EAAiB,EAAE,8CAA8C;AAAA,GACnE;AAEA,EAAA,MAAM,YAAe,GAAA,WAAA;AAAA,IACnB,CAAC,CAAqB,KAAA,QAAA,CAAS,CAAU,CAAA;AAAA,IACzC,CAAC,QAAQ;AAAA,GACX;AAEA,EAAA,uBACG,GAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAG,IAAI,CACd,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,oCAAoC,CAAA;AAAA,MAC7C,QAAU,EAAA,KAAA;AAAA,MACV,KAAA,EAAO,MAAO,CAAA,GAAA,CAAI,CAAM,CAAA,MAAA;AAAA,QACtB,KAAA,EAAO,oBAAoB,CAAC,CAAA;AAAA,QAC5B,KAAO,EAAA;AAAA,OACP,CAAA,CAAA;AAAA,MACF,QAAU,EAAA;AAAA;AAAA,GAEd,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -5,14 +5,17 @@ import { useCallback } from 'react';
|
|
|
5
5
|
import '../EntityRelationsGraph/EntityRelationsGraph.esm.js';
|
|
6
6
|
import '@backstage/catalog-model';
|
|
7
7
|
import { Direction } from '../EntityRelationsGraph/types.esm.js';
|
|
8
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
9
|
+
import { catalogGraphTranslationRef } from '../../translation.esm.js';
|
|
8
10
|
|
|
9
|
-
const DIRECTION_DISPLAY_NAMES = {
|
|
10
|
-
[Direction.LEFT_RIGHT]: "Left to right",
|
|
11
|
-
[Direction.RIGHT_LEFT]: "Right to left",
|
|
12
|
-
[Direction.TOP_BOTTOM]: "Top to bottom",
|
|
13
|
-
[Direction.BOTTOM_TOP]: "Bottom to top"
|
|
14
|
-
};
|
|
15
11
|
const DirectionFilter = ({ value, onChange }) => {
|
|
12
|
+
const { t } = useTranslationRef(catalogGraphTranslationRef);
|
|
13
|
+
const DIRECTION_DISPLAY_NAMES = {
|
|
14
|
+
[Direction.LEFT_RIGHT]: t("catalogGraphPage.directionFilter.leftToRight"),
|
|
15
|
+
[Direction.RIGHT_LEFT]: t("catalogGraphPage.directionFilter.rightToLeft"),
|
|
16
|
+
[Direction.TOP_BOTTOM]: t("catalogGraphPage.directionFilter.topToBottom"),
|
|
17
|
+
[Direction.BOTTOM_TOP]: t("catalogGraphPage.directionFilter.bottomToTop")
|
|
18
|
+
};
|
|
16
19
|
const handleChange = useCallback(
|
|
17
20
|
(v) => onChange(v),
|
|
18
21
|
[onChange]
|
|
@@ -20,7 +23,7 @@ const DirectionFilter = ({ value, onChange }) => {
|
|
|
20
23
|
return /* @__PURE__ */ jsx(Box, { pb: 1, pt: 1, children: /* @__PURE__ */ jsx(
|
|
21
24
|
Select,
|
|
22
25
|
{
|
|
23
|
-
label: "
|
|
26
|
+
label: t("catalogGraphPage.directionFilter.title"),
|
|
24
27
|
selected: value,
|
|
25
28
|
items: Object.values(Direction).map((v) => ({
|
|
26
29
|
label: DIRECTION_DISPLAY_NAMES[v],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DirectionFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/DirectionFilter.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, SelectedItems } from '@backstage/core-components';\nimport Box from '@material-ui/core/Box';\nimport { useCallback } from 'react';\nimport { Direction } from '../EntityRelationsGraph';\
|
|
1
|
+
{"version":3,"file":"DirectionFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/DirectionFilter.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, SelectedItems } from '@backstage/core-components';\nimport Box from '@material-ui/core/Box';\nimport { useCallback } from 'react';\nimport { Direction } from '../EntityRelationsGraph';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\n\nexport type Props = {\n value: Direction;\n onChange: (value: Direction) => void;\n};\n\nexport const DirectionFilter = ({ value, onChange }: Props) => {\n const { t } = useTranslationRef(catalogGraphTranslationRef);\n const DIRECTION_DISPLAY_NAMES = {\n [Direction.LEFT_RIGHT]: t('catalogGraphPage.directionFilter.leftToRight'),\n [Direction.RIGHT_LEFT]: t('catalogGraphPage.directionFilter.rightToLeft'),\n [Direction.TOP_BOTTOM]: t('catalogGraphPage.directionFilter.topToBottom'),\n [Direction.BOTTOM_TOP]: t('catalogGraphPage.directionFilter.bottomToTop'),\n };\n const handleChange = useCallback(\n (v: SelectedItems) => onChange(v as Direction),\n [onChange],\n );\n\n return (\n <Box pb={1} pt={1}>\n <Select\n label={t('catalogGraphPage.directionFilter.title')}\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"],"names":[],"mappings":";;;;;;;;;;AA2BO,MAAM,eAAkB,GAAA,CAAC,EAAE,KAAA,EAAO,UAAsB,KAAA;AAC7D,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA;AAC1D,EAAA,MAAM,uBAA0B,GAAA;AAAA,IAC9B,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C,CAAA;AAAA,IACxE,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C,CAAA;AAAA,IACxE,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C,CAAA;AAAA,IACxE,CAAC,SAAA,CAAU,UAAU,GAAG,EAAE,8CAA8C;AAAA,GAC1E;AACA,EAAA,MAAM,YAAe,GAAA,WAAA;AAAA,IACnB,CAAC,CAAqB,KAAA,QAAA,CAAS,CAAc,CAAA;AAAA,IAC7C,CAAC,QAAQ;AAAA,GACX;AAEA,EAAA,uBACG,GAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAG,IAAI,CACd,EAAA,QAAA,kBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,EAAE,wCAAwC,CAAA;AAAA,MACjD,QAAU,EAAA,KAAA;AAAA,MACV,OAAO,MAAO,CAAA,MAAA,CAAO,SAAS,CAAA,CAAE,IAAI,CAAM,CAAA,MAAA;AAAA,QACxC,KAAA,EAAO,wBAAwB,CAAC,CAAA;AAAA,QAChC,KAAO,EAAA;AAAA,OACP,CAAA,CAAA;AAAA,MACF,QAAU,EAAA;AAAA;AAAA,GAEd,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
2
3
|
import Box from '@material-ui/core/Box';
|
|
3
4
|
import FormControl from '@material-ui/core/FormControl';
|
|
4
5
|
import IconButton from '@material-ui/core/IconButton';
|
|
@@ -8,6 +9,7 @@ import Typography from '@material-ui/core/Typography';
|
|
|
8
9
|
import { makeStyles } from '@material-ui/core/styles';
|
|
9
10
|
import ClearIcon from '@material-ui/icons/Clear';
|
|
10
11
|
import { useRef, useState, useEffect, useCallback } from 'react';
|
|
12
|
+
import { catalogGraphTranslationRef } from '../../translation.esm.js';
|
|
11
13
|
|
|
12
14
|
const useStyles = makeStyles(
|
|
13
15
|
{
|
|
@@ -22,6 +24,7 @@ const MaxDepthFilter = ({ value, onChange }) => {
|
|
|
22
24
|
const classes = useStyles();
|
|
23
25
|
const onChangeRef = useRef(onChange);
|
|
24
26
|
const [currentValue, setCurrentValue] = useState(value);
|
|
27
|
+
const { t } = useTranslationRef(catalogGraphTranslationRef);
|
|
25
28
|
useEffect(() => {
|
|
26
29
|
onChangeRef.current = onChange;
|
|
27
30
|
}, [onChange]);
|
|
@@ -39,18 +42,20 @@ const MaxDepthFilter = ({ value, onChange }) => {
|
|
|
39
42
|
onChangeRef.current(Number.POSITIVE_INFINITY);
|
|
40
43
|
}, [onChangeRef]);
|
|
41
44
|
return /* @__PURE__ */ jsx(Box, { pb: 1, pt: 1, children: /* @__PURE__ */ jsxs(FormControl, { variant: "outlined", className: classes.formControl, children: [
|
|
42
|
-
/* @__PURE__ */ jsx(Typography, { variant: "button", children: "
|
|
45
|
+
/* @__PURE__ */ jsx(Typography, { variant: "button", children: t("catalogGraphPage.maxDepthFilter.title") }),
|
|
43
46
|
/* @__PURE__ */ jsx(
|
|
44
47
|
OutlinedInput,
|
|
45
48
|
{
|
|
46
49
|
type: "number",
|
|
47
|
-
placeholder: "
|
|
50
|
+
placeholder: t("catalogGraphPage.maxDepthFilter.inputPlaceholder"),
|
|
48
51
|
value: Number.isFinite(currentValue) ? String(currentValue) : "",
|
|
49
52
|
onChange: handleChange,
|
|
50
53
|
endAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(
|
|
51
54
|
IconButton,
|
|
52
55
|
{
|
|
53
|
-
"aria-label":
|
|
56
|
+
"aria-label": t(
|
|
57
|
+
"catalogGraphPage.maxDepthFilter.clearButtonAriaLabel"
|
|
58
|
+
),
|
|
54
59
|
onClick: reset,
|
|
55
60
|
edge: "end",
|
|
56
61
|
children: /* @__PURE__ */ jsx(ClearIcon, {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaxDepthFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/MaxDepthFilter.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 Box from '@material-ui/core/Box';\nimport FormControl from '@material-ui/core/FormControl';\nimport IconButton from '@material-ui/core/IconButton';\nimport InputAdornment from '@material-ui/core/InputAdornment';\nimport OutlinedInput from '@material-ui/core/OutlinedInput';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport ClearIcon from '@material-ui/icons/Clear';\nimport { ChangeEvent, useCallback, useEffect, useRef, useState } from 'react';\n\nexport type Props = {\n value: number;\n onChange: (value: number) => void;\n};\n\n/** @public */\nexport type MaxDepthFilterClassKey = 'formControl';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n width: '100%',\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphMaxDepthFilter' },\n);\n\nexport const MaxDepthFilter = ({ value, onChange }: Props) => {\n const classes = useStyles();\n const onChangeRef = useRef(onChange);\n const [currentValue, setCurrentValue] = useState(value);\n\n // Keep a fresh reference to the latest callback\n useEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n // If the value changes externally, update ourselves\n useEffect(() => {\n setCurrentValue(value);\n }, [value]);\n\n // When the entered text changes, update ourselves and communicate externally\n const handleChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const newValueNumeric = Number(event.target.value);\n const newValue =\n Number.isFinite(newValueNumeric) && newValueNumeric > 0\n ? newValueNumeric\n : Number.POSITIVE_INFINITY;\n setCurrentValue(newValue);\n onChangeRef.current(newValue);\n }, []);\n\n const reset = useCallback(() => {\n setCurrentValue(Number.POSITIVE_INFINITY);\n onChangeRef.current(Number.POSITIVE_INFINITY);\n }, [onChangeRef]);\n\n return (\n <Box pb={1} pt={1}>\n <FormControl variant=\"outlined\" className={classes.formControl}>\n <Typography variant=\"button\"
|
|
1
|
+
{"version":3,"file":"MaxDepthFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/MaxDepthFilter.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 { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport Box from '@material-ui/core/Box';\nimport FormControl from '@material-ui/core/FormControl';\nimport IconButton from '@material-ui/core/IconButton';\nimport InputAdornment from '@material-ui/core/InputAdornment';\nimport OutlinedInput from '@material-ui/core/OutlinedInput';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport ClearIcon from '@material-ui/icons/Clear';\nimport { ChangeEvent, useCallback, useEffect, useRef, useState } from 'react';\nimport { catalogGraphTranslationRef } from '../../translation';\n\nexport type Props = {\n value: number;\n onChange: (value: number) => void;\n};\n\n/** @public */\nexport type MaxDepthFilterClassKey = 'formControl';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n width: '100%',\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphMaxDepthFilter' },\n);\n\nexport const MaxDepthFilter = ({ value, onChange }: Props) => {\n const classes = useStyles();\n const onChangeRef = useRef(onChange);\n const [currentValue, setCurrentValue] = useState(value);\n const { t } = useTranslationRef(catalogGraphTranslationRef);\n\n // Keep a fresh reference to the latest callback\n useEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n // If the value changes externally, update ourselves\n useEffect(() => {\n setCurrentValue(value);\n }, [value]);\n\n // When the entered text changes, update ourselves and communicate externally\n const handleChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const newValueNumeric = Number(event.target.value);\n const newValue =\n Number.isFinite(newValueNumeric) && newValueNumeric > 0\n ? newValueNumeric\n : Number.POSITIVE_INFINITY;\n setCurrentValue(newValue);\n onChangeRef.current(newValue);\n }, []);\n\n const reset = useCallback(() => {\n setCurrentValue(Number.POSITIVE_INFINITY);\n onChangeRef.current(Number.POSITIVE_INFINITY);\n }, [onChangeRef]);\n\n return (\n <Box pb={1} pt={1}>\n <FormControl variant=\"outlined\" className={classes.formControl}>\n <Typography variant=\"button\">\n {t('catalogGraphPage.maxDepthFilter.title')}\n </Typography>\n <OutlinedInput\n type=\"number\"\n placeholder={t('catalogGraphPage.maxDepthFilter.inputPlaceholder')}\n value={Number.isFinite(currentValue) ? String(currentValue) : ''}\n onChange={handleChange}\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label={t(\n 'catalogGraphPage.maxDepthFilter.clearButtonAriaLabel',\n )}\n onClick={reset}\n edge=\"end\"\n >\n <ClearIcon />\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';
|
|
|
13
13
|
import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
14
14
|
import { useEffect, useMemo, useCallback } from 'react';
|
|
15
15
|
import useAsync from 'react-use/esm/useAsync';
|
|
16
|
+
import { catalogGraphTranslationRef } from '../../translation.esm.js';
|
|
17
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
16
18
|
|
|
17
19
|
const useStyles = makeStyles(
|
|
18
20
|
{
|
|
@@ -26,6 +28,7 @@ const SelectedKindsFilter = ({ value, onChange }) => {
|
|
|
26
28
|
const classes = useStyles();
|
|
27
29
|
const alertApi = useApi(alertApiRef);
|
|
28
30
|
const catalogApi = useApi(catalogApiRef);
|
|
31
|
+
const { t } = useTranslationRef(catalogGraphTranslationRef);
|
|
29
32
|
const { error, value: kinds } = useAsync(async () => {
|
|
30
33
|
return await catalogApi.getEntityFacets({ facets: ["kind"] }).then((response) => response.facets.kind?.map((f) => f.value).sort() || []);
|
|
31
34
|
});
|
|
@@ -56,7 +59,7 @@ const SelectedKindsFilter = ({ value, onChange }) => {
|
|
|
56
59
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
57
60
|
}
|
|
58
61
|
return /* @__PURE__ */ jsxs(Box, { pb: 1, pt: 1, children: [
|
|
59
|
-
/* @__PURE__ */ jsx(Typography, { variant: "button", children: "
|
|
62
|
+
/* @__PURE__ */ jsx(Typography, { variant: "button", children: t("catalogGraphPage.selectedKindsFilter.title") }),
|
|
60
63
|
/* @__PURE__ */ jsx(
|
|
61
64
|
Autocomplete,
|
|
62
65
|
{
|
|
@@ -64,7 +67,7 @@ const SelectedKindsFilter = ({ value, onChange }) => {
|
|
|
64
67
|
multiple: true,
|
|
65
68
|
limitTags: 4,
|
|
66
69
|
disableCloseOnSelect: true,
|
|
67
|
-
"aria-label": "
|
|
70
|
+
"aria-label": t("catalogGraphPage.selectedKindsFilter.title"),
|
|
68
71
|
options: normalizedKinds,
|
|
69
72
|
value: value ?? normalizedKinds,
|
|
70
73
|
getOptionLabel: (k) => kinds[normalizedKinds.indexOf(k)] ?? k,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectedKindsFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/SelectedKindsFilter.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 { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\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/Autocomplete';\nimport { useCallback, useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\n\n/** @public */\nexport type SelectedKindsFilterClassKey = 'formControl';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSelectedKindsFilter' },\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\"
|
|
1
|
+
{"version":3,"file":"SelectedKindsFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/SelectedKindsFilter.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 { alertApiRef, useApi } from '@backstage/core-plugin-api';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\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/Autocomplete';\nimport { useCallback, useEffect, useMemo } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogGraphTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @public */\nexport type SelectedKindsFilterClassKey = 'formControl';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSelectedKindsFilter' },\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 const { t } = useTranslationRef(catalogGraphTranslationRef);\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\">\n {t('catalogGraphPage.selectedKindsFilter.title')}\n </Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label={t('catalogGraphPage.selectedKindsFilter.title')}\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"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,WAAa,EAAA;AAAA,MACX,QAAU,EAAA;AAAA;AACZ,GACF;AAAA,EACA,EAAE,MAAM,uCAAwC;AAClD,CAAA;AAOO,MAAM,mBAAsB,GAAA,CAAC,EAAE,KAAA,EAAO,UAAsB,KAAA;AACjE,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AACnC,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA;AAE1D,EAAA,MAAM,EAAE,KAAO,EAAA,KAAA,EAAO,KAAM,EAAA,GAAI,SAAS,YAAY;AACnD,IAAO,OAAA,MAAM,WACV,eAAgB,CAAA,EAAE,QAAQ,CAAC,MAAM,CAAE,EAAC,CACpC,CAAA,IAAA,CAAK,cAAY,QAAS,CAAA,MAAA,CAAO,IAAM,EAAA,GAAA,CAAI,CAAK,CAAA,KAAA,CAAA,CAAE,KAAK,CAAE,CAAA,IAAA,EAAU,IAAA,EAAE,CAAA;AAAA,GACzE,CAAA;AAED,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAO,EAAA;AACT,MAAA,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oreIcon from '@material-ui/icons/ExpandMore';
|
|
11
11
|
import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
12
12
|
import { useMemo, useCallback } from 'react';
|
|
13
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
14
|
+
import { catalogGraphTranslationRef } from '../../translation.esm.js';
|
|
13
15
|
|
|
14
16
|
const useStyles = makeStyles(
|
|
15
17
|
{
|
|
@@ -26,6 +28,7 @@ const SelectedRelationsFilter = ({
|
|
|
26
28
|
}) => {
|
|
27
29
|
const classes = useStyles();
|
|
28
30
|
const relations = useMemo(() => relationPairs.flat(), [relationPairs]);
|
|
31
|
+
const { t } = useTranslationRef(catalogGraphTranslationRef);
|
|
29
32
|
const handleChange = useCallback(
|
|
30
33
|
(_, v) => {
|
|
31
34
|
onChange(relations.every((r) => v.includes(r)) ? void 0 : v);
|
|
@@ -36,7 +39,7 @@ const SelectedRelationsFilter = ({
|
|
|
36
39
|
onChange(value?.length ? value : void 0);
|
|
37
40
|
}, [value, onChange]);
|
|
38
41
|
return /* @__PURE__ */ jsxs(Box, { pb: 1, pt: 1, children: [
|
|
39
|
-
/* @__PURE__ */ jsx(Typography, { variant: "button", children: "
|
|
42
|
+
/* @__PURE__ */ jsx(Typography, { variant: "button", children: t("catalogGraphPage.selectedRelationsFilter.title") }),
|
|
40
43
|
/* @__PURE__ */ jsx(
|
|
41
44
|
Autocomplete,
|
|
42
45
|
{
|
|
@@ -44,7 +47,7 @@ const SelectedRelationsFilter = ({
|
|
|
44
47
|
multiple: true,
|
|
45
48
|
limitTags: 4,
|
|
46
49
|
disableCloseOnSelect: true,
|
|
47
|
-
"aria-label": "
|
|
50
|
+
"aria-label": t("catalogGraphPage.selectedRelationsFilter.title"),
|
|
48
51
|
options: relations,
|
|
49
52
|
value: value ?? relations,
|
|
50
53
|
onChange: handleChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectedRelationsFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/SelectedRelationsFilter.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 Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\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/Autocomplete';\nimport { useCallback, useMemo } from 'react';\nimport { RelationPairs } from '../EntityRelationsGraph';\n\n/** @public */\nexport type SelectedRelationsFilterClassKey = 'formControl';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSelectedRelationsFilter' },\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\"
|
|
1
|
+
{"version":3,"file":"SelectedRelationsFilter.esm.js","sources":["../../../src/components/CatalogGraphPage/SelectedRelationsFilter.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 Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\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/Autocomplete';\nimport { useCallback, useMemo } from 'react';\nimport { RelationPairs } from '../EntityRelationsGraph';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogGraphTranslationRef } from '../../translation';\n\n/** @public */\nexport type SelectedRelationsFilterClassKey = 'formControl';\n\nconst useStyles = makeStyles(\n {\n formControl: {\n maxWidth: 300,\n },\n },\n { name: 'PluginCatalogGraphSelectedRelationsFilter' },\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 const { t } = useTranslationRef(catalogGraphTranslationRef);\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\">\n {t('catalogGraphPage.selectedRelationsFilter.title')}\n </Typography>\n <Autocomplete\n className={classes.formControl}\n multiple\n limitTags={4}\n disableCloseOnSelect\n aria-label={t('catalogGraphPage.selectedRelationsFilter.title')}\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"],"names":[],"mappings":";;;;;;;;;;;;;;;AAiCA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,WAAa,EAAA;AAAA,MACX,QAAU,EAAA;AAAA;AACZ,GACF;AAAA,EACA,EAAE,MAAM,2CAA4C;AACtD,CAAA;AAQO,MAAM,0BAA0B,CAAC;AAAA,EACtC,aAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAa,KAAA;AACX,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,SAAA,GAAY,QAAQ,MAAM,aAAA,CAAc,MAAQ,EAAA,CAAC,aAAa,CAAC,CAAA;AACrE,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA;AAE1D,EAAA,MAAM,YAAe,GAAA,WAAA;AAAA,IACnB,CAAC,GAAY,CAAgB,KAAA;AAC3B,MAAS,QAAA,CAAA,SAAA,CAAU,MAAM,CAAK,CAAA,KAAA,CAAA,CAAE,SAAS,CAAC,CAAC,CAAI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,EAAA;AAAA;AAAA,SACT;AAAA,QAEF,IAAK,EAAA,OAAA;AAAA,QACL,SAAW,kBAAA,GAAA,CAAC,cAAe,EAAA,EAAA,aAAA,EAAY,2BAA4B,EAAA,CAAA;AAAA,QACnE,aAAa,CAAU,MAAA,qBAAA,GAAA,CAAC,aAAW,GAAG,MAAA,EAAQ,SAAQ,UAAW,EAAA;AAAA;AAAA;AACnE,GACF,EAAA,CAAA;AAEJ;;;;"}
|
package/dist/package.json.esm.js
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createTranslationRef } from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
const catalogGraphTranslationRef = createTranslationRef({
|
|
4
|
+
id: "catalog-graph",
|
|
5
|
+
messages: {
|
|
6
|
+
catalogGraphCard: {
|
|
7
|
+
title: "Relations",
|
|
8
|
+
deepLinkTitle: "View graph"
|
|
9
|
+
},
|
|
10
|
+
catalogGraphPage: {
|
|
11
|
+
title: "Catalog Graph",
|
|
12
|
+
filterToggleButtonTitle: "Filters",
|
|
13
|
+
supportButtonDescription: "Start tracking your component in by adding it to the software catalog.",
|
|
14
|
+
simplifiedSwitchLabel: "Simplified",
|
|
15
|
+
mergeRelationsSwitchLabel: "Merge relations",
|
|
16
|
+
zoomOutDescription: "Use pinch & zoom to move around the diagram. Click to change active node, shift click to navigate to entity.",
|
|
17
|
+
curveFilter: {
|
|
18
|
+
title: "Curve",
|
|
19
|
+
curveMonotoneX: "Monotone X",
|
|
20
|
+
curveStepBefore: "Step Before"
|
|
21
|
+
},
|
|
22
|
+
directionFilter: {
|
|
23
|
+
title: "Direction",
|
|
24
|
+
leftToRight: "Left to right",
|
|
25
|
+
rightToLeft: "Right to left",
|
|
26
|
+
topToBottom: "Top to bottom",
|
|
27
|
+
bottomToTop: "Bottom to top"
|
|
28
|
+
},
|
|
29
|
+
maxDepthFilter: {
|
|
30
|
+
title: "Max depth",
|
|
31
|
+
inputPlaceholder: "\u221E Infinite",
|
|
32
|
+
clearButtonAriaLabel: "clear max depth"
|
|
33
|
+
},
|
|
34
|
+
selectedKindsFilter: {
|
|
35
|
+
title: "Kinds"
|
|
36
|
+
},
|
|
37
|
+
selectedRelationsFilter: {
|
|
38
|
+
title: "Relations"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export { catalogGraphTranslationRef };
|
|
45
|
+
//# sourceMappingURL=translation.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/** @alpha */\nexport const catalogGraphTranslationRef = createTranslationRef({\n id: 'catalog-graph',\n messages: {\n catalogGraphCard: {\n title: 'Relations',\n deepLinkTitle: 'View graph',\n },\n catalogGraphPage: {\n title: 'Catalog Graph',\n filterToggleButtonTitle: 'Filters',\n supportButtonDescription:\n 'Start tracking your component in by adding it to the software catalog.',\n simplifiedSwitchLabel: 'Simplified',\n mergeRelationsSwitchLabel: 'Merge relations',\n zoomOutDescription:\n 'Use pinch & zoom to move around the diagram. Click to change active node, shift click to navigate to entity.',\n curveFilter: {\n title: 'Curve',\n curveMonotoneX: 'Monotone X',\n curveStepBefore: 'Step Before',\n },\n directionFilter: {\n title: 'Direction',\n leftToRight: 'Left to right',\n rightToLeft: 'Right to left',\n topToBottom: 'Top to bottom',\n bottomToTop: 'Bottom to top',\n },\n maxDepthFilter: {\n title: 'Max depth',\n inputPlaceholder: '∞ Infinite',\n clearButtonAriaLabel: 'clear max depth',\n },\n selectedKindsFilter: {\n title: 'Kinds',\n },\n selectedRelationsFilter: {\n title: 'Relations',\n },\n },\n },\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,6BAA6B,oBAAqB,CAAA;AAAA,EAC7D,EAAI,EAAA,eAAA;AAAA,EACJ,QAAU,EAAA;AAAA,IACR,gBAAkB,EAAA;AAAA,MAChB,KAAO,EAAA,WAAA;AAAA,MACP,aAAe,EAAA;AAAA,KACjB;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,KAAO,EAAA,eAAA;AAAA,MACP,uBAAyB,EAAA,SAAA;AAAA,MACzB,wBACE,EAAA,wEAAA;AAAA,MACF,qBAAuB,EAAA,YAAA;AAAA,MACvB,yBAA2B,EAAA,iBAAA;AAAA,MAC3B,kBACE,EAAA,kHAAA;AAAA,MACF,WAAa,EAAA;AAAA,QACX,KAAO,EAAA,OAAA;AAAA,QACP,cAAgB,EAAA,YAAA;AAAA,QAChB,eAAiB,EAAA;AAAA,OACnB;AAAA,MACA,eAAiB,EAAA;AAAA,QACf,KAAO,EAAA,WAAA;AAAA,QACP,WAAa,EAAA,eAAA;AAAA,QACb,WAAa,EAAA,eAAA;AAAA,QACb,WAAa,EAAA,eAAA;AAAA,QACb,WAAa,EAAA;AAAA,OACf;AAAA,MACA,cAAgB,EAAA;AAAA,QACd,KAAO,EAAA,WAAA;AAAA,QACP,gBAAkB,EAAA,iBAAA;AAAA,QAClB,oBAAsB,EAAA;AAAA,OACxB;AAAA,MACA,mBAAqB,EAAA;AAAA,QACnB,KAAO,EAAA;AAAA,OACT;AAAA,MACA,uBAAyB,EAAA;AAAA,QACvB,KAAO,EAAA;AAAA;AACT;AACF;AAEJ,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-graph",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.21-next.1",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "catalog-graph",
|
|
@@ -61,14 +61,14 @@
|
|
|
61
61
|
"test": "backstage-cli package test"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@backstage/catalog-client": "
|
|
65
|
-
"@backstage/catalog-model": "
|
|
66
|
-
"@backstage/core-compat-api": "
|
|
67
|
-
"@backstage/core-components": "
|
|
68
|
-
"@backstage/core-plugin-api": "
|
|
69
|
-
"@backstage/frontend-plugin-api": "
|
|
70
|
-
"@backstage/plugin-catalog-react": "
|
|
71
|
-
"@backstage/types": "
|
|
64
|
+
"@backstage/catalog-client": "1.10.2-next.0",
|
|
65
|
+
"@backstage/catalog-model": "1.7.5-next.0",
|
|
66
|
+
"@backstage/core-compat-api": "0.4.4-next.1",
|
|
67
|
+
"@backstage/core-components": "0.17.4-next.1",
|
|
68
|
+
"@backstage/core-plugin-api": "1.10.9-next.0",
|
|
69
|
+
"@backstage/frontend-plugin-api": "0.10.4-next.1",
|
|
70
|
+
"@backstage/plugin-catalog-react": "1.19.1-next.1",
|
|
71
|
+
"@backstage/types": "1.2.1",
|
|
72
72
|
"@material-ui/core": "^4.12.2",
|
|
73
73
|
"@material-ui/icons": "^4.9.1",
|
|
74
74
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
"react-use": "^17.2.4"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@backstage/cli": "
|
|
83
|
-
"@backstage/core-app-api": "
|
|
84
|
-
"@backstage/dev-utils": "
|
|
85
|
-
"@backstage/plugin-catalog": "
|
|
86
|
-
"@backstage/test-utils": "
|
|
82
|
+
"@backstage/cli": "0.33.1-next.1",
|
|
83
|
+
"@backstage/core-app-api": "1.17.2-next.0",
|
|
84
|
+
"@backstage/dev-utils": "1.1.12-next.1",
|
|
85
|
+
"@backstage/plugin-catalog": "1.31.1-next.1",
|
|
86
|
+
"@backstage/test-utils": "1.7.10-next.1",
|
|
87
87
|
"@testing-library/dom": "^10.0.0",
|
|
88
88
|
"@testing-library/jest-dom": "^6.0.0",
|
|
89
89
|
"@testing-library/react": "^16.0.0",
|