@backstage/plugin-catalog-react 1.16.0-next.2 → 1.16.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 +217 -0
- package/package.json +20 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,222 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-react
|
|
2
2
|
|
|
3
|
+
## 1.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 7f57365: Add support for a new entity predicate syntax when defining `filter`s related to the blueprints exported via `/alpha` for the new frontend system. For more information, see the [entity filters documentation](https://backstage.io/docs/features/software-catalog/catalog-customization#advanced-customization#entity-filters).
|
|
8
|
+
- ba9649a: Add a new `defaultGroup` parameter to the `EntityContentBlueprint`, here are usage examples:
|
|
9
|
+
|
|
10
|
+
Set a default group while creating the extension:
|
|
11
|
+
|
|
12
|
+
```diff
|
|
13
|
+
const entityKubernetesContent = EntityContentBlueprint.make({
|
|
14
|
+
name: 'kubernetes',
|
|
15
|
+
params: {
|
|
16
|
+
defaultPath: '/kubernetes',
|
|
17
|
+
defaultTitle: 'Kubernetes',
|
|
18
|
+
+ defaultGroup: 'deployment',
|
|
19
|
+
filter: 'kind:component,resource',
|
|
20
|
+
loader: () =>
|
|
21
|
+
import('./KubernetesContentPage').then(m =>
|
|
22
|
+
compatWrapper(<m.KubernetesContentPage />),
|
|
23
|
+
),
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Disassociate an entity content from a default group:
|
|
29
|
+
|
|
30
|
+
```diff
|
|
31
|
+
# app-config.yaml
|
|
32
|
+
app:
|
|
33
|
+
extensions:
|
|
34
|
+
# Entity page content
|
|
35
|
+
- - entity-content:kubernetes/kubernetes
|
|
36
|
+
+ - entity-content:kubernetes/kubernetes:
|
|
37
|
+
+ config:
|
|
38
|
+
+ group: false
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Associate an entity content with a different default or custom group than the one defined in code when the extension was created:
|
|
42
|
+
|
|
43
|
+
```diff
|
|
44
|
+
# app-config.yaml
|
|
45
|
+
app:
|
|
46
|
+
extensions:
|
|
47
|
+
# Entity page content
|
|
48
|
+
- - entity-content:kubernetes/kubernetes
|
|
49
|
+
+ - entity-content:kubernetes/kubernetes:
|
|
50
|
+
+ config:
|
|
51
|
+
+ group: custom # associating this extension with a custom group id, the group should have previously been created via entity page configuration
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- 247a40b: Introduces a new `EntityHeaderBlueprint` that allows you to override the default entity page header.
|
|
56
|
+
|
|
57
|
+
```jsx
|
|
58
|
+
import { EntityHeaderBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
59
|
+
|
|
60
|
+
EntityHeaderBlueprint.make({
|
|
61
|
+
name: 'my-default-header',
|
|
62
|
+
params: {
|
|
63
|
+
loader: () =>
|
|
64
|
+
import('./MyDefaultHeader').then(m => <m.MyDefaultHeader />),
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- a3d93ca: Introduces a new `EntityContentLayoutBlueprint` that creates custom entity content layouts.
|
|
70
|
+
|
|
71
|
+
The layout components receive card elements and can render them as they see fit. Cards is an array of objects with the following properties:
|
|
72
|
+
|
|
73
|
+
- element: `JSx.Element`;
|
|
74
|
+
- type: `"peek" | "info" | "full" | undefined`;
|
|
75
|
+
|
|
76
|
+
### Usage example
|
|
77
|
+
|
|
78
|
+
Creating a custom overview tab layout:
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import {
|
|
82
|
+
EntityContentLayoutProps,
|
|
83
|
+
EntityContentLayoutBlueprint,
|
|
84
|
+
} from '@backstage/plugin-catalog-react/alpha';
|
|
85
|
+
// ...
|
|
86
|
+
|
|
87
|
+
function StickyEntityContentOverviewLayout(props: EntityContentLayoutProps) {
|
|
88
|
+
const { cards } = props;
|
|
89
|
+
const classes = useStyles();
|
|
90
|
+
return (
|
|
91
|
+
<Grid container spacing={3}>
|
|
92
|
+
<Grid
|
|
93
|
+
className={classes.infoArea}
|
|
94
|
+
xs={12}
|
|
95
|
+
md={4}
|
|
96
|
+
item
|
|
97
|
+
>
|
|
98
|
+
<Grid container spacing={3}>
|
|
99
|
+
{cards
|
|
100
|
+
.filter(card => card.type === 'info')
|
|
101
|
+
.map((card, index) => (
|
|
102
|
+
<Grid key={index} xs={12} item>
|
|
103
|
+
{card.element}
|
|
104
|
+
</Grid>
|
|
105
|
+
))}
|
|
106
|
+
</Grid>
|
|
107
|
+
</Grid>
|
|
108
|
+
<Grid xs={12} md={8} item>
|
|
109
|
+
<Grid container spacing={3}>
|
|
110
|
+
{cards
|
|
111
|
+
.filter(card => card.type === 'peek')
|
|
112
|
+
.map((card, index) => (
|
|
113
|
+
<Grid key={index} className={classes.card} xs={12} md={6} item>
|
|
114
|
+
{card.element}
|
|
115
|
+
</Grid>
|
|
116
|
+
))}
|
|
117
|
+
{cards
|
|
118
|
+
.filter(card => !card.type || card.type === 'full')
|
|
119
|
+
.map((card, index) => (
|
|
120
|
+
<Grid key={index} className={classes.card} xs={12} md={6} item>
|
|
121
|
+
{card.element}
|
|
122
|
+
</Grid>
|
|
123
|
+
))}
|
|
124
|
+
</Grid>
|
|
125
|
+
</Grid>
|
|
126
|
+
</Grid>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const customEntityContentOverviewStickyLayoutModule = createFrontendModule({
|
|
131
|
+
pluginId: 'app',
|
|
132
|
+
extensions: [
|
|
133
|
+
EntityContentLayoutBlueprint.make({
|
|
134
|
+
name: 'sticky',
|
|
135
|
+
params: {
|
|
136
|
+
// (optional) defaults the `() => false` filter function
|
|
137
|
+
defaultFilter: 'kind:template'
|
|
138
|
+
loader: async () => StickyEntityContentOverviewLayout,
|
|
139
|
+
},
|
|
140
|
+
}),
|
|
141
|
+
],
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Disabling the custom layout:
|
|
145
|
+
|
|
146
|
+
```yaml
|
|
147
|
+
# app-config.yaml
|
|
148
|
+
app:
|
|
149
|
+
extensions:
|
|
150
|
+
- entity-content-layout:app/sticky: false
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Overriding the custom layout filter:
|
|
154
|
+
|
|
155
|
+
```yaml
|
|
156
|
+
# app-config.yaml
|
|
157
|
+
app:
|
|
158
|
+
extensions:
|
|
159
|
+
- entity-content-layout:app/sticky:
|
|
160
|
+
config:
|
|
161
|
+
# This layout will be used only with component entities
|
|
162
|
+
filter: 'kind:component'
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
- d78bb71: Added `hidden` prop to `EntityTagPicker`, `EntityAutocompletePicker` and `UserListPicker`.
|
|
166
|
+
Added `initialFilter` prop to `EntityTagPicker` to set an initial filter for the picker.
|
|
167
|
+
Added `alwaysKeepFilters` prop to `UserListPicker` to prevent filters from resetting when no entities match the initial filters.
|
|
168
|
+
- a3d93ca: Add an optional `type` parameter to `EntityCard` extensions. A card's type determines characteristics such as its expected size and where it will be rendered by the entity content layout.
|
|
169
|
+
|
|
170
|
+
Initially the following three types are supported:
|
|
171
|
+
|
|
172
|
+
- `peek`: small vertical cards that provide information at a glance, for example recent builds, deployments, and service health.
|
|
173
|
+
- `info`: medium size cards with high priority and frequently used information such as common actions, entity metadata, and links.
|
|
174
|
+
- `full`: Large cards that are more feature rich with more information, typically used by plugins that don't quite need the full content view and want to show a card instead.
|
|
175
|
+
|
|
176
|
+
### Usage examples
|
|
177
|
+
|
|
178
|
+
Defining a default type when creating a card:
|
|
179
|
+
|
|
180
|
+
```diff
|
|
181
|
+
const myCard = EntityCardBlueprint.make({
|
|
182
|
+
name: 'myCard',
|
|
183
|
+
params: {
|
|
184
|
+
+ type: 'info',
|
|
185
|
+
loader: import('./MyCard).then(m => { default: m.MyCard }),
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Changing the card type via `app-config.yaml` file:
|
|
191
|
+
|
|
192
|
+
```diff
|
|
193
|
+
app:
|
|
194
|
+
extensions:
|
|
195
|
+
+ - entity-card:myPlugin/myCard:
|
|
196
|
+
+ config:
|
|
197
|
+
+ type: info
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Patch Changes
|
|
201
|
+
|
|
202
|
+
- bec1e15: update EntityAutocompletePicker selected options when filter value is changed externally
|
|
203
|
+
- 75a3551: Export CatalogAutocomplete so it can be used externally
|
|
204
|
+
- Updated dependencies
|
|
205
|
+
- @backstage/core-components@0.17.0
|
|
206
|
+
- @backstage/core-plugin-api@1.10.5
|
|
207
|
+
- @backstage/frontend-plugin-api@0.10.0
|
|
208
|
+
- @backstage/frontend-test-utils@0.3.0
|
|
209
|
+
- @backstage/core-compat-api@0.4.0
|
|
210
|
+
- @backstage/integration-react@1.2.5
|
|
211
|
+
- @backstage/plugin-permission-react@0.4.32
|
|
212
|
+
- @backstage/catalog-client@1.9.1
|
|
213
|
+
- @backstage/catalog-model@1.7.3
|
|
214
|
+
- @backstage/errors@1.2.7
|
|
215
|
+
- @backstage/types@1.2.1
|
|
216
|
+
- @backstage/version-bridge@1.0.11
|
|
217
|
+
- @backstage/plugin-catalog-common@1.1.3
|
|
218
|
+
- @backstage/plugin-permission-common@0.8.4
|
|
219
|
+
|
|
3
220
|
## 1.16.0-next.2
|
|
4
221
|
|
|
5
222
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-react",
|
|
3
|
-
"version": "1.16.0
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "A frontend library that helps other Backstage plugins interact with the catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library",
|
|
@@ -73,20 +73,20 @@
|
|
|
73
73
|
"test": "backstage-cli package test"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@backstage/catalog-client": "1.9.1",
|
|
77
|
-
"@backstage/catalog-model": "1.7.3",
|
|
78
|
-
"@backstage/core-compat-api": "0.4.0
|
|
79
|
-
"@backstage/core-components": "0.
|
|
80
|
-
"@backstage/core-plugin-api": "1.10.
|
|
81
|
-
"@backstage/errors": "1.2.7",
|
|
82
|
-
"@backstage/frontend-plugin-api": "0.10.0
|
|
83
|
-
"@backstage/frontend-test-utils": "0.3.0
|
|
84
|
-
"@backstage/integration-react": "1.2.5
|
|
85
|
-
"@backstage/plugin-catalog-common": "1.1.3",
|
|
86
|
-
"@backstage/plugin-permission-common": "0.8.4",
|
|
87
|
-
"@backstage/plugin-permission-react": "0.4.
|
|
88
|
-
"@backstage/types": "1.2.1",
|
|
89
|
-
"@backstage/version-bridge": "1.0.11",
|
|
76
|
+
"@backstage/catalog-client": "^1.9.1",
|
|
77
|
+
"@backstage/catalog-model": "^1.7.3",
|
|
78
|
+
"@backstage/core-compat-api": "^0.4.0",
|
|
79
|
+
"@backstage/core-components": "^0.17.0",
|
|
80
|
+
"@backstage/core-plugin-api": "^1.10.5",
|
|
81
|
+
"@backstage/errors": "^1.2.7",
|
|
82
|
+
"@backstage/frontend-plugin-api": "^0.10.0",
|
|
83
|
+
"@backstage/frontend-test-utils": "^0.3.0",
|
|
84
|
+
"@backstage/integration-react": "^1.2.5",
|
|
85
|
+
"@backstage/plugin-catalog-common": "^1.1.3",
|
|
86
|
+
"@backstage/plugin-permission-common": "^0.8.4",
|
|
87
|
+
"@backstage/plugin-permission-react": "^0.4.32",
|
|
88
|
+
"@backstage/types": "^1.2.1",
|
|
89
|
+
"@backstage/version-bridge": "^1.0.11",
|
|
90
90
|
"@material-ui/core": "^4.12.2",
|
|
91
91
|
"@material-ui/icons": "^4.9.1",
|
|
92
92
|
"@material-ui/lab": "4.0.0-alpha.61",
|
|
@@ -100,11 +100,11 @@
|
|
|
100
100
|
"zen-observable": "^0.10.0"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
|
-
"@backstage/cli": "0.31.0
|
|
104
|
-
"@backstage/core-app-api": "1.16.0
|
|
105
|
-
"@backstage/plugin-catalog-common": "1.1.3",
|
|
106
|
-
"@backstage/plugin-scaffolder-common": "1.5.10
|
|
107
|
-
"@backstage/test-utils": "1.7.6
|
|
103
|
+
"@backstage/cli": "^0.31.0",
|
|
104
|
+
"@backstage/core-app-api": "^1.16.0",
|
|
105
|
+
"@backstage/plugin-catalog-common": "^1.1.3",
|
|
106
|
+
"@backstage/plugin-scaffolder-common": "^1.5.10",
|
|
107
|
+
"@backstage/test-utils": "^1.7.6",
|
|
108
108
|
"@testing-library/dom": "^10.0.0",
|
|
109
109
|
"@testing-library/jest-dom": "^6.0.0",
|
|
110
110
|
"@testing-library/react": "^16.0.0",
|