core-api: add app components to app context
This commit is contained in:
@@ -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>();
|
||||
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user