@backstage-community/plugin-explore 0.5.1 → 0.5.3
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-C1mPWDBy.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-DYsdAbPv.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-DVV7rT2y.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 +25 -16
- package/dist/esm/GroupsExplorerContent-DYsdAbPv.esm.js.map +0 -1
- package/dist/esm/ToolExplorerContent-DVV7rT2y.esm.js.map +0 -1
- package/dist/esm/index-B7El91b_.esm.js +0 -12
- package/dist/esm/index-B7El91b_.esm.js.map +0 -1
- package/dist/esm/index-Bszm73rW.esm.js +0 -23
- package/dist/esm/index-Bszm73rW.esm.js.map +0 -1
- package/dist/esm/index-C1mPWDBy.esm.js.map +0 -1
- package/dist/esm/index-CppE5yWh.esm.js +0 -280
- package/dist/esm/index-CppE5yWh.esm.js.map +0 -1
- package/dist/esm/index-Cz8p9vYj.esm.js.map +0 -1
- package/dist/esm/index-DjM1irR9.esm.js +0 -49
- package/dist/esm/index-DjM1irR9.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @backstage-community/plugin-explore
|
|
2
2
|
|
|
3
|
+
## 0.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5541765: Add missing dependency on `@backstage/catalog-client`
|
|
8
|
+
|
|
9
|
+
## 0.5.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 2173f7d: version:bump to v1.29.1
|
|
14
|
+
- Updated dependencies [2173f7d]
|
|
15
|
+
- @backstage-community/plugin-explore-common@0.0.4
|
|
16
|
+
- @backstage-community/plugin-explore-react@0.0.40
|
|
17
|
+
|
|
3
18
|
## 0.5.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/alpha/package.json
CHANGED
package/dist/alpha.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createSearchResultListItemExtension } from '@backstage/plugin-search-re
|
|
|
3
3
|
|
|
4
4
|
const exploreSearchResultListItem = createSearchResultListItemExtension({
|
|
5
5
|
predicate: (result) => result.type === "tools",
|
|
6
|
-
component: () => import('./
|
|
6
|
+
component: () => import('./components/ToolSearchResultListItem/index.esm.js').then(
|
|
7
7
|
(m) => m.ToolSearchResultListItem
|
|
8
8
|
)
|
|
9
9
|
});
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +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,
|
|
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,oDAAuC,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 @@
|
|
|
1
|
+
{"version":3,"file":"ExploreApi.esm.js","sources":["../../src/api/ExploreApi.ts"],"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 { createApiRef } from '@backstage/core-plugin-api';\nimport {\n GetExploreToolsRequest,\n GetExploreToolsResponse,\n} from '@backstage-community/plugin-explore-common';\n\n/**\n * Interface for the explore plugin.\n *\n * @public\n */\nexport interface ExploreApi {\n /**\n * Returns a list of explore tools.\n *\n * @param request - The request query options\n */\n getTools(request?: GetExploreToolsRequest): Promise<GetExploreToolsResponse>;\n}\n\n/**\n * @public\n */\nexport const exploreApiRef = createApiRef<ExploreApi>({\n id: 'plugin.explore.service',\n});\n"],"names":[],"mappings":";;AAuCO,MAAM,gBAAgB,YAAyB,CAAA;AAAA,EACpD,EAAI,EAAA,wBAAA;AACN,CAAC;;;;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ResponseError } from '@backstage/errors';
|
|
2
|
+
|
|
3
|
+
class ExploreClient {
|
|
4
|
+
discoveryApi;
|
|
5
|
+
fetchApi;
|
|
6
|
+
// NOTE: This will be removed in the future as it is replaced by the ExploreApi.getTools method
|
|
7
|
+
exploreToolsConfig;
|
|
8
|
+
/**
|
|
9
|
+
* @remarks
|
|
10
|
+
*
|
|
11
|
+
* The `exploreToolsConfig` is for backwards compatibility with the `exploreToolsConfigRef`•
|
|
12
|
+
* and will be removed in the future.
|
|
13
|
+
*/
|
|
14
|
+
constructor(options) {
|
|
15
|
+
this.discoveryApi = options.discoveryApi;
|
|
16
|
+
this.fetchApi = options.fetchApi;
|
|
17
|
+
this.exploreToolsConfig = options.exploreToolsConfig;
|
|
18
|
+
}
|
|
19
|
+
async getTools(request = {}) {
|
|
20
|
+
if (this.exploreToolsConfig) {
|
|
21
|
+
const tools = await this.exploreToolsConfig.getTools();
|
|
22
|
+
if (tools) {
|
|
23
|
+
return { tools };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const { fetch } = this.fetchApi;
|
|
27
|
+
const filter = request.filter ?? {};
|
|
28
|
+
const baseUrl = await this.discoveryApi.getBaseUrl("explore");
|
|
29
|
+
const tags = filter?.tags?.map((t) => `tag=${encodeURIComponent(t)}`) ?? [];
|
|
30
|
+
const lifecycles = filter?.lifecycle?.map((l) => `lifecycle=${encodeURIComponent(l)}`) ?? [];
|
|
31
|
+
const query = [...tags, ...lifecycles].join("&");
|
|
32
|
+
const response = await fetch(`${baseUrl}/tools${query ? `?${query}` : ""}`);
|
|
33
|
+
if (!response.ok) {
|
|
34
|
+
throw await ResponseError.fromResponse(response);
|
|
35
|
+
}
|
|
36
|
+
return response.json();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { ExploreClient };
|
|
41
|
+
//# sourceMappingURL=ExploreClient.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExploreClient.esm.js","sources":["../../src/api/ExploreClient.ts"],"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 { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport {\n GetExploreToolsRequest,\n GetExploreToolsResponse,\n} from '@backstage-community/plugin-explore-common';\nimport { ExploreToolsConfig } from '@backstage-community/plugin-explore-react';\nimport { ExploreApi } from './ExploreApi';\n\n/**\n * Default implementation of the {@link ExploreApi}.\n *\n * @public\n */\nexport class ExploreClient implements ExploreApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n // NOTE: This will be removed in the future as it is replaced by the ExploreApi.getTools method\n private readonly exploreToolsConfig: ExploreToolsConfig | undefined;\n\n /**\n * @remarks\n *\n * The `exploreToolsConfig` is for backwards compatibility with the `exploreToolsConfigRef`•\n * and will be removed in the future.\n */\n constructor(options: {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n exploreToolsConfig?: ExploreToolsConfig;\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n this.exploreToolsConfig = options.exploreToolsConfig;\n }\n\n async getTools(\n request: GetExploreToolsRequest = {},\n ): Promise<GetExploreToolsResponse> {\n // NOTE: This will be removed in the future as it is replaced by the ExploreApi.getTools method\n if (this.exploreToolsConfig) {\n const tools = await this.exploreToolsConfig.getTools();\n if (tools) {\n return { tools };\n }\n }\n\n const { fetch } = this.fetchApi;\n\n const filter = request.filter ?? {};\n const baseUrl = await this.discoveryApi.getBaseUrl('explore');\n\n const tags = filter?.tags?.map(t => `tag=${encodeURIComponent(t)}`) ?? [];\n const lifecycles =\n filter?.lifecycle?.map(l => `lifecycle=${encodeURIComponent(l)}`) ?? [];\n const query = [...tags, ...lifecycles].join('&');\n\n const response = await fetch(`${baseUrl}/tools${query ? `?${query}` : ''}`);\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return response.json() as Promise<GetExploreToolsResponse>;\n }\n}\n"],"names":[],"mappings":";;AA8BO,MAAM,aAAoC,CAAA;AAAA,EAC9B,YAAA,CAAA;AAAA,EACA,QAAA,CAAA;AAAA;AAAA,EAEA,kBAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQjB,YAAY,OAIT,EAAA;AACD,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,YAAA,CAAA;AAC5B,IAAA,IAAA,CAAK,WAAW,OAAQ,CAAA,QAAA,CAAA;AACxB,IAAA,IAAA,CAAK,qBAAqB,OAAQ,CAAA,kBAAA,CAAA;AAAA,GACpC;AAAA,EAEA,MAAM,QAAA,CACJ,OAAkC,GAAA,EACA,EAAA;AAElC,IAAA,IAAI,KAAK,kBAAoB,EAAA;AAC3B,MAAA,MAAM,KAAQ,GAAA,MAAM,IAAK,CAAA,kBAAA,CAAmB,QAAS,EAAA,CAAA;AACrD,MAAA,IAAI,KAAO,EAAA;AACT,QAAA,OAAO,EAAE,KAAM,EAAA,CAAA;AAAA,OACjB;AAAA,KACF;AAEA,IAAM,MAAA,EAAE,KAAM,EAAA,GAAI,IAAK,CAAA,QAAA,CAAA;AAEvB,IAAM,MAAA,MAAA,GAAS,OAAQ,CAAA,MAAA,IAAU,EAAC,CAAA;AAClC,IAAA,MAAM,OAAU,GAAA,MAAM,IAAK,CAAA,YAAA,CAAa,WAAW,SAAS,CAAA,CAAA;AAE5D,IAAM,MAAA,IAAA,GAAO,MAAQ,EAAA,IAAA,EAAM,GAAI,CAAA,CAAA,CAAA,KAAK,CAAO,IAAA,EAAA,kBAAA,CAAmB,CAAC,CAAC,CAAE,CAAA,CAAA,IAAK,EAAC,CAAA;AACxE,IAAM,MAAA,UAAA,GACJ,MAAQ,EAAA,SAAA,EAAW,GAAI,CAAA,CAAA,CAAA,KAAK,CAAa,UAAA,EAAA,kBAAA,CAAmB,CAAC,CAAC,CAAE,CAAA,CAAA,IAAK,EAAC,CAAA;AACxE,IAAM,MAAA,KAAA,GAAQ,CAAC,GAAG,IAAA,EAAM,GAAG,UAAU,CAAA,CAAE,KAAK,GAAG,CAAA,CAAA;AAE/C,IAAM,MAAA,QAAA,GAAW,MAAM,KAAA,CAAM,CAAG,EAAA,OAAO,CAAS,MAAA,EAAA,KAAA,GAAQ,CAAI,CAAA,EAAA,KAAK,CAAK,CAAA,GAAA,EAAE,CAAE,CAAA,CAAA,CAAA;AAE1E,IAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,MAAM,MAAA,MAAM,aAAc,CAAA,YAAA,CAAa,QAAQ,CAAA,CAAA;AAAA,KACjD;AAEA,IAAA,OAAO,SAAS,IAAK,EAAA,CAAA;AAAA,GACvB;AACF;;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
|
2
|
+
import Button from '@material-ui/core/Button';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import useAsync from 'react-use/esm/useAsync';
|
|
5
|
+
import { EntityCard } from '../EntityCard/EntityCard.esm.js';
|
|
6
|
+
import { Content, ContentHeader, SupportButton, Progress, WarningPanel, EmptyState, ItemCardGrid } from '@backstage/core-components';
|
|
7
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
8
|
+
import pluralize from 'pluralize';
|
|
9
|
+
|
|
10
|
+
const Body = (props) => {
|
|
11
|
+
const { kind } = props;
|
|
12
|
+
const kindPlural = pluralize(kind);
|
|
13
|
+
const catalogApi = useApi(catalogApiRef);
|
|
14
|
+
const {
|
|
15
|
+
value: entities,
|
|
16
|
+
loading,
|
|
17
|
+
error
|
|
18
|
+
} = useAsync(async () => {
|
|
19
|
+
const response = await catalogApi.getEntities({
|
|
20
|
+
filter: { kind }
|
|
21
|
+
});
|
|
22
|
+
return response.items;
|
|
23
|
+
}, [kind]);
|
|
24
|
+
if (loading) {
|
|
25
|
+
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
26
|
+
}
|
|
27
|
+
if (error) {
|
|
28
|
+
return /* @__PURE__ */ React.createElement(WarningPanel, { severity: "error", title: `Could not load ${kindPlural}.` }, error.message);
|
|
29
|
+
}
|
|
30
|
+
if (!entities?.length) {
|
|
31
|
+
return /* @__PURE__ */ React.createElement(
|
|
32
|
+
EmptyState,
|
|
33
|
+
{
|
|
34
|
+
missing: "info",
|
|
35
|
+
title: `No ${kindPlural} to display`,
|
|
36
|
+
description: `You haven't added any ${kindPlural} yet.`,
|
|
37
|
+
action: /* @__PURE__ */ React.createElement(
|
|
38
|
+
Button,
|
|
39
|
+
{
|
|
40
|
+
variant: "contained",
|
|
41
|
+
color: "primary",
|
|
42
|
+
href: `https://backstage.io/docs/features/software-catalog/descriptor-format#kind-${kind}`
|
|
43
|
+
},
|
|
44
|
+
"Read more"
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ React.createElement(ItemCardGrid, null, entities.map((entity, index) => /* @__PURE__ */ React.createElement(EntityCard, { key: index, entity })));
|
|
50
|
+
};
|
|
51
|
+
const CatalogKindExploreContent = (props) => {
|
|
52
|
+
const { kind, title } = props;
|
|
53
|
+
const kindLowercase = kind.toLocaleLowerCase();
|
|
54
|
+
const kindCapitalized = `${kind[0].toLocaleUpperCase()}${kind.substring(1)}`;
|
|
55
|
+
return /* @__PURE__ */ React.createElement(Content, { noPadding: true }, /* @__PURE__ */ React.createElement(ContentHeader, { title: title || `${pluralize(kindCapitalized)}` }, /* @__PURE__ */ React.createElement(SupportButton, null, /* @__PURE__ */ React.createElement(React.Fragment, null, "Discover the ", pluralize(kindLowercase), " in your ecosystem."))), /* @__PURE__ */ React.createElement(Body, { kind: kindLowercase }));
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { CatalogKindExploreContent };
|
|
59
|
+
//# sourceMappingURL=CatalogKindExploreContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CatalogKindExploreContent.esm.js","sources":["../../../src/components/CatalogKindExploreContent/CatalogKindExploreContent.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 { Entity } 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 { EntityCard } from '../EntityCard';\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 pluralize from 'pluralize';\n\nconst Body = (props: { kind: string }) => {\n const { kind } = props;\n const kindPlural = pluralize(kind);\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 },\n });\n return response.items as Entity[];\n }, [kind]);\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n return (\n <WarningPanel severity=\"error\" title={`Could not load ${kindPlural}.`}>\n {error.message}\n </WarningPanel>\n );\n }\n\n if (!entities?.length) {\n return (\n <EmptyState\n missing=\"info\"\n title={`No ${kindPlural} to display`}\n description={`You haven't added any ${kindPlural} yet.`}\n action={\n <Button\n variant=\"contained\"\n color=\"primary\"\n href={`https://backstage.io/docs/features/software-catalog/descriptor-format#kind-${kind}`}\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 CatalogKindExploreContent = (props: {\n title?: string;\n kind: string;\n}) => {\n const { kind, title } = props;\n const kindLowercase = kind.toLocaleLowerCase();\n const kindCapitalized = `${kind[0].toLocaleUpperCase()}${kind.substring(1)}`;\n return (\n <Content noPadding>\n <ContentHeader title={title || `${pluralize(kindCapitalized)}`}>\n <SupportButton>\n <>Discover the {pluralize(kindLowercase)} in your ecosystem.</>\n </SupportButton>\n </ContentHeader>\n <Body kind={kindLowercase} />\n </Content>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAkCA,MAAM,IAAA,GAAO,CAAC,KAA4B,KAAA;AACxC,EAAM,MAAA,EAAE,MAAS,GAAA,KAAA,CAAA;AACjB,EAAM,MAAA,UAAA,GAAa,UAAU,IAAI,CAAA,CAAA;AACjC,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,IAAK,EAAA;AAAA,KAChB,CAAA,CAAA;AACD,IAAA,OAAO,QAAS,CAAA,KAAA,CAAA;AAAA,GAClB,EAAG,CAAC,IAAI,CAAC,CAAA,CAAA;AAET,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,GACnB;AAEA,EAAA,IAAI,KAAO,EAAA;AACT,IACE,uBAAA,KAAA,CAAA,aAAA,CAAC,gBAAa,QAAS,EAAA,OAAA,EAAQ,OAAO,CA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A,EAAQ,SAAS,EAAA,IAAA,EAAA,kBACf,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,EAAc,KAAO,EAAA,KAAA,IAAS,CAAG,EAAA,SAAA,CAAU,eAAe,CAAC,CAC1D,CAAA,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,aACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAE,eAAc,EAAA,SAAA,CAAU,aAAa,CAAA,EAAE,qBAAmB,CAC9D,CACF,CAAA,kBACC,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAM,EAAA,aAAA,EAAe,CAC7B,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExploreLayout } from '../ExploreLayout/ExploreLayout.esm.js';
|
|
3
|
+
import { GroupsExplorerContent } from '../GroupsExplorerContent/GroupsExplorerContent.esm.js';
|
|
4
|
+
import { ToolExplorerContent } from '../ToolExplorerContent/ToolExplorerContent.esm.js';
|
|
5
|
+
import { useApi, configApiRef } from '@backstage/core-plugin-api';
|
|
6
|
+
import { CatalogKindExploreContent } from '../CatalogKindExploreContent/CatalogKindExploreContent.esm.js';
|
|
7
|
+
|
|
8
|
+
const DefaultExplorePage = () => {
|
|
9
|
+
const configApi = useApi(configApiRef);
|
|
10
|
+
const organizationName = configApi.getOptionalString("organization.name") ?? "Backstage";
|
|
11
|
+
return /* @__PURE__ */ React.createElement(
|
|
12
|
+
ExploreLayout,
|
|
13
|
+
{
|
|
14
|
+
title: `Explore the ${organizationName} ecosystem`,
|
|
15
|
+
subtitle: "Discover solutions available in your ecosystem"
|
|
16
|
+
},
|
|
17
|
+
/* @__PURE__ */ React.createElement(ExploreLayout.Route, { path: "domains", title: "Domains" }, /* @__PURE__ */ React.createElement(CatalogKindExploreContent, { kind: "domain" })),
|
|
18
|
+
/* @__PURE__ */ React.createElement(ExploreLayout.Route, { path: "groups", title: "Groups" }, /* @__PURE__ */ React.createElement(GroupsExplorerContent, null)),
|
|
19
|
+
/* @__PURE__ */ React.createElement(ExploreLayout.Route, { path: "tools", title: "Tools" }, /* @__PURE__ */ React.createElement(ToolExplorerContent, null))
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { DefaultExplorePage };
|
|
24
|
+
//# sourceMappingURL=DefaultExplorePage.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultExplorePage.esm.js","sources":["../../../src/components/DefaultExplorePage/DefaultExplorePage.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"],"names":[],"mappings":";;;;;;;AAuBO,MAAM,qBAAqB,MAAM;AACtC,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA,CAAA;AACrC,EAAA,MAAM,gBACJ,GAAA,SAAA,CAAU,iBAAkB,CAAA,mBAAmB,CAAK,IAAA,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,EAAA,EAAoB,IAAK,EAAA,SAAA,EAAU,KAAM,EAAA,SAAA,EAAA,kBACvC,KAAA,CAAA,aAAA,CAAA,yBAAA,EAAA,EAA0B,IAAK,EAAA,QAAA,EAAS,CAC3C,CAAA;AAAA,oBACA,KAAA,CAAA,aAAA,CAAC,aAAc,CAAA,KAAA,EAAd,EAAoB,IAAA,EAAK,UAAS,KAAM,EAAA,QAAA,EAAA,kBACtC,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,IAAsB,CACzB,CAAA;AAAA,oBACA,KAAA,CAAA,aAAA,CAAC,aAAc,CAAA,KAAA,EAAd,EAAoB,IAAA,EAAK,SAAQ,KAAM,EAAA,OAAA,EAAA,kBACrC,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,IAAoB,CACvB,CAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { RELATION_OWNED_BY } from '@backstage/catalog-model';
|
|
2
|
+
import { entityRouteRef, getEntityRelations, entityRouteParams, EntityRefLinks } from '@backstage/plugin-catalog-react';
|
|
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 React from 'react';
|
|
10
|
+
import { ItemCardHeader, LinkButton } from '@backstage/core-components';
|
|
11
|
+
import { useRouteRef } from '@backstage/core-plugin-api';
|
|
12
|
+
|
|
13
|
+
const DomainCard = (props) => {
|
|
14
|
+
const { entity } = props;
|
|
15
|
+
const catalogEntityRoute = useRouteRef(entityRouteRef);
|
|
16
|
+
const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);
|
|
17
|
+
const url = catalogEntityRoute(entityRouteParams(entity));
|
|
18
|
+
const owner = /* @__PURE__ */ React.createElement(
|
|
19
|
+
EntityRefLinks,
|
|
20
|
+
{
|
|
21
|
+
entityRefs: ownedByRelations,
|
|
22
|
+
defaultKind: "group",
|
|
23
|
+
color: "inherit"
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
return /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardMedia, null, /* @__PURE__ */ React.createElement(
|
|
27
|
+
ItemCardHeader,
|
|
28
|
+
{
|
|
29
|
+
title: entity.metadata.title ?? entity.metadata.name,
|
|
30
|
+
subtitle: owner
|
|
31
|
+
}
|
|
32
|
+
)), /* @__PURE__ */ React.createElement(CardContent, null, entity.metadata.tags?.length ? /* @__PURE__ */ React.createElement(Box, null, entity.metadata.tags.map((tag) => /* @__PURE__ */ React.createElement(Chip, { size: "small", label: tag, key: tag }))) : null, entity.metadata.description), /* @__PURE__ */ React.createElement(CardActions, null, /* @__PURE__ */ React.createElement(LinkButton, { to: url, color: "primary" }, "Explore")));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { DomainCard };
|
|
36
|
+
//# sourceMappingURL=DomainCard.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DomainCard.esm.js","sources":["../../../src/components/DomainCard/DomainCard.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, RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport {\n EntityRefLinks,\n entityRouteParams,\n getEntityRelations,\n entityRouteRef,\n} from '@backstage/plugin-catalog-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 React from 'react';\n\nimport { LinkButton, ItemCardHeader } from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\n\n/** @public */\nexport const DomainCard = (props: { entity: DomainEntity }) => {\n const { entity } = props;\n\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n const url = catalogEntityRoute(entityRouteParams(entity));\n\n const owner = (\n <EntityRefLinks\n entityRefs={ownedByRelations}\n defaultKind=\"group\"\n color=\"inherit\"\n />\n );\n\n return (\n <Card>\n <CardMedia>\n <ItemCardHeader\n title={entity.metadata.title ?? entity.metadata.name}\n subtitle={owner}\n />\n </CardMedia>\n <CardContent>\n {entity.metadata.tags?.length ? (\n <Box>\n {entity.metadata.tags.map(tag => (\n <Chip size=\"small\" label={tag} key={tag} />\n ))}\n </Box>\n ) : null}\n {entity.metadata.description}\n </CardContent>\n <CardActions>\n <LinkButton to={url} color=\"primary\">\n Explore\n </LinkButton>\n </CardActions>\n </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A,CAAA,aAAA,CAAC,cAAW,EAAI,EAAA,GAAA,EAAK,OAAM,SAAU,EAAA,EAAA,SAErC,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -4,18 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import useAsync from 'react-use/esm/useAsync';
|
|
5
5
|
import { Content, ContentHeader, SupportButton, Progress, WarningPanel, EmptyState, ItemCardGrid } from '@backstage/core-components';
|
|
6
6
|
import { useApi } from '@backstage/core-plugin-api';
|
|
7
|
-
import {
|
|
8
|
-
import '@backstage/errors';
|
|
9
|
-
import '@backstage/catalog-model';
|
|
10
|
-
import '@material-ui/core/Box';
|
|
11
|
-
import '@material-ui/core/Card';
|
|
12
|
-
import '@material-ui/core/CardActions';
|
|
13
|
-
import '@material-ui/core/CardContent';
|
|
14
|
-
import '@material-ui/core/CardMedia';
|
|
15
|
-
import '@material-ui/core/Chip';
|
|
16
|
-
import 'pluralize';
|
|
17
|
-
import '@backstage-community/plugin-explore-react';
|
|
18
|
-
import '@backstage/plugin-search-react';
|
|
7
|
+
import { EntityCard } from '../EntityCard/EntityCard.esm.js';
|
|
19
8
|
|
|
20
9
|
const Body = () => {
|
|
21
10
|
const catalogApi = useApi(catalogApiRef);
|
|
@@ -35,7 +24,7 @@ const Body = () => {
|
|
|
35
24
|
if (error) {
|
|
36
25
|
return /* @__PURE__ */ React.createElement(WarningPanel, { severity: "error", title: "Could not load domains." }, error.message);
|
|
37
26
|
}
|
|
38
|
-
if (!
|
|
27
|
+
if (!entities?.length) {
|
|
39
28
|
return /* @__PURE__ */ React.createElement(
|
|
40
29
|
EmptyState,
|
|
41
30
|
{
|
|
@@ -57,9 +46,8 @@ const Body = () => {
|
|
|
57
46
|
return /* @__PURE__ */ React.createElement(ItemCardGrid, null, entities.map((entity, index) => /* @__PURE__ */ React.createElement(EntityCard, { key: index, entity })));
|
|
58
47
|
};
|
|
59
48
|
const DomainExplorerContent = (props) => {
|
|
60
|
-
|
|
61
|
-
return /* @__PURE__ */ React.createElement(Content, { noPadding: true }, /* @__PURE__ */ React.createElement(ContentHeader, { title: (_a = props.title) != null ? _a : "Domains" }, /* @__PURE__ */ React.createElement(SupportButton, null, "Discover the domains in your ecosystem.")), /* @__PURE__ */ React.createElement(Body, null));
|
|
49
|
+
return /* @__PURE__ */ React.createElement(Content, { noPadding: true }, /* @__PURE__ */ React.createElement(ContentHeader, { title: props.title ?? "Domains" }, /* @__PURE__ */ React.createElement(SupportButton, null, "Discover the domains in your ecosystem.")), /* @__PURE__ */ React.createElement(Body, null));
|
|
62
50
|
};
|
|
63
51
|
|
|
64
52
|
export { DomainExplorerContent };
|
|
65
|
-
//# sourceMappingURL=
|
|
53
|
+
//# sourceMappingURL=DomainExplorerContent.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DomainExplorerContent.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;AAEf,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,GACnB;AAEA,EAAA,IAAI,KAAO,EAAA;AACT,IAAA,2CACG,YAAa,EAAA,EAAA,QAAA,E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stage/catalog-model';
|
|
2
|
+
import { entityRouteRef, getEntityRelations, entityRouteParams, EntityRefLinks } from '@backstage/plugin-catalog-react';
|
|
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 React from 'react';
|
|
10
|
+
import { ItemCardHeader, LinkButton } from '@backstage/core-components';
|
|
11
|
+
import { useRouteRef } from '@backstage/core-plugin-api';
|
|
12
|
+
|
|
13
|
+
const EntityCard = (props) => {
|
|
14
|
+
const { entity } = props;
|
|
15
|
+
const catalogEntityRoute = useRouteRef(entityRouteRef);
|
|
16
|
+
const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);
|
|
17
|
+
const url = catalogEntityRoute(entityRouteParams(entity));
|
|
18
|
+
const owner = /* @__PURE__ */ React.createElement(
|
|
19
|
+
EntityRefLinks,
|
|
20
|
+
{
|
|
21
|
+
entityRefs: ownedByRelations,
|
|
22
|
+
defaultKind: "group",
|
|
23
|
+
color: "inherit"
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
return /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(CardMedia, null, /* @__PURE__ */ React.createElement(
|
|
27
|
+
ItemCardHeader,
|
|
28
|
+
{
|
|
29
|
+
title: entity.metadata.title ?? entity.metadata.name,
|
|
30
|
+
subtitle: owner
|
|
31
|
+
}
|
|
32
|
+
)), /* @__PURE__ */ React.createElement(CardContent, null, entity.metadata.tags?.length ? /* @__PURE__ */ React.createElement(Box, null, entity.metadata.tags.map((tag) => /* @__PURE__ */ React.createElement(Chip, { size: "small", label: tag, key: tag }))) : null, entity.metadata.description), /* @__PURE__ */ React.createElement(CardActions, null, /* @__PURE__ */ React.createElement(LinkButton, { to: url, color: "primary" }, "Explore")));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { EntityCard };
|
|
36
|
+
//# sourceMappingURL=EntityCard.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityCard.esm.js","sources":["../../../src/components/EntityCard/EntityCard.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 { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport {\n EntityRefLinks,\n entityRouteParams,\n getEntityRelations,\n entityRouteRef,\n} from '@backstage/plugin-catalog-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 React from 'react';\n\nimport { LinkButton, ItemCardHeader } from '@backstage/core-components';\nimport { useRouteRef } from '@backstage/core-plugin-api';\n\n/** @public */\nexport const EntityCard = (props: { entity: Entity }) => {\n const { entity } = props;\n\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n const url = catalogEntityRoute(entityRouteParams(entity));\n\n const owner = (\n <EntityRefLinks\n entityRefs={ownedByRelations}\n defaultKind=\"group\"\n color=\"inherit\"\n />\n );\n\n return (\n <Card>\n <CardMedia>\n <ItemCardHeader\n title={entity.metadata.title ?? entity.metadata.name}\n subtitle={owner}\n />\n </CardMedia>\n <CardContent>\n {entity.metadata.tags?.length ? (\n <Box>\n {entity.metadata.tags.map(tag => (\n <Chip size=\"small\" label={tag} key={tag} />\n ))}\n </Box>\n ) : null}\n {entity.metadata.description}\n </CardContent>\n <CardActions>\n <LinkButton to={url} color=\"primary\">\n Explore\n </LinkButton>\n </CardActions>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAmCa,MAAA,UAAA,GAAa,CAAC,KAA8B,KAAA;AACvD,EAAM,MAAA,EAAE,QAAW,GAAA,KAAA,CAAA;AAEnB,EAAM,MAAA,kBAAA,GAAqB,YAAY,cAAc,CAAA,CAAA;AACrD,EAAM,MAAA,gBAAA,GAAmB,kBAAmB,CAAA,MAAA,EAAQ,iBAAiB,CAAA,CAAA;AACrE,EAAA,MAAM,GAAM,GAAA,kBAAA,CAAmB,iBAAkB,CAAA,MAAM,CAAC,CAAA,CAAA;AAExD,EAAA,MAAM,KACJ,mBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,gBAAA;AAAA,MACZ,WAAY,EAAA,OAAA;AAAA,MACZ,KAAM,EAAA,SAAA;AAAA,KAAA;AAAA,GACR,CAAA;AAGF,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,IACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,SACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,MAAA,CAAO,QAAS,CAAA,KAAA,IAAS,OAAO,QAAS,CAAA,IAAA;AAAA,MAChD,QAAU,EAAA,KAAA;AAAA,KAAA;AAAA,GAEd,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,mBACE,MAAO,CAAA,QAAA,CAAS,MAAM,MACrB,mBAAA,KAAA,CAAA,aAAA,CAAC,GACE,EAAA,IAAA,EAAA,MAAA,CAAO,SAAS,IAAK,CAAA,GAAA,CAAI,yBACvB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,MAAK,OAAQ,EAAA,KAAA,EAAO,GAAK,EAAA,GAAA,EAAK,KAAK,CAC1C,CACH,IACE,IACH,EAAA,MAAA,CAAO,SAAS,WACnB,CAAA,sCACC,WACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,EAAI,EAAA,GAAA,EAAK,OAAM,SAAU,EAAA,EAAA,SAErC,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Page, Header, RoutedTabs } from '@backstage/core-components';
|
|
2
|
+
import { attachComponentData, useElementFilter } from '@backstage/core-plugin-api';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
const dataKey = "plugin.explore.exploreLayoutRoute";
|
|
6
|
+
const Route = () => null;
|
|
7
|
+
attachComponentData(Route, dataKey, true);
|
|
8
|
+
attachComponentData(Route, "core.gatherMountPoints", true);
|
|
9
|
+
const ExploreLayout = (props) => {
|
|
10
|
+
const { title, subtitle, children } = props;
|
|
11
|
+
const routes = useElementFilter(
|
|
12
|
+
children,
|
|
13
|
+
(elements) => elements.selectByComponentData({
|
|
14
|
+
key: dataKey,
|
|
15
|
+
withStrictError: "Child of ExploreLayout must be an ExploreLayout.Route"
|
|
16
|
+
}).getElements().map((child) => child.props)
|
|
17
|
+
);
|
|
18
|
+
return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, /* @__PURE__ */ React.createElement(
|
|
19
|
+
Header,
|
|
20
|
+
{
|
|
21
|
+
title: title ?? "Explore our ecosystem",
|
|
22
|
+
subtitle: subtitle ?? "Discover solutions available in our ecosystem"
|
|
23
|
+
}
|
|
24
|
+
), /* @__PURE__ */ React.createElement(RoutedTabs, { routes }));
|
|
25
|
+
};
|
|
26
|
+
ExploreLayout.Route = Route;
|
|
27
|
+
|
|
28
|
+
export { ExploreLayout };
|
|
29
|
+
//# sourceMappingURL=ExploreLayout.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExploreLayout.esm.js","sources":["../../../src/components/ExploreLayout/ExploreLayout.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 { Header, Page, RoutedTabs } from '@backstage/core-components';\nimport {\n attachComponentData,\n useElementFilter,\n} from '@backstage/core-plugin-api';\nimport { TabProps } from '@material-ui/core/Tab';\nimport { default as React } from 'react';\n\n// TODO: This layout could be a shared based component if it was possible to create custom TabbedLayouts\n// A generalized version of createSubRoutesFromChildren, etc. would be required\n/** @public */\nexport type SubRoute = {\n path: string;\n title: string;\n children: JSX.Element;\n tabProps?: TabProps<React.ElementType, { component?: React.ElementType }>;\n};\n\nconst dataKey = 'plugin.explore.exploreLayoutRoute';\n\nconst Route: (props: SubRoute) => null = () => null;\nattachComponentData(Route, dataKey, true);\n\n// This causes all mount points that are discovered within this route to use the path of the route itself\nattachComponentData(Route, 'core.gatherMountPoints', true);\n\n/** @public */\nexport type ExploreLayoutProps = {\n title?: string;\n subtitle?: string;\n children?: React.ReactNode;\n};\n\n/**\n * Explore is a compound component, which allows you to define a custom layout\n *\n * @example\n * ```jsx\n * <ExploreLayout title=\"Explore ACME's ecosystem\">\n * <ExploreLayout.Route path=\"/example\" title=\"Example tab\">\n * <div>This is rendered under /example/anything-here route</div>\n * </ExploreLayout.Route>\n * </ExploreLayout>\n * ```\n *\n * @public\n */\nexport const ExploreLayout = (props: ExploreLayoutProps) => {\n const { title, subtitle, children } = props;\n\n const routes = useElementFilter(children, elements =>\n elements\n .selectByComponentData({\n key: dataKey,\n withStrictError:\n 'Child of ExploreLayout must be an ExploreLayout.Route',\n })\n .getElements<SubRoute>()\n .map(child => child.props),\n );\n\n return (\n <Page themeId=\"home\">\n <Header\n title={title ?? 'Explore our ecosystem'}\n subtitle={subtitle ?? 'Discover solutions available in our ecosystem'}\n />\n <RoutedTabs routes={routes} />\n </Page>\n );\n};\n\nExploreLayout.Route = Route;\n"],"names":[],"mappings":";;;;AAkCA,MAAM,OAAU,GAAA,mCAAA,CAAA;AAEhB,MAAM,QAAmC,MAAM,IAAA,CAAA;AAC/C,mBAAoB,CAAA,KAAA,EAAO,SAAS,IAAI,CAAA,CAAA;AAGxC,mBAAoB,CAAA,KAAA,EAAO,0BAA0B,IAAI,CAAA,CAAA;AAuB5C,MAAA,aAAA,GAAgB,CAAC,KAA8B,KAAA;AAC1D,EAAA,MAAM,EAAE,KAAA,EAAO,QAAU,EAAA,QAAA,EAAa,GAAA,KAAA,CAAA;AAEtC,EAAA,MAAM,MAAS,GAAA,gBAAA;AAAA,IAAiB,QAAA;AAAA,IAAU,CAAA,QAAA,KACxC,SACG,qBAAsB,CAAA;AAAA,MACrB,GAAK,EAAA,OAAA;AAAA,MACL,eACE,EAAA,uDAAA;AAAA,KACH,CACA,CAAA,WAAA,GACA,GAAI,CAAA,CAAA,KAAA,KAAS,MAAM,KAAK,CAAA;AAAA,GAC7B,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,OAAO,KAAS,IAAA,uBAAA;AAAA,MAChB,UAAU,QAAY,IAAA,+CAAA;AAAA,KAAA;AAAA,GAExB,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAW,EAAA,EAAA,MAAA,EAAgB,CAC9B,CAAA,CAAA;AAEJ,EAAA;AAEA,aAAA,CAAc,KAAQ,GAAA,KAAA;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useOutlet } from 'react-router-dom';
|
|
3
|
+
import { DefaultExplorePage } from '../DefaultExplorePage/DefaultExplorePage.esm.js';
|
|
4
|
+
|
|
5
|
+
const ExplorePage = () => {
|
|
6
|
+
const outlet = useOutlet();
|
|
7
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, outlet || /* @__PURE__ */ React.createElement(DefaultExplorePage, null));
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { ExplorePage };
|
|
11
|
+
//# sourceMappingURL=ExplorePage.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExplorePage.esm.js","sources":["../../../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 { 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":";;;;AAoBO,MAAM,cAAc,MAAM;AAC/B,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AAEzB,EAAA,uBAAU,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAA,MAAA,oBAAW,KAAA,CAAA,aAAA,CAAA,kBAAA,EAAA,IAAmB,CAAG,CAAA,CAAA;AAC7C;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { stringifyEntityRef, RELATION_CHILD_OF, parseEntityRef } from '@backstage/catalog-model';
|
|
3
|
-
import { Progress, ResponseErrorPanel, DependencyGraph, DependencyGraphTypes, Link
|
|
2
|
+
import { Progress, ResponseErrorPanel, DependencyGraph, DependencyGraphTypes, Link } from '@backstage/core-components';
|
|
4
3
|
import { useApi, configApiRef, useRouteRef } from '@backstage/core-plugin-api';
|
|
5
4
|
import { catalogApiRef, getEntityRelations, entityRouteRef, EntityDisplayName } from '@backstage/plugin-catalog-react';
|
|
6
5
|
import Typography from '@material-ui/core/Typography';
|
|
7
6
|
import { makeStyles, useTheme } from '@material-ui/core/styles';
|
|
8
7
|
import ZoomOutMap from '@material-ui/icons/ZoomOutMap';
|
|
9
8
|
import classNames from 'classnames';
|
|
9
|
+
import React from 'react';
|
|
10
10
|
import useAsync from 'react-use/esm/useAsync';
|
|
11
11
|
|
|
12
|
-
const useStyles
|
|
12
|
+
const useStyles = makeStyles(
|
|
13
13
|
(theme) => ({
|
|
14
14
|
graph: {
|
|
15
15
|
minHeight: "100%",
|
|
@@ -69,7 +69,7 @@ function RenderNode(props) {
|
|
|
69
69
|
const nodeWidth = 180;
|
|
70
70
|
const nodeHeight = 60;
|
|
71
71
|
const theme = useTheme();
|
|
72
|
-
const classes = useStyles
|
|
72
|
+
const classes = useStyles();
|
|
73
73
|
const catalogEntityRoute = useRouteRef(entityRouteRef);
|
|
74
74
|
if (props.node.id === "root") {
|
|
75
75
|
return /* @__PURE__ */ React.createElement("g", null, /* @__PURE__ */ React.createElement(
|
|
@@ -113,19 +113,18 @@ function RenderNode(props) {
|
|
|
113
113
|
));
|
|
114
114
|
}
|
|
115
115
|
function GroupsDiagram(props) {
|
|
116
|
-
var _a;
|
|
117
116
|
const nodes = new Array();
|
|
118
117
|
const edges = new Array();
|
|
119
|
-
const classes = useStyles
|
|
118
|
+
const classes = useStyles();
|
|
120
119
|
const configApi = useApi(configApiRef);
|
|
121
120
|
const catalogApi = useApi(catalogApiRef);
|
|
122
|
-
const organizationName =
|
|
121
|
+
const organizationName = configApi.getOptionalString("organization.name") ?? "Backstage";
|
|
123
122
|
const {
|
|
124
123
|
loading,
|
|
125
124
|
error,
|
|
126
125
|
value: catalogResponse
|
|
127
126
|
} = useAsync(() => {
|
|
128
|
-
|
|
127
|
+
const filter = { kind: ["Group"] };
|
|
129
128
|
if (props.namespace) {
|
|
130
129
|
filter["metadata.namespace"] = props.namespace;
|
|
131
130
|
}
|
|
@@ -141,14 +140,13 @@ function GroupsDiagram(props) {
|
|
|
141
140
|
kind: "Organization",
|
|
142
141
|
name: organizationName
|
|
143
142
|
});
|
|
144
|
-
for (const catalogItem of
|
|
143
|
+
for (const catalogItem of catalogResponse?.items || []) {
|
|
145
144
|
const currentItemId = stringifyEntityRef(catalogItem);
|
|
146
145
|
const catalogItemRelations_childOf = getEntityRelations(
|
|
147
146
|
catalogItem,
|
|
148
147
|
RELATION_CHILD_OF
|
|
149
148
|
);
|
|
150
|
-
if (props.hideChildren && catalogItemRelations_childOf.length)
|
|
151
|
-
continue;
|
|
149
|
+
if (props.hideChildren && catalogItemRelations_childOf.length) continue;
|
|
152
150
|
nodes.push({
|
|
153
151
|
id: stringifyEntityRef(catalogItem),
|
|
154
152
|
kind: catalogItem.kind,
|
|
@@ -193,28 +191,5 @@ function GroupsDiagram(props) {
|
|
|
193
191
|
));
|
|
194
192
|
}
|
|
195
193
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
root: {
|
|
199
|
-
height: "100%",
|
|
200
|
-
maxHeight: "100%",
|
|
201
|
-
minHeight: 0
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
{ name: "ExploreGroupsContent" }
|
|
205
|
-
);
|
|
206
|
-
const GroupsExplorerContent = (props) => {
|
|
207
|
-
var _a;
|
|
208
|
-
const classes = useStyles();
|
|
209
|
-
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(
|
|
210
|
-
GroupsDiagram,
|
|
211
|
-
{
|
|
212
|
-
direction: props.direction,
|
|
213
|
-
hideChildren: props.hideChildren,
|
|
214
|
-
namespace: props.namespace
|
|
215
|
-
}
|
|
216
|
-
));
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
export { GroupsExplorerContent as G };
|
|
220
|
-
//# sourceMappingURL=GroupsExplorerContent-DYsdAbPv.esm.js.map
|
|
194
|
+
export { GroupsDiagram };
|
|
195
|
+
//# sourceMappingURL=GroupsDiagram.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupsDiagram.esm.js","sources":["../../../src/components/GroupsExplorerContent/GroupsDiagram.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 const 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"],"names":[],"mappings":";;;;;;;;;;;AA2CA,MAAM,SAAY,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,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACxB,MAAQ,EAAA,MAAA;AAAA,MACR,OAAS,EAAA,MAAA;AAAA,MACT,UAAY,EAAA,QAAA;AAAA,MAC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+
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
|