1717import { HomePageWidgetBlueprint } from '@backstage/plugin-home-react/alpha' ;
1818import homePlugin from '@backstage/plugin-home/alpha' ;
1919import { compatWrapper } from '@backstage/core-compat-api' ;
20+ import { homepageMessages } from '../../translations/ref' ;
2021
2122const defaultCardLayout = {
2223 width : {
@@ -41,9 +42,11 @@ export const onboardingSectionWidget = HomePageWidgetBlueprint.make({
4142 name : 'Red Hat Developer Hub - Onboarding' ,
4243 layout : defaultCardLayout ,
4344 components : ( ) =>
44- import ( '../../components/OnboardingSection' ) . then ( m => ( {
45- Content : m . OnboardingSection ,
46- } ) ) ,
45+ import ( '../../components/OnboardingSection/OnboardingSection' ) . then (
46+ m => ( {
47+ Content : m . OnboardingSectionContent ,
48+ } ) ,
49+ ) ,
4750 } ,
4851} ) ;
4952
@@ -55,10 +58,11 @@ export const entitySectionWidget = HomePageWidgetBlueprint.make({
5558 name : 'rhdh-entity-section' ,
5659 params : {
5760 name : 'Red Hat Developer Hub - Software Catalog' ,
61+ title : homepageMessages . entities . title ,
5862 layout : defaultCardLayout ,
5963 components : ( ) =>
60- import ( '../../components/EntitySection' ) . then ( m => ( {
61- Content : ( ) => compatWrapper ( < m . EntitySection /> ) ,
64+ import ( '../../components/EntitySection/EntitySection ' ) . then ( m => ( {
65+ Content : m . EntitySectionContent ,
6266 } ) ) ,
6367 } ,
6468} ) ;
@@ -71,10 +75,11 @@ export const templateSectionWidget = HomePageWidgetBlueprint.make({
7175 name : 'rhdh-template-section' ,
7276 params : {
7377 name : 'Red Hat Developer Hub - Explore templates' ,
78+ title : homepageMessages . templates . title ,
7479 layout : defaultCardLayout ,
7580 components : ( ) =>
76- import ( '../../components/TemplateSection' ) . then ( m => ( {
77- Content : m . TemplateSection ,
81+ import ( '../../components/TemplateSection/TemplateSection ' ) . then ( m => ( {
82+ Content : m . TemplateSectionContent ,
7883 } ) ) ,
7984 } ,
8085} ) ;
@@ -87,10 +92,11 @@ export const quickAccessCardWidget = HomePageWidgetBlueprint.make({
8792 name : 'quick-access-card' ,
8893 params : {
8994 name : 'Quick Access Card' ,
95+ title : homepageMessages . quickAccess . title ,
9096 layout : defaultCardLayout ,
9197 components : ( ) =>
9298 import ( '../../components/QuickAccessCard' ) . then ( m => ( {
93- Content : ( ) => compatWrapper ( < m . QuickAccessCard /> ) ,
99+ Content : m . QuickAccessCardContent ,
94100 } ) ) ,
95101 } ,
96102} ) ;
@@ -121,6 +127,17 @@ export const searchBarWidget = HomePageWidgetBlueprint.make({
121127 } ,
122128} ) ;
123129
130+ /**
131+ * Renders a legacy plugin-home CardExtension directly, skipping the NFS
132+ * CardExtension InfoCard shell. Used when upstream only exports full cards
133+ * (not Content) from the public API.
134+ */
135+ const legacyHomeCardRenderer = ( {
136+ Content,
137+ } : {
138+ Content : React . ComponentType ;
139+ } ) => compatWrapper ( < Content /> ) ;
140+
124141/**
125142 * NFS widget: FeaturedDocsCard (migrated from mountPoint home.page/cards).
126143 * @alpha
@@ -133,6 +150,7 @@ export const featuredDocsCardWidget = HomePageWidgetBlueprint.make({
133150 components : ( ) =>
134151 import ( '../../components/FeaturedDocsCard' ) . then ( m => ( {
135152 Content : m . FeaturedDocsCard ,
153+ Renderer : legacyHomeCardRenderer ,
136154 } ) ) ,
137155 } ,
138156} ) ;
@@ -172,6 +190,7 @@ export const RecentlyVisitedWidget = HomePageWidgetBlueprint.make({
172190 components : ( ) =>
173191 import ( '@backstage/plugin-home' ) . then ( m => ( {
174192 Content : m . HomePageRecentlyVisited ,
193+ Renderer : legacyHomeCardRenderer ,
175194 } ) ) ,
176195 } ,
177196} ) ;
@@ -187,7 +206,8 @@ export const TopVisitedWidget = HomePageWidgetBlueprint.make({
187206 name : 'Top visited' ,
188207 components : ( ) =>
189208 import ( '@backstage/plugin-home' ) . then ( m => ( {
190- Content : ( ) => < m . HomePageTopVisited /> ,
209+ Content : m . HomePageTopVisited ,
210+ Renderer : legacyHomeCardRenderer ,
191211 } ) ) ,
192212 } ,
193213} ) ;
0 commit comments