fix(home): expose alpha widget metadata to custom grid
Signed-off-by: Adam Kunicki <kunickiaj@gmail.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
createExtensionBlueprint,
|
||||
ExtensionBoundary,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { attachComponentData } from '@backstage/core-plugin-api';
|
||||
import {
|
||||
CardExtension,
|
||||
CardExtensionProps,
|
||||
@@ -84,6 +85,7 @@ export const HomePageWidgetBlueprint = createExtensionBlueprint({
|
||||
output: [homePageWidgetDataRef],
|
||||
*factory(params: HomePageWidgetBlueprintParams, { node }) {
|
||||
const isCustomizable = params.settings?.schema !== undefined;
|
||||
const widgetName = params.name ?? node.spec.id;
|
||||
const LazyCard = lazy(() =>
|
||||
params.components().then(parts => ({
|
||||
default: (props: CardExtensionProps<Record<string, unknown>>) => (
|
||||
@@ -105,10 +107,18 @@ export const HomePageWidgetBlueprint = createExtensionBlueprint({
|
||||
</ExtensionBoundary>
|
||||
);
|
||||
|
||||
attachComponentData(Widget, 'core.extensionName', widgetName);
|
||||
attachComponentData(Widget, 'title', params.title);
|
||||
attachComponentData(Widget, 'description', params.description);
|
||||
attachComponentData(Widget, 'home.widget.config', {
|
||||
layout: params.layout,
|
||||
settings: params.settings,
|
||||
});
|
||||
|
||||
yield homePageWidgetDataRef({
|
||||
node,
|
||||
component: <Widget {...(params.componentProps ?? {})} />,
|
||||
name: params.name,
|
||||
name: widgetName,
|
||||
title: params.title,
|
||||
description: params.description,
|
||||
layout: params.layout,
|
||||
|
||||
@@ -175,16 +175,16 @@ export const homeTranslationRef: TranslationRef<
|
||||
readonly 'widgetSettingsOverlay.deleteWidgetTooltip': 'Delete widget';
|
||||
readonly 'widgetSettingsOverlay.submitButtonTitle': 'Submit';
|
||||
readonly 'starredEntityListItem.removeFavoriteEntityTitle': 'Remove entity from favorites';
|
||||
readonly 'visitList.few.title': 'The more pages you visit, the more pages will appear here.';
|
||||
readonly 'visitList.empty.description': 'Once you start using Backstage, your visits will appear here as a quick link to carry on where you left off.';
|
||||
readonly 'visitList.empty.title': 'There are no visits to show yet.';
|
||||
readonly 'quickStart.description': 'Get started with Backstage';
|
||||
readonly 'visitList.empty.description': 'Once you start using Backstage, your visits will appear here as a quick link to carry on where you left off.';
|
||||
readonly 'visitList.few.title': 'The more pages you visit, the more pages will appear here.';
|
||||
readonly 'quickStart.title': 'Onboarding';
|
||||
readonly 'quickStart.description': 'Get started with Backstage';
|
||||
readonly 'quickStart.learnMoreLinkTitle': 'Learn more';
|
||||
readonly 'visitedByType.action.viewMore': 'View more';
|
||||
readonly 'visitedByType.action.viewLess': 'View less';
|
||||
readonly 'featuredDocsCard.empty.description': 'Create your own document. Check out our Getting Started Information';
|
||||
readonly 'featuredDocsCard.empty.title': 'No documents to show';
|
||||
readonly 'featuredDocsCard.empty.description': 'Create your own document. Check out our Getting Started Information';
|
||||
readonly 'featuredDocsCard.empty.learnMoreLinkTitle': 'DOCS';
|
||||
readonly 'featuredDocsCard.learnMoreTitle': 'LEARN MORE';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user