@@ -50,7 +50,6 @@ export const PageBlueprint = createExtensionBlueprint({
|
||||
) {
|
||||
yield coreExtensionData.routePath(config.path ?? defaultPath);
|
||||
yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));
|
||||
|
||||
if (routeRef) {
|
||||
yield coreExtensionData.routeRef(routeRef);
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { ExtensionBlueprint } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { JSX as JSX_2 } from 'react';
|
||||
import { PortableSchema } from '@backstage/frontend-plugin-api';
|
||||
import { default as React_2 } from 'react';
|
||||
import { ResolvedExtensionInputs } from '@backstage/frontend-plugin-api';
|
||||
import { ResourcePermission } from '@backstage/plugin-permission-common';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
@@ -182,7 +182,7 @@ export const EntityCardBlueprint: ExtensionBlueprint<
|
||||
loader: () => Promise<JSX.Element>;
|
||||
filter?: string | ((entity: Entity) => boolean) | undefined;
|
||||
},
|
||||
| ConfigurableExtensionDataRef<React_2.JSX.Element, 'core.reactElement', {}>
|
||||
| ConfigurableExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
| ConfigurableExtensionDataRef<
|
||||
(entity: Entity) => boolean,
|
||||
'catalog.entity-filter-function',
|
||||
@@ -232,7 +232,7 @@ export const EntityContentBlueprint: ExtensionBlueprint<
|
||||
routeRef?: RouteRef<AnyRouteRefParams> | undefined;
|
||||
filter?: string | ((entity: Entity) => boolean) | undefined;
|
||||
},
|
||||
| ConfigurableExtensionDataRef<React_2.JSX.Element, 'core.reactElement', {}>
|
||||
| ConfigurableExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>
|
||||
| ConfigurableExtensionDataRef<string, 'core.routing.path', {}>
|
||||
| ConfigurableExtensionDataRef<
|
||||
RouteRef<AnyRouteRefParams>,
|
||||
|
||||
+2
-10
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import React, { lazy } from 'react';
|
||||
|
||||
import {
|
||||
ExtensionBoundary,
|
||||
coreExtensionData,
|
||||
@@ -54,15 +54,7 @@ export const EntityCardBlueprint = createExtensionBlueprint({
|
||||
},
|
||||
{ node, config },
|
||||
) {
|
||||
const ExtensionComponent = lazy(() =>
|
||||
loader().then(element => ({ default: () => element })),
|
||||
);
|
||||
|
||||
yield coreExtensionData.reactElement(
|
||||
<ExtensionBoundary node={node}>
|
||||
<ExtensionComponent />
|
||||
</ExtensionBoundary>,
|
||||
);
|
||||
yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));
|
||||
|
||||
if (config.filter) {
|
||||
yield catalogExtensionData.entityFilterExpression(config.filter);
|
||||
+2
-10
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import React, { lazy } from 'react';
|
||||
|
||||
import {
|
||||
coreExtensionData,
|
||||
createExtensionBlueprint,
|
||||
@@ -70,15 +70,7 @@ export const EntityContentBlueprint = createExtensionBlueprint({
|
||||
const path = config.path ?? defaultPath;
|
||||
const title = config.title ?? defaultTitle;
|
||||
|
||||
const ExtensionComponent = lazy(() =>
|
||||
loader().then(element => ({ default: () => element })),
|
||||
);
|
||||
|
||||
yield coreExtensionData.reactElement(
|
||||
<ExtensionBoundary node={node}>
|
||||
<ExtensionComponent />
|
||||
</ExtensionBoundary>,
|
||||
);
|
||||
yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));
|
||||
|
||||
yield coreExtensionData.routePath(path);
|
||||
|
||||
@@ -19,7 +19,6 @@ import { ExternalRouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { IconComponent } from '@backstage/core-plugin-api';
|
||||
import { JSX as JSX_2 } from 'react';
|
||||
import { PortableSchema } from '@backstage/frontend-plugin-api';
|
||||
import { default as React_2 } from 'react';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { SearchResultItemExtensionComponent } from '@backstage/plugin-search-react/alpha';
|
||||
import { SearchResultItemExtensionPredicate } from '@backstage/plugin-search-react/alpha';
|
||||
@@ -35,7 +34,7 @@ export const CatalogFilterBlueprint: ExtensionBlueprint<
|
||||
{
|
||||
loader: () => Promise<JSX.Element>;
|
||||
},
|
||||
ConfigurableExtensionDataRef<React_2.JSX.Element, 'core.reactElement', {}>,
|
||||
ConfigurableExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>,
|
||||
{},
|
||||
{},
|
||||
{},
|
||||
|
||||
+1
-7
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { lazy } from 'react';
|
||||
import {
|
||||
ExtensionBoundary,
|
||||
coreExtensionData,
|
||||
@@ -30,14 +29,9 @@ export const CatalogFilterBlueprint = createExtensionBlueprint({
|
||||
attachTo: { id: 'page:catalog', input: 'filters' },
|
||||
output: [coreExtensionData.reactElement],
|
||||
factory(params: { loader: () => Promise<JSX.Element> }, { node }) {
|
||||
const ExtensionComponent = lazy(() =>
|
||||
params.loader().then(element => ({ default: () => element })),
|
||||
);
|
||||
return [
|
||||
coreExtensionData.reactElement(
|
||||
<ExtensionBoundary node={node}>
|
||||
<ExtensionComponent />
|
||||
</ExtensionBoundary>,
|
||||
ExtensionBoundary.lazy(node, params.loader),
|
||||
),
|
||||
];
|
||||
},
|
||||
Reference in New Issue
Block a user