@backstage-community/plugin-explore 0.4.21
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 +2283 -0
- package/README.md +148 -0
- package/alpha/package.json +7 -0
- package/dist/alpha.d.ts +10 -0
- package/dist/alpha.esm.js +16 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/esm/GroupsExplorerContent-D_QfaGTY.esm.js +211 -0
- package/dist/esm/GroupsExplorerContent-D_QfaGTY.esm.js.map +1 -0
- package/dist/esm/ToolExplorerContent-DzMkzhod.esm.js +102 -0
- package/dist/esm/ToolExplorerContent-DzMkzhod.esm.js.map +1 -0
- package/dist/esm/index-B_Dn9qT_.esm.js +12 -0
- package/dist/esm/index-B_Dn9qT_.esm.js.map +1 -0
- package/dist/esm/index-CeOO34TY.esm.js +49 -0
- package/dist/esm/index-CeOO34TY.esm.js.map +1 -0
- package/dist/esm/index-Cz8p9vYj.esm.js +55 -0
- package/dist/esm/index-Cz8p9vYj.esm.js.map +1 -0
- package/dist/esm/index-DBoY59Wh.esm.js +65 -0
- package/dist/esm/index-DBoY59Wh.esm.js.map +1 -0
- package/dist/esm/index-DVlrZV4C.esm.js +23 -0
- package/dist/esm/index-DVlrZV4C.esm.js.map +1 -0
- package/dist/esm/index-DrIeHaZd.esm.js +280 -0
- package/dist/esm/index-DrIeHaZd.esm.js.map +1 -0
- package/dist/index.d.ts +153 -0
- package/dist/index.esm.js +19 -0
- package/dist/index.esm.js.map +1 -0
- package/package.json +91 -0
package/README.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# explore
|
|
2
|
+
|
|
3
|
+
Welcome to the explore plugin!
|
|
4
|
+
|
|
5
|
+
This plugin helps to visualize the top level entities like domains, groups and tools in your ecosystem.
|
|
6
|
+
|
|
7
|
+
## Setup
|
|
8
|
+
|
|
9
|
+
The following sections will help you get the Explore plugin setup and running.
|
|
10
|
+
|
|
11
|
+
### Backend
|
|
12
|
+
|
|
13
|
+
You need to setup the
|
|
14
|
+
[Explore backend plugin](https://github.com/backstage/backstage/tree/master/plugins/explore-backend)
|
|
15
|
+
before you move forward with any of these steps if you haven't already.
|
|
16
|
+
|
|
17
|
+
### Installation
|
|
18
|
+
|
|
19
|
+
Install this plugin:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# From your Backstage root directory
|
|
23
|
+
yarn --cwd packages/app add @backstage-community/plugin-explore
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Add the plugin to your `packages/app`
|
|
27
|
+
|
|
28
|
+
Add the root page that the playlist plugin provides to your app. You can choose
|
|
29
|
+
any path for the route, but we recommend the following:
|
|
30
|
+
|
|
31
|
+
```diff
|
|
32
|
+
// packages/app/src/App.tsx
|
|
33
|
+
+ import { ExplorePage } from '@backstage-community/plugin-explore';
|
|
34
|
+
|
|
35
|
+
...
|
|
36
|
+
|
|
37
|
+
<FlatRoutes>
|
|
38
|
+
<Route path="/catalog" element={<CatalogIndexPage />} />
|
|
39
|
+
<Route path="/catalog/:namespace/:kind/:name" element={<CatalogEntityPage />}>
|
|
40
|
+
{entityPage}
|
|
41
|
+
</Route>
|
|
42
|
+
+ <Route path="/explore" element={<ExplorePage />} />
|
|
43
|
+
...
|
|
44
|
+
</FlatRoutes>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You may also want to add a link to the playlist page to your application
|
|
48
|
+
sidebar:
|
|
49
|
+
|
|
50
|
+
```diff
|
|
51
|
+
// packages/app/src/components/Root/Root.tsx
|
|
52
|
+
+import LayersIcon from '@material-ui/icons/Layers';
|
|
53
|
+
|
|
54
|
+
export const Root = ({ children }: PropsWithChildren<{}>) => (
|
|
55
|
+
<SidebarPage>
|
|
56
|
+
<Sidebar>
|
|
57
|
+
+ <SidebarItem icon={LayersIcon} to="explore" text="Explore" />
|
|
58
|
+
...
|
|
59
|
+
</Sidebar>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Use search result list item for Explore Tools
|
|
63
|
+
|
|
64
|
+
When you have your `packages/app/src/components/search/SearchPage.tsx` file
|
|
65
|
+
ready to make modifications, add the following code snippet to add the
|
|
66
|
+
`ToolSearchResultListItem` when the type of the search results are
|
|
67
|
+
`tool`.
|
|
68
|
+
|
|
69
|
+
```diff
|
|
70
|
+
+import { ToolSearchResultListItem } from '@backstage-community/plugin-explore';
|
|
71
|
+
+import BuildIcon from '@material-ui/icons/Build';
|
|
72
|
+
|
|
73
|
+
const SearchPage = () => {
|
|
74
|
+
...
|
|
75
|
+
<SearchResult>
|
|
76
|
+
{({ results }) => (
|
|
77
|
+
<List>
|
|
78
|
+
{results.map(({ type, document, highlight, rank }) => {
|
|
79
|
+
switch (type) {
|
|
80
|
+
...
|
|
81
|
+
+ case 'tools':
|
|
82
|
+
+ return (
|
|
83
|
+
+ <ToolSearchResultListItem
|
|
84
|
+
+ icon={<BuildIcon />}
|
|
85
|
+
+ key={document.location}
|
|
86
|
+
+ result={document}
|
|
87
|
+
+ highlight={highlight}
|
|
88
|
+
+ rank={rank}
|
|
89
|
+
+ />
|
|
90
|
+
+ );
|
|
91
|
+
}
|
|
92
|
+
})}
|
|
93
|
+
</List>
|
|
94
|
+
)}
|
|
95
|
+
...
|
|
96
|
+
</SearchResult>
|
|
97
|
+
...
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Customization
|
|
101
|
+
|
|
102
|
+
Create a custom explore page in
|
|
103
|
+
`packages/app/src/components/explore/ExplorePage.tsx`.
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import {
|
|
107
|
+
CatalogKindExploreContent,
|
|
108
|
+
ExploreLayout,
|
|
109
|
+
} from '@backstage-community/plugin-explore';
|
|
110
|
+
import React from 'react';
|
|
111
|
+
import { InnerSourceExploreContent } from './InnerSourceExploreContent';
|
|
112
|
+
|
|
113
|
+
export const ExplorePage = () => {
|
|
114
|
+
return (
|
|
115
|
+
<ExploreLayout
|
|
116
|
+
title="Explore the ACME corp ecosystem"
|
|
117
|
+
subtitle="Browse our ecosystem"
|
|
118
|
+
>
|
|
119
|
+
<ExploreLayout.Route path="domains" title="Domains">
|
|
120
|
+
<CatalogKindExploreContent kind="domain" />
|
|
121
|
+
</ExploreLayout.Route>
|
|
122
|
+
<ExploreLayout.Route path="systems" title="Systems">
|
|
123
|
+
<CatalogKindExploreContent kind="system" />
|
|
124
|
+
</ExploreLayout.Route>
|
|
125
|
+
<ExploreLayout.Route path="inner-source" title="InnerSource">
|
|
126
|
+
<InnerSourceExploreContent />
|
|
127
|
+
</ExploreLayout.Route>
|
|
128
|
+
</ExploreLayout>
|
|
129
|
+
);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const explorePage = <ExplorePage />;
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Now register the new explore page in `packages/app/src/App.tsx`.
|
|
136
|
+
|
|
137
|
+
```diff
|
|
138
|
+
+import { explorePage } from './components/explore/ExplorePage';
|
|
139
|
+
|
|
140
|
+
const routes = (
|
|
141
|
+
<FlatRoutes>
|
|
142
|
+
- <Route path="/explore" element={<ExplorePage />} />
|
|
143
|
+
+ <Route path="/explore" element={<ExplorePage />}>
|
|
144
|
+
+ {explorePage}
|
|
145
|
+
+ </Route>
|
|
146
|
+
</FlatRoutes>
|
|
147
|
+
);
|
|
148
|
+
```
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
/** @alpha */
|
|
4
|
+
declare const exploreSearchResultListItem: _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
5
|
+
noTrack?: boolean | undefined;
|
|
6
|
+
}>;
|
|
7
|
+
/** @alpha */
|
|
8
|
+
declare const _default: _backstage_frontend_plugin_api.BackstagePlugin<{}, {}>;
|
|
9
|
+
|
|
10
|
+
export { _default as default, exploreSearchResultListItem };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createPlugin } from '@backstage/frontend-plugin-api';
|
|
2
|
+
import { createSearchResultListItemExtension } from '@backstage/plugin-search-react/alpha';
|
|
3
|
+
|
|
4
|
+
const exploreSearchResultListItem = createSearchResultListItemExtension({
|
|
5
|
+
predicate: (result) => result.type === "tools",
|
|
6
|
+
component: () => import('./esm/index-Cz8p9vYj.esm.js').then(
|
|
7
|
+
(m) => m.ToolSearchResultListItem
|
|
8
|
+
)
|
|
9
|
+
});
|
|
10
|
+
var alpha = createPlugin({
|
|
11
|
+
id: "explore",
|
|
12
|
+
extensions: [exploreSearchResultListItem]
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { alpha as default, exploreSearchResultListItem };
|
|
16
|
+
//# sourceMappingURL=alpha.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { createPlugin } from '@backstage/frontend-plugin-api';\nimport { createSearchResultListItemExtension } from '@backstage/plugin-search-react/alpha';\n\n/** @alpha */\nexport const exploreSearchResultListItem = createSearchResultListItemExtension({\n predicate: result => result.type === 'tools',\n component: () =>\n import('./components/ToolSearchResultListItem').then(\n m => m.ToolSearchResultListItem,\n ),\n});\n\n/** @alpha */\nexport default createPlugin({\n id: 'explore',\n extensions: [exploreSearchResultListItem],\n});\n"],"names":[],"mappings":";;;AAoBO,MAAM,8BAA8B,mCAAoC,CAAA;AAAA,EAC7E,SAAA,EAAW,CAAU,MAAA,KAAA,MAAA,CAAO,IAAS,KAAA,OAAA;AAAA,EACrC,SAAW,EAAA,MACT,OAAO,6BAAuC,CAAE,CAAA,IAAA;AAAA,IAC9C,OAAK,CAAE,CAAA,wBAAA;AAAA,GACT;AACJ,CAAC,EAAA;AAGD,YAAe,YAAa,CAAA;AAAA,EAC1B,EAAI,EAAA,SAAA;AAAA,EACJ,UAAA,EAAY,CAAC,2BAA2B,CAAA;AAC1C,CAAC,CAAA;;;;"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { stringifyEntityRef, RELATION_CHILD_OF, parseEntityRef } from '@backstage/catalog-model';
|
|
3
|
+
import { Progress, ResponseErrorPanel, DependencyGraph, DependencyGraphTypes, Link, Content, ContentHeader, SupportButton } from '@backstage/core-components';
|
|
4
|
+
import { useApi, configApiRef, useRouteRef } from '@backstage/core-plugin-api';
|
|
5
|
+
import { catalogApiRef, getEntityRelations, entityRouteRef, EntityDisplayName } from '@backstage/plugin-catalog-react';
|
|
6
|
+
import Typography from '@material-ui/core/Typography';
|
|
7
|
+
import { makeStyles, useTheme } from '@material-ui/core/styles';
|
|
8
|
+
import ZoomOutMap from '@material-ui/icons/ZoomOutMap';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import useAsync from 'react-use/esm/useAsync';
|
|
11
|
+
|
|
12
|
+
const useStyles$1 = makeStyles(
|
|
13
|
+
(theme) => ({
|
|
14
|
+
graph: {
|
|
15
|
+
minHeight: "100%",
|
|
16
|
+
flex: 1
|
|
17
|
+
},
|
|
18
|
+
graphWrapper: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
height: "100%"
|
|
21
|
+
},
|
|
22
|
+
organizationNode: {
|
|
23
|
+
fill: theme.palette.secondary.light,
|
|
24
|
+
stroke: theme.palette.secondary.light
|
|
25
|
+
},
|
|
26
|
+
groupNode: {
|
|
27
|
+
fill: theme.palette.primary.light,
|
|
28
|
+
stroke: theme.palette.primary.light
|
|
29
|
+
},
|
|
30
|
+
centeredContent: {
|
|
31
|
+
padding: theme.spacing(1),
|
|
32
|
+
height: "100%",
|
|
33
|
+
display: "flex",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
justifyContent: "center",
|
|
36
|
+
color: theme.palette.common.black
|
|
37
|
+
},
|
|
38
|
+
legend: {
|
|
39
|
+
position: "absolute",
|
|
40
|
+
bottom: 0,
|
|
41
|
+
right: 0,
|
|
42
|
+
padding: theme.spacing(1),
|
|
43
|
+
"& .icon": {
|
|
44
|
+
verticalAlign: "bottom"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
textOrganization: {
|
|
48
|
+
color: theme.palette.secondary.contrastText
|
|
49
|
+
},
|
|
50
|
+
textGroup: {
|
|
51
|
+
color: theme.palette.primary.contrastText
|
|
52
|
+
},
|
|
53
|
+
textWrapper: {
|
|
54
|
+
display: "-webkit-box",
|
|
55
|
+
WebkitBoxOrient: "vertical",
|
|
56
|
+
WebkitLineClamp: 2,
|
|
57
|
+
overflow: "hidden",
|
|
58
|
+
textOverflow: "ellipsis",
|
|
59
|
+
textAlign: "center",
|
|
60
|
+
fontWeight: "bold",
|
|
61
|
+
fontSize: "20px"
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
{
|
|
65
|
+
name: "ExploreGroupsDiagram"
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
function RenderNode(props) {
|
|
69
|
+
const nodeWidth = 180;
|
|
70
|
+
const nodeHeight = 60;
|
|
71
|
+
const theme = useTheme();
|
|
72
|
+
const classes = useStyles$1();
|
|
73
|
+
const catalogEntityRoute = useRouteRef(entityRouteRef);
|
|
74
|
+
if (props.node.id === "root") {
|
|
75
|
+
return /* @__PURE__ */ React.createElement("g", null, /* @__PURE__ */ React.createElement(
|
|
76
|
+
"rect",
|
|
77
|
+
{
|
|
78
|
+
width: nodeWidth,
|
|
79
|
+
height: nodeHeight,
|
|
80
|
+
rx: theme.shape.borderRadius,
|
|
81
|
+
className: classes.organizationNode
|
|
82
|
+
}
|
|
83
|
+
), /* @__PURE__ */ React.createElement("title", null, props.node.name), /* @__PURE__ */ React.createElement("foreignObject", { width: nodeWidth, height: nodeHeight }, /* @__PURE__ */ React.createElement("div", { className: classes.centeredContent }, /* @__PURE__ */ React.createElement(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
className: classNames(
|
|
87
|
+
classes.textWrapper,
|
|
88
|
+
classes.textOrganization
|
|
89
|
+
)
|
|
90
|
+
},
|
|
91
|
+
props.node.name
|
|
92
|
+
))));
|
|
93
|
+
}
|
|
94
|
+
const ref = parseEntityRef(props.node.id);
|
|
95
|
+
return /* @__PURE__ */ React.createElement("g", null, /* @__PURE__ */ React.createElement(
|
|
96
|
+
"rect",
|
|
97
|
+
{
|
|
98
|
+
width: nodeWidth,
|
|
99
|
+
height: nodeHeight,
|
|
100
|
+
rx: theme.shape.borderRadius,
|
|
101
|
+
className: classes.groupNode
|
|
102
|
+
}
|
|
103
|
+
), /* @__PURE__ */ React.createElement("title", null, /* @__PURE__ */ React.createElement(EntityDisplayName, { entityRef: props.node.id, hideIcon: true, disableTooltip: true })), /* @__PURE__ */ React.createElement(
|
|
104
|
+
Link,
|
|
105
|
+
{
|
|
106
|
+
to: catalogEntityRoute({
|
|
107
|
+
kind: ref.kind,
|
|
108
|
+
namespace: ref.namespace,
|
|
109
|
+
name: ref.name
|
|
110
|
+
})
|
|
111
|
+
},
|
|
112
|
+
/* @__PURE__ */ React.createElement("foreignObject", { width: nodeWidth, height: nodeHeight }, /* @__PURE__ */ React.createElement("div", { className: classes.centeredContent }, /* @__PURE__ */ React.createElement("div", { className: classNames(classes.textWrapper, classes.textGroup) }, /* @__PURE__ */ React.createElement(EntityDisplayName, { entityRef: props.node.id, hideIcon: true }))))
|
|
113
|
+
));
|
|
114
|
+
}
|
|
115
|
+
function GroupsDiagram(props) {
|
|
116
|
+
var _a;
|
|
117
|
+
const nodes = new Array();
|
|
118
|
+
const edges = new Array();
|
|
119
|
+
const classes = useStyles$1();
|
|
120
|
+
const configApi = useApi(configApiRef);
|
|
121
|
+
const catalogApi = useApi(catalogApiRef);
|
|
122
|
+
const organizationName = (_a = configApi.getOptionalString("organization.name")) != null ? _a : "Backstage";
|
|
123
|
+
const {
|
|
124
|
+
loading,
|
|
125
|
+
error,
|
|
126
|
+
value: catalogResponse
|
|
127
|
+
} = useAsync(() => {
|
|
128
|
+
return catalogApi.getEntities({
|
|
129
|
+
filter: {
|
|
130
|
+
kind: ["Group"]
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}, [catalogApi]);
|
|
134
|
+
if (loading) {
|
|
135
|
+
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
136
|
+
} else if (error) {
|
|
137
|
+
return /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error });
|
|
138
|
+
}
|
|
139
|
+
nodes.push({
|
|
140
|
+
id: "root",
|
|
141
|
+
kind: "Organization",
|
|
142
|
+
name: organizationName
|
|
143
|
+
});
|
|
144
|
+
for (const catalogItem of (catalogResponse == null ? void 0 : catalogResponse.items) || []) {
|
|
145
|
+
const currentItemId = stringifyEntityRef(catalogItem);
|
|
146
|
+
nodes.push({
|
|
147
|
+
id: stringifyEntityRef(catalogItem),
|
|
148
|
+
kind: catalogItem.kind,
|
|
149
|
+
name: ""
|
|
150
|
+
});
|
|
151
|
+
const catalogItemRelations_childOf = getEntityRelations(
|
|
152
|
+
catalogItem,
|
|
153
|
+
RELATION_CHILD_OF
|
|
154
|
+
);
|
|
155
|
+
if (catalogItemRelations_childOf.length === 0) {
|
|
156
|
+
edges.push({
|
|
157
|
+
from: currentItemId,
|
|
158
|
+
to: "root",
|
|
159
|
+
label: ""
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
catalogItemRelations_childOf.forEach((relation) => {
|
|
163
|
+
edges.push({
|
|
164
|
+
from: currentItemId,
|
|
165
|
+
to: stringifyEntityRef(relation),
|
|
166
|
+
label: ""
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return /* @__PURE__ */ React.createElement("div", { className: classes.graphWrapper }, /* @__PURE__ */ React.createElement(
|
|
171
|
+
DependencyGraph,
|
|
172
|
+
{
|
|
173
|
+
nodes,
|
|
174
|
+
edges,
|
|
175
|
+
nodeMargin: 10,
|
|
176
|
+
direction: props.direction || DependencyGraphTypes.Direction.RIGHT_LEFT,
|
|
177
|
+
renderNode: RenderNode,
|
|
178
|
+
className: classes.graph,
|
|
179
|
+
fit: "contain"
|
|
180
|
+
}
|
|
181
|
+
), /* @__PURE__ */ React.createElement(
|
|
182
|
+
Typography,
|
|
183
|
+
{
|
|
184
|
+
variant: "caption",
|
|
185
|
+
color: "textSecondary",
|
|
186
|
+
display: "block",
|
|
187
|
+
className: classes.legend
|
|
188
|
+
},
|
|
189
|
+
/* @__PURE__ */ React.createElement(ZoomOutMap, { className: "icon" }),
|
|
190
|
+
" Use pinch & zoom to move around the diagram."
|
|
191
|
+
));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const useStyles = makeStyles(
|
|
195
|
+
{
|
|
196
|
+
root: {
|
|
197
|
+
height: "100%",
|
|
198
|
+
maxHeight: "100%",
|
|
199
|
+
minHeight: 0
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{ name: "ExploreGroupsContent" }
|
|
203
|
+
);
|
|
204
|
+
const GroupsExplorerContent = (props) => {
|
|
205
|
+
var _a;
|
|
206
|
+
const classes = useStyles();
|
|
207
|
+
return /* @__PURE__ */ React.createElement(Content, { noPadding: true, stretch: true, className: classes.root }, /* @__PURE__ */ React.createElement(ContentHeader, { title: (_a = props.title) != null ? _a : "Groups" }, /* @__PURE__ */ React.createElement(SupportButton, null, "Explore your groups.")), /* @__PURE__ */ React.createElement(GroupsDiagram, { direction: props.direction }));
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export { GroupsExplorerContent as G };
|
|
211
|
+
//# sourceMappingURL=GroupsExplorerContent-D_QfaGTY.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupsExplorerContent-D_QfaGTY.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';\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}) {\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 return catalogApi.getEntities({\n filter: {\n kind: ['Group'],\n },\n });\n }, [catalogApi]);\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 nodes.push({\n id: stringifyEntityRef(catalogItem),\n kind: catalogItem.kind,\n name: '',\n });\n\n // Edge to parent\n const catalogItemRelations_childOf = getEntityRelations(\n catalogItem,\n RELATION_CHILD_OF,\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}) => {\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 direction={props.direction} />\n </Content>\n );\n};\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;AA0CA,MAAMA,WAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,KAAO,EAAA;AAAA,MACL,SAAW,EAAA,MAAA;AAAA,MACX,IAAM,EAAA,CAAA;AAAA,KACR;AAAA,IACA,YAAc,EAAA;AAAA,MACZ,OAAS,EAAA,MAAA;AAAA,MACT,MAAQ,EAAA,MAAA;AAAA,KACV;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,IAAA,EAAM,KAAM,CAAA,OAAA,CAAQ,SAAU,CAAA,KAAA;AAAA,MAC9B,MAAA,EAAQ,KAAM,CAAA,OAAA,CAAQ,SAAU,CAAA,KAAA;AAAA,KAClC;AAAA,IACA,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,KAAM,CAAA,OAAA,CAAQ,OAAQ,CAAA,KAAA;AAAA,MAC5B,MAAA,EAAQ,KAAM,CAAA,OAAA,CAAQ,OAAQ,CAAA,KAAA;AAAA,KAChC;AAAA,IACA,eAAiB,EAAA;AAAA,MACf,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A,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,KAGhC,KAAA;AAxCN,EAAA,IAAA,EAAA,CAAA;AAyCE,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAE1B,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,SAAA,EAAS,IAAC,EAAA,OAAA,EAAO,IAAC,EAAA,SAAA,EAAW,OAAQ,CAAA,IAAA,EAAA,kBAC3C,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,EAAc,KAAO,EAAA,CAAA,EAAA,GAAA,KAAA,CAAM,UAAN,IAAe,GAAA,EAAA,GAAA,QAAA,EAAA,kBAClC,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAA,EAAc,sBAAoB,CACrC,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,SAAA,EAAW,KAAM,CAAA,SAAA,EAAW,CAC7C,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import useAsync from 'react-use/esm/useAsync';
|
|
3
|
+
import Box from '@material-ui/core/Box';
|
|
4
|
+
import Card from '@material-ui/core/Card';
|
|
5
|
+
import CardActions from '@material-ui/core/CardActions';
|
|
6
|
+
import CardContent from '@material-ui/core/CardContent';
|
|
7
|
+
import CardMedia from '@material-ui/core/CardMedia';
|
|
8
|
+
import Chip from '@material-ui/core/Chip';
|
|
9
|
+
import Typography from '@material-ui/core/Typography';
|
|
10
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
11
|
+
import { LinkButton, Content, ContentHeader, SupportButton, Progress, WarningPanel, EmptyState, ItemCardGrid } from '@backstage/core-components';
|
|
12
|
+
import classNames from 'classnames';
|
|
13
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
14
|
+
import '@backstage/errors';
|
|
15
|
+
import { e as exploreApiRef } from './index-DrIeHaZd.esm.js';
|
|
16
|
+
|
|
17
|
+
const useStyles = makeStyles(
|
|
18
|
+
(theme) => ({
|
|
19
|
+
media: {
|
|
20
|
+
height: 128
|
|
21
|
+
},
|
|
22
|
+
mediaContain: {
|
|
23
|
+
backgroundSize: "contain"
|
|
24
|
+
},
|
|
25
|
+
lifecycle: {
|
|
26
|
+
lineHeight: "0.8em",
|
|
27
|
+
color: theme.palette.common.white
|
|
28
|
+
},
|
|
29
|
+
ga: {
|
|
30
|
+
backgroundColor: theme.palette.status.ok
|
|
31
|
+
},
|
|
32
|
+
alpha: {
|
|
33
|
+
backgroundColor: theme.palette.status.error
|
|
34
|
+
},
|
|
35
|
+
beta: {
|
|
36
|
+
backgroundColor: theme.palette.status.warning
|
|
37
|
+
}
|
|
38
|
+
}),
|
|
39
|
+
{
|
|
40
|
+
name: "ExploreToolCard"
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
const ToolCard = ({ card, objectFit }) => {
|
|
44
|
+
const classes = useStyles();
|
|
45
|
+
const { title, description, url, image, lifecycle, tags } = card;
|
|
46
|
+
return /* @__PURE__ */ React.createElement(Card, { key: title }, /* @__PURE__ */ React.createElement(
|
|
47
|
+
CardMedia,
|
|
48
|
+
{
|
|
49
|
+
image,
|
|
50
|
+
title,
|
|
51
|
+
className: classNames(classes.media, {
|
|
52
|
+
[classes.mediaContain]: objectFit === "contain"
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
), /* @__PURE__ */ React.createElement(CardContent, null, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, title, " ", lifecycle && lifecycle.toLocaleLowerCase("en-US") !== "ga" && /* @__PURE__ */ React.createElement(
|
|
56
|
+
Chip,
|
|
57
|
+
{
|
|
58
|
+
size: "small",
|
|
59
|
+
label: lifecycle,
|
|
60
|
+
className: classNames(
|
|
61
|
+
classes.lifecycle,
|
|
62
|
+
classes[lifecycle.toLocaleLowerCase("en-US")]
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
)), /* @__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
|
+
};
|
|
67
|
+
|
|
68
|
+
const Body = () => {
|
|
69
|
+
const exploreApi = useApi(exploreApiRef);
|
|
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-DzMkzhod.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolExplorerContent-DzMkzhod.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,IAA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AA,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;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { G as GroupsExplorerContent } from './GroupsExplorerContent-D_QfaGTY.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-B_Dn9qT_.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-B_Dn9qT_.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useOutlet } from 'react-router-dom';
|
|
3
|
+
import { a as ExploreLayout, C as CatalogKindExploreContent } from './index-DrIeHaZd.esm.js';
|
|
4
|
+
import { G as GroupsExplorerContent } from './GroupsExplorerContent-D_QfaGTY.esm.js';
|
|
5
|
+
import { T as ToolExplorerContent } from './ToolExplorerContent-DzMkzhod.esm.js';
|
|
6
|
+
import { useApi, configApiRef } from '@backstage/core-plugin-api';
|
|
7
|
+
import '@backstage/errors';
|
|
8
|
+
import '@backstage/plugin-catalog-react';
|
|
9
|
+
import '@material-ui/core/Button';
|
|
10
|
+
import 'react-use/esm/useAsync';
|
|
11
|
+
import '@backstage/catalog-model';
|
|
12
|
+
import '@material-ui/core/Box';
|
|
13
|
+
import '@material-ui/core/Card';
|
|
14
|
+
import '@material-ui/core/CardActions';
|
|
15
|
+
import '@material-ui/core/CardContent';
|
|
16
|
+
import '@material-ui/core/CardMedia';
|
|
17
|
+
import '@material-ui/core/Chip';
|
|
18
|
+
import '@backstage/core-components';
|
|
19
|
+
import 'pluralize';
|
|
20
|
+
import '@backstage-community/plugin-explore-react';
|
|
21
|
+
import '@backstage/plugin-search-react';
|
|
22
|
+
import '@material-ui/core/Typography';
|
|
23
|
+
import '@material-ui/core/styles';
|
|
24
|
+
import '@material-ui/icons/ZoomOutMap';
|
|
25
|
+
import 'classnames';
|
|
26
|
+
|
|
27
|
+
const DefaultExplorePage = () => {
|
|
28
|
+
var _a;
|
|
29
|
+
const configApi = useApi(configApiRef);
|
|
30
|
+
const organizationName = (_a = configApi.getOptionalString("organization.name")) != null ? _a : "Backstage";
|
|
31
|
+
return /* @__PURE__ */ React.createElement(
|
|
32
|
+
ExploreLayout,
|
|
33
|
+
{
|
|
34
|
+
title: `Explore the ${organizationName} ecosystem`,
|
|
35
|
+
subtitle: "Discover solutions available in your ecosystem"
|
|
36
|
+
},
|
|
37
|
+
/* @__PURE__ */ React.createElement(ExploreLayout.Route, { path: "domains", title: "Domains" }, /* @__PURE__ */ React.createElement(CatalogKindExploreContent, { kind: "domain" })),
|
|
38
|
+
/* @__PURE__ */ React.createElement(ExploreLayout.Route, { path: "groups", title: "Groups" }, /* @__PURE__ */ React.createElement(GroupsExplorerContent, null)),
|
|
39
|
+
/* @__PURE__ */ React.createElement(ExploreLayout.Route, { path: "tools", title: "Tools" }, /* @__PURE__ */ React.createElement(ToolExplorerContent, null))
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const ExplorePage = () => {
|
|
44
|
+
const outlet = useOutlet();
|
|
45
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, outlet || /* @__PURE__ */ React.createElement(DefaultExplorePage, null));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { ExplorePage };
|
|
49
|
+
//# sourceMappingURL=index-CeOO34TY.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CeOO34TY.esm.js","sources":["../../src/components/DefaultExplorePage/DefaultExplorePage.tsx","../../src/components/ExplorePage/ExplorePage.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 { ExploreLayout } from '../ExploreLayout';\nimport { GroupsExplorerContent } from '../GroupsExplorerContent';\nimport { ToolExplorerContent } from '../ToolExplorerContent';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { CatalogKindExploreContent } from '../CatalogKindExploreContent';\n\nexport const DefaultExplorePage = () => {\n const configApi = useApi(configApiRef);\n const organizationName =\n configApi.getOptionalString('organization.name') ?? 'Backstage';\n\n return (\n <ExploreLayout\n title={`Explore the ${organizationName} ecosystem`}\n subtitle=\"Discover solutions available in your ecosystem\"\n >\n <ExploreLayout.Route path=\"domains\" title=\"Domains\">\n <CatalogKindExploreContent kind=\"domain\" />\n </ExploreLayout.Route>\n <ExploreLayout.Route path=\"groups\" title=\"Groups\">\n <GroupsExplorerContent />\n </ExploreLayout.Route>\n <ExploreLayout.Route path=\"tools\" title=\"Tools\">\n <ToolExplorerContent />\n </ExploreLayout.Route>\n </ExploreLayout>\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 { useOutlet } from 'react-router-dom';\nimport { DefaultExplorePage } from '../DefaultExplorePage';\n\nexport const ExplorePage = () => {\n const outlet = useOutlet();\n\n return <>{outlet || <DefaultExplorePage />}</>;\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,MAAM,qBAAqB,MAAM;AAvBxC,EAAA,IAAA,EAAA,CAAA;AAwBE,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA,CAAA;AACrC,EAAA,MAAM,gBACJ,GAAA,CAAA,EAAA,GAAA,SAAA,CAAU,iBAAkB,CAAA,mBAAmB,MAA/C,IAAoD,GAAA,EAAA,GAAA,WAAA,CAAA;AAEtD,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,eAAe,gBAAgB,CAAA,UAAA,CAAA;AAAA,MACtC,QAAS,EAAA,gDAAA;AAAA,KAAA;AAAA,oBAER,KAAA,CAAA,aAAA,CAAA,aAAA,CAAc,KAAd,EAA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