@backstage/plugin-catalog 1.4.0-next.2 → 1.5.0-next.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 +126 -0
- package/dist/esm/index-0550248f.esm.js +90 -0
- package/dist/esm/index-0550248f.esm.js.map +1 -0
- package/dist/esm/{index-ccd8b12d.esm.js → index-2bfd6ae7.esm.js} +379 -159
- package/dist/esm/index-2bfd6ae7.esm.js.map +1 -0
- package/dist/esm/{index-4e6adb42.esm.js → index-46417657.esm.js} +5 -2
- package/dist/esm/{index-4e6adb42.esm.js.map → index-46417657.esm.js.map} +1 -1
- package/dist/esm/{index-83d1e853.esm.js → index-543b1d23.esm.js} +8 -4
- package/dist/esm/index-543b1d23.esm.js.map +1 -0
- package/dist/esm/{index-2f1bf904.esm.js → index-9cdebd35.esm.js} +3 -2
- package/dist/esm/index-9cdebd35.esm.js.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +18 -18
- package/dist/esm/index-2f1bf904.esm.js.map +0 -1
- package/dist/esm/index-83d1e853.esm.js.map +0 -1
- package/dist/esm/index-896aeac9.esm.js +0 -135
- package/dist/esm/index-896aeac9.esm.js.map +0 -1
- package/dist/esm/index-ccd8b12d.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,131 @@
|
|
|
1
1
|
# @backstage/plugin-catalog
|
|
2
2
|
|
|
3
|
+
## 1.5.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 80da5162c7: Plugin catalog has been modified to use an experimental feature where you can customize the title of the create button.
|
|
8
|
+
|
|
9
|
+
You can modify it by doing:
|
|
10
|
+
|
|
11
|
+
```typescript jsx
|
|
12
|
+
import { catalogPlugin } from '@backstage/plugin-catalog';
|
|
13
|
+
|
|
14
|
+
catalogPlugin.__experimentalReconfigure({
|
|
15
|
+
createButtonTitle: 'New',
|
|
16
|
+
});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
- @backstage/core-plugin-api@1.0.5-next.0
|
|
23
|
+
- @backstage/integration-react@1.1.3-next.0
|
|
24
|
+
- @backstage/plugin-catalog-react@1.1.3-next.0
|
|
25
|
+
- @backstage/core-components@0.10.1-next.0
|
|
26
|
+
- @backstage/plugin-search-react@1.0.1-next.0
|
|
27
|
+
|
|
28
|
+
## 1.4.0
|
|
29
|
+
|
|
30
|
+
### Minor Changes
|
|
31
|
+
|
|
32
|
+
- 97c46f2359: Add `spec.targets` (or `spec.target`) for Location entities at the `CatalogTable`.
|
|
33
|
+
- cf288221d1: Add `Location` target(s) to `AboutCard`.
|
|
34
|
+
- a274fe38b9: Add hidden title column to catalog and API table to enable filtering by title.
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- dcaf1cb418: Previously, the color of the Entity Context Menu (in the Entity Page Header) was hardcoded as `white`.
|
|
39
|
+
|
|
40
|
+
This was an issue for themes that use a header with a white background. By default, the color of the icon is now `theme.page.fontColor`.
|
|
41
|
+
|
|
42
|
+
It can now also be overridden in the theme, which is only necessary if the header title, subtitle and three-dots icon need to have different colors. For example:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
export function createThemeOverrides(theme: BackstageTheme): Overrides {
|
|
46
|
+
return {
|
|
47
|
+
PluginCatalogEntityContextMenu: {
|
|
48
|
+
button: {
|
|
49
|
+
color: 'blue',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
...
|
|
53
|
+
},
|
|
54
|
+
...
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- f1dcc6f3c6: Use entity type predicates from catalog-model
|
|
59
|
+
- 258057a4b9: Adding ability to customize the "unregister entity" menu item in the entity context menu on the entity page with options 'visible','hidden','disabled'.With this three new options, one can hide the "unregister entity" menu item from the list, disable or keep it enabled.
|
|
60
|
+
|
|
61
|
+
The boolean input for "unregister entity" will be deprecated later in favour of the above three options.
|
|
62
|
+
|
|
63
|
+
- 385389d23c: Updated to remove usage of the `bursts` object in the theme palette
|
|
64
|
+
- be26d95141: Added new `EntityProcessingStatusPicker` that will filter for entities with orphans and/or errors.
|
|
65
|
+
|
|
66
|
+
If you are using the default Catalog page this picker will be added automatically. For those who have customized their Catalog page you'll need to add this manually by doing something like this:
|
|
67
|
+
|
|
68
|
+
```diff
|
|
69
|
+
...
|
|
70
|
+
import {
|
|
71
|
+
CatalogFilterLayout,
|
|
72
|
+
EntityTypePicker,
|
|
73
|
+
UserListPicker,
|
|
74
|
+
EntityTagPicker
|
|
75
|
+
+ EntityProcessingStatusPicker,
|
|
76
|
+
} from '@backstage/plugin-catalog-react';
|
|
77
|
+
...
|
|
78
|
+
export const CustomCatalogPage = ({
|
|
79
|
+
columns,
|
|
80
|
+
actions,
|
|
81
|
+
initiallySelectedFilter = 'owned',
|
|
82
|
+
}: CatalogPageProps) => {
|
|
83
|
+
return (
|
|
84
|
+
...
|
|
85
|
+
<EntityListProvider>
|
|
86
|
+
<CatalogFilterLayout>
|
|
87
|
+
<CatalogFilterLayout.Filters>
|
|
88
|
+
<EntityKindPicker initialFilter="component" hidden />
|
|
89
|
+
<EntityTypePicker />
|
|
90
|
+
<UserListPicker initialFilter={initiallySelectedFilter} />
|
|
91
|
+
<EntityTagPicker />
|
|
92
|
+
+ <EntityProcessingStatusPicker />
|
|
93
|
+
<CatalogFilterLayout.Filters>
|
|
94
|
+
<CatalogFilterLayout.Content>
|
|
95
|
+
<CatalogTable columns={columns} actions={actions} />
|
|
96
|
+
</CatalogFilterLayout.Content>
|
|
97
|
+
</CatalogFilterLayout>
|
|
98
|
+
</EntityListProvider>
|
|
99
|
+
...
|
|
100
|
+
};
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- Updated dependencies
|
|
104
|
+
- @backstage/core-components@0.10.0
|
|
105
|
+
- @backstage/catalog-model@1.1.0
|
|
106
|
+
- @backstage/plugin-search-react@1.0.0
|
|
107
|
+
- @backstage/plugin-search-common@1.0.0
|
|
108
|
+
- @backstage/core-plugin-api@1.0.4
|
|
109
|
+
- @backstage/catalog-client@1.0.4
|
|
110
|
+
- @backstage/integration-react@1.1.2
|
|
111
|
+
- @backstage/plugin-catalog-react@1.1.2
|
|
112
|
+
- @backstage/theme@0.2.16
|
|
113
|
+
- @backstage/errors@1.1.0
|
|
114
|
+
- @backstage/plugin-catalog-common@1.0.4
|
|
115
|
+
|
|
116
|
+
## 1.4.0-next.3
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- Updated dependencies
|
|
121
|
+
- @backstage/core-plugin-api@1.0.4-next.0
|
|
122
|
+
- @backstage/core-components@0.10.0-next.3
|
|
123
|
+
- @backstage/catalog-client@1.0.4-next.2
|
|
124
|
+
- @backstage/integration-react@1.1.2-next.3
|
|
125
|
+
- @backstage/catalog-model@1.1.0-next.3
|
|
126
|
+
- @backstage/plugin-catalog-react@1.1.2-next.3
|
|
127
|
+
- @backstage/plugin-search-react@0.2.2-next.3
|
|
128
|
+
|
|
3
129
|
## 1.4.0-next.2
|
|
4
130
|
|
|
5
131
|
### Minor Changes
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
2
|
+
import LanguageIcon from '@material-ui/icons/Language';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { makeStyles, Typography, Button } from '@material-ui/core';
|
|
5
|
+
import { CodeSnippet, InfoCard } from '@backstage/core-components';
|
|
6
|
+
import { L as LinksGridList } from './index-2bfd6ae7.esm.js';
|
|
7
|
+
import { useApp } from '@backstage/core-plugin-api';
|
|
8
|
+
import 'zen-observable';
|
|
9
|
+
import '@backstage/catalog-model';
|
|
10
|
+
import 'lodash';
|
|
11
|
+
import '@backstage/integration-react';
|
|
12
|
+
import '@material-ui/icons/Cached';
|
|
13
|
+
import '@material-ui/icons/Description';
|
|
14
|
+
import '@material-ui/icons/Edit';
|
|
15
|
+
import 'react-use/lib/useAsync';
|
|
16
|
+
import '@backstage/plugin-search-react';
|
|
17
|
+
import '@material-ui/icons/OpenInNew';
|
|
18
|
+
import '@material-ui/icons/StarBorder';
|
|
19
|
+
import '@material-ui/core/styles';
|
|
20
|
+
import '@material-ui/icons/Star';
|
|
21
|
+
import '@material-ui/lab';
|
|
22
|
+
import 'react-router';
|
|
23
|
+
import '@material-ui/icons/BugReport';
|
|
24
|
+
import '@material-ui/icons/MoreVert';
|
|
25
|
+
import '@backstage/plugin-catalog-common';
|
|
26
|
+
import '@material-ui/icons/Cancel';
|
|
27
|
+
import '@backstage/errors';
|
|
28
|
+
import '@backstage/catalog-client';
|
|
29
|
+
|
|
30
|
+
const ENTITY_YAML = `metadata:
|
|
31
|
+
name: example
|
|
32
|
+
links:
|
|
33
|
+
- url: https://dashboard.example.com
|
|
34
|
+
title: My Dashboard
|
|
35
|
+
icon: dashboard`;
|
|
36
|
+
const useStyles = makeStyles(
|
|
37
|
+
(theme) => ({
|
|
38
|
+
code: {
|
|
39
|
+
borderRadius: 6,
|
|
40
|
+
margin: `${theme.spacing(2)}px 0px`,
|
|
41
|
+
background: theme.palette.type === "dark" ? "#444" : "#fff"
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
{ name: "PluginCatalogEntityLinksEmptyState" }
|
|
45
|
+
);
|
|
46
|
+
function EntityLinksEmptyState() {
|
|
47
|
+
const classes = useStyles();
|
|
48
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Typography, {
|
|
49
|
+
variant: "body1"
|
|
50
|
+
}, "No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:"), /* @__PURE__ */ React.createElement("div", {
|
|
51
|
+
className: classes.code
|
|
52
|
+
}, /* @__PURE__ */ React.createElement(CodeSnippet, {
|
|
53
|
+
text: ENTITY_YAML,
|
|
54
|
+
language: "yaml",
|
|
55
|
+
showLineNumbers: true,
|
|
56
|
+
highlightedNumbers: [3, 4, 5, 6],
|
|
57
|
+
customStyle: { background: "inherit", fontSize: "115%" }
|
|
58
|
+
})), /* @__PURE__ */ React.createElement(Button, {
|
|
59
|
+
variant: "contained",
|
|
60
|
+
color: "primary",
|
|
61
|
+
target: "_blank",
|
|
62
|
+
href: "https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional"
|
|
63
|
+
}, "Read more"));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function EntityLinksCard(props) {
|
|
67
|
+
var _a;
|
|
68
|
+
const { cols = void 0, variant } = props;
|
|
69
|
+
const { entity } = useEntity();
|
|
70
|
+
const app = useApp();
|
|
71
|
+
const iconResolver = (key) => {
|
|
72
|
+
var _a2;
|
|
73
|
+
return key ? (_a2 = app.getSystemIcon(key)) != null ? _a2 : LanguageIcon : LanguageIcon;
|
|
74
|
+
};
|
|
75
|
+
const links = (_a = entity == null ? void 0 : entity.metadata) == null ? void 0 : _a.links;
|
|
76
|
+
return /* @__PURE__ */ React.createElement(InfoCard, {
|
|
77
|
+
title: "Links",
|
|
78
|
+
variant
|
|
79
|
+
}, !links || links.length === 0 ? /* @__PURE__ */ React.createElement(EntityLinksEmptyState, null) : /* @__PURE__ */ React.createElement(LinksGridList, {
|
|
80
|
+
cols,
|
|
81
|
+
items: links.map(({ url, title, icon }) => ({
|
|
82
|
+
text: title != null ? title : url,
|
|
83
|
+
href: url,
|
|
84
|
+
Icon: iconResolver(icon)
|
|
85
|
+
}))
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { EntityLinksCard };
|
|
90
|
+
//# sourceMappingURL=index-0550248f.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-0550248f.esm.js","sources":["../../src/components/EntityLinksCard/EntityLinksEmptyState.tsx","../../src/components/EntityLinksCard/EntityLinksCard.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 { BackstageTheme } from '@backstage/theme';\nimport { Button, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\nconst ENTITY_YAML = `metadata:\n name: example\n links:\n - url: https://dashboard.example.com\n title: My Dashboard\n icon: dashboard`;\n\n/** @public */\nexport type EntityLinksEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n code: {\n borderRadius: 6,\n margin: `${theme.spacing(2)}px 0px`,\n background: theme.palette.type === 'dark' ? '#444' : '#fff',\n },\n }),\n { name: 'PluginCatalogEntityLinksEmptyState' },\n);\n\nexport function EntityLinksEmptyState() {\n const classes = useStyles();\n\n return (\n <>\n <Typography variant=\"body1\">\n No links defined for this entity. You can add links to your entity YAML\n as shown in the highlighted example below:\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#links-optional\"\n >\n Read more\n </Button>\n </>\n );\n}\n","/*\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 { useEntity } from '@backstage/plugin-catalog-react';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { EntityLinksEmptyState } from './EntityLinksEmptyState';\nimport { LinksGridList } from './LinksGridList';\nimport { ColumnBreakpoints } from './types';\nimport { IconComponent, useApp } from '@backstage/core-plugin-api';\nimport { InfoCard, InfoCardVariants } from '@backstage/core-components';\n\n/** @public */\nexport interface EntityLinksCardProps {\n cols?: ColumnBreakpoints | number;\n variant?: InfoCardVariants;\n}\n\nexport function EntityLinksCard(props: EntityLinksCardProps) {\n const { cols = undefined, variant } = props;\n const { entity } = useEntity();\n const app = useApp();\n\n const iconResolver = (key?: string): IconComponent =>\n key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon;\n\n const links = entity?.metadata?.links;\n\n return (\n <InfoCard title=\"Links\" variant={variant}>\n {!links || links.length === 0 ? (\n <EntityLinksEmptyState />\n ) : (\n <LinksGridList\n cols={cols}\n items={links.map(({ url, title, icon }) => ({\n text: title ?? url,\n href: url,\n Icon: iconResolver(icon),\n }))}\n />\n )}\n </InfoCard>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,WAAW,GAAG,CAAC;AACrB;AACA;AACA;AACA;AACA,qBAAqB,CAAC,CAAC;AACvB,MAAM,SAAS,GAAG,UAAU;AAC5B,EAAE,CAAC,KAAK,MAAM;AACd,IAAI,IAAI,EAAE;AACV,MAAM,YAAY,EAAE,CAAC;AACrB,MAAM,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AACzC,MAAM,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM;AACj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