Updates based on initial feedback

Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
This commit is contained in:
Andre Wanlin
2022-08-10 09:07:23 -05:00
parent e87663dfdc
commit f0447ee755
6 changed files with 6 additions and 37 deletions
+1 -1
View File
@@ -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.
+1 -3
View File
@@ -157,9 +157,7 @@ export type AppConfigLoader = () => Promise<AppConfig[]>;
export type AppContext = {
getPlugins(): BackstagePlugin[];
getSystemIcon(key: string): IconComponent | undefined;
getSystemIcons(): AppIcons & {
[key in string]: IconComponent;
};
getSystemIcons(): Record<string, IconComponent>;
getComponents(): AppComponents;
};
+2 -3
View File
@@ -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<string, IconComponent> {
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<string, IconComponent> {
return this.icons;
}
+1 -1
View File
@@ -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<string, IconComponent>;
/**
* Get the components registered for various purposes in the app.
+1 -28
View File
@@ -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<string, IconComponent_2>;
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;
@@ -24,5 +24,4 @@ export type {
ErrorBoundaryFallbackProps,
AppComponents,
AppContext,
AppIcons,
} from '../../../core-app-api/src/app/types';