refactor(home): rename HomepageWidgetBlueprint to HomePageWidgetBlueprint
Align naming convention with HomePageLayoutBlueprint and the catalog plugin's consistent entity- prefix pattern. Also update the kind string from 'home-widget' to 'home-page-widget' to match 'home-page-layout'. Added interface-level JSDoc to HomePageWidgetBlueprintParams. Signed-off-by: Adam Kunicki <kunickiaj@gmail.com>
This commit is contained in:
@@ -114,17 +114,17 @@ app:
|
||||
|
||||
Homepage widgets are React components that can be added to customizable home pages. The **key difference** between the new frontend system and legacy system is how these widget components are **registered and exported**:
|
||||
|
||||
- **New Frontend System**: Use `HomepageWidgetBlueprint` to register widgets as extensions
|
||||
- **New Frontend System**: Use `HomePageWidgetBlueprint` to register widgets as extensions
|
||||
- **Legacy System**: Use `createCardExtension` to export widgets as card components
|
||||
|
||||
### New Frontend System
|
||||
|
||||
Create widgets using the `HomepageWidgetBlueprint`:
|
||||
Create widgets using the `HomePageWidgetBlueprint`:
|
||||
|
||||
```ts
|
||||
import { HomepageWidgetBlueprint } from '@backstage/plugin-home-react/alpha';
|
||||
import { HomePageWidgetBlueprint } from '@backstage/plugin-home-react/alpha';
|
||||
|
||||
const myWidget = HomepageWidgetBlueprint.make({
|
||||
const myWidget = HomePageWidgetBlueprint.make({
|
||||
name: 'my-widget',
|
||||
params: {
|
||||
name: 'MyWidget',
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
createFrontendModule,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import {
|
||||
HomepageWidgetBlueprint,
|
||||
HomePageWidgetBlueprint,
|
||||
HomePageLayoutBlueprint,
|
||||
} from '@backstage/plugin-home-react/alpha';
|
||||
import { HeaderWorldClock, WelcomeTitle, type ClockConfig } from '../src';
|
||||
@@ -102,7 +102,7 @@ const homePageLayout = HomePageLayoutBlueprint.make({
|
||||
},
|
||||
});
|
||||
|
||||
const homePageToolkitWidget = HomepageWidgetBlueprint.make({
|
||||
const homePageToolkitWidget = HomePageWidgetBlueprint.make({
|
||||
name: 'home-toolkit',
|
||||
params: {
|
||||
name: 'HomePageToolkit',
|
||||
@@ -124,7 +124,7 @@ const homePageToolkitWidget = HomepageWidgetBlueprint.make({
|
||||
},
|
||||
});
|
||||
|
||||
const homePageStarredEntitiesWidget = HomepageWidgetBlueprint.make({
|
||||
const homePageStarredEntitiesWidget = HomePageWidgetBlueprint.make({
|
||||
name: 'home-starred-entities',
|
||||
params: {
|
||||
name: 'HomePageStarredEntities',
|
||||
@@ -136,7 +136,7 @@ const homePageStarredEntitiesWidget = HomepageWidgetBlueprint.make({
|
||||
},
|
||||
});
|
||||
|
||||
const homePageRandomJokeWidget = HomepageWidgetBlueprint.make({
|
||||
const homePageRandomJokeWidget = HomePageWidgetBlueprint.make({
|
||||
name: 'home-random-joke',
|
||||
params: {
|
||||
name: 'HomePageRandomJoke',
|
||||
|
||||
Reference in New Issue
Block a user