@backstage/plugin-catalog-react 1.12.3-next.3 → 1.12.4-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 +49 -0
- package/alpha/package.json +1 -1
- package/dist/alpha/blueprints/EntityCardBlueprint.esm.js +37 -0
- package/dist/alpha/blueprints/EntityCardBlueprint.esm.js.map +1 -0
- package/dist/alpha/blueprints/EntityContentBlueprint.esm.js +53 -0
- package/dist/alpha/blueprints/EntityContentBlueprint.esm.js.map +1 -0
- package/dist/alpha/blueprints/extensionData.esm.js +12 -0
- package/dist/alpha/blueprints/extensionData.esm.js.map +1 -0
- package/dist/alpha/converters/convertLegacyEntityCardExtension.esm.js +36 -0
- package/dist/alpha/converters/convertLegacyEntityCardExtension.esm.js.map +1 -0
- package/dist/alpha/converters/convertLegacyEntityContentExtension.esm.js +44 -0
- package/dist/alpha/converters/convertLegacyEntityContentExtension.esm.js.map +1 -0
- package/dist/alpha.d.ts +98 -71
- package/dist/alpha.esm.js +6 -101
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/EntityOwnerPicker/useFacetsEntities.esm.js +1 -1
- package/dist/components/EntityOwnerPicker/useFacetsEntities.esm.js.map +1 -1
- package/dist/components/FavoriteEntity/FavoriteEntity.esm.js +9 -8
- package/dist/components/FavoriteEntity/FavoriteEntity.esm.js.map +1 -1
- package/dist/index.d.ts +31 -31
- package/package.json +16 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-react
|
|
2
2
|
|
|
3
|
+
## 1.12.4-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fec8b57: Updated exports to use the new type parameters for extensions and extension blueprints.
|
|
8
|
+
- 5446061: The `/alpha` export no longer export extension creators for the new frontend system, existing usage should be switched to use the equivalent extension blueprint instead. For more information see the [new frontend system 1.30 migration documentation](https://backstage.io/docs/frontend-system/architecture/migrations#130).
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/frontend-plugin-api@0.8.0-next.0
|
|
11
|
+
- @backstage/core-compat-api@0.2.9-next.0
|
|
12
|
+
- @backstage/catalog-client@1.6.6
|
|
13
|
+
- @backstage/catalog-model@1.6.0
|
|
14
|
+
- @backstage/core-components@0.14.10
|
|
15
|
+
- @backstage/core-plugin-api@1.9.3
|
|
16
|
+
- @backstage/errors@1.2.4
|
|
17
|
+
- @backstage/integration-react@1.1.30
|
|
18
|
+
- @backstage/types@1.1.1
|
|
19
|
+
- @backstage/version-bridge@1.0.8
|
|
20
|
+
- @backstage/plugin-catalog-common@1.0.26
|
|
21
|
+
- @backstage/plugin-permission-common@0.8.1
|
|
22
|
+
- @backstage/plugin-permission-react@0.4.25
|
|
23
|
+
|
|
24
|
+
## 1.12.3
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 7bd27e1: Deprecate the old pattern of `create*Extension`, and replace it with the equivalent Blueprint implementation instead.
|
|
29
|
+
- 31bfc44: Updated alpha definitions of extension data references.
|
|
30
|
+
- 7ca331c: Correct `EntityDisplayName`'s icon alignment with the text.
|
|
31
|
+
- 9b89b82: Internal refactor to remove unnecessary `routable` prop in the implementation of the `createEntityContentExtension` alpha export.
|
|
32
|
+
- bebd569: Fix extra divider displayed on user list picker component
|
|
33
|
+
- 519b8e0: Added utilities for converting existing entity card and content extensions to the new frontend system. This is in particular useful when used in combination with the new `convertLegacyPlugin` utility from `@backstage/core-compat-api`.
|
|
34
|
+
- d001a42: Fix label related accessibility issues with `FavorityEntity`
|
|
35
|
+
- 012e3eb: Entity page extensions created for the new frontend system via the `/alpha` exports will now be enabled by default.
|
|
36
|
+
- 6349099: Added config input type to the extensions
|
|
37
|
+
- Updated dependencies
|
|
38
|
+
- @backstage/frontend-plugin-api@0.7.0
|
|
39
|
+
- @backstage/core-components@0.14.10
|
|
40
|
+
- @backstage/plugin-permission-common@0.8.1
|
|
41
|
+
- @backstage/core-compat-api@0.2.8
|
|
42
|
+
- @backstage/catalog-model@1.6.0
|
|
43
|
+
- @backstage/catalog-client@1.6.6
|
|
44
|
+
- @backstage/core-plugin-api@1.9.3
|
|
45
|
+
- @backstage/errors@1.2.4
|
|
46
|
+
- @backstage/integration-react@1.1.30
|
|
47
|
+
- @backstage/types@1.1.1
|
|
48
|
+
- @backstage/version-bridge@1.0.8
|
|
49
|
+
- @backstage/plugin-catalog-common@1.0.26
|
|
50
|
+
- @backstage/plugin-permission-react@0.4.25
|
|
51
|
+
|
|
3
52
|
## 1.12.3-next.3
|
|
4
53
|
|
|
5
54
|
### Patch Changes
|
package/alpha/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createExtensionBlueprint, coreExtensionData, ExtensionBoundary } from '@backstage/frontend-plugin-api';
|
|
2
|
+
import { entityFilterFunctionDataRef, entityFilterExpressionDataRef } from './extensionData.esm.js';
|
|
3
|
+
|
|
4
|
+
const EntityCardBlueprint = createExtensionBlueprint({
|
|
5
|
+
kind: "entity-card",
|
|
6
|
+
attachTo: { id: "entity-content:catalog/overview", input: "cards" },
|
|
7
|
+
output: [
|
|
8
|
+
coreExtensionData.reactElement,
|
|
9
|
+
entityFilterFunctionDataRef.optional(),
|
|
10
|
+
entityFilterExpressionDataRef.optional()
|
|
11
|
+
],
|
|
12
|
+
dataRefs: {
|
|
13
|
+
filterFunction: entityFilterFunctionDataRef,
|
|
14
|
+
filterExpression: entityFilterExpressionDataRef
|
|
15
|
+
},
|
|
16
|
+
config: {
|
|
17
|
+
schema: {
|
|
18
|
+
filter: (z) => z.string().optional()
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
*factory({
|
|
22
|
+
loader,
|
|
23
|
+
filter
|
|
24
|
+
}, { node, config }) {
|
|
25
|
+
yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));
|
|
26
|
+
if (config.filter) {
|
|
27
|
+
yield entityFilterExpressionDataRef(config.filter);
|
|
28
|
+
} else if (typeof filter === "string") {
|
|
29
|
+
yield entityFilterExpressionDataRef(filter);
|
|
30
|
+
} else if (typeof filter === "function") {
|
|
31
|
+
yield entityFilterFunctionDataRef(filter);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { EntityCardBlueprint };
|
|
37
|
+
//# sourceMappingURL=EntityCardBlueprint.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityCardBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityCardBlueprint.ts"],"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 {\n ExtensionBoundary,\n coreExtensionData,\n createExtensionBlueprint,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityFilterFunctionDataRef,\n entityFilterExpressionDataRef,\n} from './extensionData';\n\n/**\n * @alpha\n * A blueprint for creating cards for the entity pages in the catalog.\n */\nexport const EntityCardBlueprint = createExtensionBlueprint({\n kind: 'entity-card',\n attachTo: { id: 'entity-content:catalog/overview', input: 'cards' },\n output: [\n coreExtensionData.reactElement,\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n ],\n dataRefs: {\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n },\n config: {\n schema: {\n filter: z => z.string().optional(),\n },\n },\n *factory(\n {\n loader,\n filter,\n }: {\n loader: () => Promise<JSX.Element>;\n filter?:\n | typeof entityFilterFunctionDataRef.T\n | typeof entityFilterExpressionDataRef.T;\n },\n { node, config },\n ) {\n yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));\n\n if (config.filter) {\n yield entityFilterExpressionDataRef(config.filter);\n } else if (typeof filter === 'string') {\n yield entityFilterExpressionDataRef(filter);\n } else if (typeof filter === 'function') {\n yield entityFilterFunctionDataRef(filter);\n }\n },\n});\n"],"names":[],"mappings":";;;AA8BO,MAAM,sBAAsB,wBAAyB,CAAA;AAAA,EAC1D,IAAM,EAAA,aAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,iCAAA,EAAmC,OAAO,OAAQ,EAAA;AAAA,EAClE,MAAQ,EAAA;AAAA,IACN,iBAAkB,CAAA,YAAA;AAAA,IAClB,4BAA4B,QAAS,EAAA;AAAA,IACrC,8BAA8B,QAAS,EAAA;AAAA,GACzC;AAAA,EACA,QAAU,EAAA;AAAA,IACR,cAAgB,EAAA,2BAAA;AAAA,IAChB,gBAAkB,EAAA,6BAAA;AAAA,GACpB;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,MAAQ,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,KACnC;AAAA,GACF;AAAA,EACA,CAAC,OACC,CAAA;AAAA,IACE,MAAA;AAAA,IACA,MAAA;AAAA,GAOF,EAAA,EAAE,IAAM,EAAA,MAAA,EACR,EAAA;AACA,IAAA,MAAM,kBAAkB,YAAa,CAAA,iBAAA,CAAkB,IAAK,CAAA,IAAA,EAAM,MAAM,CAAC,CAAA,CAAA;AAEzE,IAAA,IAAI,OAAO,MAAQ,EAAA;AACjB,MAAM,MAAA,6BAAA,CAA8B,OAAO,MAAM,CAAA,CAAA;AAAA,KACnD,MAAA,IAAW,OAAO,MAAA,KAAW,QAAU,EAAA;AACrC,MAAA,MAAM,8BAA8B,MAAM,CAAA,CAAA;AAAA,KAC5C,MAAA,IAAW,OAAO,MAAA,KAAW,UAAY,EAAA;AACvC,MAAA,MAAM,4BAA4B,MAAM,CAAA,CAAA;AAAA,KAC1C;AAAA,GACF;AACF,CAAC;;;;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { createExtensionBlueprint, coreExtensionData, ExtensionBoundary } from '@backstage/frontend-plugin-api';
|
|
2
|
+
import { entityContentTitleDataRef, entityFilterFunctionDataRef, entityFilterExpressionDataRef } from './extensionData.esm.js';
|
|
3
|
+
|
|
4
|
+
const EntityContentBlueprint = createExtensionBlueprint({
|
|
5
|
+
kind: "entity-content",
|
|
6
|
+
attachTo: { id: "page:catalog/entity", input: "contents" },
|
|
7
|
+
output: [
|
|
8
|
+
coreExtensionData.reactElement,
|
|
9
|
+
coreExtensionData.routePath,
|
|
10
|
+
entityContentTitleDataRef,
|
|
11
|
+
coreExtensionData.routeRef.optional(),
|
|
12
|
+
entityFilterFunctionDataRef.optional(),
|
|
13
|
+
entityFilterExpressionDataRef.optional()
|
|
14
|
+
],
|
|
15
|
+
dataRefs: {
|
|
16
|
+
title: entityContentTitleDataRef,
|
|
17
|
+
filterFunction: entityFilterFunctionDataRef,
|
|
18
|
+
filterExpression: entityFilterExpressionDataRef
|
|
19
|
+
},
|
|
20
|
+
config: {
|
|
21
|
+
schema: {
|
|
22
|
+
path: (z) => z.string().optional(),
|
|
23
|
+
title: (z) => z.string().optional(),
|
|
24
|
+
filter: (z) => z.string().optional()
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
*factory({
|
|
28
|
+
loader,
|
|
29
|
+
defaultPath,
|
|
30
|
+
defaultTitle,
|
|
31
|
+
filter,
|
|
32
|
+
routeRef
|
|
33
|
+
}, { node, config }) {
|
|
34
|
+
const path = config.path ?? defaultPath;
|
|
35
|
+
const title = config.title ?? defaultTitle;
|
|
36
|
+
yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));
|
|
37
|
+
yield coreExtensionData.routePath(path);
|
|
38
|
+
yield entityContentTitleDataRef(title);
|
|
39
|
+
if (routeRef) {
|
|
40
|
+
yield coreExtensionData.routeRef(routeRef);
|
|
41
|
+
}
|
|
42
|
+
if (config.filter) {
|
|
43
|
+
yield entityFilterExpressionDataRef(config.filter);
|
|
44
|
+
} else if (typeof filter === "string") {
|
|
45
|
+
yield entityFilterExpressionDataRef(filter);
|
|
46
|
+
} else if (typeof filter === "function") {
|
|
47
|
+
yield entityFilterFunctionDataRef(filter);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export { EntityContentBlueprint };
|
|
53
|
+
//# sourceMappingURL=EntityContentBlueprint.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityContentBlueprint.esm.js","sources":["../../../src/alpha/blueprints/EntityContentBlueprint.ts"],"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 {\n coreExtensionData,\n createExtensionBlueprint,\n ExtensionBoundary,\n RouteRef,\n} from '@backstage/frontend-plugin-api';\nimport {\n entityContentTitleDataRef,\n entityFilterFunctionDataRef,\n entityFilterExpressionDataRef,\n} from './extensionData';\n\n/**\n * @alpha\n * Creates an EntityContent extension.\n */\nexport const EntityContentBlueprint = createExtensionBlueprint({\n kind: 'entity-content',\n attachTo: { id: 'page:catalog/entity', input: 'contents' },\n output: [\n coreExtensionData.reactElement,\n coreExtensionData.routePath,\n entityContentTitleDataRef,\n coreExtensionData.routeRef.optional(),\n entityFilterFunctionDataRef.optional(),\n entityFilterExpressionDataRef.optional(),\n ],\n dataRefs: {\n title: entityContentTitleDataRef,\n filterFunction: entityFilterFunctionDataRef,\n filterExpression: entityFilterExpressionDataRef,\n },\n config: {\n schema: {\n path: z => z.string().optional(),\n title: z => z.string().optional(),\n filter: z => z.string().optional(),\n },\n },\n *factory(\n {\n loader,\n defaultPath,\n defaultTitle,\n filter,\n routeRef,\n }: {\n loader: () => Promise<JSX.Element>;\n defaultPath: string;\n defaultTitle: string;\n routeRef?: RouteRef;\n filter?:\n | typeof entityFilterFunctionDataRef.T\n | typeof entityFilterExpressionDataRef.T;\n },\n { node, config },\n ) {\n const path = config.path ?? defaultPath;\n const title = config.title ?? defaultTitle;\n\n yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));\n\n yield coreExtensionData.routePath(path);\n\n yield entityContentTitleDataRef(title);\n\n if (routeRef) {\n yield coreExtensionData.routeRef(routeRef);\n }\n\n if (config.filter) {\n yield entityFilterExpressionDataRef(config.filter);\n } else if (typeof filter === 'string') {\n yield entityFilterExpressionDataRef(filter);\n } else if (typeof filter === 'function') {\n yield entityFilterFunctionDataRef(filter);\n }\n },\n});\n"],"names":[],"mappings":";;;AAgCO,MAAM,yBAAyB,wBAAyB,CAAA;AAAA,EAC7D,IAAM,EAAA,gBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,qBAAA,EAAuB,OAAO,UAAW,EAAA;AAAA,EACzD,MAAQ,EAAA;AAAA,IACN,iBAAkB,CAAA,YAAA;AAAA,IAClB,iBAAkB,CAAA,SAAA;AAAA,IAClB,yBAAA;AAAA,IACA,iBAAA,CAAkB,SAAS,QAAS,EAAA;AAAA,IACpC,4BAA4B,QAAS,EAAA;AAAA,IACrC,8BAA8B,QAAS,EAAA;AAAA,GACzC;AAAA,EACA,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,yBAAA;AAAA,IACP,cAAgB,EAAA,2BAAA;AAAA,IAChB,gBAAkB,EAAA,6BAAA;AAAA,GACpB;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,MAC/B,KAAO,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,MAChC,MAAQ,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,KACnC;AAAA,GACF;AAAA,EACA,CAAC,OACC,CAAA;AAAA,IACE,MAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA;AAAA,GAUF,EAAA,EAAE,IAAM,EAAA,MAAA,EACR,EAAA;AACA,IAAM,MAAA,IAAA,GAAO,OAAO,IAAQ,IAAA,WAAA,CAAA;AAC5B,IAAM,MAAA,KAAA,GAAQ,OAAO,KAAS,IAAA,YAAA,CAAA;AAE9B,IAAA,MAAM,kBAAkB,YAAa,CAAA,iBAAA,CAAkB,IAAK,CAAA,IAAA,EAAM,MAAM,CAAC,CAAA,CAAA;AAEzE,IAAM,MAAA,iBAAA,CAAkB,UAAU,IAAI,CAAA,CAAA;AAEtC,IAAA,MAAM,0BAA0B,KAAK,CAAA,CAAA;AAErC,IAAA,IAAI,QAAU,EAAA;AACZ,MAAM,MAAA,iBAAA,CAAkB,SAAS,QAAQ,CAAA,CAAA;AAAA,KAC3C;AAEA,IAAA,IAAI,OAAO,MAAQ,EAAA;AACjB,MAAM,MAAA,6BAAA,CAA8B,OAAO,MAAM,CAAA,CAAA;AAAA,KACnD,MAAA,IAAW,OAAO,MAAA,KAAW,QAAU,EAAA;AACrC,MAAA,MAAM,8BAA8B,MAAM,CAAA,CAAA;AAAA,KAC5C,MAAA,IAAW,OAAO,MAAA,KAAW,UAAY,EAAA;AACvC,MAAA,MAAM,4BAA4B,MAAM,CAAA,CAAA;AAAA,KAC1C;AAAA,GACF;AACF,CAAC;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createExtensionDataRef } from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
const entityContentTitleDataRef = createExtensionDataRef().with({
|
|
4
|
+
id: "catalog.entity-content-title"
|
|
5
|
+
});
|
|
6
|
+
const entityFilterFunctionDataRef = createExtensionDataRef().with({ id: "catalog.entity-filter-function" });
|
|
7
|
+
const entityFilterExpressionDataRef = createExtensionDataRef().with({
|
|
8
|
+
id: "catalog.entity-filter-expression"
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { entityContentTitleDataRef, entityFilterExpressionDataRef, entityFilterFunctionDataRef };
|
|
12
|
+
//# sourceMappingURL=extensionData.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensionData.esm.js","sources":["../../../src/alpha/blueprints/extensionData.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 { Entity } from '@backstage/catalog-model';\nimport { createExtensionDataRef } from '@backstage/frontend-plugin-api';\n\n/** @internal */\nexport const entityContentTitleDataRef = createExtensionDataRef<string>().with({\n id: 'catalog.entity-content-title',\n});\n\n/** @internal */\nexport const entityFilterFunctionDataRef = createExtensionDataRef<\n (entity: Entity) => boolean\n>().with({ id: 'catalog.entity-filter-function' });\n\n/** @internal */\nexport const entityFilterExpressionDataRef =\n createExtensionDataRef<string>().with({\n id: 'catalog.entity-filter-expression',\n });\n"],"names":[],"mappings":";;AAoBa,MAAA,yBAAA,GAA4B,sBAA+B,EAAA,CAAE,IAAK,CAAA;AAAA,EAC7E,EAAI,EAAA,8BAAA;AACN,CAAC,EAAA;AAGM,MAAM,8BAA8B,sBAEzC,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,kCAAkC,EAAA;AAGpC,MAAA,6BAAA,GACX,sBAA+B,EAAA,CAAE,IAAK,CAAA;AAAA,EACpC,EAAI,EAAA,kCAAA;AACN,CAAC;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { compatWrapper } from '@backstage/core-compat-api';
|
|
2
|
+
import { getComponentData } from '@backstage/core-plugin-api';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { EntityCardBlueprint } from '../blueprints/EntityCardBlueprint.esm.js';
|
|
5
|
+
import '../blueprints/EntityContentBlueprint.esm.js';
|
|
6
|
+
import kebabCase from 'lodash/kebabCase';
|
|
7
|
+
|
|
8
|
+
function convertLegacyEntityCardExtension(LegacyExtension, overrides) {
|
|
9
|
+
const element = /* @__PURE__ */ React.createElement(LegacyExtension, null);
|
|
10
|
+
const extName = getComponentData(element, "core.extensionName");
|
|
11
|
+
if (!extName) {
|
|
12
|
+
throw new Error("Extension has no name");
|
|
13
|
+
}
|
|
14
|
+
const plugin = getComponentData(element, "core.plugin");
|
|
15
|
+
const pluginId = plugin?.getId();
|
|
16
|
+
const match = extName.match(/^Entity(.*)Card$/);
|
|
17
|
+
const infix = match?.[1] ?? extName;
|
|
18
|
+
let name = infix;
|
|
19
|
+
if (pluginId && name.toLocaleLowerCase("en-US").startsWith(pluginId.toLocaleLowerCase("en-US"))) {
|
|
20
|
+
name = name.slice(pluginId.length);
|
|
21
|
+
if (!name) {
|
|
22
|
+
name = void 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
name = name && kebabCase(name);
|
|
26
|
+
return EntityCardBlueprint.make({
|
|
27
|
+
name: overrides?.name ?? name,
|
|
28
|
+
params: {
|
|
29
|
+
filter: overrides?.filter,
|
|
30
|
+
loader: async () => compatWrapper(element)
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { convertLegacyEntityCardExtension };
|
|
36
|
+
//# sourceMappingURL=convertLegacyEntityCardExtension.esm.js.map
|
|
@@ -0,0 +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 React, { ComponentType } from 'react';\nimport { EntityCardBlueprint } from '../blueprints';\nimport kebabCase from 'lodash/kebabCase';\n\n/** @alpha */\nexport function convertLegacyEntityCardExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?:\n | typeof EntityCardBlueprint.dataRefs.filterFunction.T\n | typeof EntityCardBlueprint.dataRefs.filterExpression.T;\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":";;;;;;;AAwBgB,SAAA,gCAAA,CACd,iBACA,SAMqB,EAAA;AACrB,EAAM,MAAA,OAAA,uCAAW,eAAgB,EAAA,IAAA,CAAA,CAAA;AAEjC,EAAM,MAAA,OAAA,GAAU,gBAAyB,CAAA,OAAA,EAAS,oBAAoB,CAAA,CAAA;AACtE,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAM,MAAA,IAAI,MAAM,uBAAuB,CAAA,CAAA;AAAA,GACzC;AAEA,EAAM,MAAA,MAAA,GAAS,gBAAkC,CAAA,OAAA,EAAS,aAAa,CAAA,CAAA;AACvE,EAAM,MAAA,QAAA,GAAW,QAAQ,KAAM,EAAA,CAAA;AAE/B,EAAM,MAAA,KAAA,GAAQ,OAAQ,CAAA,KAAA,CAAM,kBAAkB,CAAA,CAAA;AAC9C,EAAM,MAAA,KAAA,GAAQ,KAAQ,GAAA,CAAC,CAAK,IAAA,OAAA,CAAA;AAE5B,EAAA,IAAI,IAA2B,GAAA,KAAA,CAAA;AAC/B,EACE,IAAA,QAAA,IACA,IACG,CAAA,iBAAA,CAAkB,OAAO,CAAA,CACzB,WAAW,QAAS,CAAA,iBAAA,CAAkB,OAAO,CAAC,CACjD,EAAA;AACA,IAAO,IAAA,GAAA,IAAA,CAAK,KAAM,CAAA,QAAA,CAAS,MAAM,CAAA,CAAA;AACjC,IAAA,IAAI,CAAC,IAAM,EAAA;AACT,MAAO,IAAA,GAAA,KAAA,CAAA,CAAA;AAAA,KACT;AAAA,GACF;AACA,EAAO,IAAA,GAAA,IAAA,IAAQ,UAAU,IAAI,CAAA,CAAA;AAE7B,EAAA,OAAO,oBAAoB,IAAK,CAAA;AAAA,IAC9B,IAAA,EAAM,WAAW,IAAQ,IAAA,IAAA;AAAA,IACzB,MAAQ,EAAA;AAAA,MACN,QAAQ,SAAW,EAAA,MAAA;AAAA,MACnB,MAAA,EAAQ,YAAY,aAAA,CAAc,OAAO,CAAA;AAAA,KAC3C;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { convertLegacyRouteRef, compatWrapper } from '@backstage/core-compat-api';
|
|
2
|
+
import { getComponentData } from '@backstage/core-plugin-api';
|
|
3
|
+
import kebabCase from 'lodash/kebabCase';
|
|
4
|
+
import startCase from 'lodash/startCase';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import '../blueprints/EntityCardBlueprint.esm.js';
|
|
7
|
+
import { EntityContentBlueprint } from '../blueprints/EntityContentBlueprint.esm.js';
|
|
8
|
+
|
|
9
|
+
function convertLegacyEntityContentExtension(LegacyExtension, overrides) {
|
|
10
|
+
const element = /* @__PURE__ */ React.createElement(LegacyExtension, null);
|
|
11
|
+
const extName = getComponentData(element, "core.extensionName");
|
|
12
|
+
if (!extName) {
|
|
13
|
+
throw new Error("Extension has no name");
|
|
14
|
+
}
|
|
15
|
+
const mountPoint = getComponentData(
|
|
16
|
+
element,
|
|
17
|
+
"core.mountPoint"
|
|
18
|
+
);
|
|
19
|
+
const plugin = getComponentData(element, "core.plugin");
|
|
20
|
+
const pluginId = plugin?.getId();
|
|
21
|
+
const match = extName.match(/^Entity(.*)Content$/);
|
|
22
|
+
const infix = match?.[1] ?? extName;
|
|
23
|
+
let name = infix;
|
|
24
|
+
if (pluginId && name.toLocaleLowerCase("en-US").startsWith(pluginId.toLocaleLowerCase("en-US"))) {
|
|
25
|
+
name = name.slice(pluginId.length);
|
|
26
|
+
if (!name) {
|
|
27
|
+
name = void 0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
name = name && kebabCase(name);
|
|
31
|
+
return EntityContentBlueprint.make({
|
|
32
|
+
name: overrides?.name ?? name,
|
|
33
|
+
params: {
|
|
34
|
+
filter: overrides?.filter,
|
|
35
|
+
defaultPath: overrides?.defaultPath ?? `/${kebabCase(infix)}`,
|
|
36
|
+
defaultTitle: overrides?.defaultTitle ?? startCase(infix),
|
|
37
|
+
routeRef: mountPoint && convertLegacyRouteRef(mountPoint),
|
|
38
|
+
loader: async () => compatWrapper(element)
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { convertLegacyEntityContentExtension };
|
|
44
|
+
//# sourceMappingURL=convertLegacyEntityContentExtension.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertLegacyEntityContentExtension.esm.js","sources":["../../../src/alpha/converters/convertLegacyEntityContentExtension.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 {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport {\n BackstagePlugin,\n getComponentData,\n RouteRef as LegacyRouteRef,\n} from '@backstage/core-plugin-api';\nimport { ExtensionDefinition } from '@backstage/frontend-plugin-api';\nimport kebabCase from 'lodash/kebabCase';\nimport startCase from 'lodash/startCase';\nimport React, { ComponentType } from 'react';\nimport { EntityContentBlueprint } from '../blueprints';\n\n/** @alpha */\nexport function convertLegacyEntityContentExtension(\n LegacyExtension: ComponentType<{}>,\n overrides?: {\n name?: string;\n filter?:\n | typeof EntityContentBlueprint.dataRefs.filterFunction.T\n | typeof EntityContentBlueprint.dataRefs.filterExpression.T;\n defaultPath?: string;\n defaultTitle?: string;\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 mountPoint = getComponentData<LegacyRouteRef>(\n element,\n 'core.mountPoint',\n );\n\n const plugin = getComponentData<BackstagePlugin>(element, 'core.plugin');\n const pluginId = plugin?.getId();\n\n const match = extName.match(/^Entity(.*)Content$/);\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 EntityContentBlueprint.make({\n name: overrides?.name ?? name,\n params: {\n filter: overrides?.filter,\n defaultPath: overrides?.defaultPath ?? `/${kebabCase(infix)}`,\n defaultTitle: overrides?.defaultTitle ?? startCase(infix),\n routeRef: mountPoint && convertLegacyRouteRef(mountPoint),\n loader: async () => compatWrapper(element),\n },\n });\n}\n"],"names":[],"mappings":";;;;;;;;AAgCgB,SAAA,mCAAA,CACd,iBACA,SAQqB,EAAA;AACrB,EAAM,MAAA,OAAA,uCAAW,eAAgB,EAAA,IAAA,CAAA,CAAA;AAEjC,EAAM,MAAA,OAAA,GAAU,gBAAyB,CAAA,OAAA,EAAS,oBAAoB,CAAA,CAAA;AACtE,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAM,MAAA,IAAI,MAAM,uBAAuB,CAAA,CAAA;AAAA,GACzC;AAEA,EAAA,MAAM,UAAa,GAAA,gBAAA;AAAA,IACjB,OAAA;AAAA,IACA,iBAAA;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,MAAA,GAAS,gBAAkC,CAAA,OAAA,EAAS,aAAa,CAAA,CAAA;AACvE,EAAM,MAAA,QAAA,GAAW,QAAQ,KAAM,EAAA,CAAA;AAE/B,EAAM,MAAA,KAAA,GAAQ,OAAQ,CAAA,KAAA,CAAM,qBAAqB,CAAA,CAAA;AACjD,EAAM,MAAA,KAAA,GAAQ,KAAQ,GAAA,CAAC,CAAK,IAAA,OAAA,CAAA;AAE5B,EAAA,IAAI,IAA2B,GAAA,KAAA,CAAA;AAC/B,EACE,IAAA,QAAA,IACA,IACG,CAAA,iBAAA,CAAkB,OAAO,CAAA,CACzB,WAAW,QAAS,CAAA,iBAAA,CAAkB,OAAO,CAAC,CACjD,EAAA;AACA,IAAO,IAAA,GAAA,IAAA,CAAK,KAAM,CAAA,QAAA,CAAS,MAAM,CAAA,CAAA;AACjC,IAAA,IAAI,CAAC,IAAM,EAAA;AACT,MAAO,IAAA,GAAA,KAAA,CAAA,CAAA;AAAA,KACT;AAAA,GACF;AACA,EAAO,IAAA,GAAA,IAAA,IAAQ,UAAU,IAAI,CAAA,CAAA;AAE7B,EAAA,OAAO,uBAAuB,IAAK,CAAA;AAAA,IACjC,IAAA,EAAM,WAAW,IAAQ,IAAA,IAAA;AAAA,IACzB,MAAQ,EAAA;AAAA,MACN,QAAQ,SAAW,EAAA,MAAA;AAAA,MACnB,aAAa,SAAW,EAAA,WAAA,IAAe,CAAI,CAAA,EAAA,SAAA,CAAU,KAAK,CAAC,CAAA,CAAA;AAAA,MAC3D,YAAc,EAAA,SAAA,EAAW,YAAgB,IAAA,SAAA,CAAU,KAAK,CAAA;AAAA,MACxD,QAAA,EAAU,UAAc,IAAA,qBAAA,CAAsB,UAAU,CAAA;AAAA,MACxD,MAAA,EAAQ,YAAY,aAAA,CAAc,OAAO,CAAA;AAAA,KAC3C;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
3
|
-
import {
|
|
3
|
+
import { RouteRef, ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ComponentType } from 'react';
|
|
6
|
+
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
4
7
|
import { Entity } from '@backstage/catalog-model';
|
|
5
|
-
import { ResourcePermission } from '@backstage/plugin-permission-common';
|
|
6
8
|
import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/alpha';
|
|
9
|
+
import { ResourcePermission } from '@backstage/plugin-permission-common';
|
|
7
10
|
|
|
8
11
|
/**
|
|
9
12
|
* Returns true if the `owner` argument is a direct owner on the `entity` argument.
|
|
@@ -17,29 +20,88 @@ import * as _backstage_core_plugin_api_alpha from '@backstage/core-plugin-api/al
|
|
|
17
20
|
declare function isOwnerOf(owner: Entity, entity: Entity): boolean;
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
23
|
+
* @alpha
|
|
24
|
+
* A blueprint for creating cards for the entity pages in the catalog.
|
|
22
25
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
declare const EntityCardBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
|
|
27
|
+
kind: "entity-card";
|
|
28
|
+
namespace: undefined;
|
|
29
|
+
name: undefined;
|
|
30
|
+
params: {
|
|
31
|
+
loader: () => Promise<JSX.Element>;
|
|
32
|
+
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
33
|
+
};
|
|
34
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
35
|
+
optional: true;
|
|
36
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
37
|
+
optional: true;
|
|
38
|
+
}>;
|
|
39
|
+
inputs: {};
|
|
40
|
+
config: {
|
|
41
|
+
filter: string | undefined;
|
|
42
|
+
};
|
|
43
|
+
configInput: {
|
|
44
|
+
filter?: string | undefined;
|
|
45
|
+
};
|
|
46
|
+
dataRefs: {
|
|
47
|
+
filterFunction: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {}>;
|
|
48
|
+
filterExpression: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {}>;
|
|
49
|
+
};
|
|
50
|
+
}>;
|
|
26
51
|
|
|
27
52
|
/**
|
|
28
|
-
* A thin wrapper around the
|
|
29
|
-
* {@link @backstage/plugin-permission-react#usePermission} hook which uses the
|
|
30
|
-
* current entity in context to make an authorization request for the given
|
|
31
|
-
* {@link @backstage/plugin-catalog-common#CatalogEntityPermission}.
|
|
32
|
-
*
|
|
33
|
-
* Note: this hook blocks the permission request until the entity has loaded in
|
|
34
|
-
* context. If you have the entityRef and need concurrent requests, use the
|
|
35
|
-
* `usePermission` hook directly.
|
|
36
53
|
* @alpha
|
|
54
|
+
* Creates an EntityContent extension.
|
|
37
55
|
*/
|
|
38
|
-
declare
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
56
|
+
declare const EntityContentBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
|
|
57
|
+
kind: "entity-content";
|
|
58
|
+
namespace: undefined;
|
|
59
|
+
name: undefined;
|
|
60
|
+
params: {
|
|
61
|
+
loader: () => Promise<JSX.Element>;
|
|
62
|
+
defaultPath: string;
|
|
63
|
+
defaultTitle: string;
|
|
64
|
+
routeRef?: RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
65
|
+
filter?: string | ((entity: _backstage_catalog_model.Entity) => boolean) | undefined;
|
|
66
|
+
};
|
|
67
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<React.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
68
|
+
optional: true;
|
|
69
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
70
|
+
optional: true;
|
|
71
|
+
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
72
|
+
optional: true;
|
|
73
|
+
}>;
|
|
74
|
+
inputs: {};
|
|
75
|
+
config: {
|
|
76
|
+
path: string | undefined;
|
|
77
|
+
title: string | undefined;
|
|
78
|
+
filter: string | undefined;
|
|
79
|
+
};
|
|
80
|
+
configInput: {
|
|
81
|
+
filter?: string | undefined;
|
|
82
|
+
title?: string | undefined;
|
|
83
|
+
path?: string | undefined;
|
|
84
|
+
};
|
|
85
|
+
dataRefs: {
|
|
86
|
+
title: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-title", {}>;
|
|
87
|
+
filterFunction: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {}>;
|
|
88
|
+
filterExpression: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {}>;
|
|
89
|
+
};
|
|
90
|
+
}>;
|
|
91
|
+
|
|
92
|
+
/** @alpha */
|
|
93
|
+
declare function convertLegacyEntityCardExtension(LegacyExtension: ComponentType<{}>, overrides?: {
|
|
94
|
+
name?: string;
|
|
95
|
+
filter?: typeof EntityCardBlueprint.dataRefs.filterFunction.T | typeof EntityCardBlueprint.dataRefs.filterExpression.T;
|
|
96
|
+
}): ExtensionDefinition;
|
|
97
|
+
|
|
98
|
+
/** @alpha */
|
|
99
|
+
declare function convertLegacyEntityContentExtension(LegacyExtension: ComponentType<{}>, overrides?: {
|
|
100
|
+
name?: string;
|
|
101
|
+
filter?: typeof EntityContentBlueprint.dataRefs.filterFunction.T | typeof EntityContentBlueprint.dataRefs.filterExpression.T;
|
|
102
|
+
defaultPath?: string;
|
|
103
|
+
defaultTitle?: string;
|
|
104
|
+
}): ExtensionDefinition;
|
|
43
105
|
|
|
44
106
|
/** @alpha */
|
|
45
107
|
declare const catalogReactTranslationRef: _backstage_core_plugin_api_alpha.TranslationRef<"catalog-react", {
|
|
@@ -96,56 +158,21 @@ declare const catalogReactTranslationRef: _backstage_core_plugin_api_alpha.Trans
|
|
|
96
158
|
readonly "userListPicker.personalFilter.starredLabel": "Starred";
|
|
97
159
|
}>;
|
|
98
160
|
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
161
|
+
/**
|
|
162
|
+
* A thin wrapper around the
|
|
163
|
+
* {@link @backstage/plugin-permission-react#usePermission} hook which uses the
|
|
164
|
+
* current entity in context to make an authorization request for the given
|
|
165
|
+
* {@link @backstage/plugin-catalog-common#CatalogEntityPermission}.
|
|
166
|
+
*
|
|
167
|
+
* Note: this hook blocks the permission request until the entity has loaded in
|
|
168
|
+
* context. If you have the entityRef and need concurrent requests, use the
|
|
169
|
+
* `usePermission` hook directly.
|
|
170
|
+
* @alpha
|
|
171
|
+
*/
|
|
172
|
+
declare function useEntityPermission(permission: ResourcePermission<'catalog-entity'>): {
|
|
173
|
+
loading: boolean;
|
|
174
|
+
allowed: boolean;
|
|
175
|
+
error?: Error;
|
|
104
176
|
};
|
|
105
|
-
/** @alpha */
|
|
106
|
-
declare function createEntityCardExtension<TConfig extends {
|
|
107
|
-
filter?: string;
|
|
108
|
-
}, TInputs extends AnyExtensionInputMap>(options: {
|
|
109
|
-
namespace?: string;
|
|
110
|
-
name?: string;
|
|
111
|
-
attachTo?: {
|
|
112
|
-
id: string;
|
|
113
|
-
input: string;
|
|
114
|
-
};
|
|
115
|
-
disabled?: boolean;
|
|
116
|
-
inputs?: TInputs;
|
|
117
|
-
configSchema?: PortableSchema<TConfig>;
|
|
118
|
-
filter?: typeof catalogExtensionData.entityFilterFunction.T | typeof catalogExtensionData.entityFilterExpression.T;
|
|
119
|
-
loader: (options: {
|
|
120
|
-
config: TConfig;
|
|
121
|
-
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
|
122
|
-
}) => Promise<JSX.Element>;
|
|
123
|
-
}): _backstage_frontend_plugin_api.ExtensionDefinition<TConfig, TConfig, never, never, string | undefined, string | undefined, string | undefined>;
|
|
124
|
-
/** @alpha */
|
|
125
|
-
declare function createEntityContentExtension<TInputs extends AnyExtensionInputMap>(options: {
|
|
126
|
-
namespace?: string;
|
|
127
|
-
name?: string;
|
|
128
|
-
attachTo?: {
|
|
129
|
-
id: string;
|
|
130
|
-
input: string;
|
|
131
|
-
};
|
|
132
|
-
disabled?: boolean;
|
|
133
|
-
inputs?: TInputs;
|
|
134
|
-
routeRef?: RouteRef;
|
|
135
|
-
defaultPath: string;
|
|
136
|
-
defaultTitle: string;
|
|
137
|
-
filter?: typeof catalogExtensionData.entityFilterFunction.T | typeof catalogExtensionData.entityFilterExpression.T;
|
|
138
|
-
loader: (options: {
|
|
139
|
-
inputs: Expand<ResolvedExtensionInputs<TInputs>>;
|
|
140
|
-
}) => Promise<JSX.Element>;
|
|
141
|
-
}): _backstage_frontend_plugin_api.ExtensionDefinition<{
|
|
142
|
-
title: string;
|
|
143
|
-
path: string;
|
|
144
|
-
filter?: string | undefined;
|
|
145
|
-
}, {
|
|
146
|
-
filter?: string | undefined;
|
|
147
|
-
title?: string | undefined;
|
|
148
|
-
path?: string | undefined;
|
|
149
|
-
}, never, never, string | undefined, string | undefined, string | undefined>;
|
|
150
177
|
|
|
151
|
-
export {
|
|
178
|
+
export { EntityCardBlueprint, EntityContentBlueprint, catalogReactTranslationRef, convertLegacyEntityCardExtension, convertLegacyEntityContentExtension, isOwnerOf, useEntityPermission };
|
package/dist/alpha.esm.js
CHANGED
|
@@ -1,103 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
|
|
5
|
-
export { isOwnerOf } from './utils/isOwnerOf.esm.js';
|
|
1
|
+
export { EntityCardBlueprint } from './alpha/blueprints/EntityCardBlueprint.esm.js';
|
|
2
|
+
export { EntityContentBlueprint } from './alpha/blueprints/EntityContentBlueprint.esm.js';
|
|
3
|
+
export { convertLegacyEntityCardExtension } from './alpha/converters/convertLegacyEntityCardExtension.esm.js';
|
|
4
|
+
export { convertLegacyEntityContentExtension } from './alpha/converters/convertLegacyEntityContentExtension.esm.js';
|
|
6
5
|
export { catalogReactTranslationRef } from './translation.esm.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
entityContentTitle: createExtensionDataRef().with({
|
|
10
|
-
id: "catalog.entity-content-title"
|
|
11
|
-
}),
|
|
12
|
-
entityFilterFunction: createExtensionDataRef().with({ id: "catalog.entity-filter-function" }),
|
|
13
|
-
entityFilterExpression: createExtensionDataRef().with({
|
|
14
|
-
id: "catalog.entity-filter-expression"
|
|
15
|
-
})
|
|
16
|
-
};
|
|
17
|
-
function createEntityCardExtension(options) {
|
|
18
|
-
const configSchema = "configSchema" in options ? options.configSchema : createSchemaFromZod(
|
|
19
|
-
(z) => z.object({
|
|
20
|
-
filter: z.string().optional()
|
|
21
|
-
})
|
|
22
|
-
);
|
|
23
|
-
return createExtension({
|
|
24
|
-
kind: "entity-card",
|
|
25
|
-
namespace: options.namespace,
|
|
26
|
-
name: options.name,
|
|
27
|
-
attachTo: options.attachTo ?? {
|
|
28
|
-
id: "entity-content:catalog/overview",
|
|
29
|
-
input: "cards"
|
|
30
|
-
},
|
|
31
|
-
disabled: options.disabled,
|
|
32
|
-
output: {
|
|
33
|
-
element: coreExtensionData.reactElement,
|
|
34
|
-
filterFunction: catalogExtensionData.entityFilterFunction.optional(),
|
|
35
|
-
filterExpression: catalogExtensionData.entityFilterExpression.optional()
|
|
36
|
-
},
|
|
37
|
-
inputs: options.inputs,
|
|
38
|
-
configSchema,
|
|
39
|
-
factory({ config, inputs, node }) {
|
|
40
|
-
const ExtensionComponent = lazy(
|
|
41
|
-
() => options.loader({ inputs, config }).then((element) => ({ default: () => element }))
|
|
42
|
-
);
|
|
43
|
-
return {
|
|
44
|
-
element: /* @__PURE__ */ React.createElement(ExtensionBoundary, { node }, /* @__PURE__ */ React.createElement(ExtensionComponent, null)),
|
|
45
|
-
...mergeFilters({ config, options })
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function createEntityContentExtension(options) {
|
|
51
|
-
return createExtension({
|
|
52
|
-
kind: "entity-content",
|
|
53
|
-
namespace: options.namespace,
|
|
54
|
-
name: options.name,
|
|
55
|
-
attachTo: options.attachTo ?? {
|
|
56
|
-
id: "page:catalog/entity",
|
|
57
|
-
input: "contents"
|
|
58
|
-
},
|
|
59
|
-
disabled: options.disabled,
|
|
60
|
-
output: {
|
|
61
|
-
element: coreExtensionData.reactElement,
|
|
62
|
-
path: coreExtensionData.routePath,
|
|
63
|
-
routeRef: coreExtensionData.routeRef.optional(),
|
|
64
|
-
title: catalogExtensionData.entityContentTitle,
|
|
65
|
-
filterFunction: catalogExtensionData.entityFilterFunction.optional(),
|
|
66
|
-
filterExpression: catalogExtensionData.entityFilterExpression.optional()
|
|
67
|
-
},
|
|
68
|
-
inputs: options.inputs,
|
|
69
|
-
configSchema: createSchemaFromZod(
|
|
70
|
-
(z) => z.object({
|
|
71
|
-
path: z.string().default(options.defaultPath),
|
|
72
|
-
title: z.string().default(options.defaultTitle),
|
|
73
|
-
filter: z.string().optional()
|
|
74
|
-
})
|
|
75
|
-
),
|
|
76
|
-
factory({ config, inputs, node }) {
|
|
77
|
-
const ExtensionComponent = lazy(
|
|
78
|
-
() => options.loader({ inputs }).then((element) => ({ default: () => element }))
|
|
79
|
-
);
|
|
80
|
-
return {
|
|
81
|
-
path: config.path,
|
|
82
|
-
title: config.title,
|
|
83
|
-
routeRef: options.routeRef,
|
|
84
|
-
element: /* @__PURE__ */ React.createElement(ExtensionBoundary, { node }, /* @__PURE__ */ React.createElement(ExtensionComponent, null)),
|
|
85
|
-
...mergeFilters({ config, options })
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
function mergeFilters(inputs) {
|
|
91
|
-
const { options, config } = inputs;
|
|
92
|
-
if (config.filter) {
|
|
93
|
-
return { filterExpression: config.filter };
|
|
94
|
-
} else if (typeof options.filter === "string") {
|
|
95
|
-
return { filterExpression: options.filter };
|
|
96
|
-
} else if (typeof options.filter === "function") {
|
|
97
|
-
return { filterFunction: options.filter };
|
|
98
|
-
}
|
|
99
|
-
return {};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export { catalogExtensionData, createEntityCardExtension, createEntityContentExtension };
|
|
6
|
+
export { isOwnerOf } from './utils/isOwnerOf.esm.js';
|
|
7
|
+
export { useEntityPermission } from './hooks/useEntityPermission.esm.js';
|
|
103
8
|
//# sourceMappingURL=alpha.esm.js.map
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":[
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -14,7 +14,7 @@ function useFacetsEntities({ enabled }) {
|
|
|
14
14
|
const facetsResponse = await catalogApi.getEntityFacets({
|
|
15
15
|
facets: [facet]
|
|
16
16
|
});
|
|
17
|
-
const entityRefs = facetsResponse.facets[facet]
|
|
17
|
+
const entityRefs = facetsResponse.facets[facet]?.map((e) => e.value) ?? [];
|
|
18
18
|
return catalogApi.getEntitiesByRefs({ entityRefs }).then(
|
|
19
19
|
(resp) => resp.items.filter((entity) => entity !== void 0).map((entity) => entity).sort(
|
|
20
20
|
(a, b) => (a.metadata.namespace || "").localeCompare(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFacetsEntities.esm.js","sources":["../../../src/components/EntityOwnerPicker/useFacetsEntities.ts"],"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 */\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\nimport { catalogApiRef } from '../../api';\nimport { useState } from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport get from 'lodash/get';\n\ntype FacetsCursor = {\n start: number;\n text: string;\n};\n\ntype FacetsEntitiesResponse = {\n items: Entity[];\n cursor?: string;\n};\n\ntype FacetsInitialRequest = {\n text: string;\n};\n\n/**\n * This hook asynchronously loads the entity owners using the facets endpoint.\n * EntityOwnerPicker uses this hook when mode=\"owners-only\" is passed as prop.\n * All the owners are kept internally in memory and rendered in batches once requested\n * by the frontend. The values returned by this hook are compatible with `useQueryEntities`\n * hook, which is also used by EntityOwnerPicker.\n */\nexport function useFacetsEntities({ enabled }: { enabled: boolean }) {\n const catalogApi = useApi(catalogApiRef);\n\n const [facetsPromise] = useState(async () => {\n if (!enabled) {\n return [];\n }\n const facet = 'relations.ownedBy';\n const facetsResponse = await catalogApi.getEntityFacets({\n facets: [facet],\n });\n const entityRefs = facetsResponse.facets[facet]
|
|
1
|
+
{"version":3,"file":"useFacetsEntities.esm.js","sources":["../../../src/components/EntityOwnerPicker/useFacetsEntities.ts"],"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 */\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsyncFn from 'react-use/esm/useAsyncFn';\nimport { catalogApiRef } from '../../api';\nimport { useState } from 'react';\nimport { Entity } from '@backstage/catalog-model';\nimport get from 'lodash/get';\n\ntype FacetsCursor = {\n start: number;\n text: string;\n};\n\ntype FacetsEntitiesResponse = {\n items: Entity[];\n cursor?: string;\n};\n\ntype FacetsInitialRequest = {\n text: string;\n};\n\n/**\n * This hook asynchronously loads the entity owners using the facets endpoint.\n * EntityOwnerPicker uses this hook when mode=\"owners-only\" is passed as prop.\n * All the owners are kept internally in memory and rendered in batches once requested\n * by the frontend. The values returned by this hook are compatible with `useQueryEntities`\n * hook, which is also used by EntityOwnerPicker.\n */\nexport function useFacetsEntities({ enabled }: { enabled: boolean }) {\n const catalogApi = useApi(catalogApiRef);\n\n const [facetsPromise] = useState(async () => {\n if (!enabled) {\n return [];\n }\n const facet = 'relations.ownedBy';\n const facetsResponse = await catalogApi.getEntityFacets({\n facets: [facet],\n });\n const entityRefs = facetsResponse.facets[facet]?.map(e => e.value) ?? [];\n\n return catalogApi\n .getEntitiesByRefs({ entityRefs })\n .then(resp =>\n resp.items\n .filter(entity => entity !== undefined)\n .map(entity => entity as Entity)\n .sort(\n (a, b) =>\n (a.metadata.namespace || '').localeCompare(\n b.metadata.namespace || '',\n 'en-US',\n ) ||\n (\n get(a, 'spec.profile.displayName') ||\n a.metadata.title ||\n a.metadata.name\n ).localeCompare(\n get(b, 'spec.profile.displayName') ||\n b.metadata.title ||\n b.metadata.name,\n 'en-US',\n ) ||\n a.kind.localeCompare(b.kind, 'en-US'),\n ),\n )\n .then(entities => entities)\n .catch(() => []);\n });\n\n return useAsyncFn<\n (\n request: FacetsInitialRequest | FacetsEntitiesResponse,\n options?: { limit?: number },\n ) => Promise<FacetsEntitiesResponse>\n >(\n async (request, options) => {\n const facets = await facetsPromise;\n\n if (!facets) {\n return {\n items: [],\n };\n }\n\n const limit = options?.limit ?? 20;\n\n const { text, start } = decodeCursor(request);\n const filteredRefs = facets.filter(e => filterEntity(text, e));\n const end = start + limit;\n return {\n items: filteredRefs.slice(0, end),\n ...encodeCursor({\n entities: filteredRefs,\n limit: end,\n payload: {\n text,\n start: end,\n },\n }),\n };\n },\n [facetsPromise],\n { loading: true, value: { items: [] } },\n );\n}\n\nfunction decodeCursor(\n request: FacetsInitialRequest | FacetsEntitiesResponse,\n): FacetsCursor {\n if (isFacetsResponse(request) && request.cursor) {\n return JSON.parse(atob(request.cursor));\n }\n return {\n text: (request as FacetsInitialRequest).text || '',\n start: 0,\n };\n}\n\nfunction isFacetsResponse(\n request: FacetsInitialRequest | FacetsEntitiesResponse,\n): request is FacetsEntitiesResponse {\n return !!(request as FacetsEntitiesResponse).cursor;\n}\n\nfunction encodeCursor({\n entities,\n limit,\n payload,\n}: {\n entities: Entity[];\n limit: number;\n payload: { text: string; start: number };\n}) {\n if (entities.length > limit) {\n return { cursor: btoa(JSON.stringify(payload)) };\n }\n return {};\n}\n\nfunction filterEntity(text: string, entity: Entity) {\n const normalizedText = text.trim();\n return (\n entity.kind.includes(normalizedText) ||\n entity.metadata.namespace?.includes(normalizedText) ||\n entity.metadata.name.includes(normalizedText) ||\n entity.metadata.title?.includes(normalizedText) ||\n (get(entity, 'spec.profile.displayName') as unknown as string)?.includes(\n normalizedText,\n )\n );\n}\n"],"names":[],"mappings":";;;;;;AA2CgB,SAAA,iBAAA,CAAkB,EAAE,OAAA,EAAiC,EAAA;AACnE,EAAM,MAAA,UAAA,GAAa,OAAO,aAAa,CAAA,CAAA;AAEvC,EAAA,MAAM,CAAC,aAAa,CAAI,GAAA,QAAA,CAAS,YAAY;AAC3C,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AACA,IAAA,MAAM,KAAQ,GAAA,mBAAA,CAAA;AACd,IAAM,MAAA,cAAA,GAAiB,MAAM,UAAA,CAAW,eAAgB,CAAA;AAAA,MACtD,MAAA,EAAQ,CAAC,KAAK,CAAA;AAAA,KACf,CAAA,CAAA;AACD,IAAM,MAAA,UAAA,GAAa,cAAe,CAAA,MAAA,CAAO,KAAK,CAAA,EAAG,IAAI,CAAK,CAAA,KAAA,CAAA,CAAE,KAAK,CAAA,IAAK,EAAC,CAAA;AAEvE,IAAA,OAAO,UACJ,CAAA,iBAAA,CAAkB,EAAE,UAAA,EAAY,CAChC,CAAA,IAAA;AAAA,MAAK,CAAA,IAAA,KACJ,IAAK,CAAA,KAAA,CACF,MAAO,CAAA,CAAA,MAAA,KAAU,MAAW,KAAA,KAAA,CAAS,CACrC,CAAA,GAAA,CAAI,CAAU,MAAA,KAAA,MAAgB,CAC9B,CAAA,IAAA;AAAA,QACC,CAAC,CAAG,EAAA,CAAA,KAAA,CACD,CAAE,CAAA,QAAA,CAAS,aAAa,EAAI,EAAA,aAAA;AAAA,UAC3B,CAAA,CAAE,SAAS,SAAa,IAAA,EAAA;AAAA,UACxB,OAAA;AAAA,SACF,IAAA,CAEE,GAAI,CAAA,CAAA,EAAG,0BAA0B,CAAA,IACjC,EAAE,QAAS,CAAA,KAAA,IACX,CAAE,CAAA,QAAA,CAAS,IACX,EAAA,aAAA;AAAA,UACA,GAAA,CAAI,GAAG,0BAA0B,CAAA,IAC/B,EAAE,QAAS,CAAA,KAAA,IACX,EAAE,QAAS,CAAA,IAAA;AAAA,UACb,OAAA;AAAA,aAEF,CAAE,CAAA,IAAA,CAAK,aAAc,CAAA,CAAA,CAAE,MAAM,OAAO,CAAA;AAAA,OACxC;AAAA,KACJ,CACC,KAAK,CAAY,QAAA,KAAA,QAAQ,EACzB,KAAM,CAAA,MAAM,EAAE,CAAA,CAAA;AAAA,GAClB,CAAA,CAAA;AAED,EAAO,OAAA,UAAA;AAAA,IAML,OAAO,SAAS,OAAY,KAAA;AAC1B,MAAA,MAAM,SAAS,MAAM,aAAA,CAAA;AAErB,MAAA,IAAI,CAAC,MAAQ,EAAA;AACX,QAAO,OAAA;AAAA,UACL,OAAO,EAAC;AAAA,SACV,CAAA;AAAA,OACF;AAEA,MAAM,MAAA,KAAA,GAAQ,SAAS,KAAS,IAAA,EAAA,CAAA;AAEhC,MAAA,MAAM,EAAE,IAAA,EAAM,KAAM,EAAA,GAAI,aAAa,OAAO,CAAA,CAAA;AAC5C,MAAA,MAAM,eAAe,MAAO,CAAA,MAAA,CAAO,OAAK,YAAa,CAAA,IAAA,EAAM,CAAC,CAAC,CAAA,CAAA;AAC7D,MAAA,MAAM,MAAM,KAAQ,GAAA,KAAA,CAAA;AACpB,MAAO,OAAA;AAAA,QACL,KAAO,EAAA,YAAA,CAAa,KAAM,CAAA,CAAA,EAAG,GAAG,CAAA;AAAA,QAChC,GAAG,YAAa,CAAA;AAAA,UACd,QAAU,EAAA,YAAA;AAAA,UACV,KAAO,EAAA,GAAA;AAAA,UACP,OAAS,EAAA;AAAA,YACP,IAAA;AAAA,YACA,KAAO,EAAA,GAAA;AAAA,WACT;AAAA,SACD,CAAA;AAAA,OACH,CAAA;AAAA,KACF;AAAA,IACA,CAAC,aAAa,CAAA;AAAA,IACd,EAAE,SAAS,IAAM,EAAA,KAAA,EAAO,EAAE,KAAO,EAAA,IAAK,EAAA;AAAA,GACxC,CAAA;AACF,CAAA;AAEA,SAAS,aACP,OACc,EAAA;AACd,EAAA,IAAI,gBAAiB,CAAA,OAAO,CAAK,IAAA,OAAA,CAAQ,MAAQ,EAAA;AAC/C,IAAA,OAAO,IAAK,CAAA,KAAA,CAAM,IAAK,CAAA,OAAA,CAAQ,MAAM,CAAC,CAAA,CAAA;AAAA,GACxC;AACA,EAAO,OAAA;AAAA,IACL,IAAA,EAAO,QAAiC,IAAQ,IAAA,EAAA;AAAA,IAChD,KAAO,EAAA,CAAA;AAAA,GACT,CAAA;AACF,CAAA;AAEA,SAAS,iBACP,OACmC,EAAA;AACnC,EAAO,OAAA,CAAC,CAAE,OAAmC,CAAA,MAAA,CAAA;AAC/C,CAAA;AAEA,SAAS,YAAa,CAAA;AAAA,EACpB,QAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AACF,CAIG,EAAA;AACD,EAAI,IAAA,QAAA,CAAS,SAAS,KAAO,EAAA;AAC3B,IAAA,OAAO,EAAE,MAAQ,EAAA,IAAA,CAAK,KAAK,SAAU,CAAA,OAAO,CAAC,CAAE,EAAA,CAAA;AAAA,GACjD;AACA,EAAA,OAAO,EAAC,CAAA;AACV,CAAA;AAEA,SAAS,YAAA,CAAa,MAAc,MAAgB,EAAA;AAClD,EAAM,MAAA,cAAA,GAAiB,KAAK,IAAK,EAAA,CAAA;AACjC,EACE,OAAA,MAAA,CAAO,IAAK,CAAA,QAAA,CAAS,cAAc,CAAA,IACnC,MAAO,CAAA,QAAA,CAAS,SAAW,EAAA,QAAA,CAAS,cAAc,CAAA,IAClD,MAAO,CAAA,QAAA,CAAS,KAAK,QAAS,CAAA,cAAc,CAC5C,IAAA,MAAA,CAAO,QAAS,CAAA,KAAA,EAAO,QAAS,CAAA,cAAc,CAC7C,IAAA,GAAA,CAAI,MAAQ,EAAA,0BAA0B,CAAyB,EAAA,QAAA;AAAA,IAC9D,cAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { stringifyEntityRef } from '@backstage/catalog-model';
|
|
1
2
|
import IconButton from '@material-ui/core/IconButton';
|
|
2
3
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
3
4
|
import { withStyles } from '@material-ui/core/styles';
|
|
@@ -18,21 +19,21 @@ const FavoriteEntity = (props) => {
|
|
|
18
19
|
props.entity
|
|
19
20
|
);
|
|
20
21
|
const { t } = useTranslationRef(catalogReactTranslationRef);
|
|
22
|
+
const title = isStarredEntity ? t("favoriteEntity.removeFromFavorites") : t("favoriteEntity.addToFavorites");
|
|
23
|
+
const id = `favorite-${stringifyEntityRef(props.entity).replace(
|
|
24
|
+
/[^a-zA-Z0-9-_]/g,
|
|
25
|
+
"-"
|
|
26
|
+
)}`;
|
|
21
27
|
return /* @__PURE__ */ React.createElement(
|
|
22
28
|
IconButton,
|
|
23
29
|
{
|
|
24
|
-
"aria-label":
|
|
30
|
+
"aria-label": title,
|
|
31
|
+
id,
|
|
25
32
|
color: "inherit",
|
|
26
33
|
...props,
|
|
27
34
|
onClick: () => toggleStarredEntity()
|
|
28
35
|
},
|
|
29
|
-
/* @__PURE__ */ React.createElement(
|
|
30
|
-
Tooltip,
|
|
31
|
-
{
|
|
32
|
-
title: isStarredEntity ? t("favoriteEntity.removeFromFavorites") : t("favoriteEntity.addToFavorites")
|
|
33
|
-
},
|
|
34
|
-
isStarredEntity ? /* @__PURE__ */ React.createElement(YellowStar, null) : /* @__PURE__ */ React.createElement(StarBorder, null)
|
|
35
|
-
)
|
|
36
|
+
/* @__PURE__ */ React.createElement(Tooltip, { id, title }, isStarredEntity ? /* @__PURE__ */ React.createElement(YellowStar, null) : /* @__PURE__ */ React.createElement(StarBorder, null))
|
|
36
37
|
);
|
|
37
38
|
};
|
|
38
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoriteEntity.esm.js","sources":["../../../src/components/FavoriteEntity/FavoriteEntity.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 { Entity } from '@backstage/catalog-model';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { withStyles } from '@material-ui/core/styles';\nimport Star from '@material-ui/icons/Star';\nimport StarBorder from '@material-ui/icons/StarBorder';\nimport React, { ComponentProps } from 'react';\nimport { useStarredEntity } from '../../hooks/useStarredEntity';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type FavoriteEntityProps = ComponentProps<typeof IconButton> & {\n entity: Entity;\n};\n\nconst YellowStar = withStyles({\n root: {\n color: '#f3ba37',\n },\n})(Star);\n\n/**\n * IconButton for showing if a current entity is starred and adding/removing it from the favorite entities\n * @param props - MaterialUI IconButton props extended by required `entity` prop\n * @public\n */\nexport const FavoriteEntity = (props: FavoriteEntityProps) => {\n const { toggleStarredEntity, isStarredEntity } = useStarredEntity(\n props.entity,\n );\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <IconButton\n aria-label
|
|
1
|
+
{"version":3,"file":"FavoriteEntity.esm.js","sources":["../../../src/components/FavoriteEntity/FavoriteEntity.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 { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { withStyles } from '@material-ui/core/styles';\nimport Star from '@material-ui/icons/Star';\nimport StarBorder from '@material-ui/icons/StarBorder';\nimport React, { ComponentProps } from 'react';\nimport { useStarredEntity } from '../../hooks/useStarredEntity';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type FavoriteEntityProps = ComponentProps<typeof IconButton> & {\n entity: Entity;\n};\n\nconst YellowStar = withStyles({\n root: {\n color: '#f3ba37',\n },\n})(Star);\n\n/**\n * IconButton for showing if a current entity is starred and adding/removing it from the favorite entities\n * @param props - MaterialUI IconButton props extended by required `entity` prop\n * @public\n */\nexport const FavoriteEntity = (props: FavoriteEntityProps) => {\n const { toggleStarredEntity, isStarredEntity } = useStarredEntity(\n props.entity,\n );\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const title = isStarredEntity\n ? t('favoriteEntity.removeFromFavorites')\n : t('favoriteEntity.addToFavorites');\n\n const id = `favorite-${stringifyEntityRef(props.entity).replace(\n /[^a-zA-Z0-9-_]/g,\n '-',\n )}`;\n\n return (\n <IconButton\n aria-label={title}\n id={id}\n color=\"inherit\"\n {...props}\n onClick={() => toggleStarredEntity()}\n >\n <Tooltip id={id} title={title}>\n {isStarredEntity ? <YellowStar /> : <StarBorder />}\n </Tooltip>\n </IconButton>\n );\n};\n"],"names":["Star"],"mappings":";;;;;;;;;;;AAgCA,MAAM,aAAa,UAAW,CAAA;AAAA,EAC5B,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,SAAA;AAAA,GACT;AACF,CAAC,EAAEA,QAAI,CAAA,CAAA;AAOM,MAAA,cAAA,GAAiB,CAAC,KAA+B,KAAA;AAC5D,EAAM,MAAA,EAAE,mBAAqB,EAAA,eAAA,EAAoB,GAAA,gBAAA;AAAA,IAC/C,KAAM,CAAA,MAAA;AAAA,GACR,CAAA;AACA,EAAA,MAAM,EAAE,CAAA,EAAM,GAAA,iBAAA,CAAkB,0BAA0B,CAAA,CAAA;AAC1D,EAAA,MAAM,QAAQ,eACV,GAAA,CAAA,CAAE,oCAAoC,CAAA,GACtC,EAAE,+BAA+B,CAAA,CAAA;AAErC,EAAA,MAAM,EAAK,GAAA,CAAA,SAAA,EAAY,kBAAmB,CAAA,KAAA,CAAM,MAAM,CAAE,CAAA,OAAA;AAAA,IACtD,iBAAA;AAAA,IACA,GAAA;AAAA,GACD,CAAA,CAAA,CAAA;AAED,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,YAAY,EAAA,KAAA;AAAA,MACZ,EAAA;AAAA,MACA,KAAM,EAAA,SAAA;AAAA,MACL,GAAG,KAAA;AAAA,MACJ,OAAA,EAAS,MAAM,mBAAoB,EAAA;AAAA,KAAA;AAAA,oBAEnC,KAAA,CAAA,aAAA,CAAC,OAAQ,EAAA,EAAA,EAAA,EAAQ,KACd,EAAA,EAAA,eAAA,uCAAmB,UAAW,EAAA,IAAA,CAAA,mBAAM,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,IAAW,CAClD,CAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { ApiRef, IconComponent } from '@backstage/core-plugin-api';
|
|
|
6
6
|
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
7
7
|
import { Entity, CompoundEntityRef } from '@backstage/catalog-model';
|
|
8
8
|
import { Observable } from '@backstage/types';
|
|
9
|
-
import
|
|
9
|
+
import React__default, { PropsWithChildren, ReactNode, ComponentProps } from 'react';
|
|
10
10
|
import { LinkProps, InfoCardVariants, TableColumn, TableOptions } from '@backstage/core-components';
|
|
11
11
|
import IconButton from '@material-ui/core/IconButton';
|
|
12
12
|
import { TextFieldProps } from '@material-ui/core/TextField';
|
|
@@ -201,18 +201,18 @@ declare class MockStarredEntitiesApi implements StarredEntitiesApi {
|
|
|
201
201
|
/** @public */
|
|
202
202
|
declare const CatalogFilterLayout: {
|
|
203
203
|
(props: {
|
|
204
|
-
children:
|
|
205
|
-
}):
|
|
204
|
+
children: React__default.ReactNode;
|
|
205
|
+
}): React__default.JSX.Element;
|
|
206
206
|
Filters: (props: {
|
|
207
|
-
children:
|
|
207
|
+
children: React__default.ReactNode;
|
|
208
208
|
options?: {
|
|
209
209
|
drawerBreakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
210
210
|
drawerAnchor?: 'left' | 'right' | 'top' | 'bottom';
|
|
211
211
|
};
|
|
212
|
-
}) =>
|
|
212
|
+
}) => React__default.JSX.Element;
|
|
213
213
|
Content: (props: {
|
|
214
|
-
children:
|
|
215
|
-
}) =>
|
|
214
|
+
children: React__default.ReactNode;
|
|
215
|
+
}) => React__default.JSX.Element;
|
|
216
216
|
};
|
|
217
217
|
|
|
218
218
|
/** @public */
|
|
@@ -249,7 +249,7 @@ type EntityOwnerPickerProps = {
|
|
|
249
249
|
mode?: 'owners-only' | 'all';
|
|
250
250
|
};
|
|
251
251
|
/** @public */
|
|
252
|
-
declare const EntityOwnerPicker: (props?: EntityOwnerPickerProps) =>
|
|
252
|
+
declare const EntityOwnerPicker: (props?: EntityOwnerPickerProps) => React__default.JSX.Element | null;
|
|
253
253
|
|
|
254
254
|
/**
|
|
255
255
|
* Props for default filters.
|
|
@@ -263,7 +263,7 @@ type DefaultFiltersProps = {
|
|
|
263
263
|
initiallySelectedNamespaces?: string[];
|
|
264
264
|
};
|
|
265
265
|
/** @public */
|
|
266
|
-
declare const DefaultFilters: (props: DefaultFiltersProps) =>
|
|
266
|
+
declare const DefaultFilters: (props: DefaultFiltersProps) => React__default.JSX.Element;
|
|
267
267
|
|
|
268
268
|
/**
|
|
269
269
|
* Props for {@link EntityKindPicker}.
|
|
@@ -280,14 +280,14 @@ interface EntityKindPickerProps {
|
|
|
280
280
|
hidden?: boolean;
|
|
281
281
|
}
|
|
282
282
|
/** @public */
|
|
283
|
-
declare const EntityKindPicker: (props: EntityKindPickerProps) =>
|
|
283
|
+
declare const EntityKindPicker: (props: EntityKindPickerProps) => React__default.JSX.Element | null;
|
|
284
284
|
|
|
285
285
|
/** @public */
|
|
286
286
|
type CatalogReactEntityLifecyclePickerClassKey = 'input';
|
|
287
287
|
/** @public */
|
|
288
288
|
declare const EntityLifecyclePicker: (props: {
|
|
289
289
|
initialFilter?: string[];
|
|
290
|
-
}) =>
|
|
290
|
+
}) => React__default.JSX.Element;
|
|
291
291
|
|
|
292
292
|
/**
|
|
293
293
|
* The available style class keys for {@link EntityDisplayName}, under the name
|
|
@@ -326,7 +326,7 @@ type EntityRefLinkProps = {
|
|
|
326
326
|
defaultNamespace?: string;
|
|
327
327
|
/** @deprecated This option should no longer be used; presentation is requested through the {@link entityPresentationApiRef} instead */
|
|
328
328
|
title?: string;
|
|
329
|
-
children?:
|
|
329
|
+
children?: React__default.ReactNode;
|
|
330
330
|
hideIcon?: boolean;
|
|
331
331
|
} & Omit<LinkProps, 'to'>;
|
|
332
332
|
/**
|
|
@@ -355,7 +355,7 @@ type EntityRefLinksProps<TRef extends string | CompoundEntityRef | Entity> = {
|
|
|
355
355
|
*
|
|
356
356
|
* @public
|
|
357
357
|
*/
|
|
358
|
-
declare function EntityRefLinks<TRef extends string | CompoundEntityRef | Entity>(props: EntityRefLinksProps<TRef>):
|
|
358
|
+
declare function EntityRefLinks<TRef extends string | CompoundEntityRef | Entity>(props: EntityRefLinksProps<TRef>): React__default.JSX.Element;
|
|
359
359
|
|
|
360
360
|
/**
|
|
361
361
|
* @param defaultNamespace - if set to false then namespace is never omitted,
|
|
@@ -382,7 +382,7 @@ type EntityPeekAheadPopoverProps = PropsWithChildren<{
|
|
|
382
382
|
*
|
|
383
383
|
* @public
|
|
384
384
|
*/
|
|
385
|
-
declare const EntityPeekAheadPopover: (props: EntityPeekAheadPopoverProps) =>
|
|
385
|
+
declare const EntityPeekAheadPopover: (props: EntityPeekAheadPopoverProps) => React__default.JSX.Element;
|
|
386
386
|
|
|
387
387
|
/** @public */
|
|
388
388
|
type CatalogReactEntitySearchBarClassKey = 'searchToolbar' | 'input';
|
|
@@ -390,7 +390,7 @@ type CatalogReactEntitySearchBarClassKey = 'searchToolbar' | 'input';
|
|
|
390
390
|
* Renders search bar for filtering the entity list.
|
|
391
391
|
* @public
|
|
392
392
|
*/
|
|
393
|
-
declare const EntitySearchBar: () =>
|
|
393
|
+
declare const EntitySearchBar: () => React__default.JSX.Element;
|
|
394
394
|
|
|
395
395
|
/**
|
|
396
396
|
* Props for {@link EntityTable}.
|
|
@@ -412,7 +412,7 @@ interface EntityTableProps<T extends Entity> {
|
|
|
412
412
|
* @public
|
|
413
413
|
*/
|
|
414
414
|
declare const EntityTable: {
|
|
415
|
-
<T extends Entity>(props: EntityTableProps<T>):
|
|
415
|
+
<T extends Entity>(props: EntityTableProps<T>): React__default.JSX.Element;
|
|
416
416
|
columns: Readonly<{
|
|
417
417
|
createEntityRefColumn<T_1 extends Entity>(options: {
|
|
418
418
|
defaultKind?: string | undefined;
|
|
@@ -464,7 +464,7 @@ type EntityTagPickerProps = {
|
|
|
464
464
|
showCounts?: boolean;
|
|
465
465
|
};
|
|
466
466
|
/** @public */
|
|
467
|
-
declare const EntityTagPicker: (props: EntityTagPickerProps) =>
|
|
467
|
+
declare const EntityTagPicker: (props: EntityTagPickerProps) => React__default.JSX.Element;
|
|
468
468
|
|
|
469
469
|
/**
|
|
470
470
|
* Props for {@link EntityTypePicker}.
|
|
@@ -476,7 +476,7 @@ interface EntityTypePickerProps {
|
|
|
476
476
|
hidden?: boolean;
|
|
477
477
|
}
|
|
478
478
|
/** @public */
|
|
479
|
-
declare const EntityTypePicker: (props: EntityTypePickerProps) =>
|
|
479
|
+
declare const EntityTypePicker: (props: EntityTypePickerProps) => React__default.JSX.Element | null;
|
|
480
480
|
|
|
481
481
|
/** @public */
|
|
482
482
|
type FavoriteEntityProps = ComponentProps<typeof IconButton> & {
|
|
@@ -487,7 +487,7 @@ type FavoriteEntityProps = ComponentProps<typeof IconButton> & {
|
|
|
487
487
|
* @param props - MaterialUI IconButton props extended by required `entity` prop
|
|
488
488
|
* @public
|
|
489
489
|
*/
|
|
490
|
-
declare const FavoriteEntity: (props: FavoriteEntityProps) =>
|
|
490
|
+
declare const FavoriteEntity: (props: FavoriteEntityProps) => React__default.JSX.Element;
|
|
491
491
|
|
|
492
492
|
/**
|
|
493
493
|
* A dialog that lets users inspect the low level details of their entities.
|
|
@@ -498,7 +498,7 @@ declare function InspectEntityDialog(props: {
|
|
|
498
498
|
open: boolean;
|
|
499
499
|
entity: Entity;
|
|
500
500
|
onClose: () => void;
|
|
501
|
-
}):
|
|
501
|
+
}): React__default.JSX.Element | null;
|
|
502
502
|
|
|
503
503
|
/** @public */
|
|
504
504
|
type UnregisterEntityDialogProps = {
|
|
@@ -508,7 +508,7 @@ type UnregisterEntityDialogProps = {
|
|
|
508
508
|
entity: Entity;
|
|
509
509
|
};
|
|
510
510
|
/** @public */
|
|
511
|
-
declare const UnregisterEntityDialog: (props: UnregisterEntityDialogProps) =>
|
|
511
|
+
declare const UnregisterEntityDialog: (props: UnregisterEntityDialogProps) => React__default.JSX.Element;
|
|
512
512
|
|
|
513
513
|
/** @public */
|
|
514
514
|
type CatalogReactUserListPickerClassKey = 'root' | 'title' | 'listIcon' | 'menuItem' | 'groupWrapper';
|
|
@@ -518,12 +518,12 @@ type UserListPickerProps = {
|
|
|
518
518
|
availableFilters?: UserListFilterKind[];
|
|
519
519
|
};
|
|
520
520
|
/** @public */
|
|
521
|
-
declare const UserListPicker: (props: UserListPickerProps) =>
|
|
521
|
+
declare const UserListPicker: (props: UserListPickerProps) => React__default.JSX.Element;
|
|
522
522
|
|
|
523
523
|
/** @public */
|
|
524
524
|
type CatalogReactEntityProcessingStatusPickerClassKey = 'input';
|
|
525
525
|
/** @public */
|
|
526
|
-
declare const EntityProcessingStatusPicker: () =>
|
|
526
|
+
declare const EntityProcessingStatusPicker: () => React__default.JSX.Element;
|
|
527
527
|
|
|
528
528
|
/** @public */
|
|
529
529
|
type CatalogReactEntityNamespacePickerClassKey = 'input';
|
|
@@ -536,7 +536,7 @@ interface EntityNamespacePickerProps {
|
|
|
536
536
|
initiallySelectedNamespaces?: string[];
|
|
537
537
|
}
|
|
538
538
|
/** @public */
|
|
539
|
-
declare const EntityNamespacePicker: (props: EntityNamespacePickerProps) =>
|
|
539
|
+
declare const EntityNamespacePicker: (props: EntityNamespacePickerProps) => React__default.JSX.Element;
|
|
540
540
|
|
|
541
541
|
/**
|
|
542
542
|
* Filter entities based on Kind.
|
|
@@ -720,7 +720,7 @@ type EntityListContextProps<EntityFilters extends DefaultEntityFilters = Default
|
|
|
720
720
|
* Creates new context for entity listing and filtering.
|
|
721
721
|
* @public
|
|
722
722
|
*/
|
|
723
|
-
declare const EntityListContext:
|
|
723
|
+
declare const EntityListContext: React__default.Context<EntityListContextProps<any> | undefined>;
|
|
724
724
|
/**
|
|
725
725
|
* @public
|
|
726
726
|
*/
|
|
@@ -733,7 +733,7 @@ type EntityListProviderProps = PropsWithChildren<{
|
|
|
733
733
|
* Provides entities and filters for a catalog listing.
|
|
734
734
|
* @public
|
|
735
735
|
*/
|
|
736
|
-
declare const EntityListProvider: <EntityFilters extends DefaultEntityFilters>(props: EntityListProviderProps) =>
|
|
736
|
+
declare const EntityListProvider: <EntityFilters extends DefaultEntityFilters>(props: EntityListProviderProps) => React__default.JSX.Element;
|
|
737
737
|
/**
|
|
738
738
|
* Hook for interacting with the entity list context provided by the {@link EntityListProvider}.
|
|
739
739
|
* @public
|
|
@@ -762,7 +762,7 @@ type EntityAutocompletePickerProps<T extends DefaultEntityFilters = DefaultEntit
|
|
|
762
762
|
/** @public */
|
|
763
763
|
type CatalogReactEntityAutocompletePickerClassKey = 'root' | 'label';
|
|
764
764
|
/** @public */
|
|
765
|
-
declare function EntityAutocompletePicker<T extends DefaultEntityFilters = DefaultEntityFilters, Name extends AllowedEntityFilters<T> = AllowedEntityFilters<T>>(props: EntityAutocompletePickerProps<T, Name>):
|
|
765
|
+
declare function EntityAutocompletePicker<T extends DefaultEntityFilters = DefaultEntityFilters, Name extends AllowedEntityFilters<T> = AllowedEntityFilters<T>>(props: EntityAutocompletePickerProps<T, Name>): React__default.JSX.Element | null;
|
|
766
766
|
|
|
767
767
|
/** @public */
|
|
768
768
|
type MissingAnnotationEmptyStateClassKey = 'code';
|
|
@@ -773,7 +773,7 @@ type MissingAnnotationEmptyStateClassKey = 'code';
|
|
|
773
773
|
declare function MissingAnnotationEmptyState(props: {
|
|
774
774
|
annotation: string | string[];
|
|
775
775
|
readMoreUrl?: string;
|
|
776
|
-
}):
|
|
776
|
+
}): React__default.JSX.Element;
|
|
777
777
|
|
|
778
778
|
/** @public */
|
|
779
779
|
type EntityLoadingStatus<TEntity extends Entity = Entity> = {
|
|
@@ -799,7 +799,7 @@ interface AsyncEntityProviderProps {
|
|
|
799
799
|
*
|
|
800
800
|
* @public
|
|
801
801
|
*/
|
|
802
|
-
declare const AsyncEntityProvider: (props: AsyncEntityProviderProps) =>
|
|
802
|
+
declare const AsyncEntityProvider: (props: AsyncEntityProviderProps) => React__default.JSX.Element;
|
|
803
803
|
/**
|
|
804
804
|
* Properties for the EntityProvider component.
|
|
805
805
|
*
|
|
@@ -814,7 +814,7 @@ interface EntityProviderProps {
|
|
|
814
814
|
*
|
|
815
815
|
* @public
|
|
816
816
|
*/
|
|
817
|
-
declare const EntityProvider: (props: EntityProviderProps) =>
|
|
817
|
+
declare const EntityProvider: (props: EntityProviderProps) => React__default.JSX.Element;
|
|
818
818
|
/**
|
|
819
819
|
* Grab the current entity from the context, throws if the entity has not yet been loaded
|
|
820
820
|
* or is not available.
|
|
@@ -915,7 +915,7 @@ declare function entityRouteParams(entity: Entity): {
|
|
|
915
915
|
/** @public */
|
|
916
916
|
declare function MockEntityListContextProvider<T extends DefaultEntityFilters = DefaultEntityFilters>(props: PropsWithChildren<{
|
|
917
917
|
value?: Partial<EntityListContextProps<T>>;
|
|
918
|
-
}>):
|
|
918
|
+
}>): React__default.JSX.Element;
|
|
919
919
|
|
|
920
920
|
/** @public */
|
|
921
921
|
type CatalogReactComponentsNameToClassKey = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-react",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.4-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",
|
|
@@ -56,16 +56,17 @@
|
|
|
56
56
|
"test": "backstage-cli package test"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@backstage/catalog-client": "^1.6.6
|
|
60
|
-
"@backstage/catalog-model": "^1.6.0
|
|
61
|
-
"@backstage/core-
|
|
59
|
+
"@backstage/catalog-client": "^1.6.6",
|
|
60
|
+
"@backstage/catalog-model": "^1.6.0",
|
|
61
|
+
"@backstage/core-compat-api": "^0.2.9-next.0",
|
|
62
|
+
"@backstage/core-components": "^0.14.10",
|
|
62
63
|
"@backstage/core-plugin-api": "^1.9.3",
|
|
63
64
|
"@backstage/errors": "^1.2.4",
|
|
64
|
-
"@backstage/frontend-plugin-api": "^0.
|
|
65
|
-
"@backstage/integration-react": "^1.1.30
|
|
66
|
-
"@backstage/plugin-catalog-common": "^1.0.26
|
|
67
|
-
"@backstage/plugin-permission-common": "^0.8.1
|
|
68
|
-
"@backstage/plugin-permission-react": "^0.4.25
|
|
65
|
+
"@backstage/frontend-plugin-api": "^0.8.0-next.0",
|
|
66
|
+
"@backstage/integration-react": "^1.1.30",
|
|
67
|
+
"@backstage/plugin-catalog-common": "^1.0.26",
|
|
68
|
+
"@backstage/plugin-permission-common": "^0.8.1",
|
|
69
|
+
"@backstage/plugin-permission-react": "^0.4.25",
|
|
69
70
|
"@backstage/types": "^1.1.1",
|
|
70
71
|
"@backstage/version-bridge": "^1.0.8",
|
|
71
72
|
"@material-ui/core": "^4.12.2",
|
|
@@ -82,11 +83,12 @@
|
|
|
82
83
|
"zen-observable": "^0.10.0"
|
|
83
84
|
},
|
|
84
85
|
"devDependencies": {
|
|
85
|
-
"@backstage/cli": "^0.27.
|
|
86
|
-
"@backstage/core-app-api": "^1.14.2
|
|
87
|
-
"@backstage/
|
|
88
|
-
"@backstage/plugin-
|
|
89
|
-
"@backstage/
|
|
86
|
+
"@backstage/cli": "^0.27.1-next.0",
|
|
87
|
+
"@backstage/core-app-api": "^1.14.2",
|
|
88
|
+
"@backstage/frontend-test-utils": "^0.2.0-next.0",
|
|
89
|
+
"@backstage/plugin-catalog-common": "^1.0.26",
|
|
90
|
+
"@backstage/plugin-scaffolder-common": "^1.5.5",
|
|
91
|
+
"@backstage/test-utils": "^1.6.0-next.0",
|
|
90
92
|
"@testing-library/dom": "^10.0.0",
|
|
91
93
|
"@testing-library/jest-dom": "^6.0.0",
|
|
92
94
|
"@testing-library/react": "^15.0.0",
|