mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
use BaseRegistry
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
571694bb8e
commit
0f997094e2
@ -1,4 +1,4 @@
|
||||
import { observable } from "mobx"
|
||||
import { BaseRegistry } from "./base-registry";
|
||||
import { ClusterFeature } from "../cluster-feature";
|
||||
|
||||
export interface ClusterFeatureComponents {
|
||||
@ -11,17 +11,6 @@ export interface ClusterFeatureRegistration {
|
||||
feature: ClusterFeature
|
||||
}
|
||||
|
||||
export class ClusterFeatureRegistry {
|
||||
features = observable.array<ClusterFeatureRegistration>([], { deep: false });
|
||||
|
||||
add(feature: ClusterFeatureRegistration) {
|
||||
this.features.push(feature)
|
||||
return () => {
|
||||
this.features.replace(
|
||||
this.features.filter(f => f !== feature)
|
||||
)
|
||||
};
|
||||
}
|
||||
}
|
||||
export class ClusterFeatureRegistry extends BaseRegistry<ClusterFeatureRegistration> {}
|
||||
|
||||
export const clusterFeatureRegistry = new ClusterFeatureRegistry()
|
||||
|
||||
@ -14,7 +14,7 @@ export class Features extends React.Component<Props> {
|
||||
return (
|
||||
<div>
|
||||
<h2>Features</h2>
|
||||
{ clusterFeatureRegistry.features.map((f) => {
|
||||
{ clusterFeatureRegistry.getItems().map((f) => {
|
||||
return (
|
||||
<InstallFeature cluster={cluster} feature={f.feature}>
|
||||
<>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user