diff --git a/.changeset/hungry-dogs-agree.md b/.changeset/hungry-dogs-agree.md index 07d7e41483..b111b6e463 100644 --- a/.changeset/hungry-dogs-agree.md +++ b/.changeset/hungry-dogs-agree.md @@ -3,4 +3,4 @@ '@backstage/core-plugin-api': patch --- -Added `getSystemIcons()` function to the `AppManager` that will pull a list of all the icons that have been registered in the App. +Added `getSystemIcons()` function to the `AppContext` available through `useApp` that will pull a list of all the icons that have been registered in the App. diff --git a/packages/core-app-api/api-report.md b/packages/core-app-api/api-report.md index dde4d26364..3cc1f4a8a8 100644 --- a/packages/core-app-api/api-report.md +++ b/packages/core-app-api/api-report.md @@ -157,9 +157,7 @@ export type AppConfigLoader = () => Promise; export type AppContext = { getPlugins(): BackstagePlugin[]; getSystemIcon(key: string): IconComponent | undefined; - getSystemIcons(): AppIcons & { - [key in string]: IconComponent; - }; + getSystemIcons(): Record; getComponents(): AppComponents; }; diff --git a/packages/core-app-api/src/app/AppManager.tsx b/packages/core-app-api/src/app/AppManager.tsx index 41c57afb98..f36d37f796 100644 --- a/packages/core-app-api/src/app/AppManager.tsx +++ b/packages/core-app-api/src/app/AppManager.tsx @@ -71,7 +71,6 @@ import { AppComponents, AppConfigLoader, AppContext, - AppIcons, AppOptions, BackstageApp, SignInPageProps, @@ -154,7 +153,7 @@ class AppContextImpl implements AppContext { return this.app.getSystemIcon(key); } - getSystemIcons(): AppIcons & { [key in string]: IconComponent } { + getSystemIcons(): Record { return this.app.getSystemIcons(); } @@ -199,7 +198,7 @@ export class AppManager implements BackstageApp { return this.icons[key]; } - getSystemIcons(): AppIcons & { [key in string]: IconComponent } { + getSystemIcons(): Record { return this.icons; } diff --git a/packages/core-app-api/src/app/types.ts b/packages/core-app-api/src/app/types.ts index b196e2cf90..39bf9c0554 100644 --- a/packages/core-app-api/src/app/types.ts +++ b/packages/core-app-api/src/app/types.ts @@ -331,7 +331,7 @@ export type AppContext = { /** * Get a list of common and custom icons for this app. */ - getSystemIcons(): AppIcons & { [key in string]: IconComponent }; + getSystemIcons(): Record; /** * Get the components registered for various purposes in the app. diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index facb4235c6..87fc344a02 100644 --- a/packages/core-plugin-api/api-report.md +++ b/packages/core-plugin-api/api-report.md @@ -149,37 +149,10 @@ export type AppComponents = { export type AppContext = { getPlugins(): BackstagePlugin_2[]; getSystemIcon(key: string): IconComponent_2 | undefined; - getSystemIcons(): AppIcons & { - [key in string]: IconComponent_2; - }; + getSystemIcons(): Record; getComponents(): AppComponents; }; -// @public -export type AppIcons = { - 'kind:api': IconComponent_2; - 'kind:component': IconComponent_2; - 'kind:domain': IconComponent_2; - 'kind:group': IconComponent_2; - 'kind:location': IconComponent_2; - 'kind:system': IconComponent_2; - 'kind:user': IconComponent_2; - brokenImage: IconComponent_2; - catalog: IconComponent_2; - chat: IconComponent_2; - dashboard: IconComponent_2; - docs: IconComponent_2; - email: IconComponent_2; - github: IconComponent_2; - group: IconComponent_2; - help: IconComponent_2; - scaffolder: IconComponent_2; - search: IconComponent_2; - techdocs: IconComponent_2; - user: IconComponent_2; - warning: IconComponent_2; -}; - // @public export type AppTheme = { id: string; diff --git a/packages/core-plugin-api/src/app/types.ts b/packages/core-plugin-api/src/app/types.ts index 17623048e2..2a71eda1f4 100644 --- a/packages/core-plugin-api/src/app/types.ts +++ b/packages/core-plugin-api/src/app/types.ts @@ -24,5 +24,4 @@ export type { ErrorBoundaryFallbackProps, AppComponents, AppContext, - AppIcons, } from '../../../core-app-api/src/app/types';