@backstage-community/plugin-explore 0.17.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/alpha.d.ts +31 -31
- package/dist/alpha.esm.js +12 -16
- package/dist/alpha.esm.js.map +1 -1
- package/dist/api/ExploreApi.esm.js.map +1 -1
- package/dist/api/ExploreClient.esm.js.map +1 -1
- package/dist/components/CatalogKindExploreContent/CatalogKindExploreContent.esm.js +3 -4
- package/dist/components/CatalogKindExploreContent/CatalogKindExploreContent.esm.js.map +1 -1
- package/dist/components/DefaultExplorePage/DefaultExplorePage.esm.js +5 -12
- package/dist/components/DefaultExplorePage/DefaultExplorePage.esm.js.map +1 -1
- package/dist/components/DomainCard/DomainCard.esm.js +6 -11
- package/dist/components/DomainCard/DomainCard.esm.js.map +1 -1
- package/dist/components/DomainExplorerContent/DomainExplorerContent.esm.js +3 -4
- package/dist/components/DomainExplorerContent/DomainExplorerContent.esm.js.map +1 -1
- package/dist/components/DomainExplorerContent/index.esm.js +5 -1
- package/dist/components/DomainExplorerContent/index.esm.js.map +1 -1
- package/dist/components/EntityCard/EntityCard.esm.js +14 -13
- package/dist/components/EntityCard/EntityCard.esm.js.map +1 -1
- package/dist/components/ExploreLayout/ExploreLayout.esm.js +46 -14
- package/dist/components/ExploreLayout/ExploreLayout.esm.js.map +1 -1
- package/dist/components/ExplorePage/ExplorePage.esm.js.map +1 -1
- package/dist/components/ExplorePage/index.esm.js +5 -1
- package/dist/components/ExplorePage/index.esm.js.map +1 -1
- package/dist/components/GroupsExplorerContent/GroupsDiagram.esm.js +17 -79
- package/dist/components/GroupsExplorerContent/GroupsDiagram.esm.js.map +1 -1
- package/dist/components/GroupsExplorerContent/GroupsDiagram.module.css.esm.js +8 -0
- package/dist/components/GroupsExplorerContent/GroupsDiagram.module.css.esm.js.map +1 -0
- package/dist/components/GroupsExplorerContent/GroupsExplorerContent.esm.js +2 -13
- package/dist/components/GroupsExplorerContent/GroupsExplorerContent.esm.js.map +1 -1
- package/dist/components/GroupsExplorerContent/GroupsExplorerContent.module.css.esm.js +8 -0
- package/dist/components/GroupsExplorerContent/GroupsExplorerContent.module.css.esm.js.map +1 -0
- package/dist/components/GroupsExplorerContent/index.esm.js +5 -1
- package/dist/components/GroupsExplorerContent/index.esm.js.map +1 -1
- package/dist/components/ToolCard/ToolCard.esm.js +18 -60
- package/dist/components/ToolCard/ToolCard.esm.js.map +1 -1
- package/dist/components/ToolCard/ToolCard.module.css.esm.js +8 -0
- package/dist/components/ToolCard/ToolCard.module.css.esm.js.map +1 -0
- package/dist/components/ToolExplorerContent/ToolExplorerContent.esm.js.map +1 -1
- package/dist/components/ToolExplorerContent/index.esm.js +5 -1
- package/dist/components/ToolExplorerContent/index.esm.js.map +1 -1
- package/dist/components/ToolSearchResultListItem/ToolSearchResultListItem.esm.js +25 -47
- package/dist/components/ToolSearchResultListItem/ToolSearchResultListItem.esm.js.map +1 -1
- package/dist/components/ToolSearchResultListItem/ToolSearchResultListItem.module.css.esm.js +8 -0
- package/dist/components/ToolSearchResultListItem/ToolSearchResultListItem.module.css.esm.js.map +1 -0
- package/dist/components/ToolSearchResultListItem/index.esm.js +5 -1
- package/dist/components/ToolSearchResultListItem/index.esm.js.map +1 -1
- package/dist/extensions.esm.js.map +1 -1
- package/dist/index.d.ts +26 -21
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +29 -0
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -0
- package/dist/plugin.esm.js +2 -2
- package/dist/plugin.esm.js.map +1 -1
- package/dist/routes.esm.js.map +1 -1
- package/package.json +22 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @backstage-community/plugin-explore
|
|
2
2
|
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 5f6a0fe: **BREAKING** Migrated from Material UI (MUI) to Backstage UI (BUI).
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- a7c5b48: Backstage version bump to v1.52.0
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [a7c5b48]
|
|
16
|
+
- @backstage-community/plugin-explore-common@0.14.0
|
|
17
|
+
- @backstage-community/plugin-explore-react@0.14.0
|
|
18
|
+
|
|
19
|
+
## 0.18.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- 21067f0: Backstage version bump to v1.49.2
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [21067f0]
|
|
28
|
+
- @backstage-community/plugin-explore-common@0.13.0
|
|
29
|
+
- @backstage-community/plugin-explore-react@0.13.0
|
|
30
|
+
|
|
3
31
|
## 0.17.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
3
|
-
import * as
|
|
2
|
+
import * as react from 'react';
|
|
4
3
|
import * as _backstage_plugin_search_react_alpha from '@backstage/plugin-search-react/alpha';
|
|
5
4
|
|
|
6
5
|
/** @alpha */
|
|
@@ -14,9 +13,9 @@ declare const exploreSearchResultListItem: _backstage_frontend_plugin_api.Overri
|
|
|
14
13
|
noTrack?: boolean | undefined;
|
|
15
14
|
};
|
|
16
15
|
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
17
|
-
predicate?: _backstage_plugin_search_react_alpha.SearchResultItemExtensionPredicate
|
|
16
|
+
predicate?: _backstage_plugin_search_react_alpha.SearchResultItemExtensionPredicate;
|
|
18
17
|
component: _backstage_plugin_search_react_alpha.SearchResultItemExtensionComponent;
|
|
19
|
-
icon?:
|
|
18
|
+
icon?: react.JSX.Element;
|
|
20
19
|
}, "search.search-result-list-item.item", {}>;
|
|
21
20
|
inputs: {};
|
|
22
21
|
params: _backstage_plugin_search_react_alpha.SearchResultListItemBlueprintParams;
|
|
@@ -32,45 +31,46 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
32
31
|
configInput: {};
|
|
33
32
|
output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AnyApiFactory, "core.api.factory", {}>;
|
|
34
33
|
inputs: {};
|
|
35
|
-
params: <TApi, TImpl extends TApi, TDeps extends {
|
|
36
|
-
[x: string]: unknown;
|
|
37
|
-
}>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
38
|
-
}>;
|
|
39
|
-
"nav-item:explore": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
40
|
-
kind: "nav-item";
|
|
41
|
-
name: undefined;
|
|
42
|
-
config: {};
|
|
43
|
-
configInput: {};
|
|
44
|
-
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
45
|
-
title: string;
|
|
46
|
-
icon: _backstage_frontend_plugin_api.IconComponent;
|
|
47
|
-
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
48
|
-
}, "core.nav-item.target", {}>;
|
|
49
|
-
inputs: {};
|
|
50
|
-
params: {
|
|
51
|
-
title: string;
|
|
52
|
-
icon: _backstage_frontend_plugin_api.IconComponent;
|
|
53
|
-
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
54
|
-
};
|
|
34
|
+
params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
55
35
|
}>;
|
|
56
36
|
"page:explore": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
57
37
|
kind: "page";
|
|
58
38
|
name: undefined;
|
|
59
39
|
config: {
|
|
60
40
|
path: string | undefined;
|
|
41
|
+
title: string | undefined;
|
|
61
42
|
};
|
|
62
43
|
configInput: {
|
|
63
44
|
path?: string | undefined;
|
|
45
|
+
title?: string | undefined;
|
|
64
46
|
};
|
|
65
|
-
output: _backstage_frontend_plugin_api.ExtensionDataRef<
|
|
47
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
48
|
+
optional: true;
|
|
49
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<string, "core.title", {
|
|
50
|
+
optional: true;
|
|
51
|
+
}> | _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
|
|
66
52
|
optional: true;
|
|
67
53
|
}>;
|
|
68
|
-
inputs: {
|
|
54
|
+
inputs: {
|
|
55
|
+
pages: _backstage_frontend_plugin_api.ExtensionInput<_backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
56
|
+
optional: true;
|
|
57
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.title", {
|
|
58
|
+
optional: true;
|
|
59
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.IconElement, "core.icon", {
|
|
60
|
+
optional: true;
|
|
61
|
+
}>, {
|
|
62
|
+
singleton: false;
|
|
63
|
+
optional: false;
|
|
64
|
+
internal: false;
|
|
65
|
+
}>;
|
|
66
|
+
};
|
|
69
67
|
params: {
|
|
70
|
-
defaultPath?: [Error: "Use the 'path' param instead"] | undefined;
|
|
71
68
|
path: string;
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
title?: string;
|
|
70
|
+
icon?: _backstage_frontend_plugin_api.IconElement;
|
|
71
|
+
loader?: () => Promise<react.JSX.Element>;
|
|
72
|
+
routeRef?: _backstage_frontend_plugin_api.RouteRef;
|
|
73
|
+
noHeader?: boolean;
|
|
74
74
|
};
|
|
75
75
|
}>;
|
|
76
76
|
"search-result-list-item:explore": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
@@ -83,9 +83,9 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
83
83
|
noTrack?: boolean | undefined;
|
|
84
84
|
};
|
|
85
85
|
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
86
|
-
predicate?: _backstage_plugin_search_react_alpha.SearchResultItemExtensionPredicate
|
|
86
|
+
predicate?: _backstage_plugin_search_react_alpha.SearchResultItemExtensionPredicate;
|
|
87
87
|
component: _backstage_plugin_search_react_alpha.SearchResultItemExtensionComponent;
|
|
88
|
-
icon?:
|
|
88
|
+
icon?: react.JSX.Element;
|
|
89
89
|
}, "search.search-result-list-item.item", {}>;
|
|
90
90
|
inputs: {};
|
|
91
91
|
params: _backstage_plugin_search_react_alpha.SearchResultListItemBlueprintParams;
|
package/dist/alpha.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { ApiBlueprint,
|
|
2
|
+
import { RiStackLine } from '@remixicon/react';
|
|
3
|
+
import { compatWrapper, convertLegacyRouteRef, convertLegacyRouteRefs } from '@backstage/core-compat-api';
|
|
4
|
+
import { ApiBlueprint, fetchApiRef, discoveryApiRef, PageBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
5
5
|
import { SearchResultListItemBlueprint } from '@backstage/plugin-search-react/alpha';
|
|
6
6
|
import { ExploreClient } from './api/ExploreClient.esm.js';
|
|
7
7
|
import { exploreApiRef } from './api/ExploreApi.esm.js';
|
|
@@ -20,19 +20,19 @@ const exploreApi = ApiBlueprint.make({
|
|
|
20
20
|
const explorePage = PageBlueprint.make({
|
|
21
21
|
params: {
|
|
22
22
|
path: "/explore",
|
|
23
|
+
title: "Explore",
|
|
24
|
+
icon: /* @__PURE__ */ jsx(RiStackLine, {}),
|
|
23
25
|
routeRef: convertLegacyRouteRef(exploreRouteRef),
|
|
26
|
+
// TODO: Revisit once Backstage core supports rendering plugin headers
|
|
27
|
+
// without the wrapping PageLayout header. For now we opt out of the
|
|
28
|
+
// default header so `PluginHeader` (used inside `ExploreLayout`) is the
|
|
29
|
+
// only header rendered.
|
|
30
|
+
noHeader: true,
|
|
24
31
|
loader: async () => import('./components/ExplorePage/index.esm.js').then(
|
|
25
32
|
(m) => compatWrapper(/* @__PURE__ */ jsx(m.ExplorePage, {}))
|
|
26
33
|
)
|
|
27
34
|
}
|
|
28
35
|
});
|
|
29
|
-
const exploreNavItem = NavItemBlueprint.make({
|
|
30
|
-
params: {
|
|
31
|
-
icon: LayersIcon,
|
|
32
|
-
routeRef: convertLegacyRouteRef(exploreRouteRef),
|
|
33
|
-
title: "Explore"
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
36
|
const exploreSearchResultListItem = SearchResultListItemBlueprint.make({
|
|
37
37
|
params: {
|
|
38
38
|
predicate: (result) => result.type === "tools",
|
|
@@ -43,12 +43,8 @@ const exploreSearchResultListItem = SearchResultListItemBlueprint.make({
|
|
|
43
43
|
});
|
|
44
44
|
var alpha = createFrontendPlugin({
|
|
45
45
|
pluginId: "explore",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
explorePage,
|
|
49
|
-
exploreNavItem,
|
|
50
|
-
exploreSearchResultListItem
|
|
51
|
-
],
|
|
46
|
+
icon: /* @__PURE__ */ jsx(RiStackLine, {}),
|
|
47
|
+
extensions: [exploreApi, explorePage, exploreSearchResultListItem],
|
|
52
48
|
routes: convertLegacyRouteRefs({
|
|
53
49
|
explore: exploreRouteRef
|
|
54
50
|
})
|
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
|
|
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 { RiStackLine } from '@remixicon/react';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n convertLegacyRouteRefs,\n} from '@backstage/core-compat-api';\nimport {\n createFrontendPlugin,\n discoveryApiRef,\n fetchApiRef,\n ApiBlueprint,\n PageBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport { SearchResultListItemBlueprint } from '@backstage/plugin-search-react/alpha';\nimport { exploreApiRef, ExploreClient } from './api';\nimport { exploreRouteRef } from './routes';\n\n/** @alpha */\nconst exploreApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\n api: exploreApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new ExploreClient({ discoveryApi, fetchApi }),\n }),\n});\n\n/** @alpha */\nconst explorePage = PageBlueprint.make({\n params: {\n path: '/explore',\n title: 'Explore',\n icon: <RiStackLine />,\n routeRef: convertLegacyRouteRef(exploreRouteRef),\n // TODO: Revisit once Backstage core supports rendering plugin headers\n // without the wrapping PageLayout header. For now we opt out of the\n // default header so `PluginHeader` (used inside `ExploreLayout`) is the\n // only header rendered.\n noHeader: true,\n loader: async () =>\n import('./components/ExplorePage').then(m =>\n compatWrapper(<m.ExplorePage />),\n ),\n },\n});\n\n/** @alpha */\nexport const exploreSearchResultListItem = SearchResultListItemBlueprint.make({\n params: {\n predicate: result => result.type === 'tools',\n component: () =>\n import('./components/ToolSearchResultListItem').then(\n m => m.ToolSearchResultListItem,\n ),\n },\n});\n\n/** @alpha */\nexport default createFrontendPlugin({\n pluginId: 'explore',\n icon: <RiStackLine />,\n extensions: [exploreApi, explorePage, exploreSearchResultListItem],\n routes: convertLegacyRouteRefs({\n explore: exploreRouteRef,\n }),\n});\n"],"names":[],"mappings":";;;;;;;;;AAkCA,MAAM,UAAA,GAAa,aAAa,IAAA,CAAK;AAAA,EACnC,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,aAAA;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,YAAA,EAAc,eAAA;AAAA,MACd,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,QAAA,EAAS,KACjC,IAAI,aAAA,CAAc,EAAE,YAAA,EAAc,QAAA,EAAU;AAAA,GAC/C;AACL,CAAC,CAAA;AAGD,MAAM,WAAA,GAAc,cAAc,IAAA,CAAK;AAAA,EACrC,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,UAAA;AAAA,IACN,KAAA,EAAO,SAAA;AAAA,IACP,IAAA,sBAAO,WAAA,EAAA,EAAY,CAAA;AAAA,IACnB,QAAA,EAAU,sBAAsB,eAAe,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAK/C,QAAA,EAAU,IAAA;AAAA,IACV,MAAA,EAAQ,YACN,OAAO,uCAA0B,CAAA,CAAE,IAAA;AAAA,MAAK,OACtC,aAAA,iBAAc,GAAA,CAAC,CAAA,CAAE,WAAA,EAAF,EAAc,CAAE;AAAA;AACjC;AAEN,CAAC,CAAA;AAGM,MAAM,2BAAA,GAA8B,8BAA8B,IAAA,CAAK;AAAA,EAC5E,MAAA,EAAQ;AAAA,IACN,SAAA,EAAW,CAAA,MAAA,KAAU,MAAA,CAAO,IAAA,KAAS,OAAA;AAAA,IACrC,SAAA,EAAW,MACT,OAAO,oDAAuC,CAAA,CAAE,IAAA;AAAA,MAC9C,OAAK,CAAA,CAAE;AAAA;AACT;AAEN,CAAC;AAGD,YAAe,oBAAA,CAAqB;AAAA,EAClC,QAAA,EAAU,SAAA;AAAA,EACV,IAAA,sBAAO,WAAA,EAAA,EAAY,CAAA;AAAA,EACnB,UAAA,EAAY,CAAC,UAAA,EAAY,WAAA,EAAa,2BAA2B,CAAA;AAAA,EACjE,QAAQ,sBAAA,CAAuB;AAAA,IAC7B,OAAA,EAAS;AAAA,GACV;AACH,CAAC,CAAA;;;;"}
|
|
@@ -1 +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,
|
|
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,YAAA,CAAyB;AAAA,EACpD,EAAA,EAAI;AACN,CAAC;;;;"}
|
|
@@ -1 +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,
|
|
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,aAAA,CAAoC;AAAA,EAC9B,YAAA;AAAA,EACA,QAAA;AAAA;AAAA,EAEA,kBAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQjB,YAAY,OAAA,EAIT;AACD,IAAA,IAAA,CAAK,eAAe,OAAA,CAAQ,YAAA;AAC5B,IAAA,IAAA,CAAK,WAAW,OAAA,CAAQ,QAAA;AACxB,IAAA,IAAA,CAAK,qBAAqB,OAAA,CAAQ,kBAAA;AAAA,EACpC;AAAA,EAEA,MAAM,QAAA,CACJ,OAAA,GAAkC,EAAC,EACD;AAElC,IAAA,IAAI,KAAK,kBAAA,EAAoB;AAC3B,MAAA,MAAM,KAAA,GAAQ,MAAM,IAAA,CAAK,kBAAA,CAAmB,QAAA,EAAS;AACrD,MAAA,IAAI,KAAA,EAAO;AACT,QAAA,OAAO,EAAE,KAAA,EAAM;AAAA,MACjB;AAAA,IACF;AAEA,IAAA,MAAM,EAAE,KAAA,EAAM,GAAI,IAAA,CAAK,QAAA;AAEvB,IAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,MAAA,IAAU,EAAC;AAClC,IAAA,MAAM,OAAA,GAAU,MAAM,IAAA,CAAK,YAAA,CAAa,WAAW,SAAS,CAAA;AAE5D,IAAA,MAAM,IAAA,GAAO,MAAA,EAAQ,IAAA,EAAM,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,IAAA,EAAO,kBAAA,CAAmB,CAAC,CAAC,CAAA,CAAE,CAAA,IAAK,EAAC;AACxE,IAAA,MAAM,UAAA,GACJ,MAAA,EAAQ,SAAA,EAAW,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,UAAA,EAAa,kBAAA,CAAmB,CAAC,CAAC,CAAA,CAAE,CAAA,IAAK,EAAC;AACxE,IAAA,MAAM,KAAA,GAAQ,CAAC,GAAG,IAAA,EAAM,GAAG,UAAU,CAAA,CAAE,KAAK,GAAG,CAAA;AAE/C,IAAA,MAAM,QAAA,GAAW,MAAM,KAAA,CAAM,CAAA,EAAG,OAAO,CAAA,MAAA,EAAS,KAAA,GAAQ,CAAA,CAAA,EAAI,KAAK,CAAA,CAAA,GAAK,EAAE,CAAA,CAAE,CAAA;AAE1E,IAAA,IAAI,CAAC,SAAS,EAAA,EAAI;AAChB,MAAA,MAAM,MAAM,aAAA,CAAc,YAAA,CAAa,QAAQ,CAAA;AAAA,IACjD;AAEA,IAAA,OAAO,SAAS,IAAA,EAAK;AAAA,EACvB;AACF;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
|
3
|
-
import
|
|
3
|
+
import { ButtonLink } from '@backstage/ui';
|
|
4
4
|
import useAsync from 'react-use/esm/useAsync';
|
|
5
5
|
import { EntityCard } from '../EntityCard/EntityCard.esm.js';
|
|
6
6
|
import { Content, ContentHeader, SupportButton, Progress, WarningPanel, EmptyState, ItemCardGrid } from '@backstage/core-components';
|
|
@@ -35,10 +35,9 @@ const Body = (props) => {
|
|
|
35
35
|
title: `No ${kindPlural} to display`,
|
|
36
36
|
description: `You haven't added any ${kindPlural} yet.`,
|
|
37
37
|
action: /* @__PURE__ */ jsx(
|
|
38
|
-
|
|
38
|
+
ButtonLink,
|
|
39
39
|
{
|
|
40
|
-
variant: "
|
|
41
|
-
color: "primary",
|
|
40
|
+
variant: "primary",
|
|
42
41
|
href: `https://backstage.io/docs/features/software-catalog/descriptor-format#kind-${kind}`,
|
|
43
42
|
children: "Read more"
|
|
44
43
|
}
|
|
@@ -1 +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
|
|
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 { ButtonLink } from '@backstage/ui';\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 <ButtonLink\n variant=\"primary\"\n href={`https://backstage.io/docs/features/software-catalog/descriptor-format#kind-${kind}`}\n >\n Read more\n </ButtonLink>\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":";;;;;;;;;AAiCA,MAAM,IAAA,GAAO,CAAC,KAAA,KAA4B;AACxC,EAAA,MAAM,EAAE,MAAK,GAAI,KAAA;AACjB,EAAA,MAAM,UAAA,GAAa,UAAU,IAAI,CAAA;AACjC,EAAA,MAAM,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAA,MAAM;AAAA,IACJ,KAAA,EAAO,QAAA;AAAA,IACP,OAAA;AAAA,IACA;AAAA,GACF,GAAI,SAAS,YAAY;AACvB,IAAA,MAAM,QAAA,GAAW,MAAM,UAAA,CAAW,WAAA,CAAY;AAAA,MAC5C,MAAA,EAAQ,EAAE,IAAA;AAAK,KAChB,CAAA;AACD,IAAA,OAAO,QAAA,CAAS,KAAA;AAAA,EAClB,CAAA,EAAG,CAAC,IAAI,CAAC,CAAA;AAET,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,2BAAQ,QAAA,EAAA,EAAS,CAAA;AAAA,EACnB;AAEA,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,uBACE,GAAA,CAAC,gBAAa,QAAA,EAAS,OAAA,EAAQ,OAAO,CAAA,eAAA,EAAkB,UAAU,CAAA,CAAA,CAAA,EAC/D,QAAA,EAAA,KAAA,CAAM,OAAA,EACT,CAAA;AAAA,EAEJ;AAEA,EAAA,IAAI,CAAC,UAAU,MAAA,EAAQ;AACrB,IAAA,uBACE,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,MAAA;AAAA,QACR,KAAA,EAAO,MAAM,UAAU,CAAA,WAAA,CAAA;AAAA,QACvB,WAAA,EAAa,yBAAyB,UAAU,CAAA,KAAA,CAAA;AAAA,QAChD,MAAA,kBACE,GAAA;AAAA,UAAC,UAAA;AAAA,UAAA;AAAA,YACC,OAAA,EAAQ,SAAA;AAAA,YACR,IAAA,EAAM,8EAA8E,IAAI,CAAA,CAAA;AAAA,YACzF,QAAA,EAAA;AAAA;AAAA;AAED;AAAA,KAEJ;AAAA,EAEJ;AAEA,EAAA,uBACE,GAAA,CAAC,YAAA,EAAA,EACE,QAAA,EAAA,QAAA,CAAS,GAAA,CAAI,CAAC,MAAA,EAAQ,KAAA,qBACrB,GAAA,CAAC,UAAA,EAAA,EAAuB,MAAA,EAAA,EAAP,KAAuB,CACzC,CAAA,EACH,CAAA;AAEJ,CAAA;AAGO,MAAM,yBAAA,GAA4B,CAAC,KAAA,KAGpC;AACJ,EAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAM,GAAI,KAAA;AACxB,EAAA,MAAM,aAAA,GAAgB,KAAK,iBAAA,EAAkB;AAC7C,EAAA,MAAM,eAAA,GAAkB,CAAA,EAAG,IAAA,CAAK,CAAC,CAAA,CAAE,iBAAA,EAAmB,CAAA,EAAG,IAAA,CAAK,SAAA,CAAU,CAAC,CAAC,CAAA,CAAA;AAC1E,EAAA,uBACE,IAAA,CAAC,OAAA,EAAA,EAAQ,SAAA,EAAS,IAAA,EAChB,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,KAAA,EAAO,KAAA,IAAS,CAAA,EAAG,SAAA,CAAU,eAAe,CAAC,CAAA,CAAA,EAC1D,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EACC,QAAA,kBAAA,IAAA,CAAA,QAAA,EAAA,EAAE,QAAA,EAAA;AAAA,MAAA,eAAA;AAAA,MAAc,UAAU,aAAa,CAAA;AAAA,MAAE;AAAA,KAAA,EAAmB,GAC9D,CAAA,EACF,CAAA;AAAA,oBACA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAM,aAAA,EAAe;AAAA,GAAA,EAC7B,CAAA;AAEJ;;;;"}
|
|
@@ -8,18 +8,11 @@ import { CatalogKindExploreContent } from '../CatalogKindExploreContent/CatalogK
|
|
|
8
8
|
const DefaultExplorePage = () => {
|
|
9
9
|
const configApi = useApi(configApiRef);
|
|
10
10
|
const organizationName = configApi.getOptionalString("organization.name") ?? "Backstage";
|
|
11
|
-
return /* @__PURE__ */ jsxs(
|
|
12
|
-
ExploreLayout,
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
children: [
|
|
17
|
-
/* @__PURE__ */ jsx(ExploreLayout.Route, { path: "domains", title: "Domains", children: /* @__PURE__ */ jsx(CatalogKindExploreContent, { kind: "domain" }) }),
|
|
18
|
-
/* @__PURE__ */ jsx(ExploreLayout.Route, { path: "groups", title: "Groups", children: /* @__PURE__ */ jsx(GroupsExplorerContent, {}) }),
|
|
19
|
-
/* @__PURE__ */ jsx(ExploreLayout.Route, { path: "tools", title: "Tools", children: /* @__PURE__ */ jsx(ToolExplorerContent, {}) })
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
);
|
|
11
|
+
return /* @__PURE__ */ jsxs(ExploreLayout, { title: `Explore the ${organizationName} ecosystem`, children: [
|
|
12
|
+
/* @__PURE__ */ jsx(ExploreLayout.Route, { path: "domains", title: "Domains", children: /* @__PURE__ */ jsx(CatalogKindExploreContent, { kind: "domain" }) }),
|
|
13
|
+
/* @__PURE__ */ jsx(ExploreLayout.Route, { path: "groups", title: "Groups", children: /* @__PURE__ */ jsx(GroupsExplorerContent, {}) }),
|
|
14
|
+
/* @__PURE__ */ jsx(ExploreLayout.Route, { path: "tools", title: "Tools", children: /* @__PURE__ */ jsx(ToolExplorerContent, {}) })
|
|
15
|
+
] });
|
|
23
16
|
};
|
|
24
17
|
|
|
25
18
|
export { DefaultExplorePage };
|
|
@@ -1 +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 { 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
|
|
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 { 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 title={`Explore the ${organizationName} ecosystem`}>\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":";;;;;;;AAsBO,MAAM,qBAAqB,MAAM;AACtC,EAAA,MAAM,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAA,MAAM,gBAAA,GACJ,SAAA,CAAU,iBAAA,CAAkB,mBAAmB,CAAA,IAAK,WAAA;AAEtD,EAAA,uBACE,IAAA,CAAC,aAAA,EAAA,EAAc,KAAA,EAAO,CAAA,YAAA,EAAe,gBAAgB,CAAA,UAAA,CAAA,EACnD,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,aAAA,CAAc,KAAA,EAAd,EAAoB,IAAA,EAAK,SAAA,EAAU,KAAA,EAAM,SAAA,EACxC,QAAA,kBAAA,GAAA,CAAC,yBAAA,EAAA,EAA0B,IAAA,EAAK,QAAA,EAAS,CAAA,EAC3C,CAAA;AAAA,oBACA,GAAA,CAAC,aAAA,CAAc,KAAA,EAAd,EAAoB,IAAA,EAAK,UAAS,KAAA,EAAM,QAAA,EACvC,QAAA,kBAAA,GAAA,CAAC,qBAAA,EAAA,EAAsB,CAAA,EACzB,CAAA;AAAA,oBACA,GAAA,CAAC,aAAA,CAAc,KAAA,EAAd,EAAoB,IAAA,EAAK,SAAQ,KAAA,EAAM,OAAA,EACtC,QAAA,kBAAA,GAAA,CAAC,mBAAA,EAAA,EAAoB,CAAA,EACvB;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { RELATION_OWNED_BY } from '@backstage/catalog-model';
|
|
3
3
|
import { entityRouteRef, getEntityRelations, entityRouteParams, EntityRefLinks } from '@backstage/plugin-catalog-react';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import CardActions from '@material-ui/core/CardActions';
|
|
7
|
-
import CardContent from '@material-ui/core/CardContent';
|
|
8
|
-
import CardMedia from '@material-ui/core/CardMedia';
|
|
9
|
-
import Chip from '@material-ui/core/Chip';
|
|
10
|
-
import { ItemCardHeader, LinkButton } from '@backstage/core-components';
|
|
4
|
+
import { Card, CardHeader, CardBody, TagGroup, Tag, CardFooter, ButtonLink } from '@backstage/ui';
|
|
5
|
+
import { ItemCardHeader } from '@backstage/core-components';
|
|
11
6
|
import { useRouteRef } from '@backstage/core-plugin-api';
|
|
12
7
|
|
|
13
8
|
const DomainCard = (props) => {
|
|
@@ -24,18 +19,18 @@ const DomainCard = (props) => {
|
|
|
24
19
|
}
|
|
25
20
|
);
|
|
26
21
|
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
27
|
-
/* @__PURE__ */ jsx(
|
|
22
|
+
/* @__PURE__ */ jsx(CardHeader, { style: { padding: 0 }, children: /* @__PURE__ */ jsx(
|
|
28
23
|
ItemCardHeader,
|
|
29
24
|
{
|
|
30
25
|
title: entity.metadata.title ?? entity.metadata.name,
|
|
31
26
|
subtitle: owner
|
|
32
27
|
}
|
|
33
28
|
) }),
|
|
34
|
-
/* @__PURE__ */ jsxs(
|
|
35
|
-
entity.metadata.tags?.length ? /* @__PURE__ */ jsx(
|
|
29
|
+
/* @__PURE__ */ jsxs(CardBody, { style: { overflow: "visible" }, children: [
|
|
30
|
+
entity.metadata.tags?.length ? /* @__PURE__ */ jsx(TagGroup, { style: { marginBottom: "var(--bui-space-2)" }, children: entity.metadata.tags.map((tag) => /* @__PURE__ */ jsx(Tag, { size: "small", children: tag }, tag)) }) : null,
|
|
36
31
|
entity.metadata.description
|
|
37
32
|
] }),
|
|
38
|
-
/* @__PURE__ */ jsx(
|
|
33
|
+
/* @__PURE__ */ jsx(CardFooter, { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx(ButtonLink, { href: url, variant: "primary", children: "Explore" }) })
|
|
39
34
|
] });
|
|
40
35
|
};
|
|
41
36
|
|
|
@@ -1 +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
|
|
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 {\n ButtonLink,\n Card,\n CardBody,\n CardFooter,\n CardHeader,\n Tag,\n TagGroup,\n} from '@backstage/ui';\n\nimport { 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 <CardHeader style={{ padding: 0 }}>\n <ItemCardHeader\n title={entity.metadata.title ?? entity.metadata.name}\n subtitle={owner}\n />\n </CardHeader>\n <CardBody style={{ overflow: 'visible' }}>\n {entity.metadata.tags?.length ? (\n <TagGroup style={{ marginBottom: 'var(--bui-space-2)' }}>\n {entity.metadata.tags.map(tag => (\n <Tag key={tag} size=\"small\">\n {tag}\n </Tag>\n ))}\n </TagGroup>\n ) : null}\n {entity.metadata.description}\n </CardBody>\n <CardFooter style={{ display: 'flex', justifyContent: 'flex-end' }}>\n <ButtonLink href={url} variant=\"primary\">\n Explore\n </ButtonLink>\n </CardFooter>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAqCO,MAAM,UAAA,GAAa,CAAC,KAAA,KAAoC;AAC7D,EAAA,MAAM,EAAE,QAAO,GAAI,KAAA;AAEnB,EAAA,MAAM,kBAAA,GAAqB,YAAY,cAAc,CAAA;AACrD,EAAA,MAAM,gBAAA,GAAmB,kBAAA,CAAmB,MAAA,EAAQ,iBAAiB,CAAA;AACrE,EAAA,MAAM,GAAA,GAAM,kBAAA,CAAmB,iBAAA,CAAkB,MAAM,CAAC,CAAA;AAExD,EAAA,MAAM,KAAA,mBACJ,GAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,UAAA,EAAY,gBAAA;AAAA,MACZ,WAAA,EAAY,OAAA;AAAA,MACZ,KAAA,EAAM;AAAA;AAAA,GACR;AAGF,EAAA,4BACG,IAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,EAAE,OAAA,EAAS,GAAE,EAC9B,QAAA,kBAAA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,KAAA,IAAS,OAAO,QAAA,CAAS,IAAA;AAAA,QAChD,QAAA,EAAU;AAAA;AAAA,KACZ,EACF,CAAA;AAAA,yBACC,QAAA,EAAA,EAAS,KAAA,EAAO,EAAE,QAAA,EAAU,WAAU,EACpC,QAAA,EAAA;AAAA,MAAA,MAAA,CAAO,QAAA,CAAS,MAAM,MAAA,mBACrB,GAAA,CAAC,YAAS,KAAA,EAAO,EAAE,YAAA,EAAc,oBAAA,EAAqB,EACnD,QAAA,EAAA,MAAA,CAAO,SAAS,IAAA,CAAK,GAAA,CAAI,CAAA,GAAA,qBACxB,GAAA,CAAC,GAAA,EAAA,EAAc,IAAA,EAAK,SACjB,QAAA,EAAA,GAAA,EAAA,EADO,GAEV,CACD,CAAA,EACH,CAAA,GACE,IAAA;AAAA,MACH,OAAO,QAAA,CAAS;AAAA,KAAA,EACnB,CAAA;AAAA,wBACC,UAAA,EAAA,EAAW,KAAA,EAAO,EAAE,OAAA,EAAS,QAAQ,cAAA,EAAgB,UAAA,EAAW,EAC/D,QAAA,kBAAA,GAAA,CAAC,cAAW,IAAA,EAAM,GAAA,EAAK,OAAA,EAAQ,SAAA,EAAU,qBAEzC,CAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { catalogApiRef } from '@backstage/plugin-catalog-react';
|
|
3
|
-
import
|
|
3
|
+
import { ButtonLink } from '@backstage/ui';
|
|
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';
|
|
@@ -32,10 +32,9 @@ const Body = () => {
|
|
|
32
32
|
title: "No domains to display",
|
|
33
33
|
description: "You haven't added any domains yet.",
|
|
34
34
|
action: /* @__PURE__ */ jsx(
|
|
35
|
-
|
|
35
|
+
ButtonLink,
|
|
36
36
|
{
|
|
37
|
-
variant: "
|
|
38
|
-
color: "primary",
|
|
37
|
+
variant: "primary",
|
|
39
38
|
href: "https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain",
|
|
40
39
|
children: "Read more"
|
|
41
40
|
}
|
|
@@ -1 +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
|
|
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 { ButtonLink } from '@backstage/ui';\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 <ButtonLink\n variant=\"primary\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain\"\n >\n Read more\n </ButtonLink>\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":";;;;;;;;AAgCA,MAAM,OAAO,MAAM;AACjB,EAAA,MAAM,UAAA,GAAa,OAAO,aAAa,CAAA;AACvC,EAAA,MAAM;AAAA,IACJ,KAAA,EAAO,QAAA;AAAA,IACP,OAAA;AAAA,IACA;AAAA,GACF,GAAI,SAAS,YAAY;AACvB,IAAA,MAAM,QAAA,GAAW,MAAM,UAAA,CAAW,WAAA,CAAY;AAAA,MAC5C,MAAA,EAAQ,EAAE,IAAA,EAAM,QAAA;AAAS,KAC1B,CAAA;AACD,IAAA,OAAO,QAAA,CAAS,KAAA;AAAA,EAClB,CAAA,EAAG,CAAC,UAAU,CAAC,CAAA;AAEf,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,2BAAQ,QAAA,EAAA,EAAS,CAAA;AAAA,EACnB;AAEA,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,2BACG,YAAA,EAAA,EAAa,QAAA,EAAS,SAAQ,KAAA,EAAM,yBAAA,EAClC,gBAAM,OAAA,EACT,CAAA;AAAA,EAEJ;AAEA,EAAA,IAAI,CAAC,UAAU,MAAA,EAAQ;AACrB,IAAA,uBACE,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,MAAA;AAAA,QACR,KAAA,EAAM,uBAAA;AAAA,QACN,WAAA,EAAY,oCAAA;AAAA,QACZ,MAAA,kBACE,GAAA;AAAA,UAAC,UAAA;AAAA,UAAA;AAAA,YACC,OAAA,EAAQ,SAAA;AAAA,YACR,IAAA,EAAK,mFAAA;AAAA,YACN,QAAA,EAAA;AAAA;AAAA;AAED;AAAA,KAEJ;AAAA,EAEJ;AAEA,EAAA,uBACE,GAAA,CAAC,YAAA,EAAA,EACE,QAAA,EAAA,QAAA,CAAS,GAAA,CAAI,CAAC,MAAA,EAAQ,KAAA,qBACrB,GAAA,CAAC,UAAA,EAAA,EAAuB,MAAA,EAAA,EAAP,KAAuB,CACzC,CAAA,EACH,CAAA;AAEJ,CAAA;AAGO,MAAM,qBAAA,GAAwB,CAAC,KAAA,KAA8B;AAClE,EAAA,uBACE,IAAA,CAAC,OAAA,EAAA,EAAQ,SAAA,EAAS,IAAA,EAChB,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,OAAO,KAAA,CAAM,KAAA,IAAS,WACnC,QAAA,kBAAA,GAAA,CAAC,aAAA,EAAA,EAAc,qDAAuC,CAAA,EACxD,CAAA;AAAA,wBACC,IAAA,EAAA,EAAK;AAAA,GAAA,EACR,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { RELATION_OWNED_BY } from '@backstage/catalog-model';
|
|
3
3
|
import { entityRouteRef, getEntityRelations, entityRouteParams, EntityRefLinks } from '@backstage/plugin-catalog-react';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import CardActions from '@material-ui/core/CardActions';
|
|
7
|
-
import CardContent from '@material-ui/core/CardContent';
|
|
8
|
-
import CardMedia from '@material-ui/core/CardMedia';
|
|
9
|
-
import Chip from '@material-ui/core/Chip';
|
|
10
|
-
import { ItemCardHeader, LinkButton } from '@backstage/core-components';
|
|
4
|
+
import { Card, CardHeader, CardBody, TagGroup, Tag, CardFooter, ButtonLink } from '@backstage/ui';
|
|
5
|
+
import { ItemCardHeader } from '@backstage/core-components';
|
|
11
6
|
import { useRouteRef } from '@backstage/core-plugin-api';
|
|
12
7
|
|
|
13
8
|
const EntityCard = (props) => {
|
|
@@ -24,18 +19,24 @@ const EntityCard = (props) => {
|
|
|
24
19
|
}
|
|
25
20
|
);
|
|
26
21
|
return /* @__PURE__ */ jsxs(Card, { children: [
|
|
27
|
-
/* @__PURE__ */ jsx(
|
|
22
|
+
/* @__PURE__ */ jsx(CardHeader, { style: { padding: 0 }, children: /* @__PURE__ */ jsx(
|
|
28
23
|
ItemCardHeader,
|
|
29
24
|
{
|
|
30
25
|
title: entity.metadata.title ?? entity.metadata.name,
|
|
31
26
|
subtitle: owner
|
|
32
27
|
}
|
|
33
28
|
) }),
|
|
34
|
-
/* @__PURE__ */ jsxs(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
/* @__PURE__ */ jsxs(
|
|
30
|
+
CardBody,
|
|
31
|
+
{
|
|
32
|
+
style: { overflow: "visible", paddingTop: "var(--bui-space-3)" },
|
|
33
|
+
children: [
|
|
34
|
+
entity.metadata.tags?.length ? /* @__PURE__ */ jsx(TagGroup, { style: { marginBottom: "var(--bui-space-2)" }, children: entity.metadata.tags.map((tag) => /* @__PURE__ */ jsx(Tag, { size: "small", children: tag }, tag)) }) : null,
|
|
35
|
+
entity.metadata.description
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ jsx(CardFooter, { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx(ButtonLink, { href: url, variant: "primary", children: "Explore" }) })
|
|
39
40
|
] });
|
|
40
41
|
};
|
|
41
42
|
|
|
@@ -1 +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
|
|
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 {\n ButtonLink,\n Card,\n CardBody,\n CardFooter,\n CardHeader,\n Tag,\n TagGroup,\n} from '@backstage/ui';\n\nimport { 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 <CardHeader style={{ padding: 0 }}>\n <ItemCardHeader\n title={entity.metadata.title ?? entity.metadata.name}\n subtitle={owner}\n />\n </CardHeader>\n <CardBody\n style={{ overflow: 'visible', paddingTop: 'var(--bui-space-3)' }}\n >\n {entity.metadata.tags?.length ? (\n <TagGroup style={{ marginBottom: 'var(--bui-space-2)' }}>\n {entity.metadata.tags.map(tag => (\n <Tag key={tag} size=\"small\">\n {tag}\n </Tag>\n ))}\n </TagGroup>\n ) : null}\n {entity.metadata.description}\n </CardBody>\n <CardFooter style={{ display: 'flex', justifyContent: 'flex-end' }}>\n <ButtonLink href={url} variant=\"primary\">\n Explore\n </ButtonLink>\n </CardFooter>\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAqCO,MAAM,UAAA,GAAa,CAAC,KAAA,KAA8B;AACvD,EAAA,MAAM,EAAE,QAAO,GAAI,KAAA;AAEnB,EAAA,MAAM,kBAAA,GAAqB,YAAY,cAAc,CAAA;AACrD,EAAA,MAAM,gBAAA,GAAmB,kBAAA,CAAmB,MAAA,EAAQ,iBAAiB,CAAA;AACrE,EAAA,MAAM,GAAA,GAAM,kBAAA,CAAmB,iBAAA,CAAkB,MAAM,CAAC,CAAA;AAExD,EAAA,MAAM,KAAA,mBACJ,GAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,UAAA,EAAY,gBAAA;AAAA,MACZ,WAAA,EAAY,OAAA;AAAA,MACZ,KAAA,EAAM;AAAA;AAAA,GACR;AAGF,EAAA,4BACG,IAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,EAAE,OAAA,EAAS,GAAE,EAC9B,QAAA,kBAAA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,KAAA,IAAS,OAAO,QAAA,CAAS,IAAA;AAAA,QAChD,QAAA,EAAU;AAAA;AAAA,KACZ,EACF,CAAA;AAAA,oBACA,IAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,QAAA,EAAU,SAAA,EAAW,YAAY,oBAAA,EAAqB;AAAA,QAE9D,QAAA,EAAA;AAAA,UAAA,MAAA,CAAO,QAAA,CAAS,MAAM,MAAA,mBACrB,GAAA,CAAC,YAAS,KAAA,EAAO,EAAE,YAAA,EAAc,oBAAA,EAAqB,EACnD,QAAA,EAAA,MAAA,CAAO,SAAS,IAAA,CAAK,GAAA,CAAI,CAAA,GAAA,qBACxB,GAAA,CAAC,GAAA,EAAA,EAAc,IAAA,EAAK,SACjB,QAAA,EAAA,GAAA,EAAA,EADO,GAEV,CACD,CAAA,EACH,CAAA,GACE,IAAA;AAAA,UACH,OAAO,QAAA,CAAS;AAAA;AAAA;AAAA,KACnB;AAAA,wBACC,UAAA,EAAA,EAAW,KAAA,EAAO,EAAE,OAAA,EAAS,QAAQ,cAAA,EAAgB,UAAA,EAAW,EAC/D,QAAA,kBAAA,GAAA,CAAC,cAAW,IAAA,EAAM,GAAA,EAAK,OAAA,EAAQ,SAAA,EAAU,qBAEzC,CAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
|