1
0
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:
Jari Kolehmainen 2020-10-26 07:59:49 +02:00
parent 571694bb8e
commit 0f997094e2
2 changed files with 3 additions and 14 deletions

View File

@ -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()

View File

@ -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}>
<>