@backstage/plugin-catalog-react 1.19.1 → 1.19.2-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 +12 -0
- package/dist/alpha/blueprints/EntityHeaderBlueprint.esm.js +18 -4
- package/dist/alpha/blueprints/EntityHeaderBlueprint.esm.js.map +1 -1
- package/dist/alpha/converters/convertLegacyEntityCardExtension.esm.js +2 -1
- package/dist/alpha/converters/convertLegacyEntityCardExtension.esm.js.map +1 -1
- package/dist/alpha.d.ts +14 -3
- package/package.json +20 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-react
|
|
2
2
|
|
|
3
|
+
## 1.19.2-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 77eebdc: Support `filter` parameter on the `EntityHeaderBlueprint`
|
|
8
|
+
- a3a878d: Adding `type` as an override to the `convertLegacyEntityCardExtension`
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/core-compat-api@0.4.5-next.0
|
|
11
|
+
- @backstage/integration-react@1.2.9
|
|
12
|
+
- @backstage/frontend-plugin-api@0.10.4
|
|
13
|
+
- @backstage/frontend-test-utils@0.3.5-next.0
|
|
14
|
+
|
|
3
15
|
## 1.19.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import { createExtensionBlueprint, coreExtensionData, ExtensionBoundary } from '@backstage/frontend-plugin-api';
|
|
2
|
+
import { resolveEntityFilterData } from './resolveEntityFilterData.esm.js';
|
|
3
|
+
import { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema.esm.js';
|
|
4
|
+
import { entityFilterFunctionDataRef, entityFilterExpressionDataRef } from './extensionData.esm.js';
|
|
2
5
|
|
|
3
6
|
const EntityHeaderBlueprint = createExtensionBlueprint({
|
|
4
7
|
kind: "entity-header",
|
|
5
|
-
attachTo: { id: "page:catalog/entity", input: "
|
|
8
|
+
attachTo: { id: "page:catalog/entity", input: "headers" },
|
|
6
9
|
dataRefs: {
|
|
10
|
+
filterFunction: entityFilterFunctionDataRef,
|
|
7
11
|
element: coreExtensionData.reactElement
|
|
8
12
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
config: {
|
|
14
|
+
schema: {
|
|
15
|
+
filter: (z) => createEntityPredicateSchema(z).optional()
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
output: [
|
|
19
|
+
entityFilterFunctionDataRef.optional(),
|
|
20
|
+
entityFilterExpressionDataRef.optional(),
|
|
21
|
+
coreExtensionData.reactElement.optional()
|
|
22
|
+
],
|
|
23
|
+
*factory(params, { node, config }) {
|
|
24
|
+
const { loader, filter } = params;
|
|
25
|
+
yield* resolveEntityFilterData(filter, config, node);
|
|
12
26
|
if (loader) {
|
|
13
27
|
yield coreExtensionData.reactElement(
|
|
14
28
|
ExtensionBoundary.lazy(node, loader)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityHeaderBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityHeaderBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 createExtensionBlueprint,\n coreExtensionData,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\n\n/** @alpha */\nexport const EntityHeaderBlueprint = createExtensionBlueprint({\n kind: 'entity-header',\n attachTo: { id: 'page:catalog/entity', input: '
|
|
1
|
+
{"version":3,"file":"EntityHeaderBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityHeaderBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 createExtensionBlueprint,\n coreExtensionData,\n ExtensionBoundary,\n} from '@backstage/frontend-plugin-api';\nimport { EntityPredicate } from '../predicates/types';\nimport { Entity } from '@backstage/catalog-model';\nimport { resolveEntityFilterData } from './resolveEntityFilterData';\nimport { createEntityPredicateSchema } from '../predicates/createEntityPredicateSchema';\nimport {\n entityFilterExpressionDataRef,\n entityFilterFunctionDataRef,\n} from './extensionData';\n\n/** @alpha */\nexport const EntityHeaderBlueprint = createExtensionBlueprint({\n kind: 'entity-header',\n attachTo: { id: 'page:catalog/entity', input: 'headers' },\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n element: coreExtensionData.reactElement,\n },\n config: {\n schema: {\n filter: z => createEntityPredicateSchema(z).optional(),\n },\n },\n output: [\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n coreExtensionData.reactElement.optional(),\n ],\n *factory(\n params: {\n loader: () => Promise<JSX.Element>;\n filter?: EntityPredicate | ((entity: Entity) => boolean);\n },\n { node, config },\n ) {\n const { loader, filter } = params;\n\n yield* resolveEntityFilterData(filter, config, node);\n\n if (loader) {\n yield coreExtensionData.reactElement(\n ExtensionBoundary.lazy(node, loader),\n );\n }\n },\n});\n"],"names":[],"mappings":";;;;;AA+BO,MAAM,wBAAwB,wBAAyB,CAAA;AAAA,EAC5D,IAAM,EAAA,eAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,qBAAA,EAAuB,OAAO,SAAU,EAAA;AAAA,EACxD,QAAU,EAAA;AAAA,IACR,cAAgB,EAAA,2BAAA;AAAA,IAChB,SAAS,iBAAkB,CAAA;AAAA,GAC7B;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,MAAQ,EAAA,CAAA,CAAA,KAAK,2BAA4B,CAAA,CAAC,EAAE,QAAS;AAAA;AACvD,GACF;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,4BAA4B,QAAS,EAAA;AAAA,IACrC,8BAA8B,QAAS,EAAA;AAAA,IACvC,iBAAA,CAAkB,aAAa,QAAS;AAAA,GAC1C;AAAA,EACA,CAAC,OACC,CAAA,MAAA,EAIA,EAAE,IAAA,EAAM,QACR,EAAA;AACA,IAAM,MAAA,EAAE,MAAQ,EAAA,MAAA,EAAW,GAAA,MAAA;AAE3B,IAAO,OAAA,uBAAA,CAAwB,MAAQ,EAAA,MAAA,EAAQ,IAAI,CAAA;AAEnD,IAAA,IAAI,MAAQ,EAAA;AACV,MAAA,MAAM,iBAAkB,CAAA,YAAA;AAAA,QACtB,iBAAA,CAAkB,IAAK,CAAA,IAAA,EAAM,MAAM;AAAA,OACrC;AAAA;AACF;AAEJ,CAAC;;;;"}
|
|
@@ -26,7 +26,8 @@ function convertLegacyEntityCardExtension(LegacyExtension, overrides) {
|
|
|
26
26
|
name: overrides?.name ?? name,
|
|
27
27
|
params: {
|
|
28
28
|
filter: overrides?.filter,
|
|
29
|
-
loader: async () => compatWrapper(element)
|
|
29
|
+
loader: async () => compatWrapper(element),
|
|
30
|
+
type: overrides?.type
|
|
30
31
|
}
|
|
31
32
|
});
|
|
32
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertLegacyEntityCardExtension.esm.js","sources":["../../../src/alpha/converters/convertLegacyEntityCardExtension.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { compatWrapper } from '@backstage/core-compat-api';\nimport { BackstagePlugin, getComponentData } from '@backstage/core-plugin-api';\nimport { ExtensionDefinition } from '@backstage/frontend-plugin-api';\nimport { ComponentType } from 'react';\nimport { EntityCardBlueprint } from '../blueprints/EntityCardBlueprint';\nimport kebabCase from 'lodash/kebabCase';\nimport { EntityPredicate } from '../predicates/types';\nimport { Entity } from '@backstage/catalog-model';\n\n/** @alpha */\nexport function convertLegacyEntityCardExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?: string | EntityPredicate | ((entity: Entity) => boolean);\n },\n): ExtensionDefinition {\n const element = <LegacyExtension />;\n\n const extName = getComponentData<string>(element, 'core.extensionName');\n if (!extName) {\n throw new Error('Extension has no name');\n }\n\n const plugin = getComponentData<BackstagePlugin>(element, 'core.plugin');\n const pluginId = plugin?.getId();\n\n const match = extName.match(/^Entity(.*)Card$/);\n const infix = match?.[1] ?? extName;\n\n let name: string | undefined = infix;\n if (\n pluginId &&\n name\n .toLocaleLowerCase('en-US')\n .startsWith(pluginId.toLocaleLowerCase('en-US'))\n ) {\n name = name.slice(pluginId.length);\n if (!name) {\n name = undefined;\n }\n }\n name = name && kebabCase(name);\n\n return EntityCardBlueprint.make({\n name: overrides?.name ?? name,\n params: {\n filter: overrides?.filter,\n loader: async () => compatWrapper(element),\n },\n });\n}\n"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"convertLegacyEntityCardExtension.esm.js","sources":["../../../src/alpha/converters/convertLegacyEntityCardExtension.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { compatWrapper } from '@backstage/core-compat-api';\nimport { BackstagePlugin, getComponentData } from '@backstage/core-plugin-api';\nimport { ExtensionDefinition } from '@backstage/frontend-plugin-api';\nimport { ComponentType } from 'react';\nimport { EntityCardBlueprint } from '../blueprints/EntityCardBlueprint';\nimport kebabCase from 'lodash/kebabCase';\nimport { EntityPredicate } from '../predicates/types';\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityCardType } from '../blueprints/extensionData';\n\n/** @alpha */\nexport function convertLegacyEntityCardExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?: string | EntityPredicate | ((entity: Entity) => boolean);\n type?: EntityCardType;\n },\n): ExtensionDefinition {\n const element = <LegacyExtension />;\n\n const extName = getComponentData<string>(element, 'core.extensionName');\n if (!extName) {\n throw new Error('Extension has no name');\n }\n\n const plugin = getComponentData<BackstagePlugin>(element, 'core.plugin');\n const pluginId = plugin?.getId();\n\n const match = extName.match(/^Entity(.*)Card$/);\n const infix = match?.[1] ?? extName;\n\n let name: string | undefined = infix;\n if (\n pluginId &&\n name\n .toLocaleLowerCase('en-US')\n .startsWith(pluginId.toLocaleLowerCase('en-US'))\n ) {\n name = name.slice(pluginId.length);\n if (!name) {\n name = undefined;\n }\n }\n name = name && kebabCase(name);\n\n return EntityCardBlueprint.make({\n name: overrides?.name ?? name,\n params: {\n filter: overrides?.filter,\n loader: async () => compatWrapper(element),\n type: overrides?.type,\n },\n });\n}\n"],"names":[],"mappings":";;;;;;AA2BgB,SAAA,gCAAA,CACd,iBACA,SAK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|
|
204
204
|
name: undefined;
|
|
205
205
|
params: {
|
|
206
206
|
loader: () => Promise<JSX.Element>;
|
|
207
|
+
filter?: EntityPredicate | ((entity: Entity) => boolean);
|
|
207
208
|
};
|
|
208
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
209
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: Entity) => boolean, "catalog.entity-filter-function", {
|
|
210
|
+
optional: true;
|
|
211
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
212
|
+
optional: true;
|
|
213
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {
|
|
209
214
|
optional: true;
|
|
210
215
|
}>;
|
|
211
216
|
inputs: {};
|
|
212
|
-
config: {
|
|
213
|
-
|
|
217
|
+
config: {
|
|
218
|
+
filter: EntityPredicate | undefined;
|
|
219
|
+
};
|
|
220
|
+
configInput: {
|
|
221
|
+
filter?: EntityPredicate | undefined;
|
|
222
|
+
};
|
|
214
223
|
dataRefs: {
|
|
224
|
+
filterFunction: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: Entity) => boolean, "catalog.entity-filter-function", {}>;
|
|
215
225
|
element: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}>;
|
|
216
226
|
};
|
|
217
227
|
}>;
|
|
@@ -287,6 +297,7 @@ declare const EntityIconLinkBlueprint: _backstage_frontend_plugin_api.ExtensionB
|
|
|
287
297
|
declare function convertLegacyEntityCardExtension(LegacyExtension: ComponentType<{}>, overrides?: {
|
|
288
298
|
name?: string;
|
|
289
299
|
filter?: string | EntityPredicate | ((entity: Entity) => boolean);
|
|
300
|
+
type?: EntityCardType;
|
|
290
301
|
}): ExtensionDefinition;
|
|
291
302
|
|
|
292
303
|
/** @alpha */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-react",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.2-next.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": "
|
|
77
|
-
"@backstage/catalog-model": "
|
|
78
|
-
"@backstage/core-compat-api": "
|
|
79
|
-
"@backstage/core-components": "
|
|
80
|
-
"@backstage/core-plugin-api": "
|
|
81
|
-
"@backstage/errors": "
|
|
82
|
-
"@backstage/frontend-plugin-api": "
|
|
83
|
-
"@backstage/frontend-test-utils": "
|
|
84
|
-
"@backstage/integration-react": "
|
|
85
|
-
"@backstage/plugin-catalog-common": "
|
|
86
|
-
"@backstage/plugin-permission-common": "
|
|
87
|
-
"@backstage/plugin-permission-react": "
|
|
88
|
-
"@backstage/types": "
|
|
89
|
-
"@backstage/version-bridge": "
|
|
76
|
+
"@backstage/catalog-client": "1.10.2",
|
|
77
|
+
"@backstage/catalog-model": "1.7.5",
|
|
78
|
+
"@backstage/core-compat-api": "0.4.5-next.0",
|
|
79
|
+
"@backstage/core-components": "0.17.4",
|
|
80
|
+
"@backstage/core-plugin-api": "1.10.9",
|
|
81
|
+
"@backstage/errors": "1.2.7",
|
|
82
|
+
"@backstage/frontend-plugin-api": "0.10.4",
|
|
83
|
+
"@backstage/frontend-test-utils": "0.3.5-next.0",
|
|
84
|
+
"@backstage/integration-react": "1.2.9",
|
|
85
|
+
"@backstage/plugin-catalog-common": "1.1.5",
|
|
86
|
+
"@backstage/plugin-permission-common": "0.9.1",
|
|
87
|
+
"@backstage/plugin-permission-react": "0.4.36",
|
|
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": "
|
|
104
|
-
"@backstage/core-app-api": "
|
|
105
|
-
"@backstage/plugin-catalog-common": "
|
|
106
|
-
"@backstage/plugin-scaffolder-common": "
|
|
107
|
-
"@backstage/test-utils": "
|
|
103
|
+
"@backstage/cli": "0.33.1",
|
|
104
|
+
"@backstage/core-app-api": "1.18.0",
|
|
105
|
+
"@backstage/plugin-catalog-common": "1.1.5",
|
|
106
|
+
"@backstage/plugin-scaffolder-common": "1.6.0",
|
|
107
|
+
"@backstage/test-utils": "1.7.10",
|
|
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",
|