diff --git a/plugins/home-react/src/alpha/blueprints/HomePageWidgetBlueprint.tsx b/plugins/home-react/src/alpha/blueprints/HomePageWidgetBlueprint.tsx index 755713a363..4cd38754fa 100644 --- a/plugins/home-react/src/alpha/blueprints/HomePageWidgetBlueprint.tsx +++ b/plugins/home-react/src/alpha/blueprints/HomePageWidgetBlueprint.tsx @@ -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>) => ( @@ -105,10 +107,18 @@ export const HomePageWidgetBlueprint = createExtensionBlueprint({ ); + 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: , - name: params.name, + name: widgetName, title: params.title, description: params.description, layout: params.layout, diff --git a/plugins/home/report-alpha.api.md b/plugins/home/report-alpha.api.md index 83f1bb15c9..4568fc8c2a 100644 --- a/plugins/home/report-alpha.api.md +++ b/plugins/home/report-alpha.api.md @@ -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'; }