[core/AppBuilder] collect list of registered feature flags

This commit is contained in:
Bilawal Hameed
2020-03-26 11:56:37 +01:00
parent 45d7e2736f
commit e6a88a5dc0
+6
View File
@@ -19,6 +19,7 @@ import { Route, Switch, Redirect } from 'react-router-dom';
import { AppContextProvider } from './AppContext';
import { App } from './types';
import BackstagePlugin from '../plugin/Plugin';
import { FeatureFlagName } from '../plugin/Plugin/types';
import {
IconComponent,
SystemIcons,
@@ -62,6 +63,7 @@ export default class AppBuilder {
const app = new AppImpl(this.systemIcons);
const routes = new Array<JSX.Element>();
const registeredFeatureFlags = new Array<{ name: FeatureFlagName }>();
for (const plugin of this.plugins.values()) {
for (const output of plugin.output()) {
@@ -87,6 +89,10 @@ export default class AppBuilder {
);
break;
}
case 'feature-flag': {
registeredFeatureFlags.push({ name: output.name });
break;
}
default:
break;
}