@backstage-community/plugin-explore 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/alpha/package.json +2 -2
- package/dist/alpha.esm.js +1 -1
- package/dist/alpha.esm.js.map +1 -1
- package/dist/api/ExploreApi.esm.js +8 -0
- package/dist/api/ExploreApi.esm.js.map +1 -0
- package/dist/api/ExploreClient.esm.js +41 -0
- package/dist/api/ExploreClient.esm.js.map +1 -0
- package/dist/components/CatalogKindExploreContent/CatalogKindExploreContent.esm.js +59 -0
- package/dist/components/CatalogKindExploreContent/CatalogKindExploreContent.esm.js.map +1 -0
- package/dist/components/DefaultExplorePage/DefaultExplorePage.esm.js +24 -0
- package/dist/components/DefaultExplorePage/DefaultExplorePage.esm.js.map +1 -0
- package/dist/components/DomainCard/DomainCard.esm.js +36 -0
- package/dist/components/DomainCard/DomainCard.esm.js.map +1 -0
- package/dist/{esm/index-BWXDllsA.esm.js → components/DomainExplorerContent/DomainExplorerContent.esm.js} +4 -16
- package/dist/components/DomainExplorerContent/DomainExplorerContent.esm.js.map +1 -0
- package/dist/components/DomainExplorerContent/index.esm.js +2 -0
- package/dist/components/DomainExplorerContent/index.esm.js.map +1 -0
- package/dist/components/EntityCard/EntityCard.esm.js +36 -0
- package/dist/components/EntityCard/EntityCard.esm.js.map +1 -0
- package/dist/components/ExploreLayout/ExploreLayout.esm.js +29 -0
- package/dist/components/ExploreLayout/ExploreLayout.esm.js.map +1 -0
- package/dist/components/ExplorePage/ExplorePage.esm.js +11 -0
- package/dist/components/ExplorePage/ExplorePage.esm.js.map +1 -0
- package/dist/components/ExplorePage/index.esm.js +2 -0
- package/dist/components/ExplorePage/index.esm.js.map +1 -0
- package/dist/{esm/GroupsExplorerContent-xDnXX8fq.esm.js → components/GroupsExplorerContent/GroupsDiagram.esm.js} +11 -36
- package/dist/components/GroupsExplorerContent/GroupsDiagram.esm.js.map +1 -0
- package/dist/components/GroupsExplorerContent/GroupsExplorerContent.esm.js +29 -0
- package/dist/components/GroupsExplorerContent/GroupsExplorerContent.esm.js.map +1 -0
- package/dist/components/GroupsExplorerContent/index.esm.js +2 -0
- package/dist/components/GroupsExplorerContent/index.esm.js.map +1 -0
- package/dist/{esm/ToolExplorerContent-DhAgNCmY.esm.js → components/ToolCard/ToolCard.esm.js} +4 -41
- package/dist/components/ToolCard/ToolCard.esm.js.map +1 -0
- package/dist/components/ToolExplorerContent/ToolExplorerContent.esm.js +39 -0
- package/dist/components/ToolExplorerContent/ToolExplorerContent.esm.js.map +1 -0
- package/dist/components/ToolExplorerContent/index.esm.js +2 -0
- package/dist/components/ToolExplorerContent/index.esm.js.map +1 -0
- package/dist/{esm/index-Cz8p9vYj.esm.js → components/ToolSearchResultListItem/ToolSearchResultListItem.esm.js} +5 -7
- package/dist/components/ToolSearchResultListItem/ToolSearchResultListItem.esm.js.map +1 -0
- package/dist/components/ToolSearchResultListItem/index.esm.js +2 -0
- package/dist/components/ToolSearchResultListItem/index.esm.js.map +1 -0
- package/dist/extensions.esm.js +44 -0
- package/dist/extensions.esm.js.map +1 -0
- package/dist/index.esm.js +8 -18
- package/dist/index.esm.js.map +1 -1
- package/dist/plugin.esm.js +57 -0
- package/dist/plugin.esm.js.map +1 -0
- package/dist/routes.esm.js +13 -0
- package/dist/routes.esm.js.map +1 -0
- package/package.json +24 -16
- package/dist/esm/GroupsExplorerContent-xDnXX8fq.esm.js.map +0 -1
- package/dist/esm/ToolExplorerContent-DhAgNCmY.esm.js.map +0 -1
- package/dist/esm/index-BWXDllsA.esm.js.map +0 -1
- package/dist/esm/index-BeL03B8t.esm.js +0 -12
- package/dist/esm/index-BeL03B8t.esm.js.map +0 -1
- package/dist/esm/index-Cz8p9vYj.esm.js.map +0 -1
- package/dist/esm/index-D1DnOVYM.esm.js +0 -23
- package/dist/esm/index-D1DnOVYM.esm.js.map +0 -1
- package/dist/esm/index-DC9IXDZz.esm.js +0 -280
- package/dist/esm/index-DC9IXDZz.esm.js.map +0 -1
- package/dist/esm/index-DpL1APRw.esm.js +0 -49
- package/dist/esm/index-DpL1APRw.esm.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GroupsDiagram } from './GroupsDiagram.esm.js';
|
|
3
|
+
import { Content, ContentHeader, SupportButton } from '@backstage/core-components';
|
|
4
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
5
|
+
|
|
6
|
+
const useStyles = makeStyles(
|
|
7
|
+
{
|
|
8
|
+
root: {
|
|
9
|
+
height: "100%",
|
|
10
|
+
maxHeight: "100%",
|
|
11
|
+
minHeight: 0
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{ name: "ExploreGroupsContent" }
|
|
15
|
+
);
|
|
16
|
+
const GroupsExplorerContent = (props) => {
|
|
17
|
+
const classes = useStyles();
|
|
18
|
+
return /* @__PURE__ */ React.createElement(Content, { noPadding: true, stretch: true, className: classes.root }, /* @__PURE__ */ React.createElement(ContentHeader, { title: props.title ?? "Groups" }, /* @__PURE__ */ React.createElement(SupportButton, null, "Explore your groups.")), /* @__PURE__ */ React.createElement(
|
|
19
|
+
GroupsDiagram,
|
|
20
|
+
{
|
|
21
|
+
direction: props.direction,
|
|
22
|
+
hideChildren: props.hideChildren,
|
|
23
|
+
namespace: props.namespace
|
|
24
|
+
}
|
|
25
|
+
));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { GroupsExplorerContent };
|
|
29
|
+
//# sourceMappingURL=GroupsExplorerContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupsExplorerContent.esm.js","sources":["../../../src/components/GroupsExplorerContent/GroupsExplorerContent.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 React from 'react';\nimport { GroupsDiagram } from './GroupsDiagram';\nimport {\n Content,\n ContentHeader,\n DependencyGraphTypes,\n SupportButton,\n} from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(\n {\n root: {\n height: '100%',\n maxHeight: '100%',\n minHeight: 0,\n },\n },\n { name: 'ExploreGroupsContent' },\n);\n\nexport const GroupsExplorerContent = (props: {\n title?: string;\n direction?: DependencyGraphTypes.Direction;\n hideChildren?: boolean;\n namespace?: string;\n}) => {\n const classes = useStyles();\n\n return (\n <Content noPadding stretch className={classes.root}>\n <ContentHeader title={props.title ?? 'Groups'}>\n <SupportButton>Explore your groups.</SupportButton>\n </ContentHeader>\n <GroupsDiagram\n direction={props.direction}\n hideChildren={props.hideChildren}\n namespace={props.namespace}\n />\n </Content>\n );\n};\n"],"names":[],"mappings":";;;;;AA0BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,IAAM,EAAA;AAAA,MACJ,MAAQ,EAAA,MAAA;AAAA,MACR,SAAW,EAAA,MAAA;AAAA,MACX,SAAW,EAAA,CAAA;AAAA,KACb;AAAA,GACF;AAAA,EACA,EAAE,MAAM,sBAAuB,EAAA;AACjC,CAAA,CAAA;AAEa,MAAA,qBAAA,GAAwB,CAAC,KAKhC,KAAA;AACJ,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAE1B,EAAA,2CACG,OAAQ,EAAA,EAAA,SAAA,EAAS,MAAC,OAAO,EAAA,IAAA,EAAC,WAAW,OAAQ,CAAA,IAAA,EAAA,sCAC3C,aAAc,EAAA,EAAA,KAAA,EAAO,MAAM,KAAS,IAAA,QAAA,EAAA,sCAClC,aAAc,EAAA,IAAA,EAAA,sBAAoB,CACrC,CACA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,WAAW,KAAM,CAAA,SAAA;AAAA,MACjB,cAAc,KAAM,CAAA,YAAA;AAAA,MACpB,WAAW,KAAM,CAAA,SAAA;AAAA,KAAA;AAAA,GAErB,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/{esm/ToolExplorerContent-DhAgNCmY.esm.js → components/ToolCard/ToolCard.esm.js}
RENAMED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import useAsync from 'react-use/esm/useAsync';
|
|
3
1
|
import Box from '@material-ui/core/Box';
|
|
4
2
|
import Card from '@material-ui/core/Card';
|
|
5
3
|
import CardActions from '@material-ui/core/CardActions';
|
|
@@ -8,11 +6,9 @@ import CardMedia from '@material-ui/core/CardMedia';
|
|
|
8
6
|
import Chip from '@material-ui/core/Chip';
|
|
9
7
|
import Typography from '@material-ui/core/Typography';
|
|
10
8
|
import { makeStyles } from '@material-ui/core/styles';
|
|
11
|
-
import { LinkButton
|
|
9
|
+
import { LinkButton } from '@backstage/core-components';
|
|
12
10
|
import classNames from 'classnames';
|
|
13
|
-
import
|
|
14
|
-
import '@backstage/errors';
|
|
15
|
-
import { e as exploreApiRef } from './index-DC9IXDZz.esm.js';
|
|
11
|
+
import React from 'react';
|
|
16
12
|
|
|
17
13
|
const useStyles = makeStyles(
|
|
18
14
|
(theme) => ({
|
|
@@ -65,38 +61,5 @@ const ToolCard = ({ card, objectFit }) => {
|
|
|
65
61
|
)), /* @__PURE__ */ React.createElement(Typography, null, description || "Description missing"), tags && /* @__PURE__ */ React.createElement(Box, { marginTop: 2 }, tags.map((item, idx) => /* @__PURE__ */ React.createElement(Chip, { size: "small", key: idx, label: item })))), /* @__PURE__ */ React.createElement(CardActions, null, /* @__PURE__ */ React.createElement(LinkButton, { color: "primary", to: url, disabled: !url }, "Explore")));
|
|
66
62
|
};
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const {
|
|
71
|
-
value: tools,
|
|
72
|
-
loading,
|
|
73
|
-
error
|
|
74
|
-
} = useAsync(async () => {
|
|
75
|
-
var _a;
|
|
76
|
-
return (_a = await exploreApi.getTools()) == null ? void 0 : _a.tools;
|
|
77
|
-
}, [exploreApi]);
|
|
78
|
-
if (loading) {
|
|
79
|
-
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
80
|
-
}
|
|
81
|
-
if (error) {
|
|
82
|
-
return /* @__PURE__ */ React.createElement(WarningPanel, { title: "Failed to load tools" });
|
|
83
|
-
}
|
|
84
|
-
if (!(tools == null ? void 0 : tools.length)) {
|
|
85
|
-
return /* @__PURE__ */ React.createElement(
|
|
86
|
-
EmptyState,
|
|
87
|
-
{
|
|
88
|
-
missing: "info",
|
|
89
|
-
title: "No tools to display",
|
|
90
|
-
description: "You haven't added any tools yet."
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
return /* @__PURE__ */ React.createElement(ItemCardGrid, null, tools.map((tool, index) => /* @__PURE__ */ React.createElement(ToolCard, { key: index, card: tool })));
|
|
95
|
-
};
|
|
96
|
-
const ToolExplorerContent = (props) => {
|
|
97
|
-
var _a;
|
|
98
|
-
return /* @__PURE__ */ React.createElement(Content, { noPadding: true }, /* @__PURE__ */ React.createElement(ContentHeader, { title: (_a = props.title) != null ? _a : "Tools" }, /* @__PURE__ */ React.createElement(SupportButton, null, "Discover the tools in your ecosystem.")), /* @__PURE__ */ React.createElement(Body, null));
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export { ToolExplorerContent as T };
|
|
102
|
-
//# sourceMappingURL=ToolExplorerContent-DhAgNCmY.esm.js.map
|
|
64
|
+
export { ToolCard };
|
|
65
|
+
//# sourceMappingURL=ToolCard.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolCard.esm.js","sources":["../../../src/components/ToolCard/ToolCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { ExploreTool } from '@backstage-community/plugin-explore-react';\nimport Box from '@material-ui/core/Box';\nimport Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardMedia from '@material-ui/core/CardMedia';\nimport Chip from '@material-ui/core/Chip';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { LinkButton } from '@backstage/core-components';\nimport classNames from 'classnames';\nimport React from 'react';\n\n// TODO: Align styling between Domain and ToolCard\n\nconst useStyles = makeStyles<Theme>(\n theme => ({\n media: {\n height: 128,\n },\n mediaContain: {\n backgroundSize: 'contain',\n },\n lifecycle: {\n lineHeight: '0.8em',\n color: theme.palette.common.white,\n },\n ga: {\n backgroundColor: theme.palette.status.ok,\n },\n alpha: {\n backgroundColor: theme.palette.status.error,\n },\n beta: {\n backgroundColor: theme.palette.status.warning,\n },\n }),\n {\n name: 'ExploreToolCard',\n },\n);\n\ntype Props = {\n card: ExploreTool;\n objectFit?: 'cover' | 'contain';\n};\n\nexport const ToolCard = ({ card, objectFit }: Props) => {\n const classes = useStyles();\n\n const { title, description, url, image, lifecycle, tags } = card;\n\n return (\n <Card key={title}>\n <CardMedia\n image={image}\n title={title}\n className={classNames(classes.media, {\n [classes.mediaContain]: objectFit === 'contain',\n })}\n />\n <CardContent>\n <Typography variant=\"h5\">\n {title}{' '}\n {lifecycle && lifecycle.toLocaleLowerCase('en-US') !== 'ga' && (\n <Chip\n size=\"small\"\n label={lifecycle}\n className={classNames(\n classes.lifecycle,\n classes[lifecycle.toLocaleLowerCase('en-US')],\n )}\n />\n )}\n </Typography>\n <Typography>{description || 'Description missing'}</Typography>\n {tags && (\n <Box marginTop={2}>\n {tags.map((item, idx) => (\n <Chip size=\"small\" key={idx} label={item} />\n ))}\n </Box>\n )}\n </CardContent>\n <CardActions>\n <LinkButton color=\"primary\" to={url} disabled={!url}>\n Explore\n </LinkButton>\n </CardActions>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA+BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,KAAO,EAAA;AAAA,MACL,MAAQ,EAAA,GAAA;AAAA,KACV;AAAA,IACA,YAAc,EAAA;AAAA,MACZ,cAAgB,EAAA,SAAA;AAAA,KAClB;AAAA,IACA,SAAW,EAAA;AAAA,MACT,UAAY,EAAA,OAAA;AAAA,MACZ,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,KAAA;AAAA,KAC9B;AAAA,IACA,EAAI,EAAA;AAAA,MACF,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,EAAA;AAAA,KACxC;AAAA,IACA,KAAO,EAAA;AAAA,MACL,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,KAAA;AAAA,KACxC;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,OAAA;AAAA,KACxC;AAAA,GACF,CAAA;AAAA,EACA;AAAA,IACE,IAAM,EAAA,iBAAA;AAAA,GACR;AACF,CAAA,CAAA;AAOO,MAAM,QAAW,GAAA,CAAC,EAAE,IAAA,EAAM,WAAuB,KAAA;AACtD,EAAA,MAAM,UAAU,SAAU,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sCACC,WACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,KAAM,EAAA,SAAA,EAAU,IAAI,GAAK,EAAA,QAAA,EAAU,CAAC,GAAK,EAAA,EAAA,SAErD,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import useAsync from 'react-use/esm/useAsync';
|
|
3
|
+
import { ToolCard } from '../ToolCard/ToolCard.esm.js';
|
|
4
|
+
import { Content, ContentHeader, SupportButton, Progress, WarningPanel, EmptyState, ItemCardGrid } from '@backstage/core-components';
|
|
5
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
6
|
+
import '@backstage/errors';
|
|
7
|
+
import { exploreApiRef } from '../../api/ExploreApi.esm.js';
|
|
8
|
+
|
|
9
|
+
const Body = () => {
|
|
10
|
+
const exploreApi = useApi(exploreApiRef);
|
|
11
|
+
const {
|
|
12
|
+
value: tools,
|
|
13
|
+
loading,
|
|
14
|
+
error
|
|
15
|
+
} = useAsync(async () => {
|
|
16
|
+
return (await exploreApi.getTools())?.tools;
|
|
17
|
+
}, [exploreApi]);
|
|
18
|
+
if (loading) {
|
|
19
|
+
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
20
|
+
}
|
|
21
|
+
if (error) {
|
|
22
|
+
return /* @__PURE__ */ React.createElement(WarningPanel, { title: "Failed to load tools" });
|
|
23
|
+
}
|
|
24
|
+
if (!tools?.length) {
|
|
25
|
+
return /* @__PURE__ */ React.createElement(
|
|
26
|
+
EmptyState,
|
|
27
|
+
{
|
|
28
|
+
missing: "info",
|
|
29
|
+
title: "No tools to display",
|
|
30
|
+
description: "You haven't added any tools yet."
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
return /* @__PURE__ */ React.createElement(ItemCardGrid, null, tools.map((tool, index) => /* @__PURE__ */ React.createElement(ToolCard, { key: index, card: tool })));
|
|
35
|
+
};
|
|
36
|
+
const ToolExplorerContent = (props) => /* @__PURE__ */ React.createElement(Content, { noPadding: true }, /* @__PURE__ */ React.createElement(ContentHeader, { title: props.title ?? "Tools" }, /* @__PURE__ */ React.createElement(SupportButton, null, "Discover the tools in your ecosystem.")), /* @__PURE__ */ React.createElement(Body, null));
|
|
37
|
+
|
|
38
|
+
export { ToolExplorerContent };
|
|
39
|
+
//# sourceMappingURL=ToolExplorerContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolExplorerContent.esm.js","sources":["../../../src/components/ToolExplorerContent/ToolExplorerContent.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 React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { ToolCard } from '../ToolCard';\nimport {\n Content,\n ContentHeader,\n EmptyState,\n ItemCardGrid,\n Progress,\n SupportButton,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { exploreApiRef } from '../../api';\n\nconst Body = () => {\n const exploreApi = useApi(exploreApiRef);\n\n const {\n value: tools,\n loading,\n error,\n } = useAsync(async () => {\n return (await exploreApi.getTools())?.tools;\n }, [exploreApi]);\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n return <WarningPanel title=\"Failed to load tools\" />;\n }\n\n if (!tools?.length) {\n return (\n <EmptyState\n missing=\"info\"\n title=\"No tools to display\"\n description=\"You haven't added any tools yet.\"\n />\n );\n }\n\n return (\n <ItemCardGrid>\n {tools.map((tool, index) => (\n <ToolCard key={index} card={tool} />\n ))}\n </ItemCardGrid>\n );\n};\n\nexport const ToolExplorerContent = (props: { title?: string }) => (\n <Content noPadding>\n <ContentHeader title={props.title ?? 'Tools'}>\n <SupportButton>Discover the tools in your ecosystem.</SupportButton>\n </ContentHeader>\n <Body />\n </Content>\n);\n"],"names":[],"mappings":";;;;;;;;AA+BA,MAAM,OAAO,MAAM;AACjB,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA,CAAA;AAEvC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,KAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,GACF,GAAI,SAAS,YAAY;AACvB,IAAQ,OAAA,CAAA,MAAM,UAAW,CAAA,QAAA,EAAa,GAAA,KAAA,CAAA;AAAA,GACxC,EAAG,CAAC,UAAU,CAAC,CAAA,CAAA;AAEf,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,GACnB;AAEA,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,YAAa,EAAA,EAAA,KAAA,EAAM,sBAAuB,EAAA,CAAA,CAAA;AAAA,GACpD;AAEA,EAAI,IAAA,CAAC,OAAO,MAAQ,EAAA;AAClB,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAQ,EAAA,MAAA;AAAA,QACR,KAAM,EAAA,qBAAA;AAAA,QACN,WAAY,EAAA,kCAAA;AAAA,OAAA;AAAA,KACd,CAAA;AAAA,GAEJ;AAEA,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,IAAA,EACE,KAAM,CAAA,GAAA,CAAI,CAAC,IAAM,EAAA,KAAA,qBACf,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,GAAK,EAAA,KAAA,EAAO,IAAM,EAAA,IAAA,EAAM,CACnC,CACH,CAAA,CAAA;AAEJ,CAAA,CAAA;AAEa,MAAA,mBAAA,GAAsB,CAAC,KAClC,qBAAA,KAAA,CAAA,aAAA,CAAC,WAAQ,SAAS,EAAA,IAAA,EAAA,sCACf,aAAc,EAAA,EAAA,KAAA,EAAO,MAAM,KAAS,IAAA,OAAA,EAAA,sCAClC,aAAc,EAAA,IAAA,EAAA,uCAAqC,CACtD,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAK,CACR;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -21,17 +21,15 @@ const useStyles = makeStyles(
|
|
|
21
21
|
{ name: "ExploreToolSearchResultListItem" }
|
|
22
22
|
);
|
|
23
23
|
function ToolSearchResultListItem(props) {
|
|
24
|
-
var _a, _b, _c;
|
|
25
24
|
const result = props.result;
|
|
26
25
|
const classes = useStyles();
|
|
27
|
-
if (!result)
|
|
28
|
-
return null;
|
|
26
|
+
if (!result) return null;
|
|
29
27
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, props.icon && /* @__PURE__ */ React.createElement(ListItemIcon, null, typeof props.icon === "function" ? props.icon(result) : props.icon), /* @__PURE__ */ React.createElement("div", { className: classes.flexContainer }, /* @__PURE__ */ React.createElement(
|
|
30
28
|
ListItemText,
|
|
31
29
|
{
|
|
32
30
|
className: classes.itemText,
|
|
33
31
|
primaryTypographyProps: { variant: "h6" },
|
|
34
|
-
primary: /* @__PURE__ */ React.createElement(Link, { noTrack: true, to: result.location },
|
|
32
|
+
primary: /* @__PURE__ */ React.createElement(Link, { noTrack: true, to: result.location }, props.highlight?.fields.title ? /* @__PURE__ */ React.createElement(
|
|
35
33
|
HighlightedSearchResultText,
|
|
36
34
|
{
|
|
37
35
|
text: props.highlight.fields.title,
|
|
@@ -39,7 +37,7 @@ function ToolSearchResultListItem(props) {
|
|
|
39
37
|
postTag: props.highlight.postTag
|
|
40
38
|
}
|
|
41
39
|
) : result.title),
|
|
42
|
-
secondary:
|
|
40
|
+
secondary: props.highlight?.fields.text ? /* @__PURE__ */ React.createElement(
|
|
43
41
|
HighlightedSearchResultText,
|
|
44
42
|
{
|
|
45
43
|
text: props.highlight.fields.text,
|
|
@@ -48,8 +46,8 @@ function ToolSearchResultListItem(props) {
|
|
|
48
46
|
}
|
|
49
47
|
) : result.text
|
|
50
48
|
}
|
|
51
|
-
), /* @__PURE__ */ React.createElement(Box, null,
|
|
49
|
+
), /* @__PURE__ */ React.createElement(Box, null, result.tags?.map((tag) => /* @__PURE__ */ React.createElement(Chip, { label: tag, size: "small" })))));
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
export { ToolSearchResultListItem };
|
|
55
|
-
//# sourceMappingURL=
|
|
53
|
+
//# sourceMappingURL=ToolSearchResultListItem.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolSearchResultListItem.esm.js","sources":["../../../src/components/ToolSearchResultListItem/ToolSearchResultListItem.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React, { ReactNode } from 'react';\nimport Box from '@material-ui/core/Box';\nimport Chip from '@material-ui/core/Chip';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Link } from '@backstage/core-components';\nimport {\n IndexableDocument,\n ResultHighlight,\n} from '@backstage/plugin-search-common';\nimport { HighlightedSearchResultText } from '@backstage/plugin-search-react';\n\nconst useStyles = makeStyles(\n {\n flexContainer: {\n flexWrap: 'wrap',\n },\n itemText: {\n width: '100%',\n wordBreak: 'break-all',\n marginBottom: '1rem',\n },\n },\n { name: 'ExploreToolSearchResultListItem' },\n);\n\n/**\n * Props for {@link ToolSearchResultListItem}.\n *\n * @public\n */\nexport interface ToolSearchResultListItemProps {\n icon?: ReactNode | ((result: IndexableDocument) => ReactNode);\n result?: IndexableDocument;\n highlight?: ResultHighlight;\n rank?: number;\n}\n\n/** @public */\nexport function ToolSearchResultListItem(props: ToolSearchResultListItemProps) {\n const result = props.result as any;\n\n const classes = useStyles();\n\n if (!result) return null;\n\n return (\n <>\n {props.icon && (\n <ListItemIcon>\n {typeof props.icon === 'function' ? props.icon(result) : props.icon}\n </ListItemIcon>\n )}\n <div className={classes.flexContainer}>\n <ListItemText\n className={classes.itemText}\n primaryTypographyProps={{ variant: 'h6' }}\n primary={\n <Link noTrack to={result.location}>\n {props.highlight?.fields.title ? (\n <HighlightedSearchResultText\n text={props.highlight.fields.title}\n preTag={props.highlight.preTag}\n postTag={props.highlight.postTag}\n />\n ) : (\n result.title\n )}\n </Link>\n }\n secondary={\n props.highlight?.fields.text ? (\n <HighlightedSearchResultText\n text={props.highlight.fields.text}\n preTag={props.highlight.preTag}\n postTag={props.highlight.postTag}\n />\n ) : (\n result.text\n )\n }\n />\n <Box>\n {result.tags?.map((tag: string) => (\n <Chip label={tag} size=\"small\" />\n ))}\n </Box>\n </div>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AA6BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,aAAe,EAAA;AAAA,MACb,QAAU,EAAA,MAAA;AAAA,KACZ;AAAA,IACA,QAAU,EAAA;AAAA,MACR,KAAO,EAAA,MAAA;AAAA,MACP,SAAW,EAAA,WAAA;AAAA,MACX,YAAc,EAAA,MAAA;AAAA,KAChB;AAAA,GACF;AAAA,EACA,EAAE,MAAM,iCAAkC,EAAA;AAC5C,CAAA,CAAA;AAeO,SAAS,yBAAyB,KAAsC,EAAA;AAC7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AAA;AAAA,UACxB,OAAA,EAAS,MAAM,SAAU,CAAA,OAAA;AAAA,SAAA;AAAA,UAG3B,MAAO,CAAA,IAAA;AAAA,KAAA;AAAA,qBAIZ,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,IAAA,EACE,MAAO,CAAA,IAAA,EAAM,IAAI,CAAC,GAAA,qBAChB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,OAAO,GAAK,EAAA,IAAA,EAAK,SAAQ,CAChC,CACH,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { explorePlugin } from './plugin.esm.js';
|
|
2
|
+
import { exploreRouteRef } from './routes.esm.js';
|
|
3
|
+
import { createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
|
|
4
|
+
|
|
5
|
+
const ExplorePage = explorePlugin.provide(
|
|
6
|
+
createRoutableExtension({
|
|
7
|
+
name: "ExplorePage",
|
|
8
|
+
component: () => import('./components/ExplorePage/index.esm.js').then((m) => m.ExplorePage),
|
|
9
|
+
mountPoint: exploreRouteRef
|
|
10
|
+
})
|
|
11
|
+
);
|
|
12
|
+
const DomainExplorerContent = explorePlugin.provide(
|
|
13
|
+
createComponentExtension({
|
|
14
|
+
name: "DomainExplorerContent",
|
|
15
|
+
component: {
|
|
16
|
+
lazy: () => import('./components/DomainExplorerContent/index.esm.js').then(
|
|
17
|
+
(m) => m.DomainExplorerContent
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
const GroupsExplorerContent = explorePlugin.provide(
|
|
23
|
+
createComponentExtension({
|
|
24
|
+
name: "GroupsExplorerContent",
|
|
25
|
+
component: {
|
|
26
|
+
lazy: () => import('./components/GroupsExplorerContent/index.esm.js').then(
|
|
27
|
+
(m) => m.GroupsExplorerContent
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
const ToolExplorerContent = explorePlugin.provide(
|
|
33
|
+
createComponentExtension({
|
|
34
|
+
name: "ToolExplorerContent",
|
|
35
|
+
component: {
|
|
36
|
+
lazy: () => import('./components/ToolExplorerContent/index.esm.js').then(
|
|
37
|
+
(m) => m.ToolExplorerContent
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export { DomainExplorerContent, ExplorePage, GroupsExplorerContent, ToolExplorerContent };
|
|
44
|
+
//# sourceMappingURL=extensions.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.esm.js","sources":["../src/extensions.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { explorePlugin } from './plugin';\nimport { exploreRouteRef } from './routes';\nimport {\n createComponentExtension,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const ExplorePage = explorePlugin.provide(\n createRoutableExtension({\n name: 'ExplorePage',\n component: () =>\n import('./components/ExplorePage').then(m => m.ExplorePage),\n mountPoint: exploreRouteRef,\n }),\n);\n\n/** @public */\nexport const DomainExplorerContent = explorePlugin.provide(\n createComponentExtension({\n name: 'DomainExplorerContent',\n component: {\n lazy: () =>\n import('./components/DomainExplorerContent').then(\n m => m.DomainExplorerContent,\n ),\n },\n }),\n);\n\n/** @public */\nexport const GroupsExplorerContent = explorePlugin.provide(\n createComponentExtension({\n name: 'GroupsExplorerContent',\n component: {\n lazy: () =>\n import('./components/GroupsExplorerContent').then(\n m => m.GroupsExplorerContent,\n ),\n },\n }),\n);\n\n/** @public */\nexport const ToolExplorerContent = explorePlugin.provide(\n createComponentExtension({\n name: 'ToolExplorerContent',\n component: {\n lazy: () =>\n import('./components/ToolExplorerContent').then(\n m => m.ToolExplorerContent,\n ),\n },\n }),\n);\n"],"names":[],"mappings":";;;;AAwBO,MAAM,cAAc,aAAc,CAAA,OAAA;AAAA,EACvC,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,aAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,uCAA0B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,WAAW,CAAA;AAAA,IAC5D,UAAY,EAAA,eAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGO,MAAM,wBAAwB,aAAc,CAAA,OAAA;AAAA,EACjD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,iDAAoC,CAAE,CAAA,IAAA;AAAA,QAC3C,OAAK,CAAE,CAAA,qBAAA;AAAA,OACT;AAAA,KACJ;AAAA,GACD,CAAA;AACH,EAAA;AAGO,MAAM,wBAAwB,aAAc,CAAA,OAAA;AAAA,EACjD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,iDAAoC,CAAE,CAAA,IAAA;AAAA,QAC3C,OAAK,CAAE,CAAA,qBAAA;AAAA,OACT;AAAA,KACJ;AAAA,GACD,CAAA;AACH,EAAA;AAGO,MAAM,sBAAsB,aAAc,CAAA,OAAA;AAAA,EAC/C,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,qBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MACJ,OAAO,+CAAkC,CAAE,CAAA,IAAA;AAAA,QACzC,OAAK,CAAE,CAAA,mBAAA;AAAA,OACT;AAAA,KACJ;AAAA,GACD,CAAA;AACH;;;;"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import '@material-ui/core/Box';
|
|
10
|
-
import '@material-ui/core/Card';
|
|
11
|
-
import '@material-ui/core/CardActions';
|
|
12
|
-
import '@material-ui/core/CardContent';
|
|
13
|
-
import '@material-ui/core/CardMedia';
|
|
14
|
-
import '@material-ui/core/Chip';
|
|
15
|
-
import '@backstage/core-components';
|
|
16
|
-
import 'pluralize';
|
|
17
|
-
import '@backstage-community/plugin-explore-react';
|
|
18
|
-
import '@backstage/plugin-search-react';
|
|
1
|
+
export { ExploreClient } from './api/ExploreClient.esm.js';
|
|
2
|
+
export { exploreApiRef } from './api/ExploreApi.esm.js';
|
|
3
|
+
export { CatalogKindExploreContent } from './components/CatalogKindExploreContent/CatalogKindExploreContent.esm.js';
|
|
4
|
+
export { ExploreLayout } from './components/ExploreLayout/ExploreLayout.esm.js';
|
|
5
|
+
export { DomainCard } from './components/DomainCard/DomainCard.esm.js';
|
|
6
|
+
export { DomainExplorerContent, ExplorePage, GroupsExplorerContent, ToolExplorerContent } from './extensions.esm.js';
|
|
7
|
+
export { ToolSearchResultListItem, explorePlugin, explorePlugin as plugin } from './plugin.esm.js';
|
|
8
|
+
export { catalogEntityRouteRef, exploreRouteRef } from './routes.esm.js';
|
|
19
9
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { exploreToolsConfigRef } from '@backstage-community/plugin-explore-react';
|
|
2
|
+
import { exploreRouteRef, catalogEntityRouteRef } from './routes.esm.js';
|
|
3
|
+
import { createPlugin, createApiFactory, discoveryApiRef, fetchApiRef } from '@backstage/core-plugin-api';
|
|
4
|
+
import { createSearchResultListItemExtension } from '@backstage/plugin-search-react';
|
|
5
|
+
import { ExploreClient } from './api/ExploreClient.esm.js';
|
|
6
|
+
import { exploreApiRef } from './api/ExploreApi.esm.js';
|
|
7
|
+
|
|
8
|
+
const explorePlugin = createPlugin({
|
|
9
|
+
id: "explore",
|
|
10
|
+
apis: [
|
|
11
|
+
createApiFactory({
|
|
12
|
+
api: exploreApiRef,
|
|
13
|
+
deps: {
|
|
14
|
+
discoveryApi: discoveryApiRef,
|
|
15
|
+
fetchApi: fetchApiRef,
|
|
16
|
+
exploreToolsConfig: exploreToolsConfigRef
|
|
17
|
+
},
|
|
18
|
+
factory: ({ discoveryApi, fetchApi, exploreToolsConfig }) => (
|
|
19
|
+
// NOTE: The exploreToolsConfig is for backwards compatibility and will be removed in the future
|
|
20
|
+
new ExploreClient({ discoveryApi, fetchApi, exploreToolsConfig })
|
|
21
|
+
)
|
|
22
|
+
}),
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use ExploreApi from `@backstage-community/plugin-explore` instead
|
|
25
|
+
*
|
|
26
|
+
* Register a default for exploreToolsConfigRef, you may want to override
|
|
27
|
+
* the API locally in your app.
|
|
28
|
+
*/
|
|
29
|
+
createApiFactory({
|
|
30
|
+
api: exploreToolsConfigRef,
|
|
31
|
+
deps: {},
|
|
32
|
+
factory: () => ({
|
|
33
|
+
async getTools() {
|
|
34
|
+
return void 0;
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
],
|
|
39
|
+
routes: {
|
|
40
|
+
explore: exploreRouteRef
|
|
41
|
+
},
|
|
42
|
+
externalRoutes: {
|
|
43
|
+
catalogEntity: catalogEntityRouteRef
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const ToolSearchResultListItem = explorePlugin.provide(
|
|
47
|
+
createSearchResultListItemExtension({
|
|
48
|
+
name: "ToolSearchResultListItem",
|
|
49
|
+
component: () => import('./components/ToolSearchResultListItem/index.esm.js').then(
|
|
50
|
+
(m) => m.ToolSearchResultListItem
|
|
51
|
+
),
|
|
52
|
+
predicate: (result) => result.type === "tools"
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
export { ToolSearchResultListItem, explorePlugin };
|
|
57
|
+
//# sourceMappingURL=plugin.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { exploreToolsConfigRef } from '@backstage-community/plugin-explore-react';\nimport { catalogEntityRouteRef, exploreRouteRef } from './routes';\nimport {\n createApiFactory,\n createPlugin,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n createSearchResultListItemExtension,\n SearchResultListItemExtensionProps,\n} from '@backstage/plugin-search-react';\nimport { ExploreClient, exploreApiRef } from './api';\nimport { ToolSearchResultListItemProps } from './components/ToolSearchResultListItem';\n// import { exampleTools } from './util/examples';\n\n/** @public */\nexport const explorePlugin = createPlugin({\n id: 'explore',\n apis: [\n createApiFactory({\n api: exploreApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n exploreToolsConfig: exploreToolsConfigRef,\n },\n factory: ({ discoveryApi, fetchApi, exploreToolsConfig }) =>\n // NOTE: The exploreToolsConfig is for backwards compatibility and will be removed in the future\n new ExploreClient({ discoveryApi, fetchApi, exploreToolsConfig }),\n }),\n /**\n * @deprecated Use ExploreApi from `@backstage-community/plugin-explore` instead\n *\n * Register a default for exploreToolsConfigRef, you may want to override\n * the API locally in your app.\n */\n createApiFactory({\n api: exploreToolsConfigRef,\n deps: {},\n factory: () => ({\n async getTools() {\n // Returning `undefined` will enable the explore-backend to be used via the ExploreClient.\n // If this API has been customized and returns data it will be respected first.\n return undefined as any;\n },\n }),\n }),\n ],\n routes: {\n explore: exploreRouteRef,\n },\n externalRoutes: {\n catalogEntity: catalogEntityRouteRef,\n },\n});\n\n/** @public */\nexport const ToolSearchResultListItem: (\n props: SearchResultListItemExtensionProps<ToolSearchResultListItemProps>,\n) => JSX.Element | null = explorePlugin.provide(\n createSearchResultListItemExtension({\n name: 'ToolSearchResultListItem',\n component: () =>\n import('./components/ToolSearchResultListItem').then(\n m => m.ToolSearchResultListItem,\n ),\n predicate: result => result.type === 'tools',\n }),\n);\n"],"names":[],"mappings":";;;;;;;AAiCO,MAAM,gBAAgB,YAAa,CAAA;AAAA,EACxC,EAAI,EAAA,SAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,aAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA,WAAA;AAAA,QACV,kBAAoB,EAAA,qBAAA;AAAA,OACtB;AAAA,MACA,OAAS,EAAA,CAAC,EAAE,YAAA,EAAc,UAAU,kBAAmB,EAAA;AAAA;AAAA,QAErD,IAAI,aAAc,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU,oBAAoB,CAAA;AAAA,OAAA;AAAA,KACnE,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,qBAAA;AAAA,MACL,MAAM,EAAC;AAAA,MACP,SAAS,OAAO;AAAA,QACd,MAAM,QAAW,GAAA;AAGf,UAAO,OAAA,KAAA,CAAA,CAAA;AAAA,SACT;AAAA,OACF,CAAA;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,eAAA;AAAA,GACX;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,aAAe,EAAA,qBAAA;AAAA,GACjB;AACF,CAAC,EAAA;AAGM,MAAM,2BAEa,aAAc,CAAA,OAAA;AAAA,EACtC,mCAAoC,CAAA;AAAA,IAClC,IAAM,EAAA,0BAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,oDAAuC,CAAE,CAAA,IAAA;AAAA,MAC9C,OAAK,CAAE,CAAA,wBAAA;AAAA,KACT;AAAA,IACF,SAAA,EAAW,CAAU,MAAA,KAAA,MAAA,CAAO,IAAS,KAAA,OAAA;AAAA,GACtC,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRouteRef, createExternalRouteRef } from '@backstage/core-plugin-api';
|
|
2
|
+
|
|
3
|
+
const exploreRouteRef = createRouteRef({
|
|
4
|
+
id: "explore"
|
|
5
|
+
});
|
|
6
|
+
const catalogEntityRouteRef = createExternalRouteRef({
|
|
7
|
+
id: "catalog-entity",
|
|
8
|
+
params: ["namespace", "kind", "name"],
|
|
9
|
+
optional: true
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { catalogEntityRouteRef, exploreRouteRef };
|
|
13
|
+
//# sourceMappingURL=routes.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2020 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 createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const exploreRouteRef = createRouteRef({\n id: 'explore',\n});\n\n/**\n * @deprecated This route is no longer used and can be removed\n * @public\n */\nexport const catalogEntityRouteRef = createExternalRouteRef({\n id: 'catalog-entity',\n params: ['namespace', 'kind', 'name'],\n optional: true,\n});\n"],"names":[],"mappings":";;AAsBO,MAAM,kBAAkB,cAAe,CAAA;AAAA,EAC5C,EAAI,EAAA,SAAA;AACN,CAAC,EAAA;AAMM,MAAM,wBAAwB,sBAAuB,CAAA;AAAA,EAC1D,EAAI,EAAA,gBAAA;AAAA,EACJ,MAAQ,EAAA,CAAC,WAAa,EAAA,MAAA,EAAQ,MAAM,CAAA;AAAA,EACpC,QAAU,EAAA,IAAA;AACZ,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-explore",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "A Backstage plugin for building an exploration page of your software ecosystem",
|
|
5
5
|
"backstage": {
|
|
6
|
-
"role": "frontend-plugin"
|
|
6
|
+
"role": "frontend-plugin",
|
|
7
|
+
"pluginId": "explore",
|
|
8
|
+
"pluginPackages": [
|
|
9
|
+
"@backstage-community/plugin-explore",
|
|
10
|
+
"@backstage-community/plugin-explore-backend",
|
|
11
|
+
"@backstage-community/plugin-explore-common",
|
|
12
|
+
"@backstage-community/plugin-explore-node",
|
|
13
|
+
"@backstage-community/plugin-explore-react"
|
|
14
|
+
]
|
|
7
15
|
},
|
|
8
16
|
"publishConfig": {
|
|
9
17
|
"access": "public"
|
|
@@ -48,16 +56,16 @@
|
|
|
48
56
|
"test": "backstage-cli package test"
|
|
49
57
|
},
|
|
50
58
|
"dependencies": {
|
|
51
|
-
"@backstage-community/plugin-explore-common": "^0.0.
|
|
52
|
-
"@backstage-community/plugin-explore-react": "^0.0.
|
|
53
|
-
"@backstage/catalog-model": "^1.
|
|
54
|
-
"@backstage/core-components": "^0.14.
|
|
55
|
-
"@backstage/core-plugin-api": "^1.9.
|
|
59
|
+
"@backstage-community/plugin-explore-common": "^0.0.4",
|
|
60
|
+
"@backstage-community/plugin-explore-react": "^0.0.40",
|
|
61
|
+
"@backstage/catalog-model": "^1.5.0",
|
|
62
|
+
"@backstage/core-components": "^0.14.9",
|
|
63
|
+
"@backstage/core-plugin-api": "^1.9.3",
|
|
56
64
|
"@backstage/errors": "^1.2.4",
|
|
57
|
-
"@backstage/frontend-plugin-api": "^0.6.
|
|
58
|
-
"@backstage/plugin-catalog-react": "^1.
|
|
59
|
-
"@backstage/plugin-search-common": "^1.2.
|
|
60
|
-
"@backstage/plugin-search-react": "^1.7.
|
|
65
|
+
"@backstage/frontend-plugin-api": "^0.6.7",
|
|
66
|
+
"@backstage/plugin-catalog-react": "^1.12.2",
|
|
67
|
+
"@backstage/plugin-search-common": "^1.2.13",
|
|
68
|
+
"@backstage/plugin-search-react": "^1.7.13",
|
|
61
69
|
"@material-ui/core": "^4.12.2",
|
|
62
70
|
"@material-ui/icons": "^4.9.1",
|
|
63
71
|
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
|
@@ -66,11 +74,11 @@
|
|
|
66
74
|
"react-use": "^17.2.4"
|
|
67
75
|
},
|
|
68
76
|
"devDependencies": {
|
|
69
|
-
"@backstage/cli": "^0.26.
|
|
70
|
-
"@backstage/core-app-api": "^1.
|
|
71
|
-
"@backstage/dev-utils": "^1.0.
|
|
72
|
-
"@backstage/plugin-catalog": "^1.
|
|
73
|
-
"@backstage/test-utils": "^1.5.
|
|
77
|
+
"@backstage/cli": "^0.26.11",
|
|
78
|
+
"@backstage/core-app-api": "^1.14.0",
|
|
79
|
+
"@backstage/dev-utils": "^1.0.35",
|
|
80
|
+
"@backstage/plugin-catalog": "^1.21.1",
|
|
81
|
+
"@backstage/test-utils": "^1.5.8",
|
|
74
82
|
"@testing-library/dom": "^10.0.0",
|
|
75
83
|
"@testing-library/jest-dom": "^6.0.0",
|
|
76
84
|
"@testing-library/react": "^15.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GroupsExplorerContent-xDnXX8fq.esm.js","sources":["../../src/components/GroupsExplorerContent/GroupsDiagram.tsx","../../src/components/GroupsExplorerContent/GroupsExplorerContent.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 parseEntityRef,\n RELATION_CHILD_OF,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n DependencyGraph,\n DependencyGraphTypes,\n Link,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n entityRouteRef,\n getEntityRelations,\n EntityDisplayName,\n} from '@backstage/plugin-catalog-react';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\nimport ZoomOutMap from '@material-ui/icons/ZoomOutMap';\nimport classNames from 'classnames';\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { EntityFilterQuery } from '@backstage/catalog-client';\n\nconst useStyles = makeStyles(\n theme => ({\n graph: {\n minHeight: '100%',\n flex: 1,\n },\n graphWrapper: {\n display: 'flex',\n height: '100%',\n },\n organizationNode: {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n groupNode: {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n centeredContent: {\n padding: theme.spacing(1),\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n color: theme.palette.common.black,\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 textOrganization: {\n color: theme.palette.secondary.contrastText,\n },\n textGroup: {\n color: theme.palette.primary.contrastText,\n },\n textWrapper: {\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: 2,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n fontWeight: 'bold',\n fontSize: '20px',\n },\n }),\n {\n name: 'ExploreGroupsDiagram',\n },\n);\n\nfunction RenderNode(props: DependencyGraphTypes.RenderNodeProps<any>) {\n const nodeWidth = 180;\n const nodeHeight = 60;\n const theme = useTheme();\n const classes = useStyles();\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n\n if (props.node.id === 'root') {\n return (\n <g>\n <rect\n width={nodeWidth}\n height={nodeHeight}\n rx={theme.shape.borderRadius}\n className={classes.organizationNode}\n />\n <title>{props.node.name}</title>\n <foreignObject width={nodeWidth} height={nodeHeight}>\n <div className={classes.centeredContent}>\n <div\n className={classNames(\n classes.textWrapper,\n classes.textOrganization,\n )}\n >\n {props.node.name}\n </div>\n </div>\n </foreignObject>\n </g>\n );\n }\n\n const ref = parseEntityRef(props.node.id);\n\n return (\n <g>\n <rect\n width={nodeWidth}\n height={nodeHeight}\n rx={theme.shape.borderRadius}\n className={classes.groupNode}\n />\n <title>\n <EntityDisplayName entityRef={props.node.id} hideIcon disableTooltip />\n </title>\n\n <Link\n to={catalogEntityRoute({\n kind: ref.kind,\n namespace: ref.namespace,\n name: ref.name,\n })}\n >\n <foreignObject width={nodeWidth} height={nodeHeight}>\n <div className={classes.centeredContent}>\n <div className={classNames(classes.textWrapper, classes.textGroup)}>\n <EntityDisplayName entityRef={props.node.id} hideIcon />\n </div>\n </div>\n </foreignObject>\n </Link>\n </g>\n );\n}\n\n/**\n * Dynamically generates a diagram of groups registered in the catalog.\n */\nexport function GroupsDiagram(props: {\n direction?: DependencyGraphTypes.Direction;\n hideChildren?: boolean;\n namespace?: string;\n}) {\n const nodes = new Array<{\n id: string;\n kind: string;\n name: string;\n }>();\n const edges = new Array<{ from: string; to: string; label: string }>();\n\n const classes = useStyles();\n const configApi = useApi(configApiRef);\n const catalogApi = useApi(catalogApiRef);\n const organizationName =\n configApi.getOptionalString('organization.name') ?? 'Backstage';\n const {\n loading,\n error,\n value: catalogResponse,\n } = useAsync(() => {\n let filter: EntityFilterQuery = { kind: ['Group'] };\n if (props.namespace) {\n filter['metadata.namespace'] = props.namespace;\n }\n return catalogApi.getEntities(filter);\n }, [catalogApi, props.namespace]);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n // the root of this diagram is the organization\n nodes.push({\n id: 'root',\n kind: 'Organization',\n name: organizationName,\n });\n\n for (const catalogItem of catalogResponse?.items || []) {\n const currentItemId = stringifyEntityRef(catalogItem);\n\n // Edge to parent\n const catalogItemRelations_childOf = getEntityRelations(\n catalogItem,\n RELATION_CHILD_OF,\n );\n\n if (props.hideChildren && catalogItemRelations_childOf.length) continue;\n\n nodes.push({\n id: stringifyEntityRef(catalogItem),\n kind: catalogItem.kind,\n name: '',\n });\n\n // if no parent is found, link the node to the root\n if (catalogItemRelations_childOf.length === 0) {\n edges.push({\n from: currentItemId,\n to: 'root',\n label: '',\n });\n }\n\n catalogItemRelations_childOf.forEach(relation => {\n edges.push({\n from: currentItemId,\n to: stringifyEntityRef(relation),\n label: '',\n });\n });\n }\n\n return (\n <div className={classes.graphWrapper}>\n <DependencyGraph\n nodes={nodes}\n edges={edges}\n nodeMargin={10}\n direction={props.direction || DependencyGraphTypes.Direction.RIGHT_LEFT}\n renderNode={RenderNode}\n className={classes.graph}\n fit=\"contain\"\n />\n\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 around the\n diagram.\n </Typography>\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 */\n\nimport React from 'react';\nimport { GroupsDiagram } from './GroupsDiagram';\nimport {\n Content,\n ContentHeader,\n DependencyGraphTypes,\n SupportButton,\n} from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(\n {\n root: {\n height: '100%',\n maxHeight: '100%',\n minHeight: 0,\n },\n },\n { name: 'ExploreGroupsContent' },\n);\n\nexport const GroupsExplorerContent = (props: {\n title?: string;\n direction?: DependencyGraphTypes.Direction;\n hideChildren?: boolean;\n namespace?: string;\n}) => {\n const classes = useStyles();\n\n return (\n <Content noPadding stretch className={classes.root}>\n <ContentHeader title={props.title ?? 'Groups'}>\n <SupportButton>Explore your groups.</SupportButton>\n </ContentHeader>\n <GroupsDiagram\n direction={props.direction}\n hideChildren={props.hideChildren}\n namespace={props.namespace}\n />\n </Content>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;AA2CA,MAAMA,WAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,KAAO,EAAA;AAAA,MACL,SAAW,EAAA,MAAA;AAAA,MACX,IAAM,EAAA,CAAA;AAAA,K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IAAe,GAAA,EAAA,GAAA,QAAA,EAAA,sCAClC,aAAc,EAAA,IAAA,EAAA,sBAAoB,CACrC,CACA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,WAAW,KAAM,CAAA,SAAA;AAAA,MACjB,cAAc,KAAM,CAAA,YAAA;AAAA,MACpB,WAAW,KAAM,CAAA,SAAA;AAAA,KAAA;AAAA,GAErB,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToolExplorerContent-DhAgNCmY.esm.js","sources":["../../src/components/ToolCard/ToolCard.tsx","../../src/components/ToolExplorerContent/ToolExplorerContent.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { ExploreTool } from '@backstage-community/plugin-explore-react';\nimport Box from '@material-ui/core/Box';\nimport Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardMedia from '@material-ui/core/CardMedia';\nimport Chip from '@material-ui/core/Chip';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport { LinkButton } from '@backstage/core-components';\nimport classNames from 'classnames';\nimport React from 'react';\n\n// TODO: Align styling between Domain and ToolCard\n\nconst useStyles = makeStyles<Theme>(\n theme => ({\n media: {\n height: 128,\n },\n mediaContain: {\n backgroundSize: 'contain',\n },\n lifecycle: {\n lineHeight: '0.8em',\n color: theme.palette.common.white,\n },\n ga: {\n backgroundColor: theme.palette.status.ok,\n },\n alpha: {\n backgroundColor: theme.palette.status.error,\n },\n beta: {\n backgroundColor: theme.palette.status.warning,\n },\n }),\n {\n name: 'ExploreToolCard',\n },\n);\n\ntype Props = {\n card: ExploreTool;\n objectFit?: 'cover' | 'contain';\n};\n\nexport const ToolCard = ({ card, objectFit }: Props) => {\n const classes = useStyles();\n\n const { title, description, url, image, lifecycle, tags } = card;\n\n return (\n <Card key={title}>\n <CardMedia\n image={image}\n title={title}\n className={classNames(classes.media, {\n [classes.mediaContain]: objectFit === 'contain',\n })}\n />\n <CardContent>\n <Typography variant=\"h5\">\n {title}{' '}\n {lifecycle && lifecycle.toLocaleLowerCase('en-US') !== 'ga' && (\n <Chip\n size=\"small\"\n label={lifecycle}\n className={classNames(\n classes.lifecycle,\n classes[lifecycle.toLocaleLowerCase('en-US')],\n )}\n />\n )}\n </Typography>\n <Typography>{description || 'Description missing'}</Typography>\n {tags && (\n <Box marginTop={2}>\n {tags.map((item, idx) => (\n <Chip size=\"small\" key={idx} label={item} />\n ))}\n </Box>\n )}\n </CardContent>\n <CardActions>\n <LinkButton color=\"primary\" to={url} disabled={!url}>\n Explore\n </LinkButton>\n </CardActions>\n </Card>\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 React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { ToolCard } from '../ToolCard';\nimport {\n Content,\n ContentHeader,\n EmptyState,\n ItemCardGrid,\n Progress,\n SupportButton,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { exploreApiRef } from '../../api';\n\nconst Body = () => {\n const exploreApi = useApi(exploreApiRef);\n\n const {\n value: tools,\n loading,\n error,\n } = useAsync(async () => {\n return (await exploreApi.getTools())?.tools;\n }, [exploreApi]);\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n return <WarningPanel title=\"Failed to load tools\" />;\n }\n\n if (!tools?.length) {\n return (\n <EmptyState\n missing=\"info\"\n title=\"No tools to display\"\n description=\"You haven't added any tools yet.\"\n />\n );\n }\n\n return (\n <ItemCardGrid>\n {tools.map((tool, index) => (\n <ToolCard key={index} card={tool} />\n ))}\n </ItemCardGrid>\n );\n};\n\nexport const ToolExplorerContent = (props: { title?: string }) => (\n <Content noPadding>\n <ContentHeader title={props.title ?? 'Tools'}>\n <SupportButton>Discover the tools in your ecosystem.</SupportButton>\n </ContentHeader>\n <Body />\n </Content>\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA+BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,KAAO,EAAA;AAAA,MACL,MAAQ,EAAA,GAAA;AAAA,KACV;AAAA,IACA,YAAc,EAAA;AAAA,MACZ,cAAgB,EAAA,SAAA;AAAA,KAClB;AAAA,IACA,SAAW,EAAA;AAAA,MACT,UAAY,EAAA,OAAA;AAAA,MACZ,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,KAAA;AAAA,KAC9B;AAAA,IACA,EAAI,EAAA;AAAA,MACF,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,EAAA;AAAA,KACxC;AAAA,IACA,KAAO,EAAA;AAAA,MACL,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,KAAA;AAAA,KACxC;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,OAAA;AAAA,KACxC;AAAA,GACF,CAAA;AAAA,EACA;AAAA,IACE,I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aAAA,CAAA,YAAA,EAAA,IAAA,EACE,KAAM,CAAA,GAAA,CAAI,CAAC,IAAM,EAAA,KAAA,qBACf,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EAAS,GAAK,EAAA,KAAA,EAAO,IAAM,EAAA,IAAA,EAAM,CACnC,CACH,CAAA,CAAA;AAEJ,CAAA,CAAA;AAEa,MAAA,mBAAA,GAAsB,CAAC,KAA2B,KAAA;AArE/D,EAAA,IAAA,EAAA,CAAA;AAsEE,EAAA,uBAAA,KAAA,CAAA,aAAA,CAAC,WAAQ,SAAS,EAAA,IAAA,EAAA,kBACf,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,EAAc,QAAO,EAAM,GAAA,KAAA,CAAA,KAAA,KAAN,IAAe,GAAA,EAAA,GAAA,OAAA,EAAA,sCAClC,aAAc,EAAA,IAAA,EAAA,uCAAqC,CACtD,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAK,CACR,CAAA,CAAA;AAAA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-BWXDllsA.esm.js","sources":["../../src/components/DomainExplorerContent/DomainExplorerContent.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 { DomainEntity } from '@backstage/catalog-model';\nimport { catalogApiRef } from '@backstage/plugin-catalog-react';\nimport Button from '@material-ui/core/Button';\nimport React from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n Content,\n ContentHeader,\n EmptyState,\n ItemCardGrid,\n Progress,\n SupportButton,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { EntityCard } from '../EntityCard';\n\nconst Body = () => {\n const catalogApi = useApi(catalogApiRef);\n const {\n value: entities,\n loading,\n error,\n } = useAsync(async () => {\n const response = await catalogApi.getEntities({\n filter: { kind: 'domain' },\n });\n return response.items as DomainEntity[];\n }, [catalogApi]);\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n return (\n <WarningPanel severity=\"error\" title=\"Could not load domains.\">\n {error.message}\n </WarningPanel>\n );\n }\n\n if (!entities?.length) {\n return (\n <EmptyState\n missing=\"info\"\n title=\"No domains to display\"\n description=\"You haven't added any domains yet.\"\n action={\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain\"\n >\n Read more\n </Button>\n }\n />\n );\n }\n\n return (\n <ItemCardGrid>\n {entities.map((entity, index) => (\n <EntityCard key={index} entity={entity} />\n ))}\n </ItemCardGrid>\n );\n};\n\n/** @public */\nexport const DomainExplorerContent = (props: { title?: string }) => {\n return (\n <Content noPadding>\n <ContentHeader title={props.title ?? 'Domains'}>\n <SupportButton>Discover the domains in your ecosystem.</SupportButton>\n </ContentHeader>\n <Body />\n </Content>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAiCA,MAAM,OAAO,MAAM;AACjB,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA,CAAA;AACvC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,QAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,GACF,GAAI,SAAS,YAAY;AACvB,IAAM,MAAA,QAAA,GAAW,MAAM,UAAA,CAAW,WAAY,CAAA;AAAA,MAC5C,MAAA,EAAQ,EAAE,IAAA,EAAM,QAAS,EAAA;AAAA,KAC1B,CAAA,CAAA;AACD,IAAA,OAAO,QAAS,CAAA,KAAA,CAAA;AAAA,GAClB,EAAG,CAAC,UAAU,CAAC,CAAA,CAAA;A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CACxD,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAK,CACR,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { G as GroupsExplorerContent } from './GroupsExplorerContent-xDnXX8fq.esm.js';
|
|
2
|
-
import 'react';
|
|
3
|
-
import '@backstage/catalog-model';
|
|
4
|
-
import '@backstage/core-components';
|
|
5
|
-
import '@backstage/core-plugin-api';
|
|
6
|
-
import '@backstage/plugin-catalog-react';
|
|
7
|
-
import '@material-ui/core/Typography';
|
|
8
|
-
import '@material-ui/core/styles';
|
|
9
|
-
import '@material-ui/icons/ZoomOutMap';
|
|
10
|
-
import 'classnames';
|
|
11
|
-
import 'react-use/esm/useAsync';
|
|
12
|
-
//# sourceMappingURL=index-BeL03B8t.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-BeL03B8t.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-Cz8p9vYj.esm.js","sources":["../../src/components/ToolSearchResultListItem/ToolSearchResultListItem.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 React, { ReactNode } from 'react';\nimport Box from '@material-ui/core/Box';\nimport Chip from '@material-ui/core/Chip';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Link } from '@backstage/core-components';\nimport {\n IndexableDocument,\n ResultHighlight,\n} from '@backstage/plugin-search-common';\nimport { HighlightedSearchResultText } from '@backstage/plugin-search-react';\n\nconst useStyles = makeStyles(\n {\n flexContainer: {\n flexWrap: 'wrap',\n },\n itemText: {\n width: '100%',\n wordBreak: 'break-all',\n marginBottom: '1rem',\n },\n },\n { name: 'ExploreToolSearchResultListItem' },\n);\n\n/**\n * Props for {@link ToolSearchResultListItem}.\n *\n * @public\n */\nexport interface ToolSearchResultListItemProps {\n icon?: ReactNode | ((result: IndexableDocument) => ReactNode);\n result?: IndexableDocument;\n highlight?: ResultHighlight;\n rank?: number;\n}\n\n/** @public */\nexport function ToolSearchResultListItem(props: ToolSearchResultListItemProps) {\n const result = props.result as any;\n\n const classes = useStyles();\n\n if (!result) return null;\n\n return (\n <>\n {props.icon && (\n <ListItemIcon>\n {typeof props.icon === 'function' ? props.icon(result) : props.icon}\n </ListItemIcon>\n )}\n <div className={classes.flexContainer}>\n <ListItemText\n className={classes.itemText}\n primaryTypographyProps={{ variant: 'h6' }}\n primary={\n <Link noTrack to={result.location}>\n {props.highlight?.fields.title ? (\n <HighlightedSearchResultText\n text={props.highlight.fields.title}\n preTag={props.highlight.preTag}\n postTag={props.highlight.postTag}\n />\n ) : (\n result.title\n )}\n </Link>\n }\n secondary={\n props.highlight?.fields.text ? (\n <HighlightedSearchResultText\n text={props.highlight.fields.text}\n preTag={props.highlight.preTag}\n postTag={props.highlight.postTag}\n />\n ) : (\n result.text\n )\n }\n />\n <Box>\n {result.tags?.map((tag: string) => (\n <Chip label={tag} size=\"small\" />\n ))}\n </Box>\n </div>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AA6BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,aAAe,EAAA;AAAA,MACb,QAAU,EAAA,MAAA;AAAA,KACZ;AAAA,IACA,QAAU,EAAA;AAAA,MACR,KAAO,EAAA,MAAA;AAAA,MACP,SAAW,EAAA,WAAA;AAAA,MACX,YAAc,EAAA,MA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