core-api: add app components to app context

This commit is contained in:
Patrik Oldsberg
2021-02-21 22:59:27 +01:00
parent 64f6f5255c
commit 904280dd72
2 changed files with 13 additions and 0 deletions
+8
View File
@@ -153,6 +153,10 @@ class AppContextImpl implements AppContext {
return this.app.getSystemIcon(key);
}
getComponents(): AppComponents {
return this.app.getComponents();
}
getProvider(): React.ComponentType<{}> {
// eslint-disable-next-line no-console
console.warn('appContext.getProvider() is deprecated and will be removed');
@@ -206,6 +210,10 @@ export class PrivateAppImpl implements BackstageApp {
return this.icons[key];
}
getComponents(): AppComponents {
return this.components;
}
getRoutes(): JSX.Element[] {
const routes = new Array<JSX.Element>();
+5
View File
@@ -202,6 +202,11 @@ export type AppContext = {
*/
getSystemIcon(key: IconKey): IconComponent;
/**
* Get the components registered for various purposes in the app.
*/
getComponents(): AppComponents;
/**
* @deprecated Will be removed
*/